diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index c28007f884cfa400d19f22764b51a647265e9d8f..0000000000000000000000000000000000000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.ms filter=lfs diff=lfs merge=lfs -text diff --git a/Account/DomainAccount/.gitignore b/Account/DomainAccount/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/Account/DomainAccount/AppScope/app.json5 b/Account/DomainAccount/AppScope/app.json5 deleted file mode 100644 index 2daf34b8353fcfe05098873b7826fd87711e6c4e..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.domainaccount", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/Account/DomainAccount/AppScope/resources/base/element/string.json b/Account/DomainAccount/AppScope/resources/base/element/string.json deleted file mode 100644 index 1cbfc016cbd9684ea1c1bbc44c328dbed4b7e279..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DomainAccount" - } - ] -} diff --git a/Account/DomainAccount/AppScope/resources/base/media/app_icon.png b/Account/DomainAccount/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/Account/DomainAccount/README.md b/Account/DomainAccount/README.md deleted file mode 100644 index 30bf03feddb2ba8e700cfdb6462bbc6103f2aa24..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# DomainAccount - -### 介绍 - -用户可以在系统中添加域账号,后续可以使用该账号登录、使用系统。 - -当需要验证域账号身份(比如屏幕解锁、登录会话失效等场景)时,可以使用系统提供的接口对域账号进行身份认证。 - -OEM厂商可以采用插件方式定制化域账号管理能力,系统提供了域账号插件注册和注销能能力。 - -实现对以下指南文件中[管理域账号](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/account/manage-domain-account.md) [域账号](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/account/auth-domain-account.md) [管理域账号插件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/account/manage-domain-plugin.md) 示例代码片段的工程化。保证指南中示例代码与sample工程文件同源。 - -### 效果预览 - -| 首页 | 域账号插件管理页面 | 注册插件及结果 | -| :----------------------------------------------------------: | :----------------------------------------------------------: | ------------------------------------------------------------ | -| | | | -| 注销插件及结果 | 域账号管理页面 | 判断指定域账号是否存在及结果 | -| | | | -| 添加域账号及结果 | 删除域账号及结果 | 查询域账号信息和认证结果 | -| | | | -| 域账号认证页面 | 使用密码认证域账号及结果 | 弹窗验证域账号及结果 | -| | | | - -### 使用说明 - -1. 在主界面,点击ManageDomainAccountsPlugin,进入域账号插件管理页面。 -2. 点击注册插件按钮,进行插件注册。 -3. 进入管理域账号管理页面。 -4. 点击判断指定域账号是否存在。 -5. 点击添加域账号。 -6. 点击删除域账号。 -7. 点击查询域账号信息。 -8. 进入认证域账号界面。 -9. 点击使用密码认证域账号。 -10. 点击使用弹窗验证域账号。 -11. 回到域账号插件管理页面。 -12. 点击注销插件按钮,进行注销插件。 - -### 工程目录 - -``` -entry/src/ - ├── main - │ ├── ets - │ │ ├── entryability - │ │ ├── entrybackupability - │ │ ├── pages - | | ├──DomainAccount - | | | ├──AuthenticationDomainAccount // 域账号管理示例代码 - | | | ├──ManageDomainAccounts // 域处理示例代码 - | | | └──ManageDomainAccountsPlugin // 域账号插件示例代码 - │ │ ├── Index.ets - │ ├── module.json5 - │ └── resources - ├── ohosTest - │ ├── ets - │ │ ├── test - │ │ ├── Ability.test.ets // 自动化测试代码 -``` - -### 相关权限 - -[ohos.permission.MANAGE_LOCAL_ACCOUNTS](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionmanagelocalaccounts) - -[ohos.permission.GET_DOMAIN_ACCOUNTS](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissiongetdomainaccounts) - -[ohos.permission.ACCESS_USER_AUTH_INTERNAL](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionaccessuserauthinternal) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API14版本full-SDK,版本号:5.0.2.57,镜像版本号:OpenHarmony_5.0.2.58。 - -3.本示例需要使用DevEco Studio 5.0.1 Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/Account/DomainAccount > .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/Account/DomainAccount/build-profile.json5 b/Account/DomainAccount/build-profile.json5 deleted file mode 100644 index a33a4782e91c9280a45ec05115ebd546882ce072..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Account/DomainAccount/code-linter.json5 b/Account/DomainAccount/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/.gitignore b/Account/DomainAccount/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/Account/DomainAccount/entry/build-profile.json5 b/Account/DomainAccount/entry/build-profile.json5 deleted file mode 100644 index b4d65d490ef6cbe22d933b9231555210f1555786..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/hvigorfile.ts b/Account/DomainAccount/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/DomainAccount/entry/obfuscation-rules.txt b/Account/DomainAccount/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/Account/DomainAccount/entry/oh-package.json5 b/Account/DomainAccount/entry/oh-package.json5 deleted file mode 100644 index 4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/DomainAccount/entry/src/main/ets/entryability/EntryAbility.ets b/Account/DomainAccount/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 3e77e4b9f7946d80aa77e6b2dcfe40b23ccf6178..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Account/DomainAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1504a74f09dfdcfae408be979f99369a2c5affab..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/DomainAccount/entry/src/main/ets/pages/DomainAccount/AuthenticationDomainAccount.ets b/Account/DomainAccount/entry/src/main/ets/pages/DomainAccount/AuthenticationDomainAccount.ets deleted file mode 100644 index 18ed52c2cecc5624ff0b214e16df0ea23cb9f3ea..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/ets/pages/DomainAccount/AuthenticationDomainAccount.ets +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_the_system_account_module] -import { osAccount, BusinessError } from '@kit.BasicServicesKit'; -// [End import_the_system_account_module] -import { router } from '@kit.ArkUI'; - -@Entry -@Component -struct AuthenticationDomainAccount { - @State message: string = 'No Message'; - - private async passwordAuthenticateDomainAccount(): Promise { - // [Start get_user_input] - let domainAccountInfo: osAccount.DomainAccountInfo = { - domain: 'CHINA', - accountName: 'zhangsan' - }; - let credential: Uint8Array = new Uint8Array([0]); - // [End get_user_input] - // [Start define_the_callback_for_the_authentication_result] - let callback: osAccount.IUserAuthCallback = { - onResult: (resultCode: number, authResult: osAccount.AuthResult) => { - console.info('auth resultCode = ' + resultCode); - console.info('auth authResult = ' + JSON.stringify(authResult)); - // [StartExclude define_the_callback_for_the_authentication_result] - if(resultCode == 0) { - this.message = 'Successfully authenticated domain account using password'; - } else { - this.message = 'Failed to authenticate domain account using password: ' + resultCode; - } - // [EndExclude define_the_callback_for_the_authentication_result] - - } - }; - // [End define_the_callback_for_the_authentication_result] - // [Start perform_password_authentication] - try { - osAccount.DomainAccountManager.auth(domainAccountInfo, credential, callback); - } catch (e) { - const err = e as BusinessError; - console.error(`auth exception = ${err.message}`); - } - // [End perform_password_authentication] - } - - private async popupAuthenticateDomainAccount(): Promise { - // [Start define_the_callback_object_of_the_authentication_result] - let callback: osAccount.IUserAuthCallback = { - onResult: (resultCode: number, authResult: osAccount.AuthResult) => { - console.info('authWithPopup resultCode = ' + resultCode); - console.info('authWithPopup authResult = ' + JSON.stringify(authResult)); - // [StartExclude define_the_callback_object_of_the_authentication_result] - if(resultCode == 0) { - this.message = 'Successfully authenticated domain account using popup'; - } else if(resultCode == 12300003) { - this.message = 'No domain account is bound'; - } else { - this.message = 'Failed to authenticate domain account using popup: ' + resultCode; - } - // [EndExclude define_the_callback_object_of_the_authentication_result] - } - } - // [End define_the_callback_object_of_the_authentication_result] - // [Start call_operation_to_authenticate_the_current_domain_account] - try { - osAccount.DomainAccountManager.authWithPopup(callback) - } catch (e) { - const err = e as BusinessError; - console.error(`authWithPopup exception = ${err.message}`); - // [StartExclude call_operation_to_authenticate_the_current_domain_account] - this.message = 'Exception occurred during popup authentication: ' + JSON.stringify(err); - // [EndExclude call_operation_to_authenticate_the_current_domain_account] - } - // [End call_operation_to_authenticate_the_current_domain_account] - } - - build() { - Column() { - Text(this.message) - .id('show') - .fontSize(36) - .fontWeight(FontWeight.Bold) - Button($r('app.string.Domain1')) - .margin(10) - .id('button1') - .onClick(() => this.passwordAuthenticateDomainAccount()) - Button($r('app.string.Domain2')) - .margin(10) - .id('button2') - .onClick(() => this.popupAuthenticateDomainAccount()) - Button('Go to plugin') - .margin(10) - .id('button3') - .onClick(() => { - router.pushUrl({ - url: 'pages/DomainAccount/ManageDomainAccountsPlugin' - }) - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/ets/pages/DomainAccount/ManageDomainAccounts.ets b/Account/DomainAccount/entry/src/main/ets/pages/DomainAccount/ManageDomainAccounts.ets deleted file mode 100644 index fb2edc6145a60fa69f1c2f5fc9af92ed72cfd542..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/ets/pages/DomainAccount/ManageDomainAccounts.ets +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_the_system_account_module] -import { osAccount, BusinessError } from '@kit.BasicServicesKit'; -// [End import_the_system_account_module] -import { router } from '@kit.ArkUI'; - -// [Start obtain_the_system_account_management_object] -let osAccountMgr = osAccount.getAccountManager(); -// [End obtain_the_system_account_management_object] - -@Entry -@Component -struct ManageDomainAccounts { - @State message: string = 'Hello World'; - - private async domainAccountExists(): Promise { - // [Start define_the_domain_account_information_to_be_determined] - let domainAccountInfo: osAccount.DomainAccountInfo = { - accountName: 'testAccountName', - domain: 'testDomain' - } - // [End define_the_domain_account_information_to_be_determined] - - // [Start call_the_hasaccount_operation] - osAccount.DomainAccountManager.hasAccount(domainAccountInfo).then((isAccountExisted: boolean)=>{ - console.info('execute hasAccount successfully, isAccountExisted:' + JSON.stringify(isAccountExisted)); - // [StartExclude call_the_hasaccount_operation] - if(isAccountExisted) { - this.message = 'Domain account already exists'; - } else { - this.message = 'Domain account does not exist'; - } - // [EndExclude call_the_hasaccount_operation] - }).catch((err: BusinessError)=>{ - console.error(`execute hasAccount code is ${err.code}, message is ${err.message}`); - }); - // [End call_the_hasaccount_operation] - } - - private async createDomainAccount(): Promise { - // [Start define_the_domain_account_information] - let domainInfo: osAccount.DomainAccountInfo = { - domain: 'testDomain', - accountName: 'testAccountName' - }; - // [End define_the_domain_account_information] - - // [Start create_a_domain_account] - try { - osAccountMgr.createOsAccountForDomain(osAccount.OsAccountType.NORMAL, domainInfo, - (err: BusinessError, osAccountInfo: osAccount.OsAccountInfo)=>{ - console.error(`createOsAccountForDomain exception: code is ${err.code}, message is ${err.message}`); - console.info('createOsAccountForDomain osAccountInfo:' + JSON.stringify(osAccountInfo)); - // [StartExclude create_a_domain_account] - this.message = 'Account creation information: ' + JSON.stringify(osAccountInfo.localName); - // [EndExclude create_a_domain_account] - }); - } catch (e) { - const err = e as BusinessError; - console.error(`createOsAccountForDomain exception: code is ${e.code}, message is ${e.message}`); - // [StartExclude create_a_domain_account] - this.message = 'Account creation failed: ' + JSON.stringify(e); - // [EndExclude create_a_domain_account] - } - // [End create_a_domain_account] - } - - private async deleteDomainAccount(): Promise { - // [Start obtain_the_system_account_id_based_on_the_domain_account_information] - let domainInfo: osAccount.DomainAccountInfo = { - domain: 'testDomain', - accountName: 'testAccountName' - }; - let localId: number = 0; - try { - localId = await osAccountMgr.getOsAccountLocalIdForDomain(domainInfo); - } catch (e) { - const err = e as BusinessError; - console.error(`getOsAccountLocalIdForDomain exception: code is ${err.code}, message is ${err.message}`); - // [StartExclude obtain_the_system_account_id_based_on_the_domain_account_information] - this.message = 'Failed to get account deletion information: ' + JSON.stringify(err); - // [EndExclude obtain_the_system_account_id_based_on_the_domain_account_information] - } - // [End obtain_the_system_account_id_based_on_the_domain_account_information] - // [Start delete_the_domain_account] - try { - osAccountMgr.removeOsAccount(localId, (err: BusinessError)=>{ - if (err) { - console.error(`removeOsAccount failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude delete_the_domain_account] - this.message = 'Failed to delete account: ' + JSON.stringify(err); - // [EndExclude delete_the_domain_account] - } else { - console.info('removeOsAccount successfully'); - // [StartExclude delete_the_domain_account] - this.message = 'Successfully deleted account'; - // [EndExclude delete_the_domain_account] - } - }); - } catch (e) { - const err = e as BusinessError; - console.error(`removeOsAccount exception: code is ${err.code}, message is ${err.message}`); - } - // [End delete_the_domain_account] - - } - - private async queryDomainAccount(): Promise { - // [Start define_query_options] - let options: osAccount.GetDomainAccountInfoOptions = { - domain: 'testDomain', - accountName: 'testAccountName' - } - // [End define_query_options] - // [Start query_the_domain_account_information] - try { - osAccount.DomainAccountManager.getAccountInfo(options, - (err: BusinessError, result: osAccount.DomainAccountInfo) => { - if (err) { - console.error(`call getAccountInfo failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude query_the_domain_account_information] - this.message = 'Query failed: ' + JSON.stringify(err); - // [EndExclude query_the_domain_account_information] - } else { - console.info('getAccountInfo result: ' + result); - // [StartExclude query_the_domain_account_information] - this.message = 'Queried account information: ' + JSON.stringify(result.accountName); - // [EndExclude query_the_domain_account_information] - } - }); - } catch (e) { - const err = e as BusinessError; - console.error(`getAccountInfo exception = code is ${err.code}, message is ${err.message}`); - // [StartExclude query_the_domain_account_information] - this.message = 'Failed to query account information: ' + JSON.stringify(err); - // [EndExclude query_the_domain_account_information] - } - // [End query_the_domain_account_information] - } - - build() { - Column() { - Text(this.message) - .id('show') - .fontSize(36) - .fontWeight(FontWeight.Bold) - Button($r('app.string.Domain5')) - .margin(10) - .id('button1') - .onClick(() => this.domainAccountExists()) - Button($r('app.string.Domain6')) - .margin(10) - .id('button2') - .onClick(() => this.createDomainAccount()) - Button($r('app.string.Domain7')) - .margin(10) - .id('button3') - .onClick(() => this.deleteDomainAccount()) - Button($r('app.string.Domain8')) - .margin(10) - .id('button4') - .onClick(() => this.queryDomainAccount()) - Button('Go to AuthenticationDomainAccount') - .margin(10) - .id('button5') - .onClick(() => { - router.pushUrl({ - url: 'pages/DomainAccount/AuthenticationDomainAccount' - }) - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/ets/pages/DomainAccount/ManageDomainAccountsPlugin.ets b/Account/DomainAccount/entry/src/main/ets/pages/DomainAccount/ManageDomainAccountsPlugin.ets deleted file mode 100644 index 54ff5cdc92de8a88043491a5c3cc75ea54730f53..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/ets/pages/DomainAccount/ManageDomainAccountsPlugin.ets +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_the_system_account_module] -import { osAccount, AsyncCallback, BusinessError } from '@kit.BasicServicesKit'; -// [End import_the_system_account_module] -import { router } from '@kit.ArkUI'; - -// [Start define_the_plug_in] -let plugin: osAccount.DomainPlugin = { - auth: (domainAccountInfo: osAccount.DomainAccountInfo, credential: Uint8Array, - callback: osAccount.IUserAuthCallback) => { - console.info('plugin auth domain' + domainAccountInfo.domain); - console.info('plugin auth accountName' + domainAccountInfo.accountName); - console.info('plugin auth accountId' + domainAccountInfo.accountId); - - let result: osAccount.AuthResult = { - token: new Uint8Array([0]), - remainTimes: 5, - freezingTime: 0 - }; - callback.onResult(0, result); - }, - authWithPopup: (domainAccountInfo: osAccount.DomainAccountInfo, - callback: osAccount.IUserAuthCallback) => { - console.info('plugin authWithPopup domain' + domainAccountInfo.domain); - console.info('plugin authWithPopup accountName' + domainAccountInfo.accountName); - console.info('plugin authWithPopup accountId' + domainAccountInfo.accountId); - - let result: osAccount.AuthResult = { - token: new Uint8Array([0]), - remainTimes: 5, - freezingTime: 0 - }; - callback.onResult(0, result); - }, - authWithToken: (domainAccountInfo: osAccount.DomainAccountInfo, - token: Uint8Array, callback: osAccount.IUserAuthCallback) => { - console.info('plugin authWithToken domain' + domainAccountInfo.domain); - console.info('plugin authWithToken accountName' + domainAccountInfo.accountName); - console.info('plugin authWithToken accountId' + domainAccountInfo.accountId); - let result: osAccount.AuthResult = { - token: new Uint8Array([0]), - remainTimes: 5, - freezingTime: 0 - }; - callback.onResult(0, result); - }, - getAccountInfo: (options: osAccount.GetDomainAccountInfoPluginOptions, - callback: AsyncCallback) => { - console.info('plugin getAccountInfo domain'); - let domainAccountId = Date.now().toString(); - let code: BusinessError = { - code: 0, - name: 'mock_name', - message: 'mock_message' - }; - let domainStr: string = ''; - if (options.domain != undefined) { - domainStr = options.domain - } - let accountInfo: osAccount.DomainAccountInfo = { - domain: domainStr, - accountName: options.accountName, - accountId: domainAccountId, - isAuthenticated: false - }; - callback(code, accountInfo); - }, - getAuthStatusInfo: (domainAccountInfo: osAccount.DomainAccountInfo, - callback: AsyncCallback) => { - - console.info('plugin getAuthStatusInfo domain' + domainAccountInfo.domain); - console.info('plugin getAuthStatusInfo accountName' + domainAccountInfo.accountName); - console.info('plugin getAuthStatusInfo accountId' + domainAccountInfo.accountId); - - let code: BusinessError = { - code: 0, - name: 'mock_name', - message: 'mock_message' - }; - let statusInfo: osAccount.AuthStatusInfo = { - remainTimes: 5, - freezingTime: 0 - }; - callback(code, statusInfo); - }, - bindAccount: (domainAccountInfo: osAccount.DomainAccountInfo, localId: number, - callback: AsyncCallback) => { - console.info('plugin bindAccount domain' + domainAccountInfo.domain); - console.info('plugin bindAccount accountName' + domainAccountInfo.accountName); - console.info('plugin bindAccount accountId' + domainAccountInfo.accountId); - let code: BusinessError = { - code: 0, - name: 'mock_name', - message: 'mock_message' - }; - callback(code); - }, - unbindAccount: (domainAccountInfo: osAccount.DomainAccountInfo, callback: AsyncCallback) => { - console.info('plugin unbindAccount domain' + domainAccountInfo.domain); - console.info('plugin unbindAccount accountName' + domainAccountInfo.accountName); - console.info('plugin unbindAccount accountId' + domainAccountInfo.accountId); - }, - isAccountTokenValid: (domainAccountInfo: osAccount.DomainAccountInfo, token: Uint8Array, - callback: AsyncCallback) => { - console.info('plugin isAccountTokenValid domain' + domainAccountInfo.domain); - console.info('plugin isAccountTokenValid accountName' + domainAccountInfo.accountName); - console.info('plugin isAccountTokenValid accountId' + domainAccountInfo.accountId); - let code: BusinessError = { - code: 0, - name: 'mock_name', - message: 'mock_message' - }; - callback(code, true); - }, - getAccessToken: (options: osAccount.GetDomainAccessTokenOptions, callback: AsyncCallback) => { - console.info('plugin getAccessToken domain') - let code: BusinessError = { - code: 0, - name: 'mock_name', - message: 'mock_message' - }; - let token: Uint8Array = new Uint8Array([0]); - callback(code, token); - } -} -// [End define_the_plug_in] - - -@Entry -@Component -struct ManageDomainAccountsPlugin { - @State message: string = 'Manage domain account plugin'; - - private async registrationPlugin(): Promise { - // [Start call_the_api_to_register_the_plug_in] - try { - osAccount.DomainAccountManager.registerPlugin(plugin) - console.info('registerPlugin success'); - // [StartExclude call_the_api_to_register_the_plug_in] - this.message = 'Successfully registered plugin'; - // [EndExclude call_the_api_to_register_the_plug_in] - } catch (e) { - const err = e as BusinessError; - console.error(`registerPlugin err: code is ${err.code}, message is ${err.message}`); - // [StartExclude call_the_api_to_register_the_plug_in] - this.message = 'Failed to register plugin: ' + JSON.stringify(err); - // [EndExclude call_the_api_to_register_the_plug_in] - } - // [End call_the_api_to_register_the_plug_in] - } - - private async logoutPlugin(): Promise { - // [Start call_the_api_to_log_out_the_plug_in] - try { - osAccount.DomainAccountManager.unregisterPlugin(); - console.info('unregisterPlugin success.'); - // [StartExclude call_the_api_to_log_out_the_plug_in] - this.message = 'unregisterPlugin success'; - // [EndExclude call_the_api_to_log_out_the_plug_in] - } catch (e) { - const err = e as BusinessError; - console.error(`unregisterPlugin failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude call_the_api_to_log_out_the_plug_in] - this.message = 'Failed to unregister plugin: ' + JSON.stringify(err); - // [EndExclude call_the_api_to_log_out_the_plug_in] - } - // [End call_the_api_to_log_out_the_plug_in] - } - - build() { - Column() { - Text(this.message) - .id('show') - .fontSize(36) - .fontWeight(FontWeight.Bold) - Button($r('app.string.Domain3')) - .margin(10) - .id('button1') - .onClick(() => this.registrationPlugin()) - Button($r('app.string.Domain4')) - .margin(10) - .id('button2') - .onClick(() => this.logoutPlugin()) - Button('Return back') - .id('button3') - .onClick(() => { - router.pushUrl({ - url: 'pages/DomainAccount/ManageDomainAccounts' - }) - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/ets/pages/Index.ets b/Account/DomainAccount/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 2a207adae204d5245cf80aabcd5bef33581de5b0..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { CommonButton } from '../util/CommonButton'; - -@Entry -@Component -struct Index { - build() { - Scroll() { - Column() { - Text('DomainAccountHome') - .padding('15vp') - .width('100%') - .fontSize('25fp') - .textAlign(TextAlign.Center) - CommonButton({ - buttonName: 'AuthenticationDomainAccount', - buttonUrl: 'pages/DomainAccount/AuthenticationDomainAccount' - }); - CommonButton({ - buttonName: 'ManageDomainAccounts', - buttonUrl: 'pages/DomainAccount/ManageDomainAccounts' - }); - CommonButton({ - buttonName: 'ManageDomainAccountsPlugin', - buttonUrl: 'pages/DomainAccount/ManageDomainAccountsPlugin' - }); - } - .padding('5vp') - .width('100%') - }.margin({ bottom: 60 }) - .width('100%') - } -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/ets/util/CommonButton.ets b/Account/DomainAccount/entry/src/main/ets/util/CommonButton.ets deleted file mode 100644 index b2d268bf3aec25d2dcec35d282290ebc90d9d7d9..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/ets/util/CommonButton.ets +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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 router from '@ohos.router'; - -@Component -export struct CommonButton { - @State buttonName: string = ''; - @State buttonUrl: string = ''; - @State data: string = ''; - - build() { - Text(this.buttonName) - .id(this.buttonName) - .padding(px2vp(5)) - .fontSize(px2fp(24)) - .textAlign(TextAlign.Center) - .backgroundColor(Color.Blue) - .fontColor(Color.White) - .borderRadius(5) - .margin(px2vp(20)) - .padding(px2vp(15)) - .onClick(() => { - router.pushUrl({ - url: this.buttonUrl, - params: { - text: this.data, - buttonName: this.buttonName - } - }) - }) - } -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/module.json5 b/Account/DomainAccount/entry/src/main/module.json5 deleted file mode 100644 index cc58129f9628f1c02fb0227f56c35984903cce07..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/module.json5 +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2025 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", - "requestPermissions": [{ - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name": "ohos.permission.GET_DOMAIN_ACCOUNTS" - }, - { - "name": "ohos.permission.ACCESS_USER_AUTH_INTERNAL" - }], - "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/Account/DomainAccount/entry/src/main/resources/base/element/color.json b/Account/DomainAccount/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/resources/base/element/string.json b/Account/DomainAccount/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 195e14de37503d0215b75d2f13a2ad44804085c7..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DomainAccount" - }, - { - "name": "Domain1", - "value": "Authenticate domain account using password" - }, - { - "name": "Domain2", - "value": "Authenticate domain account using popup" - }, - { - "name": "Domain3", - "value": "Register plugin" - }, - { - "name": "Domain4", - "value": "Unregister plugin" - }, - { - "name": "Domain5", - "value": "Check if the specified domain account exists" - }, - { - "name": "Domain6", - "value": "Add domain account" - }, - { - "name": "Domain7", - "value": "Delete domain account" - }, - { - "name": "Domain8", - "value": "Query domain account information" - } - ] -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/resources/base/media/background.png b/Account/DomainAccount/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Account/DomainAccount/entry/src/main/resources/base/media/foreground.png b/Account/DomainAccount/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Account/DomainAccount/entry/src/main/resources/base/media/layered_image.json b/Account/DomainAccount/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/resources/base/media/startIcon.png b/Account/DomainAccount/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Account/DomainAccount/entry/src/main/resources/base/profile/backup_config.json b/Account/DomainAccount/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/main/resources/base/profile/main_pages.json b/Account/DomainAccount/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index e47a9436e04a20e9f2c2c825ba5c7049a6b0d372..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/DomainAccount/AuthenticationDomainAccount", - "pages/DomainAccount/ManageDomainAccounts", - "pages/DomainAccount/ManageDomainAccountsPlugin" - ] -} diff --git a/Account/DomainAccount/entry/src/main/resources/dark/element/color.json b/Account/DomainAccount/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/mock/mock-config.json5 b/Account/DomainAccount/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/DomainAccount/entry/src/ohosTest/ets/test/Ability.test.ets b/Account/DomainAccount/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 25279cdbcac906d8242ec0a379fe58af536f71f8..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -function sleep(time: number) { - return new Promise((resolve: Function) => setTimeout(resolve, time)); -} -export default function abilityTest() { - describe('DomainAccountAbilityTest', () => { - /* - * 打开应用,依次点击页面中按钮 - * 使用域账号接口功能 - */ - it('DomainAccountsExample', 0, async (done: Function) => { - console.info("uitest: TestUiExample begin"); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - } - await delegator.startAbility(want); - await sleep(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info("get top ability"); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - const driver = Driver.create(); - await driver.delayMs(1000); - - const button1 = await driver.findComponent(ON.text('ManageDomainAccountsPlugin')); - await button1.click(); - await driver.delayMs(1000); - - const button2 = await driver.findComponent(ON.id('button1')); - await button2.click(); - await driver.delayMs(1000); - const text0 = await driver.findComponent(ON.id('show')); - let content0: string = await text0.getText(); - expect(content0).assertEqual('Successfully registered plugin'); - - const button3 = await driver.findComponent(ON.id('button3')); - await button3.click(); - await driver.delayMs(1000); - - const button5 = await driver.findComponent(ON.id('button1')); - await button5.click(); - await driver.delayMs(1000); - const text = await driver.findComponent(ON.id('show')); - let content1: string = await text.getText(); - expect(content1).assertEqual('Domain account already exists'); - - const button6 = await driver.findComponent(ON.id('button2')); - await button6.click(); - await driver.delayMs(10000); - let content2: string = await text.getText(); - expect(content2).assertEqual('Account creation information: "testAccountName"'); - - const button7 = await driver.findComponent(ON.id('button3')); - await button7.click(); - await driver.delayMs(10000); - let content3: string = await text.getText(); - expect(content3).assertEqual('Successfully deleted account'); - - const button8 = await driver.findComponent(ON.id('button4')); - await button8.click(); - await driver.delayMs(1000); - let content4: string = await text.getText(); - expect(content4).assertEqual('Queried account information: "testAccountName"'); - - const button9 = await driver.findComponent(ON.id('button5')); - await button9.click(); - await driver.delayMs(1000); - - const button10 = await driver.findComponent(ON.id('button1')); - await button10.click(); - await driver.delayMs(1000); - const text1 = await driver.findComponent(ON.id('show')); - let content5: string = await text1.getText(); - expect(content5).assertEqual('Successfully authenticated domain account using password'); - - const button11 = await driver.findComponent(ON.id('button2')); - await button11.click(); - await driver.delayMs(10000); - let content6: string = await text1.getText(); - expect(content6).assertEqual('No domain account is bound'); - - const button12 = await driver.findComponent(ON.id('button3')); - await button12.click(); - await driver.delayMs(1000); - - const button13 = await driver.findComponent(ON.id('button2')); - await button13.click(); - await driver.delayMs(1000); - const text2 = await driver.findComponent(ON.id('show')); - let content7: string = await text2.getText(); - expect(content7).assertEqual('unregisterPlugin success'); - done(); - console.info("uitest: TestUiExample end"); - }) - }) -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/ohosTest/ets/test/List.test.ets b/Account/DomainAccount/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/ohosTest/module.json5 b/Account/DomainAccount/entry/src/ohosTest/module.json5 deleted file mode 100644 index 9983b2ba4e55e31a172f0328c82c9a75bfa00ded..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/Account/DomainAccount/entry/src/test/List.test.ets b/Account/DomainAccount/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/Account/DomainAccount/entry/src/test/LocalUnit.test.ets b/Account/DomainAccount/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/Account/DomainAccount/hvigor/hvigor-config.json5 b/Account/DomainAccount/hvigor/hvigor-config.json5 deleted file mode 100644 index cef74543b1f97c82275e4bf3434b162395bff2eb..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/Account/DomainAccount/hvigorfile.ts b/Account/DomainAccount/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/DomainAccount/oh-package.json5 b/Account/DomainAccount/oh-package.json5 deleted file mode 100644 index eaef52736f22c14e04fca386ba01611ab32a7e4a..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Account/DomainAccount/ohosTest.md b/Account/DomainAccount/ohosTest.md deleted file mode 100644 index 3145d43fc6fb2626a0ecb7730c6cc3b3f6bab8ab..0000000000000000000000000000000000000000 --- a/Account/DomainAccount/ohosTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# DomainAccount 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ---------------------- | ----------------------------------------------- | ----------------------------- | --------------------------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 注册插件 | 位于ManageDomainAccountsPlugin页面 | 点击‘Register plugin’ | 页面显示“Successfully registered plugin” | 是 | Pass | -| 注销插件 | 位于ManageDomainAccountsPlugin页面 | 点击‘Register plugin’ | 页面显示“unregisterPlugin success“ | 是 | Pass | -| Check if the specified domain account exists | 位于ManageDomainAccounts页面,已注册插件 | 点击‘ Check if the specified domain account exists’ | 页面显示“Domain account already exists“ | 是 | Pass | -| Add domain account | 位于ManageDomainAccounts页面,已注册插件 | 点击‘Add domain account’ | 页面显示“Account creation information: "testAccountName"“ | 是 | Pass | -| Delete domain account | 位于ManageDomainAccounts页面,已注册插件 | 点击‘Delete domain account’ | 页面显示“Successfully deleted account“ | 是 | Pass | -| Query domain account information | 位于ManageDomainAccounts页面,已注册插件 | 点击‘Query domain account information’ | 页面显示“Queried account information: "testAccountName"“ | 是 | Pass | -| Authenticate domain account using password | 位于AuthenticationDomainAccount页面,已注册插件 | 点击‘使用密码进行认证’ | 页面显示“Successfully authenticated domain account using password“ | 是 | Pass | -| Authenticate domain account using popup | 位于AuthenticationDomainAccount页面,已注册插件 | 点击‘Authenticate domain account using popup’ | 页面显示"No domain account is bound" | 是 | Pass | \ No newline at end of file diff --git a/Account/DomainAccount/screenshots/DomainAccount_1.png b/Account/DomainAccount/screenshots/DomainAccount_1.png deleted file mode 100644 index cfd2e01bbc1b4122f2bc5479238d691c8673115e..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_1.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_10.png b/Account/DomainAccount/screenshots/DomainAccount_10.png deleted file mode 100644 index 31c95223b1684e300cd35310cfe1c22cafbb980e..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_10.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_11.png b/Account/DomainAccount/screenshots/DomainAccount_11.png deleted file mode 100644 index 9974b35442f9b7520afb0a83a494ea3af0773e6f..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_11.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_12.png b/Account/DomainAccount/screenshots/DomainAccount_12.png deleted file mode 100644 index 8bc5178f742f2bd95f690ca1c31e4edc2b69e113..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_12.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_2.png b/Account/DomainAccount/screenshots/DomainAccount_2.png deleted file mode 100644 index dc15152d5840f7c70fc56ddd75e6b16791e154f9..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_2.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_3.png b/Account/DomainAccount/screenshots/DomainAccount_3.png deleted file mode 100644 index 1ed3f8e478479524fca7c47b0efb3be7c04c39ee..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_3.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_4.png b/Account/DomainAccount/screenshots/DomainAccount_4.png deleted file mode 100644 index 74a8cba911568d6a44eded3ca078fd7863a4ded2..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_4.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_5.png b/Account/DomainAccount/screenshots/DomainAccount_5.png deleted file mode 100644 index 2fac836435d2f5dabd4b4610f81f32a017511d61..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_5.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_6.png b/Account/DomainAccount/screenshots/DomainAccount_6.png deleted file mode 100644 index 9724d16af1c3dab011b73cdc353682ad9a7e1be2..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_6.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_7.png b/Account/DomainAccount/screenshots/DomainAccount_7.png deleted file mode 100644 index fe58ce1397f4ec097f487a98f369408a3c576ff7..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_7.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_8.png b/Account/DomainAccount/screenshots/DomainAccount_8.png deleted file mode 100644 index bd5431a1fa936b673a520a25067af24bfd084e00..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_8.png and /dev/null differ diff --git a/Account/DomainAccount/screenshots/DomainAccount_9.png b/Account/DomainAccount/screenshots/DomainAccount_9.png deleted file mode 100644 index 7897af572765f17884b765aa06f983a5773d99de..0000000000000000000000000000000000000000 Binary files a/Account/DomainAccount/screenshots/DomainAccount_9.png and /dev/null differ diff --git a/Account/ManageDistributedAccount/.gitignore b/Account/ManageDistributedAccount/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/Account/ManageDistributedAccount/AppScope/app.json5 b/Account/ManageDistributedAccount/AppScope/app.json5 deleted file mode 100644 index d6cb5185f09411c25d82165401b5cc82b134a637..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.managedistributedaccount", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/Account/ManageDistributedAccount/AppScope/resources/base/element/string.json b/Account/ManageDistributedAccount/AppScope/resources/base/element/string.json deleted file mode 100644 index 975d8e8814253333cdc926c9c61809fb63ef2808..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ManageDistributedAccount" - } - ] -} diff --git a/Account/ManageDistributedAccount/AppScope/resources/base/media/app_icon.png b/Account/ManageDistributedAccount/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/Account/ManageDistributedAccount/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/Account/ManageDistributedAccount/README.md b/Account/ManageDistributedAccount/README.md deleted file mode 100644 index 1b2394ac51a0088d138c05654109e8ac6979f392..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# 管理分布式账号(仅对系统应用开放) - -### 介绍 - -1.OEM厂商可以通过[分布式账号SDK](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-distributed-account.md)将自有账号与本地系统账号建立关联关系。 - -2.实现对以下指南文档中 [管理分布式账号](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/account/manage-distributed-account.md) 示例代码片段的工程化,保证指南中示例代码与sample工程文件同源。 - -### 效果预览 - -| 首页 | 执行Log in and bind distributed account on the current system account | -| :----------------------------------------------------------: | :----------------------------------------------------------: | -| | | -| **执行Log out and unbind distributed account on the current system account** | **执行Log in and bind distributed account on the specified system account** | -| | | -| **执行Log out and unbind distributed account on the specified system account** | | -| | | - -### 使用说明 - -1. 在主界面,点击'Log in and bind distributed account on the current system account',执行Log in and bind distributed account on the current system account。 -2. 点击'Log out and unbind distributed account on the current system account',执行Log out and unbind distributed account on the current system account。 -3. 点击'Log in and bind distributed account on the specified system account',执行Log in and bind distributed account on the specified system account。 -4. 点击'Log out and unbind distributed account on the specified system account',执行Log out and unbind distributed account on the specified system account。 -5. 执行结果会即时反馈在屏幕中央,并在控制台打印log。 - -### 工程目录 - -``` -entry/src/ - ├── main - │ ├── ets - │ │ ├── entryability - │ │ ├── entrybackupability - │ │ └── pages - │ │ └── Index.ets // 管理分布式账号示例代码 - │ ├── module.json5 - │ └── resources - ├── ohosTest - │ ├── ets - │ │ └── test - │ │ └── Ability.test.ets // 自动化测试代码 -``` - -### 相关权限 - -[ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionmanagedistributedaccounts) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API14版本full-SDK,版本号:5.0.2.57,镜像版本号:OpenHarmony_5.0.2.58。 - -3.本示例需要使用DevEco Studio 5.0.1 Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/Account/ManageDistributedAccount > .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/Account/ManageDistributedAccount/build-profile.json5 b/Account/ManageDistributedAccount/build-profile.json5 deleted file mode 100644 index 3c1dc3a4c625f2ec0629fbb2c33a841fa39111e6..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageDistributedAccount/code-linter.json5 b/Account/ManageDistributedAccount/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/.gitignore b/Account/ManageDistributedAccount/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/build-profile.json5 b/Account/ManageDistributedAccount/entry/build-profile.json5 deleted file mode 100644 index b4d65d490ef6cbe22d933b9231555210f1555786..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/hvigorfile.ts b/Account/ManageDistributedAccount/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageDistributedAccount/entry/obfuscation-rules.txt b/Account/ManageDistributedAccount/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/Account/ManageDistributedAccount/entry/oh-package.json5 b/Account/ManageDistributedAccount/entry/oh-package.json5 deleted file mode 100644 index 4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageDistributedAccount/entry/src/main/ets/entryability/EntryAbility.ets b/Account/ManageDistributedAccount/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 3e77e4b9f7946d80aa77e6b2dcfe40b23ccf6178..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Account/ManageDistributedAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1504a74f09dfdcfae408be979f99369a2c5affab..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageDistributedAccount/entry/src/main/ets/pages/Index.ets b/Account/ManageDistributedAccount/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f3a44f5093a99ccf5b6833db9623f58ccb0537f..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_the_distributed_account_module] -import { distributedAccount, BusinessError } from '@kit.BasicServicesKit'; -// [End import_the_distributed_account_module] - -// [Start obtain_the_single-instance_object_of_the_distributed_account] -const distributedAccountAbility = distributedAccount.getDistributedAccountAbility(); -// [End obtain_the_single-instance_object_of_the_distributed_account] - -@Entry -@Component -struct Index { - @State message: string = 'No Name'; - - private async bindCurrentManageDistributedAccounts(): Promise { - // [Start define_the_distributed_account_information_to_be_logged_in] - let distributedInfo: distributedAccount.DistributedInfo = { - name: 'ZhangSan', - id: '12345', - event: 'Ohos.account.event.LOGIN', - }; - // [End define_the_distributed_account_information_to_be_logged_in] - - // [Start bind_the_current_system_account_to_the_specified_distributed_account] - await distributedAccountAbility.setOsAccountDistributedInfo(distributedInfo).then(() => { - console.info('setOsAccountDistributedInfo successfully'); - }).catch((err: BusinessError) => { - console.error(`setOsAccountDistributedInfo exception: code is ${err.code}, message is ${err.message}`); - // [StartExclude bind_the_current_system_account_to_the_specified_distributed_account] - this.message = 'Failed to bind distributed account: ' + JSON.stringify(err); - // [EndExclude bind_the_current_system_account_to_the_specified_distributed_account] - }); - // [End bind_the_current_system_account_to_the_specified_distributed_account] - - // [Start view_the_login_information_of_distributed_account] - distributedAccountAbility.getOsAccountDistributedInfo().then((data: distributedAccount.DistributedInfo) => { - console.info('distributed information: ' + JSON.stringify(data)); - // [StartExclude view_the_login_information_of_distributed_account] - this.message = 'Bind distributed account: ' + data.name; - // [EndExclude view_the_login_information_of_distributed_account] - }).catch((err: BusinessError) => { - console.error(`getOsAccountDistributedInfo exception: code is ${err.code}, message is ${err.message}`); - // [StartExclude view_the_login_information_of_distributed_account] - this.message = 'Failed to get distributed account: ' + JSON.stringify(err); - // [EndExclude view_the_login_information_of_distributed_account] - }); - // [End view_the_login_information_of_distributed_account] - } - - private async unbindCurrentManageDistributedAccounts(): Promise { - // [Start define_the_distributed_account_information_to_be_logged_out] - let distributedInfo: distributedAccount.DistributedInfo = { - name: 'ZhangSan', - id: '12345', - event: 'Ohos.account.event.LOGOUT', - }; - // [End define_the_distributed_account_information_to_be_logged_out] - - // [Start unbind_the_specified_distributed_account_from_the_current_system_account] - distributedAccountAbility.setOsAccountDistributedInfo(distributedInfo).then(() => { - console.info('setOsAccountDistributedInfo successfully'); - // [StartExclude unbind_the_specified_distributed_account_from_the_current_system_account] - this.message = 'Successfully unbound distributed account' - // [EndExclude unbind_the_specified_distributed_account_from_the_current_system_account] - }).catch((err: BusinessError) => { - console.error(`setOsAccountDistributedInfo exception: code is ${err.code}, message is ${err.message}`); - // [StartExclude unbind_the_specified_distributed_account_from_the_current_system_account] - this.message = 'Failed to unbind distributed account' - // [EndExclude unbind_the_specified_distributed_account_from_the_current_system_account] - }); - // [End unbind_the_specified_distributed_account_from_the_current_system_account] - } - - private async bindSpecifyManageDistributedAccounts(): Promise { - // [Start determine_the_target_system_account_and_define_the_distributed_account_information_to_be_logged_in] - let localId: number = 100; - let distributedInfo: distributedAccount.DistributedInfo = { - name: 'ZhangSan', - id: '12345', - event: 'Ohos.account.event.LOGIN', - }; - // [End determine_the_target_system_account_and_define_the_distributed_account_information_to_be_logged_in] - - // [Start bind_the_specified_distributed_account_to_the_current_system_account] - await distributedAccountAbility.setOsAccountDistributedInfoByLocalId(localId, distributedInfo).then(() => { - console.info('setOsAccountDistributedInfoByLocalId successfully'); - }).catch((err: BusinessError) => { - console.error(`setOsAccountDistributedInfoByLocalId exception: code is ${err.code}, message is ${err.message}`); - // [StartExclude bind_the_specified_distributed_account_to_the_current_system_account] - this.message = 'Failed to bind distributed account on the specified system account: ' + JSON.stringify(err); - // [EndExclude bind_the_specified_distributed_account_to_the_current_system_account] - }); - // [End bind_the_specified_distributed_account_to_the_current_system_account] - - // [Start view_the_login_information_of_a_distributed_account] - distributedAccountAbility.getOsAccountDistributedInfoByLocalId(localId) - .then((data: distributedAccount.DistributedInfo) => { - console.info('distributed information: ' + JSON.stringify(data)); - // [StartExclude view_the_login_information_of_a_distributed_account] - this.message = 'Bind distributed account on the specified system account: ' + data.name; - // [EndExclude view_the_login_information_of_a_distributed_account] - }).catch((err: BusinessError) => { - console.error(`getOsAccountDistributedInfoByLocalId exception: code is ${err.code}, message is ${err.message}`); - // [StartExclude view_the_login_information_of_a_distributed_account] - this.message = 'Failed to get distributed account on the specified system account: ' + JSON.stringify(err); - // [EndExclude view_the_login_information_of_a_distributed_account] - }); - // [End view_the_login_information_of_a_distributed_account] - } - - private async unbindSpecifyManageDistributedAccounts(): Promise { - // [Start determine_the_target_system_account_and_define_the_distributed_account_information_to_be_logged_out] - let localId: number = 100; - let distributedInfo: distributedAccount.DistributedInfo = { - name: 'ZhangSan', - id: '12345', - event: 'Ohos.account.event.LOGOUT', - }; - // [End determine_the_target_system_account_and_define_the_distributed_account_information_to_be_logged_out] - - // [Start unbind_the_specified_distributed_account_from_the_target_system_account] - distributedAccountAbility.setOsAccountDistributedInfoByLocalId(localId, distributedInfo).then(() => { - console.info('setOsAccountDistributedInfoByLocalId successfully'); - // [StartExclude unbind_the_specified_distributed_account_from_the_target_system_account] - this.message = 'Successfully logged out and unbound distributed account on the specified system account' - // [EndExclude unbind_the_specified_distributed_account_from_the_target_system_account] - }).catch((err: BusinessError) => { - console.error(`setOsAccountDistributedInfoByLocalId exception: code is ${err.code}, message is ${err.message}`); - // [StartExclude unbind_the_specified_distributed_account_from_the_target_system_account] - this.message = 'Failed to log out and unbind distributed account on the specified system account' - // [EndExclude unbind_the_specified_distributed_account_from_the_target_system_account] - }); - // [End unbind_the_specified_distributed_account_from_the_target_system_account] - } - - build() { - Column() { - Text(this.message) - .id('show') - .fontSize(36) - .fontWeight(FontWeight.Bold) - Button($r('app.string.DistributedAccount1')) - .margin(10) - .id('button1') - .onClick(() => this.bindCurrentManageDistributedAccounts()) - Button($r('app.string.DistributedAccount2')) - .margin(10) - .id('button2') - .onClick(() => this.unbindCurrentManageDistributedAccounts()) - Button($r('app.string.DistributedAccount3')) - .margin(10) - .id('button3') - .onClick(() => this.bindSpecifyManageDistributedAccounts()) - Button($r('app.string.DistributedAccount4')) - .margin(10) - .id('button4') - .onClick(() => this.unbindSpecifyManageDistributedAccounts()) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/main/module.json5 b/Account/ManageDistributedAccount/entry/src/main/module.json5 deleted file mode 100644 index b5fe5daf759281fbe99c6f486651cf9e361585fa..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/module.json5 +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 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", - "requestPermissions": [{ - "name": "ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS" - }], - "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/Account/ManageDistributedAccount/entry/src/main/resources/base/element/color.json b/Account/ManageDistributedAccount/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/main/resources/base/element/string.json b/Account/ManageDistributedAccount/entry/src/main/resources/base/element/string.json deleted file mode 100644 index fd8ed54be3d64ad16b0c9fa46bfb2c3294b569a0..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "DistributedAccount1", - "value": "Log in and bind distributed account on the current system account" - }, - { - "name": "DistributedAccount2", - "value": "Log out and unbind distributed account on the current system account" - }, - { - "name": "DistributedAccount3", - "value": "Log in and bind distributed account on the specified system account" - }, - { - "name": "DistributedAccount4", - "value": "Log out and unbind distributed account on the specified system account" - } - ] -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/main/resources/base/media/background.png b/Account/ManageDistributedAccount/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Account/ManageDistributedAccount/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Account/ManageDistributedAccount/entry/src/main/resources/base/media/foreground.png b/Account/ManageDistributedAccount/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Account/ManageDistributedAccount/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Account/ManageDistributedAccount/entry/src/main/resources/base/media/layered_image.json b/Account/ManageDistributedAccount/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/main/resources/base/media/startIcon.png b/Account/ManageDistributedAccount/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Account/ManageDistributedAccount/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Account/ManageDistributedAccount/entry/src/main/resources/base/profile/backup_config.json b/Account/ManageDistributedAccount/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/main/resources/base/profile/main_pages.json b/Account/ManageDistributedAccount/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/Account/ManageDistributedAccount/entry/src/main/resources/dark/element/color.json b/Account/ManageDistributedAccount/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/mock/mock-config.json5 b/Account/ManageDistributedAccount/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageDistributedAccount/entry/src/ohosTest/ets/test/Ability.test.ets b/Account/ManageDistributedAccount/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 915855c45b514631b0cd26fd559926b27919fd55..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -function sleep(time: number) { - return new Promise((resolve: Function) => setTimeout(resolve, time)); -} -export default function abilityTest() { - describe('DistributedAccountsTest', () => { - /* - * 打开应用,依次点击页面中按钮 - * 使用分布式账号接口功能 - */ - it('distributedAccountsExample', 0, async (done: Function) => { - console.info("uitest: TestUiExample begin"); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - } - await delegator.startAbility(want); - await sleep(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info("get top ability"); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - const driver = Driver.create(); - await driver.delayMs(1000); - - const button1 = await driver.findComponent(ON.id('button1')); - await button1.click(); - await driver.delayMs(1000); - const text = await driver.findComponent(ON.id('show')); - let content1: string = await text.getText(); - expect(content1).assertEqual('Bind distributed account: ZhangSan'); - - const button2 = await driver.findComponent(ON.id('button2')); - await button2.click(); - await driver.delayMs(1000); - let content2: string = await text.getText(); - expect(content2).assertEqual('Successfully unbound distributed account'); - - const button3 = await driver.findComponent(ON.id('button3')); - await button3.click(); - await driver.delayMs(1000); - let content3: string = await text.getText(); - expect(content3).assertEqual('Bind distributed account on the specified system account: ZhangSan'); - - const button4 = await driver.findComponent(ON.id('button4')); - await button4.click(); - await driver.delayMs(1000); - let content4: string = await text.getText(); - expect(content4) - .assertEqual('Successfully logged out and unbound distributed account on the specified system account'); - done(); - console.info("uitest: TestUiExample end"); - }) - }) -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/ohosTest/ets/test/List.test.ets b/Account/ManageDistributedAccount/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/ohosTest/module.json5 b/Account/ManageDistributedAccount/entry/src/ohosTest/module.json5 deleted file mode 100644 index 9983b2ba4e55e31a172f0328c82c9a75bfa00ded..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/Account/ManageDistributedAccount/entry/src/test/List.test.ets b/Account/ManageDistributedAccount/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/entry/src/test/LocalUnit.test.ets b/Account/ManageDistributedAccount/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/Account/ManageDistributedAccount/hvigor/hvigor-config.json5 b/Account/ManageDistributedAccount/hvigor/hvigor-config.json5 deleted file mode 100644 index cef74543b1f97c82275e4bf3434b162395bff2eb..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/Account/ManageDistributedAccount/hvigorfile.ts b/Account/ManageDistributedAccount/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageDistributedAccount/oh-package.json5 b/Account/ManageDistributedAccount/oh-package.json5 deleted file mode 100644 index eaef52736f22c14e04fca386ba01611ab32a7e4a..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Account/ManageDistributedAccount/ohosTest.md b/Account/ManageDistributedAccount/ohosTest.md deleted file mode 100644 index 6a829ef97b3f8ea0e27a48a09dcfe95d56207b8f..0000000000000000000000000000000000000000 --- a/Account/ManageDistributedAccount/ohosTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# ManageDistributedAccount 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------------------------------ | ------------ | ------------------------------------------ | -------------------------------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| Log in and bind distributed account on the current system account | 位于首页 | 点击'Log in and bind distributed account on the current system account' | 页面显示'Bind distributed account: ZhangSan' | 是 | Pass | -| Log out and unbind distributed account on the current system account | 位于首页 | 点击'Log out and unbind distributed account on the current system account' | 页面显示'Successfully unbound distributed account' | 是 | Pass | -| Log in and bind distributed account on the specified system account | 位于首页 | 点击'Log in and bind distributed account on the specified system account' | 页面显示'指定的系统账号上Bind distributed account: ZhangSan' | 是 | Pass | -| Log out and unbind distributed account on the specified system account | 位于首页 | 点击'Log out and unbind distributed account on the specified system account' | 页面显示'指定系统账号上登出Successfully unbound distributed account' | 是 | Pass | \ No newline at end of file diff --git a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_1.png b/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_1.png deleted file mode 100644 index 468804a9bded5cd7abfc0e5d8f1b686cea9a281c..0000000000000000000000000000000000000000 Binary files a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_1.png and /dev/null differ diff --git a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_2.png b/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_2.png deleted file mode 100644 index 285dc2044b277e98fab204c5e8d23005a6d6615b..0000000000000000000000000000000000000000 Binary files a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_2.png and /dev/null differ diff --git a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_3.png b/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_3.png deleted file mode 100644 index 51f9f245174a540e6136017ec679ac26809509d1..0000000000000000000000000000000000000000 Binary files a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_3.png and /dev/null differ diff --git a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_4.png b/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_4.png deleted file mode 100644 index 83e36c3fa8715332a9057754727a7c6762ac1844..0000000000000000000000000000000000000000 Binary files a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_4.png and /dev/null differ diff --git a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_5.png b/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_5.png deleted file mode 100644 index be827dc3a026b33836334a927c9853240489a4f2..0000000000000000000000000000000000000000 Binary files a/Account/ManageDistributedAccount/screenshots/ManageDistributedAccount_5.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/.gitignore b/Account/ManageSystemAccountCredentials/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/Account/ManageSystemAccountCredentials/AppScope/app.json5 b/Account/ManageSystemAccountCredentials/AppScope/app.json5 deleted file mode 100644 index d3142d219c5e3f970aada650575ba0d522c8f662..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.managesystemaccountcredentials", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/Account/ManageSystemAccountCredentials/AppScope/resources/base/element/string.json b/Account/ManageSystemAccountCredentials/AppScope/resources/base/element/string.json deleted file mode 100644 index ed0031b2726f87930b679a0c78da46f749d2e031..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ManageSystemAccountCredentials" - } - ] -} diff --git a/Account/ManageSystemAccountCredentials/AppScope/resources/base/media/app_icon.png b/Account/ManageSystemAccountCredentials/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/README.md b/Account/ManageSystemAccountCredentials/README.md deleted file mode 100644 index a3a7b7775723d33dcf4666ef30d634c4a67bb490..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# 管理系统账号凭据 - -### 介绍 - -凭据可用于认证用户的身份,本文档将介绍如何录入、认证、更新、查询和删除指定系统账号的凭据。 - -该工程中展示的代码详细描述可查如下链接: - -- [ 管理系统账号凭据](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/account/manage-os-account-credential.md) - -### 效果预览 - -| 首页 | 执行录入PIN码 | -| :----------------------------------------------------------: | :----------------------------------------------------------: | -| | | -| 执行认证PIN码 | 执行更新凭据 | -| | | -| 执行查询凭据信息 | 执行删除凭据 | -| | | - -### 使用说明 - -1. 在主界面,点击'Enter PIN code',执行录入PIN码。 -2. 点击'Authenticate PIN code',执行认证PIN码。 -3. 点击'Update credentials',执行更新凭据。 -4. 点击'Query credential information',执行查询凭据信息。 -5. 点击'Delete credentials',执行删除凭据。 -6. 执行结果会即时反馈在屏幕中央,并在控制台打印log。 - -### 工程目录 - -``` -entry/src/ - ├── main - │ ├── ets - │ │ ├── entryability - │ │ ├── entrybackupability - │ │ ├── pages - │ │ ├── Index.ets // 管理系统账号凭据示例代码 - │ ├── module.json5 - │ └── resources - ├── ohosTest - │ ├── ets - │ │ ├── test - │ │ ├── Ability.test.ets // 自动化测试代码 -``` - -### 相关权限 - -[ohos.permission.MANAGE_USER_IDM](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionmanageuseridm) - -[ohos.permission.ACCESS_PIN_AUTH](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionaccesspinauth) - -[ohos.permission.ACCESS_USER_AUTH_INTERNAL](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionaccessuserauthinternal) - -[ohos.permission.USE_USER_IDM](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionuseuseridm) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API14版本full-SDK,版本号:5.0.2.57,镜像版本号:OpenHarmony_5.0.2.58。 - -3.本示例需要使用DevEco Studio 5.0.1 Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/Account/ManageSystemAccountCredentials > .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/Account/ManageSystemAccountCredentials/build-profile.json5 b/Account/ManageSystemAccountCredentials/build-profile.json5 deleted file mode 100644 index a33a4782e91c9280a45ec05115ebd546882ce072..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/code-linter.json5 b/Account/ManageSystemAccountCredentials/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/.gitignore b/Account/ManageSystemAccountCredentials/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/build-profile.json5 b/Account/ManageSystemAccountCredentials/entry/build-profile.json5 deleted file mode 100644 index b4d65d490ef6cbe22d933b9231555210f1555786..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/hvigorfile.ts b/Account/ManageSystemAccountCredentials/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageSystemAccountCredentials/entry/obfuscation-rules.txt b/Account/ManageSystemAccountCredentials/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/Account/ManageSystemAccountCredentials/entry/oh-package.json5 b/Account/ManageSystemAccountCredentials/entry/oh-package.json5 deleted file mode 100644 index 4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageSystemAccountCredentials/entry/src/main/ets/entryability/EntryAbility.ets b/Account/ManageSystemAccountCredentials/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 3e77e4b9f7946d80aa77e6b2dcfe40b23ccf6178..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Account/ManageSystemAccountCredentials/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1504a74f09dfdcfae408be979f99369a2c5affab..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageSystemAccountCredentials/entry/src/main/ets/pages/Index.ets b/Account/ManageSystemAccountCredentials/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 76f18728f2901c2e59feb46a7d636f70b22c6cf0..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,544 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_system_account_module] -import { osAccount } from '@kit.BasicServicesKit'; -// [End import_system_account_module] - -function strToUint8Arr(str: string): Uint8Array { - const buffer: number[] = []; - for (let i = 0; i < str.length; i++) { - const char = str.charAt(i); - const code = char.codePointAt(0)!; - if (code < 0x80) { - buffer.push(code); - } else if (code < 0x800) { - buffer.push(0xc0 + (code >> 6)); - buffer.push(0x80 + (code & 0x3f)); - } else if (code < 0x10000) { - buffer.push(0xe0 + (code >> 12)); - buffer.push(0x80 + ((code >> 6) & 0x3f)); - buffer.push(0x80 + (code & 0x3f)); - } - } - return new Uint8Array(buffer); -} - -@Entry -@Component -struct SystemAccount { - @State message: string = 'Nothing'; - @State cid: number = 100; - @State textPassword: string = '' - @State oldTextPassword: string = '' - - private async addCred(): Promise { - try { - this.cid = await osAccount.getAccountManager().getForegroundOsAccountLocalId(); - // [Start create_credential_management_object] - let userIDM: osAccount.UserIdentityManager = new osAccount.UserIdentityManager(); - // [End create_credential_management_object] - // [Start define_pin_inputer_pinData] - let pinData: Uint8Array = new Uint8Array([31, 32, 33, 34, 35, 36]); - // [StartExclude define_pin_inputer_pinData] - if (this.textPassword != '') { - pinData = strToUint8Arr(this.textPassword); - } - // [EndExclude define_pin_inputer_pinData] - let inputer: osAccount.IInputer = { - onGetData: (authSubType: osAccount.AuthSubType, callback: osAccount.IInputData) => { - callback.onSetData(authSubType, pinData); - } - } - // [End define_pin_inputer_pinData] - // [Start define_pin_credential_information] - let credentialInfo :osAccount.CredentialInfo = { - // [StartExclude define_pin_credential_information] - accountId: this.cid, - // [EndExclude define_pin_credential_information] - credType:osAccount.AuthType.PIN, - credSubType:osAccount.AuthSubType.PIN_SIX, - token:new Uint8Array([0]) - }; - // [End define_pin_credential_information] - // [Start call_the_api_to_register_the_inputer] - let PINAuth: osAccount.PINAuth = new osAccount.PINAuth(); - // [StartExclude call_the_api_to_register_the_inputer] - PINAuth.unregisterInputer(); - // [EndExclude call_the_api_to_register_the_inputer] - PINAuth.registerInputer(inputer); - // [End call_the_api_to_register_the_inputer] - userIDM.closeSession(this.cid); - userIDM.openSession(this.cid).then((challenge)=>{ - console.info('openSession info: ' + JSON.stringify(challenge)); - // [Start call_the_api_to_add_the_specified_credentials] - userIDM.addCredential(credentialInfo,{ - onResult: (err, extraInfo)=>{ - console.info('addCredential result: ' + JSON.stringify(err)); - console.info('edential info: ' + JSON.stringify(extraInfo)); - // [StartExclude call_the_api_to_add_the_specified_credentials] - if (err == 0) { - this.message = 'PIN code entry successful'; - } else { - this.message = 'PIN code entry failed: ' + JSON.stringify(err); - } - PINAuth.unregisterInputer(); - userIDM.closeSession(this.cid); - // [EndExclude call_the_api_to_add_the_specified_credentials] - }}) - // [End call_the_api_to_add_the_specified_credentials] - }).catch((err: Error)=>{ - console.error('openSession failed, error: ' + JSON.stringify(err)); - this.message = 'Failed to open session:' + JSON.stringify(err); - }) - } catch (e) { - console.error('getEnrolledId cur failed, error: ' + JSON.stringify(e)); - } - } - - private async auth(): Promise { - try { - let userIDM = new osAccount.UserIdentityManager(); - let PINAuth = new osAccount.PINAuth(); - let password: Uint8Array = new Uint8Array([31, 32, 33, 34, 35, 36]); - if (this.textPassword != '') { - password = strToUint8Arr(this.textPassword); - } - PINAuth.unregisterInputer(); - PINAuth.registerInputer({ - onGetData:(authSubType, callback)=>{ - callback.onSetData(osAccount.AuthSubType.PIN_SIX, password); - } - }) - userIDM.closeSession(this.cid); - userIDM.openSession(this.cid).then((challenge)=>{ - console.info('openSession info: ' + JSON.stringify(challenge)); - // [Start define_parameters_pin_type_and_level_to_auth] - let authType: osAccount.AuthType = osAccount.AuthType.PIN; - let authTrustLevel: osAccount.AuthTrustLevel = osAccount.AuthTrustLevel.ATL1; - // [End define_parameters_pin_type_and_level_to_auth] - // [Start call_the_auth_operation_for_authentication] - let userAuth: osAccount.UserAuth = new osAccount.UserAuth(); - userAuth.auth(challenge, authType, authTrustLevel, { - onResult: (result: number, extraInfo: osAccount.AuthResult) => { - console.info('pin auth result = ' + result); - console.info('pin auth extraInfo = ' + JSON.stringify(extraInfo)); - let authToken = extraInfo.token; - // [StartExclude call_the_auth_operation_for_authentication] - if(result == 0) { - this.message = 'PIN code entry successful'; - } else { - this.message = 'PIN code authentication failed: ' + result; - } - // [EndExclude call_the_auth_operation_for_authentication] - } - }); - // [End call_the_auth_operation_for_authentication] - }).catch((err: Error)=>{ - console.error('openSession failed, error: ' + JSON.stringify(err)); - this.message = 'Failed to open session:' + JSON.stringify(err); - }) - } catch (err) { - console.error('getEnrolledId cur failed, error: ' + JSON.stringify(err)); - } - } - - private async addBiologyCred(): Promise { - // [Start define_facial_credential_information] - let faceCredInfo: osAccount.CredentialInfo = { - credType: osAccount.AuthType.FACE, - credSubType: osAccount.AuthSubType.FACE_2D, - token: new Uint8Array([1, 2, 3, 4, 5]) - } - // [End define_facial_credential_information] - // [Start define_fingerprint_credential_information] - let fingerprintCredInfo: osAccount.CredentialInfo = { - credType: osAccount.AuthType.FINGERPRINT, - credSubType: osAccount.AuthSubType.FINGERPRINT_CAPACITIVE, - token: new Uint8Array([1, 2, 3, 4, 5]) - } - // [End define_fingerprint_credential_information] - try { - let userIDM = new osAccount.UserIdentityManager(); - let userAuth = new osAccount.UserAuth(); - let PINAuth = new osAccount.PINAuth(); - let password: Uint8Array = new Uint8Array([31, 32, 33, 34, 35, 36]); - PINAuth.unregisterInputer(); - PINAuth.registerInputer({ - onGetData:(authSubType, callback)=>{ - callback.onSetData(osAccount.AuthSubType.PIN_SIX, password); - } - }) - userIDM.closeSession(this.cid); - userIDM.openSession(this.cid).then((challenge)=>{ - console.info('openSession info: ' + JSON.stringify(challenge)); - let authType: osAccount.AuthType = osAccount.AuthType.PIN; - let authTrustLevel: osAccount.AuthTrustLevel = osAccount.AuthTrustLevel.ATL1; - userAuth.auth(challenge, authType, authTrustLevel, { - onResult: (result: number, extraInfo: osAccount.AuthResult) => { - console.info('pin auth result = ' + result); - console.info('pin auth extraInfo = ' + JSON.stringify(extraInfo)); - faceCredInfo.token = extraInfo.token; - fingerprintCredInfo.token = extraInfo.token; - // [Start input_facial_credential_information] - userIDM.addCredential(faceCredInfo, { - onResult: (code: number, result: osAccount.RequestResult) => { - console.info('add face credential, resultCode: ' + code); - console.info('add face credential, request result: ' + result); - // [StartExclude input_facial_credential_information] - if(code == 0) { - this.message = 'Successfully entered facial credentials'; - } else { - this.message = 'Failed to enter facial credentials: ' + code; - } - // [EndExclude input_facial_credential_information] - } - }); - // [End input_facial_credential_information] - // [Start enter_the_fingerprint_credentials] - userIDM.addCredential(fingerprintCredInfo, { - onResult: (code: number, result: osAccount.RequestResult) => { - console.info('add fingerprint credential, resultCode: ' + code); - console.info('add fingerprint credential, request result: ' + result); - // [StartExclude enter_the_fingerprint_credentials] - if(code == 0) { - this.message += 'Successfully entered fingerprint credentials'; - } else { - this.message = 'Failed to enter fingerprint credentials: ' + code; - } - // [EndExclude enter_the_fingerprint_credentials] - } - }); - // [End enter_the_fingerprint_credentials] - } - }); - }).catch((err: Error)=>{ - console.error('openSession failed, error: ' + JSON.stringify(err)); - this.message = 'Failed to open session:' + JSON.stringify(err); - }) - } catch (err) { - console.error('getEnrolledId cur failed, error: ' + JSON.stringify(err)); - } - } - - private async biologyAuth(): Promise { - try { - let userIDM = new osAccount.UserIdentityManager(); - let PINAuth = new osAccount.PINAuth(); - let password: Uint8Array = new Uint8Array([31, 32, 33, 34, 35, 36]); - PINAuth.unregisterInputer(); - PINAuth.registerInputer({ - onGetData:(authSubType, callback)=>{ - callback.onSetData(osAccount.AuthSubType.PIN_SIX, password); - } - }) - userIDM.closeSession(this.cid); - userIDM.openSession(this.cid).then((challenge)=>{ - console.info('openSession info: ' + JSON.stringify(challenge)); - // [Start define_parameters_face_type_and_level_to_auth] - let authType: osAccount.AuthType = osAccount.AuthType.FACE; - let authTrustLevel: osAccount.AuthTrustLevel = osAccount.AuthTrustLevel.ATL1; - // [End define_parameters_face_type_and_level_to_auth] - // [Start call_the_auth_operation_for_face_authentication] - let userAuth: osAccount.UserAuth = new osAccount.UserAuth(); - userAuth.auth(challenge, authType, authTrustLevel, { - onResult: (result: number, extraInfo: osAccount.AuthResult) => { - console.info('face auth result = ' + result); - console.info('face auth extraInfo = ' + JSON.stringify(extraInfo)); - // [StartExclude call_the_auth_operation_for_face_authentication] - if(result == 0) { - this.message = 'Successfully authenticated biometric credentials'; - } else { - this.message = 'Failed to authenticate biometric credentials: ' + result; - } - // [EndExclude call_the_auth_operation_for_face_authentication] - } - }); - // [End call_the_auth_operation_for_face_authentication] - }).catch((err: Error)=>{ - console.error('openSession failed, error: ' + JSON.stringify(err)); - this.message = 'Failed to open session:' + JSON.stringify(err); - }) - } catch (err) { - console.error('getEnrolledId cur failed, error: ' + JSON.stringify(err)); - } - } - - private async updateCred(): Promise { - let userIDM = new osAccount.UserIdentityManager(); - let userAuth = new osAccount.UserAuth(); - let PINAuth = new osAccount.PINAuth(); - let oldPassword: Uint8Array = new Uint8Array([31, 32, 33, 34, 35, 36]); - if (this.oldTextPassword != '') { - oldPassword = strToUint8Arr(this.oldTextPassword); - } - let password: Uint8Array = new Uint8Array([0x31, 0x31, 0x31, 0x31, 0x31, 0x31]); - if (this.textPassword != '') { - password = strToUint8Arr(this.textPassword); - } - // [Start define_the_credential_information_to_be_updated] - let credentialInfo :osAccount.CredentialInfo = { - // [StartExclude define_the_credential_information_to_be_updated] - accountId:this.cid, - // [EndExclude define_the_credential_information_to_be_updated] - credType:osAccount.AuthType.PIN, - credSubType:osAccount.AuthSubType.PIN_SIX, - token:new Uint8Array([1, 2, 3, 4, 5]) - }; - // [End define_the_credential_information_to_be_updated] - PINAuth.unregisterInputer(); - PINAuth.registerInputer({ - onGetData:(authSubType, callback)=>{ - callback.onSetData(osAccount.AuthSubType.PIN_SIX, oldPassword); - } - }) - userIDM.openSession(this.cid).then((challenge)=>{ - console.info('openSession info: ' + JSON.stringify(challenge)); - userAuth.authUser(this.cid, challenge, osAccount.AuthType.PIN, - osAccount.AuthTrustLevel.ATL1, { - onResult:(err, authResult)=>{ - console.info('authUser err: ' + JSON.stringify(err)); - console.info('authUser info: ' + JSON.stringify(authResult)); - console.info('authUser info.userId: ' + authResult.accountId); - credentialInfo.token = authResult.token; - PINAuth.unregisterInputer(); - PINAuth.registerInputer({ - onGetData:(subType, callback) =>{ - callback.onSetData(osAccount.AuthSubType.PIN_SIX, password) - } - }) - // [Start update_your_credentials] - userIDM.updateCredential(credentialInfo, { - onResult:(result: number, extraInfo: osAccount.RequestResult)=>{ - console.info('updateCredential result: ' + JSON.stringify(result)); - console.info('updateCredential extraInfo: ' + JSON.stringify(extraInfo)); - // [StartExclude update_your_credentials] - if(result == 0) { - this.message = 'Successfully updated PIN code credentials'; - } else { - this.message = 'Failed to update PIN code credentials: ' + JSON.stringify(result); - } - PINAuth.unregisterInputer(); - userIDM.closeSession(this.cid); - // [EndExclude update_your_credentials] - } - }) - // [End update_your_credentials] - } - }) - }).catch((err: Error)=>{ - console.error('openSession failed, error: ' + JSON.stringify(err)); - this.message = 'Failed to open session:' + JSON.stringify(err); - }) - } - - private async getCred(): Promise { - let userIDM = new osAccount.UserIdentityManager(); - try { - userIDM.getAuthInfo((err, data)=>{ - console.info('getAuthInfo err: ' + JSON.stringify(err)); - console.info('getAuthInfo data: ' + JSON.stringify(data)); - this.message = 'Query information length: ' + data.length; - }) - // [Start obtain_credential_information_of_the_specified_type] - let enrolledFingerCredInfoList: osAccount.EnrolledCredInfo[] = - await userIDM.getAuthInfo(osAccount.AuthType.PIN); - // [End obtain_credential_information_of_the_specified_type] - } catch (err) { - console.error('getAuthInfo failed: ' + JSON.stringify(err)); - this.message = 'Query information failed: ' + JSON.stringify(err); - } - } - - private async deleteBiologyCred(): Promise { - let userIDM = new osAccount.UserIdentityManager(); - let userAuth = new osAccount.UserAuth(); - let PINAuth = new osAccount.PINAuth(); - // [Start obtain_the_credential_information_of_the_fingerprint_type] - let credentialId: Uint8Array = new Uint8Array([1, 2, 3, 4, 5]); - let token: Uint8Array = new Uint8Array([1, 2, 3, 4, 5]); - let credInfoList: osAccount.EnrolledCredInfo[] = - await userIDM.getAuthInfo(osAccount.AuthType.FINGERPRINT); - if (credInfoList.length != 0) { - credentialId = credInfoList[0].credentialId; - } - // [End obtain_the_credential_information_of_the_fingerprint_type] - PINAuth.unregisterInputer(); - PINAuth.registerInputer({ - onGetData:(authSubType, callback)=>{ - callback.onSetData(osAccount.AuthSubType.PIN_SIX, - new Uint8Array([0x31, 0x31, 0x31, 0x31, 0x31, 0x31])); - } - }); - userIDM.closeSession(this.cid); - userIDM.openSession(this.cid).then((challenge)=>{ - console.info('openSession info: ' + JSON.stringify(challenge)); - userAuth.authUser(this.cid, challenge, osAccount.AuthType.PIN, - osAccount.AuthTrustLevel.ATL1, { - onResult:(err, authResult)=>{ - console.info('authUser err: ' + JSON.stringify(err)); - console.info('authUser info: ' + JSON.stringify(authResult)); - console.info('authUser info.userId: ' + authResult.accountId); - try { - // [Start delete_specified_credentials] - userIDM.delCred(credentialId, authResult.token, { - onResult: (result: number, extraInfo: osAccount.RequestResult) => { - console.info('delCred result = ' + result); - console.info('delCred extraInfo = ' + JSON.stringify(extraInfo)); - // [StartExclude delete_specified_credentials] - if(result == 0) { - this.message = 'Successfully deleted credentials'; - } else { - this.message = 'Failed to delete credentials: ' + result; - } - // [EndExclude delete_specified_credentials] - } - }); - // [End delete_specified_credentials] - } catch (e) { - console.error('delUser exception = ' + JSON.stringify(e)); - this.message = 'Failed to delete credentials: ' + JSON.stringify(e); - } - // [Start deactivate_pin_input_device] - PINAuth.unregisterInputer(); - // [End deactivate_pin_input_device] - // [Start close_the_session_and_end_credential_management] - userIDM.closeSession(this.cid); - // [End close_the_session_and_end_credential_management] - } - }) - }).catch((err: Error)=>{ - console.error('openSession failed, error: ' + JSON.stringify(err)); - this.message = 'Failed to open session:' + JSON.stringify(err); - }) - } - - private async deleteCred(): Promise { - let userIDM = new osAccount.UserIdentityManager(); - let userAuth = new osAccount.UserAuth(); - let PINAuth = new osAccount.PINAuth(); - let password: Uint8Array = new Uint8Array([0x31, 0x31, 0x31, 0x31, 0x31, 0x31]); - if (this.textPassword != '') { - password = strToUint8Arr(this.textPassword); - } - PINAuth.unregisterInputer(); - PINAuth.registerInputer({ - onGetData:(authSubType, callback)=>{ - callback.onSetData(osAccount.AuthSubType.PIN_SIX, password); - } - }) - userIDM.closeSession(this.cid) - userIDM.openSession(this.cid).then((challenge)=>{ - console.info('openSession info: ' + JSON.stringify(challenge)); - userAuth.authUser(this.cid, challenge, osAccount.AuthType.PIN, - osAccount.AuthTrustLevel.ATL1, { - onResult:(err, authResult)=>{ - console.info('authUser err: ' + JSON.stringify(err)); - console.info('authUser info: ' + JSON.stringify(authResult)); - console.info('authUser info.userId: ' + authResult.accountId); - console.info('authUser info.token: ' + authResult.token); - try { - userIDM.delUser(authResult.token, { - onResult: (result: number, extraInfo: osAccount.RequestResult) => { - console.info('delUser result = ' + result); - console.info('delUser extraInfo = ' + JSON.stringify(extraInfo)); - if(result == 0) { - this.message = 'Successfully deleted PIN code credentials'; - } else { - this.message = 'Failed to delete PIN code credentials: ' + JSON.stringify(result); - } - - PINAuth.unregisterInputer(); - userIDM.closeSession(this.cid); - } - }); - } catch (e) { - console.error('delUser exception = ' + JSON.stringify(e)); - } - } - }) - }).catch((err: Error)=>{ - console.error('openSession failed, error: ' + JSON.stringify(err)); - this.message = 'Failed to open session:' + JSON.stringify(err); - }) - } - - build() { - Column() { - TextInput({ text: this.textPassword, placeholder: 'input password...'}) - .placeholderColor(Color.Grey) - .placeholderFont({ size: 14, weight: 400 }) - .caretColor(Color.Blue) - .width(200) - .height(40) - .margin(10) - .fontSize(14) - .fontColor(Color.Black) - .onChange((value: string) => { - this.textPassword = value; - }) - TextInput({ text: this.oldTextPassword, placeholder: 'old password...'}) - .placeholderColor(Color.Grey) - .placeholderFont({ size: 14, weight: 400 }) - .caretColor(Color.Blue) - .width(200) - .height(40) - .margin(10) - .fontSize(14) - .fontColor(Color.Black) - .onChange((value: string) => { - this.oldTextPassword = value; - }) - Text(this.message) - .id('show') - .fontSize(36) - .fontWeight(FontWeight.Bold) - Button($r('app.string.ManageSystemAccountCredentials1')) - .margin(10) - .id('button1') - .onClick(() => this.addCred()) - Button($r('app.string.ManageSystemAccountCredentials2')) - .margin(10) - .id('button2') - .onClick(() => this.auth()) - Button($r('app.string.ManageSystemAccountCredentials3')) - .margin(10) - .id('button3') - .onClick(() => this.addBiologyCred()) - Button($r('app.string.ManageSystemAccountCredentials4')) - .margin(10) - .id('button4') - .onClick(() => this.biologyAuth()) - Button($r('app.string.ManageSystemAccountCredentials5')) - .margin(10) - .id('button5') - .onClick(() => this.updateCred()) - Button($r('app.string.ManageSystemAccountCredentials6')) - .margin(10) - .id('button6') - .onClick(() => this.getCred()) - Button($r('app.string.ManageSystemAccountCredentials7')) - .margin(10) - .id('button8') - .onClick(() => this.deleteBiologyCred()) - Button($r('app.string.ManageSystemAccountCredentials8')) - .margin(10) - .id('button7') - .onClick(() => this.deleteCred()) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/module.json5 b/Account/ManageSystemAccountCredentials/entry/src/main/module.json5 deleted file mode 100644 index d41c174be09411df64de6445f9833f520b681ec7..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/module.json5 +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2025 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", - "requestPermissions": [{ - "name": "ohos.permission.MANAGE_USER_IDM" - }, - { - "name": "ohos.permission.ACCESS_PIN_AUTH" - }, - { - "name": "ohos.permission.ACCESS_USER_AUTH_INTERNAL" - }, - { - "name": "ohos.permission.USE_USER_IDM" - } - ], - "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/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/element/color.json b/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/element/string.json b/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 2fe0787892f6c85c8ac11eaf73caeb7aeab0020f..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "ManageSystemAccountCredentials" - }, - { - "name": "ManageSystemAccountCredentials1", - "value": "Enter PIN code" - }, - { - "name": "ManageSystemAccountCredentials2", - "value": "Authenticate PIN code" - }, - { - "name": "ManageSystemAccountCredentials3", - "value": "Enter biometric credentials" - }, - { - "name": "ManageSystemAccountCredentials4", - "value": "Authenticate biometric credentials" - }, - { - "name": "ManageSystemAccountCredentials5", - "value": "Update credentials" - }, - { - "name": "ManageSystemAccountCredentials6", - "value": "Query credential information" - }, - { - "name": "ManageSystemAccountCredentials7", - "value": "Delete biometric credentials" - }, - { - "name": "ManageSystemAccountCredentials8", - "value": "Delete credentials" - } - ] -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/background.png b/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/foreground.png b/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/layered_image.json b/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/startIcon.png b/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/profile/backup_config.json b/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/profile/main_pages.json b/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/Account/ManageSystemAccountCredentials/entry/src/main/resources/dark/element/color.json b/Account/ManageSystemAccountCredentials/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/mock/mock-config.json5 b/Account/ManageSystemAccountCredentials/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageSystemAccountCredentials/entry/src/ohosTest/ets/test/Ability.test.ets b/Account/ManageSystemAccountCredentials/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index e500640d0d1e343422b48aefa1a77a8ebd7f1dc8..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -function sleep(time: number) { - return new Promise((resolve: Function) => setTimeout(resolve, time)); -} -export default function abilityTest() { - describe('AccountCredentialsAbilityTest', () => { - /* - * 打开应用,依次点击页面中按钮 - * 使用系统凭证账号接口功能 - */ - it('accountCredentialsExample',0, async (done: Function) => { - console.info("uitest: TestUiExample begin"); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - } - await delegator.startAbility(want); - await sleep(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info("get top ability"); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - const driver = Driver.create(); - await driver.delayMs(1000); - - const button1 = await driver.findComponent(ON.id('button1')); - await button1.click(); - await driver.delayMs(1000); - const text = await driver.findComponent(ON.id('show')); - let content1: string = await text.getText(); - expect(content1).assertEqual('PIN code entry successful'); - - const button2 = await driver.findComponent(ON.id('button2')); - await button2.click(); - await driver.delayMs(1000); - let content2: string = await text.getText(); - expect(content2).assertEqual('PIN code entry successful'); - - const button3 = await driver.findComponent(ON.id('button5')); - await button3.click(); - await driver.delayMs(5000); - let content3: string = await text.getText(); - expect(content3).assertEqual('Successfully updated PIN code credentials'); - - const button4 = await driver.findComponent(ON.id('button6')); - await button4.click(); - await driver.delayMs(1000); - let content4: string = await text.getText(); - expect(content4).assertEqual('Query information length: 1'); - - const button5 = await driver.findComponent(ON.id('button7')); - await button5.click(); - await driver.delayMs(3000); - let content5: string = await text.getText(); - expect(content5).assertEqual('Successfully deleted PIN code credentials'); - done(); - console.info("uitest: TestUiExample end"); - }) - }) -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/ohosTest/ets/test/List.test.ets b/Account/ManageSystemAccountCredentials/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/ohosTest/module.json5 b/Account/ManageSystemAccountCredentials/entry/src/ohosTest/module.json5 deleted file mode 100644 index 9983b2ba4e55e31a172f0328c82c9a75bfa00ded..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/Account/ManageSystemAccountCredentials/entry/src/test/List.test.ets b/Account/ManageSystemAccountCredentials/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/entry/src/test/LocalUnit.test.ets b/Account/ManageSystemAccountCredentials/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/hvigor/hvigor-config.json5 b/Account/ManageSystemAccountCredentials/hvigor/hvigor-config.json5 deleted file mode 100644 index cef74543b1f97c82275e4bf3434b162395bff2eb..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/Account/ManageSystemAccountCredentials/hvigorfile.ts b/Account/ManageSystemAccountCredentials/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManageSystemAccountCredentials/oh-package.json5 b/Account/ManageSystemAccountCredentials/oh-package.json5 deleted file mode 100644 index eaef52736f22c14e04fca386ba01611ab32a7e4a..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Account/ManageSystemAccountCredentials/ohosTest.md b/Account/ManageSystemAccountCredentials/ohosTest.md deleted file mode 100644 index 8cb7ede0ab2aab3c52f317f4d3ed9e0efb8f0565..0000000000000000000000000000000000000000 --- a/Account/ManageSystemAccountCredentials/ohosTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ManageSystemAccountCredentials 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------ | ------------ | ------------------ | --------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| Enter PIN code | 位于首页 | 点击'Enter PIN code' | 页面显示“PIN code entry successful” | 是 | Pass | -| Authenticate PIN code | 位于首页 | 点击'Authenticate PIN code' | 页面显示“PIN code entry successful” | 是 | Pass | -| Update credentials | 位于首页 | 点击'Update credentials' | 页面显示“Successfully updated PIN code credentials” | 是 | Pass | -| Query credential information | 位于首页 | 点击'Query credential information' | 页面显示“Query information length:1” | 是 | Pass | -| Delete credentials | 位于首页 | 点击'Delete credentials' | 页面显示“Successfully deleted PIN code credentials” | 是 | Pass | \ No newline at end of file diff --git a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_1.png b/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_1.png deleted file mode 100644 index 42f43349352fe4d0ee4201410ebad572cf508341..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_1.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_2.png b/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_2.png deleted file mode 100644 index e190b36d6184400dbb043b378340c8e70e0ce503..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_2.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_3.png b/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_3.png deleted file mode 100644 index 3a977ab2959b85ba2e6de1368e0ba2e4fa0888ef..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_3.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_4.png b/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_4.png deleted file mode 100644 index 49c2f301a595c25a342bb610e5538800fe07804d..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_4.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_5.png b/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_5.png deleted file mode 100644 index a67b5d00bbd1d0c979f849891fbff0eeaa64a86d..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_5.png and /dev/null differ diff --git a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_6.png b/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_6.png deleted file mode 100644 index 5d8283bfd24f2af70725ba7e31ad369bb59a13d2..0000000000000000000000000000000000000000 Binary files a/Account/ManageSystemAccountCredentials/screenshots/AccountCredentials_6.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/.gitignore b/Account/ManagerApplicationAccount/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/Account/ManagerApplicationAccount/AppScope/app.json5 b/Account/ManagerApplicationAccount/AppScope/app.json5 deleted file mode 100644 index 04e9307b8b3c5ebfe8acc7a1f561f5089198695c..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.managerapplicationaccount", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/Account/ManagerApplicationAccount/AppScope/resources/base/element/string.json b/Account/ManagerApplicationAccount/AppScope/resources/base/element/string.json deleted file mode 100644 index 4e396ec1fbd7340b3154078890610ee490dff4da..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ManagerApplicationAccount" - } - ] -} diff --git a/Account/ManagerApplicationAccount/AppScope/resources/base/media/app_icon.png b/Account/ManagerApplicationAccount/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/README.md b/Account/ManagerApplicationAccount/README.md deleted file mode 100644 index d83cb068c99561a1a5e0a0db3e17f5ff0649b64a..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# 管理应用账号 - -### 介绍 - -1.应用开发者可以使用[应用账号SDK](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-appAccount.md)管理本应用的账号数据。 - -能力限制:应用卸载场景下,被卸载应用的账号数据会被删除;本地账号删除场景下,被删除本地账号下的所有应用的账号数据会被删除。 - -2.实现对以下指南文件中 [管理应用账号](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/account/manage-application-account.md#/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-appAccount.md) 示例代码片段的工程化。保证指南中示例代码与sample工程文件同源。 - -### 效果预览 - -| 首页 | **执行创建应用账号** | -| :----------------------------------------------------------: | :----------------------------------------------------------: | -| | | -| **执行查询应用账号** | **执行存取账号的凭据** | -| | | -| **执行存取账号的自定义数据** | **执行存取账号的授权令牌** | -| | | -| **执行删除应用账号** | | -| | | - -### 使用说明 - -1. 在主界面,可以点击’Create application account‘,创建应用账号。 -2. 点击’Query application account‘,查询应用账号。 -3. 点击’Access account credentials‘,存取账号的凭据。 -4. 点击’Access custom data of the account‘,存取账号的自定义数据。 -5. 点击’Access account authorization token‘,存取账号的授权令牌。 -6. 点击’Delete application account‘,删除应用账号。 -7. 执行结果会即时反馈在屏幕中央,并在控制台打印log。 - -### 工程目录 - -``` -entry/src/ - ├── main - │ ├── ets - │ │ ├── entryability - │ │ ├── entrybackupability - │ │ └── pages - │ │ └── Index.ets // 管理应用账号示例代码 - │ ├── module.json5 - │ └── resources - └── ohosTest - └── ets - └── test - └── Ability.test.ets // 自动化测试代码 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API14版本full-SDK,版本号:5.0.2.57,镜像版本号:OpenHarmony_5.0.2.58。 - -3.本示例需要使用DevEco Studio 5.0.1 Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/Account/ApplicationAccount > .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/Account/ManagerApplicationAccount/build-profile.json5 b/Account/ManagerApplicationAccount/build-profile.json5 deleted file mode 100644 index a33a4782e91c9280a45ec05115ebd546882ce072..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/code-linter.json5 b/Account/ManagerApplicationAccount/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/.gitignore b/Account/ManagerApplicationAccount/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/build-profile.json5 b/Account/ManagerApplicationAccount/entry/build-profile.json5 deleted file mode 100644 index b4d65d490ef6cbe22d933b9231555210f1555786..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/hvigorfile.ts b/Account/ManagerApplicationAccount/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManagerApplicationAccount/entry/obfuscation-rules.txt b/Account/ManagerApplicationAccount/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/Account/ManagerApplicationAccount/entry/oh-package.json5 b/Account/ManagerApplicationAccount/entry/oh-package.json5 deleted file mode 100644 index 4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManagerApplicationAccount/entry/src/main/ets/entryability/EntryAbility.ets b/Account/ManagerApplicationAccount/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 3e77e4b9f7946d80aa77e6b2dcfe40b23ccf6178..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Account/ManagerApplicationAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1504a74f09dfdcfae408be979f99369a2c5affab..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManagerApplicationAccount/entry/src/main/ets/pages/Index.ets b/Account/ManagerApplicationAccount/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index a589906a0f1aa700c00f8fe42d534a172e1cd111..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_the_application_account_module] -import { appAccount, BusinessError } from '@kit.BasicServicesKit'; -// [End import_the_application_account_module] - -// [Start obtain_the_instance_object_of_the_application_account] -const appAccountManager = appAccount.createAppAccountManager(); -// [End obtain_the_instance_object_of_the_application_account] - -@Entry -@Component -struct Index { - @State message: string = 'No Name'; - - private async createAccount(): Promise { - // [Start parameter_preparation] - let name: string = 'ZhangSan'; - let options: appAccount.CreateAccountOptions = { - customData: { - age: '10' - } - }; - // [End parameter_preparation] - // [Start create_an_app_account_based_on_the_name_and_options] - appAccountManager.createAccount(name, options).then(()=>{ - console.info('createAccount successfully'); - // [StartExclude create_an_app_account_based_on_the_name_and_options] - this.message = 'Account creation successful'; - // [EndExclude create_an_app_account_based_on_the_name_and_options] - }).catch((err: BusinessError)=>{ - console.error(`createAccount failed, error: code is ${err.code}, message is ${err.message}`); - // [StartExclude create_an_app_account_based_on_the_name_and_options] - this.message = 'Account creation failed: ' + JSON.stringify(err); - // [EndExclude create_an_app_account_based_on_the_name_and_options] - }); - // [End create_an_app_account_based_on_the_name_and_options] - } - - private async getAccounts(): Promise { - // [Start query_the_account_list] - appAccountManager.getAllAccounts().then((data: appAccount.AppAccountInfo[]) => { - console.info('getAllAccounts successfully, data: ' + JSON.stringify(data)); - // [StartExclude query_the_account_list] - this.message = 'Query account result: ' + data[0].name; - // [EndExclude query_the_account_list] - }).catch((err: BusinessError) => { - console.error(`getAllAccounts failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude query_the_account_list] - this.message = 'Query account failed: ' + JSON.stringify(err); - // [EndExclude query_the_account_list] - }); - // [End query_the_account_list] - } - - private async setCredential(): Promise { - // [Start prepare_parameters_to_specify_the_account_name_credential_type_and_credential] - let name: string = 'ZhangSan'; - let credentialType: string = 'PIN_SIX'; - let credential: string = 'xxxxxx'; - // [End prepare_parameters_to_specify_the_account_name_credential_type_and_credential] - - // [Start set_the_credentials_for_your_account] - await appAccountManager.setCredential(name, credentialType, credential).then(() => { - console.info('setCredential successfully'); - }).catch((err: BusinessError) => { - console.error(`setCredential failed: code is ${err.code}, message is ${err.message}`); - // [StartExclude set_the_credentials_for_your_account] - this.message = 'Failed to set account credentials: ' + JSON.stringify(err); - // [EndExclude set_the_credentials_for_your_account] - }); - // [End set_the_credentials_for_your_account] - - // [Start obtain_the_credentials_for_your_account] - appAccountManager.getCredential(name, credentialType).then((data: string) => { - console.info('getCredential successfully, data: ' + data); - // [StartExclude obtain_the_credentials_for_your_account] - this.message = 'Successfully set account credentials: ' + data; - // [EndExclude obtain_the_credentials_for_your_account] - }).catch((err: BusinessError) => { - console.error(`getCredential failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude obtain_the_credentials_for_your_account] - this.message = 'Failed to query account credentials: ' + JSON.stringify(err); - // [EndExclude obtain_the_credentials_for_your_account] - }); - // [End obtain_the_credentials_for_your_account] - } - - private async setCustomData(): Promise { - // [Start prepare_parameters_specify_the_account_name_and_custom_key_values] - let name: string = 'ZhangSan'; - let key: string = 'age'; - let value: string = '12'; - // [End prepare_parameters_specify_the_account_name_and_custom_key_values] - // [Start set_up_custom_data_for_your_account] - await appAccountManager.setCustomData(name, key, value).then(() => { - console.info('setCustomData successfully'); - }).catch((err: BusinessError) => { - console.error(`setCustomData failed: code is ${err.code}, message is ${err.message}`); - // [StartExclude set_up_custom_data_for_your_account] - this.message = 'Failed to set custom account credentials: ' + JSON.stringify(err); - // [EndExclude set_up_custom_data_for_your_account] - }); - // [End set_up_custom_data_for_your_account] - // [Start obtain_the_custom_data_of_the_account] - appAccountManager.getCustomData(name, key).then((data: string) => { - console.info('getCustomData successfully, data: ' + data); - // [StartExclude obtain_the_custom_data_of_the_account] - this.message = 'Successfully set custom account credentials, ' + key + ' is ' + data; - // [EndExclude obtain_the_custom_data_of_the_account] - }).catch((err: BusinessError) => { - console.error(`getCustomData failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude obtain_the_custom_data_of_the_account] - this.message = 'Failed to query custom account credentials: ' + JSON.stringify(err); - // [EndExclude obtain_the_custom_data_of_the_account] - }); - // [End obtain_the_custom_data_of_the_account] - } - - private async setAuthToken(): Promise { - // [Start prepare_parameters_to_specify_the_account_name_account_owner_authorization_type_and_authorization_token] - let name: string = 'ZhangSan'; - let owner: string = 'com.samples.managerapplicationaccount'; - let authType: string = 'getSocialData'; - let token: string = 'xxxxxx'; - // [End prepare_parameters_to_specify_the_account_name_account_owner_authorization_type_and_authorization_token] - // [Start set_the_authorization_token_for_the_specified_authorization_type] - await appAccountManager.setAuthToken(name, authType, token).then(() => { - console.info('setAuthToken successfully'); - }).catch((err: BusinessError) => { - console.error(`setAuthToken failed: code is ${err.code}, message is ${err.message}`); - // [StartExclude set_the_authorization_token_for_the_specified_authorization_type] - this.message = 'Failed to store account authorization token: ' + JSON.stringify(err); - // [EndExclude set_the_authorization_token_for_the_specified_authorization_type] - }); - // [End set_the_authorization_token_for_the_specified_authorization_type] - // [Start obtain_an_authorization_token_for_the_specified_authorization_type] - await appAccountManager.getAuthToken(name, owner, authType).then((data: string) => { - console.info('getAuthToken successfully, data: ' + data); - // [StartExclude obtain_an_authorization_token_for_the_specified_authorization_type] - this.message = 'Successfully stored account authorization token: ' + data; - // [EndExclude obtain_an_authorization_token_for_the_specified_authorization_type] - }).catch((err: BusinessError) => { - console.error(`getAuthToken failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude obtain_an_authorization_token_for_the_specified_authorization_type] - this.message = 'Failed to get account authorization token: ' + JSON.stringify(err); - // [EndExclude obtain_an_authorization_token_for_the_specified_authorization_type] - }); - // [End obtain_an_authorization_token_for_the_specified_authorization_type] - } - - private async removeAccount(): Promise { - // [Start delete_account] - let name: string = 'ZhangSan'; - appAccountManager.removeAccount(name).then(() => { - console.info('removeAccount successfully'); - // [StartExclude delete_account] - this.message = 'removeAccount successfully'; - // [EndExclude delete_account] - }).catch((err: BusinessError) => { - console.error(`removeAccount failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude delete_account] - this.message = 'Account removal failed: ' + JSON.stringify(err); - // [EndExclude delete_account] - }); - // [End delete_account] - - } - - build() { - Column() { - Text(this.message) - .id('show') - .fontSize(36) - .fontWeight(FontWeight.Bold) - Button($r('app.string.Application1')) - .margin(10) - .id('button1') - .onClick(() => this.createAccount()) - Button($r('app.string.Application2')) - .margin(10) - .id('button2') - .onClick(() => this.getAccounts()) - Button($r('app.string.Application3')) - .margin(10) - .id('button3') - .onClick(() => this.setCredential()) - Button($r('app.string.Application4')) - .margin(10) - .id('button4') - .onClick(() => this.setCustomData()) - Button($r('app.string.Application5')) - .margin(10) - .id('button5') - .onClick(() => this.setAuthToken()) - Button($r('app.string.Application6')) - .margin(10) - .id('button6') - .onClick(() => this.removeAccount()) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/main/module.json5 b/Account/ManagerApplicationAccount/entry/src/main/module.json5 deleted file mode 100644 index 776ce01475229d674487a2830790c4c87b777379..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManagerApplicationAccount/entry/src/main/resources/base/element/color.json b/Account/ManagerApplicationAccount/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/base/element/string.json b/Account/ManagerApplicationAccount/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 599fe1e3ea8035e3be37b3e3c4e9966f75b88cbd..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "Application1", - "value": "Create application account" - }, - { - "name": "Application2", - "value": "Query application account" - }, - { - "name": "Application3", - "value": "Access account credentials" - }, - { - "name": "Application4", - "value": "Access custom data of the account" - }, - { - "name": "Application5", - "value": "Access account authorization token" - }, - { - "name": "Application6", - "value": "Delete application account" - } - ] -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/background.png b/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/foreground.png b/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/layered_image.json b/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/startIcon.png b/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/base/profile/backup_config.json b/Account/ManagerApplicationAccount/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/base/profile/main_pages.json b/Account/ManagerApplicationAccount/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/dark/element/color.json b/Account/ManagerApplicationAccount/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/en_US/element/string.json b/Account/ManagerApplicationAccount/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 8fddd8fce87fcaf4635a7294392822515acdc9b7..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AsyncConcurrencyOverview" - } - ] -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/main/resources/zh_CN/element/string.json b/Account/ManagerApplicationAccount/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 55f88339349ae1e6872f5a14b04db8fa78445b2b..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AsyncConcurrencyOverview" - } - ] -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/mock/mock-config.json5 b/Account/ManagerApplicationAccount/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManagerApplicationAccount/entry/src/ohosTest/ets/test/Ability.test.ets b/Account/ManagerApplicationAccount/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index afaa47a2b8605108403c0f0163ccdad3c22f5fbe..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -function sleep(time: number) { - return new Promise((resolve: Function) => setTimeout(resolve, time)); -} -export default function abilityTest() { - describe('ApplicationAccountAbilityTest', () => { - /* - * 打开应用,依次点击页面中按钮 - * 使用应用账号接口功能 - */ - it('applicationAccountExample',0, async (done: Function) => { - console.info("uitest: TestUiExample begin"); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - } - await delegator.startAbility(want); - await sleep(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info("get top ability"); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - const driver = Driver.create(); - await driver.delayMs(1000); - - const button1 = await driver.findComponent(ON.id('button1')); - await button1.click(); - await driver.delayMs(1000); - const text = await driver.findComponent(ON.id('show')); - let content1: string = await text.getText(); - expect(content1).assertEqual('Account creation successful'); - - const button2 = await driver.findComponent(ON.id('button2')); - await button2.click(); - await driver.delayMs(1000); - let content2: string = await text.getText(); - expect(content2).assertEqual('Query account result: ZhangSan'); - - const button3 = await driver.findComponent(ON.id('button3')); - await button3.click(); - await driver.delayMs(1000); - let content3: string = await text.getText(); - expect(content3).assertEqual('Successfully set account credentials: xxxxxx'); - - const button4 = await driver.findComponent(ON.id('button4')); - await button4.click(); - await driver.delayMs(1000); - let content4: string = await text.getText(); - expect(content4).assertEqual('Successfully set custom account credentials, age is 12'); - - const button5 = await driver.findComponent(ON.id('button5')); - await button5.click(); - await driver.delayMs(1000); - let content5: string = await text.getText(); - expect(content5).assertEqual('Successfully stored account authorization token: xxxxxx'); - - const button6 = await driver.findComponent(ON.id('button6')); - await button6.click(); - await driver.delayMs(1000); - let content6: string = await text.getText(); - expect(content6).assertEqual('removeAccount successfully'); - done(); - console.info("uitest: TestUiExample end"); - }) - }) -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/ohosTest/ets/test/List.test.ets b/Account/ManagerApplicationAccount/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/ohosTest/module.json5 b/Account/ManagerApplicationAccount/entry/src/ohosTest/module.json5 deleted file mode 100644 index 9983b2ba4e55e31a172f0328c82c9a75bfa00ded..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/Account/ManagerApplicationAccount/entry/src/test/List.test.ets b/Account/ManagerApplicationAccount/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/entry/src/test/LocalUnit.test.ets b/Account/ManagerApplicationAccount/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/hvigor/hvigor-config.json5 b/Account/ManagerApplicationAccount/hvigor/hvigor-config.json5 deleted file mode 100644 index cef74543b1f97c82275e4bf3434b162395bff2eb..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/Account/ManagerApplicationAccount/hvigorfile.ts b/Account/ManagerApplicationAccount/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/ManagerApplicationAccount/oh-package.json5 b/Account/ManagerApplicationAccount/oh-package.json5 deleted file mode 100644 index eaef52736f22c14e04fca386ba01611ab32a7e4a..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Account/ManagerApplicationAccount/ohosTest.md b/Account/ManagerApplicationAccount/ohosTest.md deleted file mode 100644 index d2d8495a3d0575addd5d4e8bb2501c9259ae7b58..0000000000000000000000000000000000000000 --- a/Account/ManagerApplicationAccount/ohosTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# AsyncConcurrencyOverview 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| -------------------- | ------------ | -------------------------- | --------------------------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| Create application account | 位于首页 | 点击'Create application account' | 页面显示'Account creation successful' | 是 | Pass | -| Query application account | 位于首页 | 点击'Query application account' | 页面显示'Query account result: ZhangSan' | 是 | Pass | -| Access account credentials | 位于首页 | 点击'Access account credentials' | 页面显示'Successfully set account credentials: xxxxxx' | 是 | Pass | -| Access custom data of the account | 位于首页 | 点击'Access custom data of the account’ | 页面显示'Successfully set custom account credentials, age is 12‘ | 是 | Pass | -| Access account authorization token | 位于首页 | 点击'Access account authorization token’ | 页面显示'Successfully stored account authorization token: xxxxxx‘ | 是 | Pass | -| Delete application account | 位于首页 | 点击'Delete application account’ | 页面显示'removeAccount successfully‘ | 是 | Pass | \ No newline at end of file diff --git a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_1.png b/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_1.png deleted file mode 100644 index e840eb7e55fc25e9b807f4f18727ca714c0847a7..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_1.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_2.png b/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_2.png deleted file mode 100644 index 8ec82f37622be4a3bc2c905f0ee8efc0a1536082..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_2.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_3.png b/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_3.png deleted file mode 100644 index 3e78d78424a5b91b9508ebf040ca239eae6de99f..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_3.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_4.png b/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_4.png deleted file mode 100644 index 0b6925fc1f9138fbe541b79d53e8dd86b6cc1878..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_4.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_5.png b/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_5.png deleted file mode 100644 index f3da04caeaa894ea9de33a1779e5ed8906d73841..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_5.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_6.png b/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_6.png deleted file mode 100644 index 2a0130469bb7d2f9cb6b0a9b8408a22f29236253..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_6.png and /dev/null differ diff --git a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_7.png b/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_7.png deleted file mode 100644 index abeb59ba0df57be165623d48a6113b14e3e6ff65..0000000000000000000000000000000000000000 Binary files a/Account/ManagerApplicationAccount/screenshots/ManagerApplicationAccount_7.png and /dev/null differ diff --git a/Account/SystemAccount/.gitignore b/Account/SystemAccount/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/Account/SystemAccount/AppScope/app.json5 b/Account/SystemAccount/AppScope/app.json5 deleted file mode 100644 index c35b144d7b6477671dc306481203795a0ea03c59..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.systemaccount", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/Account/SystemAccount/AppScope/resources/base/element/string.json b/Account/SystemAccount/AppScope/resources/base/element/string.json deleted file mode 100644 index baaa541dcbd4e47043e2a5670f557375fd3790ba..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "SystemAccount" - } - ] -} diff --git a/Account/SystemAccount/AppScope/resources/base/media/app_icon.png b/Account/SystemAccount/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/Account/SystemAccount/README.md b/Account/SystemAccount/README.md deleted file mode 100644 index a6af6cf4d0593c4bfffbcf647e66be24193ad239..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# 系统账号 (管理系统账号和使用约束管控系统账号) - -### 介绍 - -1.管理系统账号: - -系统提供了用于管理系统账号的接口。 系统应用开发者在申请对应的权限后,可以创建、激活、修改和删除系统账号,实现对系统账号的生命周期管理;三方应用开发者可以查询系统账号的基本信息,以完成与系统账号相关的业务逻辑开发。 - -2.使用约束管控系统账号: - -账号管理模块提供了基于角色的访问控制机制,用户可以为系统账号设置约束,以限制目标账号的行为。 - -预定义的账号约束条件,可以参考 :[系统账号约束列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-osAccount.md#系统账号约束列表) - -3.实现对以下指南文件中 [管理系统账号](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/account/manage-os-account.md) [使用约束管控系统账号](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/account/control-os-account-by-constraints.md) 示例代码片段的工程化。保证指南中示例代码与sample工程文件同源。 - -### 效果预览 - -| 首页 | 使用约束管控系统账号页面 | -| :----------------------------------------------------------: | :----------------------------------------------------------: | -| | | -| 执行Set the constraint list for the specified system account | 执行Determine if the specified constraint for the target system account is enabled | -| | | -| 管理系统账号首页 | 执行Create system account | -| | | -| 执行Query all system accounts | 执行Query specified system account information | -| | | -| 执行Modify system account avatar | 执行Modify system account nickname | -| | | -| 执行Delete system account | | -| | | - -### 使用说明 - -1. 在主界面,点击’UseConstraintManagementSystemAccount‘,进入约束管控系统账号页面。 -2. 点击’Set the constraint list for the specified system account‘,Set the constraint list for the specified system account。 -3. 点击’Determine if the specified constraint for the target system account is enabled‘,Determine if the specified constraint for the target system account is enabled。 -4. 点击’Go to ManageSystem‘,进入管理系统账号首页。 -5. 点击’Create system account‘,Create system account。 -6. 点击’Query all system accounts‘,Query all system accounts。 -7. 点击’Query specified system account information‘,Query specified system account information。 -8. 点击’Modify system account avatar‘,Modify system account avatar。 -9. 点击’Modify system account nickname‘,Modify system account nickname。 -10. 点击’Delete system account‘,Delete system account。 - -### 工程目录 - -``` -entry/src/ - ├── main - │ ├── ets - │ │ ├── entryability - │ │ ├── entrybackupability - │ │ └── pages - | | ├──SystemAccount - | | | ├── ManageSystemAccounts // 管理系统账号示例代码 - | | | └── UseConstraintManagementSystemAccount // 使用约束管控系统账号示例代码 - │ │ └── Index.ets // 系统账号首页 - │ ├── module.json5 - │ └── resources - ├── ohosTest - │ ├── ets - │ │ └── test - │ │ └── Ability.test.ets // 自动化测试代码 -``` - -### 相关权限 - -[ohos.permission.MANAGE_LOCAL_ACCOUNTS](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionmanagelocalaccounts) - -[ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissioninteractacrosslocalaccountsextension) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API14版本full-SDK,版本号:5.0.2.57,镜像版本号:OpenHarmony_5.0.2.58。 - -3.本示例需要使用DevEco Studio 5.0.1 Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/Account/SystemAccount > .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/Account/SystemAccount/build-profile.json5 b/Account/SystemAccount/build-profile.json5 deleted file mode 100644 index a33a4782e91c9280a45ec05115ebd546882ce072..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Account/SystemAccount/code-linter.json5 b/Account/SystemAccount/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/.gitignore b/Account/SystemAccount/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/Account/SystemAccount/entry/build-profile.json5 b/Account/SystemAccount/entry/build-profile.json5 deleted file mode 100644 index b4d65d490ef6cbe22d933b9231555210f1555786..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/hvigorfile.ts b/Account/SystemAccount/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/SystemAccount/entry/obfuscation-rules.txt b/Account/SystemAccount/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/Account/SystemAccount/entry/oh-package.json5 b/Account/SystemAccount/entry/oh-package.json5 deleted file mode 100644 index 4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/SystemAccount/entry/src/main/ets/entryability/EntryAbility.ets b/Account/SystemAccount/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 3e77e4b9f7946d80aa77e6b2dcfe40b23ccf6178..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Account/SystemAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1504a74f09dfdcfae408be979f99369a2c5affab..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/SystemAccount/entry/src/main/ets/pages/Index.ets b/Account/SystemAccount/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 03155159c8eadbae023eb7ac642613afb9f1c101..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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 { CommonButton } from '../util/CommonButton'; - -@Entry -@Component -struct Index { - build() { - Scroll() { - Column() { - Text('SystemAccountHome') - .padding('15vp') - .width('100%') - .fontSize('25fp') - .textAlign(TextAlign.Center) - CommonButton({ - buttonName: 'ManageSystemAccounts', - buttonUrl: 'pages/SystemAccount/ManageSystemAccounts' - }); - CommonButton({ - buttonName: 'UseConstraintManagementSystemAccount', - buttonUrl: 'pages/SystemAccount/UseConstraintManagementSystemAccount' - }); - } - .padding('5vp') - .width('100%') - }.margin({ bottom: 60 }) - .width('100%') - } -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/main/ets/pages/SystemAccount/ManageSystemAccounts.ets b/Account/SystemAccount/entry/src/main/ets/pages/SystemAccount/ManageSystemAccounts.ets deleted file mode 100644 index 292b9ff8f889da5e4ef6a7418ecde84d887fad69..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/ets/pages/SystemAccount/ManageSystemAccounts.ets +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_system_account_module] -import { osAccount, BusinessError } from '@kit.BasicServicesKit'; -// [End import_system_account_module] - -// [Start obtain_account_management_single_instance_object] -let accountManager = osAccount.getAccountManager(); -// [End obtain_account_management_single_instance_object] - -@Entry -@Component -struct ManageSystemAccounts { - @State message: string = 'No work done'; - @State createLocalId: number = -1; - - private async createOsAccount(): Promise { - // [Start specify_nickname_and_type_information_to_create_system_account] - let name: string = 'Bob'; - let type: osAccount.OsAccountType = osAccount.OsAccountType.NORMAL; - - accountManager.createOsAccount(name, type, (err: BusinessError, osAccountInfo: osAccount.OsAccountInfo)=>{ - console.info(`createOsAccount code is ${err.code}, message is ${err.message}`); - console.info('createOsAccount osAccountInfo:' + JSON.stringify(osAccountInfo)); - // [StartExclude specify_nickname_and_type_information_to_create_system_account] - if (!err) { - this.message = 'Account creation successful. Account name: ' + JSON.stringify(osAccountInfo.localName); - this.createLocalId = osAccountInfo.localId; - } else { - this.message = 'Failed to create account: ' + JSON.stringify(err); - } - // [EndExclude specify_nickname_and_type_information_to_create_system_account] - }); - // [End specify_nickname_and_type_information_to_create_system_account] - } - - private async findAllOsAccount(): Promise { - // [Start query_the_full_account] - accountManager.queryAllCreatedOsAccounts((err: BusinessError, accountArr: osAccount.OsAccountInfo[])=>{ - console.info(`queryAllCreatedOsAccounts code is ${err.code}, message is ${err.message}`); - console.info('queryAllCreatedOsAccounts accountArr:' + JSON.stringify(accountArr)); - // [StartExclude query_the_full_account] - if (!err) { - this.message = 'Query account successful. Account name:' + JSON.stringify(accountArr[0].localName); - } else { - this.message = 'Query account failed: ' + JSON.stringify(err); - } - // [EndExclude query_the_full_account] - }); - // [End query_the_full_account] - } - - private async findOsAccount(): Promise { - // [Start query_information_of_the_specified_account] - let localId: number = 100; - accountManager.queryOsAccountById(localId, (err: BusinessError, accountInfo: osAccount.OsAccountInfo)=>{ - console.info(`queryOsAccountById code is ${err.code}, message is ${err.message}`); - console.info('queryOsAccountById accountInfo:' + JSON.stringify(accountInfo)); - // [StartExclude query_information_of_the_specified_account] - if (!err) { - this.message = 'Query account successful. Account name for account 100: ' + JSON.stringify(accountInfo.localName); - } else { - this.message = 'Query account failed: ' + JSON.stringify(err); - } - // [EndExclude query_information_of_the_specified_account] - }); - // [End query_information_of_the_specified_account] - } - - private async changeOsAccountHead(): Promise { - // [Start change_system_account_avatar] - let localId: number = 100; - // [StartExclude change_system_account_avatar] - localId = this.createLocalId; - // [EndExclude change_system_account_avatar] - let newPhoto: string = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAAAXNSR0IArs4c6QAAAARnQU1BAA'+ - 'Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACwSURBVDhPvZLBDYMwDEV/ugsXRjAT0EHCOuFIBwkbdIRewi6unbiAyoGgSn1SFH85+Y'+ - 'q/4ljARW62X+LHS8uIzjm4dXUYF+utzBikB52Jo5e5iEPKqpACk7R9NM2RvWm5tIkD2czLCUFNKLD6IjdMHFHDzws285MgGrT0xCtp3WOKHo'+ - '+7q0mP0DZW9pNmoEFUzrQjp5cCnaen2kSJXLFD8ghbXyZCMQf/8e8Ns1XVAG/XAgqKzVnJFAAAAABJRU5ErkJggg==' - - accountManager.setOsAccountProfilePhoto(localId, newPhoto, (err: BusinessError)=>{ - console.info(`setOsAccountProfilePhoto code is ${err.code}, message is ${err.message}`); - // [StartExclude change_system_account_avatar] - if(!err) { - this.message = 'Successfully updated system account avatar' - } else { - this.message = 'Failed to update system account avatar: ' + JSON.stringify(err); - } - // [EndExclude change_system_account_avatar] - }); - // [End change_system_account_avatar] - } - - private async changeOsAccountName(): Promise { - // [Start change_system_account_name] - let localId: number = 100; - // [StartExclude change_system_account_name] - localId = this.createLocalId; - // [EndExclude change_system_account_name] - let newName: string = 'Tom'; - accountManager.setOsAccountName(localId, newName, (err: BusinessError) => { - if (err) { - console.error(`setOsAccountName failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude change_system_account_name] - this.message = 'Failed to modify system account name: ' + JSON.stringify(err); - // [EndExclude change_system_account_name] - } else { - console.info('setOsAccountName successfully'); - // [StartExclude change_system_account_name] - this.message = 'Successfully modified system account name'; - // [EndExclude change_system_account_name] - } - }); - // [End change_system_account_name] - } - - private async activateOsAccount(): Promise { - // [Start activate_system_account] - let localId: number = 101; - // [StartExclude activate_system_account] - localId = this.createLocalId; - // [EndExclude activate_system_account] - accountManager.activateOsAccount(localId, (err: BusinessError)=>{ - if (err) { - console.error(`activateOsAccount failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude activate_system_account] - this.message = 'Failed to activate system account: ' + err.code; - // [EndExclude activate_system_account] - } else { - console.info('activateOsAccount successfully'); - // [StartExclude activate_system_account] - this.message = 'Successfully activated system account' - // [EndExclude activate_system_account] - } - }); - // [End activate_system_account] - } - - private async deleteOsAccount(): Promise { - // [Start delete_the_specified_account] - let localId: number = 101; - // [StartExclude delete_the_specified_account] - localId = this.createLocalId; - // [EndExclude delete_the_specified_account] - accountManager.removeOsAccount(localId, (err: BusinessError)=>{ - if (err) { - console.error(`removeOsAccount failed, code is ${err.code}, message is ${err.message}`); - // [StartExclude delete_the_specified_account] - this.message = 'Failed to delete system account: ' + JSON.stringify(err); - // [EndExclude delete_the_specified_account] - } else { - console.info('removeOsAccount successfully'); - // [StartExclude delete_the_specified_account] - this.message = 'Successfully deleted system account' - // [EndExclude delete_the_specified_account] - } - }); - // [End delete_the_specified_account] - } - - build() { - Column() { - Text(this.message) - .id('show') - .fontSize(36) - .fontWeight(FontWeight.Bold) - Button($r('app.string.Manager1')) - .margin(10) - .id('button1') - .onClick(() => this.createOsAccount()) - Button($r('app.string.Manager2')) - .margin(10) - .id('button2') - .onClick(() => this.findAllOsAccount()) - Button($r('app.string.Manager3')) - .margin(10) - .id('button3') - .onClick(() => this.findOsAccount()) - Button($r('app.string.Manager4')) - .margin(10) - .id('button4') - .onClick(() => this.changeOsAccountHead()) - Button($r('app.string.Manager5')) - .margin(10) - .id('button5') - .onClick(() => this.changeOsAccountName()) - Button($r('app.string.Manager6')) - .margin(10) - .id('button6') - .onClick(() => this.activateOsAccount()) - Button($r('app.string.Manager7')) - .margin(10) - .id('button7') - .onClick(() => this.deleteOsAccount()) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/main/ets/pages/SystemAccount/UseConstraintManagementSystemAccount.ets b/Account/SystemAccount/entry/src/main/ets/pages/SystemAccount/UseConstraintManagementSystemAccount.ets deleted file mode 100644 index 47acddffe6e02a003a9b4d7f80c70ede13d369de..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/ets/pages/SystemAccount/UseConstraintManagementSystemAccount.ets +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_system_account_module] -import { osAccount, BusinessError } from '@kit.BasicServicesKit'; -// [End import_system_account_module] -import { router } from '@kit.ArkUI'; - -// [Start obtain_account_single_instance_object] -let accountManager = osAccount.getAccountManager(); -// [End obtain_account_single_instance_object] - -@Entry -@Component -struct UseConstraintManagementSystemAccount { - @State message: string = 'No work done'; - - private async setOsAccountConstraints(): Promise { - // [Start constraint_collections] - let localId: number = 100; - let constraint: string[] = [ 'constraint.wifi.set' ]; - // [End constraint_collections] - // [Start system_account_constraint] - try { - accountManager.setOsAccountConstraints(localId, constraint, true); - console.info('setOsAccountConstraints successfully'); - // [StartExclude system_account_constraint] - this.message = 'Successfully set the constraint list for the specified system account'; - // [EndExclude system_account_constraint] - } catch (e) { - const err = e as BusinessError; - console.error(`setOsAccountConstraints failed, error: code is ${err.code}, message is ${err.message}`); - // [StartExclude system_account_constraint] - this.message = 'Failed to set the constraint list for the specified system account'; - // [EndExclude system_account_constraint] - } - // [End system_account_constraint] - } - - private async isOsAccountConstraintEnabled(): Promise { - // [Start specify_the_system_account_id_and_constraint_name] - let localId: number = 100; - let constraint: string = 'constraint.wifi.set'; - // [End specify_the_system_account_id_and_constraint_name] - // [Start check_whether_the_specified_constraint_is_enabled] - accountManager.isOsAccountConstraintEnabled(localId, constraint).then((isEnabled: boolean) => { - if (isEnabled) { - // your business logic - // [StartExclude check_whether_the_specified_constraint_is_enabled] - this.message = 'Set the constraint list for the specified system account'; - } else { - this.message = 'Can not set the constraint list for the specified system account'; - // [EndExclude check_whether_the_specified_constraint_is_enabled] - } - }); - // [End check_whether_the_specified_constraint_is_enabled] - } - - build() { - Column() { - Text(this.message) - .id('show') - .fontSize(36) - .fontWeight(FontWeight.Bold) - Button($r('app.string.Use1')) - .margin(10) - .id('button1') - .onClick(() => this.setOsAccountConstraints()) - Button($r('app.string.Use2')) - .margin(10) - .id('button2') - .onClick(() => this.isOsAccountConstraintEnabled()) - Button($r('app.string.Use3')) - .margin(10) - .id('button3') - .onClick(() => { - router.pushUrl({ - url: 'pages/SystemAccount/ManageSystemAccounts' - }) - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/main/ets/util/CommonButton.ets b/Account/SystemAccount/entry/src/main/ets/util/CommonButton.ets deleted file mode 100644 index b2d268bf3aec25d2dcec35d282290ebc90d9d7d9..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/ets/util/CommonButton.ets +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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 router from '@ohos.router'; - -@Component -export struct CommonButton { - @State buttonName: string = ''; - @State buttonUrl: string = ''; - @State data: string = ''; - - build() { - Text(this.buttonName) - .id(this.buttonName) - .padding(px2vp(5)) - .fontSize(px2fp(24)) - .textAlign(TextAlign.Center) - .backgroundColor(Color.Blue) - .fontColor(Color.White) - .borderRadius(5) - .margin(px2vp(20)) - .padding(px2vp(15)) - .onClick(() => { - router.pushUrl({ - url: this.buttonUrl, - params: { - text: this.data, - buttonName: this.buttonName - } - }) - }) - } -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/main/module.json5 b/Account/SystemAccount/entry/src/main/module.json5 deleted file mode 100644 index 73b404544611ddb2ce8c9fdb145596f9f80195ab..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/module.json5 +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2025 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", - "requestPermissions": [{ - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION" - }], - "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/Account/SystemAccount/entry/src/main/resources/base/element/color.json b/Account/SystemAccount/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/main/resources/base/element/string.json b/Account/SystemAccount/entry/src/main/resources/base/element/string.json deleted file mode 100644 index a6934d02eacecd5cbad2c08b2e1223f1727fab26..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "system account" - }, - { - "name": "Manager1", - "value": "Create system account" - }, - { - "name": "Manager2", - "value": "Query all system accounts" - }, - { - "name": "Manager3", - "value": "Query specified system account information" - }, - { - "name": "Manager4", - "value": "Modify system account avatar" - }, - { - "name": "Manager5", - "value": "Modify system account nickname" - }, - { - "name": "Manager6", - "value": "Activate system account" - }, - { - "name": "Manager7", - "value": "Delete system account" - }, - { - "name": "Use1", - "value": "Set the constraint list for the specified system account" - }, - { - "name": "Use2", - "value": "Determine if the specified constraint for the target system account is enabled" - }, - { - "name": "Use3", - "value": "Go to ManageSystem" - } - ] -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/main/resources/base/media/background.png b/Account/SystemAccount/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Account/SystemAccount/entry/src/main/resources/base/media/foreground.png b/Account/SystemAccount/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Account/SystemAccount/entry/src/main/resources/base/media/layered_image.json b/Account/SystemAccount/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/main/resources/base/media/startIcon.png b/Account/SystemAccount/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Account/SystemAccount/entry/src/main/resources/base/profile/backup_config.json b/Account/SystemAccount/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/main/resources/base/profile/main_pages.json b/Account/SystemAccount/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 01e59d474ed71c8ce240b7b0e4c5bde146e57a3f..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/SystemAccount/ManageSystemAccounts", - "pages/SystemAccount/UseConstraintManagementSystemAccount" - ] -} diff --git a/Account/SystemAccount/entry/src/main/resources/dark/element/color.json b/Account/SystemAccount/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/mock/mock-config.json5 b/Account/SystemAccount/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/SystemAccount/entry/src/ohosTest/ets/test/Ability.test.ets b/Account/SystemAccount/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 9ca272522bf3b12990942f335f7240a4d2c6ce3e..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -function sleep(time: number) { - return new Promise((resolve: Function) => setTimeout(resolve, time)); -} -export default function abilityTest() { - describe('ActsAbilityTest', () => { - /* - * 打开应用,依次点击页面中按钮 - * 使用系统账号接口功能 - */ - it('UseConstraintManagementSystemAccountExample',0, async (done: Function) => { - console.info("uitest: TestUiExample begin"); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - } - await delegator.startAbility(want); - await sleep(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info("get top ability"); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - const driver = Driver.create(); - await driver.delayMs(1000); - - const button1 = await driver.findComponent(ON.id('UseConstraintManagementSystemAccount')); - await button1.click(); - await driver.delayMs(1000); - - const button2 = await driver.findComponent(ON.id('button1')); - await button2.click(); - await driver.delayMs(1000); - const text = await driver.findComponent(ON.id('show')); - let content1: string = await text.getText(); - expect(content1).assertEqual('Successfully set the constraint list for the specified system account'); - - const button3 = await driver.findComponent(ON.id('button2')); - await button3.click(); - await driver.delayMs(1000); - let content2: string = await text.getText(); - expect(content2).assertEqual('Set the constraint list for the specified system account'); - - const button4 = await driver.findComponent(ON.id('button3')); - await button4.click(); - await driver.delayMs(1000); - - const button5 = await driver.findComponent(ON.id('button1')); - await button5.click(); - await driver.delayMs(10000); - const text2 = await driver.findComponent(ON.id('show')); - let content3: string = await text2.getText(); - expect(content3).assertEqual('Account creation successful. Account name: "Bob"'); - - const button6 = await driver.findComponent(ON.id('button2')); - await button6.click(); - await driver.delayMs(1000); - let content4: string = await text2.getText(); - expect(content4).assertEqual('Query account successful. Account name:"user"'); - - const button7 = await driver.findComponent(ON.id('button3')); - await button7.click(); - await driver.delayMs(1000); - let content5: string = await text2.getText(); - expect(content5).assertEqual('Query account successful. Account name for account 100: "user"'); - - const button8 = await driver.findComponent(ON.id('button4')); - await button8.click(); - await driver.delayMs(1000); - let content6: string = await text2.getText(); - expect(content6).assertEqual('Successfully updated system account avatar'); - - const button9 = await driver.findComponent(ON.id('button5')); - await button9.click(); - await driver.delayMs(1000); - let content7: string = await text2.getText(); - expect(content7).assertEqual('Successfully modified system account name'); - - const button10 = await driver.findComponent(ON.id('button7')); - await button10.click(); - await driver.delayMs(10000); - let content8: string = await text2.getText(); - expect(content8).assertEqual('Successfully deleted system account'); - done(); - console.info("uitest: TestUiExample end"); - }) - }) -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/ohosTest/ets/test/List.test.ets b/Account/SystemAccount/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/ohosTest/module.json5 b/Account/SystemAccount/entry/src/ohosTest/module.json5 deleted file mode 100644 index 9983b2ba4e55e31a172f0328c82c9a75bfa00ded..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/Account/SystemAccount/entry/src/test/List.test.ets b/Account/SystemAccount/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/Account/SystemAccount/entry/src/test/LocalUnit.test.ets b/Account/SystemAccount/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/Account/SystemAccount/hvigor/hvigor-config.json5 b/Account/SystemAccount/hvigor/hvigor-config.json5 deleted file mode 100644 index cef74543b1f97c82275e4bf3434b162395bff2eb..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/Account/SystemAccount/hvigorfile.ts b/Account/SystemAccount/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Account/SystemAccount/oh-package.json5 b/Account/SystemAccount/oh-package.json5 deleted file mode 100644 index eaef52736f22c14e04fca386ba01611ab32a7e4a..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Account/SystemAccount/ohosTest.md b/Account/SystemAccount/ohosTest.md deleted file mode 100644 index 8d85ddec9590bb6f96f95f53b8305fed0420df88..0000000000000000000000000000000000000000 --- a/Account/SystemAccount/ohosTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# SystemAccount 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ---------------------------------- | -------------------------------------------- | ---------------------------------------- | -------------------------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| Set the constraint list for the specified system account | 位于UseConstraintManagementSystemAccount页面 | 点击'Set the constraint list for the specified system account' | 页面显示“Successfully set the constraint list for the specified system account” | 是 | Pass | -| Determine if the specified constraint for the target system account is enabled | 位于UseConstraintManagementSystemAccount页面 | 点击'Determine if the specified constraint for the target system account is enabled' | 页面显示“Set the constraint list for the specified system account” | 是 | Pass | -| Create system account | 位于ManageSystemAccounts页面 | 点击'Create system account' | 页面显示“Account creation successful. Account name:: "Bob"” | 是 | Pass | -| Query all system accounts | 位于ManageSystemAccounts页面 | 点击'Query all system accounts' | 页面显示“Query account successful. Account name:"user"” | 是 | Pass | -| Query specified system account information | 位于ManageSystemAccounts页面 | 点击'Query specified system account information' | 页面显示“Query account successful. Account name for account 100: "user"” | 是 | Pass | -| Modify system account avatar | 位于ManageSystemAccounts页面 | 点击'Modify system account avatar' | 页面显示“Successfully updated system account avatar” | 是 | Pass | -| Modify system account nickname | 位于ManageSystemAccounts页面 | 点击'Modify system account nickname' | 页面显示“Successfully modified system account name” | 是 | Pass | -| Delete system account | 位于ManageSystemAccounts页面 | 点击'Delete system account' | 页面显示“Successfully deleted system account” | 是 | Pass | \ No newline at end of file diff --git a/Account/SystemAccount/screenshots/SystemAccount_1.png b/Account/SystemAccount/screenshots/SystemAccount_1.png deleted file mode 100644 index 1d7ec794c6292a897740cfcde219814339a3994b..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_1.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_10.png b/Account/SystemAccount/screenshots/SystemAccount_10.png deleted file mode 100644 index 30e8339df87811f81041e178bdeb09337bd22599..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_10.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_11.png b/Account/SystemAccount/screenshots/SystemAccount_11.png deleted file mode 100644 index 8931d3c2a129fe1644eecb2b55d9b3a9b21b18d0..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_11.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_2.png b/Account/SystemAccount/screenshots/SystemAccount_2.png deleted file mode 100644 index 26a2bae68313c755c3d8b380d7571cc5c1903783..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_2.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_3.png b/Account/SystemAccount/screenshots/SystemAccount_3.png deleted file mode 100644 index b2ebf0788fcecb471818e837027be14b279304f5..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_3.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_4.png b/Account/SystemAccount/screenshots/SystemAccount_4.png deleted file mode 100644 index 003428c601687fd8d309b94e8d01facb9e671408..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_4.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_5.png b/Account/SystemAccount/screenshots/SystemAccount_5.png deleted file mode 100644 index b216e3b0281dd34abe0402d5af6f021100c0b4ca..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_5.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_6.png b/Account/SystemAccount/screenshots/SystemAccount_6.png deleted file mode 100644 index 9f4c4e852eb50d3182412bfaa0a723bd3d33d316..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_6.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_7.png b/Account/SystemAccount/screenshots/SystemAccount_7.png deleted file mode 100644 index 5137afedc7b49d54f893817ea4093c8e17de2f3c..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_7.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_8.png b/Account/SystemAccount/screenshots/SystemAccount_8.png deleted file mode 100644 index a743e513d97af5263509b3e8d8dc047b91a8c9e7..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_8.png and /dev/null differ diff --git a/Account/SystemAccount/screenshots/SystemAccount_9.png b/Account/SystemAccount/screenshots/SystemAccount_9.png deleted file mode 100644 index dfae1df5d9dcb2ae9c132e6112807ada63eec648..0000000000000000000000000000000000000000 Binary files a/Account/SystemAccount/screenshots/SystemAccount_9.png and /dev/null differ diff --git a/ArkData/DataShare/ShareConfig/.gitignore b/ArkData/DataShare/ShareConfig/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkData/DataShare/ShareConfig/AppScope/app.json5 b/ArkData/DataShare/ShareConfig/AppScope/app.json5 deleted file mode 100644 index e13c309cbfbb7cd269cbe00df46a4f4eacbbfae8..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.shareconfig", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkData/DataShare/ShareConfig/AppScope/resources/base/element/string.json b/ArkData/DataShare/ShareConfig/AppScope/resources/base/element/string.json deleted file mode 100644 index 9e2b32d1fd1fa83462717e748e42341d26fae937..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ShareConfig" - } - ] -} diff --git a/ArkData/DataShare/ShareConfig/AppScope/resources/base/media/background.png b/ArkData/DataShare/ShareConfig/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkData/DataShare/ShareConfig/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkData/DataShare/ShareConfig/AppScope/resources/base/media/foreground.png b/ArkData/DataShare/ShareConfig/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/ArkData/DataShare/ShareConfig/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkData/DataShare/ShareConfig/AppScope/resources/base/media/layered_image.json b/ArkData/DataShare/ShareConfig/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/README_zh.md b/ArkData/DataShare/ShareConfig/README_zh.md deleted file mode 100644 index d5eb6569b96d6aa070ba1cac23a8d996e8639279..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/README_zh.md +++ /dev/null @@ -1,77 +0,0 @@ -# 应用间配置共享 (ArkTS) - -## 介绍 - -本实例主要介绍应用间配置共享通过集中管理公共配置信息,在不同应用间共享配置,提升协作效率。 - - - -- [ 应用间配置共享 (ArkTS)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/database/share-config.md) - -## 效果预览 - -| 应用成功启动界面 | 文件访问结果 | -|---------------------------------------------------|-------------------------------------------------| -| | | - -使用说明: -1.在主界面中通过点击相应的按钮,应用可以完成相应的功能,完成的反馈将如日志的形式出现在主界面的上半部分。 - -## 工程目录 - -``` -//应用文件访问 -data -├──entry/src/main -| ├──ets -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -## 具体实现 - -- **配置发布方(即数据提供方)**:负责提供默认共享配置项,并能动态修改配置项信息。当前支持静态配置和动态配置两种配置方式。 - - **静态配置**:应用包在安装时提供的默认共享配置项(不依赖应用启动即生效)。 - - **动态配置**:配置发布方通过调用相关接口可以动态新增、删除或修改配置项(不依赖应用升级)。 - -- 配置的新建、更新、读取、订阅配置变化与取消订阅的使用的功能函数都集成在[Index.ets](entry/src/main/ets/pages/Index.ets)文件中。 - - - 接口请参考:[@ohos.data.dataShare](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkdata/js-apis-data-dataShare.md) - -- 一个应用最多可以发布32个配置项,这个数量是静态配置与动态配置的总和。 - -- 配置项中的allowlist使用的是appIdentifier,详见[什么是appIdentifier](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/common_problem_of_application.md#%E4%BB%80%E4%B9%88%E6%98%AFappidentifier) - -## 相关权限 - -无 - -## 依赖 - -不涉及 - -## 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:RK3568。 - -2.本示例为Stage模型,支持API20版本SDK,版本号:6.0.0.47,镜像版本号:OpenHarmony 6.0.0.47。 - -3.本示例需要使用DevEco Studio 6.0.0 Release (构建版本:6.0.0.858,构建 2025年9月24日)及以上版本才可编译运行。 - - -## 下载 - -如需单独下载本工程,执行如下命令 - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkData/DataShare/ShareConfig > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/build-profile.json5 b/ArkData/DataShare/ShareConfig/build-profile.json5 deleted file mode 100644 index c613d78e4c8b6e5e1aada4ab5bf618bfc748ed1d..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/build-profile.json5 +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/code-linter.json5 b/ArkData/DataShare/ShareConfig/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/.gitignore b/ArkData/DataShare/ShareConfig/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/build-profile.json5 b/ArkData/DataShare/ShareConfig/entry/build-profile.json5 deleted file mode 100644 index 1d2fc52afb11467a138506d8509a3ca2c123707e..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/hvigorfile.ts b/ArkData/DataShare/ShareConfig/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/obfuscation-rules.txt b/ArkData/DataShare/ShareConfig/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkData/DataShare/ShareConfig/entry/oh-package.json5 b/ArkData/DataShare/ShareConfig/entry/oh-package.json5 deleted file mode 100644 index 4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkData/DataShare/ShareConfig/entry/src/main/ets/entryability/EntryAbility.ets b/ArkData/DataShare/ShareConfig/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6a95f638674014a6d6088fb8a25f00854a309e53..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkData/DataShare/ShareConfig/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1fca37ecc34e1079aaf6557f1272cd694aa0068c..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/ets/pages/Index.ets b/ArkData/DataShare/ShareConfig/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index d73a5f78878d9cdb7ab3ec1f2c72db9a27f9c4f1..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2025 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 { dataShare } from '@kit.ArkData'; -import { BusinessError } from '@kit.BasicServicesKit'; - -// [Start publish_shared_config] -function publishSharedConfig() { - dataShare.createDataProxyHandle().then((dataProxyHandle) => { - const newConfigData: dataShare.ProxyData[] = [ - { - uri: 'datashareproxy://com.samples.shareconfig/config1', - value: 'Value1', - allowList: [ - 'appIdentifier1', - 'appIdentifier2' - ] - }, - { - uri: 'datashareproxy://com.samples.shareconfig/config2', - value: 'Value2', - allowList: [ - 'appIdentifier3', - 'appIdentifier4' - ] - } - ]; - const config: dataShare.DataProxyConfig = { - type: dataShare.DataProxyType.SHARED_CONFIG, - }; - dataProxyHandle.publish(newConfigData, config).then((results: dataShare.DataProxyResult[]) => { - results.forEach((result) => { - console.info(`URI: ${result.uri}, Result: ${result.result}`); - }); - }).catch((error: BusinessError) => { - console.error('Error publishing config:', error); - }); - }).catch((error: BusinessError) => { - console.error('Error creating DataProxyHandle:', error); - }); -} - -// [End publish_shared_config] - -// [Start delete_shared_config] -function deleteSharedConfig() { - dataShare.createDataProxyHandle().then((dataProxyHandle) => { - const urisToDelete: string[] = [ - 'datashareproxy://com.samples.shareconfig/config1', - 'datashareproxy://com.samples.shareconfig/config2' - ]; - const config: dataShare.DataProxyConfig = { - type: dataShare.DataProxyType.SHARED_CONFIG, - }; - dataProxyHandle.delete(urisToDelete, config).then((results: dataShare.DataProxyResult[]) => { - results.forEach((result) => { - console.info(`URI: ${result.uri}, Result: ${result.result}`); - }); - }).catch((error: BusinessError) => { - console.error('Error deleting config:', error); - }); - }).catch((error: BusinessError) => { - console.error('Error creating DataProxyHandle:', error); - }); -} - -// [End delete_shared_config] - -// [Start get_shared_config] -function getSharedConfig() { - dataShare.createDataProxyHandle().then((dataProxyHandle) => { - const urisToGet: string[] = [ - 'datashareproxy://com.samples.shareconfig/config1', - 'datashareproxy://com.samples.shareconfig/config2' - ]; - const config: dataShare.DataProxyConfig = { - type: dataShare.DataProxyType.SHARED_CONFIG, - }; - dataProxyHandle.get(urisToGet, config).then((results: dataShare.DataProxyGetResult[]) => { - results.forEach((result) => { - console.info(`URI: ${result.uri}, Result: ${result.result}, AllowList: ${result.allowList}`); - }); - }).catch((error: BusinessError) => { - console.error('Error getting config:', error); - }); - }).catch((error: BusinessError) => { - console.error('Error creating DataProxyHandle:', error); - }); -} - -// [End get_shared_config] - -// [Start watch_shared_config] -function watchConfigChanges() { - dataShare.createDataProxyHandle().then((dsProxyHelper) => { - const uris: string[] = [ - 'datashareproxy://com.samples.shareconfig/config1', - 'datashareproxy://com.samples.shareconfig/config2' - ]; - const config: dataShare.DataProxyConfig = { - type: dataShare.DataProxyType.SHARED_CONFIG, - }; - const callback = (err: BusinessError, changes: dataShare.DataProxyChangeInfo[]): void => { - if (err) { - console.error('err:', err); - } else { - changes.forEach((change) => { - console.info(`Change Type: ${change.type}, URI: ${change.uri}, Value: ${change.value}`); - }); - } - }; - // 监听配置变化 - const listenResults: dataShare.DataProxyResult[] = dsProxyHelper.on('dataChange', uris, config, callback); - listenResults.forEach((result) => { - console.info(`URI: ${result.uri}, Result: ${result.result}`); - }); - // 取消监听配置变化 - const unListenResults: dataShare.DataProxyResult[] = dsProxyHelper.off('dataChange', uris, config, callback); - unListenResults.forEach((result) => { - console.info(`URI: ${result.uri}, Result: ${result.result}`); - }); - }).catch((error: BusinessError) => { - console.error('Error creating DataProxyHandle:', error); - }); -} - -// [End watch_shared_config] - - -@Entry -@Component -struct Index { - @State message: string = ''; - - build() { - Column() { - TextArea({ - text: this.message, - placeholder: '', - }) - .width('100%') - .height('50%'); - Row() { - Button($r('app.string.publishSharedConfig')) - .onClick(() => { - publishSharedConfig(); - console.info('publishSharedConfig SUCCESS'); - this.message += 'publishSharedConfig SUCCESS' + '\n'; - }) - .margin({ top: 20 }) - .width('60%'); - }; - - Row() { - Button($r('app.string.deleteSharedConfig')) - .onClick(() => { - deleteSharedConfig(); - console.info('deleteSharedConfig SUCCESS'); - this.message += 'deleteSharedConfig SUCCESS' + '\n'; - }) - .margin({ top: 20 }) - .width('60%'); - }; - - Row() { - Button($r('app.string.getSharedConfig')) - .onClick(() => { - getSharedConfig(); - console.info('getSharedConfig SUCCESS'); - this.message += 'getSharedConfig SUCCESS' + '\n'; - }) - .margin({ top: 20 }) - .width('60%'); - }; - - Row() { - Button($r('app.string.watchConfigChanges')) - .onClick(() => { - watchConfigChanges(); - console.info('watchConfigChanges SUCCESS'); - this.message += 'watchConfigChanges SUCCESS' + '\n'; - }) - .margin({ top: 20 }) - .width('60%'); - }; - }; - } -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/module.json5 b/ArkData/DataShare/ShareConfig/entry/src/main/module.json5 deleted file mode 100644 index e93dadfa773b13cd6a84d2a3916544f4e6e22766..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone" - ], - "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": [ - "ohos.want.action.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/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/element/color.json b/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/element/float.json b/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/element/string.json b/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f40149a13cc6e8c6e9b1a50dc079c84f892e6074..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "publishSharedConfig", - "value": "发布或修改配置项" - }, - { - "name": "deleteSharedConfig", - "value": "删除配置项" - }, - { - "name": "getSharedConfig", - "value": "获取配置项信息" - }, - { - "name": "watchConfigChanges", - "value": "监听/取消监听配置变化" - } - ] -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/background.png b/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/foreground.png b/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/layered_image.json b/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/startIcon.png b/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/profile/backup_config.json b/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/profile/main_pages.json b/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkData/DataShare/ShareConfig/entry/src/main/resources/dark/element/color.json b/ArkData/DataShare/ShareConfig/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkData/DataShare/ShareConfig/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index b3f044b3a9458b54af9a1c95483cc7588073d9f0..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Component, Driver, ON, } from '@kit.TestKit'; - -import { dataShare } from '@kit.ArkData'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -let TAG = 'SharedConfigPublishTest '; -const DELAY_TIME = 1500; // delay time 1.5 second - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -const abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - -const newConfigData: dataShare.ProxyData[] = [ - { - uri: 'datashareproxy://com.samples.shareconfig/config1', - value: 'Value1', - allowList: [ - 'appIdentifier1', - 'appIdentifier2' - ] - }, - { - uri: 'datashareproxy://com.samples.shareconfig/config2', - value: 'Value2', - allowList: [ - 'appIdentifier3', - 'appIdentifier4' - ] - } -]; - -async function getResourceString(resource: Resource): Promise { - let manage = abilityDelegator.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - - /** - * @tc.number StartAbility_001 - * @tc.name StartAbility_001 - * @tc.desc 启动Ability - */ - it('StartAbility_001', 0, async (done: Function) => { - console.info(TAG + 'StartAbility_001 begin'); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - - await delegator.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info(TAG + 'get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - console.info(TAG + 'StartAbility_001 end'); - }); - - /** - * @tc.number SharedConfigPublishTest001 - * @tc.name SharedConfigPublishTest001 - * @tc.desc 发布指定配置项 - */ - it('SharedConfigPublishTest001', 0, async (done: Function) => { - console.info(TAG + 'SharedConfigPublishTest001 start'); - let str = await getResourceString($r('app.string.publishSharedConfig')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - // publishSharedConfig(); - - // get config published before - let testUri1 = 'datashareproxy://com.samples.shareconfig/config1'; - let urisToGet = [testUri1]; - let config: dataShare.DataProxyConfig = { - type: dataShare.DataProxyType.SHARED_CONFIG - }; - let expectedValue = 'Value1'; - let expectedAllowList = [ - 'appIdentifier1', - 'appIdentifier2' - ]; - try { - dataShare.createDataProxyHandle().then((dataProxyHandle) => { - dataProxyHandle!.get(urisToGet, config).then(results => { - expect(results.length).assertEqual(urisToGet.length); - expect(results[0].uri).assertEqual(testUri1); - expect(results[0].result).assertEqual(dataShare.DataProxyErrorCode.SUCCESS); - expect(results[0].value).assertEqual(expectedValue); - // expect(results[0].allowList).assertEqual(expectedAllowList); - }).catch((err: BusinessError) => { - console.error(TAG + 'SharedConfigGetTest001 failed.code =' + err.code + ', message=' + err.message); - expect().assertFail(); - }); - }); - } catch (err) { - console.error(TAG + 'SharedConfigGetTest001 failed,code =' + err.code + ',message=' + err.message); - expect().assertFail(); - } - done(); - console.info(TAG + 'SharedConfigPublishTest001 end'); - }); - - /** - * @tc.number SharedConfigDeleteTest001 - * @tc.name SharedConfigDeleteTest001 - * @tc.desc 删除配置项 - */ - it('SharedConfigDeleteTest001', 0, async (done: Function) => { - console.info(TAG + 'SharedConfigDeleteTest001 start'); - - let testUri1 = 'datashareproxy://com.samples.shareconfig/config1'; - let urisToGet = [testUri1]; - let config: dataShare.DataProxyConfig = { - type: dataShare.DataProxyType.SHARED_CONFIG - }; - - try { - let dataProxyHandle = await dataShare.createDataProxyHandle(); - // publish config at first - dataProxyHandle.publish(newConfigData, config).then((results: dataShare.DataProxyResult[]) => { - results.forEach((result) => { - console.info(`URI: ${result.uri}, Result: ${result.result}`); - }); - }).catch((error: BusinessError) => { - console.error('Error publishing config:', error); - }); - // get button - let str = await getResourceString($r('app.string.deleteSharedConfig')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - // click button and wait - await button.click(); - await driver.delayMs(DELAY_TIME); - - // get return uri exist - dataProxyHandle!.get(urisToGet, config).then(results => { - expect(results.length).assertEqual(urisToGet.length); - expect(results[0].uri).assertEqual(testUri1); - expect(results[0].result).assertEqual(dataShare.DataProxyErrorCode.URI_NOT_EXIST); - expect(results[0].value).assertEqual(undefined); - expect(results[0].allowList).assertEqual(undefined); - }).catch((err: BusinessError) => { - console.error(TAG + 'SharedConfigDeleteTest001 failed.code =' + err.code + ', message=' + err.message); - expect().assertFail(); - }); - } catch (err) { - console.error(TAG + 'SharedConfigDeleteTest001 failed,code =' + err.code + ',message=' + err.message); - expect().assertFail(); - } - done(); - console.info(TAG + 'SharedConfigDeleteTest001 end'); - }); - - /** - * @tc.number SharedConfigGetTest001 - * @tc.name SharedConfigGetTest001 - * @tc.desc 获取配置项信息 - */ - it('SharedConfigGetTest001', 0, async (done: Function) => { - console.info(TAG + 'SharedConfigGetTest001 start'); - - let testUri1 = 'datashareproxy://com.samples.shareconfig/config1'; - let urisToGet = [testUri1]; - let config: dataShare.DataProxyConfig = { - type: dataShare.DataProxyType.SHARED_CONFIG - }; - - try { - let dataProxyHandle = await dataShare.createDataProxyHandle(); - // publish config at first - dataProxyHandle.publish(newConfigData, config).then((results: dataShare.DataProxyResult[]) => { - expect(results.length).assertEqual(newConfigData.length); - expect(results[0].uri).assertEqual(testUri1); - expect(results[0].result).assertEqual(dataShare.DataProxyErrorCode.SUCCESS); - results.forEach((result) => { - console.info(`URI: ${result.uri}, Result: ${result.result}`); - }); - }).catch((error: BusinessError) => { - console.error('Error publishing config:', error); - }); - - // get button - let str = await getResourceString($r('app.string.getSharedConfig')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - // click button and wait - await button.click(); - await driver.delayMs(DELAY_TIME); - } catch (err) { - console.error(TAG + 'SharedConfigGetTest001 failed,code =' + err.code + ',message=' + err.message); - expect().assertFail(); - } - done(); - console.info(TAG + 'SharedConfigGetTest001 end'); - }); - - /** - * @tc.number WatchSharedConfigChangeTest001 - * @tc.name WatchSharedConfigChangeTest001 - * @tc.desc 监听与取消监听配置变化 - */ - it('WatchSharedConfigChangeTest001', 0, async (done: Function) => { - console.info(TAG + 'WatchSharedConfigChangeTest001 start'); - - let config: dataShare.DataProxyConfig = { - type: dataShare.DataProxyType.SHARED_CONFIG - }; - - try { - let dataProxyHandle = await dataShare.createDataProxyHandle(); - // publish config at first - dataProxyHandle.publish(newConfigData, config).then((results: dataShare.DataProxyResult[]) => { - results.forEach((result) => { - console.info(`URI: ${result.uri}, Result: ${result.result}`); - }); - }).catch((error: BusinessError) => { - console.error('Error publishing config:', error); - }); - // get button - let str = await getResourceString($r('app.string.watchConfigChanges')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - // click button and wait - await button.click(); - await driver.delayMs(DELAY_TIME); - } catch (err) { - console.error(TAG + 'WatchSharedConfigChangeTest001 failed,code =' + err.code + ',message=' + err.message); - expect().assertFail(); - } - done(); - console.info(TAG + 'WatchSharedConfigChangeTest001 end'); - }); - }); -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/ohosTest/ets/test/List.test.ets b/ArkData/DataShare/ShareConfig/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/ohosTest/module.json5 b/ArkData/DataShare/ShareConfig/entry/src/ohosTest/module.json5 deleted file mode 100644 index 32cf39532cec143354a4814c46c160e70f607411..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkData/DataShare/ShareConfig/entry/src/test/List.test.ets b/ArkData/DataShare/ShareConfig/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/entry/src/test/LocalUnit.test.ets b/ArkData/DataShare/ShareConfig/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/hvigor/hvigor-config.json5 b/ArkData/DataShare/ShareConfig/hvigor/hvigor-config.json5 deleted file mode 100644 index e0c92fdad58a7851692e144df9a4b1f4953ec26c..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/ArkData/DataShare/ShareConfig/hvigorfile.ts b/ArkData/DataShare/ShareConfig/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkData/DataShare/ShareConfig/oh-package.json5 b/ArkData/DataShare/ShareConfig/oh-package.json5 deleted file mode 100644 index 34a126da756d306c9412997bcd7d57a34b6da0a2..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkData/DataShare/ShareConfig/ohosTest.md b/ArkData/DataShare/ShareConfig/ohosTest.md deleted file mode 100644 index 7899c1f056754ed8a6b3107864e8032b6046f0ea..0000000000000000000000000000000000000000 --- a/ArkData/DataShare/ShareConfig/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|-------------|--------|----|--------------------------------------|------|------| -| 发布或修改指定配置项 | 设备正常运行 | | 日志中输出publishSharedConfig SUCCESS | 是 | pass | -| 删除指定配置项 | 设备正常运行 | | 日志中输出deleteSharedConfig SUCCESS | 是 | pass | -| 获取配置项信息 | 设备正常运行 | | 日志中输出readWriteFileWithStream SUCCESS | 是 | pass | -| 监听/取消监听配置变化 | 设备正常运行 | | 日志中输出watchConfigChanges SUCCESS | 是 | pass | diff --git a/ArkData/DataShare/ShareConfig/screenshots/end.png b/ArkData/DataShare/ShareConfig/screenshots/end.png deleted file mode 100644 index 774f7826d633664c2f24d0f12071d5d20c8413dc..0000000000000000000000000000000000000000 Binary files a/ArkData/DataShare/ShareConfig/screenshots/end.png and /dev/null differ diff --git a/ArkData/DataShare/ShareConfig/screenshots/start.png b/ArkData/DataShare/ShareConfig/screenshots/start.png deleted file mode 100644 index a7efe9e62ab79de3512b54a83314589c371f2c05..0000000000000000000000000000000000000000 Binary files a/ArkData/DataShare/ShareConfig/screenshots/start.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySoloist/.gitignore b/ArkGraphics2D/DisplaySoloist/.gitignore deleted file mode 100644 index ea27eaff8c3ecef3e9ebe6399a5f9073cd962a7b..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -oh-package-lock.json5 \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/AppScope/app.json5 b/ArkGraphics2D/DisplaySoloist/AppScope/app.json5 deleted file mode 100644 index feca14423759e8b0358a04fa19b0917d01b6da04..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.Displaysoloist", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkGraphics2D/DisplaySoloist/AppScope/resources/base/element/string.json b/ArkGraphics2D/DisplaySoloist/AppScope/resources/base/element/string.json deleted file mode 100644 index 8f27bbd6363b153e19eb343ee29e37f4a2813c8e..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DisplaySoloist" - } - ] -} diff --git a/ArkGraphics2D/DisplaySoloist/AppScope/resources/base/media/app_icon.png b/ArkGraphics2D/DisplaySoloist/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySoloist/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySoloist/README.md b/ArkGraphics2D/DisplaySoloist/README.md deleted file mode 100644 index d23435ceb2a2786987178d32abae11223ab7e6dc..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# DisplaySoloist分级管控 - -### 介绍 - -本示例通过 DisplaySoloist 系列功能,使用 UI 外的线程对 XComponent 的绘制内容,设置开发者所期望的帧率。使用 [NativeDisplaySoloist](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/displaysoloist-native-guidelines) 和 [Drawing](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/graphic-drawing-overview) 来实现图像绘制和显示。 - -### 效果预览 - -| XComponent | -| :------------------------------------------------------: | -| | - -使用说明 - -1.进入 XComponent 页面,依次点击“**Start**”,三个方块分别按照 30Hz、60Hz、120Hz 移动;点击“**Stop**”动画停止。 - -### 工程目录 - -``` -├──entry/src/main -│ ├──cpp // C++代码区 -│ │ ├──CMakeLists.txt // CMake配置文件 -│ │ ├──napi_init.cpp // Napi模块注册 -│ │ ├──common -│ │ │ └──log_common.h // 日志封装定义文件 -│ │ ├──plugin // 生命周期管理模块 -│ │ │ ├──plugin_manager.cpp -│ │ │ └──plugin_manager.h -│ │ ├──samples // samples渲染模块 -│ │ │ ├──sample_xcomponent.cpp -│ │ │ └──sample_xcomponent.h -│ ├──ets // ets代码区 -│ │ ├──entryability -│ │ │ ├──EntryAbility.ts // 程序入口类 -| | | └──EntryAbility.ets -| | ├──interface -│ │ │ └──XComponentContext.ts // XComponentContext -│ │ ├──pages // 页面文件 -│ │ | └──Index.ets // XComponent页面 -│ │ ├──utils // 工具类 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -* XComponent:通过在 IDE 中的 Native C++ 工程,在 TS 侧中声明对外接口为 register、unregister 以及 destroy;在 C++ 侧调用 NativeDisplaySoloist 分级管控接口,并在使用 drawing 来绘制期望帧率图像。 - - | 接口名 | 描述 | - | ------------------------------------------- | --------------------------------------------------- | - | OH_DisplaySoloist_Create | 创建一个OH_DisplaySoloist实例 | - | OH_DisplaySoloist_Destroy | 销毁一个OH_DisplaySoloist实例 | - | OH_DisplaySoloist_Start | 设置每帧回调函数,每次vsync信号到来时启动每帧回调 | - | OH_DisplaySoloist_Stop | 停止请求下一次vsync信号,并停止调用回调函数callback | - | OH_DisplaySoloist_SetExpectedFrameRateRange | 设置期望帧率范围 | - - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持在标准系统上运行; - -2.本示例为 Stage 模型,已适配 API version 14 版本 SDK,SDK 版本号(API Version 14 5.0.2.57); - -3.本示例需要使用 DevEco Studio 版本号(5.0.5.306)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo ArkGraphics2D/DisplaySoloist/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/build-profile.json5 b/ArkGraphics2D/DisplaySoloist/build-profile.json5 deleted file mode 100644 index ee9f710ef18f2965ae1469bdb5d65f02591834f5..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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": "5.0.2(14)", - "targetSdkVersion": "5.0.2(14)", - "runtimeOS": "HarmonyOS" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/code-linter.json5 b/ArkGraphics2D/DisplaySoloist/code-linter.json5 deleted file mode 100644 index 44d50304643a42f437232b908c9b44c51cea8f60..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/code-linter.json5 +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/.gitignore b/ArkGraphics2D/DisplaySoloist/entry/.gitignore deleted file mode 100644 index eadab4e1522296628f32a70228b2c758ecab4759..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test -/oh-package-lock.json5 \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/build-profile.json5 b/ArkGraphics2D/DisplaySoloist/entry/build-profile.json5 deleted file mode 100644 index 98128447b577770b257af752b1d5e91c850f64f4..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/build-profile.json5 +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/hvigorfile.ts b/ArkGraphics2D/DisplaySoloist/entry/hvigorfile.ts deleted file mode 100644 index 90e5d264bb75363bfb6969f0b832c2f1b9a02a75..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySoloist/entry/obfuscation-rules.txt b/ArkGraphics2D/DisplaySoloist/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkGraphics2D/DisplaySoloist/entry/oh-package.json5 b/ArkGraphics2D/DisplaySoloist/entry/oh-package.json5 deleted file mode 100644 index 5b21e253af246edab8b6ef4f10938f4417e8bc25..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/CMakeLists.txt b/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 0e5253594a889deea00f2e32cdc8cff59ca626a7..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(drawing_test) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED - napi_init.cpp - samples/sample_xcomponent.cpp - plugin/plugin_manager.cpp -) -find_library( - # Sets the name of the path variable. - hilog-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - hilog_ndk.z -) -target_link_libraries(entry PUBLIC ${hilog-lib}) -target_link_libraries(entry PUBLIC libace_napi.z.so libnative_drawing.so libnative_window.so libace_ndk.z.so libnative_display_soloist.so) \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/common/log_common.h b/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/common/log_common.h deleted file mode 100644 index db232e78289ae5cddb36f10c8e98b389d19b0a47..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/common/log_common.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef LOG_COMMON_H -#define LOG_COMMON_H -#include -#define LOG_PRINT_DOMAIN 0xFF00 -#define APP_LOG_DOMAIN 0x0001 -constexpr const char *APP_LOG_TAG = "DisplaySoloistSample"; -#define SAMPLE_LOGI(...) ((void)OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) -#define SAMPLE_LOGD(...) ((void)OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) -#define SAMPLE_LOGW(...) ((void)OH_LOG_Print(LOG_APP, LOG_WARN, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) -#define SAMPLE_LOGE(...) ((void)OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) - -#endif // LOG_COMMON_H diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/napi_init.cpp b/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 43e51b0018c9d42e3e9831a4953e3ef1b3eee3c0..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include -#include "napi/native_api.h" -#include "common/log_common.h" -#include "plugin/plugin_manager.h" - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - SAMPLE_LOGI("napi init"); - PluginManager::GetInstance()->Export(env, exports); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/plugin/plugin_manager.cpp b/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/plugin/plugin_manager.cpp deleted file mode 100644 index b71c471ab9250ce025eba9f2f0a561960adb6c58..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/plugin/plugin_manager.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include -#include -#include "common/log_common.h" -#include "plugin_manager.h" - -PluginManager *PluginManager::GetInstance() -{ - static PluginManager pluginManager; - return &pluginManager; -} - -PluginManager::~PluginManager() -{ - SAMPLE_LOGI("~PluginManager"); - for (auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for (auto iter = pluginRenderMap_.begin(); iter != pluginRenderMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - pluginRenderMap_.clear(); -} - -// [Start display_soloist_export_api] -void PluginManager::Export(napi_env env, napi_value exports) -{ - nativeXComponentMap_.clear(); - pluginRenderMap_.clear(); - if ((env == nullptr) || (exports == nullptr)) { - SAMPLE_LOGE("Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - SAMPLE_LOGE("Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - SAMPLE_LOGE("Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto context = PluginManager::GetInstance(); - if ((context != nullptr) && (nativeXComponent != nullptr)) { - context->SetNativeXComponent(id, nativeXComponent); - auto render = context->GetRender(id); - if (render != nullptr) { - render->RegisterCallback(nativeXComponent); - render->Export(env, exports); - } else { - SAMPLE_LOGE("render is nullptr"); - } - } -} -// [End display_soloist_export_api] - -void PluginManager::SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent) -{ - SAMPLE_LOGI("set native xComponent, ID = %{public}s.", id.c_str()); - if (nativeXComponent == nullptr) { - SAMPLE_LOGE("xcomponent null"); - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent *tmp = nativeXComponentMap_[id]; - delete tmp; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -SampleXComponent *PluginManager::GetRender(std::string &id) -{ - if (pluginRenderMap_.find(id) == pluginRenderMap_.end()) { - SampleXComponent *instance = SampleXComponent::GetInstance(id); - pluginRenderMap_[id] = instance; - return instance; - } - return pluginRenderMap_[id]; -} diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/plugin/plugin_manager.h b/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/plugin/plugin_manager.h deleted file mode 100644 index 0c323bb130ada5130718aea50a50c6c5789e3904..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/plugin/plugin_manager.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef PLUGIN_MANAGER_H -#define PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include -#include "samples/sample_xcomponent.h" - -// [Start display_soloist_create_plugin_manager] -class PluginManager { -public: - ~PluginManager(); - - static PluginManager *GetInstance(); - - void SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent); - SampleXComponent *GetRender(std::string &id); - void Export(napi_env env, napi_value exports); - -private: - std::unordered_map nativeXComponentMap_; - std::unordered_map pluginRenderMap_; -}; -// [End display_soloist_create_plugin_manager] -#endif // PLUGIN_MANAGER_H diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/samples/sample_xcomponent.cpp b/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/samples/sample_xcomponent.cpp deleted file mode 100644 index 464f21b74af20dcae486375cd16e4c928a9bd56f..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/samples/sample_xcomponent.cpp +++ /dev/null @@ -1,473 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include -#include -#include "common/log_common.h" -#include "sample_xcomponent.h" - -static std::unordered_map g_displaySync; - -static void OnSurfaceCreatedCB(OH_NativeXComponent *component, void *window) -{ - SAMPLE_LOGI("OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - SAMPLE_LOGE("OnSurfaceCreatedCB: component or window is null"); - return; - } - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - auto render = SampleXComponent::GetInstance(id); - OHNativeWindow *nativeWindow = static_cast(window); - render->SetNativeWindow(nativeWindow); - - uint64_t width; - uint64_t height; - int32_t xSize = OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - if ((xSize == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) && (render != nullptr)) { - render->SetHeight(height); - render->SetWidth(width); - SAMPLE_LOGI("xComponent width = %{public}llu, height = %{public}llu", width, height); - } -} - -static void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window) -{ - SAMPLE_LOGI("OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - SAMPLE_LOGE("OnSurfaceDestroyedCB: component or window is null"); - return; - } - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - SampleXComponent::Release(id); -} - -// [Start display_soloist_frame_rate_setting_and_subscription_function_registration] -static void TestCallback(long long timestamp, long long targetTimestamp, void *data) -{ - SAMPLE_LOGI("test callback timestamp = %{public}llu, ", timestamp); - OH_NativeXComponent *component = nullptr; - component = static_cast(data); - if (component == nullptr) { - SAMPLE_LOGE("TestCallback: component is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("TestCallback: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - auto render = SampleXComponent::GetInstance(id); - OHNativeWindow *nativeWindow = render->GetNativeWindow(); - uint64_t width; - uint64_t height; - - int32_t xSize = OH_NativeXComponent_GetXComponentSize(component, nativeWindow, &width, &height); - if ((xSize == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) && (render != nullptr)) { - render->Prepare(); - render->Create(); - if (id == "xcomponentId_30") { - int offset = 16; - render->ConstructPath(offset, offset, render->defaultOffsetY); - } - if (id == "xcomponentId_120") { - int offset = 4; - render->ConstructPath(offset, offset, render->defaultOffsetY); - } - render->SetPenAndBrush(); - render->DrawPath(); - render->DisPlay(); - render->Destroy(); - } -} -// [End display_soloist_frame_rate_setting_and_subscription_function_registration] - -static std::unordered_map g_instance; - -void SampleXComponent::SetWidth(uint64_t width) { width_ = width; } - -void SampleXComponent::SetHeight(uint64_t height) { height_ = height; } - -void SampleXComponent::SetNativeWindow(OHNativeWindow *nativeWindow) { nativeWindow_ = nativeWindow; } - -OHNativeWindow *SampleXComponent::GetNativeWindow() { return nativeWindow_; } - -void SampleXComponent::Prepare() -{ - if (nativeWindow_ == nullptr) { - SAMPLE_LOGE("nativeWindow_ is nullptr"); - return; - } - int ret = OH_NativeWindow_NativeWindowRequestBuffer(nativeWindow_, &buffer_, &fenceFd_); - SAMPLE_LOGI("request buffer ret = %{public}d", ret); - bufferHandle_ = OH_NativeWindow_GetBufferHandleFromNative(buffer_); - mappedAddr_ = static_cast( - mmap(bufferHandle_->virAddr, bufferHandle_->size, PROT_READ | PROT_WRITE, MAP_SHARED, bufferHandle_->fd, 0)); - if (mappedAddr_ == MAP_FAILED) { - SAMPLE_LOGE("mmap failed"); - } -} - -void SampleXComponent::DisPlay() -{ - void *bitmapAddr = OH_Drawing_BitmapGetPixels(cBitmap_); - uint32_t *value = static_cast(bitmapAddr); - - uint32_t *pixel = static_cast(mappedAddr_); - if (pixel == nullptr) { - SAMPLE_LOGE("pixel is null"); - return; - } - if (value == nullptr) { - SAMPLE_LOGE("value is null"); - return; - } - for (uint32_t x = 0; x < width_; x++) { - for (uint32_t y = 0; y < height_; y++) { - *pixel++ = *value++; - } - } - Region region{nullptr, 0}; - OH_NativeWindow_NativeWindowFlushBuffer(nativeWindow_, buffer_, fenceFd_, region); - int result = munmap(mappedAddr_, bufferHandle_->size); - if (result == -1) { - SAMPLE_LOGE("munmap failed!"); - } -} - -void SampleXComponent::Create() -{ - uint32_t width = static_cast(bufferHandle_->stride / 4); - cBitmap_ = OH_Drawing_BitmapCreate(); - OH_Drawing_BitmapFormat cFormat{COLOR_FORMAT_RGBA_8888, ALPHA_FORMAT_OPAQUE}; - OH_Drawing_BitmapBuild(cBitmap_, width, height_, &cFormat); - - cCanvas_ = OH_Drawing_CanvasCreate(); - OH_Drawing_CanvasBind(cCanvas_, cBitmap_); - OH_Drawing_CanvasClear(cCanvas_, OH_Drawing_ColorSetArgb(0xFF, 0xFF, 0xFF, 0xFF)); -} - -void SampleXComponent::ConstructPath(int x, int y, int offsetY) -{ - float offsetOfAy = 100.0; - float offsetOfCy = 200.0; - - aY = offsetOfAy + offsetY; - cY = offsetOfCy + offsetY; - - if (desc) { - float offset = 1.0; - aX -= x * offset; - bX -= x * offset; - } else { - float offset = 1.0; - aX += x * offset; - bX += x * offset; - } - - if (bX >= width_) { - desc = true; - } - - if (aX <= 0) { - desc = false; - } - - float bY = aY; - float cX = bX; - float dX = aX; - float dY = cY; - - cPath_ = OH_Drawing_PathCreate(); - OH_Drawing_PathMoveTo(cPath_, aX, aY); - OH_Drawing_PathLineTo(cPath_, bX, bY); - OH_Drawing_PathLineTo(cPath_, cX, cY); - OH_Drawing_PathLineTo(cPath_, dX, dY); - - OH_Drawing_PathClose(cPath_); -} - -void SampleXComponent::SetPenAndBrush() -{ - constexpr float penWidth = 10.0f; // pen width 10 - cPen_ = OH_Drawing_PenCreate(); - OH_Drawing_PenSetAntiAlias(cPen_, true); - OH_Drawing_PenSetColor(cPen_, OH_Drawing_ColorSetArgb(0xFF, 0xFF, 0x00, 0x00)); - OH_Drawing_PenSetWidth(cPen_, penWidth); - OH_Drawing_PenSetJoin(cPen_, LINE_ROUND_JOIN); - OH_Drawing_CanvasAttachPen(cCanvas_, cPen_); - - cBrush_ = OH_Drawing_BrushCreate(); - OH_Drawing_BrushSetColor(cBrush_, OH_Drawing_ColorSetArgb(0xFF, 0x00, 0xFF, 0x00)); - - OH_Drawing_CanvasAttachBrush(cCanvas_, cBrush_); -} - -void SampleXComponent::DrawPath() -{ - OH_Drawing_CanvasDrawPath(cCanvas_, cPath_); -} - -void ExecuteDisplaySoloist(std::string id, DisplaySoloist_ExpectedRateRange range, bool useExclusiveThread, - OH_NativeXComponent *nativeXComponent) -{ - OH_DisplaySoloist *nativeDisplaySoloist = nullptr; - if (g_displaySync.find(id) == g_displaySync.end()) { - g_displaySync[id] = OH_DisplaySoloist_Create(useExclusiveThread); - } - nativeDisplaySoloist = g_displaySync[id]; - OH_DisplaySoloist_SetExpectedFrameRateRange(nativeDisplaySoloist, &range); - OH_DisplaySoloist_Start(nativeDisplaySoloist, TestCallback, nativeXComponent); -} - -// [Start display_soloist_napi_register] -napi_value SampleXComponent::NapiRegister(napi_env env, napi_callback_info info) -{ - SAMPLE_LOGI("NapiRegister"); - if ((env == nullptr) || (info == nullptr)) { - SAMPLE_LOGE("NapiRegister: env or info is null"); - return nullptr; - } - - napi_value thisArg; - if (napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr) != napi_ok) { - SAMPLE_LOGE("NapiRegister: napi_get_cb_info fail"); - return nullptr; - } - - napi_value exportInstance; - if (napi_get_named_property(env, thisArg, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - SAMPLE_LOGE("NapiRegister: napi_get_named_property fail"); - return nullptr; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - SAMPLE_LOGE("NapiRegister: napi_unwrap fail"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("NapiRegister: Unable to get XComponent id"); - return nullptr; - } - SAMPLE_LOGI("RegisterID = %{public}s", idStr); - std::string id(idStr); - SampleXComponent *render = SampleXComponent().GetInstance(id); - if (render != nullptr) { - DisplaySoloist_ExpectedRateRange range; - bool useExclusiveThread = false; - if (id == "xcomponentId30") { - range = {30, 120, 30}; - } - - if (id == "xcomponentId120") { - range = {30, 120, 120}; - } - ExecuteDisplaySoloist(id, range, useExclusiveThread, nativeXComponent); - } - return nullptr; -} -// [End display_soloist_napi_register] - -napi_value SampleXComponent::NapiUnregister(napi_env env, napi_callback_info info) -{ - SAMPLE_LOGI("NapiUnregister"); - if ((env == nullptr) || (info == nullptr)) { - SAMPLE_LOGE("NapiUnregister: env or info is null"); - return nullptr; - } - - napi_value thisArg; - if (napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr) != napi_ok) { - SAMPLE_LOGE("NapiUnregister: napi_get_cb_info fail"); - return nullptr; - } - - napi_value exportInstance; - if (napi_get_named_property(env, thisArg, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - SAMPLE_LOGE("NapiUnregister: napi_get_named_property fail"); - return nullptr; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - SAMPLE_LOGE("NapiUnregister: napi_unwrap fail"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("NapiUnregister: Unable to get XComponent id"); - return nullptr; - } - SAMPLE_LOGI("ID = %{public}s", idStr); - std::string id(idStr); - SampleXComponent *render = SampleXComponent().GetInstance(id); - if (render != nullptr) { - OH_DisplaySoloist_Stop(g_displaySync[id]); - SAMPLE_LOGI("NapiUnregister executed"); - } else { - SAMPLE_LOGE("render is nullptr"); - } - return nullptr; -} - -napi_value SampleXComponent::NapiDestroy(napi_env env, napi_callback_info info) -{ - SAMPLE_LOGI("NapiUnregister"); - if ((env == nullptr) || (info == nullptr)) { - SAMPLE_LOGE("NapiDestroy: env or info is null"); - return nullptr; - } - - napi_value thisArg; - if (napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr) != napi_ok) { - SAMPLE_LOGE("NapiDestroy: napi_get_cb_info fail"); - return nullptr; - } - - napi_value exportInstance; - if (napi_get_named_property(env, thisArg, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - SAMPLE_LOGE("NapiDestroy: napi_get_named_property fail"); - return nullptr; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - SAMPLE_LOGE("NapiDestroy: napi_unwrap fail"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("NapiDestroy: Unable to get XComponent id"); - return nullptr; - } - SAMPLE_LOGI("ID = %{public}s", idStr); - std::string id(idStr); - SampleXComponent *render = SampleXComponent().GetInstance(id); - if (render != nullptr) { - OH_DisplaySoloist_Destroy(g_displaySync[id]); - g_displaySync.erase(id); - SAMPLE_LOGI("NapiUnregister executed"); - } else { - SAMPLE_LOGE("render is nullptr"); - } - return nullptr; -} - -SampleXComponent::~SampleXComponent() -{ - OH_Drawing_BrushDestroy(cBrush_); - cBrush_ = nullptr; - OH_Drawing_PenDestroy(cPen_); - cPen_ = nullptr; - OH_Drawing_PathDestroy(cPath_); - cPath_ = nullptr; - OH_Drawing_CanvasDestroy(cCanvas_); - cCanvas_ = nullptr; - OH_Drawing_BitmapDestroy(cBitmap_); - cBitmap_ = nullptr; - - buffer_ = nullptr; - bufferHandle_ = nullptr; - nativeWindow_ = nullptr; - mappedAddr_ = nullptr; -} - -void SampleXComponent::Destroy() -{ - OH_Drawing_BrushDestroy(cBrush_); - cBrush_ = nullptr; - OH_Drawing_PenDestroy(cPen_); - cPen_ = nullptr; - OH_Drawing_PathDestroy(cPath_); - cPath_ = nullptr; - OH_Drawing_CanvasDestroy(cCanvas_); - cCanvas_ = nullptr; - OH_Drawing_BitmapDestroy(cBitmap_); - cBitmap_ = nullptr; -} - -void SampleXComponent::Release(std::string &id) -{ - SampleXComponent *render = SampleXComponent::GetInstance(id); - if (render != nullptr) { - delete render; - render = nullptr; - g_instance.erase(g_instance.find(id)); - } -} - -void SampleXComponent::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - SAMPLE_LOGE("Export: env or exports is null"); - return; - } - napi_property_descriptor desc[] = { - {"register", nullptr, SampleXComponent::NapiRegister, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"unregister", nullptr, SampleXComponent::NapiUnregister, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"destroy", nullptr, SampleXComponent::NapiDestroy, nullptr, nullptr, nullptr, napi_default, nullptr}}; - - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - SAMPLE_LOGE("Export: napi_define_properties failed"); - } -} - -void SampleXComponent::RegisterCallback(OH_NativeXComponent *nativeXComponent) -{ - SAMPLE_LOGI("register callback"); - renderCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - renderCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - // Callback must be initialized - renderCallback_.DispatchTouchEvent = nullptr; - renderCallback_.OnSurfaceChanged = nullptr; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &renderCallback_); -} - -SampleXComponent *SampleXComponent::GetInstance(std::string &id) -{ - if (g_instance.find(id) == g_instance.end()) { - SampleXComponent *render = new SampleXComponent(id); - g_instance[id] = render; - return render; - } else { - return g_instance[id]; - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/samples/sample_xcomponent.h b/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/samples/sample_xcomponent.h deleted file mode 100644 index 9ced152ef6a1c5ad7d19ed8ac8b41d123042e26f..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/samples/sample_xcomponent.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef SAMPLE_XCOMPONENT_H -#define SAMPLE_XCOMPONENT_H -// [Start display_soloist_import_module] -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "napi/native_api.h" -// [End display_soloist_import_module] - -class SampleXComponent { -public: - SampleXComponent() = default; - ~SampleXComponent(); - explicit SampleXComponent(std::string id) : id_(id) {} - static napi_value NapiRegister(napi_env env, napi_callback_info info); - static napi_value NapiUnregister(napi_env env, napi_callback_info info); - static napi_value NapiDestroy(napi_env env, napi_callback_info info); - static void Release(std::string &id); - void DrawPath(); - void SetWidth(uint64_t width); - void SetHeight(uint64_t height); - void SetNativeWindow(OHNativeWindow *nativeWindow); - OHNativeWindow *GetNativeWindow(); - - void Prepare(); - void Create(); - void DisPlay(); - void ConstructPath(int x, int y, int offsetY); - void SetPenAndBrush(); - void Export(napi_env env, napi_value exports); - void RegisterCallback(OH_NativeXComponent *nativeXComponent); - void Destroy(); - static SampleXComponent *GetInstance(std::string &id); - std::string id_; - int defaultOffsetY = 100; - -private: - OH_NativeXComponent_Callback renderCallback_; - - uint64_t width_ = 0; - uint64_t height_ = 0; - - float aX = 0.0; - float aY = 0.0; - float bX = 80.0; - float cY = 0.0; - bool desc = false; - - OH_Drawing_Bitmap *cBitmap_ = nullptr; - OH_Drawing_Canvas *cCanvas_ = nullptr; - - OH_Drawing_Path *cPath_ = nullptr; - OH_Drawing_Brush *cBrush_ = nullptr; - OH_Drawing_Pen *cPen_ = nullptr; - OHNativeWindow *nativeWindow_ = nullptr; - uint32_t *mappedAddr_ = nullptr; - BufferHandle *bufferHandle_ = nullptr; - struct NativeWindowBuffer *buffer_ = nullptr; - int fenceFd_ = 0; -}; - -#endif diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/types/libentry/index.d.ts b/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/types/libentry/index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/types/libentry/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index d818828a09681b0081ebb1f0df4d8e558293a14f..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./index.d.ts", - "version": "", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/entryability/EntryAbility.ets b/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 24e1e020777423414e599ac9b5afceb4539cd55b..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 69a47ce6bf1d1e2d0c5a0f0432a8bb83ef1daae4..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/interface/XComponentContext.ts b/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/interface/XComponentContext.ts deleted file mode 100644 index 8e24b7b9bbaca207363ac15ad3d8e8d92ab76c9b..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/interface/XComponentContext.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start display_soloist_export_interface_xcomponent_context] -export default interface XComponentContext { - register(): void; - - unregister(): void; - - destroy(): void; -}; -// [End display_soloist_export_interface_xcomponent_context] diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/pages/Index.ets b/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 9cdbd814298c46d3a75d8421f9c0730f48bf4ae1..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start display_soloist_create_xcomponent] -import XComponentContext from '../interface/XComponentContext'; -import Logger from '../utils/Logger'; - -const TAG = '[XComponentDisplaySoloist]'; - -@Entry -@Component -struct Index { - private xComponentContext1: XComponentContext | undefined = undefined; - private xComponentContext2: XComponentContext | undefined = undefined; - - // [StartExclude display_soloist_create_xcomponent] - // [Start display_soloist_disappear] - aboutToDisappear(): void { - Logger.info(TAG, 'aboutToDisappear'); - if (this.xComponentContext1) { - this.xComponentContext1.unregister(); - this.xComponentContext1.destroy(); - } - if (this.xComponentContext2) { - this.xComponentContext2.unregister(); - this.xComponentContext2.destroy(); - } - } - // [End display_soloist_disappear] - // [EndExclude display_soloist_create_xcomponent] - - build() { - Column() { - Row() { - // [StartExclude display_soloist_create_xcomponent] - Text('30fps') - .fontWeight(FontWeight.Bold) - .fontSize(12) - .fontColor(Color.Red) - .textAlign(TextAlign.End) - .width(40) - .height(30) - // [EndExclude display_soloist_create_xcomponent] - - XComponent({ - id: 'xcomponentId_30', - type: XComponentType.SURFACE, - libraryname: 'entry' - }) - .onLoad((xComponentContext) => { - this.xComponentContext1 = xComponentContext as XComponentContext; - }).width('640px') - .backgroundColor(Color.White) - }.height('40%') - - Row() { - // [StartExclude display_soloist_create_xcomponent] - Text('120fps') - .fontWeight(FontWeight.Bold) - .fontSize(12) - .fontColor(Color.Red) - .textAlign(TextAlign.End) - .width(40) - .height(30) - // [EndExclude display_soloist_create_xcomponent] - - XComponent({ - id: 'xcomponentId_120', - type: XComponentType.SURFACE, - libraryname: 'entry' - }) - .onLoad((xComponentContext) => { - this.xComponentContext2 = xComponentContext as XComponentContext; - }).width('640px') - .backgroundColor(Color.White) - }.height('40%') - // [End display_soloist_create_xcomponent] - - // [Start display_soloist_start_and_stop] - Row() { - Button('Start') - .id('Start') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 20, right: 6, left: 6 }) - .onClick(() => { - if (this.xComponentContext1) { - this.xComponentContext1.register(); - } - if (this.xComponentContext2) { - this.xComponentContext2.register(); - } - }) - .width('30%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - - Button('Stop') - .id('Stop') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 20, left: 6 }) - .onClick(() => { - if (this.xComponentContext1) { - this.xComponentContext1.unregister(); - } - if (this.xComponentContext2) { - this.xComponentContext2.unregister(); - } - }) - .width('30%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - - } - .justifyContent(FlexAlign.SpaceEvenly) - .width('100%') - .height('20%') - // [End display_soloist_start_and_stop] - } - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/utils/Logger.ets b/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/utils/Logger.ets deleted file mode 100644 index 009e2c38da95d7fe3f11e577ebe4d18f359d5e6c..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/ets/utils/Logger.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 '@ohos.hilog'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s, %{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xFF00; - } - - debug(...args: string[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('[Sample_DisplaySoloist]'); \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/module.json5 b/ArkGraphics2D/DisplaySoloist/entry/src/main/module.json5 deleted file mode 100644 index c75d702e2d350523978ecaf801c22762ce7d40c0..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/element/color.json b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/element/string.json b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 7d5308ce719b744fc52c655c8d2b40fcd434cb44..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "Sample_DisplaySoloist" - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/background.png b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/foreground.png b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/layered_image.json b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index 4f9ad6307a2bc56beb6d0fce0a49cbf213b20a74..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "layered-image": { - "background": "$media:background", - "foreground": "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/startIcon.png b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/profile/backup_config.json b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/profile/main_pages.json b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/en_US/element/string.json b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 7d5308ce719b744fc52c655c8d2b40fcd434cb44..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "Sample_DisplaySoloist" - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/zh_CN/element/string.json b/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 314e0029f8d5a580142040c3fbd9f063faa6bc83..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "Sample_DisplaySoloist" - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/mock/Libentry.mock.ets b/ArkGraphics2D/DisplaySoloist/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index bbcd4ffee2dc23d8783fd8a1ac5e5325bc2b5240..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -const nativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default nativeMock; \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/mock/mock-config.json5 b/ArkGraphics2D/DisplaySoloist/entry/src/mock/mock-config.json5 deleted file mode 100644 index 98b0ae79f0090e1fc381d54c959fb32c9f7563f4..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 300a5716521dfb56661b0e1919b15629a3af6614..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2025 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 { beforeAll, describe, expect, it } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import Logger from '../utils/Logger'; - -const TAG = '[Sample_DisplaySoloist]'; -const BUNDLE = 'MyApp_' -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -const DELAYMS_1S = 1000; -const DELAYMS_5S = 5000; - -export default function abilityTest() { - describe('AbilityTest', () => { - beforeAll(async (done: Function) => { - Logger.info(TAG, BUNDLE + 'StartAbility_001, begin'); - let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - try { - await abilityDelegator.startAbility({ - bundleName: bundleName, - abilityName: 'EntryAbility' - }); - } catch (err) { - Logger.info(TAG, `beforeAll exception = ${JSON.stringify(err)}`); - } - - Logger.info(TAG, BUNDLE + 'StartAbility_001, end'); - done(); - }); - - /** - * @tc.number:SUB_GRAPHIC_2D_HGM_DISPLAYSOLOIST_0100 - * @tc.name:DisplaySoloist_001 - * @tc.desc:DisplaySoloist - * @tc.size:MediumTest - * @tc.type:Function - * @tc.level:Level 1 - */ - it(BUNDLE + 'DisplaySoloist_001', 0, async (done: Function) => { - try { - Logger.info(TAG, BUNDLE + 'DisplaySoloist_001 begin'); - - let driver = Driver.create(); - await driver.delayMs(DELAYMS_1S); - - await driver.assertComponentExist(ON.id('Start')); - let startButton = await driver.findComponent(ON.id('Start')); - await startButton.click(); - await driver.delayMs(DELAYMS_5S); - - await driver.assertComponentExist(ON.id('Stop')); - let stopButton = await driver.findComponent(ON.id('Stop')); - await stopButton.click(); - await driver.delayMs(DELAYMS_1S); - - Logger.info(TAG, BUNDLE + 'DisplaySoloist_001 end'); - done(); - } catch (error) { - Logger.info(TAG, `DisplaySoloist_001 exception = ${JSON.stringify(error)}`); - expect().assertFail(); - } - }); - }) -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/ets/test/List.test.ets b/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index c64e0b06938d246ce044186d4b2d02b500a89e14..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/ets/utils/Logger.ets b/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/ets/utils/Logger.ets deleted file mode 100644 index 2b2a9cb5405150d8e3433101be4a449e9c15ca88..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/ets/utils/Logger.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 '@ohos.hilog'; - -class Logger { - private domain: number = 0xF811; - private prefix: string = ''; - private format: string = '%{public}s, %{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('[Sample_DisplaySoloist]'); \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/module.json5 b/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/module.json5 deleted file mode 100644 index f6bdce9946cb02c0385e5a8836c133c93945013d..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/test/List.test.ets b/ArkGraphics2D/DisplaySoloist/entry/src/test/List.test.ets deleted file mode 100644 index a60c87c5cbb0badf7c3fd8975034590e6fafa992..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/entry/src/test/LocalUnit.test.ets b/ArkGraphics2D/DisplaySoloist/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index b080060dcc059796d440db79c0ad94bed7b7bc79..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/hvigor/hvigor-config.json5 b/ArkGraphics2D/DisplaySoloist/hvigor/hvigor-config.json5 deleted file mode 100644 index 588ef752bc769d16dcf3826bfac354920c592813..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySoloist/hvigorfile.ts b/ArkGraphics2D/DisplaySoloist/hvigorfile.ts deleted file mode 100644 index d5e782664a81fec19737e2dff4dead3223a9b686..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySoloist/oh-package.json5 b/ArkGraphics2D/DisplaySoloist/oh-package.json5 deleted file mode 100644 index fa0f78a6061227a18ae37179dd9fa76c6d5baa33..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkGraphics2D/DisplaySoloist/ohosTest.md b/ArkGraphics2D/DisplaySoloist/ohosTest.md deleted file mode 100644 index 0f0434f97e281105559249a8032a213e74af275a..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySoloist/ohosTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# DisplaySoloist测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|------|--------|-------------------|------------------------------|------|------| -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 按钮点击 | 位于主页 | 点击 30hz 右侧 Start | 方块按照 30hz 频率移动,同时按钮显示为 Stop | 是 | Pass | -| 按钮点击 | 位于主页 | 点击 30hz 右侧 Stop | 方块停止移动,同时按钮显示为 Start | 是 | Pass | -| 按钮点击 | 位于主页 | 点击 60hz 右侧 Start | 方块按照 60hz 频率移动,同时按钮显示为 Stop | 是 | Pass | -| 按钮点击 | 位于主页 | 点击 60hz 右侧 Stop | 方块停止移动,同时按钮显示为 Start | 是 | Pass | -| 按钮点击 | 位于主页 | 点击 120hz 右侧 Start | 方块按照 120hz 频率移动,同时按钮显示为 Stop | 是 | Pass | -| 按钮点击 | 位于主页 | 点击 120hz 右侧 Stop | 方块停止移动,同时按钮显示为 Start | 是 | Pass | \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySoloist/screenshots/device/index.png b/ArkGraphics2D/DisplaySoloist/screenshots/device/index.png deleted file mode 100644 index 1eacc005d89abe95a1f1e3faee98196afd3e94ff..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySoloist/screenshots/device/index.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySync/.gitignore b/ArkGraphics2D/DisplaySync/.gitignore deleted file mode 100644 index 08d606210b3993e8f1f4535767bb3459b7b1d208..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -/oh-package-lock.json5 \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/AppScope/app.json5 b/ArkGraphics2D/DisplaySync/AppScope/app.json5 deleted file mode 100644 index c0dd94d4cd1681f6277d423c34d0dec9e0a10b41..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.displaysync", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkGraphics2D/DisplaySync/AppScope/resources/base/element/string.json b/ArkGraphics2D/DisplaySync/AppScope/resources/base/element/string.json deleted file mode 100644 index ba13327659cfcbc5e31f01e3ab118d7c90683ef4..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DisplaySync" - } - ] -} diff --git a/ArkGraphics2D/DisplaySync/AppScope/resources/base/media/app_icon.png b/ArkGraphics2D/DisplaySync/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySync/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySync/README.md b/ArkGraphics2D/DisplaySync/README.md deleted file mode 100644 index 1dba326876af665ed8789da0b8ef475f18c50fa1..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# DisplaySync - -### 介绍 - -本示例通过 DisplaySync 系列功能,对请求动画绘制帧率、请求 UI 绘制帧率和请求自绘制内容绘制帧率设置开发者所期望的帧率。 - -本示例主要展示了 DisplaySync 系列能力,使用 [ExpectedFrameRateRange](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-explicit-animation#expectedframeraterange11) 属性来配置显性动画和属性动画的帧率;利用 [@ohos.graphics.displaySync](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/js-apis-graphics-displaysync) 方法来为独立的帧率绘制、更新操作UI界面;采用 [XComponent](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/napi-xcomponent-guidelines) 组件进行开发,从而可以请求独立的绘制帧率进行内容开发。 - -### 效果预览 - -| 初始页 | 请求动画绘制帧率 | 请求 UI 绘制帧率 | 请求自绘制内容绘制帧率 | -|:--------------------------------------------------------:|:------------------------------------------------------------:|:----------------------------------------------------:|:-------------------------------------------------------------:| -| | | | | - -使用说明 - -1.在初始页面点击“**Requesting Frame Rates for Animations**”,进入请求动画绘制帧率页面,点击“**Start**”,三个方块分别按照30Hz、40Hz、60Hz移动;点击“**Back**”返回初始页面。 - -2.在初始页面点击“**Requesting Frame Rates for UI Components**”,进入请求 UI 绘制帧率页面,点击“**Start**”,数字“**30**”按照30Hz帧率放大缩小,数字“**60**”按照60Hz帧率放大缩小;点击“**Stop**”绘制停止;点击“**Back**”返回初始页面。 - -3.在初始页面点击“**Requesting Frame Rates for Custom Content**”,进入请求自绘制内容绘制帧率页面,点击“**Start**”,两个方块分别按照30Hz、120Hz移动;点击“**Stop**”动画停止;点击“**Back**”返回初始页面。 - -### 工程目录 - -``` -├──entry/src/main -│ ├──cpp // C++代码区 -│ │ ├──CMakeLists.txt // CMake配置文件 -│ │ ├──napi_init.cpp // Napi模块注册 -│ │ ├──common -│ │ │ └──log_common.h // 日志封装定义文件 -│ │ ├──plugin // 生命周期管理模块 -│ │ │ ├──plugin_manager.cpp -│ │ │ └──plugin_manager.h -│ │ ├──samples // samples渲染模块 -│ │ │ ├──sample_xcomponent.cpp -│ │ │ └──sample_xcomponent.h -│ ├──ets // ets代码区 -│ │ ├──entryability -│ │ │ ├──EntryAbility.ts // 程序入口类 -| | | └──EntryAbility.ets -| | ├──interface -│ │ │ └──XComponentContext.ts // XComponentContext -│ │ ├──DispalySync // 业务页面目录 -│ │ | ├──PropertyAnimationDisplaySync.ets // 属性动画页面 -│ │ | ├──CustomDrawDisplaySync.ets // 自绘制页面 -│ │ | ├──XComponentDisplaySync.ets // XComponent页面 -│ │ ├──pages // 页面文件 -│ │ | ├──Index.ets // 初始页面 -│ │ ├──utils // 工具类 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -* 请求动画绘制帧率:通过 animation 和 animateTo 接口的参数——expectedFrameRateRange,来设置动画刷新率区间、预期刷新率。其作为动画的属性之一,主要作用于动画场景。 - - * 涉及到的相关接口: - - | 新增动画属性 | 描述 | - | :--------------------: | :----------------------------------------------------------: | - | expectedFrameRateRange | animation和animateTo接口的动画属性参数中可选配置expectedFrameRateRange参数 | -* 请求 UI 绘制帧率:通过调用 [@ohos.graphics.displaySync ](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-arkgraphics2d/js-apis-graphics-displaySync.md)接口,来注册回调和设置刷新区间并控制回调周期。 - - * 涉及到的相关接口: - - 通过 `import displaySync from '@ohos.graphics.displaySync` 表达式引入, - - | 接口名 | 描述 | - | ------------------------------------------------------------ | -------------------------- | - | Create(): DisplaySync | 创建一个DisplaySync实例 | - | setExpectedFrameRateRange(rateRange: ExpectedFrameRateRange): void | 设置期望帧率 | - | on(type: 'frame', callback: Callback): void | 设置自定义绘制内容回调函数 | - | off(type: 'frame', callback?: Callback): void | 清除自定义绘制内容回调函数 | - | start(): void | DisplaySync使能 | - | stop(): void | DisplaySync失能 | - -* 请求自绘制内容绘制帧率:通过在 IDE 中的 Native c++ 工程,在 c++ 代码中定义对外接口为 register 和 unregister,并调用新增的 CAPI 接口,可在页面上使用 drawing 根据设定的期望帧率来绘制。 - - | 接口名 | 描述 | - | --------------------------------------------- | ---------------- | - | OH_NativeXComponent_SetExpectedFrameRateRange | 设置期望帧率范围 | - | OH_NativeXComponent_RegisterOnFrameCallback | 注册更新回调 | - | OH_NativeXComponent_UnregisterOnFrameCallback | 取消更新回调 | - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持在标准系统上运行; - -2.本示例为 Stage 模型,已适配 API version 14 版本 SDK,SDK 版本号(API Version 14 5.0.2.57); - -3.本示例需要使用 DevEco Studio 版本号(5.0.5.306)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo ArkGraphics2D/DisplaySync/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/build-profile.json5 b/ArkGraphics2D/DisplaySync/build-profile.json5 deleted file mode 100644 index ee9f710ef18f2965ae1469bdb5d65f02591834f5..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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": "5.0.2(14)", - "targetSdkVersion": "5.0.2(14)", - "runtimeOS": "HarmonyOS" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/code-linter.json5 b/ArkGraphics2D/DisplaySync/code-linter.json5 deleted file mode 100644 index 44d50304643a42f437232b908c9b44c51cea8f60..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/code-linter.json5 +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/.gitignore b/ArkGraphics2D/DisplaySync/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/build-profile.json5 b/ArkGraphics2D/DisplaySync/entry/build-profile.json5 deleted file mode 100644 index fe58975fb74c7156ddd3d6fe75cd044005b1bb24..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/build-profile.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/hvigorfile.ts b/ArkGraphics2D/DisplaySync/entry/hvigorfile.ts deleted file mode 100644 index 90e5d264bb75363bfb6969f0b832c2f1b9a02a75..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySync/entry/obfuscation-rules.txt b/ArkGraphics2D/DisplaySync/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkGraphics2D/DisplaySync/entry/oh-package.json5 b/ArkGraphics2D/DisplaySync/entry/oh-package.json5 deleted file mode 100644 index 10cda399b0aec3099b257299a57d284393e4e55a..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySync/entry/src/main/cpp/CMakeLists.txt b/ArkGraphics2D/DisplaySync/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index cd73ec36d8c9197555560566981324534d12a49a..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.4.1) -project(drawing_test) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED - napi_init.cpp - samples/sample_xcomponent.cpp - plugin/plugin_manager.cpp -) -find_library( - hilog-lib - hilog_ndk.z -) -target_link_libraries(entry PUBLIC ${hilog-lib}) -target_link_libraries(entry PUBLIC libace_napi.z.so libnative_drawing.so libnative_window.so libace_ndk.z.so) \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/common/log_common.h b/ArkGraphics2D/DisplaySync/entry/src/main/cpp/common/log_common.h deleted file mode 100644 index be73dc024b8b89d65234ebd5954caa9fd100a510..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/common/log_common.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef LOG_COMMON_H -#define LOG_COMMON_H -#include -#define LOG_PRINT_DOMAIN 0xFF00 -#define APP_LOG_DOMAIN 0x0001 -constexpr const char *APP_LOG_TAG = "DisplaySyncSample"; -#define SAMPLE_LOGI(...) ((void)OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) -#define SAMPLE_LOGD(...) ((void)OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) -#define SAMPLE_LOGW(...) ((void)OH_LOG_Print(LOG_APP, LOG_WARN, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) -#define SAMPLE_LOGE(...) ((void)OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) - -#endif // LOG_COMMON_H diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/napi_init.cpp b/ArkGraphics2D/DisplaySync/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index e83edffd520caef11d630247c4c0f23a9180fac4..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "napi/native_api.h" -#include "plugin/plugin_manager.h" - -#undef LOG_DOMIN -#undef LOG_TAG -#define LOG_DOMIN 0X0000 -#define LOG_TAG "NAPI_INIT" - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - PluginManager::GetInstance()->Export(env, exports); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/plugin/plugin_manager.cpp b/ArkGraphics2D/DisplaySync/entry/src/main/cpp/plugin/plugin_manager.cpp deleted file mode 100644 index 31a6582ecf81446448441f7b319d7a55b5056b58..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/plugin/plugin_manager.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include -#include -#include -#include -#include "common/log_common.h" -#include "plugin_manager.h" - -PluginManager *PluginManager::GetInstance() -{ - static PluginManager pluginManager; - return &pluginManager; -} - -PluginManager::~PluginManager() -{ - SAMPLE_LOGI("~PluginManager"); - for (auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for (auto iter = pluginRenderMap_.begin(); iter != pluginRenderMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - pluginRenderMap_.clear(); -} - -void PluginManager::Export(napi_env env, napi_value exports) -{ - nativeXComponentMap_.clear(); - pluginRenderMap_.clear(); - if ((env == nullptr) || (exports == nullptr)) { - SAMPLE_LOGE("Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - SAMPLE_LOGE("Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - SAMPLE_LOGE("Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto context = PluginManager::GetInstance(); - if ((context != nullptr) && (nativeXComponent != nullptr)) { - context->SetNativeXComponent(id, nativeXComponent); - auto render = context->GetRender(id); - if (render != nullptr) { - render->RegisterCallback(nativeXComponent); - render->Export(env, exports); - } else { - SAMPLE_LOGE("render is nullptr"); - } - } -} - -void PluginManager::SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent) -{ - SAMPLE_LOGI("set native xComponent, ID = %{public}s.", id.c_str()); - if (nativeXComponent == nullptr) { - SAMPLE_LOGE("xcomponent null"); - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent *tmp = nativeXComponentMap_[id]; - delete tmp; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -SampleXComponent *PluginManager::GetRender(std::string &id) -{ - if (pluginRenderMap_.find(id) == pluginRenderMap_.end()) { - SampleXComponent *instance = SampleXComponent::GetInstance(id); - pluginRenderMap_[id] = instance; - return instance; - } - return pluginRenderMap_[id]; -} - diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/plugin/plugin_manager.h b/ArkGraphics2D/DisplaySync/entry/src/main/cpp/plugin/plugin_manager.h deleted file mode 100644 index 96242845453b1fffdfea4b24acb5cdcd47520af1..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/plugin/plugin_manager.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef PLUGIN_MANAGER_H -#define PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include -#include "samples/sample_xcomponent.h" - -class PluginManager { -public: - ~PluginManager(); - - static PluginManager *GetInstance(); - - void SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent); - SampleXComponent *GetRender(std::string &id); - void Export(napi_env env, napi_value exports); - -private: - std::unordered_map nativeXComponentMap_; - std::unordered_map pluginRenderMap_; -}; -#endif // PLUGIN_MANAGER_H diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/samples/sample_xcomponent.cpp b/ArkGraphics2D/DisplaySync/entry/src/main/cpp/samples/sample_xcomponent.cpp deleted file mode 100644 index 59429267f32b306f6067b17999be21aaa0e8fc1c..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/samples/sample_xcomponent.cpp +++ /dev/null @@ -1,436 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include -#include -#include -#include "common/log_common.h" -#include "sample_xcomponent.h" - -static void OnSurfaceCreatedCB(OH_NativeXComponent *component, void *window) -{ - SAMPLE_LOGI("OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - SAMPLE_LOGE("OnSurfaceCreatedCB: component or window is null"); - return; - } - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - auto render = SampleXComponent::GetInstance(id); - OHNativeWindow *nativeWindow = static_cast(window); - render->SetNativeWindow(nativeWindow); - - uint64_t width; - uint64_t height; - int32_t xSize = OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - if ((xSize == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) && (render != nullptr)) { - render->SetHeight(height); - render->SetWidth(width); - SAMPLE_LOGI("xComponent width = %{public}lu, height = %{public}llu", width, height); - } -} - -static void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window) -{ - SAMPLE_LOGI("OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - SAMPLE_LOGE("OnSurfaceDestroyedCB: component or window is null"); - return; - } - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - SampleXComponent::Release(id); -} - -// Start display_sync_napi_frame_rate_setting_and_subscription_function_registration] -static void TestCallback(OH_NativeXComponent *component, uint64_t timestamp, uint64_t targetTimestamp) -{ - SAMPLE_LOGI("test callback timestamp = %{public}llu, targetTimestamp = %{public}llu", timestamp, targetTimestamp); - if (component == nullptr) { - SAMPLE_LOGE("TestCallback: component is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("TestCallback: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - auto render = SampleXComponent::GetInstance(id); - OHNativeWindow *nativeWindow = render->GetNativeWindow(); - uint64_t width; - uint64_t height; - - int32_t xSize = OH_NativeXComponent_GetXComponentSize(component, nativeWindow, &width, &height); - if ((xSize == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) && (render != nullptr)) { - render->Prepare(); - render->Create(); - if (id == "xcomponentId_30") { - int offset = 16; - render->ConstructPath(offset, offset, render->defaultOffsetY); - } - if (id == "xcomponentId_120") { - int offset = 4; - render->ConstructPath(offset, offset, render->defaultOffsetY); - } - render->SetPenAndBrush(); - render->DrawPath(); - render->DisPlay(); - render->Destroy(); - } -} -// End display_sync_napi_frame_rate_setting_and_subscription_function_registration] - -static std::unordered_map g_instance; - -void SampleXComponent::SetWidth(uint64_t width) -{ - width_ = width; -} - -void SampleXComponent::SetHeight(uint64_t height) -{ - height_ = height; -} - -void SampleXComponent::SetNativeWindow(OHNativeWindow *nativeWindow) -{ - nativeWindow_ = nativeWindow; -} - -OHNativeWindow *SampleXComponent::GetNativeWindow() -{ - return nativeWindow_; -} - -void SampleXComponent::Prepare() -{ - if (nativeWindow_ == nullptr) { - SAMPLE_LOGE("nativeWindow_ is nullptr"); - return; - } - int ret = OH_NativeWindow_NativeWindowRequestBuffer(nativeWindow_, &buffer_, &fenceFd_); - SAMPLE_LOGI("request buffer ret = %{public}d", ret); - bufferHandle_ = OH_NativeWindow_GetBufferHandleFromNative(buffer_); - mappedAddr_ = static_cast( - mmap(bufferHandle_->virAddr, bufferHandle_->size, PROT_READ | PROT_WRITE, MAP_SHARED, bufferHandle_->fd, 0)); - if (mappedAddr_ == MAP_FAILED) { - SAMPLE_LOGE("mmap failed"); - } -} - -void SampleXComponent::DisPlay() -{ - void *bitmapAddr = OH_Drawing_BitmapGetPixels(cBitmap_); - uint32_t *value = static_cast(bitmapAddr); - - uint32_t *pixel = static_cast(mappedAddr_); - if (pixel == nullptr) { - SAMPLE_LOGE("pixel is null"); - return; - } - if (value == nullptr) { - SAMPLE_LOGE("value is null"); - return; - } - for (uint32_t x = 0; x < width_; x++) { - for (uint32_t y = 0; y < height_; y++) { - *pixel++ = *value++; - } - } - Region region {nullptr, 0}; - OH_NativeWindow_NativeWindowFlushBuffer(nativeWindow_, buffer_, fenceFd_, region); - int result = munmap(mappedAddr_, bufferHandle_->size); - if (result == -1) { - SAMPLE_LOGE("munmap failed!"); - } -} - -void SampleXComponent::Create() -{ - uint32_t width = static_cast(bufferHandle_->stride / 4); - cBitmap_ = OH_Drawing_BitmapCreate(); - OH_Drawing_BitmapFormat cFormat {COLOR_FORMAT_RGBA_8888, ALPHA_FORMAT_OPAQUE}; - OH_Drawing_BitmapBuild(cBitmap_, width, height_, &cFormat); - - cCanvas_ = OH_Drawing_CanvasCreate(); - OH_Drawing_CanvasBind(cCanvas_, cBitmap_); - OH_Drawing_CanvasClear(cCanvas_, OH_Drawing_ColorSetArgb(0xFF, 0xFF, 0xFF, 0xFF)); -} - -void SampleXComponent::ConstructPath(int x, int y, int offsetY) -{ - float offsetOfAy = 100.0; - float offsetOfCy = 200.0; - float offsetOfX = 1.0; - - aY = offsetOfAy + offsetY; - cY = offsetOfCy + offsetY; - - if (desc) { - aX -= x * offsetOfX; - bX -= x * offsetOfX; - } else { - aX += x * offsetOfX; - bX += x * offsetOfX; - } - - if (bX >= width_) { - desc = true; - } - - if (aX <= 0) { - desc = false; - } - - float bY = aY; - float cX = bX; - float dX = aX; - float dY = cY; - - cPath_ = OH_Drawing_PathCreate(); - OH_Drawing_PathMoveTo(cPath_, aX, aY); - OH_Drawing_PathLineTo(cPath_, bX, bY); - OH_Drawing_PathLineTo(cPath_, cX, cY); - OH_Drawing_PathLineTo(cPath_, dX, dY); - - OH_Drawing_PathClose(cPath_); -} - -void SampleXComponent::SetPenAndBrush() -{ - constexpr float penWidth = 10.0f; - cPen_ = OH_Drawing_PenCreate(); - OH_Drawing_PenSetAntiAlias(cPen_, true); - OH_Drawing_PenSetColor(cPen_, OH_Drawing_ColorSetArgb(0xFF, 0xFF, 0x00, 0x00)); - OH_Drawing_PenSetWidth(cPen_, penWidth); - OH_Drawing_PenSetJoin(cPen_, LINE_ROUND_JOIN); - OH_Drawing_CanvasAttachPen(cCanvas_, cPen_); - - cBrush_ = OH_Drawing_BrushCreate(); - OH_Drawing_BrushSetColor(cBrush_, OH_Drawing_ColorSetArgb(0xFF, 0x00, 0xFF, 0x00)); - - OH_Drawing_CanvasAttachBrush(cCanvas_, cBrush_); -} - -void SampleXComponent::DrawPath() -{ - OH_Drawing_CanvasDrawPath(cCanvas_, cPath_); -} - -// [Start display_sync_napi_register] -napi_value SampleXComponent::NapiRegister(napi_env env, napi_callback_info info) -{ - // [StartExclude display_sync_napi_register] - SAMPLE_LOGI("NapiRegister"); - if ((env == nullptr) || (info == nullptr)) { - SAMPLE_LOGE("NapiRegister: env or info is null"); - return nullptr; - } - - napi_value thisArg; - if (napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr) != napi_ok) { - SAMPLE_LOGE("NapiRegister: napi_get_cb_info fail"); - return nullptr; - } - - napi_value exportInstance; - if (napi_get_named_property(env, thisArg, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - SAMPLE_LOGE("NapiRegister: napi_get_named_property fail"); - return nullptr; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - SAMPLE_LOGE("NapiRegister: napi_unwrap fail"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("NapiRegister: Unable to get XComponent id"); - return nullptr; - } - SAMPLE_LOGI("RegisterID = %{public}s", idStr); - std::string id(idStr); - SampleXComponent *render = SampleXComponent().GetInstance(id); - if (render != nullptr) { - if (id == "xcomponentId_30") { - OH_NativeXComponent_ExpectedRateRange range = {30, 120, 30}; - OH_NativeXComponent_SetExpectedFrameRateRange(nativeXComponent, &range); - } - - if (id == "xcomponentId_120") { - OH_NativeXComponent_ExpectedRateRange range = {30, 120, 120}; - OH_NativeXComponent_SetExpectedFrameRateRange(nativeXComponent, &range); - } - // [EndExclude display_sync_napi_register] - render->RegisterOnFrameCallback(nativeXComponent); - // [StartExclude display_sync_napi_register] - } - return nullptr; - // [EndExclude display_sync_napi_register] -} -// [End display_sync_napi_register] - -// [Start display_sync_napi_unregister] -napi_value SampleXComponent::NapiUnregister(napi_env env, napi_callback_info info) -{ - // [StartExclude display_sync_napi_unregister] - SAMPLE_LOGI("NapiUnregister"); - if ((env == nullptr) || (info == nullptr)) { - SAMPLE_LOGE("NapiUnregister: env or info is null"); - return nullptr; - } - - napi_value thisArg; - if (napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr) != napi_ok) { - SAMPLE_LOGE("NapiUnregister: napi_get_cb_info fail"); - return nullptr; - } - - napi_value exportInstance; - if (napi_get_named_property(env, thisArg, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - SAMPLE_LOGE("NapiUnregister: napi_get_named_property fail"); - return nullptr; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - SAMPLE_LOGE("NapiUnregister: napi_unwrap fail"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - SAMPLE_LOGE("NapiUnregister: Unable to get XComponent id"); - return nullptr; - } - SAMPLE_LOGI("ID = %{public}s", idStr); - std::string id(idStr); - SampleXComponent *render = SampleXComponent().GetInstance(id); - if (render != nullptr) { - // [EndExclude display_sync_napi_unregister] - OH_NativeXComponent_UnregisterOnFrameCallback(nativeXComponent); - // [StartExclude display_sync_napi_unregister] - SAMPLE_LOGI("NapiUnregister executed"); - } else { - SAMPLE_LOGE("render is nullptr"); - } - return nullptr; - // [EndExclude display_sync_napi_unregister] -} -// [End display_sync_napi_unregister] - -SampleXComponent::~SampleXComponent() -{ - OH_Drawing_BrushDestroy(cBrush_); - cBrush_ = nullptr; - OH_Drawing_PenDestroy(cPen_); - cPen_ = nullptr; - OH_Drawing_PathDestroy(cPath_); - cPath_ = nullptr; - OH_Drawing_CanvasDestroy(cCanvas_); - cCanvas_ = nullptr; - OH_Drawing_BitmapDestroy(cBitmap_); - cBitmap_ = nullptr; - - buffer_ = nullptr; - bufferHandle_ = nullptr; - nativeWindow_ = nullptr; - mappedAddr_ = nullptr; -} - -void SampleXComponent::Destroy() -{ - OH_Drawing_BrushDestroy(cBrush_); - cBrush_ = nullptr; - OH_Drawing_PenDestroy(cPen_); - cPen_ = nullptr; - OH_Drawing_PathDestroy(cPath_); - cPath_ = nullptr; - OH_Drawing_CanvasDestroy(cCanvas_); - cCanvas_ = nullptr; - OH_Drawing_BitmapDestroy(cBitmap_); - cBitmap_ = nullptr; -} - -void SampleXComponent::Release(std::string &id) -{ - SampleXComponent *render = SampleXComponent::GetInstance(id); - if (render != nullptr) { - delete render; - render = nullptr; - g_instance.erase(g_instance.find(id)); - } -} - -void SampleXComponent::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - SAMPLE_LOGE("Export: env or exports is null"); - return; - } - napi_property_descriptor desc[] = { - {"register", nullptr, SampleXComponent::NapiRegister, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"unregister", nullptr, SampleXComponent::NapiUnregister, nullptr, nullptr, nullptr, napi_default, nullptr}}; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - SAMPLE_LOGE("Export: napi_define_properties failed"); - } -} - -void SampleXComponent::RegisterCallback(OH_NativeXComponent *nativeXComponent) -{ - SAMPLE_LOGI("register callback"); - renderCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - renderCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - renderCallback_.DispatchTouchEvent = nullptr; - renderCallback_.OnSurfaceChanged = nullptr; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &renderCallback_); -} - -// [Start display_sync_register_on_frame_callback] -void SampleXComponent::RegisterOnFrameCallback(OH_NativeXComponent *nativeXComponent) -{ - SAMPLE_LOGI("register onFrameCallback"); - OH_NativeXComponent_RegisterOnFrameCallback(nativeXComponent, TestCallback); -} -// [End display_sync_register_on_frame_callback] - -SampleXComponent *SampleXComponent::GetInstance(std::string &id) -{ - if (g_instance.find(id) == g_instance.end()) { - SampleXComponent *render = new SampleXComponent(id); - g_instance[id] = render; - return render; - } else { - return g_instance[id]; - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/samples/sample_xcomponent.h b/ArkGraphics2D/DisplaySync/entry/src/main/cpp/samples/sample_xcomponent.h deleted file mode 100644 index 4cf365a9fc5da0e01ed5900e13f598b0bf0d09a3..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/samples/sample_xcomponent.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef SAMPLE_XCOMPONENT_H -#define SAMPLE_XCOMPONENT_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "napi/native_api.h" - -class SampleXComponent { -public: - SampleXComponent() = default; - ~SampleXComponent(); - explicit SampleXComponent(std::string id) : id_(id) {} - static napi_value NapiRegister(napi_env env, napi_callback_info info); - static napi_value NapiUnregister(napi_env env, napi_callback_info info); - static void Release(std::string &id); - void DrawPath(); - void SetWidth(uint64_t width); - void SetHeight(uint64_t height); - void SetNativeWindow(OHNativeWindow *nativeWindow); - OHNativeWindow *GetNativeWindow(); - - void Prepare(); - void Create(); - void DisPlay(); - void ConstructPath(int x, int y, int offsetY); - void SetPenAndBrush(); - void Export(napi_env env, napi_value exports); - void RegisterCallback(OH_NativeXComponent *nativeXComponent); - void RegisterOnFrameCallback(OH_NativeXComponent *nativeXComponent); - void Destroy(); - static SampleXComponent *GetInstance(std::string &id); - std::string id_; - int defaultOffsetY = 200; - -private: - OH_NativeXComponent_Callback renderCallback_; - - uint64_t width_ = 0; - uint64_t height_ = 0; - - float aX = 0.0; - float aY = 0.0; - float bX = 80.0; - float cY = 0.0; - bool desc = false; - - OH_Drawing_Bitmap *cBitmap_ = nullptr; - OH_Drawing_Canvas *cCanvas_ = nullptr; - - OH_Drawing_Path *cPath_ = nullptr; - OH_Drawing_Brush *cBrush_ = nullptr; - OH_Drawing_Pen *cPen_ = nullptr; - OHNativeWindow *nativeWindow_ = nullptr; - uint32_t *mappedAddr_ = nullptr; - BufferHandle *bufferHandle_ = nullptr; - struct NativeWindowBuffer *buffer_ = nullptr; - int fenceFd_ = 0; -}; - -#endif diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/types/libentry/index.d.ts b/ArkGraphics2D/DisplaySync/entry/src/main/cpp/types/libentry/index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/types/libentry/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkGraphics2D/DisplaySync/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 77052c679533e45a066030a9fc21cdbf9cbcf995..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/ets/DispalySync/CustomDrawDisplaySync.ets b/ArkGraphics2D/DisplaySync/entry/src/main/ets/DispalySync/CustomDrawDisplaySync.ets deleted file mode 100644 index 991122f5a13a87187efbee54cca4c0a4edcd12c9..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/ets/DispalySync/CustomDrawDisplaySync.ets +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start display_sync_by_ui_import_module] -import { displaySync } from '@kit.ArkGraphics2D'; -// [End display_sync_by_ui_import_module] -import { router } from '@kit.ArkUI'; - -// [Start display_sync_by_ui_complete_example] -// [Start display_sync_create_object] -@Entry -@Component -struct Index { - // [StartExclude display_sync_create_object] - @State drawFirstSize: number = 25; - @State drawSecondSize: number = 25; - // [EndExclude display_sync_create_object] - private backDisplaySyncSlow: displaySync.DisplaySync | undefined = undefined; - private backDisplaySyncFast: displaySync.DisplaySync | undefined = undefined; -// [End display_sync_create_object] - private isBigger_30: boolean = true; - private isBigger_60: boolean = true; - - // [Start display_sync_create_text_component] - @Builder - doSomeRenderFirst() { - Text('30') - .fontSize(this.drawFirstSize) - } - - @Builder - doSomeRenderSecond() { - Text('60') - .fontSize(this.drawSecondSize) - } - // [End display_sync_create_text_component] - - // [Start display_sync_frame_rate_setting_and_subscription_function_registration] - CreateDisplaySyncSlow() { - let range: ExpectedFrameRateRange = { - expected: 30, - min: 0, - max: 120 - }; - - let draw30 = (intervalInfo: displaySync.IntervalInfo) => { - if (this.isBigger_30) { - this.drawFirstSize += 1; - if (this.drawFirstSize > 150) { - this.isBigger_30 = false; - } - } else { - this.drawFirstSize -= 1; - if (this.drawFirstSize < 25) { - this.isBigger_30 = true; - } - } - }; - - this.backDisplaySyncSlow = displaySync.create(); - this.backDisplaySyncSlow.setExpectedFrameRateRange(range); - this.backDisplaySyncSlow.on("frame", draw30); - } - // [End display_sync_frame_rate_setting_and_subscription_function_registration] - - CreateDisplaySyncFast() { - let range: ExpectedFrameRateRange = { - expected: 60, - min: 0, - max: 120 - }; - - let draw60 = (intervalInfo: displaySync.IntervalInfo) => { - if (this.isBigger_60) { - this.drawSecondSize += 1; - if (this.drawSecondSize > 150) { - this.isBigger_60 = false; - } - } else { - this.drawSecondSize -= 1; - if (this.drawSecondSize < 25) { - this.isBigger_60 = true; - } - } - }; - - this.backDisplaySyncFast = displaySync.create(); - this.backDisplaySyncFast.setExpectedFrameRateRange(range); - this.backDisplaySyncFast.on("frame", draw60); - } - - // [Start display_sync_call_stop] - aboutToDisappear() { - if (this.backDisplaySyncSlow) { - this.backDisplaySyncSlow.stop(); - this.backDisplaySyncSlow = undefined; - } - if (this.backDisplaySyncFast) { - this.backDisplaySyncFast.stop(); - this.backDisplaySyncFast = undefined; - } - } - // [End display_sync_call_stop] - - build() { - Column() { - Row() { - this.doSomeRenderFirst(); - } - .height('40%') - - Row() { - this.doSomeRenderSecond(); - } - .height('40%') - - Row() { - // [Start display_sync_start_per_frame_callback] - Button('Start') - .id('CustomDrawStart') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 10, left: 5 }) - .fontColor(Color.White) - .onClick((): void => { - if (this.backDisplaySyncSlow == undefined) { - this.CreateDisplaySyncSlow(); - } - if (this.backDisplaySyncFast == undefined) { - this.CreateDisplaySyncFast(); - } - if (this.backDisplaySyncSlow) { - this.backDisplaySyncSlow.start(); - } - if (this.backDisplaySyncFast) { - this.backDisplaySyncFast.start(); - } - }) - .width('20%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - // [End display_sync_start_per_frame_callback] - - // [Start display_sync_stop_per_frame_callback] - Button('Stop') - .id('CustomDrawStop') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 10, left: 5 }) - .fontColor(Color.White) - .onClick((): void => { - if (this.backDisplaySyncSlow) { - this.backDisplaySyncSlow.stop(); - } - if (this.backDisplaySyncFast) { - this.backDisplaySyncFast.stop(); - } - }) - .width('20%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - // [End display_sync_stop_per_frame_callback] - - Button('Back') - .id('CustomDrawBack') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 10, left: 5 }) - .fontColor(Color.White) - .onClick((): void => { - if (this.backDisplaySyncSlow) { - this.backDisplaySyncSlow.stop(); - } - if (this.backDisplaySyncFast) { - this.backDisplaySyncFast.stop(); - } - this.getUIContext().getRouter().back(); - }) - .width('20%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - } - .width('100%') - .justifyContent(FlexAlign.Center) - .shadow(ShadowStyle.OUTER_DEFAULT_SM) - .alignItems(VerticalAlign.Bottom) - .layoutWeight(1) - } - } -} -// [End display_sync_by_ui_complete_example] \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/ets/DispalySync/PropertyAnimationDisplaySync.ets b/ArkGraphics2D/DisplaySync/entry/src/main/ets/DispalySync/PropertyAnimationDisplaySync.ets deleted file mode 100644 index 8bd9ba280af3922c14cc0b1bbb2548c881993d7c..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/ets/DispalySync/PropertyAnimationDisplaySync.ets +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2025 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 { router } from '@kit.ArkUI'; - -// [Start display_sync_by_property_animation_complete_example] -@Entry -@Component -struct AnimationToAnimationDemo { - @State isAnimation: boolean = false; - @State translateX1: number = -100; - @State translateX2: number = -100; - @State translateX3: number = -100; - uiContext: UIContext | undefined = undefined; - - aboutToAppear() { - this.uiContext = this.getUIContext(); - if (!this.uiContext) { - console.warn('no uiContext'); - return; - } - } - - build() { - Column() { - Row() { - Text('30') - .fontWeight(FontWeight.Bold) - .fontSize(16) - .fontColor(Color.White) - .textAlign(TextAlign.Center) - .borderRadius(10) - .backgroundColor(0xF56C6C) - .width(80) - .height(80) - .translate({ x: this.translateX1 }) - } - .height('20%') - - Row() { - Text('40') - .fontWeight(FontWeight.Bold) - .fontSize(16) - .fontColor(Color.White) - .textAlign(TextAlign.Center) - .borderRadius(10) - .backgroundColor(0x2E8B57) - .width(80) - .height(80) - .translate({ x: this.translateX2 }) - } - .height('20%') - - Row() { - // [Start display_sync_property_animation] - Text('60') - // [StartExclude display_sync_property_animation] - .fontWeight(FontWeight.Bold) - .fontSize(16) - .fontColor(Color.White) - .textAlign(TextAlign.Center) - .borderRadius(10) - .backgroundColor(0x008B8B) - .width(80) - .height(80) - .translate({ x: this.translateX3 }) - // [EndExclude display_sync_property_animation] - .animation({ - duration: 1200, - iterations: 10, - playMode: PlayMode.AlternateReverse, - expectedFrameRateRange: { - expected: 60, - min: 0, - max: 120, - }, - }) - // [End display_sync_property_animation] - } - .height('20%') - - Row() { - // [Start display_sync_explicit_animation] - Button('Start') - // [StartExclude display_sync_explicit_animation] - .id('PropertyAnimationStart') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 10, left: 5 }) - .fontColor(Color.White) - .onClick(() => { - this.isAnimation = !this.isAnimation; - this.translateX3 = this.isAnimation ? 100 : -100; - // [EndExclude display_sync_explicit_animation] - - this.uiContext?.animateTo({ - duration: 1200, - iterations: 10, - playMode: PlayMode.AlternateReverse, - expectedFrameRateRange: { - expected: 30, - min: 0, - max: 120, - }, - }, () => { - this.translateX1 = this.isAnimation ? 100 : -100; - }) - // [End display_sync_explicit_animation] - - this.uiContext?.animateTo({ - duration: 1200, - iterations: 10, - playMode: PlayMode.AlternateReverse, - expectedFrameRateRange: { - expected: 40, - min: 0, - max: 120, - }, - }, () => { - this.translateX2 = this.isAnimation ? 100 : -100; - }) - }) - .width('40%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - - Button('Back') - .id('PropertyAnimationBack') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 10, left: 5 }) - .fontColor(Color.White) - .onClick((): void => { - this.getUIContext().getRouter().back(); - }) - .width('40%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - } - .width('100%') - .justifyContent(FlexAlign.Center) - .shadow(ShadowStyle.OUTER_DEFAULT_SM) - .alignItems(VerticalAlign.Bottom) - .layoutWeight(1) - } - .width('100%') - .justifyContent(FlexAlign.Center) - .shadow(ShadowStyle.OUTER_DEFAULT_SM) - .layoutWeight(1) - } -} -// [End display_sync_by_property_animation_complete_example] \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/ets/DispalySync/XComponentDisplaySync.ets b/ArkGraphics2D/DisplaySync/entry/src/main/ets/DispalySync/XComponentDisplaySync.ets deleted file mode 100644 index ec93e3d1e89fa2f53bd7128b9c246b19eb58b75d..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/ets/DispalySync/XComponentDisplaySync.ets +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start display_sync_create_xcomponent] -import XComponentContext from '../interface/XComponentContext'; -import { router } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private xComponentContext1: XComponentContext | undefined = undefined; - private xComponentContext2: XComponentContext | undefined = undefined; - - build() { - Column() { - Row() { - // [StartExclude display_sync_create_xcomponent] - Text('30fps') - .fontWeight(FontWeight.Bold) - .fontSize(12) - .fontColor(Color.Red) - .textAlign(TextAlign.End) - .width(40) - .height(30) - // [EndExclude display_sync_create_xcomponent] - - XComponent({ - id: 'xcomponentId_30', - type: XComponentType.SURFACE, - libraryname: 'entry' - }) - .onLoad((xComponentContext) => { - this.xComponentContext1 = xComponentContext as XComponentContext; - }).width('640px') - .backgroundColor(Color.White) - - - }.height('40%') - - - Row() { - // [StartExclude display_sync_create_xcomponent] - Text('120fps') - .fontWeight(FontWeight.Bold) - .fontSize(12) - .fontColor(Color.Red) - .textAlign(TextAlign.End) - .width(40) - .height(30) - // [EndExclude display_sync_create_xcomponent] - - XComponent({ - id: 'xcomponentId_120', - type: XComponentType.SURFACE, - libraryname: 'entry' - }) - .onLoad((xComponentContext) => { - this.xComponentContext2 = xComponentContext as XComponentContext; - }).width('640px') - .backgroundColor(Color.White) - }.height('40%') - // [End display_sync_create_xcomponent] - - // [Start display_sync_start_and_stop_per_frame_callback] - Row() { - Button('Start') - .id('Start') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 20, right: 6, left: 6 }) - .onClick(() => { - if (this.xComponentContext1) { - this.xComponentContext1.register(); - } - if (this.xComponentContext2) { - this.xComponentContext2.register(); - } - }) - .width('30%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - - Button('Stop') - .id('Stop') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 20, left: 6 }) - .onClick(() => { - if (this.xComponentContext1) { - this.xComponentContext1.unregister(); - } - if (this.xComponentContext2) { - this.xComponentContext2.unregister(); - } - }) - .width('30%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - // [End display_sync_start_and_stop_per_frame_callback] - - Button('Back') - .id('Back') - .fontSize(14) - .fontWeight(500) - .margin({ bottom: 20, left: 6 }) - .onClick((): void => { - if (this.xComponentContext1) { - this.xComponentContext1.unregister(); - } - if (this.xComponentContext2) { - this.xComponentContext2.unregister(); - } - this.getUIContext().getRouter().back(); - }) - .width('30%') - .height(40) - .shadow(ShadowStyle.OUTER_DEFAULT_LG) - } - .width('100%') - .height('20%') - } - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/ets/entryability/EntryAbility.ets b/ArkGraphics2D/DisplaySync/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 23a5f218909827e91bf6f66ce3d472c99df7c7c2..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySync/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkGraphics2D/DisplaySync/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 69a47ce6bf1d1e2d0c5a0f0432a8bb83ef1daae4..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySync/entry/src/main/ets/interface/XComponentContext.ts b/ArkGraphics2D/DisplaySync/entry/src/main/ets/interface/XComponentContext.ts deleted file mode 100644 index 821e80c2808c660d708a21470a209865f0926538..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/ets/interface/XComponentContext.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start display_sync_export_interface_xcomponent_context] -export default interface XComponentContext { - register(): void; - - unregister(): void; -}; -// [End display_sync_export_interface_xcomponent_context] diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/ets/pages/Index.ets b/ArkGraphics2D/DisplaySync/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index ce564f2b8192e98dbf5a377973420abb650c5bc8..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2025 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 { router } from '@kit.ArkUI'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -@Entry -@Component -struct Index { - build() { - Column({ space: 20 }) { - Button("Requesting Frame Rates for Animations") - .id("AnimationFpsRequest") - .fontSize(16) - .fontWeight(500) - .margin({ top: 200, left: 6 }) - .onClick((): void => { - this.getUIContext().getRouter().pushUrl({ - url: 'DispalySync/PropertyAnimationDisplaySync' - }, router.RouterMode.Standard, (err) => { - if (err) { - hilog.error(0x0001, "router.pushUrl", - "Invoke replaceUrl failed, code is %{public}s, message is %{public}s", - err.code, err.message); - return; - } - hilog.info(0x0002, "router.pushUrl", "Invoke replaceUrl succeeded."); - }); - }) - .width('80%') - .height(40) - - - Button('Requesting Frame Rates for UI Components') - .id('UiFpsRequest') - .fontSize(16) - .fontWeight(500) - .margin({ top: 20, left: 6 }) - .onClick((): void => { - this.getUIContext().getRouter().pushUrl({ - url: 'DispalySync/CustomDrawDisplaySync' - }, router.RouterMode.Standard, (err) => { - if (err) { - hilog.error(0x0001, "router.pushUrl", - "Invoke replaceUrl failed, code is %{public}s, message is %{public}s.", - err.code, err.message); - return; - } - hilog.info(0x0002, "router.pushUrl", "Invoke replaceUrl succeeded."); - }); - }) - .width('80%') - .height(40) - - Button('Requesting Frame Rates for Custom Content') - .id('XComponent') - .fontSize(16) - .fontWeight(500) - .margin({ top: 20, left: 6 }) - .onClick((): void => { - this.getUIContext().getRouter().pushUrl({ - url: 'DispalySync/XComponentDisplaySync' - }, router.RouterMode.Single, (err) => { - if (err) { - hilog.error(0x0001, "router.pushUrl", - "Invoke replaceUrl failed, code is %{public}s, message is %{public}s.", - err.code, err.message); - return; - } - hilog.info(0x0002, "router.pushUrl", "Invoke replaceUrl succeeded."); - }); - }) - .width('80%') - .height(40) - } - .width('100%') - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/ets/utils/Logger.ets b/ArkGraphics2D/DisplaySync/entry/src/main/ets/utils/Logger.ets deleted file mode 100644 index 3040a04a4383c918416e53a6344a7e2e48e85260..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/ets/utils/Logger.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 '@ohos.hilog'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s, %{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xFF00; - } - - debug(...args: string[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('[Sample_DisplaySync]'); \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/module.json5 b/ArkGraphics2D/DisplaySync/entry/src/main/module.json5 deleted file mode 100644 index c75d702e2d350523978ecaf801c22762ce7d40c0..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/element/color.json b/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/element/string.json b/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/element/string.json deleted file mode 100644 index aa6d9f08b231e8d865a6328a2f28ec92a2acf753..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "Sample_DisplaySync" - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/background.png b/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/foreground.png b/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/layered_image.json b/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index 4f9ad6307a2bc56beb6d0fce0a49cbf213b20a74..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "layered-image": { - "background": "$media:background", - "foreground": "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/startIcon.png b/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/profile/backup_config.json b/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/profile/main_pages.json b/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 5c9db65f6d7ead000603ce2adeb339950d73d3a1..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "src": [ - "pages/Index", - "DispalySync/CustomDrawDisplaySync", - "DispalySync/PropertyAnimationDisplaySync", - "DispalySync/XComponentDisplaySync" - ] -} diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/resources/en_US/element/string.json b/ArkGraphics2D/DisplaySync/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index aa6d9f08b231e8d865a6328a2f28ec92a2acf753..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "Sample_DisplaySync" - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/main/resources/zh_CN/element/string.json b/ArkGraphics2D/DisplaySync/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 3e449654fc7b0aec6c38a3c7b84531a29e79d203..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "Sample_DisplaySync" - } - ] -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/mock/mock-config.json5 b/ArkGraphics2D/DisplaySync/entry/src/mock/mock-config.json5 deleted file mode 100644 index 323d1d611fecf4ecb751976e3a71500b3712a445..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySync/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkGraphics2D/DisplaySync/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0ab410fb7c701d5fd9a426c96c793cf8ee8f7b04..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, expect, it } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import Logger from '../utils/Logger'; - -const TAG = '[Sample_DisplaySync]'; -const BUNDLE = 'MyApp_' -const DELAYMS_1S = 1000; -const DELAYMS_2S = 2000; -const DELAYMS_5S = 5000; - -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -export default function abilityTest() { - describe('AbilityTest', () => { - it(BUNDLE + 'StartAbility_001, begin', 0, async (done: Function) => { - Logger.info(TAG, BUNDLE + 'StartAbility_001'); - let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - try { - await abilityDelegator.startAbility({ - bundleName: bundleName, - abilityName: 'EntryAbility' - }); - } catch (err) { - Logger.info(TAG, `beforeAll exception = ${JSON.stringify(err)}`); - } - - Logger.info(TAG, BUNDLE + 'StartAbility_001, end'); - done(); - }); - - /** - * @tc.number:SUB_GRAPHIC_2D_HGM_DISPLAYSYNC_0200 - * @tc.name:PropertyAnimation_001 - * @tc.desc:PropertyAnimation - * @tc.size:MediumTest - * @tc.type:Function - * @tc.level:Level 1 - */ - it(BUNDLE + 'PropertyAnimation_001', 0, async (done: Function) => { - try { - Logger.info(TAG, BUNDLE + 'PropertyAnimation_001 beg' + - 'in'); - - let driver = Driver.create(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('AnimationFpsRequest')); - let propertyAnimationButton = await driver.findComponent(ON.id('AnimationFpsRequest')); - await propertyAnimationButton.click(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('PropertyAnimationStart')); - let startButton = await driver.findComponent(ON.id('PropertyAnimationStart')); - await startButton.click(); - await driver.delayMs(DELAYMS_5S); - - await driver.assertComponentExist(ON.id('PropertyAnimationBack')); - let backButton = await driver.findComponent(ON.id('PropertyAnimationBack')); - await backButton.click(); - await driver.delayMs(DELAYMS_1S); - - Logger.info(TAG, BUNDLE + 'PropertyAnimation_001 end'); - done(); - } catch (error) { - expect().assertFail(); - } - }); - - it(BUNDLE + 'UiFpsRequest_001', 0, async (done: Function) => { - try { - Logger.info(TAG, BUNDLE + 'UiFpsRequest_001, begin'); - - let driver = Driver.create(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('UiFpsRequest')); - let customDrawButton = await driver.findComponent(ON.id('UiFpsRequest')); - - await customDrawButton.click(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('CustomDrawStart')); - let startButton = await driver.findComponent(ON.id('CustomDrawStart')); - - await startButton.click(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('CustomDrawStop')); - let stopButton = await driver.findComponent(ON.id('CustomDrawStop')); - - await stopButton.click(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('CustomDrawBack')); - let backButton = await driver.findComponent(ON.id('CustomDrawBack')); - - await backButton.click(); - await driver.delayMs(DELAYMS_1S); - - Logger.info(TAG, BUNDLE + 'UiFpsRequest_001 end'); - done(); - } catch (error) { - expect().assertFail(); - } - }); - - /** - * @tc.number:SUB_GRAPHIC_2D_HGM_DISPLAYSYNC_0100 - * @tc.name:CustomDraw_001 - * @tc.desc:CustomDraw - * @tc.size:MediumTest - * @tc.type:Function - * @tc.level:Level 1 - */ - it(BUNDLE + 'CustomDraw_001', 0, async (done: Function) => { - try { - Logger.info(TAG, BUNDLE + 'CustomDraw_001 begin'); - - let driver = Driver.create(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('XComponent')); - - let customDrawButton = await driver.findComponent(ON.id('XComponent')); - - await customDrawButton.click(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('Start')); - - let startButton = await driver.findComponent(ON.id('Start')); - - await startButton.click(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('Stop')); - - let stopButton = await driver.findComponent(ON.id('Stop')); - - await stopButton.click(); - await driver.delayMs(DELAYMS_2S); - - await driver.assertComponentExist(ON.id('Back')); - - let backButton = await driver.findComponent(ON.id('Back')); - - await backButton.click(); - await driver.delayMs(DELAYMS_1S); - - Logger.info(TAG, BUNDLE + 'CustomDraw_001 end'); - done(); - } catch (error) { - expect().assertFail(); - } - }); - }) -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/ohosTest/ets/test/List.test.ets b/ArkGraphics2D/DisplaySync/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index c64e0b06938d246ce044186d4b2d02b500a89e14..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/ohosTest/ets/utils/Logger.ets b/ArkGraphics2D/DisplaySync/entry/src/ohosTest/ets/utils/Logger.ets deleted file mode 100644 index e6d55f5ac6aa03373a9cf02a7d4128ffa5175c8a..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/ohosTest/ets/utils/Logger.ets +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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 '@ohos.hilog'; - -class Logger { - private domain: number = 0xF811; - private prefix: string = ''; - private format: string = '%{public}s, %{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('[Sample_DisplaySync]'); \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/ohosTest/module.json5 b/ArkGraphics2D/DisplaySync/entry/src/ohosTest/module.json5 deleted file mode 100644 index f6bdce9946cb02c0385e5a8836c133c93945013d..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkGraphics2D/DisplaySync/entry/src/test/List.test.ets b/ArkGraphics2D/DisplaySync/entry/src/test/List.test.ets deleted file mode 100644 index a60c87c5cbb0badf7c3fd8975034590e6fafa992..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/entry/src/test/LocalUnit.test.ets b/ArkGraphics2D/DisplaySync/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index b080060dcc059796d440db79c0ad94bed7b7bc79..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/hvigor/hvigor-config.json5 b/ArkGraphics2D/DisplaySync/hvigor/hvigor-config.json5 deleted file mode 100644 index 588ef752bc769d16dcf3826bfac354920c592813..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySync/hvigorfile.ts b/ArkGraphics2D/DisplaySync/hvigorfile.ts deleted file mode 100644 index d5e782664a81fec19737e2dff4dead3223a9b686..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkGraphics2D/DisplaySync/oh-package.json5 b/ArkGraphics2D/DisplaySync/oh-package.json5 deleted file mode 100644 index fa0f78a6061227a18ae37179dd9fa76c6d5baa33..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkGraphics2D/DisplaySync/ohosTest.md b/ArkGraphics2D/DisplaySync/ohosTest.md deleted file mode 100644 index a9138197dd9bf1a47499832bc535eebcff7d87c9..0000000000000000000000000000000000000000 --- a/ArkGraphics2D/DisplaySync/ohosTest.md +++ /dev/null @@ -1,19 +0,0 @@ -# DisplaySync测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|-----------------|-----------------|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|------|------| -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 主页展示 | 设备正常运行 | | 展示 Requesting Frame Rates for Animations、Requesting Frame Rates for UI Components、Requesting Frame Rates for Custom Content 按钮 | 是 | Pass | -| 主页按钮点击 | 位于主页 | 点击 Requesting Frame Rates for Animations | 跳转至请求动画绘制帧率页面 | 是 | Pass | -| 动画绘制帧率开始 | 位于动画绘制帧率面 | 点击Start | 三个方块分别按照30hz、40hz、60hz频率来回移动 | 是 | Pass | -| 动画绘制帧率返回主页 | 位于动画绘制帧率页面 | 点击Back | 回到主页 | 是 | Pass | -| 主页按钮点击 | 位于主页 | 点击 Requesting Frame Rates for UI Components | 跳转请求 UI 绘制帧率页面 | 是 | Pass | -| 请求 UI 绘制帧率开始 | 位于请求 UI 绘制帧率 | 点击 Start | 数字 30、60 分别按照 30hz、60hz 频率放大缩小 | 是 | Pass | -| 请求 UI 绘制帧率停止 | 位于请求 UI 绘制帧率 | 点击 Stop | 数字 30、60 变化停止 | 是 | Pass | -| 请求 UI 绘制帧率返回 | 位于请求 UI 绘制帧率 | 点击 Back | 回到主页 | 是 | Pass | -| 主页按钮点击 | 位于主页 | 点击 Requesting Frame Rates for Custom Content | 跳转 请求自绘制内容绘制帧率 页面 | 是 | Pass | -| 请求自绘制内容绘制帧率开始 | 位于请求自绘制内容绘制帧率页面 | 点击Start | 两个方块分别按照 30hz、120hz 频率来回移动 | 是 | pass | -| 请求自绘制内容绘制帧率停止 | 位于请求自绘制内容绘制帧率页面 | 点击Stop | 两个方块移动停止 | 是 | pass | -| 请求自绘制内容绘制帧率返回主页 | 位于请求自绘制内容绘制帧率页面 | 点击Back | 回到主页 | 是 | pass | \ No newline at end of file diff --git a/ArkGraphics2D/DisplaySync/screenshots/device/UI.png b/ArkGraphics2D/DisplaySync/screenshots/device/UI.png deleted file mode 100644 index edaa1bd7b952da56ada1f17f230bedc87f3b4d6b..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySync/screenshots/device/UI.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySync/screenshots/device/XComponent.png b/ArkGraphics2D/DisplaySync/screenshots/device/XComponent.png deleted file mode 100644 index 77d32d82edab02be8a93f43561283454764744f9..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySync/screenshots/device/XComponent.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySync/screenshots/device/animation.png b/ArkGraphics2D/DisplaySync/screenshots/device/animation.png deleted file mode 100644 index ec438b209234337590d796a9fa445f08f6d5f9a2..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySync/screenshots/device/animation.png and /dev/null differ diff --git a/ArkGraphics2D/DisplaySync/screenshots/device/index.png b/ArkGraphics2D/DisplaySync/screenshots/device/index.png deleted file mode 100644 index d8949b46e924459b59871c0351703ba0b8fedeee..0000000000000000000000000000000000000000 Binary files a/ArkGraphics2D/DisplaySync/screenshots/device/index.png and /dev/null differ diff --git a/ArkUIKit/AccessibilityCapi/.gitignore b/ArkUIKit/AccessibilityCapi/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/AccessibilityCapi/AppScope/app.json5 b/ArkUIKit/AccessibilityCapi/AppScope/app.json5 deleted file mode 100644 index 634a70a289dad40f02af0831f711aa64703df1b9..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.accessibilityCapi", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/AccessibilityCapi/AppScope/resources/base/element/string.json b/ArkUIKit/AccessibilityCapi/AppScope/resources/base/element/string.json deleted file mode 100644 index 8829529342444f211e7fd0428202be9feb85b8b7..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "accessibilityCapi" - } - ] -} diff --git a/ArkUIKit/AccessibilityCapi/AppScope/resources/base/media/background.png b/ArkUIKit/AccessibilityCapi/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AccessibilityCapi/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/AccessibilityCapi/AppScope/resources/base/media/foreground.png b/ArkUIKit/AccessibilityCapi/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AccessibilityCapi/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/AccessibilityCapi/AppScope/resources/base/media/layered_image.json b/ArkUIKit/AccessibilityCapi/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/README_zh.md b/ArkUIKit/AccessibilityCapi/README_zh.md deleted file mode 100644 index 23b180f4e2346774bdd49879e2901a93153aae4d..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/README_zh.md +++ /dev/null @@ -1,76 +0,0 @@ -# AccessibilityCAPI示例 - -### 介绍 - -本示例[通过XComponent接入无障碍](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ndk-accessibility-xcomponent)中各场景的开发示例,展示在工程中,帮助开发者更好地理解Accessibility CAPI接口并合理使用。该工程中展示的接口详细描述可查如下链接: - -[native_interface_accessibility.h](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-interface-accessibility-h.md)。 - -### 效果预览 - -| 首页 | -|------------------------------------| -| ![](screenshots/device/AccessibilityCapiSample1.PNG) | -| ![](screenshots/device/AccessibilityCapiSample2.PNG) | - -### 使用说明 - -1. 通过开启屏幕朗读后使用单指滑动点击双击等操作,可以验证无障碍C-API接口的基本功能。 - -### 工程目录 -``` -├──entry/src/main -│ ├──cpp // C++代码区 -│ │ ├──CMakeLists.txt // CMake配置文件 -│ │ ├──napi_init.cpp // Napi模块注册 -│ │ ├──common -│ │ │ └──common.h // 常量定义文件 -| | ├──fakenode // 渲染模块 -| | | ├──fake_node.cpp -| | | └──fake_node.h -│ │ ├──manager -| | | ├──AccessibilityManager.cpp // Accessibility CAPI接口示例 -| | | ├──AccessibilityManager.h -│ │ │ ├──plugin_manager.cpp -│ │ │ ├──plugin_manager.h -| | | ├──xcomponent_manager.cpp -| | | └──xcomponent_manager.h -| | ├──types //定义接口文件 -│ │ │ ├──libnativerender -│ │ │ │ ├──Index.d.ts -│ │ │ │ ├──oh-package.json5 -│ ├──ets // ets代码区 -│ │ ├──entryability -│ │ │ └──EntryAbility.ts // 程序入口类 -│ │ └──pages // 页面文件 -│ │ └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API20版本SDK,版本号:6.0.0.41,镜像版本号:OpenHarmony_6.0.0.41。 - -3.本示例需要使用DevEco Studio 5.0.5 Release (Build Version: 5.0.13.200, built on May 13, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/AccessibilityCapi > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/build-profile.json5 b/ArkUIKit/AccessibilityCapi/build-profile.json5 deleted file mode 100644 index 2db7b3656fe4f4e9a5e3b66db5b22dce5d873eb8..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/build-profile.json5 +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/code-linter.json5 b/ArkUIKit/AccessibilityCapi/code-linter.json5 deleted file mode 100644 index 5c4682f8164874ec7e9cb8f99ff8b3228ffbc126..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/code-linter.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/.gitignore b/ArkUIKit/AccessibilityCapi/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/build-profile.json5 b/ArkUIKit/AccessibilityCapi/entry/build-profile.json5 deleted file mode 100644 index c23b01fe5847951e2c042c28e4739bce5207be18..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - }, - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/hvigorfile.ts b/ArkUIKit/AccessibilityCapi/entry/hvigorfile.ts deleted file mode 100644 index b0e3a1ab98a91bc918d6404b2413111a5011f14a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/obfuscation-rules.txt b/ArkUIKit/AccessibilityCapi/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/AccessibilityCapi/entry/oh-package.json5 b/ArkUIKit/AccessibilityCapi/entry/oh-package.json5 deleted file mode 100644 index 67c2f26437e06f21e4723643a292c71012385531..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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": { - } -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 6c330c428c0216c2464d92ec442aceb9cd6c280c..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(accessibilityCapi) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(nativerender SHARED - manager/plugin_manager.cpp - manager/xcomponent_manager.cpp - manager/AccessibilityManager.cpp - napi_init.cpp - fakenode/fake_node.h - fakenode/fake_node.cpp) - -find_library( - # Sets the name of the path variable. - hilog-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - hilog_ndk.z -) - -find_library( - # Sets the name of the path variable. - libace-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_ndk.z -) - -find_library( - # Sets the name of the path variable. - libnapi-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_napi.z -) -find_library( - libnative_window - - native_window -) - -target_link_libraries(nativerender PUBLIC ${hilog-lib} ${libace-lib} ${libnapi-lib} ${libnative_window}) \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/common/common.h b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/common/common.h deleted file mode 100644 index 1026e451384360b79fb1e965b10c8ced8d2561ac..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/common/common.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_COMMON_H -#define NATIVE_XCOMPONENT_COMMON_H - -#include -#include -#include -#include -#include -#include -#include -#include -/** - * Log print domain. - */ -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - - -#endif // NATIVE_XCOMPONENT_COMMON_H diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/fakenode/fake_node.cpp b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/fakenode/fake_node.cpp deleted file mode 100644 index a97a02227501d8729419755ade61c530f7ea6201..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/fakenode/fake_node.cpp +++ /dev/null @@ -1,180 +0,0 @@ -// -// Created on 30/9/2025. -// -// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found, -// please include "napi/native_api.h". -#include -#include "fake_node.h" -namespace NativeXComponentSample { -const int32_t NUMBER_MIN = 0; -const int32_t NUMBER_CURRENT = 20; -const int32_t NUMBER_MAX = 100; -const int32_t NUMBER_COUNT = 5; -const int32_t NUMBER_INDEX = 5; -const int32_t NUMBER_SPAN = 2; - -void AccessibleObject::fillAccessibilityElement(ArkUI_AccessibilityElementInfo *element) -{ - if (!accessibilityText_.empty()) { - OH_ArkUI_AccessibilityElementInfoSetAccessibilityText(element, accessibilityText_.data()); - } - if (!accessibilityDescription_.empty()) { - OH_ArkUI_AccessibilityElementInfoSetAccessibilityDescription(element, accessibilityDescription_.data()); - } - OH_ArkUI_AccessibilityElementInfoSetComponentType(element, ObjectType()); - OH_ArkUI_AccessibilityElementInfoSetContents(element, Name().data()); - OH_ArkUI_AccessibilityElementInfoSetHintText(element, Hint()); - OH_ArkUI_AccessibilityElementInfoSetVisible(element, IsVisible()); - OH_ArkUI_AccessibilityElementInfoSetEnabled(element, IsEnable()); - OH_ArkUI_AccessibilityElementInfoSetClickable(element, Clickable()); - OH_ArkUI_AccessibilityElementInfoSetFocusable(element, Focusable()); - OH_ArkUI_AccessibilityElementInfoSetFocused(element, Focused()); - OH_ArkUI_AccessibilityElementInfoSetIsPassword(element, isPassword_); - OH_ArkUI_AccessibilityElementInfoSetScrollable(element, isScrollable_); - OH_ArkUI_AccessibilityElementInfoSetLongClickable(element, isLongClick_); - OH_ArkUI_AccessibilityElementInfoSetEditable(element, true); - OH_ArkUI_AccessibilityElementInfoSetAccessibilityGroup(element, isGroup_); - OH_ArkUI_AccessibilityElementInfoSetCheckable(element, checkable_); - OH_ArkUI_AccessibilityElementInfoSetChecked(element, checked_); - OH_ArkUI_AccessibilityElementInfoSetSelected(element, checkable_); - OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel(element, accessibilityLevel_.data()); - if (ObjectType() == "FakeSilder") { - OH_ArkUI_AccessibilityElementInfoSetRangeInfo(element, &rangeInfo_); - } - if (ObjectType() == "FakeList") { - OH_ArkUI_AccessibilityElementInfoSetGridInfo(element, &gridInfo_); - } - if (ObjectType() == "FakeSwiper") { - OH_ArkUI_AccessibilityElementInfoSetGridItemInfo(element, &gridItemInfo_); - } - if (selectedTextStart_ < selectedTextEnd_) { - if (0 <= selectedTextStart_ && selectedTextStart_ <= static_cast(accessibilityText_.size())) { - OH_ArkUI_AccessibilityElementInfoSetSelectedTextStart(element, selectedTextStart_); - } - if (0 <= selectedTextEnd_ && selectedTextEnd_ <= static_cast(accessibilityText_.size())) { - OH_ArkUI_AccessibilityElementInfoSetSelectedTextEnd(element, selectedTextEnd_); - } - } - if ((itemCount_ >= endItemIndex_) && (endItemIndex_ > 0) && (startItemIndex_ <= currentItemIndex_) && - (currentItemIndex_ <= endItemIndex_)) { - OH_ArkUI_AccessibilityElementInfoSetItemCount(element, itemCount_); - OH_ArkUI_AccessibilityElementInfoSetStartItemIndex(element, startItemIndex_); - OH_ArkUI_AccessibilityElementInfoSetCurrentItemIndex(element, currentItemIndex_); - OH_ArkUI_AccessibilityElementInfoSetEndItemIndex(element, endItemIndex_); - } - OH_ArkUI_AccessibilityElementInfoSetAccessibilityOffset(element, offset_); - OH_ArkUI_AccessibilityElementInfoSetZIndex(element, zIndex_); - OH_ArkUI_AccessibilityElementInfoSetAccessibilityOpacity(element, opacity_); - OH_ArkUI_AccessibilityElementInfoSetBackgroundImage(element, backgroundImage_.data()); - OH_ArkUI_AccessibilityElementInfoSetBackgroundColor(element, backgroundColor_.data()); - OH_ArkUI_AccessibilityElementInfoSetBlur(element, blue_.data()); - OH_ArkUI_AccessibilityElementInfoSetHitTestBehavior(element, hitTestBehavior_.data()); - - ArkUI_AccessibleAction actions[10]; - int index = 0; - if (this->Clickable()) { - actions[index].actionType = ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLICK; - actions[index].description = "Click"; - index++; - } - - if (this->Focusable()) { - actions[index].actionType = ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_GAIN_ACCESSIBILITY_FOCUS; - actions[index].description = "Focus"; - index++; - actions[index].actionType = ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLEAR_ACCESSIBILITY_FOCUS; - actions[index].description = "ClearFocus"; - index++; - } - if (index > 0) { - OH_ArkUI_AccessibilityElementInfoSetOperationActions(element, index, actions); - } -} - -void FakeWidget::AddButton(const bool fillText, const bool fillDescription) -{ - static int i = 1; - auto node = new FakeButton("button" + std::to_string(i)); - if (fillText) { - node->SetAccessibilityText("this is Text for button."); - } - if (fillDescription) { - node->SetAccessibilityDescription("this is Description for button."); - } - objects.push_back(node); - i++; -} - -void FakeWidget::AddText(const bool fillText, const bool fillDescription) -{ - static int i = 1; - auto node = new FakeText("text" + std::to_string(i)); - if (fillText) { - node->SetAccessibilityText("this is Text for text."); - } - if (fillDescription) { - node->SetAccessibilityDescription("this is Description for text."); - } - objects.push_back(node); - i++; -} - -void FakeWidget::AddSlider(const bool fillText, const bool fillDescription) -{ - static int i = 1; - auto node = new FakeSlider("slider" + std::to_string(i)); - ArkUI_AccessibleRangeInfo rangeInfo; - rangeInfo.current = NUMBER_CURRENT; - rangeInfo.min = NUMBER_MIN; - rangeInfo.max = NUMBER_MAX; - node->SetRangeInfo(rangeInfo); - if (fillText) { - node->SetAccessibilityText("this is Text for slider."); - } - if (fillDescription) { - node->SetAccessibilityDescription("this is Description for slider."); - } - objects.push_back(node); - i++; -} -void FakeWidget::AddList(const bool fillText, const bool fillDescription) -{ - static int i = 1; - auto node = new FakeList("list" + std::to_string(i)); - ArkUI_AccessibleGridInfo gridInfo; - gridInfo.columnCount = NUMBER_COUNT; - gridInfo.rowCount = NUMBER_COUNT; - gridInfo.selectionMode = NUMBER_MIN; - node->SetGridInfo(gridInfo); - if (fillText) { - node->SetAccessibilityText("this is Text for list."); - } - if (fillDescription) { - node->SetAccessibilityDescription("this is Description for list."); - } - objects.push_back(node); - i++; -} - -void FakeWidget::AddSwiper(const bool fillText, const bool fillDescription) -{ - static int i = 1; - auto node = new FakeSwiper("swiper" + std::to_string(i)); - ArkUI_AccessibleGridItemInfo gridItemInfo; - gridItemInfo.rowSpan = NUMBER_SPAN; - gridItemInfo.rowIndex = NUMBER_INDEX; - gridItemInfo.columnSpan = NUMBER_SPAN; - gridItemInfo.columnIndex = NUMBER_INDEX; - gridItemInfo.selected = true; - gridItemInfo.heading = true; - node->SetGridItemInfo(gridItemInfo); - if (fillText) { - node->SetAccessibilityText("this is Text for list."); - } - if (fillDescription) { - node->SetAccessibilityDescription("this is Description for list."); - } - objects.push_back(node); - i++; -} -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/fakenode/fake_node.h b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/fakenode/fake_node.h deleted file mode 100644 index 3d04f18939f47eca9ea77f50bcaf01366b987883..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/fakenode/fake_node.h +++ /dev/null @@ -1,353 +0,0 @@ -// -// Created on 30/9/2025. -// -// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found, -// please include "napi/native_api.h". - -#ifndef ACCESSIBILITY_CAPI_FAKE_NODE_H -#define ACCESSIBILITY_CAPI_FAKE_NODE_H -#include -#include -#include -#include "common/common.h" -#include -namespace NativeXComponentSample { -class AccessibleObject { -public: - explicit AccessibleObject(const std::string &name) : name_(name), originName_(name) {} -// 设置string和int类型属性 - void SetAccessibilityLevel(const std::string &accessibilityLevel) - { - accessibilityLevel_ = accessibilityLevel; - } - void SetAccessibilityText(const std::string &accessibilityText) - { - accessibilityText_ = accessibilityText; - } - void SetAccessibilityDescription(const std::string &accessibilityDescription) - { - accessibilityDescription_ = accessibilityDescription; - } - void SetAnnouncedForAccessibility(const std::string &announcedForAccessibility) - { - announcedForAccessibility_ = announcedForAccessibility; - } - const std::string GetAnnouncedForAccessibility() - { - return announcedForAccessibility_; - } - void SetName(const std::string &name) - { - name_ = name; - } - std::string Name() const - { - return name_; - } - std::string OriginName() const - { - return originName_; - } - - void SetBackgroundColor(const std::string &color) - { - backgroundColor_ = color; - } - void SetBackgroundImage(const std::string &image) - { - backgroundImage_ = image; - } - void SetBlue(const std::string &blue) - { - blue_ = blue; - } - void SetHitTestBehavior(const std::string &hitTestBehavior) - { - hitTestBehavior_ = hitTestBehavior; - } - void SetSelectedText(int32_t textStart, int32_t textEnd) - { - selectedTextStart_ = textStart; - selectedTextEnd_ = textEnd; - } - void SetSelectedItem(int32_t itemCount, int32_t itemStart, int32_t itemCurrent, int32_t itemEnd) - { - itemCount_ = itemCount; - startItemIndex_ = itemStart; - endItemIndex_ = itemEnd; - currentItemIndex_ = itemCurrent; - } - void SetOffset(int32_t offset) - { - offset_ = offset; - } - void SetRangeInfo(ArkUI_AccessibleRangeInfo rangeInfo) - { - rangeInfo_ = rangeInfo; - } - ArkUI_AccessibleRangeInfo GetRangeInfo() - { - return rangeInfo_; - } - ArkUI_AccessibleGridInfo GetGridInfo() - { - return gridInfo_; - } - ArkUI_AccessibleGridItemInfo GetGridItemInfo() - { - return gridItemInfo_; - } - void SetGridInfo(ArkUI_AccessibleGridInfo gridInfo) - { - gridInfo_ = gridInfo; - } - void SetGridItemInfo(ArkUI_AccessibleGridItemInfo gridItemInfo) - { - gridItemInfo_ = gridItemInfo; - } - void SetFocus(bool focus) - { - focus_ = focus; - } - virtual void SetFocusable(bool focusable) - { - focusable_ = focusable; - } - virtual void SetClickable(bool clickable) - { - clickable_ = clickable; - } - void SetChecked(bool checked) - { - checked_ = checked; - } - void SetCheckable(bool checkable) - { - checkable_ = checkable; - } - void SetIsPassword(bool isPassword) - { - isPassword_ = isPassword; - } - void SetScrollable(bool isScrollable) - { - isScrollable_ = isScrollable; - } - void SetLongClickable(bool isLongClick) - { - isLongClick_ = isLongClick; - } - void SetIsGroup(bool isGroup) - { - isGroup_ = isGroup; - } - void SetIsSelected(bool isSelected) - { - isSelected_ = isSelected; - } - void SetIsEnable(bool isEnable) - { - isEnable_ = isEnable; - } - - virtual bool Focused() const - { - return focus_; - } - virtual bool Focusable() const - { - return focusable_; - } - virtual const char *ObjectType() const - { - return "object"; - } - virtual const char *Hint() const - { - return "It's object"; - } - virtual void OnClick() - { - } - bool Clickable() const - { - return clickable_; - } - bool IsVisible() const - { - return isVisible_; - } - bool IsEnable() const - { - return isEnable_; - } - void fillAccessibilityElement(ArkUI_AccessibilityElementInfo *element); - -private: - std::string accessibilityLevel_ = "auto"; - std::string accessibilityText_; - std::string accessibilityDescription_; - std::string announcedForAccessibility_; - std::string name_; - std::string originName_; - std::string backgroundColor_; - std::string backgroundImage_; - std::string blue_; - std::string hitTestBehavior_; - - bool clickable_ = true; - bool focus_ = false; - bool focusable_ = true; - bool checked_ = false; - bool checkable_ = false; - bool isPassword_ = false; - bool isScrollable_ = false; - bool isLongClick_ = false; - bool isSelected_ = false; - bool isGroup_ = false; - bool isVisible_ = true; - bool isEnable_ = true; - - int32_t selectedTextStart_ = 0; - int32_t selectedTextEnd_ = 0; - int32_t currentItemIndex_ = 0; - int32_t startItemIndex_ = 0; - int32_t endItemIndex_ = 0; - int32_t itemCount_ = 0; - int32_t zIndex_ = 0; - int32_t offset_ = 0; - float opacity_ = 0.0f; - - ArkUI_AccessibleRangeInfo rangeInfo_; - ArkUI_AccessibleGridInfo gridInfo_; - ArkUI_AccessibleGridItemInfo gridItemInfo_; -}; - -class FakeButton : public AccessibleObject { -public: - explicit FakeButton(const std::string &name) : AccessibleObject(name) {} - char *Hint() const override { return "It's a button"; } - char *ObjectType() const override { return "FakeButton"; } - void OnClick() override - { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "AccessibleObject", "FakeButton OnClick"); - } -}; - -class FakeText : public AccessibleObject { -public: - explicit FakeText(const std::string &name) : AccessibleObject(name) {} - - char *Hint() const override { return "It's a text"; } - char *ObjectType() const override { return "FakeText"; } - void OnClick() override - { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "AccessibleObject", "FakeText OnClick"); - } -}; - -class FakeSlider : public AccessibleObject { -public: - explicit FakeSlider(const std::string &name) : AccessibleObject(name) {} - - char *Hint() const override { return "It's a slider"; } - char *ObjectType() const override { return "FakeSlider"; } - void OnClick() override - { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "AccessibleObject", "FakeSlider OnClick"); - } -}; - -class FakeList : public AccessibleObject { -public: - explicit FakeList(const std::string &name) : AccessibleObject(name) {} - - char *Hint() const override { return "It's a list"; } - char *ObjectType() const override { return "FakeList"; } - void OnClick() override - { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "AccessibleObject", "FakeList OnClick"); - } -}; - -class FakeSwiper : public AccessibleObject { -public: - explicit FakeSwiper(const std::string &name) : AccessibleObject(name) {} - - char *Hint() const override { return "It's a swiper"; } - char *ObjectType() const override { return "FakeSwiper"; } - void OnClick() override - { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "AccessibleObject", "FakeSwiper OnClick"); - } -}; - -class FakeWidget : public AccessibleObject { -public: - static FakeWidget &Instance() - { - static FakeWidget w; - return w; - } - - const std::vector &GetAllObjects(std::string instanceId) const - { - for (int i = 0; i < objects.size(); i++) { - objects[i]->SetName(objects[i]->OriginName() + instanceId); - } - return objects; - } - - AccessibleObject *GetChild(int elementId) const - { - if (elementId <= 0) { - return nullptr; - } - if (elementId - 1 >= objects.size()) { - return nullptr; - } - return objects.at(elementId - 1); - } - - bool Focusable() const override { return false; } - char *Hint() const override { return "It's a widget"; } - char *ObjectType() const override { return "Widget"; } - void OnClick() override - { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "AccessibleObject", "FakeWidget OnClick"); - } - -private: - FakeWidget() : AccessibleObject("fakeWidget") - { - this->AddButton(true, false); - this->AddButton(true, true); - this->AddButton(false, false); - this->AddButton(false, true); - this->AddText(true, false); - this->AddText(true, true); - this->AddText(false, false); - this->AddText(false, true); - this->AddSlider(true, true); - this->AddList(true, true); - this->AddSwiper(true, true); - } - ~FakeWidget() - { - for (auto &obj : objects) { - delete obj; - } - } - -private: - void AddButton(const bool fillText, const bool fillDescription); - void AddText(const bool fillText, const bool fillDescription); - void AddSlider(const bool fillText, const bool fillDescription); - void AddList(const bool fillText, const bool fillDescription); - void AddSwiper(const bool fillText, const bool fillDescription); - -private: - std::vector objects; -}; -} -#endif //ACCESSIBILITY_CAPI_FAKE_NODE_H diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.cpp b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.cpp deleted file mode 100644 index 09175edb7f0a6deb8424c74e5f234a1d8b073548..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.cpp +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include "common/common.h" -#include "fakenode/fake_node.h" -#include "AccessibilityManager.h" - -const char *DEFAULT_ID = "XComponentIdSingle"; - -const char *LOG_PRINT_TEXT = "AccessibilityManager"; -namespace NativeXComponentSample { - -const int32_t NUMBER_ZERO = 0; -const int32_t NUMBER_FIRST = 100; -const int32_t NUMBER_SECOND = 500; -const int32_t NUMBER_THIRD = 800; - -void FillEvent(ArkUI_AccessibilityEventInfo *eventInfo, ArkUI_AccessibilityElementInfo *elementInfo, - ArkUI_AccessibilityEventType eventType, std::string announcedText) -{ - if (eventInfo == nullptr) { - return; - } - if (elementInfo == nullptr) { - return; - } - OH_ArkUI_AccessibilityEventSetEventType(eventInfo, eventType); - - OH_ArkUI_AccessibilityEventSetElementInfo(eventInfo, elementInfo); - - if (eventType == ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ANNOUNCE_FOR_ACCESSIBILITY && announcedText.size() > 0) { - OH_ArkUI_AccessibilityEventSetTextAnnouncedForAccessibility(eventInfo, announcedText.data()); - } -} - - -ArkUI_AccessibilityProvider *g_provider = nullptr; - -void AccessibilityManager::SendAccessibilityAsyncEvent(ArkUI_AccessibilityElementInfo *elementInfo, - ArkUI_AccessibilityEventType eventType, - std::string announcedText) -{ - auto eventInfo = OH_ArkUI_CreateAccessibilityEventInfo(); - // 1.填写event内容 - FillEvent(eventInfo, elementInfo, eventType, announcedText); - // 2.callback - auto callback = [](int32_t errorCode) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "result: %{public}d", errorCode); - }; - // 3. 调用接口发送事件给OH侧 - OH_ArkUI_SendAccessibilityAsyncEvent(g_provider, eventInfo, callback); -} - -AccessibilityManager::AccessibilityManager() -{ -// 多实例场景 - accessibilityProviderCallbacksWithInstance_.findAccessibilityNodeInfosById = FindAccessibilityNodeInfosById; - accessibilityProviderCallbacksWithInstance_.findAccessibilityNodeInfosByText = FindAccessibilityNodeInfosByText; - accessibilityProviderCallbacksWithInstance_.findFocusedAccessibilityNode = FindFocusedAccessibilityNode; - accessibilityProviderCallbacksWithInstance_.findNextFocusAccessibilityNode = FindNextFocusAccessibilityNode; - accessibilityProviderCallbacksWithInstance_.executeAccessibilityAction = ExecuteAccessibilityAction; - accessibilityProviderCallbacksWithInstance_.clearFocusedFocusAccessibilityNode = ClearFocusedFocusAccessibilityNode; - accessibilityProviderCallbacksWithInstance_.getAccessibilityNodeCursorPosition = GetAccessibilityNodeCursorPosition; -// 单实例场景 - accessibilityProviderCallbacks_.findAccessibilityNodeInfosById = FindAccessibilityNodeInfosById; - accessibilityProviderCallbacks_.findAccessibilityNodeInfosByText = FindAccessibilityNodeInfosByText; - accessibilityProviderCallbacks_.findFocusedAccessibilityNode = FindFocusedAccessibilityNode; - accessibilityProviderCallbacks_.findNextFocusAccessibilityNode = FindNextFocusAccessibilityNode; - accessibilityProviderCallbacks_.executeAccessibilityAction = ExecuteAccessibilityAction; - accessibilityProviderCallbacks_.clearFocusedFocusAccessibilityNode = ClearFocusedFocusAccessibilityNode; - accessibilityProviderCallbacks_.getAccessibilityNodeCursorPosition = GetAccessibilityNodeCursorPosition; -} - -void AccessibilityManager::Initialize(const std::string &id, OH_NativeXComponent *nativeXComponent) -{ - int32_t ret = OH_NativeXComponent_GetNativeAccessibilityProvider(nativeXComponent, &provider); - if (provider == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "get provider is null"); - return; - } - // 2.注册回调函数 - ret = OH_ArkUI_AccessibilityProviderRegisterCallbackWithInstance(id.c_str(), provider, - &accessibilityProviderCallbacksWithInstance_); - if (ret != 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "InterfaceDesignTest OH_ArkUI_AccessibilityProviderRegisterCallback failed"); - return; - } - g_provider = provider; -} - -int32_t AccessibilityManager::FindAccessibilityNodeInfosById(const char* instanceId, int64_t elementId, - ArkUI_AccessibilitySearchMode mode, int32_t requestId, ArkUI_AccessibilityElementInfoList *elementList) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "FindAccessibilityNodeInfosById start,instanceId %{public}s elementId: %{public}ld, " - "requestId: %{public}d, mode: %{public}d", instanceId, - elementId, requestId, static_cast(mode)); - if (elementList == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "FindAccessibilityNodeInfosById elementList is null"); - return OH_NATIVEXCOMPONENT_RESULT_FAILED; - } - int ret = 0; - const int parentOfRoot = -2100000; - if (elementId == -1) { - elementId = 0; - } - - if (mode == ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_RECURSIVE_CHILDREN) { - // arkUi框架设计的特殊值,根节点必须设置parentId为这个值 - - // fill some fake nodes - auto rootNode = OH_ArkUI_AddAndGetAccessibilityElementInfo(elementList); - if (!rootNode) { - return OH_NATIVEXCOMPONENT_RESULT_FAILED; - } - OH_ArkUI_AccessibilityElementInfoSetElementId(rootNode, 0); - OH_ArkUI_AccessibilityElementInfoSetParentId(rootNode, parentOfRoot); - FakeWidget::Instance().fillAccessibilityElement(rootNode); - - ArkUI_AccessibleRect rect; - rect.leftTopX = NUMBER_ZERO; - rect.leftTopY = NUMBER_ZERO; - rect.rightBottomX = NUMBER_THIRD; - rect.rightBottomY = NUMBER_THIRD; - ret = OH_ArkUI_AccessibilityElementInfoSetScreenRect(rootNode, &rect); - OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel(rootNode, "no"); - auto objects = FakeWidget::Instance().GetAllObjects(instanceId); - int64_t childNodes[1024]; - for (int i = 0; i < objects.size(); i++) { - int elementId = i + 1; - - childNodes[i] = elementId; - } - for (int i = 0; i < objects.size(); i++) { - int elementId = i + 1; - childNodes[i] = elementId; - auto child = OH_ArkUI_AddAndGetAccessibilityElementInfo(elementList); - OH_ArkUI_AccessibilityElementInfoSetElementId(child, elementId); - OH_ArkUI_AccessibilityElementInfoSetParentId(child, 0); - OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel(child, "yes"); - objects[i]->fillAccessibilityElement(child); - - ArkUI_AccessibleRect rect; - rect.leftTopX = i * NUMBER_FIRST; - rect.leftTopY = NUMBER_FIRST; - rect.rightBottomX = i * NUMBER_FIRST + NUMBER_FIRST; - rect.rightBottomY = NUMBER_SECOND; - OH_ArkUI_AccessibilityElementInfoSetScreenRect(child, &rect); - if (objects[i]->ObjectType() == "FakeSlider") { - auto rangeInfo = objects[i]->GetRangeInfo(); - OH_ArkUI_AccessibilityElementInfoSetRangeInfo(child, &rangeInfo); - } - if (objects[i]->ObjectType() == "FakeList") { - auto gridInfo = objects[i]->GetGridInfo(); - OH_ArkUI_AccessibilityElementInfoSetGridInfo(child, &gridInfo); - } - if (objects[i]->ObjectType() == "FakeSwiper") { - auto gridItemInfo = objects[i]->GetGridItemInfo(); - OH_ArkUI_AccessibilityElementInfoSetGridItemInfo(child, &gridItemInfo); - } - } - - ret = OH_ArkUI_AccessibilityElementInfoSetChildNodeIds(rootNode, objects.size(), childNodes); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "FindAccessibilityNodeInfosById child count: %{public}ld %{public}d", - objects.size(), ret); - } else if (mode == ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_CURRENT) { - auto &widget = FakeWidget::Instance(); - AccessibleObject *obj = nullptr; - if (elementId == 0) { - obj = &widget; - } else { - obj = widget.GetChild(elementId); - } - if (!obj) { - return OH_NATIVEXCOMPONENT_RESULT_FAILED; - } - auto node = OH_ArkUI_AddAndGetAccessibilityElementInfo(elementList); - OH_ArkUI_AccessibilityElementInfoSetElementId(node, elementId); - OH_ArkUI_AccessibilityElementInfoSetParentId(node, elementId == 0 ? parentOfRoot : 0); - OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel(node, elementId == 0 ? "no" : "yes"); - obj->fillAccessibilityElement(node); - ArkUI_AccessibleRect rect; - if (elementId == 0) { - rect.leftTopX = NUMBER_ZERO; - rect.leftTopY = NUMBER_ZERO; - rect.rightBottomX = NUMBER_THIRD; - rect.rightBottomY = NUMBER_THIRD; - } else { - int i = elementId - 1; - rect.leftTopX = i * NUMBER_FIRST; - rect.leftTopY = NUMBER_FIRST; - rect.rightBottomX = i * NUMBER_FIRST + NUMBER_FIRST; - rect.rightBottomY = NUMBER_SECOND; - } - - OH_ArkUI_AccessibilityElementInfoSetScreenRect(node, &rect); - if (elementId == 0) { - auto objects = FakeWidget::Instance().GetAllObjects(instanceId); - int64_t childNodes[1024]; - - for (int i = 0; i < objects.size(); i++) { - int elementId = i + 1; - - childNodes[i] = elementId; - auto child = OH_ArkUI_AddAndGetAccessibilityElementInfo(elementList); - OH_ArkUI_AccessibilityElementInfoSetElementId(child, elementId); - OH_ArkUI_AccessibilityElementInfoSetParentId(child, 0); - - objects[i]->fillAccessibilityElement(child); - - ArkUI_AccessibleRect rect; - rect.leftTopX = i * NUMBER_FIRST; - rect.leftTopY = NUMBER_ZERO; - rect.rightBottomX = i * NUMBER_FIRST + NUMBER_FIRST; - rect.rightBottomY = NUMBER_SECOND; - OH_ArkUI_AccessibilityElementInfoSetScreenRect(child, &rect); - } - ret = OH_ArkUI_AccessibilityElementInfoSetChildNodeIds(node, objects.size(), childNodes); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "FindAccessibilityNodeInfosById child2 count: %{public}ld", objects.size()); - } - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "FindAccessibilityNodeInfosById end"); - return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; -} - -int32_t AccessibilityManager::FindAccessibilityNodeInfosByText(const char* instanceId, int64_t elementId, - const char *text, int32_t requestId, ArkUI_AccessibilityElementInfoList *elementList) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "FindAccessibilityNodeInfosByText start,instanceId %{public}s elementId: %{public}ld, " - "requestId: %{public}d, text: %{public}s.", instanceId, - elementId, requestId, text); - return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; -} - -int32_t AccessibilityManager::FindFocusedAccessibilityNode(const char* instanceId, int64_t elementId, - ArkUI_AccessibilityFocusType focusType, int32_t requestId, ArkUI_AccessibilityElementInfo *elementInfo) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "FindFocusedAccessibilityNode start instanceId %{public}s, " - "elementId: %{public}ld, requestId: %{public}d, focusType: %{public}d", - instanceId, elementId, requestId, static_cast(focusType)); - return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; -} - -int32_t AccessibilityManager::FindNextFocusAccessibilityNode(const char* instanceId, int64_t elementId, - ArkUI_AccessibilityFocusMoveDirection direction, int32_t requestId, - ArkUI_AccessibilityElementInfo *elementInfo) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "FindNextFocusAccessibilityNode instanceId %{public}s " - "elementId: %{public}ld, requestId: %{public}d, direction: %{public}d", - instanceId, elementId, requestId, static_cast(direction)); - auto objects = FakeWidget::Instance().GetAllObjects(instanceId); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "objects.size() %{public}d", objects.size()); - // object.size 不包含 root节点 - if ((elementId < 0) || (elementId > objects.size())) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "elementId invalid"); - return OH_NATIVEXCOMPONENT_RESULT_FAILED; - } - int64_t nextElementId = -1; - if (direction == ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_FORWARD) { - nextElementId = elementId + 1; - } else { - nextElementId = elementId - 1; - } - - // 屏幕朗读约束 如果是根节点 然后backward的话需要回到最后一个节点 - if ((nextElementId == -1) && (direction == ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_BACKWARD)) { - nextElementId = objects.size(); - } - - if (nextElementId > objects.size()) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "nextElementId invalid"); - return OH_NATIVEXCOMPONENT_RESULT_FAILED; - } - - if (nextElementId <= 0) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "nextElementId less than zero"); - return OH_NATIVEXCOMPONENT_RESULT_FAILED; - } - OH_ArkUI_AccessibilityElementInfoSetElementId(elementInfo, nextElementId); - OH_ArkUI_AccessibilityElementInfoSetParentId(elementInfo, 0); - // id 比object索引大1 - objects[nextElementId - 1]->fillAccessibilityElement(elementInfo); - ArkUI_AccessibleRect rect; - rect.leftTopX = nextElementId * NUMBER_FIRST; - rect.leftTopY = NUMBER_ZERO; - rect.rightBottomX = nextElementId * NUMBER_FIRST + NUMBER_FIRST; - rect.rightBottomY = NUMBER_SECOND; - OH_ArkUI_AccessibilityElementInfoSetScreenRect(elementInfo, &rect); - auto eventInfo = OH_ArkUI_CreateAccessibilityEventInfo(); - OH_ArkUI_AccessibilityEventSetRequestFocusId(eventInfo, requestId); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "%{public}ld", nextElementId); - return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; -} - -int32_t AccessibilityManager::ExecuteAccessibilityAction(const char* instanceId, int64_t elementId, - ArkUI_Accessibility_ActionType action, ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "ExecuteAccessibilityAction instanceId %{public}s elementId: %{public}ld, " - "action: %{public}d, requestId: %{public}d", - instanceId, elementId, action, requestId); - auto object = FakeWidget::Instance().GetChild(elementId); - if (!object) { - return 0; - } - auto announcedText = object->GetAnnouncedForAccessibility(); - auto element = OH_ArkUI_CreateAccessibilityElementInfo(); - OH_ArkUI_AccessibilityElementInfoSetElementId(element, elementId); - const char *actionKey = "some_key"; - char *actionValue = nullptr; - OH_ArkUI_FindAccessibilityActionArgumentByKey(actionArguments, actionKey, &actionValue); - switch (action) { - case ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLICK: - if (object) { - object->OnClick(); - object->fillAccessibilityElement(element); - } - AccessibilityManager::SendAccessibilityAsyncEvent(element, - ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_CLICKED, announcedText); - break; - case ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_GAIN_ACCESSIBILITY_FOCUS: - if (object) { - object->SetFocus(true); - - object->fillAccessibilityElement(element); - } - - AccessibilityManager::SendAccessibilityAsyncEvent(element, - ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUSED, - announcedText); - break; - case ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLEAR_ACCESSIBILITY_FOCUS: - if (object) { - object->SetFocus(false); - object->fillAccessibilityElement(element); - } - AccessibilityManager::SendAccessibilityAsyncEvent( - element, ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUS_CLEARED, - announcedText); - break; - default: - // Optionally handle unknown actions or do nothing - break; - } - OH_ArkUI_DestoryAccessibilityElementInfo(element); - return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; -} - -int32_t AccessibilityManager::ClearFocusedFocusAccessibilityNode(const char* instanceId) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "ClearFocusedFocusAccessibilityNode, instanceId %{public}s", instanceId); - return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; -} - -int32_t AccessibilityManager::GetAccessibilityNodeCursorPosition(const char* instanceId, int64_t elementId, - int32_t requestId, int32_t *index) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "GetAccessibilityNodeCursorPosition, instanceId %{public}s " - "elementId: %{public}ld, requestId: %{public}d, index: %{public}d", - instanceId, elementId, requestId, index); - return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; -} - -void AccessibilityManager::Initialize(OH_NativeXComponent *nativeXComponent) -{ - int32_t ret = OH_NativeXComponent_GetNativeAccessibilityProvider(nativeXComponent, &provider); - if (provider == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "get provider is null"); - return; - } - // 2.注册回调函数 - ret = OH_ArkUI_AccessibilityProviderRegisterCallback(provider, &accessibilityProviderCallbacks_); - if (ret != 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, - "InterfaceDesignTest OH_ArkUI_AccessibilityProviderRegisterCallback failed"); - return; - } - g_provider = provider; -} - -int32_t AccessibilityManager::FindAccessibilityNodeInfosById(int64_t elementId, ArkUI_AccessibilitySearchMode mode, - int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList) -{ - return FindAccessibilityNodeInfosById(DEFAULT_ID, elementId, mode, requestId, elementList); -} - -int32_t AccessibilityManager::FindAccessibilityNodeInfosByText(int64_t elementId, const char* text, int32_t requestId, - ArkUI_AccessibilityElementInfoList* elementList) -{ - return FindAccessibilityNodeInfosByText(DEFAULT_ID, elementId, text, requestId, elementList); -} - -int32_t AccessibilityManager::FindFocusedAccessibilityNode(int64_t elementId, ArkUI_AccessibilityFocusType focusType, - int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo) -{ - return FindFocusedAccessibilityNode(DEFAULT_ID, elementId, focusType, requestId, elementInfo); -} - -int32_t AccessibilityManager::FindNextFocusAccessibilityNode(int64_t elementId, - ArkUI_AccessibilityFocusMoveDirection direction, int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo) -{ - return FindNextFocusAccessibilityNode(DEFAULT_ID, elementId, direction, requestId, elementInfo); -} - -int32_t AccessibilityManager::ExecuteAccessibilityAction(int64_t elementId, ArkUI_Accessibility_ActionType action, - ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId) -{ - return ExecuteAccessibilityAction(DEFAULT_ID, elementId, action, actionArguments, requestId); -} - -int32_t AccessibilityManager::ClearFocusedFocusAccessibilityNode() -{ - return ClearFocusedFocusAccessibilityNode(DEFAULT_ID); -} - -int32_t AccessibilityManager::GetAccessibilityNodeCursorPosition(int64_t elementId, int32_t requestId, int32_t* index) -{ - return GetAccessibilityNodeCursorPosition(DEFAULT_ID, elementId, requestId, index); -} -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.h b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.h deleted file mode 100644 index 911bf04a862e2f0e4f9165b1749cc4c974ee69c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef OH_ACCESSIBILITYDEMO_ACCESSIBILITYMANAGER_H -#define OH_ACCESSIBILITYDEMO_ACCESSIBILITYMANAGER_H - -#include - -namespace NativeXComponentSample { -class AccessibilityManager { -public: - AccessibilityManager(); - void Initialize(const std::string &id, OH_NativeXComponent* nativeXComponent); - void Initialize(OH_NativeXComponent* nativeXComponent); - -public: -// 多实例场景 - static int32_t FindAccessibilityNodeInfosById(const char* instanceId, int64_t elementId, - ArkUI_AccessibilitySearchMode mode, int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList); - - static int32_t FindAccessibilityNodeInfosByText(const char* instanceId, int64_t elementId, - const char* text, int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList); - - static int32_t FindFocusedAccessibilityNode(const char* instanceId, int64_t elementId, - ArkUI_AccessibilityFocusType focusType, int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo); - - static int32_t FindNextFocusAccessibilityNode(const char* instanceId, int64_t elementId, - ArkUI_AccessibilityFocusMoveDirection direction, - int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo); - - static int32_t ExecuteAccessibilityAction(const char* instanceId, int64_t elementId, - ArkUI_Accessibility_ActionType action, ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId); - - static int32_t ClearFocusedFocusAccessibilityNode(const char* instanceId); - - static int32_t GetAccessibilityNodeCursorPosition(const char* instanceId, int64_t elementId, - int32_t requestId, int32_t* index); -// 单实例场景 - static int32_t FindAccessibilityNodeInfosById(int64_t elementId, ArkUI_AccessibilitySearchMode mode, - int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList); - - static int32_t FindAccessibilityNodeInfosByText(int64_t elementId, const char* text, int32_t requestId, - ArkUI_AccessibilityElementInfoList* elementList); - - static int32_t FindFocusedAccessibilityNode(int64_t elementId, ArkUI_AccessibilityFocusType focusType, - int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo); - - static int32_t FindNextFocusAccessibilityNode(int64_t elementId, ArkUI_AccessibilityFocusMoveDirection direction, - int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo); - - static int32_t ExecuteAccessibilityAction(int64_t elementId, ArkUI_Accessibility_ActionType action, - ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId); - - static int32_t ClearFocusedFocusAccessibilityNode(); - - static int32_t GetAccessibilityNodeCursorPosition(int64_t elementId, int32_t requestId, int32_t* index); - -private: - static void SendAccessibilityAsyncEvent(ArkUI_AccessibilityElementInfo *elementInfo, - ArkUI_AccessibilityEventType eventType, std::string announcedText); -private: - ArkUI_AccessibilityProvider* provider = nullptr; - ArkUI_AccessibilityProviderCallbacks accessibilityProviderCallbacks_; - ArkUI_AccessibilityProviderCallbacksWithInstance accessibilityProviderCallbacksWithInstance_; -}; -} -#endif //OH_ACCESSIBILITYDEMO_ACCESSIBILITYMANAGER_H diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/plugin_manager.cpp b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/plugin_manager.cpp deleted file mode 100644 index 880444646d5806806bb58e125e0f43eea35cd175..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/plugin_manager.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "plugin_manager.h" - -#include -#include -#include -#include - - -#include -// native render -#include -#include -#include - -#include "common/common.h" - -#include "xcomponent_manager.h" - -using namespace std; - -namespace NativeXComponentSample { -PluginManager PluginManager::pluginManager_; -AbilityInfo PluginManager::m_abilityInfo; - -const char *LOG_TAG_RECT = "TestRect"; - -napi_status callMethod(napi_env env, napi_value obj, const std::string &methodName, napi_value *out) -{ - napi_value func = nullptr; - napi_status ret = napi_ok; - - ret = napi_get_named_property(env, obj, methodName.data(), &func); - if (ret != napi_ok) { - return ret; - } - ret = napi_call_function(env, obj, func, 0, nullptr, out); - - return ret; -} - -void AbilityInfo::Init(napi_env env, napi_value uiAbility, napi_value windowStage) -{ - napi_value ohosWindow; - napi_status code = callMethod(env, windowStage, "getMainWindowSync", &ohosWindow); - if (code != napi_ok) { - napi_throw_error(env, nullptr, "call getMainWindowSync failed"); - } - this->env = env; - - napi_create_reference(env, uiAbility, 1, &this->uiAbility); - napi_create_reference(env, windowStage, 1, &this->windowStage); - napi_create_reference(env, ohosWindow, 1, &this->window); -} - -napi_value AbilityInfo::getWindow() -{ - napi_value value; - if (this->window) { - napi_status status = napi_get_reference_value(env, window, &value); - if (status != napi_ok) { - napi_throw_type_error(env, NULL, "getWindow failed"); - } - } - return value; -} - -AbilityInfo::~AbilityInfo() -{ - // todo release ref -} - -void setupNativeWindowBufferUsage(::OHNativeWindow *nativeWindow, std::uint64_t usageSetBits) -{ - std::uint64_t windowBufferUsage = 0; - auto getUsageRes = - ::OH_NativeWindow_NativeWindowHandleOpt(nativeWindow, ::NativeWindowOperation::GET_USAGE, &windowBufferUsage); - - std::uint64_t requestedWindowBufferUsage = windowBufferUsage | usageSetBits; - if (requestedWindowBufferUsage != windowBufferUsage) { - auto setUsageRes = ::OH_NativeWindow_NativeWindowHandleOpt( - nativeWindow, ::NativeWindowOperation::SET_USAGE, requestedWindowBufferUsage); - } -} - -PluginManager::PluginManager() - :xcomponentMgr(new XComponentManager) -{ -} - -PluginManager::~PluginManager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "~PluginManager"); - delete xcomponentMgr; -} - -void PluginManager::AttachXComponent(const std::string &id, - OH_NativeXComponent *nativeXComponent, OHNativeWindow *window) -{ - this->xcomponentMgr->SetNativeXComponent(id, nativeXComponent, window); -} - -void PluginManager::Export(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: start execute"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - this->xcomponentMgr->RegisterCallback(nativeXComponent); -} - -} // namespace NativeXComponentSample \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/plugin_manager.h b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/plugin_manager.h deleted file mode 100644 index 3fc5af82edc2c3c2d5ecbc477874516af1189e0d..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/plugin_manager.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include -#include - -#include "xcomponent_manager.h" -namespace NativeXComponentSample { - -class AbilityInfo { -public: - napi_ref uiAbility; - napi_ref windowStage; - napi_ref window; - napi_env env; - void Init(napi_env env, napi_value uiAbility, napi_value windowStage); - napi_value getWindow(); - ~AbilityInfo(); -}; - -class PluginManager { -public: - PluginManager(); - ~PluginManager(); - - static PluginManager *GetInstance() - { - return &PluginManager::pluginManager_; - } - - static AbilityInfo &GetAbilityInfo() - { - return m_abilityInfo; - } - - void AttachXComponent(const std::string &id, OH_NativeXComponent *nativeXComponent, OHNativeWindow *window); - void Export(napi_env env, napi_value exports); - -private: - static PluginManager pluginManager_; - static AbilityInfo m_abilityInfo; - XComponentManager *xcomponentMgr; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/xcomponent_manager.cpp b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/xcomponent_manager.cpp deleted file mode 100644 index a7a358e87ee67fd8c7868feb96fdff2043df20b0..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/xcomponent_manager.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "common/common.h" -#include "xcomponent_manager.h" -#include -#include - -#include -#include - -#include "manager/AccessibilityManager.h" -#include "plugin_manager.h" - - -void OnSurfaceCreatedCB(OH_NativeXComponent *component, void *window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB component id is %{public}s", id.c_str()); - - auto plugin = NativeXComponentSample::PluginManager::GetInstance(); - plugin->AttachXComponent(id, component, reinterpret_cast<::OHNativeWindow *>(window)); -} - -void OnSurfaceChangedCB(OH_NativeXComponent *component, void *window) -{ -} - -void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window) -{ -} - -void DispatchTouchEventCB(OH_NativeXComponent *component, void *window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - OH_NativeXComponent_TouchEvent touchEvent; -} - -void DispatchHoverEvent(::OH_NativeXComponent *xComponent, bool isHover) -{ -} - -namespace NativeXComponentSample { - -XComponentManager::XComponentManager() : accessibilityManager(new AccessibilityManager()) -{ -} - -XComponentManager::~XComponentManager() -{ - delete accessibilityManager; -} - -void XComponentManager::RegisterCallback(OH_NativeXComponent *nativeXComponent) -{ - renderCallback_.OnSurfaceCreated = ::OnSurfaceCreatedCB; - renderCallback_.OnSurfaceChanged = ::OnSurfaceChangedCB; - renderCallback_.OnSurfaceDestroyed = ::OnSurfaceDestroyedCB; - renderCallback_.DispatchTouchEvent = ::DispatchTouchEventCB; - int ret = OH_NativeXComponent_RegisterCallback(nativeXComponent, &renderCallback_); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "XComponentManager", "RegisterCallback %{public}d", ret); -} - -void XComponentManager::SetNativeXComponent(const std::string &id, OH_NativeXComponent *nativeXComponent, - OHNativeWindow *window) -{ - if (nativeXComponent == nullptr) { - return; - } - auto it = nativeXComponentMap_.find(id); - if (id.c_str() == singleInstanceId) { - accessibilityManager->Initialize(nativeXComponent); - } else { - accessibilityManager->Initialize(id, nativeXComponent); - } - if (it != nativeXComponentMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNativeXComponent", "%{public}s already exists", - id.data()); - return; - } else { - nativeXComponentMap_.emplace(id, XSurface{nativeXComponent, window}); - } -} -} // namespace NativeXComponentSample \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/xcomponent_manager.h b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/xcomponent_manager.h deleted file mode 100644 index 098712842da4ad04ee45be22aec9fc1e75809425..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/xcomponent_manager.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef NATIVE_XCOMPONENT_XCOMPONENT_MANAGER_H -#define NATIVE_XCOMPONENT_XCOMPONENT_MANAGER_H - -#include -#include -#include -#include -#include - -namespace NativeXComponentSample { - -class AccessibilityManager; -class XComponentManager { -public: - XComponentManager(); - ~XComponentManager(); - std::string singleInstanceId = "XComponentIdSingle"; - void RegisterCallback(OH_NativeXComponent *nativeXComponent); - - struct XSurface { - OH_NativeXComponent *xcomponent; - OHNativeWindow *window; - }; - -public: - - // manager xcomponent - void SetNativeXComponent(const std::string &id, OH_NativeXComponent *nativeXComponent, OHNativeWindow *window); - - XSurface GetXSurface(const std::string &id) const - { - auto it = nativeXComponentMap_.find(id); - return it != nativeXComponentMap_.end() ? it->second : XSurface{}; - } - -private: - std::unordered_map nativeXComponentMap_; - - OH_NativeXComponent_Callback renderCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; - AccessibilityManager *accessibilityManager; -}; -} // namespace NativeXComponentSample - -#endif // NATIVE_XCOMPONENT_XCOMPONENT_MANAGER_H \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 56714e7a63255e61e05c6fc31b6dac0b418b1322..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include - -#include "common/common.h" -#include "manager/plugin_manager.h" - -namespace NativeXComponentSample { -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - PluginManager::GetInstance()->Export(env, exports); - return exports; -} -EXTERN_C_END - -static napi_module nativerenderModule = { .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativerender", - .nm_priv = ((void*)0), - .reserved = { 0 } }; - -extern "C" __attribute__((constructor)) void RegisterModule(void) -{ - napi_module_register(&nativerenderModule); -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/types/libnativerender/index.d.ts b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/types/libnativerender/index.d.ts deleted file mode 100644 index f2c2739e103c666c9e8265e07d8ce904fef6c6ba..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/types/libnativerender/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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 Window from '@ohos.window'; -import { type UIAbility } from '@kit.AbilityKit'; - diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/types/libnativerender/oh-package.json5 b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/types/libnativerender/oh-package.json5 deleted file mode 100644 index 78953253ec0ed6892ab6506b202a0b52579f6621..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/types/libnativerender/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libnativerender.so", - "types": "./index.d.ts", - "version": "1.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/ets/MyStage.ets b/ArkUIKit/AccessibilityCapi/entry/src/main/ets/MyStage.ets deleted file mode 100644 index ca46f850408b31282d47a9aa6cce31f8cf2d53e0..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/ets/MyStage.ets +++ /dev/null @@ -1,17 +0,0 @@ -import AbilityStage from '@ohos.app.ability.AbilityStage'; -import Want from '@ohos.app.ability.Want'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -export default class MyStage extends AbilityStage { - onCreate(): void { - - } - onNewProcessRequest(want: Want): string { - return ''; - } - onAcceptWant(want: Want): string { - let callerPidKey = 'ohos.aafwk.param.callerPid'; - hilog.info(0x0000, 'testLaunch', 'MyStage::onAcceptWant: callerPid: ' + want.parameters![callerPidKey]); - return '0'; - } -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/AccessibilityCapi/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index c2a167e15569ba83ccdbf377346adb513d2742ca..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,48 +0,0 @@ -import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/AccessibilityCapi/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index fae19f9dd53d2857e2843539cbedf5bee4a34b5a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,16 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/ets/pages/Index.ets b/ArkUIKit/AccessibilityCapi/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index c91867ed976a639c1353ed1f85d49ae9bebba373..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,76 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; -const msg_tag = '[accessibilityCapi]'; - -@Entry(undefined) -@Component -struct Index { - @LocalStorageLink('mainWindow') private mainWindow: window.Window | undefined = undefined; - @State isMultiInstance: boolean = false; - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Button('SubWindow').onClick(()=>{ - try { - this.mainWindow?.createSubWindowWithOptions('Modal', - {title: 'SubWindow', decorEnabled: true, isModal:true}) - } catch (err) { - console.error(`${msg_tag} code: ${err.code}, message: ${err.message}`); - } - }) - Button('XComponent单实例/多实例切换').onClick(()=>{ - this.isMultiInstance = !this.isMultiInstance; - console.info(`${msg_tag}: current XComponent multiInstance is ${this.isMultiInstance}`); - }) - if (this.isMultiInstance) { - XComponent({ - id: 'xComponentId1', - type: XComponentType.SURFACE, - libraryname: 'nativerender' - }) - .onDestroy(()=>{ - console.info(`${msg_tag} Destroy Sub Window`); - }) - .id('xComponentId1') - .focusable(true) - .background(Color.Green) - .width('100%') - .height('50%') - XComponent({ - id: 'xComponentId2', - type: XComponentType.SURFACE, - libraryname: 'nativerender' - }) - .onDestroy(()=>{ - console.info(`${msg_tag} Destroy Sub Window`); - }) - .id('xComponentId2') - .focusable(true) - .background(Color.Gray) - .width('100%') - .height('50%') - } else { - XComponent({ - id: 'xComponentIdSingle', - type: XComponentType.SURFACE, - libraryname: 'nativerender' - }) - .onDestroy(()=>{ - console.info(`${msg_tag} Destroy Sub Window`); - }) - .id('xComponentIdSingle') - .focusable(true) - .background(Color.Gray) - .width('100%') - .height('50%') - } - } - } - .width('100%') - .height('100%') - .focusable(true) - .defaultFocus(true) - } -} diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/module.json5 b/ArkUIKit/AccessibilityCapi/entry/src/main/module.json5 deleted file mode 100644 index ad36904fcc243f0fd2496dbe2ca433a1622c5c18..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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", - "srcEntry": "./ets/MyStage.ets", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "phone" - ], - "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": [ - "ohos.want.action.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/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/element/color.json b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/element/float.json b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 5f0600c7083c3ac3776dcc13ce3e3f03c378fc6d..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/element/string.json b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/background.png b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 55c3f007f87b7ce5206d325f968cc56f2f79441f..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/dark/element/color.json b/ArkUIKit/AccessibilityCapi/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/mock/Libentry.mock.ets b/ArkUIKit/AccessibilityCapi/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index c2171716d040a605ef6af71e90b937a945f2677d..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,7 +0,0 @@ -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/mock/mock-config.json5 b/ArkUIKit/AccessibilityCapi/entry/src/mock/mock-config.json5 deleted file mode 100644 index 98b0ae79f0090e1fc381d54c959fb32c9f7563f4..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/AccessibilityCapi/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f67579d6e31b5f5aeea463e216b9b141048..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/AccessibilityCapi/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/ohosTest/module.json5 b/ArkUIKit/AccessibilityCapi/entry/src/ohosTest/module.json5 deleted file mode 100644 index e2edf4b819eea7f4722eee31e108418a8c188db1..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/AccessibilityCapi/entry/src/test/List.test.ets b/ArkUIKit/AccessibilityCapi/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/entry/src/test/LocalUnit.test.ets b/ArkUIKit/AccessibilityCapi/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/hvigor/hvigor-config.json5 b/ArkUIKit/AccessibilityCapi/hvigor/hvigor-config.json5 deleted file mode 100644 index 621df0ebe5a2656bdd0b783e06adca0c196d9a8c..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/ArkUIKit/AccessibilityCapi/hvigorfile.ts b/ArkUIKit/AccessibilityCapi/hvigorfile.ts deleted file mode 100644 index 47113e2e36ecefde41c136272a0bd6ff745cffe4..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/oh-package.json5 b/ArkUIKit/AccessibilityCapi/oh-package.json5 deleted file mode 100644 index 3e96da16d34f581377a54e6ee372898d9d0178e4..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/AccessibilityCapi/ohosTest.md b/ArkUIKit/AccessibilityCapi/ohosTest.md deleted file mode 100644 index 28aed20968b9da486a606f47d282f808e067330c..0000000000000000000000000000000000000000 --- a/ArkUIKit/AccessibilityCapi/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# AccessibilityCAPI 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|------------------------------|--------|----------------------------------------|----------------------------------------|:-----|------| -| 无障碍单实例场景显示正常 | 设备正常运行 | 进入首页 | 预期显示XComponent单实例/多实例切换按钮以及默认显示单实例场景 | 否 | Pass | -| 无障碍多实例场景显示正常 | 设备正常运行 | 进入首页-点击切换按钮 | 预期显示多实例场景,看到两个XComponent组件。 | 否 | Pass | \ No newline at end of file diff --git a/ArkUIKit/AccessibilityCapi/screenshots/device/AccessibilityCapiSample1.PNG b/ArkUIKit/AccessibilityCapi/screenshots/device/AccessibilityCapiSample1.PNG deleted file mode 100644 index 706e35e821ebe2322efcb0bbbb8fe1547b2c9a06..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AccessibilityCapi/screenshots/device/AccessibilityCapiSample1.PNG and /dev/null differ diff --git a/ArkUIKit/AccessibilityCapi/screenshots/device/AccessibilityCapiSample2.PNG b/ArkUIKit/AccessibilityCapi/screenshots/device/AccessibilityCapiSample2.PNG deleted file mode 100644 index 440bc6c2f424e74fb8e767b28353281e068626ed..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AccessibilityCapi/screenshots/device/AccessibilityCapiSample2.PNG and /dev/null differ diff --git a/ArkUIKit/AnimationNDK/.gitignore b/ArkUIKit/AnimationNDK/.gitignore deleted file mode 100644 index 64a92e049c70536316198207466689d6395f9b16..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -log.txt \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/AppScope/app.json5 b/ArkUIKit/AnimationNDK/AppScope/app.json5 deleted file mode 100644 index e083a34a5a89c1339e49324a6b00c21b7cdec8bd..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.sample.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/AnimationNDK/AppScope/resources/base/element/string.json b/ArkUIKit/AnimationNDK/AppScope/resources/base/element/string.json deleted file mode 100644 index 00cfc029f1ee32cca390dfcd083c6ce509eb1c0d..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AnimationNDK" - } - ] -} diff --git a/ArkUIKit/AnimationNDK/AppScope/resources/base/media/background.png b/ArkUIKit/AnimationNDK/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AnimationNDK/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/AnimationNDK/AppScope/resources/base/media/foreground.png b/ArkUIKit/AnimationNDK/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AnimationNDK/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/AnimationNDK/AppScope/resources/base/media/layered_image.json b/ArkUIKit/AnimationNDK/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/README_zh.md b/ArkUIKit/AnimationNDK/README_zh.md deleted file mode 100644 index 6582b8968e4d4c55e9a65e542070adf9987d75e2..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/README_zh.md +++ /dev/null @@ -1,81 +0,0 @@ -# UseAnimationNDK - -## 介绍 - -本示例展示了keyFrameAnimeteto、animateTo、tranisation及animator动画。该工程中展示的接口详细描述可查如下链接: - -[native_animate.h](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-animate-h.md)。 - -## 效果预览 - -| 预览 | -| -------------------------------------------- | - - -## 使用说明 -1. 安装编译生成的hap包,并打开应用; -2. 点击关键帧动画下的组件,触发关键帧动画; -3. 点击Animeteto下的组件,触发AnimateTo动画; -4. 点击transition按键,触发组件显隐动画; -5. 点击create后点击play,触发Animator动画; - - -## 工程目录 - -``` -TextAreaEventNDK -entry/src/main/ets/ -└── pages - └── Index.ets (显示动画页面) -entry/src/main/ -├── cpp -│ ├── types -│ │ └── libentry -│ │ └── Index.d.ts (对应的js映射) -│ ├── ArkUIAnimate.h (动画页面实现) -| ├── ArkUIBaseNode.h (提供组件挂载与卸载) -| ├── ArkUIButtonNode.h (button组件实现) -| ├── ArkUIColumnNode.h (column组件实现) -| ├── ArkUIListItemNode.h (listItem实现) -| ├── ArkUIListNode.h (list组件实现) -| ├── ArkUINode.h (通用属性实现) -| ├── ArkUIScrollNode.h (scroll实现) -| ├── ArkUITextNode.h (text组件实现) -| ├── NativeEntry.cpp (使动画节点挂载到页面节点) -│ └── napi_init.cpp -└── resources - ├── base - │ ├── element - │ │ ├── color.json - │ │ ├── float.json - │ │ └── string.json - │ └── media -``` - -## 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束和限制 - -1. 本示例支持标准系统上运行,支持设备:RK3568。 - -2. 本示例为Stage模型,支持API19版本full-SDK,版本号:5.1.1.208,镜像版本号:OpenHarmony_5.1.1 Release。 - -3. 本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.830, built on August 4, 2025)及以上版本才可编译运行。 - -## 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/TextAreaEventNDK > .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/ArkUIKit/AnimationNDK/build-profile.json5 b/ArkUIKit/AnimationNDK/build-profile.json5 deleted file mode 100644 index c23a5de7cb620ac6fa9515bbfd456a97c9f95753..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/code-linter.json5 b/ArkUIKit/AnimationNDK/code-linter.json5 deleted file mode 100644 index 5c4682f8164874ec7e9cb8f99ff8b3228ffbc126..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/code-linter.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/.gitignore b/ArkUIKit/AnimationNDK/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/build-profile.json5 b/ArkUIKit/AnimationNDK/entry/build-profile.json5 deleted file mode 100644 index 33e618d0df6ff9a85ea9731f510e17e13e59d3ca..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/build-profile.json5 +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a","x86_64", - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/hvigorfile.ts b/ArkUIKit/AnimationNDK/entry/hvigorfile.ts deleted file mode 100644 index f8b117a17af3b2d7cb87a7680e29e2bb8ccd5b46..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/obfuscation-rules.txt b/ArkUIKit/AnimationNDK/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/AnimationNDK/entry/oh-package-lock.json5 b/ArkUIKit/AnimationNDK/entry/oh-package-lock.json5 deleted file mode 100644 index 52f9dae4f5bae6936d7250e6c7be83c936dea09a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/oh-package-lock.json5 +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry" - }, - "packages": { - "libentry.so@src/main/cpp/types/libentry": { - "name": "libentry.so", - "version": "1.0.0", - "resolved": "src/main/cpp/types/libentry", - "registryType": "local" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/oh-package.json5 b/ArkUIKit/AnimationNDK/entry/oh-package.json5 deleted file mode 100644 index 5b21e253af246edab8b6ef4f10938f4417e8bc25..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIAnimate.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIAnimate.h deleted file mode 100644 index ae0c254dc6132477c276078398789744a5b09cd0..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIAnimate.h +++ /dev/null @@ -1,653 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIANIMATE_H -#define MYAPPLICATION_ARKUIANIMATE_H -#include "ArkUIButtonNode.h" -#include "ArkUIScrollNode.h" -#include "ArkUIColumnNode.h" -#include "ArkUITextNode.h" -#include - -namespace NativeModule { -constexpr int32_t NUM_100 = 100; -constexpr int32_t NUM_120 = 120; -constexpr int32_t NUM_150 = 150; -constexpr int32_t NUM_200 = 200; -constexpr int32_t NUM_250 = 250; -constexpr int32_t NUM_300 = 300; -constexpr int32_t NUM_400 = 400; -constexpr int32_t NUM_500 = 500; -constexpr int32_t NUM_1000 = 1000; -constexpr int32_t NUM_1500 = 1500; -constexpr int32_t NUM_2000 = 2000; -constexpr int32_t NUM_0 = 0; -constexpr int32_t NUM_1 = 1; -constexpr int32_t NUM_2 = 2; -constexpr int32_t NUM_3 = 3; -constexpr int32_t NUM_4 = 4; -constexpr int32_t NUM_5 = 5; -constexpr int32_t NUM_6 = 6; -constexpr int32_t NUM_7 = 7; -constexpr int32_t NUM_8 = 8; -constexpr int32_t NUM_9 = 9; -constexpr int32_t NUM_10 = 10; -constexpr int32_t NUM_20 = 20; -constexpr int32_t NUM_30 = 30; -constexpr int32_t NUM_40 = 40; -constexpr int32_t NUM_50 = 50; -constexpr int32_t NUM_60 = 60; -constexpr int32_t NUM_80 = 80; -std::shared_ptr g_keyframe_button = nullptr; -std::shared_ptr g_keyframe_text = nullptr; -std::shared_ptr g_animateto_button = nullptr; -std::shared_ptr g_animateto_text = nullptr; -std::shared_ptr g_transition_button = nullptr; -std::shared_ptr g_animator_button = nullptr; -std::shared_ptr g_animator_text = nullptr; -ArkUI_AnimatorHandle animatorHandle = nullptr; -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -struct KeyFrameAnimateToData { - ArkUI_KeyframeAnimateOption* option; - ArkUI_CurveHandle curve; -}; - -struct AnimateData { - ArkUI_AnimateOption* option; - ArkUI_CurveHandle curve; -}; - -struct TransitionData { - ArkUI_AnimateOption* option; - ArkUI_TransitionEffect* effect; -}; - -std::shared_ptr CreateKeyFrameAnimeteto() -{ - auto column = std::make_shared(); - column->SetWidth(NUM_300); - column->SetHeight(NUM_250); - // 创建文本节点,内容区介绍“这是关键帧动画” - auto textNode = std::make_shared(); - textNode->SetTextContent("这是关键帧动画"); - textNode->SetWidth(NUM_120); - textNode->SetHeight(NUM_50); - // 创建button,后续创建的关键帧动画作用在button组件上 - auto button = std::make_shared(); - // 设置button初始宽高 - button->SetWidth(NUM_100); - button->SetHeight(NUM_100); - // 存储button全局变量,在onTouch注册时需要使用 - g_keyframe_button = button; - // 注册点击事件到button上 - button->RegisterNodeEvent(button->GetHandle(), NODE_ON_CLICK, NUM_1, nullptr); - g_keyframe_text = std::make_shared(); - g_keyframe_text->KeyframeAnimatetoToString(); - auto onTouch = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_1) { - // 获取context对象 - ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_keyframe_button->GetHandle()); - - // 获取ArkUI_NativeAnimateAPI接口 - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - - // 以下代码为创建关键帧动画的关键流程,包括设置关键帧动画参数、开启关键帧动画 - // 设置ArkUI_KeyframeAnimateOption参数,通过提供的C方法设置对应的参数 - ArkUI_KeyframeAnimateOption *option = OH_ArkUI_KeyframeAnimateOption_Create(NUM_2); // 关键帧动画状态数 - OH_ArkUI_KeyframeAnimateOption_SetDelay(option, NUM_500); - OH_ArkUI_KeyframeAnimateOption_SetDuration(option, NUM_1000, NUM_0); // 第一段关键帧动画的持续时间 - OH_ArkUI_KeyframeAnimateOption_SetDuration(option, NUM_2000, NUM_1); // 第二段关键帧动画的持续时间 - OH_ArkUI_KeyframeAnimateOption_SetIterations(option, NUM_5); // 关键帧动画播放次数 - ArkUI_CurveHandle curve = OH_ArkUI_Curve_CreateCubicBezierCurve(0.5f, 4.0f, 1.2f, 0.0f); - // 以下四种曲线根据自己得业务需要选择 - ArkUI_CurveHandle springCurve = OH_ArkUI_Curve_CreateSpringCurve(0.5f, 4.0f, 1.2f, 0.0f); - ArkUI_CurveHandle springMotionCurve = OH_ArkUI_Curve_CreateSpringMotion(0.5f, 0.6f, 0.0f); - ArkUI_CurveHandle responsiveSpringMotionCurve = OH_ArkUI_Curve_CreateResponsiveSpringMotion(0.5f, - 4.0f, 1.2f); - ArkUI_CurveHandle interpolatingSpringCurve = OH_ArkUI_Curve_CreateInterpolatingSpring(0.5f, - 4.0f, 1.2f, 0.0f); - OH_ArkUI_KeyframeAnimateOption_SetCurve(option, curve, 1); - OH_ArkUI_KeyframeAnimateOption_RegisterOnEventCallback(option, nullptr, [](void *userData) { - g_keyframe_button->SetWidth(NUM_150); - }, NUM_0); // 第一段关键帧时刻状态的闭包函数 - OH_ArkUI_KeyframeAnimateOption_RegisterOnEventCallback(option, nullptr, [](void *userData) { - g_keyframe_button->SetWidth(80); - }, NUM_1); // 第二段关键帧时刻状态的闭包函数 - KeyFrameAnimateToData* data = new KeyFrameAnimateToData(); - data->option = option; - data->curve = curve; - OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback(option, nullptr, [](void *user) { - KeyFrameAnimateToData* data = reinterpret_cast(user); - if (data) { - ArkUI_KeyframeAnimateOption* option = data->option; - ArkUI_CurveHandle curve = data->curve; - if (option) { - OH_ArkUI_KeyframeAnimateOption_Dispose(option); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_KeyframeAnimateOption_Dispose success!"); - } - if (curve) { - OH_ArkUI_Curve_DisposeCurve(curve); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_Curve_DisposeCurve success!"); - } - delete data; // 释放结构体 - } - }); // 关键帧动画结束回调 - ArkUI_ExpectedFrameRateRange *range = new ArkUI_ExpectedFrameRateRange; - range->max = NUM_120; - range->expected = NUM_60; - range->min = NUM_30; - OH_ArkUI_KeyframeAnimateOption_SetExpectedFrameRate(option, range); // 关键帧设置期望帧率 - - // 执行对应的动画 - animateApi->keyframeAnimateTo(context, option); - auto delay = OH_ArkUI_KeyframeAnimateOption_GetDelay(option); - auto iter = OH_ArkUI_KeyframeAnimateOption_GetIterations(option); - auto expected = OH_ArkUI_KeyframeAnimateOption_GetExpectedFrameRate(option); // 获取关键帧动画参数的期望帧率 - auto dur0 = OH_ArkUI_KeyframeAnimateOption_GetDuration(option, NUM_1); - auto dur1 = OH_ArkUI_KeyframeAnimateOption_GetDuration(option, NUM_1); - auto curves = OH_ArkUI_KeyframeAnimateOption_GetCurve(option, NUM_1); //获取关键帧动画某段状态动画曲线 - g_keyframe_text->KeyframeAnimatetoToString(dur0, dur1, delay, iter, *expected); - } - }; - // 注册点击事件的回调函数 - button->RegisterNodeEventReceiver(onTouch); - // 将button挂载在column上,返回column节点 - column->AddChild(g_keyframe_text); - column->AddChild(textNode); - column->AddChild(button); - return column; -} - -std::shared_ptr CreateAnimeteto() -{ - auto column = std::make_shared(); - column->SetWidth(NUM_300); - column->SetHeight(NUM_250); - // 创建文本节点,内容区介绍“这是animateto动画” - auto textNode = std::make_shared(); - textNode->SetTextContent("这是animateto动画"); - textNode->SetWidth(NUM_150); - textNode->SetHeight(NUM_50); - // 创建button,后续创建的动画作用在button组件上 - auto button = std::make_shared(); - // 设置button初始宽高及颜色 - button->SetWidth(NUM_100); - button->SetHeight(NUM_100); - button->SetBackgroundColor(0xFFA280FF); - // 存储button全局变量,在onTouch注册时需要使用 - g_animateto_button = button; - // 注册点击事件到button上 - button->RegisterNodeEvent(button->GetHandle(), NODE_ON_CLICK, NUM_2, nullptr); - g_animateto_text = std::make_shared(); - g_animateto_text->AnimatetoToString(); - auto onTouch = [](ArkUI_NodeEvent *event) { - // 获取context对象 - static ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_animateto_button->GetHandle()); - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_2) { - // 获取ArkUI_NativeAnimateAPI接口 - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - - // 设置动画参数 - ArkUI_AnimateOption *option = OH_ArkUI_AnimateOption_Create(); - OH_ArkUI_AnimateOption_SetDuration(option, NUM_2000); - OH_ArkUI_AnimateOption_SetTempo(option, 1.1); - OH_ArkUI_AnimateOption_SetCurve(option, ARKUI_CURVE_EASE); - ArkUI_CurveHandle cubicBezierCurve = OH_ArkUI_Curve_CreateCubicBezierCurve(0.5f, 4.0f, 1.2f, 0.0f); - // 设置动画的动画曲线,优先于OH_ArkUI_AnimateOption_SetCurve生效 - OH_ArkUI_AnimateOption_SetICurve(option, cubicBezierCurve); - OH_ArkUI_AnimateOption_SetDelay(option, NUM_20); - OH_ArkUI_AnimateOption_SetIterations(option, NUM_1); - OH_ArkUI_AnimateOption_SetPlayMode(option, ARKUI_ANIMATION_PLAY_MODE_REVERSE); - ArkUI_ExpectedFrameRateRange *range = new ArkUI_ExpectedFrameRateRange; - range->min = NUM_10; - range->max = NUM_120; - range->expected = NUM_60; - OH_ArkUI_AnimateOption_SetExpectedFrameRateRange(option, range); - - // 设置完成的回调 - ArkUI_AnimateCompleteCallback *completeCallback = new ArkUI_AnimateCompleteCallback; - completeCallback->type = ARKUI_FINISH_CALLBACK_REMOVED; - AnimateData* data = new AnimateData(); - data->option = option; - data->curve = cubicBezierCurve; - completeCallback->userData = reinterpret_cast(data); - completeCallback->callback = [](void *userData) { - AnimateData* data = reinterpret_cast(userData); - if (data) { - ArkUI_AnimateOption* option = data->option; - ArkUI_CurveHandle curve = data->curve; - if (option) { - OH_ArkUI_AnimateOption_Dispose(option); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_AnimateOption_Dispose success!"); - } - if (curve) { - OH_ArkUI_Curve_DisposeCurve(curve); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_Curve_DisposeCurve success!"); - } - delete data; // 释放结构体 - } - }; - - // 设置闭包函数 - static bool isback = true; - ArkUI_ContextCallback *update = new ArkUI_ContextCallback; - update->callback = [](void *user) { - // 对应的属性变化 width height - if (isback) { - g_animateto_button->SetWidth(NUM_200); - g_animateto_button->SetHeight(NUM_80); - g_animateto_button->SetBackgroundColor(0xFFA280FF); - } else { - g_animateto_button->SetWidth(NUM_100); - g_animateto_button->SetHeight(NUM_40); - g_animateto_button->SetBackgroundColor(0xFFFF2E77); - } - isback = !isback; - }; - // 执行对应的动画 - animateApi->animateTo(context, option, update, completeCallback); - - auto duration = OH_ArkUI_AnimateOption_GetDuration(option); - auto tempo = OH_ArkUI_AnimateOption_GetTempo(option); - auto curve = OH_ArkUI_AnimateOption_GetCurve(option); - auto delay = OH_ArkUI_AnimateOption_GetDelay(option); - auto iteration = OH_ArkUI_AnimateOption_GetIterations(option); - auto playmode = OH_ArkUI_AnimateOption_GetPlayMode(option); - auto expectedFrameRateRange = OH_ArkUI_AnimateOption_GetExpectedFrameRateRange(option); - auto iCurve = OH_ArkUI_AnimateOption_GetICurve(option); // 获取动画的动画曲线 - g_animateto_text->AnimatetoToString(duration, tempo, curve, delay, iteration, playmode, - *expectedFrameRateRange); - } - }; - button->RegisterNodeEventReceiver(onTouch); - column->AddChild(g_animateto_text); - column->AddChild(textNode); - column->AddChild(button); - return column; -} - -std::shared_ptr CreateTransitionEffect() -{ - auto column = std::make_shared(); - column->SetWidth(NUM_300); - column->SetHeight(NUM_250); - // 创建文本节点,内容区介绍“这是TransitionEffect” - auto textNode = std::make_shared(); - textNode->SetTextContent("这是TransitionEffect"); - textNode->SetWidth(NUM_150); - textNode->SetHeight(NUM_50); - // 创建transitionButton,后续创建的动画作用在transitionButton组件上 - auto transitionButton = std::make_shared(); - // 设置button初始宽高及颜色 - transitionButton->SetWidth(NUM_100); - transitionButton->SetHeight(NUM_100); - transitionButton->SetBackgroundColor(0xFFA280FF); - // 存储button全局变量 - g_transition_button = transitionButton; - g_transition_button->SetVisibility(ARKUI_VISIBILITY_VISIBLE); - // 创建button,后续动画逻辑在button的点击事件中实现 - auto button = std::make_shared(); - button->SetButtonLabel("transition"); - // 创建buttonColumn容器,用于调整button的布局效果 - auto buttonColumn = std::make_shared(); - buttonColumn->SetWidth(NUM_300); - buttonColumn->SetPadding(NUM_10, false); // 设置布局格式,调整组件内间距 - // 注册点击事件到button上 - button->RegisterNodeEvent(button->GetHandle(), NODE_ON_CLICK, NUM_10, nullptr); - auto onTouch = [](ArkUI_NodeEvent *event) { - // 获取context对象 - static ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_transition_button->GetHandle()); - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_10) { - // 获取ArkUI_NativeAnimateAPI接口 - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - - // 设置动画参数 - ArkUI_AnimateOption *option = OH_ArkUI_AnimateOption_Create(); - OH_ArkUI_AnimateOption_SetDuration(option, NUM_2000); - OH_ArkUI_AnimateOption_SetCurve(option, ARKUI_CURVE_EASE); - // 根据业务所需调整OH_ArkUI_TransitionEffect_SetAnimation的第一个入参 - // 创建组件转场时的透明度效果对象 - auto opacityTransitionEffect = OH_ArkUI_CreateOpacityTransitionEffect(0.7); - // 创建组件转场时的平移效果对象 - ArkUI_TranslationOptions* translate = new ArkUI_TranslationOptions; - translate->x = NUM_10; - translate->y = NUM_0; - translate->z = NUM_0; - auto translationTransitionEffect = OH_ArkUI_CreateTranslationTransitionEffect(translate); - // 创建组件转场时的缩放效果对象 - ArkUI_ScaleOptions* scale = new ArkUI_ScaleOptions; - scale->x = 1.5; - scale->y = 0.0; - scale->z = 0.0; - scale->centerX = 0.0; - scale->centerY = 0.0; - auto scaleTransitionEffect = OH_ArkUI_CreateScaleTransitionEffect(scale); - // 创建组件转场时的旋转效果对象 - ArkUI_RotationOptions* rotate = new ArkUI_RotationOptions; - rotate->x = 10.0; - rotate->y = 0.0; - rotate->z = 0.0; - rotate->centerX = 0.0; - rotate->centerY = 0.1; - rotate->angle = 30.0; - rotate->centerZ = 0.1; - rotate->perspective = NUM_0; - auto rotationTransition = OH_ArkUI_CreateRotationTransitionEffect(rotate); - // 创建组件平移效果对象 - auto movementTransition = OH_ArkUI_CreateMovementTransitionEffect(ARKUI_TRANSITION_EDGE_TOP); - // 创建非对称的转场效果对象 - auto asymmetricTransition = OH_ArkUI_CreateAsymmetricTransitionEffect( - rotationTransition, movementTransition); - // 设置转场效果动画参数,此动画设置的是透明度效果 - OH_ArkUI_TransitionEffect_SetAnimation(opacityTransitionEffect, option); - // 设置转场效果链式组合,以形成包含多种转场效果的TransitionEffect - OH_ArkUI_TransitionEffect_Combine(translationTransitionEffect, scaleTransitionEffect); - - // 设置完成的回调 - ArkUI_AnimateCompleteCallback *completeCallback = new ArkUI_AnimateCompleteCallback; - completeCallback->type = ARKUI_FINISH_CALLBACK_REMOVED; - TransitionData* data = new TransitionData(); - data->option = option; - data->effect = opacityTransitionEffect; - completeCallback->userData = reinterpret_cast(data); - completeCallback->callback = [](void *userData) { - TransitionData* data = reinterpret_cast(userData); - if (data) { - ArkUI_AnimateOption* option = data->option; - ArkUI_TransitionEffect* effect = data->effect; - if (option) { - OH_ArkUI_AnimateOption_Dispose(option); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_AnimateOption_Dispose success!"); - } - if (effect) { - OH_ArkUI_TransitionEffect_Dispose(effect); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_TransitionEffect_Dispose success!"); - } - delete data; // 释放结构体 - } - }; - - // 设置闭包函数 - static bool transitionIsBack = false; - ArkUI_ContextCallback *update = new ArkUI_ContextCallback; - update->callback = [](void *user) { - // 通过transitionIsBack变量使组件做显隐变化 - if (transitionIsBack) { - g_transition_button->SetVisibility(ARKUI_VISIBILITY_VISIBLE); - } else { - g_transition_button->SetVisibility(ARKUI_VISIBILITY_HIDDEN); - } - transitionIsBack = !transitionIsBack; - }; - // 执行对应的动画 - animateApi->animateTo(context, option, update, completeCallback); - } - }; - button->RegisterNodeEventReceiver(onTouch); - column->AddChild(textNode); - column->AddChild(transitionButton); - buttonColumn->AddChild(button); - column->AddChild(buttonColumn); - return column; -} - -std::shared_ptr CreateAnimator() -{ - auto column = std::make_shared(); - column->SetWidth(NUM_300); - column->SetHeight(NUM_250); - // 创建文本节点,内容区介绍“这是animator动画” - auto textNode = std::make_shared(); - textNode->SetTextContent("这是animator动画"); - textNode->SetWidth(NUM_120); - textNode->SetHeight(NUM_50); - // 创建createButton,用于初始化animator参数 - auto createButton = std::make_shared(); - // 创建button,后续创建的animator动画作用在button组件上 - auto button = std::make_shared(); - // 设置button初始宽高 - button->SetWidth(NUM_100); - button->SetHeight(NUM_100); - // 存储button全局变量,在onTouch注册时需要使用 - g_animator_button = button; - // 注册点击事件到button上 - createButton->RegisterNodeEvent(createButton->GetHandle(), NODE_ON_CLICK, NUM_3, nullptr); - g_animator_text = std::make_shared(); - g_animator_text->AnimatorToString(); - auto onTouch = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_3) { - // 获取context对象 - static ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_animator_button->GetHandle()); - - // 获取ArkUI_NativeAnimateAPI接口 - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - - // 以下代码为创建Animator动画的关键流程,包括设置Animator动画参数、开启Animator动画 - // 设置ArkUI_AnimatorOption参数,通过提供的C方法设置对应的参数 - static ArkUI_AnimatorOption *option = OH_ArkUI_AnimatorOption_Create(NUM_0); // Animator动画状态数 - OH_ArkUI_AnimatorOption_SetDuration(option, NUM_2000); - OH_ArkUI_AnimatorOption_SetDelay(option, NUM_10); - OH_ArkUI_AnimatorOption_SetIterations(option, NUM_3); - OH_ArkUI_AnimatorOption_SetFill(option, ARKUI_ANIMATION_FILL_MODE_NONE); - OH_ArkUI_AnimatorOption_SetDirection(option, ARKUI_ANIMATION_DIRECTION_NORMAL); - ArkUI_CurveHandle curve = OH_ArkUI_Curve_CreateCubicBezierCurve(0.5f, 4.0f, 1.2f, 0.0f); // 构造三阶贝塞尔曲线对象 - OH_ArkUI_AnimatorOption_SetCurve(option, curve); - OH_ArkUI_AnimatorOption_SetBegin(option, NUM_100); - OH_ArkUI_AnimatorOption_SetEnd(option, NUM_150); - ArkUI_ExpectedFrameRateRange *range = new ArkUI_ExpectedFrameRateRange; - range->max = NUM_120; - range->expected = NUM_60; - range->min = NUM_30; - OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange(option, range); - OH_ArkUI_AnimatorOption_SetKeyframe(option, 0.5, 120.5, NUM_0); // 设置animator动画关键帧参数 - OH_ArkUI_AnimatorOption_SetKeyframeCurve(option, curve, NUM_0); // 设置animator动画关键帧曲线类型 - OH_ArkUI_AnimatorOption_RegisterOnFrameCallback(option, nullptr, [](ArkUI_AnimatorOnFrameEvent *event) - { - OH_ArkUI_AnimatorOnFrameEvent_GetUserData(event); // 获取动画事件对象中的用户自定义对象 - auto value = OH_ArkUI_AnimatorOnFrameEvent_GetValue(event); // 获取动画事件对象中的当前进度 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", - "CXX OH_ArkUI_AnimatorOption_RegisterOnFrameCallback %{public}f", value); - g_animator_button->SetWidth(value); - }); - OH_ArkUI_AnimatorOption_RegisterOnFinishCallback(option, nullptr, [](ArkUI_AnimatorEvent* event) - { - OH_ArkUI_AnimatorEvent_GetUserData(event); // 获取动画事件对象中的用户自定义对象 - }); - OH_ArkUI_AnimatorOption_RegisterOnCancelCallback(option, nullptr, [](ArkUI_AnimatorEvent* event) - { - }); - OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback(option, nullptr, [](ArkUI_AnimatorEvent* event) - { - }); - // 执行对应的动画 - animatorHandle = animateApi->createAnimator(context, option); - - auto duration = OH_ArkUI_AnimatorOption_GetDuration(option); - auto delay = OH_ArkUI_AnimatorOption_GetDelay(option); - auto iterations = OH_ArkUI_AnimatorOption_GetIterations(option); - auto fill = OH_ArkUI_AnimatorOption_GetFill(option); - auto direction = OH_ArkUI_AnimatorOption_GetDirection(option); - auto curves = OH_ArkUI_AnimatorOption_GetCurve(option); // 获取animator动画插值曲线 - auto begin = OH_ArkUI_AnimatorOption_GetBegin(option); - auto end = OH_ArkUI_AnimatorOption_GetEnd(option); // 获取animator动画插值终点 - auto expected = OH_ArkUI_AnimatorOption_GetExpectedFrameRateRange(option); // 获取关键帧动画参数的期望帧率 - auto keyframeTime = OH_ArkUI_AnimatorOption_GetKeyframeTime(option, NUM_0); // 获取animator动画关键帧时间 - auto keyframeValue = OH_ArkUI_AnimatorOption_GetKeyframeValue(option, NUM_0); // 获取animator动画关键帧数值 - auto keyframeCurve = OH_ArkUI_AnimatorOption_GetKeyframeCurve(option, NUM_0); // 获取animator动画关键帧动画插值曲线 - g_animator_text->AnimatorToString(duration, delay, iterations, fill, direction, begin, - end, *expected, keyframeTime, keyframeValue); - } - }; - - // 注册点击事件的回调函数 - createButton->RegisterNodeEventReceiver(onTouch); - createButton->SetButtonLabel("create"); - // 创建容器,用于存放button按键 - auto buttoColumn = std::make_shared(); - buttoColumn->SetPadding(NUM_30, false); // 设置布局格式,调整组件内间距 - buttoColumn->SetWidth(NUM_300); - // 创建容器,用于存放playButton按键 - auto playButtonColumn = std::make_shared(); - playButtonColumn->SetPadding(NUM_10, false); // 设置布局格式,调整组件内间距 - playButtonColumn->SetWidth(NUM_300); - // 设置animator播放按钮 - auto playButton = std::make_shared(); - playButton->SetButtonLabel("play"); - playButton->RegisterNodeEvent(playButton->GetHandle(), NODE_ON_CLICK, NUM_4, nullptr); - auto onTouchPlay = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_4) { - OH_ArkUI_Animator_Play(animatorHandle); - } - }; - playButton->RegisterNodeEventReceiver(onTouchPlay); - // 设置animator结束按钮 - auto finishButton = std::make_shared(); - finishButton->SetButtonLabel("finish"); - finishButton->RegisterNodeEvent(finishButton->GetHandle(), NODE_ON_CLICK, NUM_5, nullptr); - auto onTouchFinish = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_5) { - OH_ArkUI_Animator_Finish(animatorHandle); - } - }; - finishButton->RegisterNodeEventReceiver(onTouchFinish); - // 创建容器,用于存放resetButton按键 - auto resetButtonColumn = std::make_shared(); - resetButtonColumn->SetPadding(NUM_10, false); // 设置布局格式,调整组件内间距 - resetButtonColumn->SetWidth(NUM_300); - // 设置animator更新按钮 - auto resetButton = std::make_shared(); - resetButton->SetButtonLabel("reset"); - resetButton->RegisterNodeEvent(resetButton->GetHandle(), NODE_ON_CLICK, NUM_6, nullptr); - auto onTouchReset = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_6) { - static ArkUI_AnimatorOption *option = OH_ArkUI_AnimatorOption_Create(NUM_0); // Animator动画状态数 - OH_ArkUI_AnimatorOption_SetDuration(option, NUM_1000); - OH_ArkUI_AnimatorOption_SetDelay(option, NUM_0); - OH_ArkUI_AnimatorOption_SetIterations(option, NUM_4); - // 根据自己得需要选择下述两种曲线适合得去设置OH_ArkUI_AnimatorOption_SetCurve - auto curve = OH_ArkUI_Curve_CreateCurveByType(ARKUI_CURVE_EASE); // 动画以低速开始,然后加快,在结束前变慢 - auto stepsCurve = OH_ArkUI_Curve_CreateStepsCurve(NUM_20, true); // 构造阶梯曲线对象 - OH_ArkUI_AnimatorOption_SetCurve(option, curve); - OH_ArkUI_AnimatorOption_SetBegin(option, NUM_200); - OH_ArkUI_AnimatorOption_SetEnd(option, NUM_100); - OH_ArkUI_AnimatorOption_RegisterOnFrameCallback(option, nullptr, [](ArkUI_AnimatorOnFrameEvent *event) - { - OH_ArkUI_AnimatorOnFrameEvent_GetUserData(event); // 获取动画事件对象中的用户自定义对象 - auto value = OH_ArkUI_AnimatorOnFrameEvent_GetValue(event); // 获取动画事件对象中的当前进度 - g_animator_button->SetWidth(value); - }); - OH_ArkUI_Animator_ResetAnimatorOption(animatorHandle, option); - } - }; - resetButton->RegisterNodeEventReceiver(onTouchReset); - // 设置animator暂停按钮 - auto pauseButton = std::make_shared(); - pauseButton->SetButtonLabel("pause"); - pauseButton->RegisterNodeEvent(pauseButton->GetHandle(), NODE_ON_CLICK, NUM_7, nullptr); - auto onTouchPause = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_7) { - OH_ArkUI_Animator_Pause(animatorHandle); - } - }; - pauseButton->RegisterNodeEventReceiver(onTouchPause); - // 创建容器,用于存放cancelButton按键 - auto cancelButtonColumn = std::make_shared(); - cancelButtonColumn->SetPadding(NUM_10, false); // 设置布局格式,调整组件内间距 - cancelButtonColumn->SetWidth(NUM_300); - // 设置animator取消按钮 - auto cancelButton = std::make_shared(); - cancelButton->SetButtonLabel("cancel"); - cancelButton->RegisterNodeEvent(cancelButton->GetHandle(), NODE_ON_CLICK, NUM_8, nullptr); - auto onTouchCancel = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_8) { - OH_ArkUI_Animator_Cancel(animatorHandle); - } - }; - cancelButton->RegisterNodeEventReceiver(onTouchCancel); - // 设置animator以相反的顺序播放按钮 - auto reverseButton = std::make_shared(); - reverseButton->SetButtonLabel("reverse"); - reverseButton->RegisterNodeEvent(reverseButton->GetHandle(), NODE_ON_CLICK, NUM_9, nullptr); - auto onTouchReverse = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_9) { - OH_ArkUI_Animator_Reverse(animatorHandle); - } - }; - reverseButton->RegisterNodeEventReceiver(onTouchReverse); - // 将button挂载在column上,返回column节点 - column->AddChild(g_animator_text); - column->AddChild(textNode); - column->AddChild(button); - buttoColumn->AddChild(createButton); - playButtonColumn->AddChild(playButton); - buttoColumn->AddChild(playButtonColumn); - buttoColumn->AddChild(finishButton); - resetButtonColumn->AddChild(resetButton); - buttoColumn->AddChild(resetButtonColumn); - buttoColumn->AddChild(pauseButton); - cancelButtonColumn->AddChild(cancelButton); - buttoColumn->AddChild(cancelButtonColumn); - buttoColumn->AddChild(reverseButton); - column->AddChild(buttoColumn); - return column; -} - -std::shared_ptr CreateAnimateRootNode() -{ - auto scroll = std::make_shared(); - auto column = std::make_shared(); - column->SetPadding(NUM_30, false); // 设置布局格式,调整组件内间距 - column->SetHeight(NUM_1500); - scroll->SetWidth(NUM_400); - scroll->SetBackgroundColor(0xFFEDF3FF); - auto keyFrameNode = CreateKeyFrameAnimeteto(); - auto animeteToNode = CreateAnimeteto(); - auto transitionEffectNode = CreateTransitionEffect(); - auto animatorNode = CreateAnimator(); - column->AddChild(keyFrameNode); - column->AddChild(animeteToNode); - column->AddChild(transitionEffectNode); - column->AddChild(animatorNode); - scroll->AddChild(column); - return scroll; -} -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUIANIMATE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIBaseNode.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIBaseNode.h deleted file mode 100644 index 79368e025f12ef2ee690b173f4805574c476ef95..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIBaseNode.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIBASENODE_H -#define MYAPPLICATION_ARKUIBASENODE_H - -#include -#include -#include - -#include "NativeModule.h" - -namespace NativeModule { - -class ArkUIBaseNode { -public: - explicit ArkUIBaseNode(ArkUI_NodeHandle handle) - : handle_(handle), nativeModule_(NativeModuleInstance::GetInstance()->GetNativeNodeAPI()) {} - - virtual ~ArkUIBaseNode() - { - // 封装析构函数,实现子节点移除功能。 - if (!children_.empty()) { - for (const auto& child : children_) { - nativeModule_->removeChild(handle_, child->GetHandle()); - } - children_.clear(); - } - // 封装析构函数,统一回收节点资源。 - nativeModule_->disposeNode(handle_); - } - - void AddChild(const std::shared_ptr &child) - { - children_.emplace_back(child); - OnAddChild(child); - } - - void RemoveChild(const std::shared_ptr &child) - { - children_.remove(child); - OnRemoveChild(child); - } - - void InsertChild(const std::shared_ptr &child, int32_t index) - { - if (index >= children_.size()) { - AddChild(child); - } else { - auto iter = children_.begin(); - std::advance(iter, index); - children_.insert(iter, child); - OnInsertChild(child, index); - } - } - - ArkUI_NodeHandle GetHandle() const - { - return handle_; - } - ArkUI_NativeNodeAPI_1* GetNativeModule() const - { - return nativeModule_; - } - -protected: - // 针对父容器子类需要重载下面的函数,实现组件挂载和卸载。 - virtual void OnAddChild(const std::shared_ptr &child) {} - virtual void OnRemoveChild(const std::shared_ptr &child) {} - virtual void OnInsertChild(const std::shared_ptr &child, int32_t index) {} - - ArkUI_NodeHandle handle_; - ArkUI_NativeNodeAPI_1 *nativeModule_ = nullptr; - -private: - std::list> children_; -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUIBASENODE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIButtonNode.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIButtonNode.h deleted file mode 100644 index 69514851b07d18d4bcd163a589e422a19a4126e4..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIButtonNode.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIBUTTONNODE_H -#define MYAPPLICATION_ARKUIBUTTONNODE_H - -#include "ArkUINode.h" - -#include - -namespace NativeModule { -class ArkUIButtonNode : public ArkUINode { -public: - // 创建ArkUI的button组件。 - ArkUIButtonNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_BUTTON)) {} - - ~ArkUIButtonNode() override {} - void SetContentWithAnimete() - {} - - void SetButtonLabel(const std::string &content) - { - ArkUI_AttributeItem item = {nullptr, 0, content.c_str()}; - nativeModule_->setAttribute(handle_, NODE_BUTTON_LABEL, &item); - } -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUIBUTTONNODE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIColumnNode.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIColumnNode.h deleted file mode 100644 index f3ff7d42b083a9fc45dccc45ca46c23d5481e5df..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIColumnNode.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUICOLUMNNODE_H -#define MYAPPLICATION_ARKUICOLUMNNODE_H - -#include "ArkUINode.h" -namespace NativeModule { -class ArkUIColumnNode : public ArkUINode { -public: - // 创建ArkUI的列表组件 - ArkUIColumnNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_COLUMN)) {} - - ~ArkUIColumnNode() override {} -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUICOLUMNNODE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIListItemNode.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIListItemNode.h deleted file mode 100644 index e322abed6fa372393e946060348bd9b8f7b8dd11..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIListItemNode.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUISTACKNODE_H -#define MYAPPLICATION_ARKUISTACKNODE_H - -#include "ArkUINode.h" - -namespace NativeModule { -class ArkUIListItemNode : public ArkUINode { -public: - ArkUIListItemNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_LIST_ITEM)) {} -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUISTACKNODE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIListNode.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIListNode.h deleted file mode 100644 index db5c3a9f2bf5d84c79aefe48256fa7c6dea7ed28..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIListNode.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUILISTNODE_H -#define MYAPPLICATION_ARKUILISTNODE_H - -#include "ArkUINode.h" - -namespace NativeModule { -class ArkUIListNode : public ArkUINode { -public: - // 创建ArkUI的列表组件 - ArkUIListNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_LIST)) {} - - ~ArkUIListNode() override {} - // List组件的属性接口封装 - void SetScrollBarState(bool isShow) - { - ArkUI_ScrollBarDisplayMode displayMode = - isShow ? ARKUI_SCROLL_BAR_DISPLAY_MODE_ON : ARKUI_SCROLL_BAR_DISPLAY_MODE_OFF; - ArkUI_NumberValue value[] = {{.i32 = displayMode}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_SCROLL_BAR_DISPLAY_MODE, &item); - } -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUILISTNODE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUINode.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUINode.h deleted file mode 100644 index ec7884067ec545078bfc0f07bd212bb6126f48d6..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUINode.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUINODE_H -#define MYAPPLICATION_ARKUINODE_H - -#include "ArkUIBaseNode.h" -#include "NativeModule.h" -#include -#include -#include - -namespace NativeModule { - -class ArkUINode : public ArkUIBaseNode { -public: - explicit ArkUINode(ArkUI_NodeHandle handle) : ArkUIBaseNode(handle) {} - - ~ArkUINode() override {} - - // 通用属性调用封装 - void SetWidth(float width) - { - ArkUI_NumberValue value[] = {{.f32 = width}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_WIDTH, &item); - } - void SetPercentWidth(float percent) - { - ArkUI_NumberValue value[] = {{.f32 = percent}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_WIDTH_PERCENT, &item); - } - void SetHeight(float height) - { - ArkUI_NumberValue value[] = {{.f32 = height}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_HEIGHT, &item); - } - void SetPercentHeight(float percent) - { - ArkUI_NumberValue value[] = {{.f32 = percent}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_HEIGHT_PERCENT, &item); - } - void SetBackgroundColor(uint32_t color) - { - ArkUI_NumberValue value[] = {{.u32 = color}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_BACKGROUND_COLOR, &item); - } - void SetPadding(float padding, bool isPercent = false) - { - ArkUI_NumberValue value[] = {{.f32 = padding}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, isPercent ? NODE_PADDING_PERCENT : NODE_PADDING, &item); - } - void SetVisibility(int visibility) - { - ArkUI_NumberValue value[] = {{.i32 = visibility}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_VISIBILITY, &item); - } - - void RegisterNodeEvent(ArkUI_NodeHandle node, - ArkUI_NodeEventType eventType, int32_t targetId, void* userData) - { - nativeModule_->registerNodeEvent(node, eventType, targetId, userData); - } - - void RegisterNodeEventReceiver(void (*eventReceiver)(ArkUI_NodeEvent* event)) - { - nativeModule_->addNodeEventReceiver(handle_, eventReceiver); - } - -protected: - // 组件树操作的实现类对接。 - void OnAddChild(const std::shared_ptr &child) override - { - nativeModule_->addChild(handle_, child->GetHandle()); - } - void OnRemoveChild(const std::shared_ptr &child) override - { - nativeModule_->removeChild(handle_, child->GetHandle()); - } - void OnInsertChild(const std::shared_ptr &child, int32_t index) override - { - nativeModule_->insertChildAt(handle_, child->GetHandle(), index); - } -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUINODE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIScrollNode.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIScrollNode.h deleted file mode 100644 index 0be3c630838ef956855a1c08288bdc2a492a4c0a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIScrollNode.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUISCROLLNODE_H -#define MYAPPLICATION_ARKUISCROLLNODE_H - -#include "ArkUINode.h" - -namespace NativeModule { -class ArkUIScrollNode : public ArkUINode { -public: - ArkUIScrollNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_SCROLL)) {} - - ~ArkUIScrollNode() override {} -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUISCROLLNODE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUITextNode.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUITextNode.h deleted file mode 100644 index acf58b8d852b0a033498f924111bf376f166e76f..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUITextNode.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUITEXTNODE_H -#define MYAPPLICATION_ARKUITEXTNODE_H - -#include "ArkUINode.h" - -#include - -namespace NativeModule { -class ArkUITextNode : public ArkUINode { -public: - ArkUITextNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_TEXT)) {} - // 文本属性接口封装。 - void SetFontSize(float fontSize) - { - ArkUI_NumberValue value[] = {{.f32 = fontSize}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_FONT_SIZE, &item); - } - void SetFontColor(uint32_t color) - { - ArkUI_NumberValue value[] = {{.u32 = color}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_FONT_COLOR, &item); - } - void SetTextContent(const std::string &content) - { - ArkUI_AttributeItem item = {nullptr, 0, content.c_str()}; - nativeModule_->setAttribute(handle_, NODE_TEXT_CONTENT, &item); - } - void SetTextAlign(ArkUI_TextAlignment align) - { - ArkUI_NumberValue value[] = {{.i32 = align}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_TEXT_ALIGN, &item); - } - - void AnimatorToString( - int duration = 0, int delay = 0, int iterations = 0, - ArkUI_AnimationFillMode fill = ARKUI_ANIMATION_FILL_MODE_FORWARDS, - ArkUI_AnimationDirection direction = ARKUI_ANIMATION_DIRECTION_REVERSE, float begin = 0.0, float end = 0.0, - const ArkUI_ExpectedFrameRateRange& expectedFrameRateRange = { 0, 0, 0 }, - float keyframeTime = 0.0, float keyframeValue = 0.0) - { - SetTextContent("Animator{ dur:" + std::to_string(duration) - + "; delay:" + std::to_string(delay) - + "; iterations:" + std::to_string(iterations) - + "; fill:" + std::to_string(fill) - + "; direction:" + std::to_string(direction) - + "; begin:" + std::to_string(begin) - + "; end:" + std::to_string(end) - + "; expectedFrameRateRange:[ max:" + - std::to_string(expectedFrameRateRange.max) + ", min:" + - std::to_string(expectedFrameRateRange.min) + ", expected:" + - std::to_string(expectedFrameRateRange.expected) + "]" - + "; keyframeTime:" + std::to_string(keyframeTime) - + "; keyframeValue:" + std::to_string(keyframeValue) - + "}"); - } - - void AnimatetoToString( - int duration = 0, float tempo = 0, int curve = 0, int delay = 0, - int iteration = 0, ArkUI_AnimationPlayMode playmode = ARKUI_ANIMATION_PLAY_MODE_REVERSE, - const ArkUI_ExpectedFrameRateRange& expectedFrameRateRange = { 0, 0, 0 }) - { - SetTextContent("animateto{ dur:" + std::to_string(duration) - + "; tempo:" + std::to_string(tempo) - + "; curve:" + std::to_string(static_cast(curve)) - + "; delay:" + std::to_string(delay) - + "; iteration:" + std::to_string(iteration) - + "; playmode:" + std::to_string(static_cast(playmode)) - + "; expectedFrameRateRange:[ max:" + - std::to_string(expectedFrameRateRange.max) + ", min:" + - std::to_string(expectedFrameRateRange.min) + ", expected:" + - std::to_string(expectedFrameRateRange.expected) + "]}"); - } - - void KeyframeAnimatetoToString( - int durationIndex1 = 0, int durationIndex2 = 0, int delay = 0, - int iteration = 0, - const ArkUI_ExpectedFrameRateRange& expectedFrameRateRange = { 0, 0, 0 }) - { - SetTextContent("KeyframeAnimateto{ dur index:" + std::to_string(durationIndex1) - + "; delay:" + std::to_string(delay) - + "; iteration:" + std::to_string(iteration) - + "; expectedFrameRateRange:[ max:" + - std::to_string(expectedFrameRateRange.max) + ", min:" + - std::to_string(expectedFrameRateRange.min) + ", expected:" + - std::to_string(expectedFrameRateRange.expected) + "]}"); - } -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUITEXTNODE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/AnimationNDK/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 058cf3cf28158c660e24c4f703b6ebf64c088aea..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(CAPINativeAnimateTest) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp NativeEntry.cpp) - -target_link_libraries(entry PUBLIC libace_napi.z.so libace_ndk.z.so libhilog_ndk.z.so) - diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.cpp b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.cpp deleted file mode 100644 index 847e28af653947e37565c5a60751a8cbfe4cfe97..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include "NativeEntry.h" -#include "NormalTextListExample.h" -#include "ArkUIAnimate.h" - -namespace NativeModule { - -napi_value CreateNativeRoot(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - // 获取NodeContent - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - NativeEntry::GetInstance()->SetContentHandle(contentHandle); - - // 创建动画 - auto column = CreateAnimateRootNode(); - NativeEntry::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value DestroyNativeRoot(napi_env env, napi_callback_info info) -{ - // 从管理类中释放Native侧对象。 - NativeEntry::GetInstance()->DisposeRootNode(); - return nullptr; -} - -} // namespace NativeModule \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.h deleted file mode 100644 index 789e19d6f9d1dfd54f546dc401f1b3f8c1143dc2..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_NATIVEENTRY_H -#define MYAPPLICATION_NATIVEENTRY_H - -#include -#include -#include -#include - -namespace NativeModule { - -napi_value CreateNativeRoot(napi_env env, napi_callback_info info); - -napi_value DestroyNativeRoot(napi_env env, napi_callback_info info); - -// 管理Native组件的生命周期和内存。 -class NativeEntry { -public: - static NativeEntry *GetInstance() - { - static NativeEntry nativeEntry; - return &nativeEntry; - } - - void SetContentHandle(ArkUI_NodeContentHandle handle) - { - handle_ = handle; - } - - void SetRootNode(const std::shared_ptr &baseNode) - { - root_ = baseNode; - // 添加Native组件到NodeContent上用于挂载显示。 - OH_ArkUI_NodeContent_AddNode(handle_, root_->GetHandle()); - } - void DisposeRootNode() - { - // 从NodeContent上卸载组件并销毁Native组件。 - OH_ArkUI_NodeContent_RemoveNode(handle_, root_->GetHandle()); - root_.reset(); - } - -private: - std::shared_ptr root_; - ArkUI_NodeContentHandle handle_; -}; - -} // namespace NativeModule - -#endif // MYAPPLICATION_NATIVEENTRY_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeModule.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeModule.h deleted file mode 100644 index b4ad857bf17898e59082e875d92f56068f677376..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeModule.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_NATIVEMODULE_H -#define MYAPPLICATION_NATIVEMODULE_H - -#include -#include -#include - -#include - -namespace NativeModule { - -class NativeModuleInstance { -public: - static NativeModuleInstance *GetInstance() - { - static NativeModuleInstance instance; - return &instance; - } - - NativeModuleInstance() - { - // 获取接口的函数指针结构体对象,用于后续操作。 - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, arkUINativeNodeApi_); - } - // 暴露给其他模块使用。 - ArkUI_NativeNodeAPI_1 *GetNativeNodeAPI() { return arkUINativeNodeApi_; } - -private: - ArkUI_NativeNodeAPI_1 *arkUINativeNodeApi_ = nullptr; -}; - -} // namespace NativeModule - -#endif // MYAPPLICATION_NATIVEMODULE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NormalTextListExample.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NormalTextListExample.h deleted file mode 100644 index 07c43cc88ca5cbf873184ea6d5d000507ecde173..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NormalTextListExample.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_NORMALTEXTLISTEXAMPLE_H -#define MYAPPLICATION_NORMALTEXTLISTEXAMPLE_H - -#include "ArkUIBaseNode.h" -#include "ArkUIListItemNode.h" -#include "ArkUIListNode.h" -#include "ArkUITextNode.h" -#include - -namespace NativeModule { -constexpr int32_t LISTNUM_0 = 0; -constexpr int32_t LISTNUM_1 = 1; -constexpr int32_t NUM_16 = 16; -constexpr int32_t LISTNUM_30 = 30; -constexpr int32_t LISTNUM_100 = 100; -constexpr int32_t LISTNUM_300 = 300; - -std::shared_ptr CreateTextListExample() -{ - // 创建组件并挂载 - // 1:使用智能指针创建List组件。 - auto list = std::make_shared(); - list->SetPercentWidth(LISTNUM_1); - list->SetPercentHeight(LISTNUM_1); - list->SetScrollBarState(true); - // 2:创建ListItem子组件并挂载到List上。 - for (int32_t i = LISTNUM_0; i < LISTNUM_30; ++i) { - auto listItem = std::make_shared(); - auto textNode = std::make_shared(); - textNode->SetTextContent(std::to_string(i)); - textNode->SetFontSize(NUM_16); - textNode->SetFontColor(0xFFff00ff); - textNode->SetPercentWidth(LISTNUM_1); - textNode->SetWidth(LISTNUM_300); - textNode->SetHeight(LISTNUM_100); - textNode->SetBackgroundColor(0xFFfffacd); - textNode->SetTextAlign(ARKUI_TEXT_ALIGNMENT_CENTER); - listItem->InsertChild(textNode, i); - list->AddChild(listItem); - } - return list; -} -} // namespace NativeModule - -#endif // MYAPPLICATION_NORMALTEXTLISTEXAMPLE_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/AnimationNDK/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index ff24bc6e2d5d92ecc97a59d4f58f1953b1c9eaad..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include "NativeEntry.h" - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ -// 绑定Native侧的创建组件和销毁组件。 - napi_property_descriptor desc[] = { - {"createNativeRoot", nullptr, NativeModule::CreateNativeRoot, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"destroyNativeRoot", nullptr, NativeModule::DestroyNativeRoot, nullptr, - nullptr, nullptr, napi_default, nullptr}}; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/index.d.ts b/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/index.d.ts deleted file mode 100644 index 26cb19dfd8fae099d1dc3feca199debd8e3414bd..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -export const createNativeRoot: (content: Object) => void; -export const destroyNativeRoot: () => void; \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index da3d1c3825df6ab56e2bf2821d988f1257f34795..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/AnimationNDK/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 843c7f0c1f7b9a460e3dbbd2689e5b34016027d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/AnimationNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 4ce6449f0e91914e73d4502c9f2e8e9a395ea4b1..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/Index.ets b/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 5ac5a67649d957dc2b10908056e3d6cc0fbde0c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - @State @Watch('changeNativeFlag') showNative: boolean = false; - @State isModuleLoaded: boolean = false; - - changeNativeFlag(): void { - if (nativeNode) { - this.isModuleLoaded = true; - } - if (!this.isModuleLoaded) { - console.info('CXX Please wait, native module is loading...'); - return; - } - - if (this.showNative) { - // 传递NodeContent对象用于Native创建组件的挂载显示 - nativeNode?.createNativeRoot(this.rootSlot) - } else { - // 销毁NativeModule组件 - nativeNode.destroyNativeRoot() - } - } - - build() { - Column() { - Button(this.showNative ? 'Hide Native UI Animate' : 'Show Native UI Animate').onClick(() => { - this.showNative = !this.showNative - }) - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/module.json5 b/ArkUIKit/AnimationNDK/entry/src/main/module.json5 deleted file mode 100644 index 4e782f2a33d37350362667cd6243da13fb267a8b..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/module.json5 +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone", - "tablet", - "2in1", - "wearable" - ], - "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": [ - "ohos.want.action.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/ArkUIKit/AnimationNDK/entry/src/main/resources/base/element/color.json b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/element/float.json b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/element/string.json b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f5f2e04b93c4c18a04876f8e02668d82e6862464..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,988 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "ScrollableComponent" - }, - { - "name": "pageIndex_List", - "value": "列表/List" - }, - { - "name": "pageIndex_ArcList", - "value": "弧形列表/ArcList" - }, - { - "name": "pageIndex_Grid", - "value": "网格/Grid" - }, - { - "name": "pageIndex_Swiper", - "value": "轮播/Swiper" - }, - { - "name": "pageIndex_ArcSwiper", - "value": "弧形轮播/ArcSwiper" - }, - { - "name": "pageIndex_Tabs", - "value": "选项卡/Tabs" - }, - { - "name": "GridLayout_title", - "value": "网格开发布局" - }, - { - "name": "GridLayout_titleRowSpacing", - "value": "设置行列数量占比和行间距示例" - }, - { - "name": "GridLayout_titleChildSpan", - "value": "设置子组件所占行列数示例" - }, - { - "name": "GridLayout_titleMainAxis", - "value": "设置主轴方向示例" - }, - { - "name": "GridLayout_description", - "value": "示例设置了网格中子组件行列数量占比、行列间距和主轴方向。" - }, - { - "name": "DataInGrid_title", - "value": "网格显示数据" - }, - { - "name": "DataInGrid_titleOfficeServices", - "value": "办公服务网格示例" - }, - { - "name": "DataInGrid_titleForEach", - "value": "办公服务网格ForEach语句示例" - }, - { - "name": "DataInGrid_description", - "value": "示例采用二维布局的方式组织其内部元素,显示通用办公服务网格。" - }, - { - "name": "ScrollableGrid_title", - "value": "可滚动的网格布局" - }, - { - "name": "ScrollableGrid_titleHorizontal", - "value": "横向可滚动网格布局示例" - }, - { - "name": "ScrollableGrid_description", - "value": "示例通过仅设置行、列数量与占比中的一个实现横向可滚动网格布局。" - }, - { - "name": "ScrollPosition_title", - "value": "控制滚动位置的网格布局" - }, - { - "name": "ScrollPosition_titleExample", - "value": "控制滚动位置示例" - }, - { - "name": "ScrollPosition_description", - "value": "示例通过添加Scroller对象的scrollPage方法,实现滚动网格布局翻页滚动的功能。" - }, - { - "name": "SwiperLoop_title", - "value": "循环播放" - }, - { - "name": "SwiperLoop_titleTrue", - "value": "循环播放loop为true的示例" - }, - { - "name": "SwiperLoop_titleFalse", - "value": "循环播放loop为false的示例" - }, - { - "name": "SwiperLoop_description", - "value": "通过设置loop属性控制是否循环播放。" - }, - { - "name": "SwiperAutoPlay_title", - "value": "自动轮播" - }, - { - "name": "SwiperAutoPlay_titleExample", - "value": "自动轮播示例" - }, - { - "name": "SwiperAutoPlay_description", - "value": "通过设置autoPlay属性控制是否自动轮播子组件。" - }, - { - "name": "SwiperIndicatorStyle_title", - "value": "自定义导航点样式" - }, - { - "name": "SwiperIndicatorStyle_titleDefault", - "value": "默认导航点样式示例" - }, - { - "name": "SwiperIndicatorStyle_titleCustom", - "value": "自定义导航点样式示例" - }, - { - "name": "SwiperIndicatorStyle_titleDefaultArrows", - "value": "默认箭头样式导航点样式示例" - }, - { - "name": "SwiperIndicatorStyle_titleCustomArrows", - "value": "自定义箭头样式导航点样式示例" - }, - { - "name": "SwiperIndicatorStyle_description", - "value": "通过indicator属性和displayArrow属性对导航点样式和导航点箭头样式进行设置。" - }, - { - "name": "SwiperPageSwitchMethod_title", - "value": "页面切换方式" - }, - { - "name": "SwiperPageSwitchMethod_titleHorizontal", - "value": "水平方向上轮播示例" - }, - { - "name": "SwiperPageSwitchMethod_titleVertical", - "value": "垂直方向上轮播示例" - }, - { - "name": "SwiperPageSwitchMethod_description", - "value": "Swiper支持手指滑动、点击导航点和通过控制器三种方式切换页面,示例展示通过控制器切换页面的方法。" - }, - { - "name": "SwiperDirection_title", - "value": "轮播方向" - }, - { - "name": "SwiperDirection_description", - "value": "Swiper支持水平和垂直方向上进行轮播,主要通过vertical属性控制。" - }, - { - "name": "SwiperMultiPage_title", - "value": "每页显示多个子页面" - }, - { - "name": "SwiperMultiPage_titleExample", - "value": "每页显示多个子页面示例" - }, - { - "name": "SwiperMultiPage_description", - "value": "Swiper支持在一个页面内同时显示多个子组件,通过displayCount属性设置。" - }, - { - "name": "SwiperCustomAnimation_title", - "value": "自定义切换动画" - }, - { - "name": "SwiperCustomAnimation_titleExample", - "value": "自定义切换动画示例" - }, - { - "name": "SwiperCustomAnimation_description", - "value": "Swiper支持通过customContentTransition设置自定义切换动画。" - }, - { - "name": "TabsLayout_title", - "value": "基本布局" - }, - { - "name": "TabsLayout_titleExample", - "value": "基本布局示例" - }, - { - "name": "TabsLayout_description", - "value": "示例展示Tabs组件页面组成的两个部分,分别是内容页TabContent和导航页签栏TabBar。" - }, - { - "name": "BottomTabBar_title", - "value": "底部导航" - }, - { - "name": "BottomTabBar_titleExample", - "value": "底部导航示例" - }, - { - "name": "homepage", - "value": "首页" - }, - { - "name": "homepage_content", - "value": "首页的内容" - }, - { - "name": "recommend", - "value": "推荐" - }, - { - "name": "recommend_content", - "value": "推荐的内容" - }, - { - "name": "discover", - "value": "发现" - }, - { - "name": "discover_content", - "value": "发现的内容" - }, - { - "name": "mine", - "value": "我的" - }, - { - "name": "mine_content", - "value": "我的内容" - }, - { - "name": "BottomTabBar_description", - "value": "示例展示导航页签栏TabBar在底部的情景。" - }, - { - "name": "TopTabBar_title", - "value": "顶部导航" - }, - { - "name": "TopTabBar_titleExample", - "value": "顶部导航示例" - }, - { - "name": "TopTabBar_description", - "value": "示例展示导航页签栏TabBar在顶部的情景。" - }, - { - "name": "SideTabBar_title", - "value": "侧边导航" - }, - { - "name": "SideTabBar_titleExample", - "value": "侧边导航示例" - }, - { - "name": "SideTabBar_description", - "value": "示例展示导航页签栏TabBar在侧边的情景。" - }, - { - "name": "SwipeLockedTabBar_title", - "value": "限制导航栏的滑动切换" - }, - { - "name": "SwipeLockedTabBar_titleExample", - "value": "限制导航栏的滑动切换示例" - }, - { - "name": "SwipeLockedTabBar_description", - "value": "示例展示在底部导航+顶部导航组合的情况下,限制底部导航栏滑动的情景。" - }, - { - "name": "FixedTabBar_title", - "value": "固定导航栏" - }, - { - "name": "FixedTabBar_titleExample", - "value": "固定导航栏示例" - }, - { - "name": "FixedTabBar_description", - "value": "示例展示底部导航内容分类一般固定,分类数量一般在3-5个,使用固定导航栏的情景。" - }, - { - "name": "ScrollableTabBar_title", - "value": "滚动导航栏" - }, - { - "name": "ScrollableTabBar_titleExample", - "value": "滚动导航栏示例" - }, - { - "name": "FocusOn_content", - "value": "关注的内容" - }, - { - "name": "game_content", - "value": "游戏的内容" - }, - { - "name": "digit_content", - "value": "数码的内容" - }, - { - "name": "technology_content", - "value": "科技的内容" - }, - { - "name": "sport_content", - "value": "体育的内容" - }, - { - "name": "film_content", - "value": "影视的内容" - }, - { - "name": "humanities_content", - "value": "人文的内容" - }, - { - "name": "FocusOn", - "value": "关注" - }, - { - "name": "game", - "value": "游戏" - }, - { - "name": "digit", - "value": "数码" - }, - { - "name": "technology", - "value": "科技" - }, - { - "name": "sport", - "value": "体育" - }, - { - "name": "film", - "value": "影视" - }, - { - "name": "humanities", - "value": "人文" - }, - { - "name": "ScrollableTabBar_description", - "value": "示例展示内容分类较多,屏幕宽度无法容纳所有分类页签的情况下,需要使用可滚动的导航栏的情景。" - }, - { - "name": "CustomTabBar_title", - "value": "自定义导航栏" - }, - { - "name": "CustomTabBar_titleExample", - "value": "自定义导航栏示例" - }, - { - "name": "internet_content", - "value": "网络的内容" - }, - { - "name": "album_content", - "value": "相册的内容" - }, - { - "name": "video_content", - "value": "视频的内容" - }, - { - "name": "more_content", - "value": "更多的内容" - }, - { - "name": "internet", - "value": "网络" - }, - { - "name": "album", - "value": "相册" - }, - { - "name": "video", - "value": "视频" - }, - { - "name": "more", - "value": "更多" - }, - { - "name": "CustomTabBar_description", - "value": "示例展示通过组合文字以及对应语义图标表示页签内容,自定义导航栏样式的情景。" - }, - { - "name": "ContentWillChange_title", - "value": "切换至指定页签" - }, - { - "name": "ContentWillChange_titleContentAndTabSync", - "value": "内容页和页签联动示例" - }, - { - "name": "ContentWillChange_titleSpecifiedTab", - "value": "切换指定页签示例" - }, - { - "name": "ContentWillChange_titleInterception", - "value": "支持开发者自定义页面切换拦截事件示例" - }, - { - "name": "ContentWillChange_changeIndex", - "value": "动态修改index" - }, - { - "name": "ContentWillChange_description", - "value": "示例展示使用了自定义导航栏后,自行实现页签切换逻辑。" - }, - { - "name": "AgeFriendlyTabs_title", - "value": "支持适老化" - }, - { - "name": "AgeFriendlyTabs_description", - "value": "示例展示在适老化大字体场景下,底部页签提供大字体弹窗显示内容。" - }, - { - "name": "ListLayout_title", - "value": "列表开发布局" - }, - { - "name": "ListLayout_titleMainAxis", - "value": "设置主轴方向布局" - }, - { - "name": "ListLayout_titleCrossAxisLanes", - "value": "设置交叉轴布局lanes属性" - }, - { - "name": "ListLayout_titleCrossAxisAlignment", - "value": "设置交叉轴布局alignListItem属性" - }, - { - "name": "ListLayout_description", - "value": "展示列表主轴和交叉轴布局的各种示例。" - }, - { - "name": "DataInList_title", - "value": "列表显示数据" - }, - { - "name": "DataInList_titlePage", - "value": "在列表中显示数据" - }, - { - "name": "DataInList_titleCityList", - "value": "城市列表示例" - }, - { - "name": "city_beijing", - "value": "北京" - }, - { - "name": "city_hangzhou", - "value": "杭州" - }, - { - "name": "city_shanghai", - "value": "上海" - }, - { - "name": "peopleOne", - "value": "小明" - }, - { - "name": "peopleTwo", - "value": "小红" - }, - { - "name": "DataInList_titleContactsList", - "value": "联系人列表示例" - }, - { - "name": "DataInList_description", - "value": "示例模拟显示城市列表,以及图片和文字一起显示的联系人列表。" - }, - { - "name": "ListIteration_title", - "value": "迭代列表内容" - }, - { - "name": "ListIteration_titleExample", - "value": "迭代列表内容示例" - }, - { - "name": "ListIteration_description", - "value": "示例通过数据集合动态地创建列表。" - }, - { - "name": "CustomListStyle_title", - "value": "自定义列表样式" - }, - { - "name": "CustomListStyle_titleContentSpacing", - "value": "设置内容间距" - }, - { - "name": "CustomListStyle_titleDividerLines", - "value": "添加分隔线" - }, - { - "name": "CustomListStyle_titleScrollbars", - "value": "添加滚动条" - }, - { - "name": "CustomListStyle_description", - "value": "示例通过属性自定义设置列表的内容间距、分隔线、滚动条等样式。" - }, - { - "name": "GroupedList_title", - "value": "支持分组列表" - }, - { - "name": "GroupedList_titleExample", - "value": "支持分组列表示例" - }, - { - "name": "GroupedList_description", - "value": "示例在列表中支持数据分组展示,可以使列表显示结构清晰,查找方便,从而提高使用效率。" - }, - { - "name": "StickyHeaderList_title", - "value": "添加粘性标题" - }, - { - "name": "StickyHeaderList_titleExample", - "value": "添加粘性标题示例" - }, - { - "name": "StickyHeaderList_description", - "value": "粘性标题常用于定位字母列表的头部元素,有助于阐明列表中数据的表示形式和用途,帮助用户进行数据定位。" - }, - { - "name": "ControlledScrollPositionList_title", - "value": "控制滚动位置" - }, - { - "name": "ControlledScrollPositionList_titleExample", - "value": "控制滚动位置示例" - }, - { - "name": "ControlledScrollPositionList_description", - "value": "当列表中新闻页列表项数量庞大时,可以快速滚动到列表底部或返回列表顶部。" - }, - { - "name": "ResponsiveScrollPositionList_title", - "value": "响应滚动位置" - }, - { - "name": "ResponsiveScrollPositionList_titleExample", - "value": "响应滚动位置示例" - }, - { - "name": "contacts_A_one", - "value": "艾佳" - }, - { - "name": "contacts_A_two", - "value": "安安" - }, - { - "name": "contacts_B_one", - "value": "白叶" - }, - { - "name": "contacts_B_two", - "value": "伯伯" - }, - { - "name": "contacts_B_three", - "value": "伯明" - }, - { - "name": "contacts_D_one", - "value": "大白" - }, - { - "name": "contacts_D_two", - "value": "大伯" - }, - { - "name": "contacts_D_three", - "value": "大明" - }, - { - "name": "contacts_F_one", - "value": "帆帆" - }, - { - "name": "contacts_F_two", - "value": "芳芳" - }, - { - "name": "contacts_G_one", - "value": "刚刚" - }, - { - "name": "contacts_G_two", - "value": "哥哥" - }, - { - "name": "contacts_H_one", - "value": "花花" - }, - { - "name": "contacts_H_two", - "value": "华华" - }, - { - "name": "contacts_H_three", - "value": "欢欢" - }, - { - "name": "contacts_X_one", - "value": "小李" - }, - { - "name": "contacts_X_two", - "value": "小王" - }, - { - "name": "contacts_X_three", - "value": "小张" - }, - { - "name": "ResponsiveScrollPositionList_description", - "value": "在联系人列表滚动时,如果跨越了不同字母开头的分组,则侧边字母索引栏也需要更新到对应的字母位置。" - }, - { - "name": "SwipeListItem_title", - "value": "响应列表项侧滑" - }, - { - "name": "SwipeListItem_titleExample", - "value": "响应列表项侧滑示例" - }, - { - "name": "SwipeListItem_description", - "value": "在消息列表中,给消息列表提供侧滑删除功能。" - }, - { - "name": "TaggedListItems_title", - "value": "给列表项添加标记" - }, - { - "name": "TaggedListItems_titleExample", - "value": "给列表项添加标记示例" - }, - { - "name": "TaggedListItems_description", - "value": "在消息列表中,给消息信息右上角添加标记。" - }, - { - "name": "AddListItem_title", - "value": "新增列表项" - }, - { - "name": "AddListItem_titleExample", - "value": "新增列表项示例" - }, - { - "name": "TodoItem", - "value": "待办" - }, - { - "name": "AddListItem_description", - "value": "在示例中击添加按钮,列表项内容选择或填写的交互界面,用户点击确定后,列表中新增对应的项目。" - }, - { - "name": "DeleteListItem_title", - "value": "删除列表项" - }, - { - "name": "DeleteListItem_titleExample", - "value": "删除列表项示例" - }, - { - "name": "DeleteListItem_description", - "value": "在示例中用户长按列表项进入删除模式,提供用户删除列表项选择的交互界面,勾选完成后点击删除按钮,列表中删除对应的项目。" - }, - { - "name": "pageIndex_WaterFlow", - "value": "创建瀑布流/WaterFlow" - }, - { - "name": "WaterFlowInfiniteScrolling_title", - "value": "无限滚动(到达末尾时新增数据)" - }, - { - "name": "WaterFlowInfiniteScrolling_description", - "value": "在瀑布流组件到达末尾位置时触发事件回调,增加新数据。" - }, - { - "name": "WaterFlowInfiniteScrollingEarly_title", - "value": "无限滚动(提前新增数据)" - }, - { - "name": "WaterFlowInfiniteScrollingEarly_description", - "value": "为了实现更加流畅的无限滑动,需要调整增加新数据的时机。可以在还剩余若干个数据未遍历的情况下提前加载新数据。" - }, - { - "name": "WaterFlowGroupingMixing_title", - "value": "分组混合布局" - }, - { - "name": "WaterFlowGroupingMixing_description", - "value": "许多应用界面在瀑布流上方包含其他内容,这类场景可通过在Scroll或List内部嵌套WaterFlow来实现。" - }, - { - "name": "WaterFlowDynamicSwitchover_title", - "value": "动态切换列数" - }, - { - "name": "WaterFlowDynamicSwitchover_description", - "value": "通过动态调整瀑布流的列数,应用能够实现在列表模式与瀑布流模式间的切换,或适应屏幕宽度的变化。" - }, - { - "name": "GridSideToSide_title", - "value": "控制滚动位置" - }, - { - "name": "GridSideToSide_description", - "value": "与新闻列表的返回顶部场景类似,控制滚动位置功能在网格布局中也很常用,例如下图所示日历的翻页功能。" - }, - { - "name": "GridScrollbar_title", - "value": "添加外置滚动条" - }, - { - "name": "GridScrollbar_description", - "value": "网格组件Grid可与ScrollBar组件配合使用,为网格添加外置滚动条。" - }, - { - "name": "ArcSwiperHorizontal_title", - "value": "水平方向轮播" - }, - { - "name": "ArcSwiperHorizontal_description", - "value": "设置水平方向上轮播。" - }, - { - "name": "ArcSwiperVertical_title", - "value": "垂直方向轮播" - }, - { - "name": "ArcSwiperVertical_description", - "value": "设置垂直方向轮播,导航点设为3点钟方向。。" - }, - { - "name": "ArcSwiperAction_title", - "value": "自定义切换动画" - }, - { - "name": "ArcSwiperAction_description", - "value": "ArcSwiper支持设置自定义切换动画,可以在回调中对视窗内所有页面逐帧设置透明度、缩放比例、位移、渲染层级等属性,从而实现自定义切换动画效果。" - }, - { - "name": "ArcSwiperSideSlip_title", - "value": "实现侧滑返回" - }, - { - "name": "ArcSwiperSideSlip_description", - "value": "ArcSwiper的滑动事件会与侧滑返回冲突,可以通过手势拦截去判断ArcSwiper是否滑动到开头去拦截ArcSwiper的滑动手势,实现再次左滑返回上一页的功能。" - }, - { - "name": "ArcSwiperStyles_title", - "value": "设置导航点样式" - }, - { - "name": "ArcSwiperStyles_titleDefault", - "value": "导航点使用默认样式" - }, - { - "name": "ArcSwiperStyles_titleCustomize", - "value": "自定义导航点样式" - }, - { - "name": "ArcSwiperStyles_description", - "value": "ArcSwiper提供了默认的弧形导航点样式,导航点默认显示在ArcSwiper下方居中位置,开发者也可以通过indicator属性自定义弧形导航点的样式。" - }, - { - "name": "ArcSwiperToggle_title", - "value": "控制页面切换方式" - }, - { - "name": "ArcSwiperToggle_description", - "value": "以下示例展示通过控制控制器和旋转表冠翻页的方法。" - }, - { - "name": "ArcListAcrScrollBar_title", - "value": "添加外置滚动条ArcScrollBar" - }, - { - "name": "ArcListAcrScrollBar_description", - "value": "弧形列表ArcList可与ArcScrollBar组件配合使用,为弧形列表添加外置滚动条。" - }, - { - "name": "ArcListArcIndexerBar_title", - "value": "与弧形索引条ArcAlphabetIndexer联动" - }, - { - "name": "ArcListArcIndexerBar_description", - "value": "许多应用需要监测列表的滚动位置变动并作出响应,或通过调整滚动位置实现列表的快速定位。为此,需使用弧形索引条组件ArcAlphabetIndexer。" - }, - { - "name": "arcListBuiltInScrollerBar_title", - "value": "添加内置滚动条" - }, - { - "name": "arcListBuiltInScrollerBar_description", - "value": "当列表项的高度超过屏幕高度时,弧形列表能够沿垂直方向滚动。" - }, - { - "name": "ArcListContents_title", - "value": "迭代弧形列表内容" - }, - { - "name": "ArcListContents_description", - "value": "通常,应用会通过数据集合动态创建列表。采用循环渲染的方式,可以从数据源中迭代获取数据,在每次迭代过程中创建相应的组件,从而降低代码的复杂度。" - }, - { - "name": "ArcListCrown_title", - "value": "响应旋转表冠" - }, - { - "name": "ArcListCrown_description", - "value": "手表设备上弧形列表在获焦的情况下可对旋转表冠做出响应,用户可通过旋转表冠的操作滑动列表,浏览列表项数据。" - }, - { - "name": "ArcListShow_title", - "value": "在弧形列表中显示数据" - }, - { - "name": "ArcListShow_description", - "value": "弧形列表视图垂直展示项目集合,当列表项超出屏幕范围时,提供滚动功能,这使得它非常适合展示大型数据集合。" - }, - { - "name": "ArcListSideSlip_title", - "value": "响应列表项侧滑" - }, - { - "name": "ArcListSideSlip_description", - "value": "ArcListItem的swipeAction属性可用于实现列表项的左右滑动功能。" - }, - { - "name": "ArcListStyles_head", - "value": "自定义弧形列表标题" - }, - { - "name": "ArcListStyles_title", - "value": "自定义弧形列表样式" - }, - { - "name": "ArcListStyles_titleSpacing", - "value": "自定义弧形列表项间距" - }, - { - "name": "ArcListStyles_titleScale", - "value": "列表项关闭自动缩放" - }, - { - "name": "ArcListStyles_description", - "value": "以下示例展示自定义弧形列表样式的方法。" - }, - { - "name": "LongList_title", - "value": "长列表的处理" - }, - { - "name": "LongList_description", - "value": "循环渲染适用于短列表,当构建具有大量列表项的长列表时,如果直接采用循环渲染方式,会一次性加载所有的列表元素,会导致页面启动时间过长,影响用户体验。因此,推荐使用数据懒加载(LazyForEach)方式实现按需迭代加载数据,从而提升列表性能。" - }, - { - "name": "CollapseAndExpand_title", - "value": "折叠与展开" - }, - { - "name": "CollapseAndExpand_description", - "value": "列表项的折叠与展开用途广泛,常用于信息清单的展示、填写等应用场景。" - }, - { - "name": "SwiperAndTabsLinkage_title", - "value": "Swiper与Tabs联动" - }, - { - "name": "SwiperAndTabsLinkage_description", - "value": "Swiper选中的元素改变时,会通过onSelected回调事件,将元素的索引值index返回。通过调用tabsController.changeIndex(index)方法来实现Tabs页签的切换。" - }, - { - "name": "SwiperIgnoreComponentSize_title", - "value": "设置圆点导航点间距和忽略导航点组件大小" - }, - { - "name": "SwiperIgnoreComponentSize_description", - "value": "针对圆点导航点,可以通过DotIndicator的space属性来设置圆点导航点的间距。当导航点的bottom设为0之后,导航点的底部与Swiper的底部还会有一定间距。如果希望消除该间距,可通过调用bottom(bottom, ignoreSize)属性来进行设置。" - }, - { - "name": "ArcLongList_title", - "value": "处理长列表" - }, - { - "name": "ArcLongList_description", - "value": "循环渲染适用于短列表,当构建具有大量列表项的长列表时,如果直接采用循环渲染方式,会一次性加载所有的列表元素,会导致页面启动时间过长,影响用户体验。因此,推荐使用数据懒加载(LazyForEach)方式实现按需迭代加载数据,从而提升列表性能。" - }, - { - "name": "ListChatRoom_title", - "value": "切换布局方向" - }, - { - "name": "ListChatRoom_description", - "value": "部分业务场景需要列表底部插入数据时,自动向上滚动,把新插入的节点展示出来。" - }, - { - "name": "LongGrid_title", - "value": "性能优化" - }, - { - "name": "LongGrid_description", - "value": "与长列表的处理类似,循环渲染适用于数据量较小的布局场景,当构建具有大量网格项的可滚动网格布局时,推荐使用数据懒加载方式实现按需迭代加载数据,从而提升列表性能。" - }, - { - "name": "GridCalculator_title", - "value": "计算器的按键布局" - }, - { - "name": "GridCalculator_description", - "value": "实现不同大小的网格组成不均匀分布的网格布局场景" - }, - { - "name": "ArcListCrown_set", - "value": "设置" - }, - { - "name": "ArcListStyles_waln", - "value": "WLAN" - }, - { - "name": "ArcListStyles_open", - "value": "已开启" - }, - { - "name": "ArcListStyles_blue", - "value": "蓝牙" - }, - { - "name": "ArcListStyles_net", - "value": "移动网络" - }, - { - "name": "ArcListStyles_connect", - "value": "更多连接" - }, - { - "name": "ArcListStyles_light", - "value": "显示和亮度" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/background.png b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/dark/element/color.json b/ArkUIKit/AnimationNDK/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/mock/Libentry.mock.ets b/ArkUIKit/AnimationNDK/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 82fa70b5693ddab96d237d2d17d943d866b61465..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/mock/mock-config.json5 b/ArkUIKit/AnimationNDK/entry/src/mock/mock-config.json5 deleted file mode 100644 index 98b0ae79f0090e1fc381d54c959fb32c9f7563f4..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 7f30942b81554a399e89aa253c7089eca4f8d8d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index c64e0b06938d246ce044186d4b2d02b500a89e14..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/ohosTest/module.json5 b/ArkUIKit/AnimationNDK/entry/src/ohosTest/module.json5 deleted file mode 100644 index 6aa299de060102fad8a388928a04b1e14c2a751d..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone", - "tablet", - "2in1", - "wearable" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/AnimationNDK/entry/src/test/List.test.ets b/ArkUIKit/AnimationNDK/entry/src/test/List.test.ets deleted file mode 100644 index a60c87c5cbb0badf7c3fd8975034590e6fafa992..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/test/LocalUnit.test.ets b/ArkUIKit/AnimationNDK/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 841bfd77e56060e50ec0924302a5ae624e76e3aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/hvigor/hvigor-config.json5 b/ArkUIKit/AnimationNDK/hvigor/hvigor-config.json5 deleted file mode 100644 index a389527d6e97360973f5359d0496c8780ed77a33..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/ArkUIKit/AnimationNDK/hvigorfile.ts b/ArkUIKit/AnimationNDK/hvigorfile.ts deleted file mode 100644 index ae9086af35844176c08f1be3772d081d95d267c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/oh-package-lock.json5 b/ArkUIKit/AnimationNDK/oh-package-lock.json5 deleted file mode 100644 index 01f291e148fe3bb4fde8c5b9aba73b25d493f3d2..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/oh-package-lock.json5 +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.21": "@ohos/hypium@1.0.21" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "@ohos/hamock", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.21": { - "name": "@ohos/hypium", - "version": "1.0.21", - "integrity": "sha512-iyKGMXxE+9PpCkqEwu0VykN/7hNpb+QOeIuHwkmZnxOpI+dFZt6yhPB7k89EgV1MiSK/ieV/hMjr5Z2mWwRfMQ==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.21.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/oh-package.json5 b/ArkUIKit/AnimationNDK/oh-package.json5 deleted file mode 100644 index 41ed05598470e02379db2b68e6cb9015c0847509..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/AnimationNDK/ohosTest.md b/ArkUIKit/AnimationNDK/ohosTest.md deleted file mode 100644 index 6c9d7f50ce74ecca8b4d07191c5000e566916b44..0000000000000000000000000000000000000000 --- a/ArkUIKit/AnimationNDK/ohosTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# AnimationNDK 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|------------------------------|--------|----------------------------------------|----------------------------------------|:-----|------| -| AnimationNDK 示例运行正常 | 设备正常运行 | 进入首页 | 预期显示“关键帧动画,animateTo动画,transition,以及animator” 四个模块动画 | 是 | Pass | -| KeyFrameAnimeteto动画运行正常 | 设备正常运行 | 进入首页-点击关键帧动画下的组件 | 预期动画可以正常执行 | 是 | Pass | -| Animeteto动画运行正常 | 设备正常运行 | 进入首页-点击Animeteto下的组件 | 预期Animeteto动画正常执行 | 是 | Pass | -| Transition动画运行正常 | 设备正常运行 | 进入首页-点击transition按钮 | 组件显隐动画正常执行 | 是 | Pass | -| animator动画运行正常 | 设备正常运行 | 进入首页-点击create-点击play | animator动画可以正常执行 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/screenshots/Animation.gif b/ArkUIKit/AnimationNDK/screenshots/Animation.gif deleted file mode 100644 index 3e52e7e68357eefc7051e5f15c2483fd30859932..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/AnimationNDK/screenshots/Animation.gif and /dev/null differ diff --git a/ArkUIKit/ArkTSXComponent/.gitignore b/ArkUIKit/ArkTSXComponent/.gitignore deleted file mode 100644 index fbabf771011fe78f9919db0b1195ab6cadffc2b0..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/AppScope/app.json5 b/ArkUIKit/ArkTSXComponent/AppScope/app.json5 deleted file mode 100644 index efa5c58de2e89c10d805722de050a27f97ce2850..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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.samples.arktsxcomponent", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/ArkTSXComponent/AppScope/resources/base/element/string.json b/ArkUIKit/ArkTSXComponent/AppScope/resources/base/element/string.json deleted file mode 100644 index 23797971100a06869721b629195f6256412b41a5..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ArkTSXComponent" - } - ] -} diff --git a/ArkUIKit/ArkTSXComponent/AppScope/resources/base/media/app_icon.png b/ArkUIKit/ArkTSXComponent/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ArkTSXComponent/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/ArkTSXComponent/README_zh.md b/ArkUIKit/ArkTSXComponent/README_zh.md deleted file mode 100644 index 82763d3a7a69ee025bba42a7ff2fa24c20f12f01..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/README_zh.md +++ /dev/null @@ -1,106 +0,0 @@ -# XComponent - -### 介绍 - -本示例主要介绍开发者如何使用ArkTS XComponent组件进行自绘制,主要包括:XComponent组件使用, -SurfaceId获取方法,Surface生命周期回调使用,NativeWindow创建等知识点。开发者基于ArkTS侧获取的SurfaceId, -在Native侧调用OH_NativeWindow_CreateNativeWindowFromSurfaceId接口创建出NativeWindow实例后,使用OpenGL ES/EGL接口在XComponent组件上进行图形绘制。功能主要包括点击按钮绘制一个五角星,并可以通过点击XComponent区域改变五角星的颜色。 - -### 效果预览 - -| 主页 | 绘制五角星 | 改变颜色 | -|--------------------------------------|-----------------------------------------------|-----------------------------------------------------| -| ![main](screenshots/device/main.png) | ![draw star](screenshots/device/drawStar.png) | ![change color](screenshots/device/changeColor.png) | - -使用说明 - -1. 安装编译生成的hap包,并打开应用。 - -2. 点击页面底部“Draw Star”按钮,页面将绘制一个五角星。 - -3. 点击XComponent组件区域(页面中灰色区域)改变五角星颜色。 - - -### 工程目录 - -``` -├──entry/src/main -│ ├──cpp // C++代码区 -│ │ ├──CMakeLists.txt // CMake配置文件 -│ │ ├──napi_init.cpp // Napi模块注册 -│ │ ├──common -│ │ │ └──common.h // 常量定义文件 -│ │ ├──manager // 生命周期管理模块 -│ │ │ ├──plugin_manager.cpp -│ │ │ └──plugin_manager.h -│ │ ├──render // 渲染模块 -│ │ │ ├──egl_core.cpp -│ │ │ ├──egl_core.h -│ │ │ ├──plugin_render.cpp -│ │ │ └──plugin_render.h -| | ├──types //定义接口文件 -│ │ │ ├──libnativerender -│ │ │ │ ├──Index.d.ts -│ │ │ │ ├──oh-package.json5 -│ ├──ets // ets代码区 -│ │ ├──entryability -│ │ │ └──EntryAbility.ts // 程序入口类 -│ │ └──pages // 页面文件 -│ │ └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -通过在IDE中创建Native c++ 工程,在c++代码中定义对外接口为DrawPattern,在ArkTS侧调用该接口可在页面上绘制出一个五角星。在 -c++代码中定义对外接口为ChangeColor,点击XComponent组件时,在ArkTs侧调用该接口可在页面绘制一个大小相同、颜色不同的五角星,达到改变颜色的目的。 - -在XComponentController的OnSurfaceCreated回调中,传入XComponent的surfaceId,在Native侧调用OH_NativeWindow_CreateNativeWindowFromSurfaceId创建NativeWindow实例并初始化 -EGL环境。在XComponentController的OnsurfaceChanged回调中,传入surfaceId、宽和高,并以此为输入调用EGL相关的接口改变对应NativeWindow的尺寸和内容。 - -源码参考:[main目录](entry/src/main/)下的文件。涉及到的相关接口: - -#### ArkTS组件 -XComponentController - -| 接口名 | 描述 | -|-------------------------------------------|--------------------------| -| getXComponentSurfaceId(): string | 获取XComponent对应Surface的ID | -| onSurfaceCreated(surfaceId: string): void |当XComponent持有的Surface创建后进行该回调| -|onSurfaceChanged(surfaceId: string, rect: SurfaceRect): void|当XComponent持有的Surface尺寸更新时进行该回调,包括初始尺寸设定| -|onSurfaceDestroyed(surfaceId: string): void|当XComponent持有的Surface销毁后进行该回调| - -#### C API -| 接口名 | 描述 | -|-------------------------------------------|--------------------------| -| int32_t OH_NativeWindow_CreateNativeWindowFromSurfaceId (uint64_t surfaceId, OHNativeWindow **window ) | 通过surfaceId创建对应的OHNativeWindow | -| void OH_NativeWindow_DestroyNativeWindow (OHNativeWindow* window)|将OHNativeWindow对象的引用计数减1,当引用计数为0的时候,该OHNativeWindow对象会被析构掉| - - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机、平板 - -2. 本示例为Stage模型,支持API12版本SDK,SDK版本号(API Version 12 Release),镜像版本号(5.0 Release) - -3. 本示例需要使用DevEco Studio 版本号(4.0 Release)及以上版本才可编译运行 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo ArkUIKit/ArkTSXComponent/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` diff --git a/ArkUIKit/ArkTSXComponent/build-profile.json5 b/ArkUIKit/ArkTSXComponent/build-profile.json5 deleted file mode 100644 index f7f2bfddf1cfd2205e6917ed106c4c5953e64e7f..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/build-profile.json5 +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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": "5.0.0(12)", - "runtimeOS": "HarmonyOS" - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/.gitignore b/ArkUIKit/ArkTSXComponent/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/build-profile.json5 b/ArkUIKit/ArkTSXComponent/entry/build-profile.json5 deleted file mode 100644 index 177757fad3d380f8b55ccbb1bd00ebf112561d7e..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/build-profile.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "targets": [ - { - "name": "default", - "runtimeOS": "HarmonyOS" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/hvigorfile.ts b/ArkUIKit/ArkTSXComponent/entry/hvigorfile.ts deleted file mode 100644 index c6edcd90486dd5a853cf7d34c8647f08414ca7a3..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/ArkUIKit/ArkTSXComponent/entry/oh-package.json5 b/ArkUIKit/ArkTSXComponent/entry/oh-package.json5 deleted file mode 100644 index 811a0b10e04f84946f75b69e8b72f3bf7ec35000..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/oh-package.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": { - "libnativerender.so": "file:./src/main/cpp/types/libnativerender" - } -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 9364964d1d61f571e57148f854e6fb6dddfb9630..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.4.1) -project(XComponent) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -add_definitions(-DOHOS_PLATFORM) - -include_directories( - ${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include -) - -add_library(nativerender SHARED - render/egl_core.cpp - render/plugin_render.cpp - manager/plugin_manager.cpp - napi_init.cpp -) - -find_library( - # Sets the name of the path variable. - EGL-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - EGL -) - -find_library( - # Sets the name of the path variable. - GLES-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - GLESv3 -) - -find_library( - # Sets the name of the path variable. - hilog-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - hilog_ndk.z -) - -find_library( - # Sets the name of the path variable. - libace-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_ndk.z -) - -find_library( - # Sets the name of the path variable. - libnapi-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_napi.z -) - -find_library( - # Sets the name of the path variable. - libuv-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - uv -) - -target_link_libraries(nativerender PUBLIC - ${EGL-lib} ${GLES-lib} ${hilog-lib} ${libace-lib} ${libnapi-lib} ${libuv-lib} libnative_window.so) \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/common/common.h b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/common/common.h deleted file mode 100644 index c7760109da75f11204bd359ac3a65900b6749872..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/common/common.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -#ifndef NATIVE_XCOMPONENT_COMMON_H -#define NATIVE_XCOMPONENT_COMMON_H - -#include -#include -#include -#include -#include - -namespace NativeXComponentSample { -/** - * Log print domain. - */ -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_COMMON_H diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/manager/plugin_manager.cpp b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/manager/plugin_manager.cpp deleted file mode 100644 index 8942dc87ce7e5bd2eba0a9e5545998fa436f3d41..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/manager/plugin_manager.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/* - * 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. - */ - -#include "plugin_manager.h" -#include -#include -#include -#include -#include -#include "../common/common.h" -#include - -namespace NativeXComponentSample { - -namespace { - int64_t ParseId(napi_env env, napi_callback_info info) - { - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ParseId", "env or info is null"); - return -1; - } - size_t argc = 1; - napi_value args[1] = {nullptr}; - if (napi_ok != napi_get_cb_info(env, info, &argc, args, nullptr, nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ParseId", "GetContext napi_get_cb_info failed"); - return -1; - } - int64_t value = 0; - bool lossless = true; - if (napi_ok != napi_get_value_bigint_int64(env, args[0], &value, &lossless)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ParseId", "Get value failed"); - return -1; - } - return value; - } -} - -std::unordered_map PluginManager::pluginRenderMap_; -std::unordered_map PluginManager::windowMap_; - -PluginManager::~PluginManager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "~PluginManager"); - for (auto iter = pluginRenderMap_.begin(); iter != pluginRenderMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - pluginRenderMap_.clear(); - for (auto iter = windowMap_.begin(); iter != windowMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - windowMap_.clear(); -} - -PluginRender* PluginManager::GetPluginRender(int64_t& id) -{ - if (pluginRenderMap_.find(id) != pluginRenderMap_.end()) { - return pluginRenderMap_[id]; - } - return nullptr; -} - -napi_value PluginManager::SetSurfaceId(napi_env env, napi_callback_info info) -{ - int64_t surfaceId = ParseId(env, info); - OHNativeWindow *nativeWindow; - PluginRender *pluginRender; - if (windowMap_.find(surfaceId) == windowMap_.end()) { - OH_NativeWindow_CreateNativeWindowFromSurfaceId(surfaceId, &nativeWindow); - windowMap_[surfaceId] = nativeWindow; - } - if (pluginRenderMap_.find(surfaceId) == pluginRenderMap_.end()) { - pluginRender = new PluginRender(surfaceId); - pluginRenderMap_[surfaceId] = pluginRender; - } - pluginRender->InitNativeWindow(nativeWindow); - return nullptr; -} - -napi_value PluginManager::DestroySurface(napi_env env, napi_callback_info info) -{ - int64_t surfaceId = ParseId(env, info); - auto pluginRenderMapIter = pluginRenderMap_.find(surfaceId); - if (pluginRenderMapIter != pluginRenderMap_.end()) { - delete pluginRenderMapIter->second; - pluginRenderMap_.erase(pluginRenderMapIter); - } - auto windowMapIter = windowMap_.find(surfaceId); - if (windowMapIter != windowMap_.end()) { - OH_NativeWindow_DestroyNativeWindow(windowMapIter->second); - windowMap_.erase(windowMapIter); - } - return nullptr; -} - -napi_value PluginManager::ChangeSurface(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", - "ChangeSurface: OnLoad env or info is null"); - return nullptr; - } - int64_t surfaceId = 0; - size_t argc = 3; - napi_value args[3] = {nullptr}; - - if (napi_ok != napi_get_cb_info(env, info, &argc, args, nullptr, nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", - "ChangeSurface: GetContext napi_get_cb_info failed"); - } - bool lossless = true; - int index = 0; - if (napi_ok != napi_get_value_bigint_int64(env, args[index++], &surfaceId, &lossless)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "ChangeSurface: Get value failed"); - } - double width; - if (napi_ok != napi_get_value_double(env, args[index++], &width)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "ChangeSurface: Get width failed"); - } - double height; - if (napi_ok != napi_get_value_double(env, args[index++], &height)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "ChangeSurface: Get height failed"); - } - auto pluginRender = GetPluginRender(surfaceId); - if (pluginRender == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "ChangeSurface: Get pluginRender failed"); - return nullptr; - } - pluginRender->UpdateNativeWindowSize(width, height); - return nullptr; -} - -napi_value PluginManager::ChangeColor(napi_env env, napi_callback_info info) -{ - int64_t surfaceId = ParseId(env, info); - auto pluginRender = GetPluginRender(surfaceId); - if (pluginRender == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "ChangeColor: Get pluginRender failed"); - return nullptr; - } - pluginRender->ChangeColor(); - return nullptr; -} - -napi_value PluginManager::DrawPattern(napi_env env, napi_callback_info info) -{ - int64_t surfaceId = ParseId(env, info); - auto pluginRender = GetPluginRender(surfaceId); - if (pluginRender == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "DrawPattern: Get pluginRender failed"); - return nullptr; - } - pluginRender->DrawPattern(); - return nullptr; -} - -napi_value PluginManager::GetXComponentStatus(napi_env env, napi_callback_info info) -{ - int64_t surfaceId = ParseId(env, info); - auto pluginRender = GetPluginRender(surfaceId); - if (pluginRender == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", - "GetXComponentStatus: Get pluginRender failed"); - return nullptr; - } - napi_value hasDraw; - napi_value hasChangeColor; - napi_status ret = napi_create_int32(env, pluginRender->HasDraw(), &(hasDraw)); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", - "GetXComponentStatus: napi_create_int32 hasDraw_ error"); - return nullptr; - } - ret = napi_create_int32(env, pluginRender->HasChangedColor(), &(hasChangeColor)); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", - "GetXComponentStatus: napi_create_int32 hasChangeColor_ error"); - return nullptr; - } - napi_value obj; - ret = napi_create_object(env, &obj); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "PluginManager", "GetXComponentStatus: napi_create_object error"); - return nullptr; - } - ret = napi_set_named_property(env, obj, "hasDraw", hasDraw); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", - "GetXComponentStatus: napi_set_named_property hasDraw error"); - return nullptr; - } - ret = napi_set_named_property(env, obj, "hasChangeColor", hasChangeColor); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", - "GetXComponentStatus: napi_set_named_property hasChangeColor error"); - return nullptr; - } - return obj; -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/manager/plugin_manager.h b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/manager/plugin_manager.h deleted file mode 100644 index 3734c98239e70c0671f52a57816b51ab93ffc965..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/manager/plugin_manager.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include -#include "../render/plugin_render.h" - -namespace NativeXComponentSample { -class PluginManager { -public: - ~PluginManager(); - static PluginRender* GetPluginRender(int64_t& id); - static napi_value ChangeColor(napi_env env, napi_callback_info info); - static napi_value DrawPattern(napi_env env, napi_callback_info info); - static napi_value SetSurfaceId(napi_env env, napi_callback_info info); - static napi_value ChangeSurface(napi_env env, napi_callback_info info); - static napi_value DestroySurface(napi_env env, napi_callback_info info); - static napi_value GetXComponentStatus(napi_env env, napi_callback_info info); -public: - static std::unordered_map pluginRenderMap_; - static std::unordered_map windowMap_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 9a96bc999f1c9231cda4c20c2a23f5faf302e683..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ - -#include - -#include "common/common.h" -#include "manager/plugin_manager.h" - -namespace NativeXComponentSample { - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - napi_property_descriptor desc[] = { - {"ChangeColor", nullptr, PluginManager::ChangeColor, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"SetSurfaceId", nullptr, PluginManager::SetSurfaceId, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"ChangeSurface", nullptr, PluginManager::ChangeSurface, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"GetXComponentStatus", nullptr, PluginManager::GetXComponentStatus, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"DrawPattern", nullptr, PluginManager::DrawPattern, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"DestroySurface", nullptr, PluginManager::DestroySurface, - nullptr, nullptr, nullptr, napi_default, nullptr} - }; - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - return exports; -} -EXTERN_C_END - -static napi_module nativerenderModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativerender", - .nm_priv = ((void*)0), - .reserved = { 0 } }; -} // namespace NativeXComponentSample -extern "C" __attribute__((constructor)) void RegisterModule(void) -{ - napi_module_register(&NativeXComponentSample::nativerenderModule); -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/egl_core.cpp b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/egl_core.cpp deleted file mode 100644 index 7112fd06276e9e1829d515394e2f4abf3bb9af33..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/egl_core.cpp +++ /dev/null @@ -1,607 +0,0 @@ -/* - * 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. - */ - -#include "egl_core.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "../common/common.h" -#include "plugin_render.h" - -namespace NativeXComponentSample { -namespace { -constexpr int32_t NUM_4 = 4; -/** - * Vertex shader. - */ -const char VERTEX_SHADER[] = "#version 300 es\n" - "layout(location = 0) in vec4 a_position;\n" - "layout(location = 1) in vec4 a_color; \n" - "out vec4 v_color; \n" - "void main() \n" - "{ \n" - " gl_Position = a_position; \n" - " v_color = a_color; \n" - "} \n"; - -/** - * Fragment shader. - */ -const char FRAGMENT_SHADER[] = "#version 300 es\n" - "precision mediump float; \n" - "in vec4 v_color; \n" - "out vec4 fragColor; \n" - "void main() \n" - "{ \n" - " fragColor = v_color; \n" - "} \n"; - -/** - * Background color #f4f4f4. - */ -const GLfloat BACKGROUND_COLOR[] = {244.0f / 255, 244.0f / 255, 244.0f / 255, 1.0f}; - -/** - * Draw color #7E8FFB. - */ -const GLfloat DRAW_COLOR[] = {126.0f / 255, 143.0f / 255, 251.0f / 255, 1.0f}; - -/** - * Change color #92D6CC. - */ -const GLfloat CHANGE_COLOR[] = {146.0f / 255, 214.0f / 255, 204.0f / 255, 1.0f}; - -/** - * Background area. - */ -const GLfloat BACKGROUND_RECTANGLE_VERTICES[] = { - -1.0f, 1.0f, - 1.0f, 1.0f, - 1.0f, -1.0f, - -1.0f, -1.0f}; - -/** - * Get context parameter count. - */ -const size_t GET_CONTEXT_PARAM_CNT = 1; - -/** - * Fifty percent. - */ -const float FIFTY_PERCENT = 0.5; - -/** - * Pointer size. - */ -const GLint POINTER_SIZE = 2; - -/** - * Triangle fan size. - */ -const GLsizei TRIANGLE_FAN_SIZE = 4; - -/** - * Egl red size default. - */ -const int EGL_RED_SIZE_DEFAULT = 8; - -/** - * Egl green size default. - */ -const int EGL_GREEN_SIZE_DEFAULT = 8; - -/** - * Egl blue size default. - */ -const int EGL_BLUE_SIZE_DEFAULT = 8; - -/** - * Egl alpha size default. - */ -const int EGL_ALPHA_SIZE_DEFAULT = 8; - -/** - * Default x position. - */ -const int DEFAULT_X_POSITION = 0; - -/** - * Default y position. - */ -const int DEFAULT_Y_POSITION = 0; - -/** - * Gl red default. - */ -const GLfloat GL_RED_DEFAULT = 0.0; - -/** - * Gl green default. - */ -const GLfloat GL_GREEN_DEFAULT = 0.0; - -/** - * Gl blue default. - */ -const GLfloat GL_BLUE_DEFAULT = 0.0; - -/** - * Gl alpha default. - */ -const GLfloat GL_ALPHA_DEFAULT = 1.0; - -/** - * Program error. - */ -const GLuint PROGRAM_ERROR = 0; - -/** - * Shape vertices size. - */ -const int SHAPE_VERTICES_SIZE = 8; - -/** - * Position handle name. - */ -const char POSITION_NAME[] = "a_position"; - -/** - * Position error. - */ -const GLint POSITION_ERROR = -1; - -/** - * Config attribute list. - */ -const EGLint ATTRIB_LIST[] = { - // Key,value. - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RED_SIZE, EGL_RED_SIZE_DEFAULT, - EGL_GREEN_SIZE, EGL_GREEN_SIZE_DEFAULT, - EGL_BLUE_SIZE, EGL_BLUE_SIZE_DEFAULT, - EGL_ALPHA_SIZE, EGL_ALPHA_SIZE_DEFAULT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - // End. - EGL_NONE}; - -/** - * Context attributes. - */ -const EGLint CONTEXT_ATTRIBS[] = { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE}; -} // namespace -bool EGLCore::EglContextInit(void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "EglContextInit execute"); - eglWindow_ = static_cast(window); - - // Init display. - eglDisplay_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (eglDisplay_ == EGL_NO_DISPLAY) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglGetDisplay: unable to get EGL display"); - return false; - } - - EGLint majorVersion; - EGLint minorVersion; - if (!eglInitialize(eglDisplay_, &majorVersion, &minorVersion)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglInitialize: unable to get initialize EGL display"); - return false; - } - - // Select configuration. - const EGLint maxConfigSize = 1; - EGLint numConfigs; - if (!eglChooseConfig(eglDisplay_, ATTRIB_LIST, &eglConfig_, maxConfigSize, &numConfigs)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglChooseConfig: unable to choose configs"); - return false; - } - - return CreateEnvironment(); -} - -bool EGLCore::CreateEnvironment() -{ - // Create surface. - if (eglWindow_ == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglWindow_ is null"); - return false; - } - eglSurface_ = eglCreateWindowSurface(eglDisplay_, eglConfig_, eglWindow_, NULL); - if (eglSurface_ == nullptr) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglCreateWindowSurface: unable to create surface"); - return false; - } - // Create context. - eglContext_ = eglCreateContext(eglDisplay_, eglConfig_, EGL_NO_CONTEXT, CONTEXT_ATTRIBS); - if (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglMakeCurrent failed"); - return false; - } - // Create program. - program_ = CreateProgram(VERTEX_SHADER, FRAGMENT_SHADER); - if (program_ == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "CreateProgram: unable to create program"); - return false; - } - return true; -} - -void EGLCore::Background() -{ - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Background get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, - BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Background execute draw failed"); - return; - } - - if (!FinishDraw()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Background FinishDraw failed"); - return; - } -} - -void EGLCore::Draw(int& hasDraw) -{ - flag_ = false; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "Draw"); - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, - BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw background failed"); - return; - } - - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices - GLfloat rotateX = 0; - GLfloat rotateY = FIFTY_PERCENT * height_; - GLfloat centerX = 0; - // Convert DEG(54° & 18°) to RAD - GLfloat centerY = -rotateY * (M_PI / 180 * 54) * (M_PI / 180 * 18); - // Convert DEG(18°) to RAD - GLfloat leftX = -rotateY * (M_PI / 180 * 18); - GLfloat leftY = 0; - // Convert DEG(18°) to RAD - GLfloat rightX = rotateY * (M_PI / 180 * 18); - GLfloat rightY = 0; - - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawStar(position, DRAW_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - - // Convert DEG(72°) to RAD - GLfloat rad = M_PI / 180 * 72; - // Rotate four times - for (int i = 0; i < NUM_4; ++i) { - Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); - Rotate2d(centerX, centerY, &leftX, &leftY, rad); - Rotate2d(centerX, centerY, &rightX, &rightY, rad); - - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawStar(position, DRAW_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - } - - if (!FinishDraw()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw FinishDraw failed"); - return; - } - hasDraw = 1; - - flag_ = true; -} - -void EGLCore::ChangeColor(int& hasChangeColor) -{ - if (!flag_) { - return; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor"); - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, - BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor execute draw background failed"); - return; - } - - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices - GLfloat rotateX = 0; - GLfloat rotateY = FIFTY_PERCENT * height_; - GLfloat centerX = 0; - // Convert DEG(54° & 18°) to RAD - GLfloat centerY = -rotateY * (M_PI / 180 * 54) * (M_PI / 180 * 18); - // Convert DEG(18°) to RAD - GLfloat leftX = -rotateY * (M_PI / 180 * 18); - GLfloat leftY = 0; - // Convert DEG(18°) to RAD - GLfloat rightX = rotateY * (M_PI / 180 * 18); - GLfloat rightY = 0; - - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawNewStar(0, CHANGE_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - - // Convert DEG(72°) to RAD - GLfloat rad = M_PI / 180 * 72; - // Rotate four times - for (int i = 0; i < NUM_4; ++i) { - Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); - Rotate2d(centerX, centerY, &leftX, &leftY, rad); - Rotate2d(centerX, centerY, &rightX, &rightY, rad); - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawNewStar(position, CHANGE_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - } - - if (!FinishDraw()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor FinishDraw failed"); - } - hasChangeColor = 1; -} - -GLint EGLCore::PrepareDraw() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (eglContext_ == nullptr) || - (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "PrepareDraw: param error"); - return POSITION_ERROR; - } - - // The gl function has no return value. - glViewport(DEFAULT_X_POSITION, DEFAULT_Y_POSITION, width_, height_); - glClearColor(GL_RED_DEFAULT, GL_GREEN_DEFAULT, GL_BLUE_DEFAULT, GL_ALPHA_DEFAULT); - glClear(GL_COLOR_BUFFER_BIT); - glUseProgram(program_); - - return glGetAttribLocation(program_, POSITION_NAME); -} - -bool EGLCore::ExecuteDraw(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) -{ - if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glEnableVertexAttribArray(position); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - - return true; -} - -bool EGLCore::ExecuteDrawStar( - GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) -{ - if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glVertexAttribPointer(1, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, color); - glEnableVertexAttribArray(position); - glEnableVertexAttribArray(1); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - glDisableVertexAttribArray(1); - - return true; -} - -bool EGLCore::ExecuteDrawNewStar( - GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) -{ - if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glEnableVertexAttribArray(position); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - - return true; -} - -void EGLCore::Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat* rotateX, GLfloat* rotateY, GLfloat theta) -{ - GLfloat tempX = cos(theta) * (*rotateX - centerX) - sin(theta) * (*rotateY - centerY); - GLfloat tempY = sin(theta) * (*rotateX - centerX) + cos(theta) * (*rotateY - centerY); - *rotateX = tempX + centerX; - *rotateY = tempY + centerY; -} - -bool EGLCore::FinishDraw() -{ - // The gl function has no return value. - glFlush(); - glFinish(); - return eglSwapBuffers(eglDisplay_, eglSurface_); -} - -GLuint EGLCore::LoadShader(GLenum type, const char* shaderSrc) -{ - if ((type <= 0) || (shaderSrc == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCreateShader type or shaderSrc error"); - return PROGRAM_ERROR; - } - - GLuint shader = glCreateShader(type); - if (shader == 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCreateShader unable to load shader"); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glShaderSource(shader, 1, &shaderSrc, nullptr); - glCompileShader(shader); - - GLint compiled; - glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); - if (compiled != 0) { - return shader; - } - - GLint infoLen = 0; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen <= 1) { - glDeleteShader(shader); - return PROGRAM_ERROR; - } - - char* infoLog = (char*)malloc(sizeof(char) * (infoLen + 1)); - if (infoLog != nullptr) { - memset(infoLog, 0, infoLen + 1); - glGetShaderInfoLog(shader, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCompileShader error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(shader); - return PROGRAM_ERROR; -} - -GLuint EGLCore::CreateProgram(const char* vertexShader, const char* fragShader) -{ - if ((vertexShader == nullptr) || (fragShader == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram: vertexShader or fragShader is null"); - return PROGRAM_ERROR; - } - - GLuint vertex = LoadShader(GL_VERTEX_SHADER, vertexShader); - if (vertex == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram vertex error"); - return PROGRAM_ERROR; - } - - GLuint fragment = LoadShader(GL_FRAGMENT_SHADER, fragShader); - if (fragment == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram fragment error"); - return PROGRAM_ERROR; - } - - GLuint program = glCreateProgram(); - if (program == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram program error"); - glDeleteShader(vertex); - glDeleteShader(fragment); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glAttachShader(program, vertex); - glAttachShader(program, fragment); - glLinkProgram(program); - - GLint linked; - glGetProgramiv(program, GL_LINK_STATUS, &linked); - if (linked != 0) { - glDeleteShader(vertex); - glDeleteShader(fragment); - return program; - } - - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram linked error"); - GLint infoLen = 0; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen > 1) { - char* infoLog = (char*)malloc(sizeof(char) * (infoLen + 1)); - memset(infoLog, 0, infoLen + 1); - glGetProgramInfoLog(program, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glLinkProgram error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(vertex); - glDeleteShader(fragment); - glDeleteProgram(program); - return PROGRAM_ERROR; -} - -void EGLCore::UpdateSize(int width, int height) -{ - width_ = width; - height_ = height; - if (width_ > 0) { - widthPercent_ = FIFTY_PERCENT * height_ / width_; - } -} - -void EGLCore::Release() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (!eglDestroySurface(eglDisplay_, eglSurface_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroySurface failed"); - } - - if ((eglDisplay_ == nullptr) || (eglContext_ == nullptr) || (!eglDestroyContext(eglDisplay_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroyContext failed"); - } - - if ((eglDisplay_ == nullptr) || (!eglTerminate(eglDisplay_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglTerminate failed"); - } -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/egl_core.h b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/egl_core.h deleted file mode 100644 index 0f25ca0ccfea46959dba9161f1c6abf064904209..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/egl_core.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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. - */ -#ifndef NATIVE_XCOMPONENT_EGL_CORE_H -#define NATIVE_XCOMPONENT_EGL_CORE_H - -#include -#include -#include - -namespace NativeXComponentSample { -class EGLCore { -public: - explicit EGLCore() {}; - ~EGLCore() {} - bool EglContextInit(void* window); - bool CreateEnvironment(); - void Draw(int& hasDraw); - void Background(); - void ChangeColor(int& hasChangeColor); - void Release(); - void UpdateSize(int width, int height); - -private: - GLuint LoadShader(GLenum type, const char* shaderSrc); - GLuint CreateProgram(const char* vertexShader, const char* fragShader); - GLint PrepareDraw(); - bool ExecuteDraw(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize); - bool ExecuteDrawStar(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize); - bool ExecuteDrawNewStar(GLint position, const GLfloat* color, - const GLfloat shapeVertices[], unsigned long vertSize); - void Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat* rotateX, GLfloat* rotateY, GLfloat theta); - bool FinishDraw(); - -private: - EGLNativeWindowType eglWindow_; - EGLDisplay eglDisplay_ = EGL_NO_DISPLAY; - EGLConfig eglConfig_ = EGL_NO_CONFIG_KHR; - EGLSurface eglSurface_ = EGL_NO_SURFACE; - EGLContext eglContext_ = EGL_NO_CONTEXT; - GLuint program_; - bool flag_ = false; - int width_; - int height_; - GLfloat widthPercent_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_EGL_CORE_H diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/plugin_render.cpp b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/plugin_render.cpp deleted file mode 100644 index c19c5f4b990666b8eda3ddd2771ddd4fb510cd9d..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/plugin_render.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ - -#include -#include -#include "plugin_render.h" - -namespace NativeXComponentSample { - -PluginRender::PluginRender(int64_t& id) -{ - this->id_ = id; - this->eglCore_ = new EGLCore(); - hasDraw_ = 0; - hasChangeColor_ = 0; -} - -void PluginRender::ChangeColor() -{ - eglCore_->ChangeColor(hasChangeColor_); -} - -void PluginRender::DrawPattern() -{ - eglCore_->Draw(hasDraw_); -} - -void PluginRender::InitNativeWindow(OHNativeWindow *window) -{ - eglCore_->EglContextInit(window); -} - -void PluginRender::UpdateNativeWindowSize(int width, int height) -{ - eglCore_->UpdateSize(width, height); - if (!hasChangeColor_ && !hasDraw_) { - eglCore_->Background(); - } -} - -int32_t PluginRender::HasDraw() -{ - return hasDraw_; -} - -int32_t PluginRender::HasChangedColor() -{ - return hasChangeColor_; -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/plugin_render.h b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/plugin_render.h deleted file mode 100644 index 16cffcd7a35264f127b1544bd94f5db9d0dcfa23..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/render/plugin_render.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ -#ifndef NATIVE_XCOMPONENT_PLUGIN_RENDER_H -#define NATIVE_XCOMPONENT_PLUGIN_RENDER_H - -#include -#include -#include "egl_core.h" - -namespace NativeXComponentSample { -class PluginRender { -public: - explicit PluginRender(int64_t& id); - ~PluginRender() - { - if (eglCore_ != nullptr) { - eglCore_->Release(); - delete eglCore_; - eglCore_ = nullptr; - } - } - void ChangeColor(); - void DrawPattern(); - int32_t HasDraw(); - int32_t HasChangedColor(); - void InitNativeWindow(OHNativeWindow* window); - void UpdateNativeWindowSize(int width, int height); -private: - EGLCore* eglCore_; - int64_t id_; - int32_t hasDraw_; - int32_t hasChangeColor_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_RENDER_H diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/types/libnativerender/Index.d.ts b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/types/libnativerender/Index.d.ts deleted file mode 100644 index e5bed9410ed867df3bc3131af1db29c969e6b652..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/types/libnativerender/Index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ -type XComponentContextStatus = { - hasDraw: boolean, - hasChangeColor: boolean, -}; -export const SetSurfaceId: (id: BigInt) => any; -export const ChangeSurface: (id: BigInt, w: number, h: number) =>any; -export const DrawPattern: (id: BigInt) => any; -export const GetXComponentStatus: (id: BigInt) => XComponentContextStatus -export const ChangeColor: (id: BigInt) => any; -export const DestroySurface: (id: BigInt) => any; diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/types/libnativerender/oh-package.json5 b/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/types/libnativerender/oh-package.json5 deleted file mode 100644 index f66d915ed293f4db1248f1c46aaf10ff0a7c7b34..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/cpp/types/libnativerender/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libnativerender.so", - "types": "./Index.d.ts", - "version": "", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/ArkTSXComponent/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 30e8936fcd5927a4e8934503305318b68c2049ae..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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/ArkUIKit/ArkTSXComponent/entry/src/main/ets/pages/Index.ets b/ArkUIKit/ArkTSXComponent/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 9336b63caa78480bf773b11bc3853ccce67f1633..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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 nativeRender from 'libnativerender.so'; - -class MyXComponentController extends XComponentController{ - onSurfaceCreated(surfaceId: string): void { - console.log(`onSurfaceCreated surfaceId: ${surfaceId}`); - nativeRender.SetSurfaceId(BigInt(surfaceId)); - } - onSurfaceChanged(surfaceId: string, rect: SurfaceRect): void { - console.log(`onSurfaceChanged surfaceId: ${surfaceId}, rect: ${JSON.stringify(rect)}}`); - nativeRender.ChangeSurface(BigInt(surfaceId), rect.surfaceWidth, rect.surfaceHeight); - } - onSurfaceDestroyed(surfaceId: string): void { - console.log(`onSurfaceDestroyed surfaceId: ${surfaceId}`); - nativeRender.DestroySurface(BigInt(surfaceId)); - } -} - -@Entry -@Component -struct Index { - @State currentStatus: string = "index"; - xComponentController: XComponentController = new MyXComponentController(); - build() { - Column() { - Row() { - Text('Native XComponent Sample') - .fontSize('24fp') - .fontWeight(500) - .margin({ - left: 24, - top: 12 - }) - } - .margin({ top: 24 }) - .width('100%') - .height(56) - - Column({ space: 10 }) { - XComponent({ - type: XComponentType.SURFACE, - controller: this.xComponentController - }) - Text(this.currentStatus) - .fontSize('24fp') - .fontWeight(500) - } - .onClick(() => { - let surfaceId = this.xComponentController.getXComponentSurfaceId(); - nativeRender.ChangeColor(BigInt(surfaceId)); - let hasChangeColor: boolean = false; - if (nativeRender.GetXComponentStatus(BigInt(surfaceId))) { - hasChangeColor = nativeRender.GetXComponentStatus(BigInt(surfaceId)).hasChangeColor; - } - if (hasChangeColor) { - this.currentStatus = "change color"; - } - }) - .margin({ - top: 27, - left: 12, - right: 12 - }) - .height('40%') - .width('90%') - Row() { - Button('Draw Star') - .fontSize('16fp') - .fontWeight(500) - .margin({ bottom: 24 }) - .onClick(() => { - let surfaceId = this.xComponentController.getXComponentSurfaceId(); - nativeRender.DrawPattern(BigInt(surfaceId)); - let hasDraw: boolean = false; - if (nativeRender.GetXComponentStatus(BigInt(surfaceId))) { - hasDraw = nativeRender.GetXComponentStatus(BigInt(surfaceId)).hasDraw; - } - if (hasDraw) { - this.currentStatus = "draw star"; - } - }) - .width('53.6%') - .height(40) - } - .width('100%') - .justifyContent(FlexAlign.Center) - .alignItems(VerticalAlign.Bottom) - .layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/module.json5 b/ArkUIKit/ArkTSXComponent/entry/src/main/module.json5 deleted file mode 100644 index cc3a198956886aaf2e02f2f228c8d6391ff52241..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/module.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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": [ - "phone", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/element/color.json b/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/element/string.json b/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/media/icon.png b/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/ArkTSXComponent/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/ArkTSXComponent/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 585a000d65aaf0cc128e3e9edde5d7bbd9cb7d88..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 '@ohos.hilog'; -import TestRunner from '@ohos.application.testRunner'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -let abilityDelegator = undefined; -let abilityDelegatorArguments = undefined; - -async function onAbilityCreateCallback() { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); - let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; - let debug = abilityDelegatorArguments.parameters['-D']; - if (debug == 'true') { - cmd += ' -D'; - } - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }); - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index e790e436bfe740d121e5b33d150ef2ab22da6158..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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 abilityTest from './XComponentAbility.test' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/test/XComponentAbility.test.ets b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/test/XComponentAbility.test.ets deleted file mode 100644 index 2333f3d3d3e135201d1345c2f6defdd21e36f6c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/test/XComponentAbility.test.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { describe, it, expect } from '@ohos/hypium'; -import { Driver, ON } from '@ohos.UiTest'; - -const TAG = '[Sample_NDK_XComponent]'; - -export default function abilityTest() { - - describe('ActsAbilityTest', () => { - /** - * 打开应用 - */ - it('StartAbility_001', 0, async (done: Function) => { - console.info(TAG, 'StartAbility_001 begin'); - let driver = Driver.create(); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - try { - await abilityDelegator.startAbility({ - bundleName: 'com.sample.xcomponent', - abilityName: 'EntryAbility' - }); - } catch (exception) { - console.info(TAG, `StartAbility_001 exception = ${JSON.stringify(exception)}`); - expect().assertFail(); - } - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('Draw Star')); - done(); - console.info(TAG, 'StartAbility_001 end'); - }) - - /** - * 点击按钮,绘制图形,之后点击XComponent改变颜色 - */ - it('DrawShape_001', 2, async () => { - console.info(TAG, 'CreateFiles_001 begin'); - let driver = Driver.create(); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('index')); - // 判断是否有按键 - await driver.assertComponentExist(ON.text('Draw Star')); - let drawStarBtn = await driver.findComponent(ON.text('Draw Star')); - // 点击'Draw Star'按钮 - await drawStarBtn.click(); - await driver.delayMs(1000); - // 判断drawPattern方法已执行 - await driver.assertComponentExist(ON.text('draw star')); - - // 判断是否有XComponent组件 - let xcomponent = await driver.findComponent(ON.id('xcomponent')); - // 点击XComponent组件 - await xcomponent.click(); - await driver.delayMs(1000); - // 判断touch回调已执行 - await driver.assertComponentExist(ON.text('change color')); - console.info(TAG, 'DrawShape_001 end'); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/testability/TestAbility.ets b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index 41857cadc2b07849a89d6cda4fdccd0c6ee23589..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 UIAbility from '@ohos.app.ability.UIAbility'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import hilog from '@ohos.hilog'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; -import window from '@ohos.window'; -import Want from '@ohos.app.ability.Want'; -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; - -export default class TestAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs = AbilityDelegatorRegistry.getArguments(); - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - 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. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/testability/pages/Index.ets b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index 5991a3ef4b41ec78e4977a7d65d84a589ee1eb20..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 '@ohos.hilog'; - -@Entry -@Component -struct Index { - aboutToAppear() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); - } - - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - } - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(() => { - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/module.json5 b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/module.json5 deleted file mode 100644 index a7685a59ea27672ae8074c984c4699bd73f36a5b..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/element/color.json b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/element/string.json b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/media/icon.png b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/profile/test_pages.json b/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/ArkUIKit/ArkTSXComponent/hvigor/hvigor-config.json5 b/ArkUIKit/ArkTSXComponent/hvigor/hvigor-config.json5 deleted file mode 100644 index 9b4f0fca99368e3cd711b6cb4b45c083cc6b3e06..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */ - // "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": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */ - } -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/hvigorfile.ts b/ArkUIKit/ArkTSXComponent/hvigorfile.ts deleted file mode 100644 index f3cb9f1a87a81687554a76283af8df27d8bda775..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/ArkUIKit/ArkTSXComponent/oh-package.json5 b/ArkUIKit/ArkTSXComponent/oh-package.json5 deleted file mode 100644 index 699504ce5f1b6eabe030897b5c38f3ad77c4c5a3..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/oh-package.json5 +++ /dev/null @@ -1,15 +0,0 @@ -{ - "modelVersion": "5.0.0", - "name": "ndkxcomponentv2", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.16", - "@ohos/hamock": "1.0.0" - } -} \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/ohosTest.md b/ArkUIKit/ArkTSXComponent/ohosTest.md deleted file mode 100644 index 5469eacbec87545aec4cfaa42c141af8859124e1..0000000000000000000000000000000000000000 --- a/ArkUIKit/ArkTSXComponent/ohosTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# NdkXComponent 测试用例归档 - -## 用例表 - -|测试功能|预置条件|输入|预期输出|是否自动|测试结果| -|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------| -| 拉起应用 | 设备正常运行 | |成功拉起应用|是| Pass | -| 绘制图形 | 位于首页 | 1、点击**Draw Star** | 1、页面显示出一个五角星 | 是 | Pass | -| 响应触摸事件 | 位于首页,且已经显示了五角星 | 1、点击XComponent区域(灰色背景部分) | 1、页面中的五角星改变颜色 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/ArkTSXComponent/screenshots/device/changeColor.png b/ArkUIKit/ArkTSXComponent/screenshots/device/changeColor.png deleted file mode 100644 index 07586fceb2d038482dd984b921a7c80871824bb8..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ArkTSXComponent/screenshots/device/changeColor.png and /dev/null differ diff --git a/ArkUIKit/ArkTSXComponent/screenshots/device/drawStar.png b/ArkUIKit/ArkTSXComponent/screenshots/device/drawStar.png deleted file mode 100644 index e8be339ee8a16dae2c1ce350747f8e1f09782692..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ArkTSXComponent/screenshots/device/drawStar.png and /dev/null differ diff --git a/ArkUIKit/ArkTSXComponent/screenshots/device/main.png b/ArkUIKit/ArkTSXComponent/screenshots/device/main.png deleted file mode 100644 index a51df8c9cf759098882721219d5c9f4b5acfb0c8..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ArkTSXComponent/screenshots/device/main.png and /dev/null differ diff --git a/ArkUIKit/CoastingAxisEventNDK/.gitignore b/ArkUIKit/CoastingAxisEventNDK/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/CoastingAxisEventNDK/AppScope/app.json5 b/ArkUIKit/CoastingAxisEventNDK/AppScope/app.json5 deleted file mode 100644 index 5a4df3eacd42f1b97583907421f857705f328655..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.coastingaxiseventndk", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/element/string.json b/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/element/string.json deleted file mode 100644 index dfa5ba62951f8a8813f60edbaf595f5986a46947..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "CoastingAxisEventNDK" - } - ] -} diff --git a/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/media/background.png b/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/media/foreground.png b/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/media/layered_image.json b/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/README.md b/ArkUIKit/CoastingAxisEventNDK/README.md deleted file mode 100644 index 4f67f5ccaa89e39a5d87a6b686def7a3c56b4917..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# CoastingAxisEventNDK - -## 介绍 - -本示例通过使用[ArkUI指南文档](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/reference)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [输入事件开发指导](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-ui-input-event-h.md)。 - -本示例展示了如何注册监听和使用惯性滚动轴事件接口。通过惯性轴事件相关接口,在双指抛滑离开触控板时,让滚动类容器继续惯性滚动。 - -## 效果预览 - -| 预览 | -| -------------------------------------------- | - - -## 使用说明 -1. 安装编译生成的hap包,并打开应用; -2. 双指在触摸板上抛滑; - - -## 工程目录 - -``` -CoastingAxisEventNDK -entry/src/main/ets/ -└── pages - ├── common - │ └── icon.svg - └── Index.ets (应用主页面) -entry/src/main/ -├── cpp -│ ├── types -│ │ └── libentry -│ │ └── Index.d.ts (NDK函数对应的js映射) -│ ├── CMakeLists.txt (CMake脚本) -| ├── manager.cpp (创建文本实现CPP文件) -| ├── manager.h -│ └── napi_init.cpp (NDK函数) -``` - -## 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束和限制 - -1. 本示例支持标准系统上运行,支持设备:RK3568; - -2. 本示例支持API22版本SDK,版本号:6.0.2.53; - -3. 本示例已支持使DevEco Studio 5.0.5 Release (构建版本:5.0.13.220,构建 2025年7月22日)编译运行 - -## 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/CoastingAxisEventNDK > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/build-profile.json5 b/ArkUIKit/CoastingAxisEventNDK/build-profile.json5 deleted file mode 100644 index d0201328a158e954273d3b660d2df8c8d41006ea..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": 20, - "compatibleSdkVersion": 20, - "compileSdkVersion": 20, - "runtimeOS": "OpenHarmony", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/code-linter.json5 b/ArkUIKit/CoastingAxisEventNDK/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/.gitignore b/ArkUIKit/CoastingAxisEventNDK/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/build-profile.json5 b/ArkUIKit/CoastingAxisEventNDK/entry/build-profile.json5 deleted file mode 100644 index b6d841509d3d85babd136cde8d09281bbe392c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "armeabi-v7a", - "arm64-v8a", - "x86_64" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/hvigorfile.ts b/ArkUIKit/CoastingAxisEventNDK/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/obfuscation-rules.txt b/ArkUIKit/CoastingAxisEventNDK/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/CoastingAxisEventNDK/entry/oh-package.json5 b/ArkUIKit/CoastingAxisEventNDK/entry/oh-package.json5 deleted file mode 100644 index 5d993e5251fd56950970aa593aefef1b8d71e976..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 86eda15caf5a47036e66bc4a3f1a0aa7c1b86b13..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(CoastingAxisEventNDK) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp manager.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libace_ndk.z.so libhilog_ndk.z.so) \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/manager.cpp b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/manager.cpp deleted file mode 100644 index 7a58c5a1bcc6708953288a9cb47bdfc15593f529..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include - -#include "manager.h" - -namespace NativeXComponentSample { -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; -static ArkUI_NativeNodeAPI_1* nativeModule_ = nullptr; -double g_px2vp = 0; - -const std::vector staticContacts = { - { "A", { Contact("Alice"), Contact("Alan"), Contact("Amy"), Contact("Andy"), Contact("Anna") } }, - { "B", - { Contact("Bob"), Contact("Betty"), Contact("Bruce"), Contact("Bella"), Contact("Brian"), Contact("Blake") } }, - { "C", { Contact("Charlie"), Contact("Cindy"), Contact("Chris"), Contact("Clara"), Contact("Carter") } }, - { "D", { Contact("David"), Contact("Diana"), Contact("Dan"), Contact("Daisy"), Contact("Duke"), Contact("Dora") } }, - { "E", { Contact("Emma"), Contact("Eric"), Contact("Eva"), Contact("Ethan"), Contact("Elise") } }, - { "F", - { Contact("Frank"), Contact("Fiona"), Contact("Felix"), Contact("Faith"), Contact("Flora"), Contact("Fred") } }, - { "G", { Contact("George"), Contact("Grace"), Contact("Gary"), Contact("Gina"), Contact("Gavin") } }, - { "H", - { Contact("Helen"), Contact("Henry"), Contact("Hank"), Contact("Hazel"), Contact("Hugo"), Contact("Holly") } }, - { "I", { Contact("Ivy"), Contact("Ian"), Contact("Iris"), Contact("Ivan"), Contact("Isla") } }, - { "J", { Contact("John"), Contact("Jane"), Contact("Jack"), Contact("Jill"), Contact("James"), Contact("Julia") } }, - { "K", { Contact("Kevin"), Contact("Kate"), Contact("Kyle"), Contact("Karen"), Contact("Karl") } }, - { "L", { Contact("Lucy"), Contact("Leo"), Contact("Lily"), Contact("Luke"), Contact("Liam"), Contact("Luna") } }, - { "M", { Contact("Mike"), Contact("Mary"), Contact("Mark"), Contact("Mia"), Contact("Max") } }, - { "N", { Contact("Nancy"), Contact("Nick"), Contact("Nora"), Contact("Noah"), Contact("Nina"), Contact("Nate") } }, - { "O", { Contact("Olivia"), Contact("Oscar"), Contact("Olive"), Contact("Owen"), Contact("Opal") } }, - { "P", { Contact("Peter"), Contact("Paula"), Contact("Paul"), Contact("Pam"), Contact("Phil"), Contact("Piper") } }, - { "Q", { Contact("Quinn"), Contact("Quentin"), Contact("Queen"), Contact("Quincy"), Contact("Quella") } }, - { "R", { Contact("Robert"), Contact("Rose"), Contact("Ryan"), Contact("Ruth"), Contact("Roy"), Contact("Rex") } }, - { "S", { Contact("Sarah"), Contact("Sam"), Contact("Steve"), Contact("Sue"), Contact("Sean") } }, - { "T", { Contact("Tom"), Contact("Tina"), Contact("Tim"), Contact("Tara"), Contact("Ted"), Contact("Troy") } }, - { "U", { Contact("Uma"), Contact("Ulysses"), Contact("Uriah"), Contact("Ulric"), Contact("Ula") } }, - { "V", - { Contact("Victor"), Contact("Vera"), Contact("Vince"), Contact("Violet"), Contact("Van"), Contact("Vicky") } }, - { "W", { Contact("William"), Contact("Wendy"), Contact("Wayne"), Contact("Willa"), Contact("Wade") } }, - { "X", { Contact("Xander"), Contact("Xena"), Contact("Xavier"), Contact("Xia"), Contact("Xerxes") } }, - { "Y", - { Contact("Yvonne"), Contact("Yves"), Contact("Yael"), Contact("Yuri"), Contact("Yolanda"), Contact("Yan") } }, - { "Z", { Contact("Zoe"), Contact("Zack"), Contact("Zara"), Contact("Zane"), Contact("Zelda") } } -}; - -NodeManager& NodeManager::GetInstance() -{ - static NodeManager instance; - return instance; -} - -void NodeManager::SetXComponent(OH_NativeXComponent* xComponent) -{ - xComponent_ = xComponent; -} - -void NodeManager::CreateNativeNode(double px2vp) -{ - if (!xComponent_ || px2vp == 0) { - return; - } - g_px2vp = px2vp; - nativeModule_ = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nativeModule_ == nullptr) { - return; - } - // 创建一个Column容器组件 - ArkUI_NodeHandle column = nativeModule_->createNode(ARKUI_NODE_COLUMN); - // 创建List - ArkUI_NodeHandle listNode = CreateList(); - nativeModule_->addChild(column, listNode); - // 为List注册惯性轴事件监听 - RegisterCoastingAxisEvent(listNode); - OH_NativeXComponent_AttachNativeRootNode(xComponent_, column); -} - -ArkUI_NodeHandle NodeManager::CreateList() -{ - ArkUI_NodeHandle listNode = nativeModule_->createNode(ARKUI_NODE_LIST); - ArkUI_NumberValue value[] = { { .i32 = ARKUI_STICKY_STYLE_HEADER } }; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(listNode, NODE_LIST_STICKY, &item); - for (const auto& group : staticContacts) { - auto groupNode = nativeModule_->createNode(ARKUI_NODE_LIST_ITEM_GROUP); - ArkUI_AttributeItem Item = { .object = CreateHeader(group.title) }; - nativeModule_->setAttribute(groupNode, NODE_LIST_ITEM_GROUP_SET_HEADER, &Item); - for (const auto& contact : group.contacts) { - auto listItem = CreateListItem(contact); - nativeModule_->addChild(groupNode, listItem); - } - nativeModule_->addChild(listNode, groupNode); - } - - return listNode; -} - -ArkUI_NodeHandle NodeManager::CreateListItem(const Contact& contact) -{ - auto listItem = nativeModule_->createNode(ARKUI_NODE_LIST_ITEM); - auto row = nativeModule_->createNode(ARKUI_NODE_ROW); - auto image = CreateListImage(contact.icon); - auto text = CreateListText(contact.name); - - ArkUI_NumberValue paddingValue[] = { { .f32 = 12 } }; - ArkUI_AttributeItem padding = { paddingValue, 1 }; - nativeModule_->setAttribute(row, NODE_PADDING, &padding); - - ArkUI_NumberValue alignValue[] = { { .i32 = ARKUI_VERTICAL_ALIGNMENT_CENTER } }; - ArkUI_AttributeItem align = { alignValue, 1 }; - nativeModule_->setAttribute(row, NODE_ROW_ALIGN_ITEMS, &align); - nativeModule_->addChild(row, image); - nativeModule_->addChild(row, text); - nativeModule_->addChild(listItem, row); - - return listItem; -} - -ArkUI_NodeHandle NodeManager::CreateListImage(std::string icon) -{ - auto image = nativeModule_->createNode(ARKUI_NODE_IMAGE); - ArkUI_AttributeItem item = { .string = icon.c_str() }; - nativeModule_->setAttribute(image, NODE_IMAGE_SRC, &item); - ArkUI_NumberValue value[] = { { .f32 = 40 } }; - ArkUI_AttributeItem height = { value, 1 }; - ArkUI_AttributeItem width = { value, 1 }; - nativeModule_->setAttribute(image, NODE_HEIGHT, &height); - nativeModule_->setAttribute(image, NODE_WIDTH, &width); - ArkUI_NumberValue radiusValue[] = { { .f32 = 20 } }; - ArkUI_AttributeItem radius = { radiusValue, 1 }; - nativeModule_->setAttribute(image, NODE_BORDER_RADIUS, &radius); - ArkUI_NumberValue marginValue[] = { { .f32 = 0 }, { .f32 = 17 }, { .f32 = 0 }, { .f32 = 0 } }; - ArkUI_AttributeItem margin = { marginValue, 4 }; - nativeModule_->setAttribute(image, NODE_MARGIN, &margin); - return image; -} - -ArkUI_NodeHandle NodeManager::CreateListText(std::string text) -{ - auto textNode = nativeModule_->createNode(ARKUI_NODE_TEXT); - ArkUI_AttributeItem str = { nullptr, 0, text.c_str() }; - nativeModule_->setAttribute(textNode, NODE_TEXT_CONTENT, &str); - ArkUI_NumberValue fontSizeValue[] = { { .f32 = 18 } }; - ArkUI_AttributeItem fontSize = { fontSizeValue, 1 }; - nativeModule_->setAttribute(textNode, NODE_FONT_SIZE, &fontSize); - return textNode; -} - -ArkUI_NodeHandle NodeManager::CreateHeader(const std::string& text) -{ - auto textNode = nativeModule_->createNode(ARKUI_NODE_TEXT); - ArkUI_AttributeItem str = { nullptr, 0, text.c_str() }; - nativeModule_->setAttribute(textNode, NODE_TEXT_CONTENT, &str); - - ArkUI_NumberValue fontSizeValue[] = { { .f32 = 20 } }; - ArkUI_AttributeItem fontSize = { fontSizeValue, 1 }; - nativeModule_->setAttribute(textNode, NODE_FONT_SIZE, &fontSize); - - ArkUI_NumberValue widthValue[] = { { .f32 = 100 } }; - ArkUI_AttributeItem width = { widthValue, 1 }; - nativeModule_->setAttribute(textNode, NODE_WIDTH_PERCENT, &width); - - ArkUI_NumberValue colorValue[] = { { .u32 = 0xfff1f3f5 } }; - ArkUI_AttributeItem color = { colorValue, 1 }; - nativeModule_->setAttribute(textNode, NODE_BACKGROUND_COLOR, &color); - - ArkUI_NumberValue paddingValue[] = { { .f32 = 5 } }; - ArkUI_AttributeItem padding = { paddingValue, 1 }; - nativeModule_->setAttribute(textNode, NODE_PADDING, &padding); - return textNode; -} - -void NodeManager::RegisterCoastingAxisEvent(ArkUI_NodeHandle node) -{ - nativeModule_->registerNodeEvent(node, NODE_ON_COASTING_AXIS_EVENT, 0, nullptr); - nativeModule_->registerNodeEvent(node, NODE_ON_AXIS, 0, nullptr); - nativeModule_->addNodeEventReceiver(node, [](ArkUI_NodeEvent* event) { - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - switch (eventType) { - case NODE_ON_COASTING_AXIS_EVENT: { - auto uiInputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); - auto handler = OH_ArkUI_NodeEvent_GetNodeHandle(event); - auto coastingAxisEvent = OH_ArkUI_UIInputEvent_GetCoastingAxisEvent(uiInputEvent); - auto time = OH_ArkUI_CoastingAxisEvent_GetEventTime(coastingAxisEvent); - auto phase = OH_ArkUI_CoastingAxisEvent_GetPhase(coastingAxisEvent); - auto deltaX = OH_ArkUI_CoastingAxisEvent_GetDeltaX(coastingAxisEvent); - auto deltaY = OH_ArkUI_CoastingAxisEvent_GetDeltaY(coastingAxisEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NODE_ON_COASTING_AXIS_EVENT", - "phase=%{public}d, deltaX=%{public}f, deltaY=%{public}f, " - "time=%{public}ld", - phase, deltaX, deltaY, time); - ArkUI_NumberValue scrollOffset[] = { { .f32 = static_cast(deltaX * g_px2vp) }, - { .f32 = static_cast(deltaY * g_px2vp) } }; - ArkUI_AttributeItem scrollOffsetItem = { scrollOffset, - sizeof(scrollOffset) / sizeof(ArkUI_NumberValue) }; - nativeModule_->setAttribute(handler, NODE_SCROLL_BY, &scrollOffsetItem); - break; - } - default: { - break; - } - } - }); -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/manager.h b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/manager.h deleted file mode 100644 index ccf13c9aaa4b4984d302bb5be783189dcc110a53..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef COASTING_AXIS_EVENT_MANAGER_H -#define COASTING_AXIS_EVENT_MANAGER_H - -#include -#include -#include - -namespace NativeXComponentSample { -struct Contact { - explicit Contact(std::string name) : name(name){}; - std::string name = ""; - std::string icon = "/pages/common/icon.svg"; -}; - -struct ContactsGroup { - std::string title = ""; - std::vector contacts = {}; -}; - -class NodeManager { -public: - ~NodeManager() = default; - static NodeManager &GetInstance(); - void SetXComponent(OH_NativeXComponent *xComponent); - void CreateNativeNode(double density); - -private: - NodeManager() = default; - ArkUI_NodeHandle CreateList(); - ArkUI_NodeHandle CreateListItem(const Contact &contact); - ArkUI_NodeHandle CreateHeader(const std::string &text); - ArkUI_NodeHandle CreateListText(std::string text); - ArkUI_NodeHandle CreateListImage(std::string icon); - void RegisterCoastingAxisEvent(ArkUI_NodeHandle node); - OH_NativeXComponent *xComponent_; -}; -} // namespace NativeXComponentSample - -#endif // COASTING_AXIS_EVENT_MANAGER_H diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index e966ca45a2771cb85528824e788f6e6a50fa7b40..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "manager.h" -#include -#include - -static OH_NativeXComponent* GetXComponent(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - return nullptr; - } - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - return nullptr; - } - OH_NativeXComponent* xComp = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&xComp)) != napi_ok) { - return nullptr; - } - return xComp; -} - -static napi_value createNativeNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value argv[1] = { nullptr }; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - napi_valuetype valueType = napi_undefined; - napi_typeof(env, argv[0], &valueType); - if (valueType != napi_number) { - return nullptr; - } - double px2vp; - napi_get_value_double(env, argv[0], &px2vp); - NativeXComponentSample::NodeManager::GetInstance().CreateNativeNode(px2vp); - return nullptr; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "createNativeNode", nullptr, createNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - auto xComponent = GetXComponent(env, exports); - if (xComponent) { - NativeXComponentSample::NodeManager::GetInstance().SetXComponent(xComponent); - } - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index a7a9b11e7271de2a9361933a08f51189b8872757..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const createNativeNode: (px2vp: number) => void; \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 846e4c7e13ead48abe6019bd40f3a13bf8f9c083..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 03de9ddeb4315b230a1965f1c50fd9f5e2024ef5..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1fca37ecc34e1079aaf6557f1272cd694aa0068c..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/pages/Index.ets b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 008c4b8d578de923fbac5bba3938413093d3d445..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so'; - -@Entry -@Component -struct Index { - build() { - Row() { - Column() { - XComponent({ - id: "coastingAxisEvent", - type: XComponentType.NODE, - libraryname: "entry" - }).onAppear(()=> { - nativeNode.createNativeNode(this.getUIContext().px2vp(1)) - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/pages/common/icon.svg b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/pages/common/icon.svg deleted file mode 100644 index 6329960c7aa012ff007c80af8d6e9b694ba85fd0..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/ets/pages/common/icon.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - error - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/module.json5 b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/module.json5 deleted file mode 100644 index 776ce01475229d674487a2830790c4c87b777379..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/element/color.json b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/element/float.json b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/element/string.json b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/background.png b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/dark/element/color.json b/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/mock/Libentry.mock.ets b/ArkUIKit/CoastingAxisEventNDK/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index eebf1ed910f6a8f2a9e7e565aa71b179b7b8b537..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/mock/mock-config.json5 b/ArkUIKit/CoastingAxisEventNDK/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 7c16bc08c6fb53175fcdc9d628a4d6a9b34bef4c..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import IndexTest from './index.test'; - -export default function testsuite() { - abilityTest(); - IndexTest(); -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/ets/test/index.test.ets b/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/ets/test/index.test.ets deleted file mode 100644 index e9bc0b9cf0c5de77a0464d48950c8e76316d8535..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/ets/test/index.test.ets +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect, beforeAll } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON, MatchPattern } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -export default function IndexTest() { - - describe('IndexTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - /** - * @tc.number UiTest_001 - * @tc.name testCoastingAxisEvent - * @tc.desc 测试惯性滚动轴事件基本用法 - */ - it('testCoastingAxisEvent', 0, async (done: Function) => { - console.info('uitest: testCoastingAxisEvent begin'); - let driver = Driver.create(); - let user = await driver.findComponent(ON.text('Alice', MatchPattern.CONTAINS)); - expect(user === null).assertFalse(); - await driver.fling({x: 500, y: 500}, {x: 200, y: 200}, 20, 4000); - user = await driver.findComponent(ON.text('Alice', MatchPattern.CONTAINS)); - expect(user === null).assertTrue(); - await driver.delayMs(1000); - console.info('uitest: testTapGesture end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/module.json5 b/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/module.json5 deleted file mode 100644 index 9983b2ba4e55e31a172f0328c82c9a75bfa00ded..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/test/List.test.ets b/ArkUIKit/CoastingAxisEventNDK/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/entry/src/test/LocalUnit.test.ets b/ArkUIKit/CoastingAxisEventNDK/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/hvigor/hvigor-config.json5 b/ArkUIKit/CoastingAxisEventNDK/hvigor/hvigor-config.json5 deleted file mode 100644 index 70879912169503ff02665211233887556b8f4ae8..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "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/ArkUIKit/CoastingAxisEventNDK/hvigorfile.ts b/ArkUIKit/CoastingAxisEventNDK/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/oh-package.json5 b/ArkUIKit/CoastingAxisEventNDK/oh-package.json5 deleted file mode 100644 index bb713889dcf243763a520796f6a8bd779efa08b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/CoastingAxisEventNDK/ohosTest.md b/ArkUIKit/CoastingAxisEventNDK/ohosTest.md deleted file mode 100644 index c560f98c8f647f0442319f996ea16f600e92445b..0000000000000000000000000000000000000000 --- a/ArkUIKit/CoastingAxisEventNDK/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# NdkGestureSetting 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------------- | -------------- |---------------------------------------|----------| :------- | -------- | -| 测试惯性滚动轴事件基本用法 | 在有触控板的设备上正常运行 | 鼠标放到应用上,双指在触控板上快速抛滑 | 应用列表可以在双指离开触控板后有惯性滚动效果 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/CoastingAxisEventNDK/screenshots/coasting_axis_event.png b/ArkUIKit/CoastingAxisEventNDK/screenshots/coasting_axis_event.png deleted file mode 100644 index 99db5ad3279be55b6de886e56d5a16d819b0499e..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/CoastingAxisEventNDK/screenshots/coasting_axis_event.png and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/.gitignore b/ArkUIKit/DrawableDescriptorSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/DrawableDescriptorSample/AppScope/app.json5 b/ArkUIKit/DrawableDescriptorSample/AppScope/app.json5 deleted file mode 100644 index 721059a8c9905e14398fa32f81c441aa1f460ebd..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.drawabledescriptorsample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/element/string.json b/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 2ada7e9ab48d78775263c744fe0bab677880f70d..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DrawableDescriptorSample" - } - ] -} diff --git a/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/media/background.png b/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/media/foreground.png b/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/media/layered_image.json b/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/README_zh.md b/ArkUIKit/DrawableDescriptorSample/README_zh.md deleted file mode 100644 index 9b08ea2a2a5dbd4cb442722efce6aee17c757550..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/README_zh.md +++ /dev/null @@ -1,81 +0,0 @@ -# ArkUI使用DrawableDescriptor指南文档示例 - -### 介绍 - -本示例通过使用[drawable_descriptor.h](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/capi-drawable-descriptor-h)中的接口,帮助开发者更好的理解并合理使用ArkUI提供的组件以及组件属性。该工程创建Image组件,入参类型为DrawableDescriptor,并可以设置duration、iteration属性。 - -### 效果预览 - -| 首页 | 设置属性 | -|-------------------------------------|-------------------------------------| -| ![](screenshots/device/image1.jpeg) | ![](screenshots/device/result.jpeg) | - -### 使用说明 - -1. 工程启动后,通过文本输入,设置属性值。 - -2. 在"设置duration"和"设置iteration"文本输入框中,分别输入属性值,其中duration为动图播放的播放时长,iteration为动图播放的次数。 - -3. 分别点击"设置",查看已设置的属性值。 - -4. 工程启动后,会自动加载图片并触发对OH_ArkUI_DrawableDescriptor_GetStaticPixelMap、OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArray、OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArraySize这几个接口的调用,若接口成功调用可以在DevEco Studio开发环境中的日志界面看到如下相关日志信息: -``` -"GetStaticPixelMap success" -"GetAnimatedPixelMapArray success" -"GetAnimatedPixelMapArraySize success" -``` - -5. 退出工程后,会自动调用OH_ArkUI_DrawableDescriptor_Dispose接口,若接口成功调用可以在DevEco Studio开发环境中的日志界面看到如下相关日志信息: -``` -"Dispose success" -``` - -### 工程目录 -``` -entry/src/main/cpp -|---CMakeLists.txt // 编译脚本 -|---napi_init.cpp // 实现资源创建、属性设置相关功能 -|---drawable_manager.cpp // 管理DrawableDescriptor节点 -|---types - |---Index.d.ts // 注册napi函数到ets层,供上层调用 -entry/src/main/ets/ -|---entryability -|---pages -| |---Index.ets // 应用主页面 -entry/src/ohosTest/ -|---ets -| |---index.test.ets // 示例代码测试代码 -``` - -### 具体实现 - -1. 在[Index.ets](entry%2Fsrc%2Fmain%2Fets%2Fpages%2FIndex.ets)文件中,通过文本输入框和"设置"按钮设置Image组件属性值。 -2. 在[Index.d.ts](entry%2Fsrc%2Fmain%2Fcpp%2Ftypes%2Flibentry%2FIndex.d.ts)文件中,注册napi函数到ets层。 -3. 在[napi_init.cpp](entry%2Fsrc%2Fmain%2Fcpp%2Fnapi_init.cpp)文件中,实现Index.d.ts中对外的接口。 -4. 在[drawable_manager.cpp](entry%2Fsrc%2Fmain%2Fcpp%2Fmanager.cpp)文件中,实现对DrawableDescriptor节点的保存、获取、删除功能。 - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例支持标准系统上运行, 支持设备:RK3568等。 - -2.本示例为Stage模型,支持API20版本SDK,版本号:6.0.0.47,镜像版本号:OpenHarmony_5.0.2.57。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUIDocSample/DrawableDescriptorSample > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/build-profile.json5 b/ArkUIKit/DrawableDescriptorSample/build-profile.json5 deleted file mode 100644 index 227897f0bf38773db8de92d51751c286a40cc10b..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - "signingConfigs": [ - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/code-linter.json5 b/ArkUIKit/DrawableDescriptorSample/code-linter.json5 deleted file mode 100644 index 5c4682f8164874ec7e9cb8f99ff8b3228ffbc126..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/code-linter.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/.gitignore b/ArkUIKit/DrawableDescriptorSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/build-profile.json5 b/ArkUIKit/DrawableDescriptorSample/entry/build-profile.json5 deleted file mode 100644 index bfeb27f07c5bb5a268082430be78c1c618f32371..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/build-profile.json5 +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a","x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/hvigorfile.ts b/ArkUIKit/DrawableDescriptorSample/entry/hvigorfile.ts deleted file mode 100644 index f8b117a17af3b2d7cb87a7680e29e2bb8ccd5b46..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/obfuscation-rules.txt b/ArkUIKit/DrawableDescriptorSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/DrawableDescriptorSample/entry/oh-package-lock.json5 b/ArkUIKit/DrawableDescriptorSample/entry/oh-package-lock.json5 deleted file mode 100644 index 05149e9a0799aca540bf4cd16ae71233319d991b..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/oh-package-lock.json5 +++ /dev/null @@ -1,19 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry" - }, - "packages": { - "libentry.so@src/main/cpp/types/libentry": { - "name": "libentry.so", - "version": "1.0.0", - "resolved": "", - "registryType": "local" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/oh-package.json5 b/ArkUIKit/DrawableDescriptorSample/entry/oh-package.json5 deleted file mode 100644 index 5b21e253af246edab8b6ef4f10938f4417e8bc25..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index a6e3e66004c8d6b281d02587371dd1439510cacc..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(DrawableDescriptorSample) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -find_library( - libace-lib - ace_ndk.z -) - -# 查找系统库 -find_library(ace_ndk_lib ace_ndk.z.so image_lib image.z.so) - -add_library(entry SHARED napi_init.cpp drawable_manager.cpp) -target_link_libraries(entry PUBLIC - ${libace-lib} - libace_napi.z.so - libpixelmap_ndk.z.so - libhilog_ndk.z.so - libimage_source.so - libpixelmap.so - libohresmgr.so - librawfile.z.so -) \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/drawable_manager.cpp b/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/drawable_manager.cpp deleted file mode 100644 index 2ddd6fdeba6b266b068586d8d4521ace90da392b..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/drawable_manager.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "drawable_manager.h" - -DrawableManager& DrawableManager::GetInstance() -{ - static DrawableManager instance; - return instance; -} - -DrawableManager::~DrawableManager() -{ - std::lock_guard lock(mutex_); - for (auto& pair : drawableMap_) { - if (pair.second != nullptr) { - OH_ArkUI_DrawableDescriptor_Dispose(pair.second); - } - } - drawableMap_.clear(); -} - -int32_t DrawableManager::AddDrawable(ArkUI_DrawableDescriptor* descriptor) -{ - if (descriptor == nullptr) { - return -1; - } - - std::lock_guard lock(mutex_); - int32_t id = nextId_++; - drawableMap_[id] = descriptor; - return id; -} - -ArkUI_DrawableDescriptor* DrawableManager::GetDrawable(int32_t id) -{ - std::lock_guard lock(mutex_); - auto it = drawableMap_.find(id); - if (it != drawableMap_.end()) { - return it->second; - } - return nullptr; -} - -void DrawableManager::RemoveDrawable(int32_t id) -{ - std::lock_guard lock(mutex_); - auto it = drawableMap_.find(id); - if (it != drawableMap_.end()) { - if (it->second != nullptr) { - OH_ArkUI_DrawableDescriptor_Dispose(it->second); - } - drawableMap_.erase(it); - } -} - \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/drawable_manager.h b/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/drawable_manager.h deleted file mode 100644 index 1b38d321ec53330c3883c5966120ba428c798c0e..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/drawable_manager.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef DRAWABLE_MANAGER_H -#define DRAWABLE_MANAGER_H - -#include -#include -#include - -class DrawableManager { -public: - static DrawableManager& GetInstance(); - - DrawableManager(const DrawableManager&) = delete; - DrawableManager& operator=(const DrawableManager&) = delete; - - int32_t AddDrawable(ArkUI_DrawableDescriptor* descriptor); - - ArkUI_DrawableDescriptor* GetDrawable(int32_t id); - - void RemoveDrawable(int32_t id); - -private: - DrawableManager() = default; - ~DrawableManager(); - - std::map drawableMap_; - std::mutex mutex_; - int32_t nextId_ = 1; -}; - -#endif // DRAWABLE_MANAGER_H - \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index f564a6b9bbad2316f42fe6d9de28abdeaa5229d2..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "drawable_manager.h" -#include "rawfile/raw_file_manager.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -enum class PixelMapFormat { RGBA_8888 = PIXEL_FORMAT_BGRA_8888 }; -class DecodingOptions { -public: - DecodingOptions() - { - OH_DecodingOptions *options; - OH_DecodingOptions_Create(&options); - options_ = options; - } - ~DecodingOptions() = default; - - void SetPixelFormat(PixelMapFormat format) - { - OH_DecodingOptions_SetPixelFormat(options_, static_cast(PixelMapFormat::RGBA_8888)); - } - - OH_DecodingOptions *GetNativePointer() { return options_; } - -private: - OH_DecodingOptions *options_; -}; - -struct PixelMaps { - OH_PixelmapNative** pixelMaps; - size_t size; -}; - -static ArkUI_NodeHandle mainPageScroll = nullptr; -static ArkUI_NativeNodeAPI_1* GetNodeApi() -{ - static ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - return nodeApi; -} - -static ArkUI_NodeHandle GetMainPageSroll() -{ - if (mainPageScroll == nullptr) { - ArkUI_NativeNodeAPI_1* nodeApi = GetNodeApi(); - mainPageScroll = nodeApi->createNode(ARKUI_NODE_SCROLL); - } - return mainPageScroll; -} - -// 从PixelMap创建DrawableDescriptor描述符 -static napi_value CreateFromPixelMap(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - void *temp = nullptr; - napi_unwrap(env, args[0], &temp); - OH_PixelmapNative *nativePixelMap = reinterpret_cast(temp); - - ArkUI_DrawableDescriptor *descriptor = OH_ArkUI_DrawableDescriptor_CreateFromPixelMap(nativePixelMap); - if (descriptor == nullptr) { - return nullptr; - } - - OH_PixelmapNative *newHandle = OH_ArkUI_DrawableDescriptor_GetStaticPixelMap(descriptor); - if (nativePixelMap == newHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "GetStaticPixelMap success"); - } - - int32_t imagePixelMapId = DrawableManager::GetInstance().AddDrawable(descriptor); - napi_value result; - napi_create_int32(env, imagePixelMapId, &result); - return result; -} - -// 从PixelMap创建DrawableDescriptor描述符 -static napi_value CreateFromAnimatedPixelMap(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - void *temp = nullptr; - napi_unwrap(env, args[0], &temp); - OH_PixelmapNative *nativePixelMapArray = reinterpret_cast(temp); - - int32_t size; - napi_get_value_int32(env, args[1], &size); - - ArkUI_DrawableDescriptor *descriptor = OH_ArkUI_DrawableDescriptor_CreateFromAnimatedPixelMap( - &nativePixelMapArray, size); - if (descriptor == nullptr) { - return nullptr; - } - - OH_PixelmapNativeHandle *newHandle = OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArray(descriptor); - if (nativePixelMapArray == *newHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "GetAnimatedPixelMapArray success"); - } - int32_t arraySize = OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArraySize(descriptor); - if (arraySize == size) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "GetAnimatedPixelMapArraySize success"); - } - - // 将DrawableDescriptor添加到管理器并获取资源ID - int32_t imagePixelMapId = DrawableManager::GetInstance().AddDrawable(descriptor); - DrawableManager::GetInstance().RemoveDrawable(imagePixelMapId); - return nullptr; -} - -// 释放DrawableDescriptor描述符 -static napi_value DisposeDrawable(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t imagePixelMapId; - napi_get_value_int32(env, args[0], &imagePixelMapId); - DrawableManager::GetInstance().RemoveDrawable(imagePixelMapId); - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "Dispose success"); - return nullptr; -} - -// 设置duration属性值 -static napi_value SetAnimationDuration(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t imagePixelMapId; - napi_get_value_int32(env, args[0], &imagePixelMapId); - int32_t duration; - napi_get_value_int32(env, args[1], &duration); - - ArkUI_DrawableDescriptor* descriptor = DrawableManager::GetInstance().GetDrawable(imagePixelMapId); - if (descriptor == nullptr) { - return nullptr; - } - OH_ArkUI_DrawableDescriptor_SetAnimationDuration(descriptor, duration); - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "---test SetAnimationDuration, %{public}d", duration); - return nullptr; -} - -// 获取duration属性值 -static napi_value GetAnimationDuration(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t imagePixelMapId; - napi_get_value_int32(env, args[0], &imagePixelMapId); - - ArkUI_DrawableDescriptor* descriptor = DrawableManager::GetInstance().GetDrawable(imagePixelMapId); - if (descriptor == nullptr) { - return nullptr; - } - - // 获取动画时长 - int32_t duration = OH_ArkUI_DrawableDescriptor_GetAnimationDuration(descriptor); - napi_value result; - napi_create_int32(env, duration, &result); - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "---test GetAnimationDuration, %{public}d", duration); - return result; -} - -// 设置iteration属性值 -static napi_value SetAnimationIteration(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t imagePixelMapId; - napi_get_value_int32(env, args[0], &imagePixelMapId); - int32_t iteration; - napi_get_value_int32(env, args[1], &iteration); - // 获取Drawable描述符 - ArkUI_DrawableDescriptor* descriptor = DrawableManager::GetInstance().GetDrawable(imagePixelMapId); - if (descriptor == nullptr) { - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "---test SetAnimationIteration, %{public}d", iteration); - OH_ArkUI_DrawableDescriptor_SetAnimationIteration(descriptor, iteration); - return nullptr; -} - -// 获取iteration属性值 -static napi_value GetAnimationIteration(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - // 解析参数 - int32_t imagePixelMapId; - napi_get_value_int32(env, args[0], &imagePixelMapId); - - ArkUI_DrawableDescriptor* descriptor = DrawableManager::GetInstance().GetDrawable(imagePixelMapId); - if (descriptor == nullptr) { - return nullptr; - } - int32_t iteration = OH_ArkUI_DrawableDescriptor_GetAnimationIteration(descriptor); - napi_value result; - napi_create_int32(env, iteration, &result); - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "---test GetAnimationIteration, %{public}d", iteration); - return result; -} - -PixelMaps CreatePixelMapList(OH_ImageSourceNative *source, DecodingOptions options) -{ - if (source == nullptr) { - return {nullptr, 0}; - } - uint32_t count = 0; - OH_ImageSourceNative_GetFrameCount(source, &count); - if (count <= 1) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "---test CreatePixelMapList failed, count = %{public}d", count); - return {nullptr, 0}; - } - OH_PixelmapNative **resPixMapList = new OH_PixelmapNative *[count]; - auto code = OH_ImageSourceNative_CreatePixelmapList(source, options.GetNativePointer(), resPixMapList, - static_cast(count)); - if (code != Image_ErrorCode::IMAGE_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "---test CreatePixelMapList failed, code = %{public}d", code); - delete[] resPixMapList; - return {nullptr, 0}; - } - PixelMaps maps; - maps.pixelMaps = resPixMapList; - maps.size = count; - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "---test CreatePixelMapList succ, count = %{public}d", count); - return maps; -} - -ArkUI_DrawableDescriptor* GetPixelMapArray(napi_env env, napi_callback_info info, size_t &size) -{ - size_t argc = 2; - napi_value argv[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - uint8_t *data = nullptr; - uint64_t dataLen = 0; - NativeResourceManager *mNativeResMgr = OH_ResourceManager_InitNativeResourceManager(env, argv[1]); - OH_ResourceManager_GetMediaByName(mNativeResMgr, "test1", &data, &dataLen); - - OH_ImageSourceNative *source = nullptr; - auto code = OH_ImageSourceNative_CreateFromData(data, dataLen, &source); - - DecodingOptions options; - PixelMaps maps = CreatePixelMapList(source, options); - - auto descriptor = OH_ArkUI_DrawableDescriptor_CreateFromAnimatedPixelMap(maps.pixelMaps, maps.size); - if (descriptor == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "---test CreateFromAnimatedPixelMap failed"); - } - size = maps.size; - return descriptor; -} - -static napi_value AddPixelMapArray(napi_env env, napi_callback_info info, ArkUI_NodeHandle sroll) -{ - ArkUI_NativeNodeAPI_1* nodeApi = GetNodeApi(); - size_t mapSize = 0; - ArkUI_DrawableDescriptor* pixelArrayDes = GetPixelMapArray(env, info, mapSize); - - ArkUI_NodeHandle imageNode = nodeApi->createNode(ARKUI_NODE_IMAGE); - ArkUI_AttributeItem item = {.object = pixelArrayDes}; - nodeApi->setAttribute(imageNode, NODE_IMAGE_SRC, &item); - nodeApi->addChild(sroll, imageNode); - - // 将DrawableDescriptor添加到管理器并获取资源ID - int32_t imagePixelMapId = DrawableManager::GetInstance().AddDrawable(pixelArrayDes); - napi_value result; - napi_create_int32(env, imagePixelMapId, &result); - return result; -} - -static napi_value CreateNodePage(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - return nullptr; - } - size_t argCnt = 2; - napi_value args[2] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "Drawable", "---test napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &nodeContentHandle); - ArkUI_NativeNodeAPI_1* nodeApi = GetNodeApi(); - if (nodeApi != nullptr) { - if (nodeApi->createNode != nullptr && nodeApi->addChild != nullptr) { - ArkUI_NodeHandle scrollNode = GetMainPageSroll(); - napi_value mapArrayId = AddPixelMapArray(env, info, scrollNode); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, scrollNode); - return mapArrayId; - } - } - return nullptr; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - // 注册Native方法到ArkTS - napi_property_descriptor desc[] = { - {"createFromPixelMap", nullptr, CreateFromPixelMap, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createFromAnimatedPixelMap", nullptr, CreateFromAnimatedPixelMap, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"disposeDrawable", nullptr, DisposeDrawable, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setAnimationDuration", nullptr, SetAnimationDuration, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"getAnimationDuration", nullptr, GetAnimationDuration, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setAnimationIteration", nullptr, SetAnimationIteration, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"getAnimationIteration", nullptr, GetAnimationIteration, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNodePage", nullptr, CreateNodePage, nullptr, nullptr, nullptr, napi_default, nullptr}, - }; - napi_define_properties(env, exports, sizeof(desc)/sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index c8e579c5b873c6bd91ba68b177e52ca67e32b549..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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 image from '@ohos.multimedia.image'; -import resourceManager from '@ohos.resourceManager'; - -export const createFromPixelMap: (pMap: image.PixelMap) => number; -export const createFromAnimatedPixelMap: (pMap: image.PixelMap, size: number) => void; -export const disposeDrawable: (imagePixelMapId: number) => void; -export const setAnimationDuration: (imagePixelMapId: number, duration: number) => void; -export const getAnimationDuration: (imagePixelMapId: number) => number; -export const setAnimationIteration: (imagePixelMapId: number, iteration: number) => void; -export const getAnimationIteration: (imagePixelMapId: number) => number; -export const createNodePage: (content: Object, resmgr: resourceManager.ResourceManager) =>number; \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 77052c679533e45a066030a9fc21cdbf9cbcf995..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/DrawableDescriptorSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 843c7f0c1f7b9a460e3dbbd2689e5b34016027d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/DrawableDescriptorSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 4ce6449f0e91914e73d4502c9f2e8e9a395ea4b1..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/DrawableDescriptorSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index ed58973029647643ec66bc81d1df814558c988fa..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright (c) 2025 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 image from '@ohos.multimedia.image'; -import hilog from '@ohos.hilog'; -import napiAgent from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -const TAG = 'DrawableDemo'; - -@Entry -@Component -struct DrawablePage { - @State imagePixelMap: image.PixelMap | null = null; - @State imagePixelMapId: number = -1; // 用于存储图片描述符的引用ID - - @State imagePixelMapArray: image.PixelMap | null = null; - @State imagePixelMapArrayId: number = -1; // 用于存储图片描述符的引用ID - @State animationDuration: number = 0; - @State newDuration: number = 1000; - @State animationIteration: number = 0; - @State newIteration: number = 10; - private nodeContent = new NodeContent(); - - loadPixelMapArray() { - if (!this.getUIContext() || !this.getUIContext().getHostContext()) { - hilog.error(0x0000, TAG, `getUIContext fail.`); - return; - } - const context = this.getUIContext().getHostContext(); - const resMgr = context!.resourceManager; - - this.imagePixelMapArrayId = napiAgent.createNodePage(this.nodeContent, resMgr); - - if (this.imagePixelMapArrayId >= 0) { - hilog.error(0x0000, TAG, '---test loadPixelMapArray创建成功, imagePixelMapArrayId:%d', this.imagePixelMapArrayId); - } else { - hilog.error(0x0000, TAG, '---test loadPixelMapArray创建失败'); - } - } - - async loadPixelMapArrayAsync() { - this.loadPixelMapArray() - } - - async aboutToAppear() { - // 从资源加载图片并转换为PixelMap - await this.loadImageFromResource(); - await this.loadImageArrayFromResource(); - await this.loadPixelMapArrayAsync(); - } - - // 从资源加载图片并转换为PixelMap - async loadImageFromResource() { - try { - if (!this.getUIContext() || !this.getUIContext().getHostContext()) { - return; - } - const context = this.getUIContext().getHostContext(); - const resMgr = context!.resourceManager; - const imageData = await resMgr.getRawFileContent('startIcon.png'); - - // 创建图像解码器 - const imageSource = image.createImageSource(imageData.buffer); - const pixelMap = await imageSource.createPixelMap({}); - - this.imagePixelMap = pixelMap; - hilog.info(0x0000, TAG, '图片startIcon加载成功'); - - // 从PixelMap创建Drawable描述符 - this.createPixelMap(); - } catch (err) { - hilog.error(0x0000, TAG, `图片startIcon加载失败: ${JSON.stringify(err)}`); - } - } - - async loadImageArrayFromResource() { - try { - if (!this.getUIContext() || !this.getUIContext().getHostContext()) { - return; - } - const context = this.getUIContext().getHostContext(); - const resMgr = context!.resourceManager; - const imageData = await resMgr.getRawFileContent('test.jpg'); - - // 创建图像解码器 - const imageSource = image.createImageSource(imageData.buffer); - const pixelMap = await imageSource.createPixelMap({}); - - this.imagePixelMapArray = pixelMap; - hilog.info(0x0000, TAG, '图片test加载成功'); - - this.createPixelMapArray(); - } catch (err) { - hilog.error(0x0000, TAG, `图片test加载失败: ${JSON.stringify(err)}`); - } - } - - // 从PixelMap创建DrawableDescriptor - createPixelMap() { - if (!this.imagePixelMap) { - return; - } - - // 调用Native方法创建DrawableDescriptor - this.imagePixelMapId = napiAgent.createFromPixelMap(this.imagePixelMap); - - if (this.imagePixelMapId >= 0) { - hilog.error(0x0000, TAG, 'imagePixelMap创建成功'); - } else { - hilog.error(0x0000, TAG, 'imagePixelMap创建失败'); - } - } - - createPixelMapArray() { - // 调用Native方法,测试相关接口 - napiAgent.createFromAnimatedPixelMap(this.imagePixelMapArray, 1); - } - - // 设置输入的duration - setNewDuration() { - if (this.imagePixelMapArrayId >= 0) { - napiAgent.disposeDrawable(this.imagePixelMapArrayId); - this.imagePixelMapArrayId = -1; - } - - this.loadPixelMapArray(); - napiAgent.setAnimationDuration(this.imagePixelMapArrayId, this.newDuration); - this.animationDuration = napiAgent.getAnimationDuration(this.imagePixelMapArrayId); - } - - // 设置输入的iteration - setNewIteration() { - if (this.imagePixelMapArrayId < 0) { - hilog.error(0x0000, TAG, 'imagePixelMapArrayId < 0, return'); - return; - } - - napiAgent.setAnimationIteration(this.imagePixelMapArrayId, this.newIteration); - this.animationIteration = napiAgent.getAnimationIteration(this.imagePixelMapArrayId); - } - - // 页面销毁时释放资源 - aboutToDisappear() { - if (this.imagePixelMapId >= 0) { - napiAgent.disposeDrawable(this.imagePixelMapId); - this.imagePixelMapId = -1; - } - if (this.imagePixelMap) { - this.imagePixelMap.release(); - this.imagePixelMap = null; - } - - if (this.imagePixelMapArrayId >= 0) { - napiAgent.disposeDrawable(this.imagePixelMapArrayId); - this.imagePixelMapArrayId = -1; - } - if (this.imagePixelMapArray) { - this.imagePixelMapArray.release(); - this.imagePixelMapArray = null; - } - } - - onBackPress() { - hilog.error(0x0000, TAG, 'onBackPress'); - - // 先清理老的节点,再重新设置一个新的 - hilog.error(0x0000, TAG, 'onBackPress begin, ---test imagePixelMapArrayId:%d', this.imagePixelMapArrayId); - napiAgent.disposeDrawable(this.imagePixelMapArrayId); - this.imagePixelMapArrayId = -1; - - this.loadPixelMapArray(); - } - - build() { - Column() { - Text($r('app.string.Index_label_func_sample')) - .fontSize(24) - .margin(20) - .fontWeight(FontWeight.Bold) - - if (this.imagePixelMap) { - Image(this.imagePixelMap) - .width(100) - .height(100) - .margin(10) - .objectFit(ImageFit.Auto) - } else { - Text($r('app.string.Index_label_load_fail')) - .fontSize(16) - .margin(10) - } - - Column() { - ContentSlot(this.nodeContent) - } - - Column() { - Text(`duration: ${this.animationDuration}ms`) - .fontSize(18) - .margin(10) - Text(`iteration: ${this.animationIteration}`) - .fontSize(18) - .margin(10) - - Row() { - Text($r('app.string.Index_label_set_duration')) - .fontSize(16) - .margin({ right: 10 }) - - TextInput({ - text: this.newDuration.toString() - }) - .width(100) - .onChange((value) => { - this.newDuration = parseInt(value) || 0; - }) - - Button($r('app.string.Index_button_setting')) - .margin({ left: 10 }) - .onClick(() => this.setNewDuration()) - } - .margin(10) - - Row() { - Text($r('app.string.Index_label_set_iteration')) - .fontSize(16) - .margin({ right: 10 }) - - TextInput({ - text: this.newIteration.toString() - }) - .width(100) - .onChange((value) => { - this.newIteration = parseInt(value) || 0; - }) - - Button($r('app.string.Index_button_setting')) - .margin({ left: 10 }) - .onClick(() => this.setNewIteration()) - } - .margin(10) - } - .width('100%') - .padding(20) - .backgroundColor('#f5f5f5') - .borderRadius(10) - - Button($r('app.string.Index_button_back')) - .fontSize(18) - .width(240) - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - .margin({ top: 20, bottom: 20 }) - } - .width('100%') - .height('100%') - .padding(15) - .backgroundColor('#ffffff') - } -} diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/module.json5 b/ArkUIKit/DrawableDescriptorSample/entry/src/main/module.json5 deleted file mode 100644 index c75d702e2d350523978ecaf801c22762ce7d40c0..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/element/color.json b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/element/float.json b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/element/string.json b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 49d236d37cbf2f2349e1f6f593165c6ec53fce57..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "Index_label_func_sample", - "value": "DrawableDescriptor功能示例" - }, - { - "name": "Index_label_load_fail", - "value": "加载图片失败,请检查资源文件" - }, - { - "name": "Index_label_set_duration", - "value": "设置duration" - }, - { - "name": "Index_label_set_iteration", - "value": "设置iteration" - }, - { - "name": "Index_button_setting", - "value": "设置" - }, - { - "name": "Index_button_back", - "value": "返回" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/background.png b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/test1.gif b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/test1.gif deleted file mode 100755 index 90fac8fbd889e4573f77b86c82529d4676b0a32a..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/media/test1.gif and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/dark/element/color.json b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/rawfile/startIcon.png b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/rawfile/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/rawfile/startIcon.png and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/rawfile/test.jpg b/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/rawfile/test.jpg deleted file mode 100644 index 4a3fa2b98624b4678db7c8f911ede21aa75d1e66..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/entry/src/main/resources/rawfile/test.jpg and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/mock/Libentry.mock.ets b/ArkUIKit/DrawableDescriptorSample/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 82fa70b5693ddab96d237d2d17d943d866b61465..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/mock/mock-config.json5 b/ArkUIKit/DrawableDescriptorSample/entry/src/mock/mock-config.json5 deleted file mode 100644 index 98b0ae79f0090e1fc381d54c959fb32c9f7563f4..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 7f30942b81554a399e89aa253c7089eca4f8d8d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 272041cc29a670afbe7be931c44862245f87db17..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import IndexTest from './index.test'; - -export default function testsuite() { - abilityTest(); - IndexTest(); -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/ets/test/index.test.ets b/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/ets/test/index.test.ets deleted file mode 100644 index 57c43bb5c4bc5ffbaced08613c73653d88b3f85c..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/ets/test/index.test.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect, beforeAll } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON, MouseButton, Component, MatchPattern } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -export default function IndexTest() { - - describe('IndexTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - /** - * @tc.number UiTest_001 - * @tc.name testSetAttribute - * @tc.desc 测试点击设置按钮示例 - */ - it('testSetAttribute', 0, async (done: Function) => { - console.info('uitest: testSetAttribute begin'); - let driver = Driver.create(); - let button = await driver.findComponent(ON.text('设置', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - await driver.delayMs(1000); - console.info('uitest: testSetAttribute end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/module.json5 b/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index f6bdce9946cb02c0385e5a8836c133c93945013d..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/test/List.test.ets b/ArkUIKit/DrawableDescriptorSample/entry/src/test/List.test.ets deleted file mode 100644 index a60c87c5cbb0badf7c3fd8975034590e6fafa992..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/entry/src/test/LocalUnit.test.ets b/ArkUIKit/DrawableDescriptorSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 841bfd77e56060e50ec0924302a5ae624e76e3aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/hvigor/hvigor-config.json5 b/ArkUIKit/DrawableDescriptorSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 4d435603637cbbfe92ac9865537a0c1051810bb1..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "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/ArkUIKit/DrawableDescriptorSample/hvigorfile.ts b/ArkUIKit/DrawableDescriptorSample/hvigorfile.ts deleted file mode 100644 index ae9086af35844176c08f1be3772d081d95d267c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/oh-package-lock.json5 b/ArkUIKit/DrawableDescriptorSample/oh-package-lock.json5 deleted file mode 100644 index 9b8016a6dd91fd56a74a9bc04858205036d7fc54..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.21": "@ohos/hypium@1.0.21" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.21": { - "name": "", - "version": "1.0.21", - "integrity": "sha512-iyKGMXxE+9PpCkqEwu0VykN/7hNpb+QOeIuHwkmZnxOpI+dFZt6yhPB7k89EgV1MiSK/ieV/hMjr5Z2mWwRfMQ==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.21.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/oh-package.json5 b/ArkUIKit/DrawableDescriptorSample/oh-package.json5 deleted file mode 100644 index 38abfd099681aeb547cf83a4966111dd5f4f6d13..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/DrawableDescriptorSample/ohosTest.md b/ArkUIKit/DrawableDescriptorSample/ohosTest.md deleted file mode 100644 index 5bf98ed7079893861b341295bb94a06ff1f39cd3..0000000000000000000000000000000000000000 --- a/ArkUIKit/DrawableDescriptorSample/ohosTest.md +++ /dev/null @@ -1,16 +0,0 @@ -# DrawableDescriptorSample 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|------------| -------------- |---------------|-----------| :------- | -------- | -| 加载单张图片 | 设备正常运行 | 无| 界面上方第一张图片能够正常显示 | 是 | Pass | -| 加载动态图片 | 设备正常运行 | 无| 界面上方第二张图片能够正常显示 | 是 | Pass | -| 调用OH_ArkUI_DrawableDescriptor_GetStaticPixelMap接口 | 设备正常运行 | 无| DevEco Studio开发环境查看有"GetStaticPixelMap success"相关日志 | 是 | Pass | -| 调用OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArray接口 | 设备正常运行 | 无| DevEco Studio开发环境查看有"GetAnimatedPixelMapArray success"相关日志 | 是 | Pass | -| 调用OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArraySize接口 | 设备正常运行 | 无| DevEco Studio开发环境查看有"GetAnimatedPixelMapArraySize success"相关日志 | 是 | Pass | -| 调用OH_ArkUI_DrawableDescriptor_Dispose接口 | 设备正常运行 | 无| DevEco Studio开发环境查看有"Dispose success"相关日志 | 是 | Pass | -| 设置duration属性 | 设备正常运行 | 点击"设置duration"后面的"设置"按钮| duration值能够正常显示 | 是 | Pass | -| 获取duration属性 | 设备正常运行 | 点击"设置duration"后面的"设置"按钮| duration值能够正常显示 | 是 | Pass | -| 设置iteration属性 | 设备正常运行 | 点击"设置iteration"后面的"设置"按钮| iteration值能够正常显示 | 是 | Pass | -| 获取duration属性 | 设备正常运行 | 点击"设置iteration"后面的"设置"按钮| iteration值能够正常显示 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/DrawableDescriptorSample/screenshots/device/image1.jpeg b/ArkUIKit/DrawableDescriptorSample/screenshots/device/image1.jpeg deleted file mode 100644 index 1fbf52bbccfb8c500c08dd098981602424bb3f40..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/screenshots/device/image1.jpeg and /dev/null differ diff --git a/ArkUIKit/DrawableDescriptorSample/screenshots/device/result.jpeg b/ArkUIKit/DrawableDescriptorSample/screenshots/device/result.jpeg deleted file mode 100644 index 5db58d650902509d0c042487f8ed9654507a9a37..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/DrawableDescriptorSample/screenshots/device/result.jpeg and /dev/null differ diff --git a/ArkUIKit/FloatingBall/.gitignore b/ArkUIKit/FloatingBall/.gitignore deleted file mode 100644 index bb553c77555079b1b1f2c43bb977cf5152f2f52f..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -build/ -/.gradle -.vscode \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/AppScope/app.json5 b/ArkUIKit/FloatingBall/AppScope/app.json5 deleted file mode 100644 index 6496e0c5ad4bb808d458451819db972ddf54216f..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/AppScope/app.json5 +++ /dev/null @@ -1,14 +0,0 @@ -{ - "app": { - "bundleName": "com.example.floatingBall", // 实际使用应替换成你自己的包名 - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "multiAppMode": { - "multiAppModeType": "appClone", - "maxCount": 5 - } - } -} diff --git a/ArkUIKit/FloatingBall/AppScope/resources/base/element/string.json b/ArkUIKit/FloatingBall/AppScope/resources/base/element/string.json deleted file mode 100644 index 49c1903f05f734f501eb2395591f3135855082a5..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "FloatingBall" - } - ] -} diff --git a/ArkUIKit/FloatingBall/AppScope/resources/base/media/app_icon.png b/ArkUIKit/FloatingBall/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/FloatingBall/AppScope/resources/zh_CN/element/string.json b/ArkUIKit/FloatingBall/AppScope/resources/zh_CN/element/string.json deleted file mode 100644 index 14414bbe424e32af3cbe0753851b613ed21fcdbc..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/AppScope/resources/zh_CN/element/string.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "闪控球" - } - ] -} - \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/README.md b/ArkUIKit/FloatingBall/README.md deleted file mode 100644 index 298150f4deb82d0f7b9544653bf66de7c62f6aee..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# ArkTS 悬浮球(FloatingBall) - -### 介绍 - -悬浮球是一种在设备屏幕上悬浮的非全屏应用窗口,为应用提供临时的全局能力,完成跨应用交互。 - -应用可以将关键信息(如比价、搜题或抢单等)以小窗(悬浮球)模式呈现。切换为小窗(悬浮球)模式后,用户可以进行其他界面操作,提升使用体验。 - -从API version 20开始,支持使用悬浮球能力。 - -### 效果预览 -1、Demo提供4种悬浮球创建布局 - -2、除了静态布局不支持创建后【更新】,其余布局均支持创建后【更新】 - -![view1.jpeg](screenshots/view1.jpeg) ![view2.jpeg](screenshots/view2.jpeg) ![view3.jpeg](screenshots/view3.jpeg) ![view4.jpeg](screenshots/view4.jpeg) -![view5.jpeg](screenshots/view5.jpeg) ![view6.jpeg](screenshots/view6.jpeg) ![view7.jpeg](screenshots/view7.jpeg) - -### 使用说明 - -单击悬浮球:触发悬浮球点击事件。 - -长按悬浮球:长按悬浮球震动变为待删除态,可以点击图标单个删除或全部删除。 - -拖动悬浮球:可以手动拖拽悬浮球改变位置,拖拽时自动避让状态栏、固定态软键盘(改变软键盘为固定态或者悬浮态方法详细介绍请参见输入法服务)、导航条等其他组件, 设备处于横屏场景时不会自动避让输入法。拖拽松手时悬浮球自动吸附在最近的侧边,拖拽到垃圾桶区域(底部中部区域)松手即可删除。 -悬浮球位置记忆:关闭悬浮球会记录当前位置,下一次打开功能时自动展示在上次关闭时的位置。旋转屏幕或重启设备会恢复到默认位置,默认位置位于屏幕右上侧。 - -同一个应用只能启动一个悬浮球,同一个设备最多同时存在两个悬浮球,在超出悬浮球最大个数限制时,打开新的悬浮球会替换最早启动的悬浮球。 - -### 工程目录 - -``` -entry/src/ - ├── main - │ ├── ets - │ │ ├── entryability - │ │ ├── entrybackupability - │ │ ├── pages - │ │ ├── Index.ets // 悬浮球应用页面 - │ │ ├── util - │ │ ├── ContextUtil.ts // 上下文相关类 - │ │ ├── Utils.ts // 工具类 - │ ├── module.json5 - │ └── resources - ├── ohosTest - │ ├── ets - │ │ ├── test - │ │ ├── Index.test.ets // 自动化测试代码 -``` - -### 相关权限 - -基于安全考虑,仅允许应用在前台时启动悬浮球,并且需要具有ohos.permission.USE_FLOAT_BALL权限。 - -### 依赖 - -@ohos/hvigor-ohos-online-sign-plugin,最低版本"3.2.0"。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:手机和平板。 - -2.本示例为Stage模型,支持API20版本SDK,版本号:6.0.0.49,镜像版本号:OpenHarmony-6.0.2.53(Beta1)。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.720, built on July 1, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/XXXXXXXXXXX????????? > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/ArkUIKit/FloatingBall/build-profile.json5 b/ArkUIKit/FloatingBall/build-profile.json5 deleted file mode 100644 index c033ce4278fb0641d84107c3c134047ac487368e..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/build-profile.json5 +++ /dev/null @@ -1,35 +0,0 @@ -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "compatibleSdkVersion": "5.0.0(12)", - "runtimeOS": "HarmonyOS", - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/entry/build-profile.json5 b/ArkUIKit/FloatingBall/entry/build-profile.json5 deleted file mode 100644 index b695582d3680556f4cce2ec518f65720a9413ca3..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/build-profile.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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/ArkUIKit/FloatingBall/entry/hvigorfile.ts b/ArkUIKit/FloatingBall/entry/hvigorfile.ts deleted file mode 100644 index c6edcd90486dd5a853cf7d34c8647f08414ca7a3..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/ArkUIKit/FloatingBall/entry/oh-package.json5 b/ArkUIKit/FloatingBall/entry/oh-package.json5 deleted file mode 100644 index eca728820625ea84a16d565d54a25a56e9c8f10d..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "A Demo for FloatingBall", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/ArkUIKit/FloatingBall/entry/src/main/ets/abilities/MainAbility.ets b/ArkUIKit/FloatingBall/entry/src/main/ets/abilities/MainAbility.ets deleted file mode 100644 index bdb3d1131597aae922d4cda6dabbd48b5d6c660d..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/src/main/ets/abilities/MainAbility.ets +++ /dev/null @@ -1,48 +0,0 @@ -// MainAbility.ets - -import { AbilityConstant, ConfigurationConstant, UIAbility, Want} from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; -import { ContextUtil } from '../util/ContextUtil' - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate( want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, "testTag", '%{public}s', "Ability onCreate"); - ContextUtil.context = this.context; - } - - onDestroy(): void { - hilog.info(DOMAIN, "testTag", '%{public}s', "Ability onDestroy"); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, "testTag", '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, "testTag", 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, "testTag", 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, "testTag", '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, "testTag", '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, "testTag", '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/entry/src/main/ets/pages/Index.ets b/ArkUIKit/FloatingBall/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 4b3036d0cf2e8f2429a66605da69aedc7e6f8398..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,172 +0,0 @@ -// Index.ets -// 该页面利用按钮点击事件展示闪控球基本操作 - -import image from '@ohos.multimedia.image'; -import { floatingBall } from '@kit.ArkUI'; -import {Utils} from '../util/Utils'; - -@Entry -@Component -struct Index{ - // 当前可用的行,-1 表示全部行可见 - @State private activeRow: number = -1; - // 声明闪控球控制器 - private floatingBallController: floatingBall.FloatingBallController | undefined = undefined; - // 缓存 icon 图标(静态布局) - private cachedIcon1: image.PixelMap | undefined = undefined; - // 缓存 icon 图标(强调文本布局) - private cachedIcon2: image.PixelMap | undefined = undefined; - - // activeRow 的状态更新函数(确保闪控球销毁时,activeRow的值更新为-1) - activeRowChange = (value: number) => {this.activeRow = value}; - - // 判断某个布局是否可用(是否置灰) - isEnabled(rowInex: number): boolean{ - return this.activeRow === -1 || this.activeRow === rowInex; - } - - build(){ - Column({space: 12}){ - // 静态布局,支持标题和图标,该布局在创建后无法修改 - Row({space: 6}){ - Button('创建静态布局').onClick( async () => { - // 请在组件内获取context,确保this.getUIContext().getHostContext()返回的结果是UIAbilityContext - if(!this.floatingBallController){ - this.floatingBallController = await floatingBall.create({ - context: this.getUIContext().getHostContext() - }) - } - if(this.floatingBallController){ - // 仅当没有缓存 cachedIcon1 时才加载;有缓存时,直接使用; - if(!this.cachedIcon1){ - let pixelMap = Utils.getRawfilePixelMapSync('books.png'); // 图片尺寸有最大限制 - if(pixelMap){ - this.cachedIcon1 = pixelMap; // 把图标缓存起了 - console.info('success to load icon PixelMap'); - }else{ - console.error('failed to load icon PixelMap'); - } - } - Utils.onClickCreateFloatingBall(this.floatingBallController, - floatingBall.FloatingBallTemplate.STATIC, this.activeRowChange, 'title', 'content', this.cachedIcon1) - this.activeRow = 0; - } - }) - .enabled(this.isEnabled(0)) - // 更新闪控球信息(该布局在创建后无法更新,按钮永久置灰) - Button('更新').enabled(false) - // 关闭闪控球 - Button('关闭').onClick(() => { - Utils.onClickStopFloatingBall(this.floatingBallController); - this.activeRow = -1; // 关闭后恢复所有行显示 - }) - .enabled(this.isEnabled(0)) - } - .width('100%') - .justifyContent(FlexAlign.Center) - - // 普通文本布局,支持标题和内容 - Row({space: 6}){ - Button('创建普通文本布局').onClick( async () => { - // 请在组件内获取context,确保this.getUIContext().getHostContext()返回的结果是UIAbilityContext - if(!this.floatingBallController){ - this.floatingBallController = await floatingBall.create({ - context: this.getUIContext().getHostContext() - }) - } - if(this.floatingBallController){ - Utils.onClickCreateFloatingBall(this.floatingBallController, - floatingBall.FloatingBallTemplate.NORMAL, this.activeRowChange, 'title', 'content') - this.activeRow = 1; - } - }) - .enabled(this.isEnabled(1)) - // 更新闪控球信息 - Button('更新').onClick(() => Utils.onClickUpdateFloatingBall(this.floatingBallController, - floatingBall.FloatingBallTemplate.NORMAL)) - .enabled(this.isEnabled(1)) - // 关闭闪控球 - Button('关闭').onClick(() => { - Utils.onClickStopFloatingBall(this.floatingBallController); - this.activeRow = -1; // 关闭后恢复所有行显示 - }) - .enabled(this.isEnabled(1)) - } - .width('100%') - .justifyContent(FlexAlign.Center) - - // 强调文本布局,支持标题、图标和内容 - Row({space: 6}){ - Button('创建强调文本布局').onClick( async () => { - // 请在组件内获取context,确保this.getUIContext().getHostContext()返回的结果是UIAbilityContext - if(!this.floatingBallController){ - this.floatingBallController = await floatingBall.create({ - context: this.getUIContext().getHostContext() - }) - } - if(this.floatingBallController){ - // 仅当没有缓存 cachedIcon1 时才加载;有缓存时,直接使用; - if(!this.cachedIcon1){ - let pixelMap = Utils.getRawfilePixelMapSync('video.png'); // 图片尺寸有最大限制 - if(pixelMap){ - this.cachedIcon1 = pixelMap; // 把图标缓存起了 - console.info('success to load icon PixelMap'); - }else{ - console.error('failed to load icon PixelMap'); - } - } - Utils.onClickCreateFloatingBall(this.floatingBallController, - floatingBall.FloatingBallTemplate.EMPHATIC, this.activeRowChange, '16', '分钟', this.cachedIcon2) - this.activeRow = 2; - } - }) - .enabled(this.isEnabled(2)) - // 更新闪控球信息 - Button('更新').onClick(() => Utils.onClickUpdateFloatingBall(this.floatingBallController, - floatingBall.FloatingBallTemplate.EMPHATIC, '', '分钟', this.cachedIcon2)) - .enabled(this.isEnabled(2)) - // 关闭闪控球 - Button('关闭').onClick(() => { - Utils.onClickStopFloatingBall(this.floatingBallController); - this.activeRow = -1; // 关闭后恢复所有行显示 - }) - .enabled(this.isEnabled(2)) - } - .width('100%') - .justifyContent(FlexAlign.Center) - - // 纯文本布局,只支持标题 - Row({space: 6}){ - Button('创建纯文本布局').onClick( async () => { - // 请在组件内获取context,确保this.getUIContext().getHostContext()返回的结果是UIAbilityContext - if(!this.floatingBallController){ - this.floatingBallController = await floatingBall.create({ - context: this.getUIContext().getHostContext() - }) - } - if(this.floatingBallController){ - Utils.onClickCreateFloatingBall(this.floatingBallController, - floatingBall.FloatingBallTemplate.SIMPLE, this.activeRowChange) - this.activeRow = 3; - } - }) - .enabled(this.isEnabled(3)) - // 更新闪控球信息 - Button('更新').onClick(() => Utils.onClickUpdateFloatingBall(this.floatingBallController, - floatingBall.FloatingBallTemplate.SIMPLE)) - .enabled(this.isEnabled(3)) - // 关闭闪控球 - Button('关闭').onClick(() => { - Utils.onClickStopFloatingBall(this.floatingBallController); - this.activeRow = -1; // 关闭后恢复所有行显示 - }) - .enabled(this.isEnabled(3)) - } - .width('100%') - .justifyContent(FlexAlign.Center) - } - .width("100%") - .height("100%") - .justifyContent(FlexAlign.Center) - } -} \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/entry/src/main/ets/util/ContextUtil.ts b/ArkUIKit/FloatingBall/entry/src/main/ets/util/ContextUtil.ts deleted file mode 100644 index 6d394849283b5fbbea761d2ab62fbcf634cf0f29..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/src/main/ets/util/ContextUtil.ts +++ /dev/null @@ -1,9 +0,0 @@ -// ContextUtil.ts - -import abilityCommon from '@ohos.app.ability.common'; -import window from '@ohos.window'; - -export class ContextUtil{ - public static context: abilityCommon.UIAbilityContext; - public static win: window.Window; -} \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/entry/src/main/ets/util/Utils.ts b/ArkUIKit/FloatingBall/entry/src/main/ets/util/Utils.ts deleted file mode 100644 index af7097ded2144b97f4b47758262b69dbfd97b760..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/src/main/ets/util/Utils.ts +++ /dev/null @@ -1,118 +0,0 @@ -// Utils.ts - -import image from '@ohos.multimedia.image'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { floatingBall } from '@kit.ArkUI'; -import { Want } from '@kit.AbilityKit'; -import { ContextUtil} from './ContextUtil'; - -export class Utils { - public static getRawfilePixelMapSync(path: string): image.PixelMap{ - try{ - const buffer = ContextUtil.context.resourceManager.getRawFileContentSync(path); - const imageSource: image.ImageSource = image.createImageSource(buffer.buffer as ArrayBuffer); - console.log(`Get rawfile pixelMap path '${path}' success`); - return imageSource.createPixelMapSync(); - }catch (e) { - console.log(`Get rawfile pixelMap path '${path}' failed`, e); - throw e as Error; - } - } - - // 悬浮球启动逻辑 - public static async onClickCreateFloatingBall(floatingBallController: floatingBall.FloatingBallController | undefined, - template: floatingBall.FloatingBallTemplate, - onActiveRowChange: (value: number) => void, // 接收状态更新回调函数 - title: string = "title", - content: string = "content", - icon?: image.PixelMap): Promise { - // 注册 监听点击回调事件 - floatingBallController?.on("click", () => { - console.info('FloatingBall onClickEvent'); - let want: Want = { - // 实际使用应替换成你自己的应用包名 - bundleName: "com.example.floatingBall", - abilityName: "MainAbility" - } - // 使用promise异步回调 - floatingBallController?.restoreMainWindow(want) - .then(() => { - console.log('Success in restoring FloatingBall main window'); - }).catch((err: BusinessError) => { - console.log('failed to restore FloatingBall main window. Cause code: ${err.code}, message: ${err.message}'); - }) - }) - // 注册 监听状态变化事件 - floatingBallController?.on('stateChange', - (state: floatingBall.FloatingBallState) => { - console.info('FloatingBall stateCange:', state); - if(state === floatingBall.FloatingBallState.STOPPED){ - floatingBallController?.off("click") - floatingBallController?.off("stateChange") - floatingBallController = undefined; - // 执行状态更新回调 - onActiveRowChange?.(-1); - } - }) - // 最后启动山控球 - let startParams: floatingBall.FloatingBallParams = icon? { - template: template, - title: title, - content: content, - icon: icon - } : { - template: template, - title: title, - content: content - } - try{ - floatingBallController?.startFloatingBall(startParams) - .then(() => { - console.log('succeed in starting FloatingBall'); - }).catch((err: BusinessError) => { - console.error(`failed to start FloatingBall. Cause code: ${err.code}, message: ${err.message}`); - }) - }catch(e){ - console.error('startFloatingBall Error', e) - } - } - -// 悬浮球更新逻辑 -public static onClickUpdateFloatingBall(floatingBallController: floatingBall.FloatingBallController | undefined, - template: floatingBall.FloatingBallTemplate, - title: string = "title", - content: string = "content", - icon?: image.PixelMap): void { - // 更新时给标题、内容 随机使用数字后缀 - let random_string: string = Math.floor(Math.random() * 100).toString(); - let updateParams: floatingBall.FloatingBallParams = icon ? { - template: template, - title: title + random_string, - content: content + random_string, - icon: icon - } : { - template: template, - title: title + random_string, - content: content + random_string, - } - try{ - floatingBallController?.updateFloatingBall(updateParams).then(() => { - console.info('Succeed in updating FloatingBall.'); - }).catch((err: BusinessError) => { - console.error(`failed to update FloatingBall. Cause code: ${err.code}, message: ${err.message}`); - }) - }catch(e){ - console.error('updateFloatingBall Error:', e) - } - } - - // 悬浮球停止逻辑 - public static onClickStopFloatingBall(floatingBallController: floatingBall.FloatingBallController | undefined){ - // stop 是异步流程,需要通过 stateChange 状态回调获取实际删除结果 - floatingBallController?.stopFloatingBall().then(() => { - console.info('Succeed in stopping FloatingBall.'); - }).catch((err: BusinessError) => { - console.error(`failed to stop FloatingBall. Cause code: ${err.code}, message: ${err.message}`); - }) - } -} \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/entry/src/main/module.json5 b/ArkUIKit/FloatingBall/entry/src/main/module.json5 deleted file mode 100644 index 989eb8d58f77b1dad29ae4961e7825e1429aaa32..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/src/main/module.json5 +++ /dev/null @@ -1,98 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "MainAbility", - "srcEntry": "./ets/abilities/MainAbility.ets", - "description": "$string:MainAbility_desc", - "icon": "$media:app_icon", - "label": "$string:app_name", - "startWindowIcon": "$media:app_icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "orientation":"auto_rotation_restricted", // 需要配置为相应的旋转策略 - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "backgroundModes": [ - // 长时任务类型的配置项 - "location" - ] - } - ], - "extensionAbilities": [ - ], - "requestPermissions": [ - { - "name" : "ohos.permission.GET_INSTALLED_BUNDLE_LIST", - "reason": "$string:request_permission", - "usedScene": { - "abilities": [ - "MainAbility" - ], - "when":"inuse" - } - }, - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - }, - { - "name": "ohos.permission.NOTIFICATION_AGENT_CONTROLLER" - }, - { - "name": "ohos.permission.SET_UNREMOVABLE_NOTIFICATION" - }, - { - "name": "ohos.permission.GET_BUNDLE_RESOURCES" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" - }, - { - "name": "ohos.permission.START_SYSTEM_DIALOG" - }, - { - "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND" - }, - { - "name": "ohos.permission.USE_FLOAT_BALL" - }, - { - "name": "ohos.permission.SUBSCRIBE_NOTIFICATION_WINDOW_STATE" - } -// { -// "name": "ohos.permission.ACCESS_CAST_ENGINE_MIRROR" -// }, -// { -// "name": "ohos.permission.GET_WIFI_INFO", -// }, -// { -// "name": "ohos.permission.START_INVISIBLE_ABILITY", -// }, -// { -// "name": "ohos.permission.GET_WALLPAPER" -// } - ] - } -} \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/entry/src/main/resources/base/element/color.json b/ArkUIKit/FloatingBall/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/entry/src/main/resources/base/element/string.json b/ArkUIKit/FloatingBall/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 049bebfb936239e19966b644021620193dcc3ef4..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "FloatingBall" - }, - { - "name":"request_permission", - "value":"请求权限" - }, - { - "name":"MainAbility_desc", - "value":"description" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/FloatingBall/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/FloatingBall/entry/src/main/resources/rawfile/books.png b/ArkUIKit/FloatingBall/entry/src/main/resources/rawfile/books.png deleted file mode 100644 index b9ac070a05b746c4f74b26d29e9da0051314c790..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/entry/src/main/resources/rawfile/books.png and /dev/null differ diff --git a/ArkUIKit/FloatingBall/entry/src/main/resources/rawfile/video.png b/ArkUIKit/FloatingBall/entry/src/main/resources/rawfile/video.png deleted file mode 100644 index 3f15ba2e61f9ee3aec30729a148c88f9f928ebbf..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/entry/src/main/resources/rawfile/video.png and /dev/null differ diff --git a/ArkUIKit/FloatingBall/entry/src/ohosTest/ets/test/Index.test.ets b/ArkUIKit/FloatingBall/entry/src/ohosTest/ets/test/Index.test.ets deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/ArkUIKit/FloatingBall/entry/src/ohosTest/module.json5 b/ArkUIKit/FloatingBall/entry/src/ohosTest/module.json5 deleted file mode 100644 index 23b80699e8c1cf3646a453f5165b512c0b39934c..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/hvigor/hvigor-config.json5 b/ArkUIKit/FloatingBall/hvigor/hvigor-config.json5 deleted file mode 100644 index bff3fd94ae27c382e48a548c53444999bb116098..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "5.0.0", - "dependencies": { -// "@ohos/hvigor-ohos-online-sign-plugin": "3.2.0" - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ - "daemon": false, /* 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/ArkUIKit/FloatingBall/hvigorfile.ts b/ArkUIKit/FloatingBall/hvigorfile.ts deleted file mode 100644 index f3cb9f1a87a81687554a76283af8df27d8bda775..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/ArkUIKit/FloatingBall/oh-package.json5 b/ArkUIKit/FloatingBall/oh-package.json5 deleted file mode 100644 index bb1fd952dc0b3c908a58aa9161b9cd013e7bfa3e..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/oh-package.json5 +++ /dev/null @@ -1,8 +0,0 @@ -{ - "modelVersion": "5.0.0", - "description": "A Demo for FloaingBall", - "dependencies": { - }, - "devDependencies": { - } -} diff --git a/ArkUIKit/FloatingBall/ohosTest.md b/ArkUIKit/FloatingBall/ohosTest.md deleted file mode 100644 index 59040d0f05cffb1cb93b7938aab24a1ad9249501..0000000000000000000000000000000000000000 --- a/ArkUIKit/FloatingBall/ohosTest.md +++ /dev/null @@ -1,23 +0,0 @@ -# FloatingBall 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|-----------|----------------------|------------------|-------------------|------| -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 创建 静态布局 | 位于应用首页 | 点击【创建静态布局】 | 创建悬浮球 | 是 | Pass | -| 删除 静态布局 | 位于应用首页,已经创建悬浮球 | 点击【关闭】 | 删除悬浮球 | 是 | Pass | -| 创建 普通文本布局 | 位于应用首页 | 点击【创建普通文本布局】 | 创建悬浮球 | 是 | Pass | -| 更新 普通文本布局 | 位于应用首页,已经创建悬浮球 | 点击【更新】 | 更新悬浮球 | 是 | Pass | -| 删除 普通文本布局 | 位于应用首页,已经创建悬浮球 | 点击【关闭】 | 删除悬浮球 | 是 | Pass | -| 创建 强调文本布局 | 位于应用首页 | 点击【创建强调文本布局】 | 创建悬浮球 | 是 | Pass | -| 更新 强调文本布局 | 位于应用首页,已经创建悬浮球 | 点击【更新】 | 更新悬浮球 | 是 | Pass | -| 删除 强调文本布局 | 位于应用首页,已经创建悬浮球 | 点击【关闭】 | 删除悬浮球 | 是 | Pass | -| 创建 纯文本布局 | 位于应用首页 | 点击【创建纯文本布局】 | 创建悬浮球 | 是 | Pass | -| 更新 纯文本布局 | 位于应用首页,已经创建悬浮球 | 点击【更新】 | 更新悬浮球 | 是 | Pass | -| 删除 纯文本布局 | 位于应用首页,已经创建悬浮球 | 点击【关闭】 | 删除悬浮球 | 是 | Pass | -| 回到应用首页 | 已经创建悬浮球,当前界面在悬浮球应用之外 | 点击【悬浮球】 | 回到悬浮球应用首页 | 否 | Pass | -| 拖动删除 | 位于应用首页,已经创建悬浮球, | 拖动【悬浮球】到回收站 | 删除悬浮球 | 否 | Pass | -| 悬浮球应用分身 | 应用开启分身功能 | 创建多个【悬浮球】 | 最多创建2个,最早的悬浮球会被顶掉 | 否 | Pass | -| 长按删除单个悬浮球 | 应用开启分身功能,创建多个【悬浮球】 | 长按【悬浮球】,然后选择删除单个 | 删除单个悬浮球 | 否 | Pass | -| 长按删除所有悬浮球 | 应用开启分身功能,创建多个【悬浮球】 | 点击【悬浮球】,然后选择删除全部 | 删除全部悬浮球 | 否 | Pass | \ No newline at end of file diff --git a/ArkUIKit/FloatingBall/screenshots/view1.jpeg b/ArkUIKit/FloatingBall/screenshots/view1.jpeg deleted file mode 100644 index 4cc40c9cdfa54a9535065d91739189a1d48d4685..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/screenshots/view1.jpeg and /dev/null differ diff --git a/ArkUIKit/FloatingBall/screenshots/view2.jpeg b/ArkUIKit/FloatingBall/screenshots/view2.jpeg deleted file mode 100644 index 49aa5cda3841ffec76797cd7ddd13c8561bbcf8a..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/screenshots/view2.jpeg and /dev/null differ diff --git a/ArkUIKit/FloatingBall/screenshots/view3.jpeg b/ArkUIKit/FloatingBall/screenshots/view3.jpeg deleted file mode 100644 index ebbb03b07494c64db3d000a07c310da0b229dc4f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/screenshots/view3.jpeg and /dev/null differ diff --git a/ArkUIKit/FloatingBall/screenshots/view4.jpeg b/ArkUIKit/FloatingBall/screenshots/view4.jpeg deleted file mode 100644 index b5c1256023a06f1b847b85ea162400e7ce4c43ad..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/screenshots/view4.jpeg and /dev/null differ diff --git a/ArkUIKit/FloatingBall/screenshots/view5.jpeg b/ArkUIKit/FloatingBall/screenshots/view5.jpeg deleted file mode 100644 index c2431fcf7ee7915cb7d93977fe67b7f4b63fd74d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/screenshots/view5.jpeg and /dev/null differ diff --git a/ArkUIKit/FloatingBall/screenshots/view6.jpeg b/ArkUIKit/FloatingBall/screenshots/view6.jpeg deleted file mode 100644 index b586096725012db6afb0c495dc981dff3ea5d05a..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/screenshots/view6.jpeg and /dev/null differ diff --git a/ArkUIKit/FloatingBall/screenshots/view7.jpeg b/ArkUIKit/FloatingBall/screenshots/view7.jpeg deleted file mode 100644 index f7ed9db76a36970b46c6cf0471b3ce2f7a87605b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/FloatingBall/screenshots/view7.jpeg and /dev/null differ diff --git a/ArkUIKit/LayoutSample/.gitignore b/ArkUIKit/LayoutSample/.gitignore deleted file mode 100755 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/LayoutSample/AppScope/app.json5 b/ArkUIKit/LayoutSample/AppScope/app.json5 deleted file mode 100755 index 0976c89f204536185d7ae5089407589d0fc85dbb..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.layoutsample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/LayoutSample/AppScope/resources/base/element/string.json b/ArkUIKit/LayoutSample/AppScope/resources/base/element/string.json deleted file mode 100755 index baf8f0026724536990c47644f61bcbc3e3960ab2..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "LayoutSample" - } - ] -} diff --git a/ArkUIKit/LayoutSample/AppScope/resources/base/media/background.png b/ArkUIKit/LayoutSample/AppScope/resources/base/media/background.png deleted file mode 100755 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/LayoutSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/LayoutSample/AppScope/resources/base/media/foreground.png b/ArkUIKit/LayoutSample/AppScope/resources/base/media/foreground.png deleted file mode 100755 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/LayoutSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/LayoutSample/AppScope/resources/base/media/layered_image.json b/ArkUIKit/LayoutSample/AppScope/resources/base/media/layered_image.json deleted file mode 100755 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/README_zh.md b/ArkUIKit/LayoutSample/README_zh.md deleted file mode 100644 index 4a0198f90950f05384fad47e7e6aa475df88846e..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/README_zh.md +++ /dev/null @@ -1,270 +0,0 @@ -# ArkUI Layout Sample - -## 项目简介 - -本项目基于HarmonyOS ArkUI框架,展示了ArkUI中多种布局组件布局约束的使用方法。项目包括了Native C++实现和ArkTS的编码实现,为开发者提供了多种布局学习资源。 -工程中涉及接口文档: -1. [提供NativeModule公共的类型定义](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-type-h.md)。 -2. [提供NativeNode接口的类型定义](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-node-h.md)。 - -## 效果预览 - - -## 项目结构 -``` -LayoutSample/ -├── AppScope/ # 应用全局配置 -│ ├── app.json5 # 应用配置文件 -│ └── resources/ # 全局资源文件 -├── entry/ # 主模块 -│ ├── src/main/ -│ │ ├── cpp/ # Native C++代码 -│ │ │ ├── examples/ # 布局示例实现 -│ │ │ │ ├── alignRuleOptionExample.h # 对齐规则示例 -│ │ │ │ ├── barrierOptionExample.h # 障碍物布局示例 -│ │ │ │ ├── columnExample.h # 列布局示例 -│ │ │ │ ├── flexExample.h # Flex布局示例 -│ │ │ │ ├── guidelineOptionExample.h # 引导线示例 -│ │ │ │ ├── itemAlignmentExample.h # 项目对齐示例 -│ │ │ │ ├── layoutConstraintExample.h # 布局约束示例 -│ │ │ │ ├── layoutPolicyExample.h # 布局策略示例 -│ │ │ │ ├── layoutPositionExample.h # 布局位置示例 -│ │ │ │ ├── listChildrenMainSizeExample.h # 列表子元素主尺寸示例 -│ │ │ │ ├── pixelRoundExample.h # 像素舍入示例 -│ │ │ │ ├── positionEdgesExample.h # 位置边缘示例 -│ │ │ │ ├── refreshOffsetChangeExample.h # 刷新偏移事件示例 -│ │ │ │ ├── relativeLayoutChainExample.h # 相对布局链示例 -│ │ │ │ ├── rowExample.h # 行布局示例 -│ │ │ │ ├── safeAreaExample.h # 安全区域示例 -│ │ │ │ ├── stackExample.h # 堆叠布局示例 -│ │ │ │ └── LayoutConstants.h # 布局常量定义 -│ │ │ ├── nodes/ # ArkUI节点封装 -│ │ │ │ └── ArkUIBaseNode.h # 基础节点类 -│ │ │ ├── NativeEntry.h # Native入口头文件 -│ │ │ ├── NativeEntry.cpp # Native入口实现 -│ │ │ └── napi_init.cpp # NAPI初始化 -│ │ ├── ets/ # ArkTS代码 -│ │ │ ├── entryability/ # 应用入口 -│ │ │ │ └── EntryAbility.ets # 主Ability -│ │ │ ├── models/ # 数据模型 -│ │ │ │ └── NavigationItem.ts # 导航项模型 -│ │ │ └── pages/ # 页面文件 -│ │ │ ├── Index.ets # 主页面 -│ │ │ ├── native.ets # Native测试页面 -│ │ │ ├── node.ets # Node测试页面 -│ │ │ ├── nativeTest/ # Native测试示例页面 -│ │ │ └── nodeTest/ # Node测试示例页面 -│ │ ├── resources/ # 资源文件 -│ │ └── module.json5 # 模块配置文件 -│ ├── build-profile.json5 # 构建配置 -│ └── oh-package.json5 # 包配置文件 -├── build-profile.json5 # 项目构建配置 -├── oh-package.json5 # 项目包配置 -└── README.md # 项目说明文档 -``` -## 功能特性 - -### 1. 布局组件示例 -- **Flex布局**: 弹性盒子布局,支持主轴和交叉轴对齐 -- **Stack布局**: 堆叠布局,子组件按层级叠放 -- **Row布局**: 水平线性布局 -- **Column布局**: 垂直线性布局 -- **RelativeContainer**: 相对布局容器 - -### 2. 布局约束和规则 -- **LayoutConstraint**: 布局约束设置和获取 -- **AlignRuleOption**: 相对布局对齐规则配置 -- **GuidelineOption**: 引导线配置,辅助布局对齐 -- **BarrierOption**: 障碍物配置,创建虚拟边界 -- **RelativeLayoutChain**: 相对布局链,实现组件间的链式约束 - -### 3. 布局属性和策略 -- **LayoutPosition**: 布局位置设置和获取 -- **LayoutPolicy**: 布局策略(WrapContent、FixAtIdealSize等) -- **PositionEdges**: 位置边缘设置 -- **PixelRound**: 像素取整处理 -- **SafeArea**: 安全区域处理 - -### 4. 高级功能 -- **ListChildrenMainSize**: 列表子元素主尺寸控制 -- **ItemAlignment**: 项目对齐方式设置 -- **RefreshOffsetEvent**: 刷新偏移事件处理 - -## 技术架构 - -### 1. 混合开发架构 -- **ArkTS层**: 提供UI界面和用户交互 -- **Native C++层**: 实现核心布局逻辑和性能优化 -- **NAPI桥接**: 连接ArkTS和C++层,实现数据传递 - -### 2. 核心组件 -- **NativeEntry**: Native层入口管理类,负责组件生命周期 -- **ArkUIBaseNode**: 基础节点类,封装ArkUI原生节点操作 -- **NodeContent**: 内容容器,用于承载Native组件 - -### 3. 设计模式 -- **工厂模式**: 用于创建不同类型的布局示例 -- **单例模式**: NativeEntry采用单例模式管理全局状态 -- **模板方法模式**: 统一的创建和销毁流程 - -## 开发环境要求 - -- **HarmonyOS SDK**: 6.0.0(49) 或更高版本 -- **DevEco Studio**: 最新版本 -- **编译器**: BiSheng (用于Native编译) -- **目标设备**: 支持HarmonyOS的移动设备 - -## 构建和运行 - -### 1. 环境准备 -```bash -# 确保已安装DevEco Studio和HarmonyOS开发工具包 -# 配置好开发环境和设备连接 -``` - -### 2. 项目构建 -```bash -# 连接HarmonyOS设备或启动模拟器 -# 点击构建按钮进行构建 -``` - -### 3. 安装运行 -```bash -# 连接HarmonyOS设备或启动模拟器 -# 点击运行按钮安装并运行应用 -``` - -## 使用说明 - -### 1. 应用导航 -- 启动应用后,主页面显示两个主要入口: - - **NativeType测试**: 展示Native C++实现的布局示例 - - **Node测试**: 展示ArkTS Node API实现的布局示例 - -### 2. Native测试示例 -包含以下测试页面: -- `layoutConstraintTest`: 布局约束测试 -- `alignRuleOptionExample`: 对齐规则示例 -- `guidelineOptionExample`: 引导线示例 -- `barrierOptionExample`: 障碍物示例 -- `listChildrenMainSizeExample`: 列表子元素主尺寸示例 -- `itemAlignmentExample`: 项目对齐示例 -- `relativeLayoutChainExample`: 相对布局链示例 -- `positionEdgesExample`: 位置边缘示例 -- `pixelRoundExample`: 像素舍入示例 - -### 3. Node测试示例 -包含以下测试页面: -- `flex测试`: Flex布局测试 -- `stack测试`: Stack布局测试 -- `row测试`: Row布局测试 -- `column测试`: Column布局测试 -- `layoutPosition测试`: 布局位置测试 -- `safeArea测试`: 安全区域测试 -- `refreshOffsetEvent测试`: 刷新偏移事件测试 -- `layoutPolicy测试`: 布局策略测试 - -## 代码示例 - -### 1. Native C++布局示例 -```cpp -// 创建布局约束示例 -std::shared_ptr CreateLayoutConstraintExample() -{ - auto column = std::make_shared(); - auto child = std::make_shared(); - child->SetWidth(Sizes::EXTRA_LARGE); - child->SetHeight(Sizes::EXTRA_LARGE); - - // 应用布局约束 - auto values = column->layoutConstraintExample(child); - auto constraint = values.first; - auto size = values.second; - - // 显示约束信息 - auto sizeText = std::make_shared(); - sizeText->SetTextContent("Width : " + std::to_string(size.width) + - " Height : " + std::to_string(size.height)); - - column->AddChild(sizeText); - child->SetBackgroundColor(Colors::LIGHT_BLUE); - return column; -} -``` - -### 2. ArkTS页面示例 -```typescript -@Entry -@Component -struct layoutConstraintTest { - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - // 创建Native组件 - nativeNode.CreateLayoutConstraintNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - // 销毁Native组件 - nativeNode.DestroyLayoutConstraintNativeRoot() - } - - build() { - Column() { - Row() { - // 绑定Native内容 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} -``` - -## 学习要点 - -### 1. 布局基础概念 -- **约束系统**: 了解HarmonyOS的布局约束机制 -- **测量和布局**: 掌握组件的测量和布局流程 -- **坐标系统**: 了解屏幕坐标和组件坐标的关系 - -### 2. 性能优化 -- **Native实现**: 关键布局逻辑使用C++实现,提升性能 -- **内存管理**: 合理的组件生命周期管理 -- **渲染优化**: 减少不必要的重绘和重排 - -### 3. 开发实践 -- **混合开发**: ArkTS + Native C++的开发模式 -- **组件封装**: 可复用的布局组件设计 -- **调试技巧**: 布局问题的调试和定位方法 - -## 常见问题 - -### 1. 编译问题 -- 确保Native编译环境配置正确 -- 检查CMakeLists.txt配置是否正确 -- 验证SDK版本兼容性 - -### 2. 运行问题 -- 检查设备连接和权限设置 -- 确认应用签名配置 -- 查看日志输出定位问题 - -### 3. 布局问题 -- 理解不同布局组件的特性和限制 -- 注意约束冲突和优先级 -- 合理使用布局策略 - -## 扩展开发 - -### 1. 添加新的布局示例 -1. 在`cpp/examples/`目录下创建新的示例头文件 -2. 实现布局逻辑和UI展示 -3. 在`NativeEntry.cpp`中注册新的NAPI接口 -4. 创建对应的ArkTS测试页面 - -### 2. 自定义布局组件 -1. 继承`ArkUIBaseNode`创建自定义节点类 -2. 实现特定的布局算法 -3. 封装为可复用的组件 \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/build-profile.json5 b/ArkUIKit/LayoutSample/build-profile.json5 deleted file mode 100755 index 6f8f88a9a7b9e2c761e5f9c4c58353d0106f00fa..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/code-linter.json5 b/ArkUIKit/LayoutSample/code-linter.json5 deleted file mode 100755 index 4c531be90a6c875995767bd87f2de3cbd6b55160..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/.gitignore b/ArkUIKit/LayoutSample/entry/.gitignore deleted file mode 100755 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/build-profile.json5 b/ArkUIKit/LayoutSample/entry/build-profile.json5 deleted file mode 100755 index 15f2a74c67251fcabdb9bbac35e937a4237ccd22..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/build-profile.json5 +++ /dev/null @@ -1,60 +0,0 @@ - -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - }, - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/hvigorfile.ts b/ArkUIKit/LayoutSample/entry/hvigorfile.ts deleted file mode 100755 index 10f881f112b08550ed5c8a3ceb7d0148be2a0b6e..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/obfuscation-rules.txt b/ArkUIKit/LayoutSample/entry/obfuscation-rules.txt deleted file mode 100755 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/LayoutSample/entry/oh-package-lock.json5 b/ArkUIKit/LayoutSample/entry/oh-package-lock.json5 deleted file mode 100755 index e7c2cfa42de333c3b84b949d7022ed1276f39929..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/oh-package-lock.json5 +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry" - }, - "packages": { - "libentry.so@src/main/cpp/types/libentry": { - "name": "libentry.so", - "version": "1.0.0", - "resolved": "", - "registryType": "local" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/oh-package.json5 b/ArkUIKit/LayoutSample/entry/oh-package.json5 deleted file mode 100755 index 9cb2792ff360f4ebc41707b0baf669d6a19eb7f0..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/LayoutSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100755 index f4f30dcd128ef753461f393d40a9b012c48f5a6a..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(CAPI0805_2) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -find_library( - # Sets the name of the path variable. - hilog-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - hilog_ndk.z -) - -add_library(entry SHARED napi_init.cpp NativeEntry.cpp NativeEntry.h NativeModule.h nodes/ArkUINode.h nodes/ArkUINode.cpp examples/guidelineOptionExample.h examples/barrierOptionExample.h examples/listChildrenMainSizeExample.h nodes/ArkUIListNode.h examples/itemAlignmentExample.h nodes/ArkUIFlexNode.h examples/relativeLayoutChainExample.h examples/flexExample.h nodes/ArkUIStackNode.h examples/stackExample.h examples/rowExample.h examples/columnExample.h examples/layoutPositionExample.h nodes/ArkUICustomColumnNode.h examples/safeAreaExample.h examples/layoutPolicyExample.h examples/positionEdgesExample.h nodes/ArkUIButtonNode.h) -target_link_libraries(entry PUBLIC libace_napi.z.so libace_ndk.z.so ${hilog-lib} libhilog_ndk.z.so) \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/NativeEntry.cpp b/ArkUIKit/LayoutSample/entry/src/main/cpp/NativeEntry.cpp deleted file mode 100755 index 874a7464709d4af96aa066e9e7f2c7ee33a0f773..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/NativeEntry.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include "NativeEntry.h" -#include "examples/guidelineOptionExample.h" -#include "examples/layoutConstraintExample.h" -#include "examples/alignRuleOptionExample.h" -#include "examples/barrierOptionExample.h" -#include "examples/layoutPolicyExample.h" -#include "examples/listChildrenMainSizeExample.h" -#include "examples/itemAlignmentExample.h" -#include "examples/relativeLayoutChainExample.h" -#include "examples/flexExample.h" -#include "examples/stackExample.h" -#include "examples/rowExample.h" -#include "examples/columnExample.h" -#include "examples/layoutPositionExample.h" -#include "examples/safeAreaExample.h" -#include "examples/refreshOffsetChangeExample.h" -#include "examples/positionEdgesExample.h" -#include "examples/pixelRoundExample.h" - -namespace NativeModule { - -template -napi_value CreateNativeRootImpl(napi_env env, napi_callback_info info, CreateFuncType createFunc) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - /* 获取NAPI函数调用参数 */ - if (napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) != napi_ok) { - return nullptr; - } - ArkUI_NodeContentHandle contentHandle; - /* 从NAPI参数中获取NodeContent句柄 */ - if (OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle) != 0) { - return nullptr; - } - /* 创建指定模块的Native组件 */ - auto node = createFunc(); - /* 设置根节点 */ - NativeEntry::GetInstance()->SetRootNode(contentHandle, node); - return nullptr; -} - -napi_value DestroyNativeRootImpl(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) != napi_ok) { - return nullptr; - } - ArkUI_NodeContentHandle contentHandle; - if (OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle) != 0) { - return nullptr; - } - NativeEntry::GetInstance()->DisposeRootNode(contentHandle); - return nullptr; -} - -#define DEFINE_CREATE_DESTROY_FUNCTIONS(ModuleName, CreateFunc) \ - napi_value Create##ModuleName##NativeRoot(napi_env env, napi_callback_info info) { \ - return CreateNativeRootImpl(env, info, CreateFunc); \ - } \ - napi_value Destroy##ModuleName##NativeRoot(napi_env env, napi_callback_info info) { \ - return DestroyNativeRootImpl(env, info); \ - } - -// 布局约束模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(LayoutConstraint, CreateLayoutConstraintExample) -// 对齐规则模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(AlignRuleOption, CreateAlignRuleOptionExample) -// 引导线模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(GuidelineOption, CreateGuidelineOptionExample) -// 障碍物模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(BarrierOption, CreateBarrierOptionExample) -// 子元素主尺寸模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(ListChildrenMainSize, CreateListChildrenMainSizExample) -// 项目对齐模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(ItemAlignment, itemAligmentExample) -// 相对布局链模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(RelativeLayoutChain, RelativeLayoutChainExample) -// Flex布局模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(Flex, CreateFlexExample) -// Stack布局模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(Stack, CreateStackExample) -// Row布局模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(Row, CreateRowExample) -// Column布局模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(Column, CreateColumnExample) -// 布局位置模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(LayoutPosition, CreateLayoutPositionExample) -// 安全区域模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(SafeArea, SafeAreaExample) -// 刷新偏移事件模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(RefreshOffsetEvent, CreateRefreshOffsetEventExample) -// 布局策略模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(LayoutPolicy, CreateLayoutPolicyExample) -// 位置边缘模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(PositionEdges, CreatePositionEdgesExample) -// 像素舍入模块 -DEFINE_CREATE_DESTROY_FUNCTIONS(PixelRound, CreatePixelRoundExample) - -} // namespace NativeModule diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/NativeEntry.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/NativeEntry.h deleted file mode 100755 index 8b19796274103f68460a05da7bac546af2572b96..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/NativeEntry.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_NATIVEENTRY_H -#define MYAPPLICATION_NATIVEENTRY_H - -#include -#include -#include -#include - -namespace NativeModule { - -// 布局约束相关接口 -napi_value CreateLayoutConstraintNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyLayoutConstraintNativeRoot(napi_env env, napi_callback_info info); - -// 对齐规则相关接口 -napi_value CreateAlignRuleOptionNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyAlignRuleOptionNativeRoot(napi_env env, napi_callback_info info); - -// 引导线相关接口 -napi_value CreateGuidelineOptionNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyGuidelineOptionNativeRoot(napi_env env, napi_callback_info info); - -// 障碍物相关接口 -napi_value CreateBarrierOptionNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyBarrierOptionNativeRoot(napi_env env, napi_callback_info info); - -// 子元素主尺寸相关接口 -napi_value CreateListChildrenMainSizeNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyListChildrenMainSizeNativeRoot(napi_env env, napi_callback_info info); - -// 项目对齐相关接口 -napi_value CreateItemAlignmentNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyItemAlignmentNativeRoot(napi_env env, napi_callback_info info); - -// 相对布局链相关接口 -napi_value CreateRelativeLayoutChainNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyRelativeLayoutChainNativeRoot(napi_env env, napi_callback_info info); - -// Flex布局相关接口 -napi_value CreateFlexNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyFlexNativeRoot(napi_env env, napi_callback_info info); - -// Stack布局相关接口 -napi_value CreateStackNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyStackNativeRoot(napi_env env, napi_callback_info info); - -// Row布局相关接口 -napi_value CreateRowNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyRowNativeRoot(napi_env env, napi_callback_info info); - -// Column布局相关接口 -napi_value CreateColumnNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyColumnNativeRoot(napi_env env, napi_callback_info info); - -// 布局位置相关接口 -napi_value CreateLayoutPositionNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyLayoutPositionNativeRoot(napi_env env, napi_callback_info info); - -// 安全区域相关接口 -napi_value CreateSafeAreaNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroySafeAreaNativeRoot(napi_env env, napi_callback_info info); - -// 刷新偏移事件相关接口 -napi_value CreateRefreshOffsetEventNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyRefreshOffsetEventNativeRoot(napi_env env, napi_callback_info info); - -// 布局策略相关接口 -napi_value CreateLayoutPolicyNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyLayoutPolicyNativeRoot(napi_env env, napi_callback_info info); - -// 位置边缘相关接口 -napi_value CreatePositionEdgesNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyPositionEdgesNativeRoot(napi_env env, napi_callback_info info); - -// 像素舍入相关接口 -napi_value CreatePixelRoundNativeRoot(napi_env env, napi_callback_info info); -napi_value DestroyPixelRoundNativeRoot(napi_env env, napi_callback_info info); - -class NativeEntry { -public: - static NativeEntry *GetInstance() - { - static NativeEntry nativeEntry; - return &nativeEntry; - } - - // 使用 contentHandle 作为 key,支持多个页面 - void SetRootNode(ArkUI_NodeContentHandle contentHandle, const std::shared_ptr& node) - { - roots_[contentHandle] = node; - OH_ArkUI_NodeContent_AddNode(contentHandle, node->GetHandle()); - } - - void DisposeRootNode(ArkUI_NodeContentHandle contentHandle) - { - auto it = roots_.find(contentHandle); - if (it != roots_.end()) { - OH_ArkUI_NodeContent_RemoveNode(contentHandle, it->second->GetHandle()); - roots_.erase(it); - } - } - -private: - std::unordered_map> roots_; -}; - -} // namespace NativeModule - -#endif // MYAPPLICATION_NATIVE_ENTRY_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/NativeModule.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/NativeModule.h deleted file mode 100755 index db001e402d46d2a0d42b7cb8e02a4ea64d25c1d2..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/NativeModule.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_NATIVEMODULE_H -#define MYAPPLICATION_NATIVEMODULE_H - -#include -#include - -#include - -namespace NativeModule { - -class NativeModuleInstance { -public: - static NativeModuleInstance *GetInstance() - { - static NativeModuleInstance instance; - return &instance; - } - - NativeModuleInstance() - { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, arkUINativeNodeApi_); -#ifdef DEBUG - assert(arkUINativeNodeApi_); -#endif - } - // 暴露给其他模块使用。 - ArkUI_NativeNodeAPI_1 *GetNativeNodeAPI() { return arkUINativeNodeApi_; } - -private: - ArkUI_NativeNodeAPI_1 *arkUINativeNodeApi_ = nullptr; -}; - -} // namespace NativeModule - -#endif // MYAPPLICATION_NATIVEMODULE_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/LayoutConstants.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/LayoutConstants.h deleted file mode 100755 index 76d5430f135c19a58e7aad8b2f3017829af5e49c..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/LayoutConstants.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef LAYOUT_CONSTANTS_H -#define LAYOUT_CONSTANTS_H - -#include -#include -#include - -namespace LayoutConstants { - -// ==================== 颜色常量 ==================== -namespace Colors { -constexpr uint32_t LIGHT_GREEN = 0xFFA3CF62; -constexpr uint32_t TEAL = 0xFF00AE9D; -constexpr uint32_t BLUE = 0xFF0A59F7; - -constexpr uint32_t YELLOW = 0xFFFFFF00; -constexpr uint32_t RED = 0xFFFF0000; -constexpr uint32_t GREEN = 0xFF00FF00; -constexpr uint32_t LIGHT_GRAY = 0xFFDDDDDD; -constexpr uint32_t BEIGE = 0xFFF5DEB3; -constexpr uint32_t TAN = 0xFFD2B48C; -constexpr uint32_t LIGHT_BLUE = 0xFFAFEEEE; -constexpr uint32_t LIGHT_CYAN = 0xFFF0FAFF; - -constexpr uint32_t PURPLE = 0xFF800080; -constexpr uint32_t CYAN = 0xFF00FFFF; -constexpr uint32_t LIGHT_BROWN = 0xFFD2CAB3; -constexpr uint32_t SAGE_GREEN = 0xFFC1CBAC; -constexpr uint32_t BUTTON_BACKGROUND_COLOR = BLUE; - -// 颜色数组 -const std::vector STANDARD_COLORS = { LIGHT_GREEN, TEAL, BLUE }; -const std::vector ITEM_COLORS = { BEIGE, TAN, BEIGE, TAN }; -} // namespace Colors - -// ==================== 尺寸常量 ==================== -namespace Sizes { -// 基础尺寸 -constexpr float SMALL = 30.0f; -constexpr float MEDIUM = 50.0f; -constexpr float LARGE = 80.0f; -constexpr float EXTRA_LARGE = 100.0f; -constexpr float ULTRA_LARGE = 200.0f; -constexpr float GIANT = 300.0f; - -// 特定用途尺寸 -constexpr float BORDER_WIDTH = 2.0f; -constexpr float BORDER_WIDTH_THIN = 1.0f; -constexpr float MARGIN_SMALL = 5.0f; -constexpr float MARGIN_MEDIUM = 10.0f; -constexpr float PADDING_MEDIUM = 10.0f; - -// 高度变化 -constexpr float HEIGHT_SMALL = 20.0f; -constexpr float HEIGHT_LARGE = 70.0f; - -// 按钮样式 -constexpr float BUTTON_HEIGHT = 40.0f; -constexpr float BUTTON_WIDTH = 150.0f; - -// 特定偏移值 -constexpr float OFFSET_MEDIUM = 60.0f; - -// 字体大小 -constexpr float FONT_SIZE_SMALL = 16.0f; -constexpr float FONT_SIZE_MEDIUM = 20.0f; - -// 布局策略相关尺寸 -constexpr float CONSTRAINT_SIZE_SMALL = 150.0f; -constexpr float CONSTRAINT_SIZE_MEDIUM = 250.0f; - -// LayoutPosition相关尺寸 -constexpr int32_t LAYOUT_RECT_WIDTH = 900; -constexpr int32_t LAYOUT_RECT_HEIGHT = 200; - -constexpr int32_t POSITION_X = 30; -constexpr int32_t POSITION_Y = 30; - -constexpr int32_t ROW_COUNT = 9; - -constexpr int32_t ZERO = 0; - -} // namespace Sizes - -// ==================== 百分比常量 ==================== -namespace Percentages { -constexpr float FULL_WIDTH = 1.0f; -constexpr float NINETY_PERCENT = 0.9f; -constexpr float SEVENTY_PERCENT = 0.7f; -constexpr float SIXTY_PERCENT = 0.6f; -constexpr float TWENTY_PERCENT = 0.2f; - -// 边框百分比 -constexpr float BORDER_THIN = 0.005f; - -// 圆角百分比 -constexpr float RADIUS_SMALL = 0.1f; -constexpr float RADIUS_MEDIUM = 0.2f; -constexpr float RADIUS_LARGE = 0.3f; -constexpr float RADIUS_EXTRA_LARGE = 0.4f; - -// Flex收缩 -constexpr float FLEX_SHRINK_SMALL = 0.05f; -} // namespace Percentages - -// ==================== 数量常量 ==================== -namespace Counts { -constexpr int TEXT_NODES_SMALL = 2; -constexpr int TEXT_NODES_MEDIUM = 3; -constexpr int TEXT_NODES_LARGE = 4; -constexpr int TEXT_NODES_EXTRA_LARGE = 6; -constexpr int TEXT_NODES_MAX = 10; -} // namespace Counts - -// ==================== 文本常量 ==================== -namespace Texts { -// 标题文本 -const std::string TITLE_SET_POSITION = "SetPosition"; -const std::string TITLE_SET_OFFSET = "SetOffset"; -const std::string TITLE_SET_SIZE = "SetSize"; -const std::string TITLE_JUSTIFY_CONTENT = "justifyContent + alignItems"; -const std::string TITLE_BOTTOM_ALIGNMENT = "bottom alignment"; -const std::string TITLE_DIRECTION = "direction"; -const std::string TITLE_ALIGNMENT = "alignment"; -const std::string TITLE_ASPECT_RATIO = "aspect ratio"; -const std::string TITLE_BORDER_ALIGNSELF = "setborder and alignself test"; -const std::string TITLE_FLEX_GROW = "SetFlexGrow test"; -const std::string TITLE_FLEX_BASIS = "flexBasis test"; -const std::string TITLE_DISPLAY_PRIORITY = "display priority"; -const std::string TITLE_LAYOUT_POSITION = "setLayoutPosition"; - -// 内容文本 -const std::string CONTENT_POSITION = "position1 (30, 30)"; -const std::string CONTENT_OFFSET = "offset (60,60)"; -const std::string CONTENT_SIZE = "size (100*100)"; -const std::string CONTENT_RATIO = "ratio w/h=1.5"; -const std::string CONTENT_FLEX_GROW_2 = "flexGrow(2)"; -const std::string CONTENT_FLEX_GROW_1 = "flexGrow(1)"; -const std::string CONTENT_FLEX_BASIS_100 = "flexBasis(100)"; -const std::string CONTENT_FLEX_BASIS_AUTO = "flexBasis(auto)"; -const std::string CONTENT_STACK_FIRST = "first child, show in bottom"; -const std::string CONTENT_STACK_SECOND = "second child, show in top"; -} // namespace Texts - -// ==================== ID常量 ==================== -namespace IDs { -const std::string FATHER = "father"; -const std::string ROW_PREFIX = "row"; -const std::string TEXT_PREFIX = "text"; -const std::string DIRECTION_PREFIX = "direction"; -const std::string ALIGNMENT_PREFIX = "alignment"; -const std::string CHILD_PREFIX = "child"; -const std::string BARRIER_PREFIX = "barrier"; -} // namespace IDs - -// ==================== 索引常量 ==================== -namespace Indices { -constexpr int ZERO = 0; -constexpr int ONE = 1; -constexpr int TWO = 2; -constexpr int THREE = 3; -constexpr int FOUR = 4; -constexpr int FIVE = 5; -constexpr int SIX = 6; -constexpr int SEVEN = 7; -constexpr int EIGHT = 8; - -// 测试索引常量 -constexpr int BARRIER_TEST_INDEX = ZERO; -constexpr int REFERENCE_TEST_INDEX = ZERO; -} // namespace Indices - -// ==================== Flex相关常量 ==================== -namespace Flex { -constexpr int GROW_FACTOR_HIGH = 2; -constexpr int GROW_FACTOR_LOW = 1; -constexpr float BASIS_FIXED = 100.0f; -constexpr float ASPECT_RATIO_WIDE = 1.5f; -} // namespace Flex - -// ==================== 显示优先级常量 ==================== -namespace DisplayPriority { -constexpr int HIGH = 2; -constexpr int LOW = 1; -} // namespace DisplayPriority - -// ==================== 便利函数 ==================== -namespace Utils { - -inline std::string GenerateId(const std::string& prefix, int index) -{ - return prefix + std::to_string(index); -} - -inline std::string GenerateText(const std::string& prefix, int index) -{ - return prefix + std::to_string(index); -} - -inline float CalculateIncrementalSize(float base, int index, float increment = 10.0f) -{ - return base + index * increment; -} - -inline uint32_t GetCyclicColor(const std::vector& colors, int index) -{ - return colors[index % colors.size()]; -} -} // namespace Utils - -} // namespace LayoutConstants - -#endif // LAYOUT_CONSTANTS_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/alignRuleOptionExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/alignRuleOptionExample.h deleted file mode 100755 index 0ae90ca2134774b2879e48298118ee13c0f07df0..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/alignRuleOptionExample.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ALIGNRULEOPTIONEXAMPLE_REFACTORED_H -#define MYAPPLICATION_ALIGNRULEOPTIONEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRelativeContainerNode.h" -#include "nodes/ArkUITextNode.h" - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreateAlignRuleOptionExample() -{ - // 创建相对布局容器并设置ID - auto relativeContainer = std::make_shared(); - relativeContainer->SetId(IDs::FATHER.c_str()); - int id = 1; - // 创建第一个子列容器(黄色) - auto child1 = std::make_shared(); - child1->SetId(Utils::GenerateId(IDs::CHILD_PREFIX, id++).c_str()); - child1->SetWidth(Sizes::EXTRA_LARGE); - child1->SetHeight(Sizes::EXTRA_LARGE); - child1->SetBackgroundColor(Colors::YELLOW); - - // 创建第二个子列容器(紫色) - auto child2 = std::make_shared(); - child2->SetId(Utils::GenerateId(IDs::CHILD_PREFIX, id++).c_str()); - child2->SetWidth(Sizes::EXTRA_LARGE); - child2->SetHeight(Sizes::EXTRA_LARGE); - child2->SetBackgroundColor(Colors::PURPLE); - - // 创建第三个子列容器(青色) - auto child3 = std::make_shared(); - child3->SetId(Utils::GenerateId(IDs::CHILD_PREFIX, id++).c_str()); - child3->SetWidth(Sizes::EXTRA_LARGE); - child3->SetHeight(Sizes::EXTRA_LARGE); - child3->SetBackgroundColor(Colors::CYAN); - - // 应用对齐规则 - auto rules = relativeContainer->alignRuleOptionExample(child1, child2, child3); - - // 将子节点添加到相对布局容器中 - relativeContainer->AddChild(child1); - relativeContainer->AddChild(child2); - relativeContainer->AddChild(child3); - - // 创建显示对齐规则信息的文本节点 - auto rulesText = std::make_shared(); - rulesText->SetTextContent(rules); - relativeContainer->AddChild(rulesText); - - return relativeContainer; -} - -} // namespace NativeModule - -#endif \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/barrierOptionExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/barrierOptionExample.h deleted file mode 100755 index 4c0f3d689f476fe859d23c35605bafb9a79889b0..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/barrierOptionExample.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_BARRIEROPTIONEXAMPLE_H -#define CAPI0805_2_BARRIEROPTIONEXAMPLE_H - -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRelativeContainerNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIRowNode.h" -#include "LayoutConstants.h" - -namespace NativeModule { - -std::shared_ptr CreateBasicRowNode(int rowIndex, uint32_t backgroundColor) -{ - auto row = std::make_shared(); - auto text = std::make_shared(); - - text->SetTextContent(LayoutConstants::Utils::GenerateText(LayoutConstants::IDs::ROW_PREFIX, rowIndex)); - row->AddChild(text); - row->SetWidth(LayoutConstants::Sizes::EXTRA_LARGE); - row->SetHeight(LayoutConstants::Sizes::EXTRA_LARGE); - row->SetBackgroundColor(backgroundColor); - row->setJustifyContent(ArkUI_FlexAlignment::ARKUI_FLEX_ALIGNMENT_CENTER); - row->SetId(LayoutConstants::Utils::GenerateId(LayoutConstants::IDs::ROW_PREFIX, rowIndex).c_str()); - - return row; -} - -std::shared_ptr CreateRowWithAlignment(int rowIndex, uint32_t backgroundColor, const char *anchorId) -{ - auto row = CreateBasicRowNode(rowIndex, backgroundColor); - - // 设置对齐规则 - auto alignRules = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetCenterHorizontal(alignRules, anchorId, - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules, anchorId, ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_BOTTOM); - row->SetAlignRules(alignRules); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules); - - return row; -} - -// 在 CreateAndConfigureBarrier 函数中 -std::string CreateAndConfigureBarrier(std::shared_ptr container, - std::shared_ptr row1, std::shared_ptr row2) -{ - // 设置屏障 - auto barrier = OH_ArkUI_BarrierOption_Create(LayoutConstants::Counts::TEXT_NODES_SMALL); - std::string barrierId = - LayoutConstants::Utils::GenerateId(LayoutConstants::IDs::BARRIER_PREFIX, LayoutConstants::Indices::ONE); - OH_ArkUI_BarrierOption_SetId(barrier, barrierId.c_str(), LayoutConstants::Indices::ZERO); - barrierId = - LayoutConstants::Utils::GenerateId(LayoutConstants::IDs::BARRIER_PREFIX, LayoutConstants::Indices::TWO); - OH_ArkUI_BarrierOption_SetId(barrier, - barrierId.c_str(), - LayoutConstants::Indices::ONE); - OH_ArkUI_BarrierOption_SetReferencedId(barrier, row1->GetId(), LayoutConstants::Indices::ZERO); - OH_ArkUI_BarrierOption_SetReferencedId(barrier, row2->GetId(), LayoutConstants::Indices::ZERO); - OH_ArkUI_BarrierOption_SetReferencedId(barrier, row1->GetId(), LayoutConstants::Indices::ONE); - OH_ArkUI_BarrierOption_SetReferencedId(barrier, row2->GetId(), LayoutConstants::Indices::ONE); - OH_ArkUI_BarrierOption_SetDirection(barrier, ArkUI_BarrierDirection::ARKUI_BARRIER_DIRECTION_END, - LayoutConstants::Indices::ZERO); - OH_ArkUI_BarrierOption_SetDirection(barrier, ArkUI_BarrierDirection::ARKUI_BARRIER_DIRECTION_BOTTOM, - LayoutConstants::Indices::ONE); - - // 获取障碍物配置信息用于显示 - int barrierIndexTest = LayoutConstants::Indices::BARRIER_TEST_INDEX; - int refIdTest = LayoutConstants::Indices::REFERENCE_TEST_INDEX; - std::string barrierStyle = "Id: " + std::string(OH_ArkUI_BarrierOption_GetId(barrier, barrierIndexTest)); - barrierStyle += "\n"; - barrierStyle += "Direction: " + std::to_string(OH_ArkUI_BarrierOption_GetDirection(barrier, barrierIndexTest)); - barrierStyle += "\n"; - barrierStyle += - "ReferencedId: " + std::string(OH_ArkUI_BarrierOption_GetReferencedId(barrier, barrierIndexTest, refIdTest)); - barrierStyle += "\n"; - barrierStyle += - "ReferencedIdSize: " + std::to_string(OH_ArkUI_BarrierOption_GetReferencedIdSize(barrier, barrierIndexTest)); - - container->SetBarrier(barrier); - OH_ArkUI_BarrierOption_Dispose(barrier); - - return barrierStyle; -} - -std::shared_ptr CreateRow3WithBarrierAlignment(const char *anchorRowId) -{ - auto row3 = std::make_shared(); - auto text3 = std::make_shared(); - std::string content = - LayoutConstants::Utils::GenerateText(LayoutConstants::IDs::ROW_PREFIX, LayoutConstants::Indices::THREE); - text3->SetTextContent(content); - row3->AddChild(text3); - row3->setJustifyContent(ArkUI_FlexAlignment::ARKUI_FLEX_ALIGNMENT_CENTER); - row3->SetWidth(LayoutConstants::Sizes::EXTRA_LARGE); - row3->SetHeight(LayoutConstants::Sizes::EXTRA_LARGE); - row3->SetBackgroundColor(LayoutConstants::Colors::TAN); - - // 设置row3的对齐规则 - auto alignRules3 = OH_ArkUI_AlignmentRuleOption_Create(); - std::string barrierId = - LayoutConstants::Utils::GenerateId(LayoutConstants::IDs::BARRIER_PREFIX, LayoutConstants::Indices::ONE); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules3, barrierId.c_str(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules3, anchorRowId, - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - row3->SetAlignRules(alignRules3); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules3); - - return row3; -} - -std::shared_ptr CreateRow4WithBarrierAlignment(const char *anchorRowId) -{ - auto row4 = std::make_shared(); - auto text4 = std::make_shared(); - std::string content = - LayoutConstants::Utils::GenerateText(LayoutConstants::IDs::ROW_PREFIX, LayoutConstants::Indices::FOUR); - text4->SetTextContent(content); - row4->AddChild(text4); - row4->SetWidth(LayoutConstants::Sizes::MEDIUM); - row4->SetHeight(LayoutConstants::Sizes::MEDIUM); - row4->SetBackgroundColor(LayoutConstants::Colors::BLUE); - - // 设置row4的对齐规则 - auto alignRules4 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules4, anchorRowId, - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - std::string barrierId = - LayoutConstants::Utils::GenerateId(LayoutConstants::IDs::BARRIER_PREFIX, LayoutConstants::Indices::TWO); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules4, - barrierId.c_str(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_BOTTOM); - row4->SetAlignRules(alignRules4); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules4); - - return row4; -} - -void ConfigureRelativeContainerStyle(std::shared_ptr container) -{ - container->SetWidth(LayoutConstants::Sizes::GIANT); - container->SetHeight(LayoutConstants::Sizes::GIANT); - container->SetMargin(LayoutConstants::Sizes::ZERO, LayoutConstants::Sizes::ZERO, - LayoutConstants::Sizes::ZERO, LayoutConstants::Sizes::MEDIUM); - container->SetBorderColor(LayoutConstants::Colors::BLUE); // 这个颜色在LayoutConstants中没有定义,保持原样 - container->SetBorderWidth(LayoutConstants::Sizes::BORDER_WIDTH); -} - -std::shared_ptr CreateBarrierOptionExample() -{ - // 创建主列容器 - auto column = std::make_shared(); - - // 创建相对布局容器并设置ID - auto relativeContainer = std::make_shared(); - relativeContainer->SetId(LayoutConstants::IDs::FATHER.c_str()); - - // 创建row1和row2 - auto row1 = CreateBasicRowNode(LayoutConstants::Indices::ONE, LayoutConstants::Colors::GREEN); - auto row2 = CreateRowWithAlignment(LayoutConstants::Indices::TWO, LayoutConstants::Colors::TEAL, row1->GetId()); - - relativeContainer->AddChild(row1); - relativeContainer->AddChild(row2); - - // 创建并配置障碍物 - std::string barrierStyle = CreateAndConfigureBarrier(relativeContainer, row1, row2); - - // 创建row3和row4 - auto row3 = CreateRow3WithBarrierAlignment(row1->GetId()); - auto row4 = CreateRow4WithBarrierAlignment(row1->GetId()); - - // 创建显示障碍物配置信息的文本节点 - auto text5 = std::make_shared(); - text5->SetTextContent(barrierStyle); - - relativeContainer->AddChild(row3); - relativeContainer->AddChild(row4); - - // 配置容器样式 - ConfigureRelativeContainerStyle(relativeContainer); - - column->AddChild(relativeContainer); - column->AddChild(text5); - - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_BARRIEROPTIONEXAMPLE_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/columnExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/columnExample.h deleted file mode 100755 index a8f4d19bfff37598a6ffc52459f3e563330d513f..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/columnExample.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_COLUMNEXAMPLE_REFACTORED_H -#define CAPI0805_2_COLUMNEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRowNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIStackNode.h" -#include - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreateTitleText(const std::string& titleText) -{ - auto title = std::make_shared(); - title->SetTextContent(titleText); - return title; -} - -std::shared_ptr CreateBaseContainer() -{ - auto container = std::make_shared(); - container->SetPercentWidth(Percentages::NINETY_PERCENT); - container->SetBorderWidth(Sizes::BORDER_WIDTH); - container->SetMargin(Sizes::MARGIN_MEDIUM); - return container; -} - -std::shared_ptr CreatePositionSection() -{ - auto positionColumn = CreateBaseContainer(); - - auto positionText = std::make_shared(); - positionText->SetBackgroundColor(Colors::YELLOW); - positionText->SetTextContent(Texts::CONTENT_POSITION); - positionText->SetPosition(Sizes::SMALL, Sizes::SMALL); - - positionColumn->AddChild(positionText); - positionColumn->SetHeight(Sizes::EXTRA_LARGE); - - return positionColumn; -} - -std::shared_ptr CreateOffsetSection() -{ - auto offsetColumn = CreateBaseContainer(); - - auto offsetText = std::make_shared(); - offsetText->SetTextContent(Texts::CONTENT_OFFSET); - offsetText->SetPosition(Sizes::ZERO, Sizes::ZERO); //初始位置为(0,0) - offsetText->SetOffset(Sizes::OFFSET_MEDIUM, Sizes::OFFSET_MEDIUM); // 特定偏移值 - offsetText->SetBackgroundColor(Colors::GREEN); - - offsetColumn->AddChild(offsetText); - offsetColumn->SetHeight(Sizes::EXTRA_LARGE); - - return offsetColumn; -} - -std::shared_ptr CreateSizeSection() -{ - auto sizeColumn = CreateBaseContainer(); - - auto sizeText = std::make_shared(); - sizeText->SetTextContent(Texts::CONTENT_SIZE); - sizeText->SetBackgroundColor(Colors::YELLOW); - sizeText->SetSize(Sizes::EXTRA_LARGE, Sizes::EXTRA_LARGE); - - sizeColumn->AddChild(sizeText); - - return sizeColumn; -} - -std::shared_ptr CreateJustifyContentSection() -{ - auto justifyColumn = CreateBaseContainer(); - std::vector> justifyText(Counts::TEXT_NODES_MEDIUM); - - for (int i = 0; i < Counts::TEXT_NODES_MEDIUM; i++) { - justifyText[i] = std::make_shared(); - std::string id = Utils::GenerateId(IDs::TEXT_PREFIX, i); - justifyText[i]->SetTextContent(id); - justifyText[i]->SetWidth(Utils::CalculateIncrementalSize(Sizes::MEDIUM, i, Sizes::MEDIUM)); - justifyText[i]->SetBackgroundColor(Utils::GetCyclicColor(Colors::STANDARD_COLORS, i)); - justifyColumn->AddChild(justifyText[i]); - } - - justifyColumn->SetColumnJustifyContent(ARKUI_FLEX_ALIGNMENT_START); - justifyColumn->SetColumnAlignItems(ARKUI_HORIZONTAL_ALIGNMENT_END); - justifyColumn->SetHeight(Sizes::EXTRA_LARGE); - - return justifyColumn; -} - -std::shared_ptr CreateColumnExample() -{ - auto column = std::make_shared(); - - // 第一部分:位置设置 - column->AddChild(CreateTitleText(Texts::TITLE_SET_POSITION)); - column->AddChild(CreatePositionSection()); - - // 第二部分:偏移量设置 - column->AddChild(CreateTitleText(Texts::TITLE_SET_OFFSET)); - column->AddChild(CreateOffsetSection()); - - // 第三部分:尺寸调整 - column->AddChild(CreateTitleText(Texts::TITLE_SET_SIZE)); - column->AddChild(CreateSizeSection()); - - // 第四部分:内容对齐 - column->AddChild(CreateTitleText(Texts::TITLE_JUSTIFY_CONTENT)); - column->AddChild(CreateJustifyContentSection()); - - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_COLUMNEXAMPLE_REFACTORED_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/flexExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/flexExample.h deleted file mode 100755 index 0814289078640a4f68f1a39e89d2d485c1c422c4..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/flexExample.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_FLEXEXAMPLE_REFACTORED_H -#define CAPI0805_2_FLEXEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRelativeContainerNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIRowNode.h" - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreateFlexTitle(const std::string &titleText) -{ - auto title = std::make_shared(); - title->SetTextContent(titleText); - return title; -} - -std::shared_ptr CreateBasicFlexRow(int index, float width, float height) -{ - auto row = std::make_shared(); - row->SetWidth(width); - row->SetHeight(height); - row->SetBackgroundColor(Utils::GetCyclicColor(Colors::STANDARD_COLORS, index)); - - std::string id = Utils::GenerateId(IDs::ROW_PREFIX, index + 1); - row->SetId(id.c_str()); - - auto text = std::make_shared(); - text->SetTextContent(id); - row->AddChild(text); - row->setJustifyContent(ARKUI_FLEX_ALIGNMENT_CENTER); - - return row; -} - -void ConfigureRowRadius(std::vector>& rows) -{ - // 设置圆角 - rows[Indices::ONE]->SetBorderRadiusPercent(Percentages::RADIUS_SMALL); - rows[Indices::TWO]->SetBorderRadiusPercent(Percentages::RADIUS_SMALL, Percentages::RADIUS_MEDIUM, - Percentages::RADIUS_LARGE, Percentages::RADIUS_EXTRA_LARGE); -} - -void ConfigureRowAlignSelf(std::vector>& rows) -{ - rows[Indices::ZERO]->SetAlignSelf(ArkUI_ItemAlignment::ARKUI_ITEM_ALIGNMENT_STRETCH); - rows[Indices::ONE]->SetAlignSelf(ArkUI_ItemAlignment::ARKUI_ITEM_ALIGNMENT_CENTER); - rows[Indices::ZERO]->SetFlexShrink(Percentages::FLEX_SHRINK_SMALL); -} - -std::shared_ptr CreateBorderAlignSelfSection() -{ - auto flex = std::make_shared(); - flex->SetId(Utils::GenerateId(IDs::ROW_PREFIX, Indices::ZERO).c_str()); - flex->SetBorderWidthPercent(Percentages::BORDER_THIN, - Percentages::BORDER_THIN, Percentages::BORDER_THIN, Percentages::BORDER_THIN); - std::vector> rows(Counts::TEXT_NODES_EXTRA_LARGE); - - for (int i = 0; i < Counts::TEXT_NODES_LARGE; i++) { - float width = Utils::CalculateIncrementalSize(Sizes::LARGE, i); - float height = Utils::CalculateIncrementalSize(Sizes::LARGE, i); - rows[i] = CreateBasicFlexRow(i, width, height); - flex->AddChild(rows[i]); - } - - ConfigureRowRadius(rows); - ConfigureRowAlignSelf(rows); - - return flex; -} - -std::shared_ptr CreateFlexGrowSection() -{ - auto flex = std::make_shared(); - flex->SetBorderWidthPercent(Percentages::BORDER_THIN); - std::vector> rowGrow(Counts::TEXT_NODES_SMALL); - for (int i = 0; i < Counts::TEXT_NODES_SMALL; i++) { - rowGrow[i] = std::make_shared(); - rowGrow[i]->SetBackgroundColor(Utils::GetCyclicColor(Colors::STANDARD_COLORS, i)); - rowGrow[i]->SetHeight(Sizes::EXTRA_LARGE); - rowGrow[i]->setJustifyContent(ARKUI_FLEX_ALIGNMENT_CENTER); - flex->AddChild(rowGrow[i]); - } - - // 设置Flex增长 - rowGrow[Indices::ZERO]->SetFlexGrow(Flex::GROW_FACTOR_HIGH); - rowGrow[Indices::ONE]->SetFlexGrow(Flex::GROW_FACTOR_LOW); - - auto textGrow0 = std::make_shared(); - textGrow0->SetTextContent(Texts::CONTENT_FLEX_GROW_2); - rowGrow[Indices::ZERO]->AddChild(textGrow0); - - auto textGrow1 = std::make_shared(); - textGrow1->SetTextContent(Texts::CONTENT_FLEX_GROW_1); - rowGrow[Indices::ONE]->AddChild(textGrow1); - - flex->SetBackgroundColor(Colors::RED); - return flex; -} - -std::shared_ptr CreateFlexBasisSection() -{ - auto flex = std::make_shared(); - - auto text0 = std::make_shared(); - text0->SetTextContent(Texts::CONTENT_FLEX_BASIS_100); - text0->SetBackgroundColor(Colors::BEIGE); - text0->SetTextAlignment(ArkUI_TextAlignment::ARKUI_TEXT_ALIGNMENT_CENTER); - text0->SetHeight(Sizes::EXTRA_LARGE); - text0->SetFlexBasis(Flex::BASIS_FIXED); - flex->AddChild(text0); - - auto text1 = std::make_shared(); - text1->SetTextContent(Texts::CONTENT_FLEX_BASIS_AUTO); - text1->SetHeight(Sizes::EXTRA_LARGE); - text1->SetPercentWidth(Percentages::SIXTY_PERCENT); - text1->SetBackgroundColor(Colors::TAN); - text1->SetTextAlignment(ArkUI_TextAlignment::ARKUI_TEXT_ALIGNMENT_CENTER); - flex->AddChild(text1); - - return flex; -} - -std::shared_ptr CreateDisplayPrioritySection() -{ - auto flex = std::make_shared(); - std::vector> priorityRows(Counts::TEXT_NODES_SMALL); - - for (int i = 0; i < Counts::TEXT_NODES_SMALL; i++) { - priorityRows[i] = std::make_shared(); - priorityRows[i]->SetBackgroundColor(Utils::GetCyclicColor(Colors::STANDARD_COLORS, i)); - priorityRows[i]->SetHeight(Sizes::EXTRA_LARGE); - priorityRows[i]->setJustifyContent(ARKUI_FLEX_ALIGNMENT_CENTER); - - auto priorityText = std::make_shared(); - int priority = (i == 0) ? DisplayPriority::HIGH : DisplayPriority::LOW; - priorityText->SetTextContent(Utils::GenerateText("priority", priority)); - priorityRows[i]->AddChild(priorityText); - - priorityRows[i]->SetDisplayPriority(priority); - flex->AddChild(priorityRows[i]); - } - - return flex; -} - -std::shared_ptr CreateFlexExample() -{ - auto column = std::make_shared(); - - // 第一部分:边框和自对齐 - column->AddChild(CreateFlexTitle(Texts::TITLE_BORDER_ALIGNSELF)); - column->AddChild(CreateBorderAlignSelfSection()); - - // 第二部分:Flex增长因子 - column->AddChild(CreateFlexTitle(Texts::TITLE_FLEX_GROW)); - column->AddChild(CreateFlexGrowSection()); - - // 第三部分:Flex基础尺寸 - column->AddChild(CreateFlexTitle(Texts::TITLE_FLEX_BASIS)); - column->AddChild(CreateFlexBasisSection()); - - // 第四部分:显示优先级 - column->AddChild(CreateFlexTitle(Texts::TITLE_DISPLAY_PRIORITY)); - column->AddChild(CreateDisplayPrioritySection()); - - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_FLEXEXAMPLE_REFACTORED_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/guidelineOptionExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/guidelineOptionExample.h deleted file mode 100755 index d5210332d81f61afad297596f3ba3a3668f8358b..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/guidelineOptionExample.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_GUIDELINEOPTIONEXAMPLE_REFACTORED_H -#define CAPI0805_2_GUIDELINEOPTIONEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRelativeContainerNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIRowNode.h" - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreateGuidelineOptionExample() -{ - auto column = std::make_shared(); - - // 创建相对布局容器并设置ID - auto relativeContainer = std::make_shared(); - relativeContainer->SetId("relativeContainer"); - - // 创建Row节点并设置属性 - auto row = std::make_shared(); - row->SetHeight(Sizes::EXTRA_LARGE); - row->SetWidth(Sizes::EXTRA_LARGE); - row->SetBackgroundColor(Colors::GREEN); - row->SetId(Utils::GenerateId(IDs::ROW_PREFIX, 1).c_str()); - - // 应用引导线选项 - auto value = relativeContainer->guidelineOptionExample(row); - - // 创建显示引导线信息的文本节点 - auto text = std::make_shared(); - text->SetTextContent(value); - column->AddChild(text); - - // 将Row节点添加到相对布局容器中 - relativeContainer->AddChild(row); - - // 设置相对布局容器的属性 - relativeContainer->SetWidth(Sizes::GIANT); - relativeContainer->SetHeight(Sizes::GIANT); - relativeContainer->SetMargin(0, 0, 0, Sizes::MEDIUM); - relativeContainer->SetBorderWidth(Sizes::BORDER_WIDTH); - relativeContainer->SetBorderColor(Colors::BLUE); - column->AddChild(relativeContainer); - - return column; -} - -} // namespace NativeModule - -#endif // CAPI0805_2_GUIDELINEOPTIONEXAMPLE_REFACTORED_H diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/itemAlignmentExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/itemAlignmentExample.h deleted file mode 100755 index 21523017e65a039818919d72faf3c9f6ecc7cc77..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/itemAlignmentExample.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_ITEMALIGNMENTEXAMPLE_REFACTORED_H -#define CAPI0805_2_ITEMALIGNMENTEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUITextNode.h" -#include - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr itemAligmentExample() -{ - auto column = std::make_shared(); - auto flex = std::make_shared(); - std::vector> text(Counts::TEXT_NODES_MAX); - - // 创建10个文本节点并添加到Flex容器中 - for (int i = 0; i < Counts::TEXT_NODES_MAX; i++) { - text[i] = std::make_shared(); - text[i]->SetTextContent(std::to_string(i)); - text[i]->SetPercentWidth(Percentages::TWENTY_PERCENT); - text[i]->SetHeight(Sizes::MEDIUM); - text[i]->SetBackgroundColor(Utils::GetCyclicColor(Colors::ITEM_COLORS, i)); - flex->AddChild(text[i]); - } - - // 设置Flex容器属性 - flex->SetHeight(Sizes::HEIGHT_LARGE); - flex->SetPercentWidth(Percentages::NINETY_PERCENT); - flex->SetPadding(Sizes::PADDING_MEDIUM); - flex->SetBackgroundColor(Colors::LIGHT_BLUE); - - // 设置Flex布局样式 - // 参数:方向、换行、主轴对齐、交叉轴对齐、内容对齐 - flex->SetFlexStyle(ARKUI_FLEX_DIRECTION_ROW, ARKUI_FLEX_WRAP_WRAP, ARKUI_FLEX_ALIGNMENT_START, - ARKUI_ITEM_ALIGNMENT_CENTER, ARKUI_FLEX_ALIGNMENT_SPACE_BETWEEN); - column->AddChild(flex); - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_ITEMALIGNMENTEXAMPLE_REFACTORED_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/layoutConstraintExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/layoutConstraintExample.h deleted file mode 100755 index 032f63c41bb3c8a96f0253e009dc1ddc809bd86e..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/layoutConstraintExample.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_LAYOUTCONSTRAINTEXAMPLE_REFACTORED_H -#define MYAPPLICATION_LAYOUTCONSTRAINTEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUITextNode.h" - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreateLayoutConstraintExample() -{ - auto column = std::make_shared(); - // 创建子列容器并设置固定尺寸 - auto child = std::make_shared(); - child->SetWidth(Sizes::EXTRA_LARGE); - child->SetHeight(Sizes::EXTRA_LARGE); - - // 创建布局约束示例 - auto values = column->layoutConstraintExample(child); - auto constraint = values.first; // 约束信息 - auto size = values.second; // 尺寸信息 - - auto sizeText = std::make_shared(); - sizeText->SetTextContent("Width : " + std::to_string(size.width) + " Height : " + std::to_string(size.height)); - - auto constraintText = std::make_shared(); - constraintText->SetTextContent(constraint); - - column->AddChild(sizeText); - column->AddChild(constraintText); - - child->SetBackgroundColor(Colors::LIGHT_BLUE); - return column; -} - -} // namespace NativeModule - -#endif \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/layoutPolicyExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/layoutPolicyExample.h deleted file mode 100755 index dc68e72b7f5fb491ef83710e4d728b61038ca754..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/layoutPolicyExample.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI_0922_LAYOUTPOLICYEXAMPLE_REFACTORED_H -#define CAPI_0922_LAYOUTPOLICYEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRowNode.h" -#include "nodes/ArkUIStackNode.h" -#include "nodes/ArkUITextNode.h" -#include - - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreatePolicyTitle(const std::string& titleText) -{ - auto title = std::make_shared(); - title->SetTextContent(titleText); - return title; -} - -std::shared_ptr CreateMainContainer() -{ - auto column = std::make_shared(); - column->SetWidth(Sizes::ULTRA_LARGE); // 特定容器宽度 - column->SetHeight(Sizes::ULTRA_LARGE); // 特定容器高度 - column->SetPadding(Sizes::MARGIN_MEDIUM); - column->SetBorderWidth(Sizes::BORDER_WIDTH); - return column; -} - -std::shared_ptr CreateMatchParentExample() -{ - // matchParent生效时,当前组件会与其父组件内容区大小(180vp * 180vp)相等, - // 同时依旧受自身constraintSize(150vp * 150vp)约束,因此当前组件大小为150vp - // * 150vp - auto matchParentFlex = std::make_shared(); - matchParentFlex->SetBackgroundColor(Colors::RED); - matchParentFlex->SetWidthLayoutPolicy(ARKUI_LAYOUTPOLICY_MATCHPARENT); - matchParentFlex->SetHeightLayoutPolicy(ARKUI_LAYOUTPOLICY_MATCHPARENT); - matchParentFlex->SetConstraintSize(Sizes::CONSTRAINT_SIZE_SMALL, Sizes::CONSTRAINT_SIZE_SMALL, - Sizes::CONSTRAINT_SIZE_SMALL, Sizes::CONSTRAINT_SIZE_SMALL); // 特定约束尺寸 - return matchParentFlex; -} - -std::shared_ptr CreateWrapContentExample() -{ - // wrapContent生效时,当前组件会与其子组件大小(300vp * 300vp)相等, - // 但不能超过父组件内容大小(180vp * 180vp)且会受自身constraintSize(250vp * - // 250vp)约束, 因此当前组件大小为180vp * 180vp - auto wrapContentRow = std::make_shared(); - auto wrapContentFlex = std::make_shared(); - - wrapContentFlex->SetWidth(Sizes::ULTRA_LARGE); - wrapContentFlex->SetHeight(Sizes::ULTRA_LARGE); - wrapContentRow->AddChild(wrapContentFlex); - - wrapContentRow->SetBackgroundColor(Colors::BLUE); - wrapContentRow->SetWidthLayoutPolicy(ARKUI_LAYOUTPOLICY_WRAPCONTENT); - wrapContentRow->SetHeightLayoutPolicy(ARKUI_LAYOUTPOLICY_WRAPCONTENT); - wrapContentRow->SetConstraintSize(0, Sizes::CONSTRAINT_SIZE_MEDIUM, 0, Sizes::CONSTRAINT_SIZE_MEDIUM); // 特定约束尺寸 - - return wrapContentRow; -} - -std::shared_ptr CreateFixAtIdealSizeExample() -{ - // fixAtIdealSize生效时,当前组件会与其子组件大小(300vp * 300vp)相等, - // 可以超过父组件内容大小(180vp * 180vp)但会受自身constraintSize(250vp * - // 250vp)约束, 因此当前组件大小为250vp * 250vp - auto fixAtIdealSizeRow = std::make_shared(); - auto fixAtIdealSizeFlex = std::make_shared(); - - fixAtIdealSizeFlex->SetWidth(Sizes::GIANT); - fixAtIdealSizeFlex->SetHeight(Sizes::GIANT); - fixAtIdealSizeRow->AddChild(fixAtIdealSizeFlex); - - fixAtIdealSizeRow->SetBackgroundColor(Colors::LIGHT_CYAN); - fixAtIdealSizeRow->SetWidthLayoutPolicy(ARKUI_LAYOUTPOLICY_FIXATIDEALSIZE); - fixAtIdealSizeRow->SetHeightLayoutPolicy(ARKUI_LAYOUTPOLICY_FIXATIDEALSIZE); - fixAtIdealSizeRow->SetConstraintSize(0, Sizes::CONSTRAINT_SIZE_MEDIUM, 0, Sizes::CONSTRAINT_SIZE_MEDIUM); // 特定约束尺寸 - - return fixAtIdealSizeRow; -} - -std::shared_ptr CreateLayoutPolicyExample() -{ - auto column = CreateMainContainer(); - - // MatchParent策略示例 - column->AddChild(CreatePolicyTitle("matchParent")); - column->AddChild(CreateMatchParentExample()); - - // WrapContent策略示例 - column->AddChild(CreatePolicyTitle("wrapContentText")); - column->AddChild(CreateWrapContentExample()); - - // FixAtIdealSize策略示例 - column->AddChild(CreatePolicyTitle("fixAtIdealSize")); - column->AddChild(CreateFixAtIdealSizeExample()); - - return column; -} - -} // namespace NativeModule -#endif // CAPI_0922_LAYOUTPOLICYEXAMPLE_REFACTORED_H diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/layoutPositionExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/layoutPositionExample.h deleted file mode 100755 index 1d4eb0a48cafb4fcc5c93f7da4ab3724f50d5d0c..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/layoutPositionExample.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_LAYOUTPOSITIONEXAMPLE_REFACTORED_H -#define CAPI0805_2_LAYOUTPOSITIONEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIButtonNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUICustomColumnNode.h" -#include "nodes/ArkUIRowNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIStackNode.h" -#include -#include - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreateStyledButton(const std::string& text, std::function onClickCallback) -{ - auto button = std::make_shared(); - button->SetTextContent(text); - button->SetBackgroundColor(Colors::BUTTON_BACKGROUND_COLOR); - button->SetWidth(Sizes::BUTTON_WIDTH); // 特定按钮宽度 - button->SetHeight(Sizes::BUTTON_HEIGHT); - button->SetMargin(Sizes::MARGIN_SMALL); - button->SetOnClick(onClickCallback); - return button; -} - -std::shared_ptr CreateStyledTextNode(const std::string& text, uint32_t color) -{ - auto textNode = std::make_shared(); - textNode->SetTextContent(text); - textNode->SetBackgroundColor(color); - textNode->SetWidth(Sizes::EXTRA_LARGE); - textNode->SetHeight(Sizes::MEDIUM); - textNode->SetTextAlign(ARKUI_TEXT_ALIGNMENT_CENTER); - return textNode; -} - -std::shared_ptr CreateIdTextNode(const std::string& id, uint32_t color) -{ - auto textNode = CreateStyledTextNode(id, color); - textNode->SetId(id.c_str()); - return textNode; -} - -std::shared_ptr CreateTitleNode(const std::string& title) -{ - auto titleNode = std::make_shared(); - titleNode->SetTextContent(title); - return titleNode; -} - -std::pair, std::vector>>CreateCustomColumn() -{ - auto layoutPosColumn = std::make_shared(); - std::vector> layPosText; - - // 创建带颜色的文本节点 - for (size_t i = 0; i < Colors::STANDARD_COLORS.size(); i++) { - std::string id = Utils::GenerateId(IDs::TEXT_PREFIX, i); - auto textNode = CreateIdTextNode(id, Colors::STANDARD_COLORS[i]); - layPosText.push_back(textNode); - layoutPosColumn->AddChild(textNode); - } - - // 设置布局列属性 - layoutPosColumn->SetMargin(Sizes::MARGIN_MEDIUM); - layoutPosColumn->SetBorderWidth(Sizes::BORDER_WIDTH); - layoutPosColumn->SetLayoutWeight(1); - layoutPosColumn->SetHeight(Sizes::EXTRA_LARGE); - - return std::make_pair(layoutPosColumn, layPosText); -} - -void AddLayoutControlButtons(std::shared_ptr column, - std::shared_ptr layoutPosColumn, - const std::vector>& layPosText) -{ - // 布局按钮 - column->AddChild(CreateStyledButton( - "layout", [layoutPosColumn]() { layoutPosColumn->SetOffsetCustom(Sizes::EXTRA_LARGE, Sizes::EXTRA_LARGE); })); - - // 获取布局大小按钮 - column->AddChild(CreateStyledButton("layoutSize", [layPosText]() { - auto value = layPosText[Indices::TWO]->GetLayoutSize(); - OH_LOG_INFO(LOG_APP, "%{public}s", value.c_str()); - })); - - // 获取布局位置按钮 - column->AddChild(CreateStyledButton("GetLayoutPositionOH", [layPosText]() { - auto value = layPosText[Indices::TWO]->GetLayoutPositionOH(); - OH_LOG_INFO(LOG_APP, "%{public}s", value.c_str()); - })); - - // 获取布局位置按钮 - column->AddChild(CreateStyledButton("GetLayoutPosition", [layPosText]() { - auto value = layPosText[Indices::TWO]->GetLayoutPosition(); - OH_LOG_INFO(LOG_APP, "%{public}s", value.c_str()); - })); -} - -void AddScreenPositionButtons(std::shared_ptr column, - const std::vector>& layPosText) -{ - // 获取屏幕布局位置按钮 - column->AddChild(CreateStyledButton("GetLayPosInScr", [layPosText]() { - auto value = layPosText[Indices::TWO]->GetLayoutPositionInScreen(); - OH_LOG_INFO(LOG_APP, "%{public}s", value.c_str()); - })); - - // GetPositionWithTranslateInScreen - column->AddChild(CreateStyledButton("GetPosWthTrInScr", [layPosText]() { - auto value = layPosText[Indices::TWO]->GetPositionWithTranslateInScreen(); - OH_LOG_INFO(LOG_APP, "%{public}s", value.c_str()); - })); - - // GetPosToParent - column->AddChild( - CreateStyledButton("GetPosToParent", [layPosText]() { layPosText[Indices::TWO]->GetPositionToParent(); })); -} - -void AddCallbackButtons(std::shared_ptr column, - std::shared_ptr layoutPosColumn) -{ - // OH_ArkUI_RegisterLayoutCallbackOnNodeHandle() - column->AddChild( - CreateStyledButton("registerCallback", [layoutPosColumn]() { layoutPosColumn->SetRegisterLayoutCallback(); })); - - column->AddChild(CreateStyledButton("UnregisterCallback", - [layoutPosColumn]() { layoutPosColumn->SetUnregisterLayoutCallback(); })); -} - -std::shared_ptr CreateLayoutRectSection() -{ - auto layRectColumn = std::make_shared(); - auto layRectText = std::make_shared(); - - layRectText->SetTextContent("position(30, 30) rect(900, 200) px"); - layRectText->SetBackgroundColor(Colors::YELLOW); - layRectText->SetLayoutRect(Sizes::POSITION_X, Sizes::POSITION_Y, - Sizes::LAYOUT_RECT_WIDTH, Sizes::LAYOUT_RECT_HEIGHT); - layRectColumn->AddChild(layRectText); - - // 设置布局矩形列属性 - layRectColumn->SetPercentWidth(Percentages::NINETY_PERCENT); - layRectColumn->SetHeight(Sizes::EXTRA_LARGE); - layRectColumn->SetBorderWidth(Sizes::BORDER_WIDTH); - layRectColumn->SetMargin(Sizes::MARGIN_MEDIUM); - - return layRectColumn; -} - -std::shared_ptr CreateLayoutPositionExample() -{ - auto column = std::make_shared(); - - // 添加标题 - auto layPosTitle = CreateTitleNode(Texts::TITLE_LAYOUT_POSITION); - column->AddChild(layPosTitle); - - // 创建布局位置列和文本节点 - auto [layoutPosColumn, layPosText] = CreateCustomColumn(); - column->AddChild(layoutPosColumn); - - // 添加各种按钮 - AddLayoutControlButtons(column, layoutPosColumn, layPosText); - AddScreenPositionButtons(column, layPosText); - AddCallbackButtons(column, layoutPosColumn); - - // 添加布局矩形区域 - auto layRectTitle = CreateTitleNode("layout rect"); - column->AddChild(layRectTitle); - - auto layRectColumn = CreateLayoutRectSection(); - column->AddChild(layRectColumn); - - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_LAYOUTPOSITIONEXAMPLE_REFACTORED_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/listChildrenMainSizeExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/listChildrenMainSizeExample.h deleted file mode 100755 index a52c4c02d9de75d369a3964a4c67309eb72e1141..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/listChildrenMainSizeExample.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_LISTCHILDRENMAINSIZEEXAMPLE_REFACTORED_H -#define CAPI0805_2_LISTCHILDRENMAINSIZEEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRelativeContainerNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIRowNode.h" -#include "nodes/ArkUIListNode.h" - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreateListItem(int index) -{ - auto child = std::make_shared(); - auto text = std::make_shared(); - - // 设置文本内容和样式 - text->SetTextContent("item-" + std::to_string(index)); - text->SetHeight(Sizes::MEDIUM); - text->SetPercentWidth(Percentages::NINETY_PERCENT); - text->SetFontSize(Sizes::FONT_SIZE_SMALL); // 特定字体大小 - text->SetBorderRadius(Sizes::MARGIN_MEDIUM); - text->SetBackgroundColor(Colors::LIGHT_GRAY); - text->SetTextAlignment(ARKUI_TEXT_ALIGNMENT_CENTER); - - // 设置列表项样式 - child->AddChild(text); - child->SetMargin(Sizes::MARGIN_MEDIUM); - - return child; -} - -std::shared_ptr CreateConfiguredList() -{ - auto list = std::make_shared(); - - // 创建50个列表项 - for (int i = 0; i < Counts::TEXT_NODES_MAX * 5; i++) { // 50个项目 - auto listItem = CreateListItem(i); - list->AddChild(listItem); - } - - return list; -} - -void ConfigureListProperties(std::shared_ptr list) -{ - // 设置列表基本属性 - list->SetLayoutWeight(1); - list->SetScrollBar(ARKUI_SCROLL_BAR_DISPLAY_MODE_AUTO); - - // 设置列表项对齐方式 - list->SetListItemAlign(ARKUI_LIST_ITEM_ALIGNMENT_CENTER); -} - -std::shared_ptr CreateInfoTextNode(const std::string& info) -{ - auto text = std::make_shared(); - text->SetTextContent(info); - return text; -} - -std::shared_ptr CreateListChildrenMainSizExample() -{ - auto column = std::make_shared(); - auto list = CreateConfiguredList(); - ConfigureListProperties(list); - - // 设置子元素主尺寸示例 - auto value = list->SetChildrenMainSizeExample(); - column->AddChild(list); - auto infoText = CreateInfoTextNode(value); - column->AddChild(infoText); - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_LISTCHILDRENMAINSIZEEXAMPLE_REFACTORED_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/pixelRoundExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/pixelRoundExample.h deleted file mode 100755 index 77faba6810e230f8d19a57d3ab651f10a5421792..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/pixelRoundExample.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI_0922_PIXELROUNDEXAMPLE_REFACTORED_H -#define CAPI_0922_PIXELROUNDEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIButtonNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRelativeContainerNode.h" -#include "nodes/ArkUITextNode.h" - -namespace NativeModule { - -using namespace LayoutConstants; - -// 常量定义 -namespace PixelRoundConstants { -constexpr float DIVISION_FACTOR = 3.25f; -constexpr float INCREMENT = 0.1f; -constexpr float SPECIFIC_HEIGHT = 300.6f; -constexpr int BUTTON_WIDTH = 200; -} // namespace PixelRoundConstants - -// 像素舍入管理类 - 封装所有状态和UI组件 -class PixelRoundManager { -public: - // 状态变量 - float width; - bool isPixelRound; - std::string currentState; - - // UI组件 - std::shared_ptr titleText; - std::shared_ptr currentStateText; - std::shared_ptr buttonPixelRound; - std::shared_ptr pixelRoundRow; - std::shared_ptr pixelRoundFather; - - PixelRoundManager() : width(Sizes::GIANT), isPixelRound(true), currentState("current is pixelRound") {} - - // 更新宽度 - void UpdateWidth() - { - width += PixelRoundConstants::INCREMENT; - pixelRoundFather->SetWidth(width / PixelRoundConstants::DIVISION_FACTOR); - titleText->SetTextContent("current width " + std::to_string(width) + "\n"); - } - - // 设置像素舍入策略 - void SetPixelRoundPolicy(bool enablePixelRound) - { - if (enablePixelRound) { - pixelRoundRow->SetPixelRoundExample( - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL, - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL); - pixelRoundFather->SetPixelRoundExample( - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL, - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL); - } else { - pixelRoundRow->SetPixelRoundExample( - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND); - pixelRoundFather->SetPixelRoundExample( - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND); - } - } - - // 切换像素舍入状态 - void TogglePixelRoundState() - { - isPixelRound = !isPixelRound; - - if (isPixelRound) { - currentState = "current is pixelRound"; - currentStateText->SetTextContent(currentState); - buttonPixelRound->SetTextContent("click change to no pixelRound"); - } else { - currentState = "current is not pixelRound"; - currentStateText->SetTextContent(currentState); - buttonPixelRound->SetTextContent("click change to pixelRound"); - } - - SetPixelRoundPolicy(isPixelRound); - } -}; - -// 创建标题文本组件 -std::shared_ptr CreateTitleText(float width) -{ - auto titleText = std::make_shared(); - titleText->SetTextContent("current width " + std::to_string(width) + "\n"); - return titleText; -} - -// 创建像素舍入子组件 -std::shared_ptr CreatePixelRoundRow(const std::string& currentState, - std::shared_ptr& currentStateText) -{ - auto pixelRoundRow = std::make_shared(); - currentStateText = std::make_shared(); - currentStateText->SetTextContent(currentState); - - pixelRoundRow->AddChild(currentStateText); - pixelRoundRow->SetPercentWidth(Percentages::FULL_WIDTH); - pixelRoundRow->SetPercentHeight(Percentages::FULL_WIDTH); - pixelRoundRow->SetBackgroundColor(Colors::YELLOW); - - // 设置像素舍入示例 - pixelRoundRow->SetPixelRoundExample(ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL, - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL); - - return pixelRoundRow; -} - -// 创建像素舍入父组件 -std::shared_ptr CreatePixelRoundFather(std::shared_ptr pixelRoundRow, float width) -{ - auto pixelRoundFather = std::make_shared(); - pixelRoundFather->AddChild(pixelRoundRow); - pixelRoundFather->SetBackgroundColor(Colors::RED); - - // 像素取整时,父子组件会存在1px的差值 - pixelRoundFather->SetWidth(width / PixelRoundConstants::DIVISION_FACTOR); - pixelRoundFather->SetHeight(PixelRoundConstants::SPECIFIC_HEIGHT / PixelRoundConstants::DIVISION_FACTOR); - pixelRoundFather->SetPixelRoundExample( - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL, - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL); - - return pixelRoundFather; -} - -// 创建宽度增加按钮 -std::shared_ptr CreateWidthIncrementButton(std::shared_ptr manager) -{ - auto buttonText = std::make_shared(); - buttonText->SetTextContent("width +0.1"); - buttonText->SetWidth(PixelRoundConstants::BUTTON_WIDTH); - buttonText->SetHeight(Sizes::BUTTON_HEIGHT); - buttonText->SetBackgroundColor(Colors::BUTTON_BACKGROUND_COLOR); - buttonText->SetMargin(Sizes::MARGIN_MEDIUM); - - // Lambda只需要捕获一个manager对象 - buttonText->SetOnClick([manager]() { - manager->UpdateWidth(); - }); - - return buttonText; -} - -// 创建像素舍入切换按钮 -std::shared_ptr CreatePixelRoundToggleButton(std::shared_ptr manager) -{ - auto buttonPixelRound = std::make_shared(); - buttonPixelRound->SetTextContent("click change to no pixelRound"); - buttonPixelRound->SetWidth(PixelRoundConstants::BUTTON_WIDTH); - buttonPixelRound->SetHeight(Sizes::BUTTON_HEIGHT); - buttonPixelRound->SetBackgroundColor(Colors::BUTTON_BACKGROUND_COLOR); - buttonPixelRound->SetMargin(Sizes::MARGIN_MEDIUM); - buttonPixelRound->SetButtonType(ARKUI_BUTTON_TYPE_CAPSULE); - - // Lambda只需要捕获一个manager对象 - buttonPixelRound->SetOnClick([manager]() { - manager->TogglePixelRoundState(); - }); - - return buttonPixelRound; -} - -std::shared_ptr CreatePixelRoundExample() -{ - // 创建管理器对象,通过shared_ptr确保生命周期 - auto manager = std::make_shared(); - - auto column = std::make_shared(); - - // 创建各个组件 - manager->titleText = CreateTitleText(manager->width); - manager->pixelRoundRow = CreatePixelRoundRow(manager->currentState, manager->currentStateText); - manager->pixelRoundFather = CreatePixelRoundFather(manager->pixelRoundRow, manager->width); - - auto buttonText = CreateWidthIncrementButton(manager); - manager->buttonPixelRound = CreatePixelRoundToggleButton(manager); - - // 将组件添加到主列容器中 - column->AddChild(manager->titleText); - column->AddChild(manager->pixelRoundFather); - column->AddChild(buttonText); - column->AddChild(manager->buttonPixelRound); - - // 创建显示像素舍入配置信息的文本节点 - auto valueText = std::make_shared(); - auto value = manager->pixelRoundRow->SetPixelRoundExample( - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL, - ARKUI_PIXELROUNDCALCPOLICY_NOFORCEROUND, ARKUI_PIXELROUNDCALCPOLICY_FORCECEIL); - valueText->SetTextContent(value); - column->AddChild(valueText); - - return column; -} - -} // namespace NativeModule -#endif // CAPI_0922_PIXELROUNDEXAMPLE_REFACTORED_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/positionEdgesExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/positionEdgesExample.h deleted file mode 100755 index c1005eda0891671bc97241add6ca87dc9c6e5c03..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/positionEdgesExample.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI_0922_POSITIONEDGESEXAMPLE_REFACTORED_H -#define CAPI_0922_POSITIONEDGESEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRelativeContainerNode.h" -#include "nodes/ArkUITextNode.h" -#include -#include - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreatePositionEdgesExample() -{ - auto column = std::make_shared(); - auto positionEdgesTitle = std::make_shared(); - positionEdgesTitle->SetTextContent("position use edges"); - column->AddChild(positionEdgesTitle); - - // 创建行容器作为位置边缘的父组件 - auto positionEdgesRow = std::make_shared(); - positionEdgesRow->SetPercentWidth(Percentages::NINETY_PERCENT); - positionEdgesRow->SetHeight(Sizes::EXTRA_LARGE); - positionEdgesRow->SetBorderWidth(Sizes::BORDER_WIDTH_THIN); - positionEdgesRow->SetBorderStyle(ARKUI_BORDER_STYLE_DASHED); - column->AddChild(positionEdgesRow); - - std::vector contents = {"bottom:0, right:0", "top:0, left:0", "top:50, left:100", "bottom:0, left:30"}; - std::vector> positionEdgesTexts(Counts::TEXT_NODES_LARGE); - for (int i = 0; i < Counts::TEXT_NODES_LARGE; i++) { - positionEdgesTexts[i] = std::make_shared(); - positionEdgesTexts[i]->SetTextAlign(ArkUI_TextAlignment::ARKUI_TEXT_ALIGNMENT_CENTER); - positionEdgesTexts[i]->SetBackgroundColor(Utils::GetCyclicColor(Colors::ITEM_COLORS, i)); - positionEdgesTexts[i]->SetTextContent(contents[i]); - positionEdgesTexts[i]->SetBorderWidth(Sizes::BORDER_WIDTH_THIN); - positionEdgesRow->AddChild(positionEdgesTexts[i]); - } - - // 设置各个文本节点的位置边缘 - positionEdgesTexts[Indices::ZERO]->SetPositionEdgesExample(-1, -1, 0, 0); // 右下角 - positionEdgesTexts[Indices::ONE]->SetPositionEdgesExample(0, 0, -1, -1); // 左上角 - positionEdgesTexts[Indices::TWO]->SetPositionEdgesExample(Sizes::MEDIUM, Sizes::EXTRA_LARGE, -1, -1); - auto value = - positionEdgesTexts[Indices::THREE]->SetPositionEdgesExample(-1, Sizes::SMALL, 0, -1); // 距离底部0,左侧30 - - // 创建显示位置边缘配置信息的文本节点 - auto text = std::make_shared(); - text->SetTextContent(value); - column->AddChild(text); - - return column; -} - -} // namespace NativeModule - -#endif // CAPI_0922_POSITIONEDGESEXAMPLE_REFACTORED_H diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/refreshOffsetChangeExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/refreshOffsetChangeExample.h deleted file mode 100755 index e49e92966bc052b3459ead5396e0d87950feb26a..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/refreshOffsetChangeExample.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_VISIBLEAREACHANGE_REFACTORED_H -#define CAPI0805_2_VISIBLEAREACHANGE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIListNode.h" -#include - -namespace NativeModule { - -using namespace LayoutConstants; - -// 常量定义 -namespace RefreshConstants { -constexpr int LIST_ITEM_COUNT = 50; -constexpr int BUTTON_WIDTH = 200; -constexpr int TEXT_FONT_SIZE = 16; -constexpr uint32_t LIST_BACKGROUND_COLOR = 0xFF808080; -constexpr float VISIBLE_AREA_RATIO = 0.5f; -constexpr float OFFSET_INCREMENT = 10.0f; -} // namespace RefreshConstants - -std::shared_ptr CreateRefreshListItemText(int index) -{ - auto text = std::make_shared(); - text->SetTextContent("item-" + std::to_string(index)); - text->SetHeight(Sizes::EXTRA_LARGE); - text->SetPercentWidth(Percentages::NINETY_PERCENT); - text->SetFontSize(RefreshConstants::TEXT_FONT_SIZE); - text->SetBorderRadius(Sizes::MARGIN_MEDIUM); - text->SetBackgroundColor(Colors::LIGHT_GRAY); - text->SetTextAlignment(ARKUI_TEXT_ALIGNMENT_CENTER); - - // 注册事件 - text->SetRegisterRefreshEvent(); - text->SetVisibleAreaChangeRatio(RefreshConstants::VISIBLE_AREA_RATIO); - text->SetRegisterVisibleAreaChangeEvent(); - - return text; -} - -std::shared_ptr CreateRefreshListItem(std::shared_ptr text) -{ - auto child = std::make_shared(); - child->AddChild(text); - child->SetMargin(Sizes::MARGIN_MEDIUM); - return child; -} - -struct ListWithTexts { - std::shared_ptr list; - std::vector> texts; -}; - -ListWithTexts CreateRefreshPopulatedList() -{ - auto list = std::make_shared(); - std::vector> texts; - - // 创建列表项 - for (int i = 0; i < RefreshConstants::LIST_ITEM_COUNT; ++i) { - auto text = CreateRefreshListItemText(i); - auto listItem = CreateRefreshListItem(text); - list->AddChild(listItem); - texts.push_back(text); - } - - return {list, texts}; -} - -void ConfigureRefreshListProperties(std::shared_ptr list) -{ - list->SetBackgroundColor(RefreshConstants::LIST_BACKGROUND_COLOR); - list->SetLayoutWeight(1); - list->SetScrollBar(ARKUI_SCROLL_BAR_DISPLAY_MODE_AUTO); - list->SetListItemAlign(ARKUI_LIST_ITEM_ALIGNMENT_CENTER); -} - -std::shared_ptr CreateRefreshOffsetButton(const std::vector>& texts) -{ - auto btn = std::make_shared(); - btn->SetTextContent("refreshOffset+50"); - btn->SetWidth(RefreshConstants::BUTTON_WIDTH); - btn->SetHeight(Sizes::MEDIUM); - btn->SetBackgroundColor(Colors::YELLOW); - - // 使用shared_ptr管理偏移量 - auto offset = std::make_shared(Sizes::MEDIUM); - btn->SetOnClick([offset, texts]() { - texts[Indices::ZERO]->SetRefreshOffset(*offset); - *offset += RefreshConstants::OFFSET_INCREMENT; - }); - - return btn; -} - -std::shared_ptr CreateRefreshOffsetEventExample() -{ - auto column = std::make_shared(); - - // 创建并配置列表 - 使用结构体避免C++17结构化绑定 - ListWithTexts listData = CreateRefreshPopulatedList(); - ConfigureRefreshListProperties(listData.list); - column->AddChild(listData.list); - - // 创建按钮 - auto button = CreateRefreshOffsetButton(listData.texts); - column->AddChild(button); - - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_VISIBLEAREACHANGE_REFACTORED_H diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/relativeLayoutChainExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/relativeLayoutChainExample.h deleted file mode 100755 index a7db89f6637aa8f0ec2b0e3e69f13448a6a6eb62..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/relativeLayoutChainExample.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_RELATIVELAYOUTCHAINEXAMPLE_REFACTORED_H -#define CAPI0805_2_RELATIVELAYOUTCHAINEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRelativeContainerNode.h" -#include "nodes/ArkUITextNode.h" -#include - -namespace NativeModule { - -using namespace LayoutConstants; - -std::vector> CreateRowNodes() -{ - std::vector> rows(Sizes::ROW_COUNT); - - for (int i = 0; i < Sizes::ROW_COUNT; i++) { - rows[i] = std::make_shared(); - rows[i]->SetWidth(Sizes::LARGE); - rows[i]->SetHeight(Sizes::LARGE); - rows[i]->SetBackgroundColor(Utils::GetCyclicColor(Colors::STANDARD_COLORS, i)); - - std::string id = Utils::GenerateId(IDs::ROW_PREFIX, i + 1); - rows[i]->SetId(id.c_str()); - - auto text = std::make_shared(); - text->SetTextContent(id); - rows[i]->AddChild(text); - rows[i]->setJustifyContent(ARKUI_FLEX_ALIGNMENT_CENTER); - } - - return rows; -} - -void SetupTopRowChain(std::vector>& rows, - std::shared_ptr container) -{ - // 设置第0个Row节点的对齐规则和链模式 - auto alignRules0 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules0, "__container__", - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules0, rows[Indices::ONE]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules0, "__container__", - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - rows[Indices::ZERO]->SetAlignRules(alignRules0); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules0); - rows[Indices::ZERO]->SetChainMode(ArkUI_Axis::ARKUI_AXIS_HORIZONTAL, - ArkUI_RelativeLayoutChainStyle::ARKUI_RELATIVE_LAYOUT_CHAIN_STYLE_SPREAD); - - // 设置第1个Row节点的对齐规则 - auto alignRules1 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules1, rows[Indices::ZERO]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules1, rows[Indices::TWO]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules1, rows[Indices::ZERO]->GetId(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - rows[Indices::ONE]->SetAlignRules(alignRules1); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules1); - - // 设置第2个Row节点的对齐规则 - auto alignRules2 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules2, rows[Indices::ONE]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules2, container->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules2, rows[Indices::ZERO]->GetId(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - rows[Indices::TWO]->SetAlignRules(alignRules2); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules2); -} - -void SetupMiddleRowChain(std::vector>& rows, - std::shared_ptr container) -{ - // 设置第3个Row节点的对齐规则和链模式 - auto alignRules3 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules3, container->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules3, rows[Indices::FOUR]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - OH_ArkUI_AlignmentRuleOption_SetCenterVertical(alignRules3, container->GetId(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_CENTER); - rows[Indices::THREE]->SetAlignRules(alignRules3); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules3); - rows[Indices::THREE]->SetChainMode(ArkUI_Axis::ARKUI_AXIS_HORIZONTAL, - ArkUI_RelativeLayoutChainStyle::ARKUI_RELATIVE_LAYOUT_CHAIN_STYLE_SPREAD_INSIDE); - - // 设置第4个Row节点的对齐规则 - auto alignRules4 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules4, rows[Indices::THREE]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules4, rows[Indices::FIVE]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules4, rows[Indices::THREE]->GetId(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - rows[Indices::FOUR]->SetAlignRules(alignRules4); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules4); - - // 设置第5个Row节点的对齐规则 - auto alignRules5 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules5, rows[Indices::FOUR]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules5, container->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules5, rows[Indices::THREE]->GetId(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - rows[Indices::FIVE]->SetAlignRules(alignRules5); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules5); -} - -void SetupBottomRowChain(std::vector>& rows, - std::shared_ptr container) -{ - // 设置第6个Row节点的对齐规则和链模式 - auto alignRules6 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules6, "__container__", - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules6, rows[Indices::SEVEN]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - OH_ArkUI_AlignmentRuleOption_SetBottom(alignRules6, "__container__", - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_BOTTOM); - rows[Indices::SIX]->SetAlignRules(alignRules6); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules6); - rows[Indices::SIX]->SetChainMode(ArkUI_Axis::ARKUI_AXIS_HORIZONTAL, - ArkUI_RelativeLayoutChainStyle::ARKUI_RELATIVE_LAYOUT_CHAIN_STYLE_PACKED); - - // 设置第7个Row节点的对齐规则 - auto alignRules7 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules7, rows[Indices::SIX]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules7, rows[Indices::EIGHT]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_START); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules7, rows[Indices::SIX]->GetId(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - rows[Indices::SEVEN]->SetAlignRules(alignRules7); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules7); - - // 设置第8个Row节点的对齐规则 - auto alignRules8 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules8, rows[Indices::SEVEN]->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules8, container->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules8, rows[Indices::SIX]->GetId(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - rows[Indices::EIGHT]->SetAlignRules(alignRules8); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules8); -} - -void ConfigureContainer(std::shared_ptr container) -{ - container->SetWidth(Sizes::GIANT); - container->SetHeight(Sizes::GIANT); - container->SetMargin(0, 0, 0, Sizes::MEDIUM); - container->SetBorderWidth(Sizes::BORDER_WIDTH); - container->SetBorderColor(Colors::BLUE); - container->SetBorderStyle(ARKUI_BORDER_STYLE_SOLID, ARKUI_BORDER_STYLE_DASHED, - ARKUI_BORDER_STYLE_DOTTED, ARKUI_BORDER_STYLE_SOLID); -} - -std::shared_ptr RelativeLayoutChainExample() -{ - // 创建容器 - auto relativeContainer = std::make_shared(); - relativeContainer->SetId("__container__"); - - // 创建行节点 - auto rows = CreateRowNodes(); - - // 将行节点添加到容器 - for (auto& row : rows) { - relativeContainer->AddChild(row); - } - - // 设置各行链的对齐规则 - SetupTopRowChain(rows, relativeContainer); - SetupMiddleRowChain(rows, relativeContainer); - SetupBottomRowChain(rows, relativeContainer); - - // 配置容器属性 - ConfigureContainer(relativeContainer); - - return relativeContainer; -} - -} // namespace NativeModule - -#endif // CAPI0805_2_RELATIVELAYOUTCHAINEXAMPLE_REFACTORED_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/rowExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/rowExample.h deleted file mode 100755 index bc6acbbf7959acb66237415ace1eca083bd1a61e..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/rowExample.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_ROWEXAMPLE_REFACTORED_H -#define CAPI0805_2_ROWEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRowNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIStackNode.h" -#include - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreateMainColumn() { return std::make_shared(); } - -void CreateBottomAlignExample(std::shared_ptr column) -{ - auto bottomAlign = std::make_shared(); - bottomAlign->SetTextContent(Texts::TITLE_BOTTOM_ALIGNMENT); - column->AddChild(bottomAlign); - - auto row = std::make_shared(); - std::vector> text(Counts::TEXT_NODES_MEDIUM); - - // 创建文本节点 - for (int i = 0; i < Counts::TEXT_NODES_MEDIUM; i++) { - text[i] = std::make_shared(); - text[i]->SetWidth(Sizes::MEDIUM); - text[i]->SetHeight(Utils::CalculateIncrementalSize(Sizes::MEDIUM, i, Sizes::MEDIUM)); - text[i]->SetBackgroundColor(Utils::GetCyclicColor(Colors::STANDARD_COLORS, i)); - row->AddChild(text[i]); - } - - // 设置行属性 - row->SetRowAlignItems(ARKUI_VERTICAL_ALIGNMENT_BOTTOM); - row->SetMargin(Sizes::MARGIN_MEDIUM); - column->AddChild(row); -} - -void CreateDirectionExample(std::shared_ptr column) -{ - auto directionText = std::make_shared(); - directionText->SetTextContent(Texts::TITLE_DIRECTION); - column->AddChild(directionText); - - auto directionRow = std::make_shared(); - directionRow->SetDirection(ARKUI_DIRECTION_RTL); - - // 创建方向文本节点 - std::vector> directText(Counts::TEXT_NODES_MEDIUM); - for (int i = 0; i < Counts::TEXT_NODES_MEDIUM; i++) { - directText[i] = std::make_shared(); - std::string id = Utils::GenerateId(IDs::DIRECTION_PREFIX, i); - directText[i]->SetTextContent(id.c_str()); - directText[i]->SetBackgroundColor(Utils::GetCyclicColor(Colors::STANDARD_COLORS, i)); - directText[i]->SetMargin(Sizes::MARGIN_MEDIUM); - directionRow->AddChild(directText[i]); - } - - // 设置方向行属性 - directionRow->SetPercentWidth(Percentages::NINETY_PERCENT); - directionRow->SetHeight(Sizes::EXTRA_LARGE); - directionRow->SetBorderWidth(Sizes::BORDER_WIDTH); - directionRow->SetMargin(Sizes::MARGIN_MEDIUM); - column->AddChild(directionRow); -} - -void CreateAlignmentExample(std::shared_ptr column) -{ - auto alignTitle = std::make_shared(); - alignTitle->SetTextContent(Texts::TITLE_ALIGNMENT); - column->AddChild(alignTitle); - - auto alignRow = std::make_shared(); - std::vector> alignText(Counts::TEXT_NODES_MEDIUM); - alignRow->SetAlignment(ARKUI_ALIGNMENT_TOP_START); - - // 创建对齐文本节点 - for (int i = 0; i < Counts::TEXT_NODES_MEDIUM; i++) { - alignText[i] = std::make_shared(); - alignText[i]->SetBackgroundColor(Utils::GetCyclicColor(Colors::STANDARD_COLORS, i)); - std::string id = Utils::GenerateId(IDs::ALIGNMENT_PREFIX, i); - alignText[i]->SetTextContent(id.c_str()); - alignText[i]->SetHeight(Utils::CalculateIncrementalSize(Sizes::HEIGHT_SMALL, i, Sizes::HEIGHT_SMALL)); - alignText[i]->SetAlignment(ARKUI_ALIGNMENT_TOP_START); - alignRow->AddChild(alignText[i]); - } - - // 设置对齐行属性 - alignRow->SetPercentWidth(Percentages::NINETY_PERCENT); - alignRow->SetHeight(Sizes::EXTRA_LARGE); - alignRow->SetBorderWidth(Sizes::BORDER_WIDTH); - alignRow->SetMargin(Sizes::MARGIN_MEDIUM); - column->AddChild(alignRow); -} - -void CreateAspectRatioExample(std::shared_ptr column) -{ - // 添加标题 - auto aspectRatioTitle = std::make_shared(); - aspectRatioTitle->SetTextContent(Texts::TITLE_ASPECT_RATIO); - column->AddChild(aspectRatioTitle); - - // 创建宽高比行容器 - auto aspRatioRow = std::make_shared(); - auto aspRatioText = std::make_shared(); - aspRatioText->SetTextContent(Texts::CONTENT_RATIO); - aspRatioText->SetAspectRatio(Flex::ASPECT_RATIO_WIDE); - aspRatioText->SetWidth(Sizes::EXTRA_LARGE); - aspRatioText->SetBackgroundColor(Colors::YELLOW); - aspRatioRow->AddChild(aspRatioText); - - // 设置宽高比行属性 - aspRatioRow->SetPercentWidth(Percentages::NINETY_PERCENT); - aspRatioRow->SetHeight(Sizes::EXTRA_LARGE); - aspRatioRow->SetBorderWidth(Sizes::BORDER_WIDTH); - aspRatioRow->SetMargin(Sizes::MARGIN_MEDIUM); - column->AddChild(aspRatioRow); -} - -std::shared_ptr CreateRowExample() -{ - auto column = CreateMainColumn(); - - // 创建各种示例 - CreateBottomAlignExample(column); - CreateDirectionExample(column); - CreateAlignmentExample(column); - CreateAspectRatioExample(column); - - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_ROWEXAMPLE_REFACTORED_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/safeAreaExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/safeAreaExample.h deleted file mode 100755 index a1ae4edeced1315a3265d891ba3c1c4888c3a7a5..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/safeAreaExample.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_SAFEAREAEXAMPLE_REFACTORED_H -#define CAPI0805_2_SAFEAREAEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIListNode.h" -#include - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr SafeAreaExample() -{ - auto column = std::make_shared(); - auto title = std::make_shared(); - title->SetTextContent("expand safe area top edge"); - title->SetFontSize(Sizes::FONT_SIZE_MEDIUM); - column->AddChild(title); - column->SetPercentHeight(Percentages::FULL_WIDTH); - column->SetPercentWidth(Percentages::FULL_WIDTH); - column->SetBackgroundColor(Colors::BEIGE); - column->SetExpandSafeArea(ARKUI_SAFE_AREA_TYPE_SYSTEM, ARKUI_SAFE_AREA_EDGE_TOP); - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_SAFEAREAEXAMPLE_REFACTORED_H diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/stackExample.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/stackExample.h deleted file mode 100755 index 8358bf4c9d60a66dd0abcf3e82c02df5c19e1110..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/examples/stackExample.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_STACKEXAMPLE_REFACTORED_H -#define CAPI0805_2_STACKEXAMPLE_REFACTORED_H - -#include "LayoutConstants.h" -#include "nodes/ArkUIBaseNode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUITextNode.h" -#include "nodes/ArkUIStackNode.h" -#include - -namespace NativeModule { - -using namespace LayoutConstants; - -std::shared_ptr CreateStackExample() -{ - auto column = std::make_shared(); - auto stack = std::make_shared(); - - std::vector> text(Counts::TEXT_NODES_SMALL); - for (int i = 0; i < Counts::TEXT_NODES_SMALL; i++) { - text[i] = std::make_shared(); - stack->AddChild(text[i]); - } - - // 设置第一个文本节点(底部显示) - text[Indices::ZERO]->SetTextContent(Texts::CONTENT_STACK_FIRST); - text[Indices::ZERO]->SetPercentWidth(Percentages::NINETY_PERCENT); - text[Indices::ZERO]->SetPercentHeight(Percentages::FULL_WIDTH); - text[Indices::ZERO]->SetBackgroundColor(Colors::LIGHT_BROWN); - text[Indices::ZERO]->SetStackAlignContent(ARKUI_ALIGNMENT_TOP); - - // 设置第二个文本节点(顶部显示) - text[Indices::ONE]->SetTextContent(Texts::CONTENT_STACK_SECOND); - text[Indices::ONE]->SetPercentWidth(Percentages::SEVENTY_PERCENT); - text[Indices::ONE]->SetPercentHeight(Percentages::SIXTY_PERCENT); - text[Indices::ONE]->SetBackgroundColor(Colors::SAGE_GREEN); - text[Indices::ONE]->SetAlignment(ARKUI_ALIGNMENT_TOP); - - column->AddChild(stack); - return column; -} - -} // namespace NativeModule -#endif // CAPI0805_2_STACKEXAMPLE_REFACTORED_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/LayoutSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100755 index 23f1a34e30674148cb109ec2ac802ca25b7d4847..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include "NativeEntry.h" - -// C语言链接声明开始 -EXTERN_C_START - -#define REGISTER_COMPONENT(name) \ - {"Create" #name "NativeRoot", nullptr, NativeModule::Create##name##NativeRoot, \ - nullptr, nullptr, nullptr, napi_default, nullptr}, \ - {"Destroy" #name "NativeRoot", nullptr, NativeModule::Destroy##name##NativeRoot, \ - nullptr, nullptr, nullptr, napi_default, nullptr} - -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - // 布局相关组件 - REGISTER_COMPONENT(LayoutConstraint), - REGISTER_COMPONENT(AlignRuleOption), - REGISTER_COMPONENT(GuidelineOption), - REGISTER_COMPONENT(BarrierOption), - - // 列表和对齐相关组件 - REGISTER_COMPONENT(ListChildrenMainSize), - REGISTER_COMPONENT(ItemAlignment), - REGISTER_COMPONENT(RelativeLayoutChain), - - // 基础布局组件 - REGISTER_COMPONENT(Flex), - REGISTER_COMPONENT(Stack), - REGISTER_COMPONENT(Row), - REGISTER_COMPONENT(Column), - - // 位置和区域相关组件 - REGISTER_COMPONENT(LayoutPosition), - REGISTER_COMPONENT(SafeArea), - REGISTER_COMPONENT(RefreshOffsetEvent), - - // 策略和边缘相关组件 - REGISTER_COMPONENT(LayoutPolicy), - REGISTER_COMPONENT(PositionEdges), - REGISTER_COMPONENT(PixelRound) - }; - - // 定义NAPI属性 - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} - -// C语言链接声明结束 -EXTERN_C_END - -// 定义NAPI模块 -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIBaseNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIBaseNode.h deleted file mode 100755 index 16076ab0fe47960bcf627a7ff64140fce168367d..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIBaseNode.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIBASENODE_H -#define MYAPPLICATION_ARKUIBASENODE_H - -#include -#include -#include - -#include "NativeModule.h" -#include -#undef LOG_DOMAIN -#undef LOG_TAG -#define LOG_DOMAIN 0x3200 // 全局domain宏,标识业务领域 -#define LOG_TAG "NativeModule" // 全局tag宏,标识模块日志tag -namespace NativeModule { - -class ArkUIBaseNode { -public: - explicit ArkUIBaseNode(ArkUI_NodeHandle handle) - : handle_(handle), nativeModule_(NativeModuleInstance::GetInstance()->GetNativeNodeAPI()) {} - - virtual ~ArkUIBaseNode() - { - // 封装析构函数,实现子节点移除功能 - if (!children_.empty()) { - for (const auto &child : children_) { - nativeModule_->removeChild(handle_, child->GetHandle()); - } - children_.clear(); - } - // 封装析构函数,统一回收节点资源 - nativeModule_->disposeNode(handle_); - } - - void AddChild(const std::shared_ptr &child) - { - children_.emplace_back(child); - OnAddChild(child); - } - - void RemoveChild(const std::shared_ptr &child) - { - children_.remove(child); - OnRemoveChild(child); - } - - void InsertChild(const std::shared_ptr &child, int32_t index) - { - if (index >= children_.size()) { - AddChild(child); - } else { - auto iter = children_.begin(); - std::advance(iter, index); - children_.insert(iter, child); - OnInsertChild(child, index); - } - } - - int GetIndex(const std::shared_ptr &child) - { - int index = 0; - for (const auto &item : children_) { - if (item == child) { - return index; - } - index++; - } - return -1; // 如果没找到,返回-1 - } - - ArkUI_NodeHandle GetHandle() const - { - if (!this || !handle_) { - OH_LOG_INFO(LOG_APP, "GetHandle nullptr"); - return nullptr; - } - return handle_; - } - -protected: - virtual void OnAddChild(const std::shared_ptr &child) {} - - virtual void OnRemoveChild(const std::shared_ptr &child) {} - - virtual void OnInsertChild(const std::shared_ptr &child, int32_t index) {} - - ArkUI_NodeHandle handle_; // ArkUI节点句柄 - ArkUI_NativeNodeAPI_1 *nativeModule_ = nullptr; // Native模块API指针 - -private: - std::list> children_; // 子节点列表 -}; - -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUIBASENODE_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIButtonNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIButtonNode.h deleted file mode 100755 index f2eb23b2a9ee0edb515b01fddd47843481be3164..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIButtonNode.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef LAYOUTSAMPLE_ARKUIBUTTONNODE_H -#define LAYOUTSAMPLE_ARKUIBUTTONNODE_H -#include "ArkUINode.h" - -namespace NativeModule { - -class ArkUIButtonNode : public ArkUINode { -public: - using ClickCallback = std::function; - - ArkUIButtonNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_BUTTON)) - { - // 注册自定义事件监听器 - nativeModule_->addNodeEventReceiver(handle_, OnClickEvent); - // 声明自定义事件并转递自身作为自定义数据 - nativeModule_->registerNodeEvent(handle_, NODE_ON_CLICK_EVENT, 0, this); - } - - ~ArkUIButtonNode() override {} - - void SetOnClick(ClickCallback cb) { onClick_ = std::move(cb); } - - void SetTextContent(const std::string &content) - { - assert(handle_); - ArkUI_AttributeItem item = { nullptr, 0, content.c_str() }; - nativeModule_->setAttribute(handle_, NODE_BUTTON_LABEL, &item); - } - - void SetButtonType(int32_t type) - { - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = type }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_BUTTON_LABEL, &item); - } -private: - static void OnClickEvent(ArkUI_NodeEvent *event) - { - // 获取组件实例对象,调用相关实例方法 - auto buttonNode = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(event)); - auto type = OH_ArkUI_NodeEvent_GetEventType(event); - switch (type) { - case NODE_ON_CLICK_EVENT: - if (buttonNode->onClick_) - buttonNode->onClick_(); - break; - default: - break; - } - } - ClickCallback onClick_; // 点击回调函数 -}; - -} // namespace NativeModule -#endif //LAYOUTSAMPLE_ARKUIBUTTONNODE_H diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIColumnNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIColumnNode.h deleted file mode 100755 index 8eea2be28e3c5da9655e794331ebecaa407bed4f..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIColumnNode.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUICOLUMNNODE_H -#define MYAPPLICATION_ARKUICOLUMNNODE_H - -#include "ArkUINode.h" - -namespace NativeModule { - -class ArkUIColumnNode : public ArkUINode { -public: - ArkUIColumnNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_COLUMN)) {} - - ~ArkUIColumnNode() override {} -}; - -} // namespace NativeModule - -#endif \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUICustomColumnNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUICustomColumnNode.h deleted file mode 100755 index 87d53afed828f4d44763591cefd4c0393143d18b..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUICustomColumnNode.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_ARKUICUSTOMCOLUMN_H -#define CAPI0805_2_ARKUICUSTOMCOLUMN_H - -#include "ArkUINode.h" - -namespace NativeModule { - -class ArkUICustomColumnNode : public ArkUINode { -public: - ArkUICustomColumnNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_CUSTOM)) - { - // 注册自定义事件监听器 - nativeModule_->addNodeCustomEventReceiver(handle_, OnStaticCustomEvent); - // 声明自定义事件并转递自身作为自定义数据 - nativeModule_->registerNodeCustomEvent(handle_, ARKUI_NODE_CUSTOM_EVENT_ON_MEASURE, 0, this); - nativeModule_->registerNodeCustomEvent(handle_, ARKUI_NODE_CUSTOM_EVENT_ON_LAYOUT, 0, this); - } - - ~ArkUICustomColumnNode() override - { - // 反注册自定义事件监听器 - nativeModule_->removeNodeCustomEventReceiver(handle_, OnStaticCustomEvent); - // 取消声明自定义事件 - nativeModule_->unregisterNodeCustomEvent(handle_, ARKUI_NODE_CUSTOM_EVENT_ON_MEASURE); - nativeModule_->unregisterNodeCustomEvent(handle_, ARKUI_NODE_CUSTOM_EVENT_ON_LAYOUT); - } - - void SetPaddingCustom(int32_t padding) - { - padding_ = padding; - nativeModule_->markDirty(handle_, NODE_NEED_MEASURE); - } - - void SetOffsetCustom(int32_t offsetX, int32_t offsetY) - { - offset_.x = offsetX; - offset_.y = offsetY; - nativeModule_->markDirty(handle_, NODE_NEED_LAYOUT); - } - - void SetRegisterLayoutCallback() - { - OH_ArkUI_RegisterLayoutCallbackOnNodeHandle(handle_, this, OnLayoutCompleted); - OH_LOG_INFO(LOG_APP, "SetRegisterLayoutCallback"); - } - - void SetUnregisterLayoutCallback() - { - OH_ArkUI_UnregisterLayoutCallbackOnNodeHandle(handle_); - OH_LOG_INFO(LOG_APP, "SetUnregisterLayoutCallback"); - } - -private: - - static void OnStaticCustomEvent(ArkUI_NodeCustomEvent *event) - { - // 获取组件实例对象,调用相关实例方法 - auto customNode = reinterpret_cast(OH_ArkUI_NodeCustomEvent_GetUserData(event)); - auto type = OH_ArkUI_NodeCustomEvent_GetEventType(event); - switch (type) { - case ARKUI_NODE_CUSTOM_EVENT_ON_MEASURE: - customNode->OnMeasure(event); - break; - case ARKUI_NODE_CUSTOM_EVENT_ON_LAYOUT: - customNode->OnLayout(event); - break; - default: - break; - } - } - - void OnMeasure(ArkUI_NodeCustomEvent *event) - { - OH_LOG_INFO(LogType::LOG_APP, "OnMeasure"); - auto layoutConstrain = OH_ArkUI_NodeCustomEvent_GetLayoutConstraintInMeasure(event); - - // 创建子节点布局限制,复用父组件布局中的百分比参考值 - auto childLayoutConstrain = OH_ArkUI_LayoutConstraint_Copy(layoutConstrain); - OH_ArkUI_LayoutConstraint_SetMaxHeight(childLayoutConstrain, MAX_SIZE); - OH_ArkUI_LayoutConstraint_SetMaxWidth(childLayoutConstrain, MAX_SIZE); - OH_ArkUI_LayoutConstraint_SetMinHeight(childLayoutConstrain, 0); - OH_ArkUI_LayoutConstraint_SetMinWidth(childLayoutConstrain, 0); - - // 测算子节点获取子节点最大值 - auto totalSize = nativeModule_->getTotalChildCount(handle_); - int32_t maxWidth = 0; - int32_t maxHeight = 0; - for (uint32_t i = 0; i < totalSize; i++) { - auto child = nativeModule_->getChildAt(handle_, i); - // 调用测算接口测算Native组件 - nativeModule_->measureNode(child, childLayoutConstrain); - auto size = nativeModule_->getMeasuredSize(child); - if (size.width > maxWidth) { - maxWidth = size.width; - } - if (size.height > maxHeight) { - maxHeight = size.height; - } - } - nativeModule_->setMeasuredSize(handle_, maxWidth + DOUBLE * padding_, maxHeight + DOUBLE * padding_); - } - - void OnLayout(ArkUI_NodeCustomEvent *event) - { - OH_LOG_INFO(LogType::LOG_APP, "OnLayout"); - // 获取父组件期望位置并设置 - auto position = OH_ArkUI_NodeCustomEvent_GetPositionInLayout(event); - nativeModule_->setLayoutPosition(handle_, position.x + offset_.x, position.y + offset_.y); - // 获取子组件总数和自身大小 - auto totalSize = nativeModule_->getTotalChildCount(handle_); - auto selfSize = nativeModule_->getMeasuredSize(handle_); - float currentX = 0.0f; - float currentY = 0.0f; - float maxHeightInColumn = 0.0f; - - for (uint32_t i = 0; i < totalSize; i++) { - auto child = nativeModule_->getChildAt(handle_, i); - auto childSize = nativeModule_->getMeasuredSize(child); - // 如果当前子组件超出容器高度,换列 - if (currentY + childSize.height > selfSize.height && currentY != 0) { - currentX += maxHeightInColumn; - currentY = 0; - maxHeightInColumn = 0; - } - nativeModule_->layoutNode(child, currentX, currentY); - currentY += childSize.height; - if (childSize.width > maxHeightInColumn) { - maxHeightInColumn = childSize.width; - } - } - } - - static void OnLayoutCompleted(void *userData) { OH_LOG_INFO(LogType::LOG_APP, "OnLayoutCompleted"); } - int32_t padding_ = 100; // 内边距 - ArkUI_IntOffset offset_ = { 0, 0 }; // 偏移量 - static constexpr int DOUBLE = 2; - static constexpr int MAX_SIZE = 2; -}; - -} // namespace NativeModule - -#endif // CAPI0805_2_ARKUICUSTOMCOLUMN_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIFlexNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIFlexNode.h deleted file mode 100755 index 5056107572effdd05a6abd821534eec614a57c94..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIFlexNode.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIFLEXNODE_H -#define MYAPPLICATION_ARKUIFLEXNODE_H - -#include "ArkUINode.h" - -namespace NativeModule { - -class ArkUIFlexNode : public ArkUINode { -public: - ArkUIFlexNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_FLEX)) {} - - ~ArkUIFlexNode() override {} - - void SetFlexStyle(int32_t direct, int32_t flex, int32_t align, int32_t itemAlign, int32_t flexAlign) - { - assert(handle_); - ArkUI_NumberValue value[] = { - { .i32 = direct }, { .i32 = flex }, { .i32 = align }, { .i32 = itemAlign }, { .i32 = flexAlign }}; - ArkUI_AttributeItem item = { .value = value, 5 }; - nativeModule_->setAttribute(handle_, NODE_FLEX_OPTION, &item); - } -}; - -} // namespace NativeModule - -#endif \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIListNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIListNode.h deleted file mode 100755 index 23521f724cc699a4c64f8db91245690b0e469d7a..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIListNode.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_ARKUILISTNODE_H -#define CAPI0805_2_ARKUILISTNODE_H - -#include "ArkUINode.h" - -namespace NativeModule { - -// 列表节点相关常量定义 -namespace ListConstants { - // 默认主尺寸值 - static constexpr float DEFAULT_MAIN_SIZE = 60.0f; - - // 数组操作相关常量 - static constexpr int32_t INITIAL_ARRAY_SIZE = 10; - static constexpr int32_t SPLICE_START_INDEX = 5; - static constexpr int32_t SPLICE_DELETE_COUNT = 0; - static constexpr int32_t SPLICE_INSERT_COUNT = 5; - - // 循环范围常量 - static constexpr int32_t LOOP_START_INDEX = 5; - static constexpr int32_t LOOP_END_INDEX = 10; - - // 尺寸设置常量 - static constexpr float ITEM_SIZE = 100.0f; - static constexpr int32_t TEST_INDEX = 5; - - // 属性项数组大小 - static constexpr size_t ATTRIBUTE_ITEM_COUNT = 1; -} - -class ArkUIListNode : public ArkUINode { -public: - ArkUIListNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_LIST)) {} - - ~ArkUIListNode() override {} - - void SetListItemAlign(int32_t align) - { - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = align }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_LIST_ALIGN_LIST_ITEM, &item); - } - - void SetChildrenMainSize(void *mainSize) - { - assert(handle_); - ArkUI_AttributeItem item = { .object = mainSize }; - nativeModule_->setAttribute(handle_, NODE_LIST_CHILDREN_MAIN_SIZE, &item); - } - - std::string SetChildrenMainSizeExample() - { - assert(handle_); - std::string mainSize = ""; - auto childrenMainSize = OH_ArkUI_ListChildrenMainSizeOption_Create(); - - // 设置默认大小 - auto err = OH_ArkUI_ListChildrenMainSizeOption_SetDefaultMainSize(childrenMainSize, - ListConstants::DEFAULT_MAIN_SIZE); - mainSize += "SetDefaultMainSizeErr: " + std::to_string(err); - mainSize += "\n"; - - // 获取默认大小 - auto size = OH_ArkUI_ListChildrenMainSizeOption_GetDefaultMainSize(childrenMainSize); - mainSize += "defaultMainSize: " + std::to_string(size); - mainSize += "\n"; - - // 重置数组大小 - OH_ArkUI_ListChildrenMainSizeOption_Resize(childrenMainSize, ListConstants::INITIAL_ARRAY_SIZE); - - // 数组大小+5 此时为15 - err = OH_ArkUI_ListChildrenMainSizeOption_Splice(childrenMainSize, - ListConstants::SPLICE_START_INDEX, - ListConstants::SPLICE_DELETE_COUNT, - ListConstants::SPLICE_INSERT_COUNT); - mainSize += "spliceErr: " + std::to_string(err); - mainSize += "\n"; - - // 从位置5-10处,设置为100 - for (int i = ListConstants::LOOP_START_INDEX; i < ListConstants::LOOP_END_INDEX; i++) { - err = OH_ArkUI_ListChildrenMainSizeOption_UpdateSize(childrenMainSize, i, ListConstants::ITEM_SIZE); - } - mainSize += "UpdateSizeErr: " + std::to_string(err); - mainSize += "\n"; - - size = OH_ArkUI_ListChildrenMainSizeOption_GetMainSize(childrenMainSize, ListConstants::TEST_INDEX); - mainSize += "index [5] size: " + std::to_string(size); - mainSize += "\n"; - - SetChildrenMainSize(childrenMainSize); - OH_ArkUI_ListChildrenMainSizeOption_Dispose(childrenMainSize); - return mainSize; - } -}; - -class ArkUIListItemNode : public ArkUINode { -public: - ArkUIListItemNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_LIST_ITEM)) {} - - ~ArkUIListItemNode() override {} -}; - -} // namespace NativeModule -#endif // CAPI0805_2_ARKUILISTNODE_H diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUINode.cpp b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUINode.cpp deleted file mode 100755 index 90397fae1e1c54d10011730ec2c1b0e5acfc06cd..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUINode.cpp +++ /dev/null @@ -1,769 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "ArkUINode.h" -#include - -namespace NativeModule { - -ArkUINode::ArkUINode(ArkUI_NodeHandle handle) : ArkUIBaseNode(handle) -{ - nativeModule_ = NativeModuleInstance::GetInstance()->GetNativeNodeAPI(); - // 事件触发时需要通过函数获取对应的事件对象,这边通过设置节点自定义数据将封装类指针保持在组件上,方便后续事件分发 - nativeModule_->setUserData(handle_, this); - // 注册节点监听事件接受器 - nativeModule_->addNodeEventReceiver(handle_, ArkUINode::NodeEventReceiver); -} - -ArkUINode::~ArkUINode() -{ - if (onClick_) { - nativeModule_->unregisterNodeEvent(handle_, NODE_ON_CLICK); - } - if (onTouch_) { - nativeModule_->unregisterNodeEvent(handle_, NODE_TOUCH_EVENT); - } - if (onDisappear_) { - nativeModule_->unregisterNodeEvent(handle_, NODE_EVENT_ON_DISAPPEAR); - } - if (onAppear_) { - nativeModule_->unregisterNodeEvent(handle_, NODE_EVENT_ON_APPEAR); - } - nativeModule_->removeNodeEventReceiver(handle_, ArkUINode::NodeEventReceiver); -} - -std::pair ArkUINode::layoutConstraintExample(std::shared_ptr child) -{ - assert(handle_); - - // Create constraint and set its values. - auto layoutConstraint = OH_ArkUI_LayoutConstraint_Create(); - OH_ArkUI_LayoutConstraint_SetMinWidth(layoutConstraint, defaultMinSize); - OH_ArkUI_LayoutConstraint_SetMaxWidth(layoutConstraint, defaultMaxSize); - OH_ArkUI_LayoutConstraint_SetMinHeight(layoutConstraint, defaultMinSize); - OH_ArkUI_LayoutConstraint_SetMaxHeight(layoutConstraint, defaultMaxSize); - OH_ArkUI_LayoutConstraint_SetPercentReferenceWidth(layoutConstraint, defaultPercentReference); - OH_ArkUI_LayoutConstraint_SetPercentReferenceHeight(layoutConstraint, defaultPercentReference); - - std::string constraint = "MinWidth: " + std::to_string(OH_ArkUI_LayoutConstraint_GetMinWidth(layoutConstraint)); - constraint += "\n"; - constraint += "MaxWidth: " + std::to_string(OH_ArkUI_LayoutConstraint_GetMaxWidth(layoutConstraint)); - constraint += "\n"; - constraint += "MinHeight: " + std::to_string(OH_ArkUI_LayoutConstraint_GetMinHeight(layoutConstraint)); - constraint += "\n"; - constraint += "MaxHeight: " + std::to_string(OH_ArkUI_LayoutConstraint_GetMaxHeight(layoutConstraint)); - constraint += "\n"; - constraint += "PercentReferenceWidth: "; - constraint += std::to_string(OH_ArkUI_LayoutConstraint_GetPercentReferenceWidth(layoutConstraint)); - constraint += "\n"; - constraint += "PercentReferenceHeight: "; - constraint += std::to_string(OH_ArkUI_LayoutConstraint_GetPercentReferenceHeight(layoutConstraint)); - - // Create a deep copy of old constraint. - auto layoutConstraintCopy = OH_ArkUI_LayoutConstraint_Copy(layoutConstraint); - - nativeModule_->addChild(handle_, child->GetHandle()); - nativeModule_->measureNode(handle_, layoutConstraint); - auto size = nativeModule_->getMeasuredSize(handle_); - - constraint += "\n\n"; - constraint += "inner first width: " + std::to_string(size.width); - constraint += "\n"; - constraint += "inner first height: " + std::to_string(size.height); - constraint += "\n\n"; - - // Check if it is a deep copy. - OH_ArkUI_LayoutConstraint_SetMaxWidth(layoutConstraintCopy, constraintCopyMaxWidth); - nativeModule_->measureNode(handle_, layoutConstraintCopy); - nativeModule_->layoutNode(handle_, defaultLayoutPosition, defaultLayoutPosition); - size = nativeModule_->getMeasuredSize(handle_); - - constraint += "inner second width: " + std::to_string(size.width); - constraint += "\n"; - constraint += "inner second height: " + std::to_string(size.height); - constraint += "\n"; - - // Destroy constraints. - OH_ArkUI_LayoutConstraint_Dispose(layoutConstraint); - OH_ArkUI_LayoutConstraint_Dispose(layoutConstraintCopy); - return std::pair(constraint, size); -} - -void ArkUINode::SetWidthLayoutPolicy(int32_t policy) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = policy }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_WIDTH_LAYOUTPOLICY, &item); -} - -void ArkUINode::SetConstraintSize(float minWidth, float maxWidth, float minHeight, float maxHeight) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = minWidth }, { .f32 = maxWidth }, - { .f32 = minHeight }, { .f32 = maxHeight }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_CONSTRAINT_SIZE, &item); -} - -void ArkUINode::SetHeightLayoutPolicy(int32_t policy) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = policy }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_HEIGHT_LAYOUTPOLICY, &item); -} - -void ArkUINode::SetWidth(float width) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = width }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_WIDTH, &item); -} - -float ArkUINode::GetWidth() -{ - assert(handle_); - auto item = nativeModule_->getAttribute(handle_, NODE_WIDTH); - return item->value->f32; -} - -std::string ArkUINode::GetLayoutPositionOH() -{ - assert(handle_); - ArkUI_IntOffset offset = {}; - std::string offsetValue = ""; - auto err = OH_ArkUI_NodeUtils_GetLayoutPosition(handle_, &offset); - offsetValue += "LayoutPositionOH\n"; - offsetValue += "id: " + std::string(GetId()) + "\n"; - offsetValue += "err: " + std::to_string(err) + "\n"; - offsetValue += "ArkUI_IntOffset: (" + std::to_string(offset.x) + ", " + std::to_string(offset.y) + ")\n"; - return offsetValue; -} - -std::string ArkUINode::GetLayoutPosition() -{ - assert(handle_); - ArkUI_IntOffset offset = nativeModule_->getLayoutPosition(handle_); - std::string offsetValue = ""; - offsetValue += "LayoutPosition\n"; - offsetValue += "id: " + std::string(GetId()) + "\n"; - offsetValue += "ArkUI_IntOffset: (" + std::to_string(offset.x) + ", " + std::to_string(offset.y) + ")\n"; - return offsetValue; -} - -std::string ArkUINode::GetLayoutPositionInScreen() -{ - assert(handle_); - ArkUI_IntOffset offset = {}; - std::string offsetValue = ""; - auto err = OH_ArkUI_NodeUtils_GetLayoutPositionInScreen(handle_, &offset); - offsetValue += "LayoutPositionInScreen\n"; - offsetValue += "id: " + std::string(GetId()) + "\n"; - offsetValue += "err: " + std::to_string(err) + "\n"; - offsetValue += "ArkUI_IntOffset: (" + std::to_string(offset.x) + ", " + std::to_string(offset.y) + ")\n"; - return offsetValue; -} - -std::string ArkUINode::GetPositionWithTranslateInScreen() -{ - assert(handle_); - ArkUI_IntOffset offset = {}; - std::string offsetValue = ""; - auto err = OH_ArkUI_NodeUtils_GetPositionWithTranslateInScreen(handle_, &offset); - offsetValue += "PositionWithTranslateInScreen\n"; - offsetValue += "id: " + std::string(GetId()) + "\n"; - offsetValue += "err: " + std::to_string(err) + "\n"; - offsetValue += "ArkUI_IntOffset: (" + std::to_string(offset.x) + ", " + std::to_string(offset.y) + ")\n"; - return offsetValue; -} - -void ArkUINode::GetPositionToParent() -{ - assert(handle_); - ArkUI_IntOffset offset = {}; - auto err = OH_ArkUI_NodeUtils_GetPositionToParent(handle_, &offset); - std::string value = ""; - value += "GetPositionToParent: (" + std::to_string(offset.x) + ", " + std::to_string(offset.y) + ")\n"; - OH_LOG_INFO(LOG_APP, "%{public}s", value.c_str()); -} - -std::string ArkUINode::GetLayoutPositionInWindow() -{ - assert(handle_); - ArkUI_IntOffset offset = {}; - std::string offsetValue = ""; - auto err = OH_ArkUI_NodeUtils_GetLayoutPositionInWindow(handle_, &offset); - offsetValue += "LayoutPositionInWindow\n"; - offsetValue += "id: " + std::string(GetId()) + "\n"; - offsetValue += "err: " + std::to_string(err) + "\n"; - offsetValue += "ArkUI_IntOffset: (" + std::to_string(offset.x) + ", " + std::to_string(offset.y) + ")\n"; - return offsetValue; -} - -std::string ArkUINode::GetLayoutSize() -{ - assert(handle_); - ArkUI_IntSize intSize = {}; - std::string intSizeValue = ""; - auto err = OH_ArkUI_NodeUtils_GetLayoutSize(handle_, &intSize); - intSizeValue += "GetLayoutSize\n"; - intSizeValue += "id: " + std::string(GetId()) + "\n"; - intSizeValue += "err: " + std::to_string(err) + "\n"; - intSizeValue += - "ArkUI_IntSize: (" + std::to_string(intSize.width) + ", " + std::to_string(intSize.height) + ")\n"; - return intSizeValue; -} - -void ArkUINode::SetHeight(float height) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = height }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_HEIGHT, &item); -} - -void ArkUINode::SetPercentWidth(float percent) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = percent }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_WIDTH_PERCENT, &item); -} - -void ArkUINode::SetPercentHeight(float percent) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = percent }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_HEIGHT_PERCENT, &item); -} - -void ArkUINode::SetPositionEdges(void *positionEdge) -{ - assert(handle_); - ArkUI_AttributeItem item = { .object = positionEdge }; - nativeModule_->setAttribute(handle_, NODE_POSITION_EDGES, &item); -} - -void ArkUINode::SetBackgroundColor(uint32_t color) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .u32 = color }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_BACKGROUND_COLOR, &item); -} - -std::string ArkUINode::SetPositionEdgesExample(float top, float left, float bottom, float right) -{ - auto positionEdges = OH_ArkUI_PositionEdges_Create(); - if (top != -1) { - OH_ArkUI_PositionEdges_SetTop(positionEdges, top); - } - if (left != -1) { - OH_ArkUI_PositionEdges_SetLeft(positionEdges, left); - } - if (bottom != -1) { - OH_ArkUI_PositionEdges_SetBottom(positionEdges, bottom); - } - if (right != -1) { - OH_ArkUI_PositionEdges_SetRight(positionEdges, right); - } - SetPositionEdges(positionEdges); - std::string positionEdgesValue = ""; - positionEdgesValue += "PositionEdges\n"; - float value; - OH_ArkUI_PositionEdges_GetTop(positionEdges, &value); - positionEdgesValue += "Top: " + std::to_string(value) + "\n"; - OH_ArkUI_PositionEdges_GetLeft(positionEdges, &value); - positionEdgesValue += "Left: " + std::to_string(value) + "\n"; - OH_ArkUI_PositionEdges_GetBottom(positionEdges, &value); - positionEdgesValue += "Bottom: " + std::to_string(value) + "\n"; - OH_ArkUI_PositionEdges_GetRight(positionEdges, &value); - positionEdgesValue += "Right: " + std::to_string(value) + "\n"; - - auto positionEdgesCopy = OH_ArkUI_PositionEdges_Copy(positionEdges); - OH_ArkUI_PositionEdges_GetTop(positionEdgesCopy, &value); - positionEdgesValue += "TopCopy: " + std::to_string(value) + "\n"; - OH_ArkUI_PositionEdges_GetLeft(positionEdgesCopy, &value); - positionEdgesValue += "LeftCopy: " + std::to_string(value) + "\n"; - OH_ArkUI_PositionEdges_GetBottom(positionEdgesCopy, &value); - positionEdgesValue += "BottomCopy: " + std::to_string(value) + "\n"; - OH_ArkUI_PositionEdges_GetRight(positionEdgesCopy, &value); - positionEdgesValue += "RightCopy: " + std::to_string(value) + "\n"; - - OH_ArkUI_PositionEdges_Dispose(positionEdges); - OH_ArkUI_PositionEdges_Dispose(positionEdgesCopy); - return positionEdgesValue; -} - -void ArkUINode::SetPixelRound(void *pixelRound) -{ - assert(handle_); - ArkUI_AttributeItem item = { .object = pixelRound }; - nativeModule_->setAttribute(handle_, NODE_PIXEL_ROUND, &item); -} - -std::string ArkUINode::SetPixelRoundExample(ArkUI_PixelRoundCalcPolicy top, ArkUI_PixelRoundCalcPolicy start, - ArkUI_PixelRoundCalcPolicy bottom, ArkUI_PixelRoundCalcPolicy end) -{ - assert(handle_); - auto pixelRoundPolicy = OH_ArkUI_PixelRoundPolicy_Create(); - OH_ArkUI_PixelRoundPolicy_SetStart(pixelRoundPolicy, start); - OH_ArkUI_PixelRoundPolicy_SetTop(pixelRoundPolicy, top); - OH_ArkUI_PixelRoundPolicy_SetBottom(pixelRoundPolicy, bottom); - OH_ArkUI_PixelRoundPolicy_SetEnd(pixelRoundPolicy, end); - SetPixelRound(pixelRoundPolicy); - std::string pixelRoundValue = ""; - auto value = std::make_shared(); - pixelRoundValue += "PixelRoundPolicy\n"; - OH_ArkUI_PixelRoundPolicy_GetStart(pixelRoundPolicy, value.get()); - pixelRoundValue += "Start: " + std::to_string(*value) + "\n"; - OH_ArkUI_PixelRoundPolicy_GetTop(pixelRoundPolicy, value.get()); - pixelRoundValue += "Top: " + std::to_string(*value) + "\n"; - OH_ArkUI_PixelRoundPolicy_GetBottom(pixelRoundPolicy, value.get()); - pixelRoundValue += "Bottom: " + std::to_string(*value) + "\n"; - OH_ArkUI_PixelRoundPolicy_GetEnd(pixelRoundPolicy, value.get()); - pixelRoundValue += "End: " + std::to_string(*value) + "\n"; - - OH_ArkUI_PixelRoundPolicy_Dispose(pixelRoundPolicy); - return pixelRoundValue; -} - -void ArkUINode::SetDisplayPriority(uint32_t priority) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .u32 = priority }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_DISPLAY_PRIORITY, &item); -} - -void ArkUINode::SetLayoutRect(int32_t positionX, int32_t positionY, int32_t width, int32_t height) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = positionX }, { .i32 = positionY }, { .i32 = width }, { .i32 = height }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_LAYOUT_RECT, &item); -} - -void ArkUINode::SetExpandSafeArea(uint32_t type, uint32_t edge) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .u32 = type }, { .u32 = edge }}; - ArkUI_AttributeItem item = { value, 2 }; - nativeModule_->setAttribute(handle_, NODE_EXPAND_SAFE_AREA, &item); -} - -void ArkUINode::SetAlignSelf(int32_t align) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = align }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_ALIGN_SELF, &item); -} - -void ArkUINode::SetTextAlignment(int32_t align) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = align }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_TEXT_ALIGN, &item); -} - -void ArkUINode::SetPadding(float top, float right, float bottom, float left) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = top }, { .f32 = right }, { .f32 = bottom }, { .f32 = left }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_PADDING, &item); -} - -void ArkUINode::SetPadding(float padding) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = padding }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_PADDING, &item); -} - -void ArkUINode::SetPercentPadding(float top, float right, float bottom, float left) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = top }, { .f32 = right }, { .f32 = bottom }, { .f32 = left }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_PADDING_PERCENT, &item); -} - -void ArkUINode::SetPercentPadding(float percentPadding) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = percentPadding }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_PADDING_PERCENT, &item); -} - -void ArkUINode::SetBorderWidth(float top, float right, float bottom, float left) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = top }, { .f32 = right }, { .f32 = bottom }, { .f32 = left }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_WIDTH, &item); -} - -void ArkUINode::SetBorderWidth(float borderWidth) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = borderWidth }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_WIDTH, &item); -} - -void ArkUINode::SetBorderRadius(float upperLeft, float upperRight, float lowerLeft, float lowerRight) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = upperLeft }, { .f32 = upperRight }, - { .f32 = lowerLeft }, { .f32 = lowerRight }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_RADIUS, &item); -} - -void ArkUINode::SetStackAlignContent(int32_t align) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = align }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_STACK_ALIGN_CONTENT, &item); -} - -void ArkUINode::SetBorderRadius(float borderRadius) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = borderRadius }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_RADIUS, &item); -} - -void ArkUINode::SetBorderColor(uint32_t upperLeft, uint32_t upperRight, uint32_t lowerLeft, uint32_t lowerRight) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .u32 = upperLeft }, { .u32 = upperRight }, - { .u32 = lowerLeft }, { .u32 = lowerRight }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_COLOR, &item); -} - -void ArkUINode::SetBorderColor(uint32_t borderColor) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .u32 = borderColor }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_COLOR, &item); -} - -void ArkUINode::SetBorderStyle(int32_t upperLeft, int32_t upperRight, int32_t lowerLeft, int32_t lowerRight) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = upperLeft }, - { .i32 = upperRight }, { .i32 = lowerLeft }, { .i32 = lowerRight }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_STYLE, &item); -} - -void ArkUINode::SetBorderStyle(int32_t borderStyle) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = borderStyle }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_STYLE, &item); -} - -void ArkUINode::SetMargin(float top, float right, float bottom, float left) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = top }, { .f32 = right }, { .f32 = bottom }, { .f32 = left }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_MARGIN, &item); -} - -void ArkUINode::SetMargin(float margin) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = margin }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_MARGIN, &item); -} - -void ArkUINode::SetPercentMargin(float top, float right, float bottom, float left) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = top }, { .f32 = right }, { .f32 = bottom }, { .f32 = left }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_MARGIN_PERCENT, &item); -} - -void ArkUINode::SetPercentMargin(float percentMargin) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = percentMargin }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_MARGIN_PERCENT, &item); -} - -void ArkUINode::SetFlexShrink(float shrink) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = shrink }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_FLEX_SHRINK, &item); -} - -void ArkUINode::SetFlexGrow(float grow) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = grow }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_FLEX_GROW, &item); -} - -void ArkUINode::SetFlexBasis(float basis) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = basis }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_FLEX_BASIS, &item); -} - -void ArkUINode::SetPosition(float x, float y) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = x }, { .f32 = y }}; - ArkUI_AttributeItem item = { value, 2 }; - nativeModule_->setAttribute(handle_, NODE_POSITION, &item); -} - -void ArkUINode::SetOffset(float x, float y) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = x }, { .f32 = y }}; - ArkUI_AttributeItem item = { value, 2 }; - nativeModule_->setAttribute(handle_, NODE_OFFSET, &item); -} - -void ArkUINode::SetDirection(int32_t direct) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = direct }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_DIRECTION, &item); -} - -void ArkUINode::SetAspectRatio(float ratio) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = ratio }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_ASPECT_RATIO, &item); -} - -void ArkUINode::SetSize(float width, float height) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = width }, { .f32 = height }}; - ArkUI_AttributeItem item = { value, 2 }; - nativeModule_->setAttribute(handle_, NODE_SIZE, &item); -} - -void ArkUINode::SetColumnJustifyContent(int32_t justifyContent) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = justifyContent }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_COLUMN_JUSTIFY_CONTENT, &item); -} - -void ArkUINode::SetColumnAlignItems(int32_t align) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = align }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_COLUMN_ALIGN_ITEMS, &item); -} - -void ArkUINode::SetAlignment(int32_t align) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = align }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_ALIGNMENT, &item); -} - -void ArkUINode::SetRowAlignItems(int32_t align) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = align }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_ROW_ALIGN_ITEMS, &item); -} - -void ArkUINode::SetId(const char *id) -{ - assert(handle_); - ArkUI_AttributeItem item = {nullptr, 0, id }; - nativeModule_->setAttribute(handle_, NODE_ID, &item); -} - -void ArkUINode::SetAlignRules(void *alignRules) -{ - assert(handle_); - ArkUI_AttributeItem item = { .object = alignRules }; - nativeModule_->setAttribute(handle_, NODE_ALIGN_RULES, &item); -} - -void ArkUINode::SetBarrier(void *barrier) -{ - assert(handle_); - ArkUI_AttributeItem item = { .object = barrier }; - nativeModule_->setAttribute(handle_, NODE_RELATIVE_CONTAINER_BARRIER, &item); -} - -void ArkUINode::SetLayoutWeight(uint32_t layoutWeight) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .u32 = layoutWeight }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_LAYOUT_WEIGHT, &item); -} - -void ArkUINode::SetScrollBar(int32_t displayMode) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = displayMode }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_SCROLL_BAR_DISPLAY_MODE, &item); -} - -void ArkUINode::SetChainMode(int32_t axi, int32_t style) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = axi }, { .i32 = style }}; - ArkUI_AttributeItem item = { value, 2 }; - nativeModule_->setAttribute(handle_, NODE_RELATIVE_LAYOUT_CHAIN_MODE, &item); -} - -void ArkUINode::SetBorderWidthPercent(float width) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = width }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_WIDTH_PERCENT, &item); -} - -void ArkUINode::SetBorderWidthPercent(float top, float right, float bottom, float left) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = top }, { .f32 = right }, { .f32 = bottom }, { .f32 = left }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_WIDTH_PERCENT, &item); -} - -void ArkUINode::SetBorderRadiusPercent(float radius) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = radius }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_RADIUS_PERCENT, &item); -} - -void ArkUINode::SetBorderRadiusPercent(float upperLeft, float upperRight, float lowerLeft, float lowerRight) -{ - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = upperLeft }, - { .f32 = upperRight }, { .f32 = lowerLeft }, { .f32 = lowerRight }}; - ArkUI_AttributeItem item = { value, 4 }; - nativeModule_->setAttribute(handle_, NODE_BORDER_RADIUS_PERCENT, &item); -} - -const char *ArkUINode::GetId() -{ - assert(handle_); - return nativeModule_->getAttribute(handle_, NODE_ID)->string; -} - -void ArkUINode::NodeEventReceiver(ArkUI_NodeEvent *event) -{ - // 获取事件发生的UI组件对象 - auto nodeHandle = OH_ArkUI_NodeEvent_GetNodeHandle(event); - // 获取保持在UI组件对象中的自定义数据,返回封装类指针 - auto *node = reinterpret_cast( - NativeModuleInstance::GetInstance()->GetNativeNodeAPI()->getUserData(nodeHandle)); - // 基于封装类实例对象处理事件 - node->ProcessNodeEvent(event); -} - -void ArkUINode::ProcessNodeEvent(ArkUI_NodeEvent *event) -{ - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - switch (eventType) { - case NODE_ON_CLICK: { - if (onClick_) { - onClick_(); - } - break; - } - case NODE_TOUCH_EVENT: { - if (onTouch_) { - auto *uiInputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); - float x = OH_ArkUI_PointerEvent_GetX(uiInputEvent); - float y = OH_ArkUI_PointerEvent_GetY(uiInputEvent); - auto type = OH_ArkUI_UIInputEvent_GetAction(uiInputEvent); - onTouch_(type, x, y); - } - } - case NODE_EVENT_ON_DISAPPEAR: { - if (onDisappear_) { - onDisappear_(); - } - break; - } - case NODE_EVENT_ON_APPEAR: { - if (onAppear_) { - onAppear_(); - } - break; - } - default: { - // 组件特有事件交给子类处理 - OnNodeEvent(event); - } - } -} - -void ArkUINode::OnAddChild(const std::shared_ptr &child) -{ - nativeModule_->addChild(handle_, child->GetHandle()); -} - -void ArkUINode::OnRemoveChild(const std::shared_ptr &child) -{ - nativeModule_->removeChild(handle_, child->GetHandle()); -} - -void ArkUINode::OnInsertChild(const std::shared_ptr &child, int32_t index) -{ - nativeModule_->insertChildAt(handle_, child->GetHandle(), index); -} - -} // namespace NativeModule \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUINode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUINode.h deleted file mode 100755 index 6010f73ec8310c3c6bfd3061bf3968567091864b..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUINode.h +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUINODE_H -#define MYAPPLICATION_ARKUINODE_H - -#include "NativeModule.h" -#include "nodes/ArkUIBaseNode.h" -#include -#include -#include -#include -#include -#include -#include - -#undef LOG_DOMAIN -#undef LOG_TAG -#define LOG_DOMAIN 0x3200 // 全局domain宏,标识业务领域 -#define LOG_TAG "NativeModule" // 全局tag宏,标识模块日志tag - -namespace NativeModule { - -class ArkUINode : public ArkUIBaseNode { -public: - explicit ArkUINode(ArkUI_NodeHandle handle); - - ~ArkUINode() override; - - std::pair layoutConstraintExample(std::shared_ptr child); - - // 布局策略相关方法 - void SetWidthLayoutPolicy(int32_t policy); - void SetHeightLayoutPolicy(int32_t policy); - void SetConstraintSize(float minWidth, float maxWidth, float minHeight, float maxHeight); - - // 尺寸相关方法 - void SetWidth(float width); - float GetWidth(); - void SetHeight(float height); - void SetPercentWidth(float percent); - void SetPercentHeight(float percent); - void SetSize(float width, float height); - void SetAspectRatio(float ratio); - - // 位置相关方法 - std::string GetLayoutPositionOH(); - std::string GetLayoutPosition(); - std::string GetLayoutPositionInScreen(); - std::string GetPositionWithTranslateInScreen(); - void GetPositionToParent(); - std::string GetLayoutPositionInWindow(); - std::string GetLayoutSize(); - void SetPosition(float x, float y); - void SetOffset(float x, float y); - - // 位置边距相关方法 - void SetPositionEdges(void *positionEdge); - std::string SetPositionEdgesExample(float top = -1, float left = -1, float bottom = -1, float right = -1); - - // 像素取整相关方法 - void SetPixelRound(void *pixelRound); - std::string SetPixelRoundExample(ArkUI_PixelRoundCalcPolicy top, ArkUI_PixelRoundCalcPolicy start, - ArkUI_PixelRoundCalcPolicy bottom, ArkUI_PixelRoundCalcPolicy end); - - // 显示和布局相关方法 - void SetDisplayPriority(uint32_t priority); - void SetLayoutRect(int32_t positionX, int32_t positionY, int32_t width, int32_t height); - void SetExpandSafeArea(uint32_t type, uint32_t edge); - void SetDirection(int32_t direct); - - // 对齐相关方法 - void SetAlignSelf(int32_t align); - void SetTextAlignment(int32_t align); - void SetAlignment(int32_t align); - void SetColumnJustifyContent(int32_t justifyContent); - void SetColumnAlignItems(int32_t align); - void SetRowAlignItems(int32_t align); - void SetStackAlignContent(int32_t align); - - // 内边距相关方法 - void SetPadding(float top, float right, float bottom, float left); - void SetPadding(float padding); - void SetPercentPadding(float top, float right, float bottom, float left); - void SetPercentPadding(float percentPadding); - - // 外边距相关方法 - void SetMargin(float top, float right, float bottom, float left); - void SetMargin(float margin); - void SetPercentMargin(float top, float right, float bottom, float left); - void SetPercentMargin(float percentMargin); - - // 边框相关方法 - void SetBorderWidth(float top, float right, float bottom, float left); - void SetBorderWidth(float borderWidth); - void SetBorderRadius(float upperLeft, float upperRight, float lowerLeft, float lowerRight); - void SetBorderRadius(float borderRadius); - void SetBorderColor(uint32_t upperLeft, uint32_t upperRight, uint32_t lowerLeft, uint32_t lowerRight); - void SetBorderColor(uint32_t borderColor); - void SetBorderStyle(int32_t upperLeft, int32_t upperRight, int32_t lowerLeft, int32_t lowerRight); - void SetBorderStyle(int32_t borderStyle); - void SetBorderWidthPercent(float width); - void SetBorderWidthPercent(float top, float right, float bottom, float left); - void SetBorderRadiusPercent(float radius); - void SetBorderRadiusPercent(float upperLeft, float upperRight, float lowerLeft, float lowerRight); - - // Flex布局相关方法 - void SetFlexShrink(float shrink); - void SetFlexGrow(float grow); - void SetFlexBasis(float basis); - - // 背景相关方法 - void SetBackgroundColor(uint32_t color); - - // 布局权重和滚动条 - void SetLayoutWeight(uint32_t layoutWeight); - void SetScrollBar(int32_t displayMode); - - // 相对布局相关方法 - void SetAlignRules(void *alignRules); - void SetBarrier(void *barrier); - void SetChainMode(int32_t axi, int32_t style); - - // ID相关方法 - void SetId(const char *id); - const char *GetId(); - - // 事件注册方法 - void RegisterOnClick(std::function onClick) - { - onClick_ = std::move(onClick); - nativeModule_->registerNodeEvent(handle_, NODE_ON_CLICK, 0, nullptr); - } - - void RegisterOnTouch(std::function onTouch) - { - onTouch_ = std::move(onTouch); - nativeModule_->registerNodeEvent(handle_, NODE_TOUCH_EVENT, 0, nullptr); - } - - void RegisterOnAppear(std::function onAppear) - { - onAppear_ = std::move(onAppear); - nativeModule_->registerNodeEvent(handle_, NODE_EVENT_ON_APPEAR, 0, nullptr); - } - - void RegisterOnDisappear(std::function onDisappear) - { - onDisappear_ = std::move(onDisappear); - nativeModule_->registerNodeEvent(handle_, NODE_EVENT_ON_DISAPPEAR, 0, nullptr); - } - -protected: - static void NodeEventReceiver(ArkUI_NodeEvent *event); - - void ProcessNodeEvent(ArkUI_NodeEvent *event); - - virtual void OnNodeEvent(ArkUI_NodeEvent *event) {} - - void OnAddChild(const std::shared_ptr &child) override; - - void OnRemoveChild(const std::shared_ptr &child) override; - - void OnInsertChild(const std::shared_ptr &child, int32_t index) override; - -private: - std::function onClick_; // 点击事件回调函数 - std::function onDisappear_; // 消失事件回调函数 - std::function onAppear_; // 出现事件回调函数 - std::function onTouch_; // 触摸事件回调函数 - - // 添加常量定义 - static constexpr float defaultMinSize = 0.0f; - static constexpr float defaultMaxSize = 50.0f; - static constexpr float defaultPercentReference = 1.0f; - static constexpr int32_t defaultLayoutPosition = 20; - static constexpr float constraintCopyMaxWidth = 5.0f; -}; - -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUINODE_H \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIRelativeContainerNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIRelativeContainerNode.h deleted file mode 100755 index 50472bb8812d83e4413207ad8129ac65c198cd21..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIRelativeContainerNode.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIRELATIVECONTAINERNODE_H -#define MYAPPLICATION_ARKUIRELATIVECONTAINERNODE_H - -#include "ArkUINode.h" -#include "nodes/ArkUIColumnNode.h" -#include "nodes/ArkUIRowNode.h" - -namespace NativeModule { - -class ArkUIRelativeContainerNode : public ArkUINode { -private: - // 布局相关常量 - static constexpr float DEFAULT_BIAS_VALUE = 1.0f; // 默认偏移值 - static constexpr int DEFAULT_GUIDELINE_COUNT = 2; // 默认引导线数量 - static constexpr float DEFAULT_GUIDELINE_POSITION = 50.0f; // 默认引导线位置 - - // 引导线索引常量 - static constexpr int FIRST_GUIDELINE_INDEX = 0; // 第一条引导线索引 - static constexpr int SECOND_GUIDELINE_INDEX = 1; // 第二条引导线索引 - - // 引导线ID常量 - static constexpr const char* VERTICAL_GUIDELINE_ID = "guideline1"; // 垂直引导线ID - static constexpr const char* HORIZONTAL_GUIDELINE_ID = "guideline2"; // 水平引导线ID - - // 容器ID常量 - static constexpr const char* CONTAINER_ID = "__container__"; // 容器ID - -public: - ArkUIRelativeContainerNode() - : ArkUINode( - (NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_RELATIVE_CONTAINER)) {} - - ~ArkUIRelativeContainerNode() override {} - - void SetGuideline(void *guideline) - { - assert(handle_); - ArkUI_AttributeItem item = { .object = guideline }; - nativeModule_->setAttribute(handle_, NODE_RELATIVE_CONTAINER_GUIDE_LINE, &item); - } - - std::string alignRuleOptionExample(std::shared_ptr child1, - std::shared_ptr child2, - std::shared_ptr child3) - { - assert(handle_); - std::string rules; - // Create alignRules and set its values. - // child1对齐规则 在父容器中间偏离0.1 0.1 - auto alignRules1 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules1, CONTAINER_ID, - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_CENTER); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules1, CONTAINER_ID, - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_CENTER); - OH_ArkUI_AlignmentRuleOption_SetBiasHorizontal(alignRules1, DEFAULT_BIAS_VALUE); - OH_ArkUI_AlignmentRuleOption_SetBiasVertical(alignRules1, DEFAULT_BIAS_VALUE); - rules += - "child1 StartAlignment: " + std::to_string(OH_ArkUI_AlignmentRuleOption_GetStartAlignment(alignRules1)); - rules += "\n"; - rules += "child1 TopAlignment: " + std::to_string(OH_ArkUI_AlignmentRuleOption_GetTopAlignment(alignRules1)); - rules += "\n"; - rules += - "child1 BiasHorizontal: " + std::to_string(OH_ArkUI_AlignmentRuleOption_GetBiasHorizontal(alignRules1)); - rules += "\n"; - rules += "child1 BiasVertical: " + std::to_string(OH_ArkUI_AlignmentRuleOption_GetBiasVertical(alignRules1)); - child1->SetAlignRules(alignRules1); - // Destroy alignRules. - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules1); - - // child2对齐规则 在child1上方 - auto alignRules2 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignRules2, child1->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetBottom(alignRules2, child1->GetId(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - rules += "\n"; - rules += "child2 EndAlignment: " + std::to_string(OH_ArkUI_AlignmentRuleOption_GetEndAlignment(alignRules2)); - rules += "\n"; - rules += - "child2 BottomAlignment: " + std::to_string(OH_ArkUI_AlignmentRuleOption_GetBottomAlignment(alignRules2)); - child2->SetAlignRules(alignRules2); - // Destroy alignRules. - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules2); - - // child3对齐规则 在child1的右下方 - auto alignRules3 = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetCenterHorizontal(alignRules3, child1->GetId(), - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetCenterVertical(alignRules3, child1->GetId(), - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_BOTTOM); - rules += "\n"; - rules += "child3 CenterAlignmentHorizontal: " + - std::to_string(OH_ArkUI_AlignmentRuleOption_GetCenterAlignmentHorizontal(alignRules3)); - rules += "\n"; - rules += "child3 CenterAlignmentVertical: " + - std::to_string(OH_ArkUI_AlignmentRuleOption_GetCenterAlignmentVertical(alignRules3)); - child3->SetAlignRules(alignRules3); - // Destroy alignRules. - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules3); - - nativeModule_->measureNode(handle_, OH_ArkUI_LayoutConstraint_Create()); - return rules; - } - - std::string guidelineOptionExample(std::shared_ptr row) - { - assert(handle_); - auto guideline = OH_ArkUI_GuidelineOption_Create(DEFAULT_GUIDELINE_COUNT); - OH_ArkUI_GuidelineOption_SetId(guideline, VERTICAL_GUIDELINE_ID, FIRST_GUIDELINE_INDEX); - OH_ArkUI_GuidelineOption_SetId(guideline, HORIZONTAL_GUIDELINE_ID, SECOND_GUIDELINE_INDEX); - OH_ArkUI_GuidelineOption_SetDirection(guideline, ARKUI_AXIS_VERTICAL, FIRST_GUIDELINE_INDEX); - OH_ArkUI_GuidelineOption_SetDirection(guideline, ARKUI_AXIS_HORIZONTAL, SECOND_GUIDELINE_INDEX); - OH_ArkUI_GuidelineOption_SetPositionStart(guideline, DEFAULT_GUIDELINE_POSITION, FIRST_GUIDELINE_INDEX); - OH_ArkUI_GuidelineOption_SetPositionStart(guideline, DEFAULT_GUIDELINE_POSITION, SECOND_GUIDELINE_INDEX); - OH_ArkUI_GuidelineOption_SetPositionEnd(guideline, DEFAULT_GUIDELINE_POSITION, FIRST_GUIDELINE_INDEX); - OH_ArkUI_GuidelineOption_SetPositionEnd(guideline, DEFAULT_GUIDELINE_POSITION, SECOND_GUIDELINE_INDEX); - SetGuideline(guideline); - - auto alignRules = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetStart(alignRules, VERTICAL_GUIDELINE_ID, - ArkUI_HorizontalAlignment::ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetTop(alignRules, HORIZONTAL_GUIDELINE_ID, - ArkUI_VerticalAlignment::ARKUI_VERTICAL_ALIGNMENT_TOP); - row->SetAlignRules(alignRules); - OH_ArkUI_AlignmentRuleOption_Dispose(alignRules); - std::string guidelineStyle = ""; - guidelineStyle += "Id:" + std::string(OH_ArkUI_GuidelineOption_GetId(guideline, SECOND_GUIDELINE_INDEX)); - guidelineStyle += "\n"; - guidelineStyle += - "Direction:" + std::to_string(OH_ArkUI_GuidelineOption_GetDirection(guideline, SECOND_GUIDELINE_INDEX)); - guidelineStyle += "\n"; - guidelineStyle += "PositionStart:" + std::to_string( - OH_ArkUI_GuidelineOption_GetPositionStart(guideline, SECOND_GUIDELINE_INDEX)); - guidelineStyle += "PositionEnd:" + std::to_string( - OH_ArkUI_GuidelineOption_GetPositionEnd(guideline, SECOND_GUIDELINE_INDEX)); - guidelineStyle += "\n"; - OH_ArkUI_GuidelineOption_Dispose(guideline); - return guidelineStyle; - } -}; - -} // namespace NativeModule - -#endif \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIRowNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIRowNode.h deleted file mode 100755 index 542d46c728151db75b456d650689e0a3c95be63b..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIRowNode.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIROWNODE_H -#define MYAPPLICATION_ARKUIROWNODE_H - -#include "ArkUINode.h" - -namespace NativeModule { - -class ArkUIRowNode : public ArkUINode { -public: - ArkUIRowNode() : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_ROW)) {} - - ~ArkUIRowNode() override {} - - void setJustifyContent(int32_t align) - { - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = align }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_ROW_JUSTIFY_CONTENT, &item); - } -}; - -} // namespace NativeModule - -#endif \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIStackNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIStackNode.h deleted file mode 100755 index b377aa55be81944f7dcb661c15cade43a22254f3..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUIStackNode.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI0805_2_ARKUISTACKNODE_H -#define CAPI0805_2_ARKUISTACKNODE_H - -#include "ArkUINode.h" - -namespace NativeModule { - -class ArkUIStackNode : public ArkUINode { -public: - ArkUIStackNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_STACK)) {} - - ~ArkUIStackNode() override {} -}; - -} // namespace NativeModule -#endif // CAPI0805_2_ARKUISTACKNODE_H diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUITextNode.h b/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUITextNode.h deleted file mode 100755 index d0d9ca8b6506ce8ba78ab4354ededc0bb2be0f8d..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/nodes/ArkUITextNode.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUITEXTNODE_H -#define MYAPPLICATION_ARKUITEXTNODE_H - -#include "ArkUINode.h" -#include - -namespace NativeModule { - -class ArkUIFlexNode : public ArkUINode { -public: - ArkUIFlexNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_FLEX)) {} - - ~ArkUIFlexNode() override {} - - void SetFlexStyle(int32_t direct, int32_t flex, int32_t align, int32_t itemAlign, int32_t flexAlign) - { - assert(handle_); - ArkUI_NumberValue value[] = { - { .i32 = direct }, { .i32 = flex }, { .i32 = align }, { .i32 = itemAlign }, { .i32 = flexAlign }}; - ArkUI_AttributeItem item = { .value = value, 5 }; - nativeModule_->setAttribute(handle_, NODE_FLEX_OPTION, &item); - } -}; - -class ArkUITextNode : public ArkUINode { -public: - using ClickCallback = std::function; - - ArkUITextNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_TEXT)) - { - // 注册自定义事件监听器 - nativeModule_->addNodeEventReceiver(handle_, OnTextEvent); - // 声明自定义事件并转递自身作为自定义数据 - nativeModule_->registerNodeEvent(handle_, NODE_ON_CLICK_EVENT, 0, this); - } - - void SetRegisterRefreshEvent() - { - assert(handle_); - nativeModule_->registerNodeEvent(handle_, NODE_REFRESH_ON_OFFSET_CHANGE, 0, this); - OH_LOG_INFO(LOG_APP, "SetRegisterRefreshEvent"); - } - - void SetRegisterVisibleAreaChangeEvent() - { - assert(handle_); - nativeModule_->registerNodeEvent(handle_, NODE_EVENT_ON_VISIBLE_AREA_CHANGE, 0, this); - } - - void SetVisibleAreaChangeRatio(float ratio) - { - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = ratio }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_VISIBLE_AREA_CHANGE_RATIO, &item); - } - - void SetUnregisterRefreshEvent() - { - assert(handle_); - nativeModule_->unregisterNodeEvent(handle_, NODE_REFRESH_ON_OFFSET_CHANGE); - } - - void SetFontSize(float fontSize) - { - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = fontSize }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_FONT_SIZE, &item); - } - - void SetFontColor(uint32_t color) - { - assert(handle_); - ArkUI_NumberValue value[] = {{ .u32 = color }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_FONT_COLOR, &item); - } - - void SetTextContent(const std::string &content) - { - assert(handle_); - ArkUI_AttributeItem item = { nullptr, 0, content.c_str() }; - nativeModule_->setAttribute(handle_, NODE_TEXT_CONTENT, &item); - } - - void SetTextAlign(ArkUI_TextAlignment align) - { - assert(handle_); - ArkUI_NumberValue value[] = {{ .i32 = align }}; - ArkUI_AttributeItem item = { value, 1 }; - nativeModule_->setAttribute(handle_, NODE_TEXT_ALIGN, &item); - } - - void SetOnClick(ClickCallback cb) { onClick_ = std::move(cb); } - - void SetRefreshOffset(float offset) - { - assert(handle_); - ArkUI_NumberValue value[] = {{ .f32 = offset }}; - ArkUI_AttributeItem item = { value, 1 }; - std::string log = "SetRefreshOffset: " + std::to_string(offset); - OH_LOG_INFO(LOG_APP, "%{public}s", log.c_str()); - nativeModule_->setAttribute(handle_, NODE_REFRESH_OFFSET, &item); - } - -private: - static void OnTextEvent(ArkUI_NodeEvent *event) - { - // 获取组件实例对象,调用相关实例方法 - auto textNode = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(event)); - auto type = OH_ArkUI_NodeEvent_GetEventType(event); - switch (type) { - case NODE_ON_CLICK_EVENT: - if (textNode->onClick_) - textNode->onClick_(); - break; - case NODE_REFRESH_ON_OFFSET_CHANGE: - textNode->OnOffsetChange(); - break; - case NODE_EVENT_ON_VISIBLE_AREA_CHANGE: - textNode->OnVisibleAreaChange(); - default: - break; - } - } - - void OnOffsetChange() { OH_LOG_INFO(LOG_APP, "OnOffsetChange"); } - - void OnVisibleAreaChange() { OH_LOG_INFO(LOG_APP, "OnVisibleAreaChange"); } - - ClickCallback onClick_; // 点击回调函数 -}; - -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUITEXTNODE_H diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/LayoutSample/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100755 index 37aaa93424d1eb880416f1891efec75a93c027f9..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -export const CreateLayoutConstraintNativeRoot: (content: Object) => void; -export const DestroyLayoutConstraintNativeRoot: () => void; - -export const CreateAlignRuleOptionNativeRoot: (content: Object) => void; -export const DestroyAlignRuleOptionNativeRoot: () => void; - -export const CreateGuidelineOptionNativeRoot: (content: Object) => void; -export const DestroyGuidelineOptionNativeRoot: () => void; - -export const CreateBarrierOptionNativeRoot: (content: Object) => void; -export const DestroyBarrierOptionNativeRoot: () => void; - -export const CreateListChildrenMainSizeNativeRoot: (content: Object) => void; -export const DestroyListChildrenMainSizeNativeRoot: () => void; - -export const CreateItemAlignmentNativeRoot: (content: Object) => void; -export const DestroyItemAlignmentNativeRoot: () => void; - -export const CreateRelativeLayoutChainNativeRoot: (content: Object) => void; -export const DestroyRelativeLayoutChainNativeRoot: () => void; - -export const CreateFlexNativeRoot: (content: Object) => void; -export const DestroyFlexNativeRoot: () => void; - -export const CreateStackNativeRoot: (content: Object) => void; -export const DestroyStackNativeRoot: () => void; - -export const CreateRowNativeRoot: (content: Object) => void; -export const DestroyRowNativeRoot: () => void; - -export const CreateColumnNativeRoot: (content: Object) => void; -export const DestroyColumnNativeRoot: () => void; - -export const CreateLayoutPositionNativeRoot: (content: Object) => void; -export const DestroyLayoutPositionNativeRoot: () => void; - -export const CreateSafeAreaNativeRoot: (content: Object) => void; -export const DestroySafeAreaNativeRoot: () => void; - -export const CreateRefreshOffsetEventNativeRoot: (content: Object) => void; -export const DestroyRefreshOffsetEventNativeRoot: () => void; - -export const CreatePositionEdgesNativeRoot: (content: Object) => void; -export const DestroyPositionEdgesNativeRoot: () => void; - -export const CreateLayoutPolicyNativeRoot: (content: Object) => void; -export const DestroyLayoutPolicyNativeRoot: () => void; - -export const CreatePixelRoundNativeRoot: (content: Object) => void; -export const DestroyPixelRoundNativeRoot: () => void; \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/LayoutSample/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100755 index ea410725a8826704d061021d98cf02aa76cd8016..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100755 index 27856b069346527e1c4587a2c8209a479446eb08..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit' -import { hilog } from '@kit.PerformanceAnalysisKit' -import { window } from '@kit.ArkUI' - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100755 index 44ef4f581f5226cfef9ca03d0585234e9646cacd..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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' - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/models/NavigationItem.ts b/ArkUIKit/LayoutSample/entry/src/main/ets/models/NavigationItem.ts deleted file mode 100755 index f074629b26c8c828ccd4cd7fab982f3659791eba..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/models/NavigationItem.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export interface NavigationItem { - - title: string; - page: string; -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/Index.ets deleted file mode 100755 index fc46741517779b487e271346ec2d39e6ae6949aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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 router from '@ohos.router' -import { NavigationItem } from '../models/NavigationItem' - -@Entry -@Component -struct Index { - // 导航数据列表 - data: NavigationItem[] = [ - { - title: 'NativeType测试', - page: 'pages/native' - }, - { - title: 'Node测试', - page: 'pages/node' - }, - ] - - build() { - Column() { - Column() { - List({ space: '8vp' }) { - ForEach(this.data, (item: NavigationItem) => { - ListItem() { - Button(item.title) - .width('100%') - .onClick(() => { - // 跳转到指定页面 - router.pushUrl({ url: item.page }) - }) - } - .width('100%') - .padding({ left: '8vp', right: '8vp' }) - }, (item: NavigationItem) => item.title) - } - .scrollBar(BarState.Off) - } - .width(250) - .height(200) - .backgroundColor($r('sys.color.background_primary')) - .justifyContent(FlexAlign.Center) - .flexGrow(1) - } - .height('100%') - .width('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/native.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/native.ets deleted file mode 100755 index b884a775d4effbb9fb42fd0152f0f775d7f510f0..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/native.ets +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2025 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 router from '@ohos.router' -import { NavigationItem } from '../models/NavigationItem' - -@Entry -@Component -struct NativeTestPage { - // Native测试示例列表 - data: NavigationItem[] = [ - { - title: 'layoutConstraintTest', - page: 'pages/nativeTest/layoutConstraintTest' - }, - { - title: 'alignRuleOptionExample', - page: 'pages/nativeTest/alignRuleOptionExample' - }, - { - title:'guidelineOptionExample', - page: 'pages/nativeTest/guidelineOptionExample' - }, - { - title:'barrierOptionExample', - page: 'pages/nativeTest/barrierOptionExample' - }, - { - title:'listChildrenMainSizeExample', - page: 'pages/nativeTest/listChildrenMainSizeExample' - }, - { - title:'itemAlignmentExample', - page: 'pages/nativeTest/itemAlignmentExample' - }, - { - title:'relativeLayoutChainExample', - page: 'pages/nativeTest/relativeLayoutChainExample' - }, - { - title:'positionEdgesExample', - page: 'pages/nativeTest/positionEdgesExample' - }, - { - title:'pixelRoundExample', - page: 'pages/nativeTest/pixelRoundExample' - } - ] - - build() { - Column() { - Column() { - List({ space: '8vp' }) { - ForEach(this.data, (item: NavigationItem) => { - ListItem() { - Button(item.title) - .width('100%') - .onClick(() => { - // 跳转到指定的Native测试页面 - router.pushUrl({ url: item.page }) - }) - } - .width('100%') - .padding({ left: '8vp', right: '8vp' }) - }, (item: NavigationItem) => item.title) - } - .scrollBar(BarState.Off) - } - .width(250) - .height(200) - .backgroundColor($r('sys.color.background_primary')) - .justifyContent(FlexAlign.Center) - .flexGrow(1) - } - .height('100%') - .width('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/alignRuleOptionExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/alignRuleOptionExample.ets deleted file mode 100755 index 6fca428bb83e80f2e31bfc7cd0410450c66bd673..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/alignRuleOptionExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct alignRuleOptionTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateAlignRuleOptionNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyAlignRuleOptionNativeRoot() - } - - build() { - Column() { - Row(){ - ContentSlot(this.rootSlot) - } - .layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/barrierOptionExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/barrierOptionExample.ets deleted file mode 100755 index a6ac322a47fe8fc6395d0341f1fe49490b4c9913..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/barrierOptionExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct barrierOptionTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateBarrierOptionNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyBarrierOptionNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/guidelineOptionExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/guidelineOptionExample.ets deleted file mode 100755 index 647d38e99df3089cb6d353212bba4b81b680a87f..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/guidelineOptionExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct guidelineOptionTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateGuidelineOptionNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyGuidelineOptionNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/itemAlignmentExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/itemAlignmentExample.ets deleted file mode 100755 index bf0bc8797ff9785c39db3da27240d2e21206fba9..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/itemAlignmentExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct itemAlignmentTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateItemAlignmentNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyItemAlignmentNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/layoutConstraintTest.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/layoutConstraintTest.ets deleted file mode 100755 index ce5660ce681e8fae04df9dad82877d0b61dcf05f..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/layoutConstraintTest.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct layoutConstraintTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateLayoutConstraintNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyLayoutConstraintNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/listChildrenMainSizeExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/listChildrenMainSizeExample.ets deleted file mode 100755 index 6ca050442d2d5c3b7145324ccb8848cb37f2032e..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/listChildrenMainSizeExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct listChildrenMainSizeTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateListChildrenMainSizeNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyListChildrenMainSizeNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/pixelRoundExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/pixelRoundExample.ets deleted file mode 100755 index 06257397811cc4426e77b8edc4c9c5883e807c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/pixelRoundExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct pixelRoundTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreatePixelRoundNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyPixelRoundNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/positionEdgesExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/positionEdgesExample.ets deleted file mode 100755 index 5f95c84f321e06454dbb72d9b704375a7b137695..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/positionEdgesExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct positionEdgesTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreatePositionEdgesNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyLayoutPositionNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/relativeLayoutChainExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/relativeLayoutChainExample.ets deleted file mode 100755 index 6e1d5c18c2a60e7f2310eba022321bc6ecfff40b..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nativeTest/relativeLayoutChainExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct relativeLayoutChainTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateRelativeLayoutChainNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyRelativeLayoutChainNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/node.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/node.ets deleted file mode 100755 index 3c9b09aeffe6b5e1ccd8c2a853ffd907ed17e903..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/node.ets +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2025 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 router from '@ohos.router' -import { NavigationItem } from '../models/NavigationItem' - -@Entry -@Component -struct NodeTestPage { - // Node测试示例列表 - data: NavigationItem[] = [ - { - title: 'flex测试', - page: 'pages/nodeTest/createFlexExample' - }, - { - title: 'stack测试', - page: 'pages/nodeTest/createStackExample' - }, - { - title: 'row测试', - page: 'pages/nodeTest/createRowExample' - }, - { - title: 'column测试', - page: 'pages/nodeTest/createColumnExample' - }, - { - title: 'layoutPosition测试', - page: 'pages/nodeTest/createLayoutPositionExample' - }, - { - title: 'safeArea测试', - page: 'pages/nodeTest/createSafeAreaExample' - }, - { - title: 'refreshOffsetEvent测试', - page: 'pages/nodeTest/createRefreshOffsetEventExample' - }, - { - title: 'layoutPolicy测试', - page: 'pages/nodeTest/createLayoutPolicyExample' - }, - ] - - build() { - Column() { - Column() { - List({ space: '8vp' }) { - ForEach(this.data, (item: NavigationItem) => { - ListItem() { - Button(item.title) - .width('100%') - .onClick(() => { - // 跳转到指定的Node测试页面 - router.pushUrl({ url: item.page }) - }) - } - .width('100%') - .padding({ left: '8vp', right: '8vp' }) - }, (item: NavigationItem) => item.title) - } - .scrollBar(BarState.Off) - } - .width(250) - .height(200) - .backgroundColor($r('sys.color.background_primary')) - .justifyContent(FlexAlign.Center) - .flexGrow(1) - } - .height('100%') - .width('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createColumnExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createColumnExample.ets deleted file mode 100755 index de99620a23db4ea0311892f34d7ac07952f8ed56..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createColumnExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct createColumnTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateColumnNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyColumnNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createFlexExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createFlexExample.ets deleted file mode 100755 index 1d43e344e6c6e8c227cc669a3e4204829fd1a547..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createFlexExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct createFlexTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateFlexNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyFlexNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createLayoutPolicyExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createLayoutPolicyExample.ets deleted file mode 100755 index 50b26ff9958e0ed874e20f603421d68fa2708917..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createLayoutPolicyExample.ets +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct createLayoutPolicyTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateLayoutPolicyNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyLayoutPolicyNativeRoot() - } - - build() { - Column() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createLayoutPositionExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createLayoutPositionExample.ets deleted file mode 100755 index e908c3b6fcf70efe629d3a08c1bf134dc3ef9e7b..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createLayoutPositionExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct createLayoutPositionTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateLayoutPositionNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyLayoutPositionNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createRefreshOffsetEventExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createRefreshOffsetEventExample.ets deleted file mode 100755 index d2e4dca1575948b73d20c7dd726fd1cc452684d2..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createRefreshOffsetEventExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct createRefreshOffsetEventTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateRefreshOffsetEventNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyRefreshOffsetEventNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createRowExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createRowExample.ets deleted file mode 100755 index dd7bef59079b3f978da6a9d5d40a9e0ef7ae1517..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createRowExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct createRowTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateRowNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyRowNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createSafeAreaExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createSafeAreaExample.ets deleted file mode 100755 index d2b3c1aad489691532b29a9fd8f7ddc700d257fa..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createSafeAreaExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct createSafeAreaTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateSafeAreaNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroySafeAreaNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createStackExample.ets b/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createStackExample.ets deleted file mode 100755 index 938f497a442d0d1f56c0134f6525023639de3baf..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/ets/pages/nodeTest/createStackExample.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so' -import { NodeContent } from '@kit.ArkUI' - -export interface DataClass { - title: string - page: string -} - -@Entry -@Component -struct createStackTest { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - - aboutToAppear(): void { - nativeNode.CreateStackNativeRoot(this.rootSlot) - } - - aboutToDisappear(): void { - nativeNode.DestroyStackNativeRoot() - } - - build() { - Column() { - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/module.json5 b/ArkUIKit/LayoutSample/entry/src/main/module.json5 deleted file mode 100755 index f78421e81033cd110218f65bd492ecac3349a47a..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone" - ], - "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": [ - "ohos.want.action.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/ArkUIKit/LayoutSample/entry/src/main/resources/base/element/color.json b/ArkUIKit/LayoutSample/entry/src/main/resources/base/element/color.json deleted file mode 100755 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/resources/base/element/float.json b/ArkUIKit/LayoutSample/entry/src/main/resources/base/element/float.json deleted file mode 100755 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/LayoutSample/entry/src/main/resources/base/element/string.json b/ArkUIKit/LayoutSample/entry/src/main/resources/base/element/string.json deleted file mode 100755 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/background.png b/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/background.png deleted file mode 100755 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100755 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100755 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100755 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/LayoutSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/LayoutSample/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/LayoutSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100755 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/LayoutSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 483158327dcfb5d3c2efe462f03a68f920822e5c..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/native", - "pages/node", - "pages/nativeTest/layoutConstraintTest", - "pages/nativeTest/alignRuleOptionExample", - "pages/nativeTest/barrierOptionExample", - "pages/nativeTest/guidelineOptionExample", - "pages/nativeTest/itemAlignmentExample", - "pages/nativeTest/listChildrenMainSizeExample", - "pages/nativeTest/relativeLayoutChainExample", - "pages/nodeTest/createColumnExample", - "pages/nodeTest/createFlexExample", - "pages/nodeTest/createLayoutPositionExample", - "pages/nodeTest/createRefreshOffsetEventExample", - "pages/nodeTest/createRowExample", - "pages/nodeTest/createSafeAreaExample", - "pages/nodeTest/createStackExample", - "pages/nodeTest/createLayoutPolicyExample", - "pages/nativeTest/positionEdgesExample", - "pages/nativeTest/pixelRoundExample" - ] -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/main/resources/dark/element/color.json b/ArkUIKit/LayoutSample/entry/src/main/resources/dark/element/color.json deleted file mode 100755 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/mock/Libentry.mock.ets b/ArkUIKit/LayoutSample/entry/src/mock/Libentry.mock.ets deleted file mode 100755 index ac383da8f14c1a78e075d81d4ad8a2a3fb939c94..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -} - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/mock/mock-config.json5 b/ArkUIKit/LayoutSample/entry/src/mock/mock-config.json5 deleted file mode 100755 index 8ff46344fd452722861cf79bcb860967f7f458f5..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/LayoutSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100755 index 542d2f077f3c5096fdf445c10e8339de17915346..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/LayoutSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100755 index 1de54bc7c34955b2d4f4c982a1b944d839ba8ca6..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test' - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/ohosTest/module.json5 b/ArkUIKit/LayoutSample/entry/src/ohosTest/module.json5 deleted file mode 100755 index 887efa50a1c4cfb2cfd549a56096488b96fff711..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/LayoutSample/entry/src/test/List.test.ets b/ArkUIKit/LayoutSample/entry/src/test/List.test.ets deleted file mode 100755 index ce0d3ce32800206d8d888972b948978201183d34..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test' - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/entry/src/test/LocalUnit.test.ets b/ArkUIKit/LayoutSample/entry/src/test/LocalUnit.test.ets deleted file mode 100755 index b6ff6505a111b5ee9cf3a3446edc8a534cf6cf26..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/hvigor/hvigor-config.json5 b/ArkUIKit/LayoutSample/hvigor/hvigor-config.json5 deleted file mode 100755 index 40db2246cf3fe58fe95036623a44879881d5df3d..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/ArkUIKit/LayoutSample/hvigorfile.ts b/ArkUIKit/LayoutSample/hvigorfile.ts deleted file mode 100755 index 3fb9e5ffe0cc272b2b8e073c748a28f728bba037..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/oh-package-lock.json5 b/ArkUIKit/LayoutSample/oh-package-lock.json5 deleted file mode 100755 index 1e92831eccf9bcd11179abea401473b35e64a9f8..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/oh-package-lock.json5 +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.24": "@ohos/hypium@1.0.24" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.24": { - "name": "", - "version": "1.0.24", - "integrity": "sha512-3dCqc+BAR5LqEGG2Vtzi8O3r7ci/3fYU+FWjwvUobbfko7DUnXGOccaror0yYuUhJfXzFK0aZNMGSnXaTwEnbw==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.24.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/LayoutSample/oh-package.json5 b/ArkUIKit/LayoutSample/oh-package.json5 deleted file mode 100755 index b8d2148de4f928b0e1a205c4080f10abeb04624d..0000000000000000000000000000000000000000 --- a/ArkUIKit/LayoutSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/LayoutSample/screenshot/operate_sample.gif b/ArkUIKit/LayoutSample/screenshot/operate_sample.gif deleted file mode 100755 index e0bc59184d2e4937b0b9ff35a6f8eded362c9de6..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/LayoutSample/screenshot/operate_sample.gif and /dev/null differ diff --git a/ArkUIKit/NativeDialogSample/.gitignore b/ArkUIKit/NativeDialogSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NativeDialogSample/AppScope/app.json5 b/ArkUIKit/NativeDialogSample/AppScope/app.json5 deleted file mode 100644 index 26062382b32df0e6d9e52811f359be307870163d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.nativedialogsample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NativeDialogSample/AppScope/resources/base/element/string.json b/ArkUIKit/NativeDialogSample/AppScope/resources/base/element/string.json deleted file mode 100644 index af0bc097b5a7d1258e3656cfbbcde593efef48b5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "NativeDialogSample" - } - ] -} diff --git a/ArkUIKit/NativeDialogSample/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NativeDialogSample/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDialogSample/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NativeDialogSample/README.md b/ArkUIKit/NativeDialogSample/README.md deleted file mode 100644 index dc7e6f7bf4bc9aaa5b65f89505ea6c37c4af9c94..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# NativeDialogSample - -## 介绍 - -本示例展示了如何创建自定义弹窗,设置自定义弹窗的背景颜色、圆角半径、对齐方式、边框颜色、边框样式等功能。该工程中展示的接口详细描述可查如下链接: - -[native_dialog.h](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/capi-native-dialog-h) - -## 效果预览 - -| 首页 | CustomDialogController_CAPI页面 |OpenCustomDialog_CAPI页面 | -| ----------------------------------------------------- |--------------------------------------------------------------| ------------------------------------------------------- | -| | | | - -## 使用说明 - -1. 安装编译生成的hap包,并打开应用; -2. 首页面会出现CustomDialogController_CAPI对接示例按钮,点击此按钮进入CustomDialogController_CAPI对接示例界面; -3. 首页面会出现OpenCustomDialog_CAPI对接示例按钮,点击此按钮进入OpenCustomDialog_CAPI对接示例界面; -4. 首页面会出现关闭应用按钮,点击此按钮关闭应用; - -## 工程目录 - -``` -native_type_sample -entry/src/main/ets/ -└── pages - ├── Index.ets (获取导航页面) - ├── IndexController.ets (CustomDialogController_CAPI对接示例界面) - └── IndexCustomDialog.ets (OpenCustomDialog_CAPI对接示例界面) -entry/src/main/ -├── cpp -│ ├── types -│ │ └── libentry -│ │ └── Index.d.ts (函数对应的js映射) -│ ├── common.h -│ ├── CMakeLists.txt (CMake脚本) -| ├── customdialogexample.cpp -| ├── customdialogexample.h -│ ├── napi_init.cpp -│ └── utils.h -└── resources - ├── base - │ ├── element - │ │ ├── color.json - │ │ ├── float.json - │ │ └── string.json - │ └── media -``` - -## 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束和限制 - -1. 本示例支持标准系统上运行,支持设备:RK3568等; - -2. 本示例支持API20版本SDK,版本号:6.0.0.36; - -3. 本示例已支持使DevEco Studio 5.1.1 Release (构建版本:5.1.1.840,构建 2025年9月20日)编译运行 - -## 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/NativeDialogSample > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/ArkUIKit/NativeDialogSample/build-profile.json5 b/ArkUIKit/NativeDialogSample/build-profile.json5 deleted file mode 100644 index bf2b9fac8fa0b05540755a0bc38946bec3ddbe61..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/code-linter.json5 b/ArkUIKit/NativeDialogSample/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/.gitignore b/ArkUIKit/NativeDialogSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/build-profile.json5 b/ArkUIKit/NativeDialogSample/entry/build-profile.json5 deleted file mode 100644 index fccb5e9352a9e9ac8f582affa7367bc85c3029a7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a","x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/hvigorfile.ts b/ArkUIKit/NativeDialogSample/entry/hvigorfile.ts deleted file mode 100644 index c6edcd90486dd5a853cf7d34c8647f08414ca7a3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/ArkUIKit/NativeDialogSample/entry/obfuscation-rules.txt b/ArkUIKit/NativeDialogSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NativeDialogSample/entry/oh-package.json5 b/ArkUIKit/NativeDialogSample/entry/oh-package.json5 deleted file mode 100644 index 0d1a948a2b71ca080cf66a017d0d2dd4178a5762..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libnativerender.so": "file:./src/main/cpp/types/libnativerender" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 423f1a1dee0501824f8674b61ee69668ccaaa7b4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(NativeDialogSample) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -add_definitions(-DOHOS_PLATFORM) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(nativerender SHARED - napi_init.cpp - customdialog/customdialogexample.cpp -) - -find_library( - # Sets the name of the path variable. - hilog-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - hilog_ndk.z -) - -find_library( - # Sets the name of the path variable. - libace-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_ndk.z -) - -find_library( - # Sets the name of the path variable. - libnapi-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_napi.z -) - -find_library( - # Sets the name of the path variable. - libuv-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - uv -) - -target_link_libraries(nativerender PUBLIC - libnative_drawing.so libace_napi.z.so ${hilog-lib} ${libace-lib} ${libnapi-lib} ${libuv-lib} libudmf.so hilog_ndk.z.so) \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/common.h b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/common.h deleted file mode 100644 index 5b1429e55fc57e0e890c9a9954bb26507fb5371c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/common.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef ARKUI_CAPI_XTS_COMMON_TEST_H -#define ARKUI_CAPI_XTS_COMMON_TEST_H - -#include -#include - -namespace ArkUICapiTest { -#define PARAM_0 0 -#define PARAM_1 1 -#define PARAM_2 2 -#define PARAM_4 4 -#define PARAM_10 10 -#define PARAM_15 15 -#define PARAM_20 20 -#define PARAM_32 32 -#define PARAM_40 40 -#define PARAM_100 100 -#define PARAM_150 150 -#define PARAM_200 200 -#define PARAM_300 300 -#define PARAM_350 350 -#define PARAM_400 400 -#define PARAM_500 500 -#define PARAM_600 600 -#define PARAM_800 800 - -#define PARAM_NEGATIVE_10 (-10) -#define PARAM_NEGATIVE_20 (-20) -#define PARAM_NEGATIVE_99 (-99) -#define DEFAULT_MARGIN 10 - -#define SUCCESS 0 -#define INVALID_PARAM 401 -#define NULL_PARAM 404 - -#define COLOR_RED 0xFFFF0000 -#define COLOR_GREEN 0xFF00FF00 -#define COLOR_BLUE 0xFF0000FF -#define COLOR_YELLOW 0xFFFFFF00 -#define COLOR_GRAY 0xFFDDDDDD -#define COLOR_WHITE 0xFFFFFFFF -#define COLOR_PINK 0xFFFFC0CB -#define ON_CLICK_EVENT_ID 6001 -#define ON_CLICK_EVENT_ID2 6015 -#define ON_CLICK_EVENT_ID3 6016 -#define ON_CLICK_EVENT_ID4 6017 -#define ON_CLICK_EVENT_ID5 6018 - -#define ON_CLICK_EVENT_ID_2 1002 - -/** - * Log print domain. - */ -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; -} // namespace ArkUICapiTest -#endif // ARKUI_CAPI_XTS_COMMON_TEST_H diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/customdialogexample.cpp b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/customdialogexample.cpp deleted file mode 100644 index 40464e1c909f93d8c33e0e82a0d5a3349f5c0c6d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/customdialogexample.cpp +++ /dev/null @@ -1,1828 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "customdialogexample.h" -#include -#include -#include -#include -#include -#include - -namespace ArkUICapiTest { -static ArkUI_CustomDialogOptions *g_dialogOption = nullptr; -static ArkUI_NativeDialogHandle globalCustomDialog = nullptr; -static ArkUI_NativeDialogAPI_3* g_dialogAPI3 = nullptr; -static int32_t g_dialogIdState = 0; -static std::mutex g_dialogIdMutex; // 全局互斥锁,保护 g_dialogIdState -CallBackData CustomDialogTest::callBackData; -static bool g_isEventState = false; -static bool g_isOpenDialog = false; -static bool g_isOpenController = false; -napi_env CustomDialogTest::g_env = nullptr; -std::vector CustomDialogTest::g_callback_refs{}; - -enum CustomDialogSettingType { - BACKGROUND_COLOR = 1, // 背景颜色 - CORNER_RADIUS, // 圆角半径 - BORDER_COLORS, // 边框颜色 - BORDER_STYLE, // 边框样式 - BACKBOARD_SHADOW, // 背板 - BACKBOARD_CUSTOM_SHADOW, // 自定义背板阴影 - BACKGROUND_BLUR_STYLE, // 背板模糊材质 - ALIGN_MODE, // 对齐模式 - MODAL_MODE, // 自定义弹窗是否开启模态样式的弹窗 - AUTO_CANCEL, // 自定义弹窗是否允许点击遮罩层退出 - SUBWINDOW_MODE, // 弹窗是否在子窗口显示此弹窗 - MASK, // 自定义弹窗遮罩属性 - KEYBOARD_AVOID_MODE, // 弹窗的键盘避让模式 - HOVER_MODE_ENABLED, // 弹窗是否响应悬停态 - HOVER_MODE_AREA, // 悬停态下弹窗默认展示区域 - BACKGROUND_BLUR_STYLE_OPTIONS, // 背景模糊效果 - BACKGROUND_EFFECT, // 设置弹窗的背景效果参数 - LEVEL_MODE, // 设置弹窗的显示层级 - LEVEL_UNIQUE_ID, // 设置弹窗显示层级页面下的节点id - IMMERSIVE_MODE, // 设置嵌入式弹窗蒙层的显示区域 - SHOULD_BLOCK_DISMISS, // 设置是否需要屏蔽系统关闭弹窗行为,true表示屏蔽系统行为不关闭弹窗,false表示不屏蔽 -}; - -enum ControllerAttributeType { - NATIVE_BACKGROUND_COLOR = 1, // 背景颜色 - NATIVE_CORNER_RADIUS, // 圆角半径 - NATIVE_BORDER_COLORS, // 边框颜色 - NATIVE_BORDER_STYLE, // 边框样式 - NATIVE_BACKBOARD_SHADOW, // 背板阴影 - NATIVE_BACKBOARD_CUSTOM_SHADOW, // 自定义背板阴影 - NATIVE_BACKGROUND_BLUR_STYLE, // 背板模糊材质 - NATIVE_HOVER_MODE_ENABLED, // 是否响应悬停态 - NATIVE_HOVER_MODE_AREA, // 悬停态下弹窗默认展示区域 - NATIVE_FOCUSABLE, // 是否获取焦点 - NATIVE_BACKGROUND_BLUR_STYLE_OPTIONS, // 背景模糊效果 - NATIVE_BACKGROUND_EFFECT, // 弹窗的背景效果参数 - NATIVE_CONTENT_ALIGNMENT, // 设置自定义弹窗对齐方式。 - NATIVE_RESET_CONTENT_ALIGNMENT, // 重置setContentAlignment方法设置的属性,使用系统默认的对齐方式。 - NATIVE_MODAL_MODE, // 设置自定义弹窗是否开启模态样式的弹窗 - NATIVE_AUTO_CANCEL, // 设置自定义弹窗是否允许通过点击遮罩层退出 - NATIVE_MASK, // 设置自定义弹窗遮罩属性 - NATIVE_COLUMN_COUNT, // 设置弹窗宽度占栅格宽度的个数 - NATIVE_CUSTOM_STYLE, // 弹窗容器样式是否可以自定义 - NATIVE_CUSTOM_ANIMATION, // 弹窗容器是否使用自定义弹窗动画 - NATIVE_KEYBOARD_AVOID_MODE, // 设置自定义弹窗避让键盘模式 - NATIVE_LEVEL_MODE, // 设置弹窗的显示层级 - NATIVE_LEVEL_UNIQUE_ID, // 设置弹窗显示层级页面下的节点id - NATIVE_IMMERSIVE_MODE, // 设置嵌入式弹窗蒙层的显示区域 - NATIVE_LEVEL_ORDER, // 设置自定义弹窗显示的顺序 - NATIVE_REGISTER_ON_WILL_DISMISS, // 当触发系统定义的返回操作、键盘ESC关闭交互操作时,如果注册了该回调函数,弹窗不会立即关闭,而是由用户决定是否关闭。 - NATIVE_REGISTER_ON_WILL_DISMISS_WITH_USER_DATA, // 注册系统关闭自定义弹窗的监听事件 -}; - -static void OnWillDismiss(ArkUI_DialogDismissEvent *event) -{ - ArkUI_AttributeItem id_item = {}; - id_item.string = "willDismiss"; - CustomDialogTest::callBackData.willDismiss = id_item.string; - - OH_ArkUI_DialogDismissEvent_SetShouldBlockDismiss(event, g_isEventState); - OH_ArkUI_DialogDismissEvent_GetUserData(event); - OH_ArkUI_DialogDismissEvent_GetDismissReason(event); -} - -void CallCallbackMethodWithString(napi_env env, const char *methodName, const std::string &value) -{ - if (CustomDialogTest::g_callback_refs.empty()) { - return; - } - for (auto &ref : CustomDialogTest::g_callback_refs) { - if (ref == nullptr) { - continue; - } - napi_value cbObj = nullptr; - if (napi_get_reference_value(env, ref, &cbObj) != napi_ok || cbObj == nullptr) { - continue; - } - napi_value method = nullptr; - if (napi_get_named_property(env, cbObj, methodName, &method) != napi_ok) { - continue; - } - napi_valuetype methodType; - if (napi_typeof(env, method, &methodType) != napi_ok || methodType != napi_function) { - continue; - } - napi_value argv[1]; - napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &argv[0]); - napi_value result; - napi_call_function(env, cbObj, method, 1, argv, &result); - } -} - -void ShowDialogState(ArkUI_DialogState state) -{ - std::string resultStr; - switch (state) { - case DIALOG_UNINITIALIZED: - resultStr = "DIALOG_UNINITIALIZED"; - break; - case DIALOG_INITIALIZED: - resultStr = "DIALOG_INITIALIZED"; - break; - case DIALOG_APPEARING: - resultStr = "DIALOG_APPEARING"; - break; - case DIALOG_APPEARED: - resultStr = "DIALOG_APPEARED"; - break; - case DIALOG_DISAPPEARING: - resultStr = "DIALOG_DISAPPEARING"; - break; - case DIALOG_DISAPPEARED: - resultStr = "DIALOG_DISAPPEARED"; - break; - default: - break; - } - CallCallbackMethodWithString(CustomDialogTest::g_env, "fromNapiCallWithStringParam", resultStr); -} - -static void OnWillAppear(void *userData) -{ - ArkUI_AttributeItem id_item = {}; - id_item.string = "willAppear"; - CustomDialogTest::callBackData.willAppear = id_item.string; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", "OnWillAppear"); -} - -static void OnDidAppear(void *userData) -{ - ArkUI_AttributeItem id_item = {}; - id_item.string = "didAppear"; - CustomDialogTest::callBackData.didAppear = id_item.string; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", "OnDidAppear"); - ArkUI_DialogState state = DIALOG_UNINITIALIZED; - int32_t result = OH_ArkUI_CustomDialog_GetState(reinterpret_cast(g_dialogOption), &state); - CallCallbackMethodWithString(CustomDialogTest::g_env, "fromNapiCallWithStringParam", "DIALOG_APPEARED"); -} - -static void OnWillDisappear(void *userData) -{ - ArkUI_AttributeItem id_item = {}; - id_item.string = "willDisappear"; - CustomDialogTest::callBackData.willDisappear = id_item.string; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", "OnWillDisappear"); -} - -static void OnDidDisappear(void *userData) -{ - ArkUI_AttributeItem id_item = {}; - id_item.string = "didDisappear"; - CustomDialogTest::callBackData.didDisappear = id_item.string; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", "OnDidDisappear"); - ArkUI_DialogState state = DIALOG_UNINITIALIZED; - int32_t result = OH_ArkUI_CustomDialog_GetState(reinterpret_cast(g_dialogOption), &state); - CallCallbackMethodWithString(CustomDialogTest::g_env, "fromNapiCallWithStringParam", "DIALOG_DISAPPEARED"); -} - -void MyCustomCallback(int32_t dialogId) -{ - std::lock_guard lock(g_dialogIdMutex); - g_dialogIdState = dialogId; -} - -void MyCustomCallback2(int32_t dialogId) -{ - std::lock_guard lock(g_dialogIdMutex); - g_dialogIdState = dialogId; -} - -void MyOnClose(ArkUI_NodeEvent *event) -{ - if (g_dialogOption) { - std::lock_guard lock(g_dialogIdMutex); - OH_ArkUI_CustomDialog_CloseDialog(g_dialogIdState); - } -} - -ArkUI_NodeHandle CreateStyledButton(ArkUI_NativeNodeAPI_1 *nodeAPI, - ArkUI_NodeHandle parent, - const char *text, - void (*eventReceiver)(ArkUI_NodeEvent *callback), - int32_t eventId = 0) -{ - if (!nodeAPI) { - return nullptr; - } - - const char *id = text; - auto button = nodeAPI->createNode(ARKUI_NODE_BUTTON); - button = CustomDialogUtils::SetButton(nodeAPI, button, id, text); - int32_t ret = 0; - ret = nodeAPI->registerNodeEvent(button, NODE_ON_CLICK, eventId, nullptr); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "CreateStyledButton registerNodeEvent failed, ret = %{public}d ", ret); - } - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "CreateStyledButton registerNodeEvent failed, ret = %{public}d ", ret); - } - ret = nodeAPI->addNodeEventReceiver(button, eventReceiver); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "CreateStyledButton addNodeEventReceiver failed, ret = %{public}d ", ret); - } - nodeAPI->addChild(parent, button); - return button; -} - -int32_t SetDialogBackgroundColor(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - ret = OH_ArkUI_CustomDialog_SetBackgroundColor(g_dialogOption, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetBackgroundColor failed, ret = %{public}d", ret); - } - ret = OH_ArkUI_CustomDialog_UpdateDialog(g_dialogOption, MyCustomCallback2); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_UpdateDialog failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetDialogBackboardShadow() -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - ret = OH_ArkUI_CustomDialog_SetShadow(g_dialogOption, ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetShadow failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogBackboardCustomShadow() -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置自定义阴影 - ArkUI_NumberValue custom_shadow_value[] = { - {.f32 = 50}, {.i32 = {}}, {.f32 = {}}, {.f32 = {}}, - {.i32 = {}}, {.u32 = COLOR_RED}, {.u32 = PARAM_200} - }; - ArkUI_AttributeItem custom_shadow_item = { - custom_shadow_value, sizeof(custom_shadow_value) / sizeof(ArkUI_NumberValue) - }; - ret = OH_ArkUI_CustomDialog_SetCustomShadow(g_dialogOption, &custom_shadow_item); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetCustomShadow failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogBorderColors(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 始终设置全部四个边框 - ret = OH_ArkUI_CustomDialog_SetBorderColor(g_dialogOption, nodeValue, nodeValue, nodeValue, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetBorderColor failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogBorderStyle(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - int32_t borderStyle = nodeValue; - ret = OH_ArkUI_CustomDialog_SetBorderStyle(g_dialogOption, borderStyle, borderStyle, borderStyle, borderStyle); - // 设置边框颜色 - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetBorderStyle failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogCornerRadius(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置圆角半径 - ret = OH_ArkUI_CustomDialog_SetCornerRadius(g_dialogOption, nodeValue, nodeValue, nodeValue, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetCornerRadius failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetDialogBackgroundBlurStyle(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置背板模糊材质 - ret = OH_ArkUI_CustomDialog_SetBackgroundBlurStyle(g_dialogOption, (ArkUI_BlurStyle)nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetBackgroundBlurStyle failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogAlignment(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置弹窗的对齐模式 - ret = OH_ArkUI_CustomDialog_SetAlignment(g_dialogOption, static_cast(nodeValue), 0, PARAM_200); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetAlignment failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetDialogModalMode(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置自定义弹窗是否开启模态样式的弹窗 - ret = OH_ArkUI_CustomDialog_SetModalMode(g_dialogOption, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetModalMode failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogAutoCancel(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置自定义弹窗是否允许点击遮罩层退出 - ret = OH_ArkUI_CustomDialog_SetAutoCancel(g_dialogOption, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetAutoCancel failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogSubwindowMode(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置弹窗是否在子窗口显示此弹窗 - ret = OH_ArkUI_CustomDialog_SetSubwindowMode(g_dialogOption, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetSubwindowMode failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetDialogMask() -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - ArkUI_Rect maskRect = {PARAM_0, PARAM_0, PARAM_500, PARAM_500}; - // 设置自定义弹窗遮罩属性 - ret = OH_ArkUI_CustomDialog_SetMask(g_dialogOption, COLOR_RED, &maskRect); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetMask failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogKeyboardAvoidMode(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置弹窗避让键盘的模式 - ret = OH_ArkUI_CustomDialog_SetKeyboardAvoidMode(g_dialogOption, (ArkUI_KeyboardAvoidMode)nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetKeyboardAvoidMode failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogHoverModeEnabled(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置弹窗是否响应悬停态。 - ret = OH_ArkUI_CustomDialog_SetHoverModeEnabled(g_dialogOption, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetHoverModeEnabled failed, ret = %{public}d", ret); - } - // 设置悬停态下弹窗默认展示区域 - ret = OH_ArkUI_CustomDialog_SetHoverModeArea(g_dialogOption, ARKUI_HOVER_MODE_AREA_TYPE_BOTTOM); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetHoverModeArea failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogHoverModeArea(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置弹窗是否响应悬停态。 - ret = OH_ArkUI_CustomDialog_SetHoverModeEnabled(g_dialogOption, true); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetHoverModeEnabled failed, ret = %{public}d", ret); - } - // 设置悬停态下弹窗默认展示区域 - ret = OH_ArkUI_CustomDialog_SetHoverModeArea(g_dialogOption, (ArkUI_HoverModeAreaType)nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetHoverModeArea failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogBackgroundBlurStyleOptions() -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 模糊效果 - ArkUI_NumberValue blurValues[] = { - {.i32 = ARKUI_COLOR_MODE_LIGHT}, - {.i32 = ARKUI_ADAPTIVE_COLOR_AVERAGE}, - {.f32 = PARAM_1}, - {.u32 = PARAM_20}, - {.u32 = PARAM_20}, - {.i32 = ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_ACTIVE}, - {.u32 = COLOR_RED} - }; - ArkUI_AttributeItem blurItem = { - blurValues, - sizeof(blurValues) / sizeof(ArkUI_NumberValue) - }; - // 设置弹窗的背景模糊效果 - int32_t ret = OH_ArkUI_CustomDialog_SetBackgroundBlurStyleOptions(g_dialogOption, &blurItem); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetBackgroundBlurStyleOptions failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogBackgroundEffect() -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 背景效果 - ArkUI_NumberValue effectValues[] = { - {.f32 = 0}, {.f32 = 0}, {.f32 = 0.0001}, - {.u32 = 0x66FFFFFF}, {.i32 = 0}, {.u32 = PARAM_300}, - {.u32 = PARAM_300}, {.i32 = 1}, {.u32 = 0x00FF0000} - }; - ArkUI_AttributeItem effectItem = { - effectValues, - sizeof(effectValues) / sizeof(ArkUI_NumberValue) - }; - // 设置弹窗的背景效果参数 - int32_t ret = OH_ArkUI_CustomDialog_SetBackgroundEffect(g_dialogOption, &effectItem); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetBackgroundEffect failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogLevelMode(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", "SetDialogLevelMode"); - int32_t ret = 0; - // 设置弹窗的显示层级 - ret = OH_ArkUI_CustomDialog_SetLevelMode(g_dialogOption, (ArkUI_LevelMode)nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetLevelMode failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogLevelUniqueId(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置层级唯一ID - ret = OH_ArkUI_CustomDialog_SetLevelUniqueId(g_dialogOption, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetLevelUniqueId failed, ret = %{public}d", ret); - } - return ret; -} - - -int32_t SetDialogImmersiveMode(uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置嵌入式弹窗蒙层的显示区域 - ret = OH_ArkUI_CustomDialog_SetImmersiveMode(g_dialogOption, (ArkUI_ImmersiveMode)nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetImmersiveMode failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetDialogShouldBlockDismiss(ArkUI_NodeHandle contentNode, uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - g_isEventState = nodeValue; - int32_t ret = 0; - // 注册关闭回调 - ret = OH_ArkUI_CustomDialog_RegisterOnWillDismissCallback(g_dialogOption, contentNode, OnWillDismiss); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_RegisterOnWillDismissCallback failed, ret = %{public}d", ret); - } - return ret; -} - -int32_t SetCustomDialogProperties2(ArkUI_NodeHandle contentNode, int32_t nodeType, uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - CustomDialogSettingType settingType = static_cast(nodeType); - switch (settingType) { - case CustomDialogSettingType::MASK: // 设置弹窗是否在子窗口显示此弹窗 - ret = SetDialogMask(); - break; - case CustomDialogSettingType::KEYBOARD_AVOID_MODE: // 弹窗的键盘避让模式 - ret = SetDialogKeyboardAvoidMode(nodeValue); - break; - case CustomDialogSettingType::HOVER_MODE_ENABLED: // 弹窗是否响应悬停态 - ret = SetDialogHoverModeEnabled(nodeValue); - break; - case CustomDialogSettingType::HOVER_MODE_AREA: // 悬停态下弹窗默认展示区域 - ret = SetDialogHoverModeArea(nodeValue); - break; - case CustomDialogSettingType::BACKGROUND_BLUR_STYLE_OPTIONS: // 背景模糊效果 - ret = SetDialogBackgroundBlurStyleOptions(); - break; - case CustomDialogSettingType::BACKGROUND_EFFECT: // 设置弹窗的背景效果参数 - ret = SetDialogBackgroundEffect(); - break; - case CustomDialogSettingType::LEVEL_MODE: // 设置弹窗的显示层级 - ret = SetDialogLevelMode(nodeValue); - break; - case CustomDialogSettingType::LEVEL_UNIQUE_ID: // 设置弹窗显示层级页面下的节点id - ret = SetDialogLevelUniqueId(nodeValue); - break; - case CustomDialogSettingType::IMMERSIVE_MODE: // 设置嵌入式弹窗蒙层的显示区域 - ret = SetDialogImmersiveMode(nodeValue); - break; - case CustomDialogSettingType:: - SHOULD_BLOCK_DISMISS: // 设置是否需要屏蔽系统关闭弹窗行为,true表示屏蔽系统行为不关闭弹窗,false表示不屏 - ret = SetDialogShouldBlockDismiss(contentNode, nodeValue); - break; - default: - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - return ret; -} - -int32_t SetCustomDialogProperties(ArkUI_NodeHandle contentNode, int32_t nodeType, uint32_t nodeValue) -{ - if (!g_dialogOption) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - CustomDialogSettingType settingType = static_cast(nodeType); - switch (settingType) { - case CustomDialogSettingType::BACKGROUND_COLOR : // 设置背景颜色 - ret = SetDialogBackgroundColor(nodeValue); - break; - case CustomDialogSettingType::CORNER_RADIUS : // 设置圆角半径 - ret = SetDialogCornerRadius(nodeValue); - break; - case CustomDialogSettingType::BORDER_COLORS : // 设置边框颜色 - ret = SetDialogBorderColors(nodeValue); - break; - case CustomDialogSettingType::BORDER_STYLE: // 设置边框样式 - ret = SetDialogBorderStyle(nodeValue); - break; - case CustomDialogSettingType::BACKBOARD_SHADOW: // 设置背板阴影 - ret = SetDialogBackboardShadow(); - break; - case CustomDialogSettingType::BACKBOARD_CUSTOM_SHADOW: // 设置自定义背板阴影 - ret = SetDialogBackboardCustomShadow(); - break; - case CustomDialogSettingType::BACKGROUND_BLUR_STYLE: // 设置背板模糊材质 - ret = SetDialogBackgroundBlurStyle(nodeValue); - break; - case CustomDialogSettingType::ALIGN_MODE: // 设置弹窗的对齐模式 - ret = SetDialogAlignment(nodeValue); - break; - case CustomDialogSettingType::MODAL_MODE: // 设置自定义弹窗是否开启模态样式的弹窗 - ret = SetDialogModalMode(nodeValue); - break; - case CustomDialogSettingType::AUTO_CANCEL: // 设置自定义弹窗是否允许点击遮罩层退出 - ret = SetDialogAutoCancel(nodeValue); - break; - case CustomDialogSettingType::SUBWINDOW_MODE: // 设置弹窗是否在子窗口显示此弹窗 - ret = SetDialogSubwindowMode(nodeValue); - break; - default: - ret = SetCustomDialogProperties2(contentNode, nodeType, nodeValue); - break; - } - return ret; -} - -void SetDialogBasicStyle(ArkUI_CustomDialogOptions* controller) -{ - if (!controller) { - return; - } - int32_t ret = 0; - // 设置边框宽度 - ret = OH_ArkUI_CustomDialog_SetBorderWidth(controller, PARAM_2, PARAM_2, PARAM_2, PARAM_2, - ARKUI_LENGTH_METRIC_UNIT_VP); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetBorderWidth failed, ret = %{public}d", ret); - } - - // 设置宽度 - ret = OH_ArkUI_CustomDialog_SetWidth(controller, PARAM_300, ARKUI_LENGTH_METRIC_UNIT_VP); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetWidth failed, ret = %{public}d", ret); - } - // 设置高度 - ret = OH_ArkUI_CustomDialog_SetHeight(controller, PARAM_200, ARKUI_LENGTH_METRIC_UNIT_VP); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_SetHeight failed, ret = %{public}d", ret); - } -} - -// 注册对话框回调事件 -void RegisterDialogCallbacks(ArkUI_CustomDialogOptions* controller, ArkUI_NodeHandle contentNode) -{ - if (!controller) { - return; - } - int32_t ret = 0; - // 注册显示前回调 - ret = OH_ArkUI_CustomDialog_RegisterOnWillAppearCallback(controller, contentNode, OnWillAppear); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_RegisterOnWillAppearCallback failed, ret = %{public}d", ret); - } - - // 注册显示后回调 - ret = OH_ArkUI_CustomDialog_RegisterOnDidAppearCallback(controller, contentNode, OnDidAppear); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_RegisterOnDidAppearCallback failed, ret = %{public}d", ret); - } - - // 注册消失前回调 - ret = OH_ArkUI_CustomDialog_RegisterOnWillDisappearCallback(controller, contentNode, OnWillDisappear); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_RegisterOnWillDisappearCallback failed, ret = %{public}d", ret); - } - - // 注册消失后回调 - ret = OH_ArkUI_CustomDialog_RegisterOnDidDisappearCallback(controller, contentNode, OnDidDisappear); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "OH_ArkUI_CustomDialog_RegisterOnDidDisappearCallback failed, ret = %{public}d", ret); - } -} - -// 主初始化函数 -void InitDialogOptions(ArkUI_CustomDialogOptions* controller, ArkUI_NodeHandle contentNode) -{ - if (!controller) { - return; - } - SetDialogBasicStyle(controller); - RegisterDialogCallbacks(controller, contentNode); -} - -bool CreateCustomDialog() -{ - ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - if (!nodeAPI) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Error", "nodeAPI is null"); - return false; - } - // 创建对话框内容 - auto column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - if (!column) { - return false; - } - // 创建对话框控制器 - auto dialogController = OH_ArkUI_CustomDialog_CreateOptions(column); - if (!dialogController) { - return false; - } - g_dialogOption = dialogController; - ArkUI_DialogState state = DIALOG_UNINITIALIZED; - OH_ArkUI_CustomDialog_GetState(reinterpret_cast(g_dialogOption), &state); - ShowDialogState(state); - InitDialogOptions(g_dialogOption, column); - CreateStyledButton(nodeAPI, column, "Close Dialog", MyOnClose); - g_isOpenDialog = true; - return true; -} - -int32_t CustomDialogTest::SetCustomDialogDialogAttribute(int32_t nodeType, uint32_t nodeValue) -{ - ArkUI_DialogState state = DIALOG_UNINITIALIZED; - int32_t result = OH_ArkUI_CustomDialog_GetState(reinterpret_cast(g_dialogOption), &state); - ShowDialogState(state); - ArkUI_NodeHandle column; - if (!g_isOpenDialog && !g_dialogOption) { - bool ret = CreateCustomDialog(); - if (!ret) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - } - result = SetCustomDialogProperties(column, nodeType, nodeValue); - return result; -} - -static void CloseApplication() -{ - std::lock_guard lock(g_dialogIdMutex); - if (globalCustomDialog) { - g_dialogAPI3->nativeDialogAPI1.dispose(globalCustomDialog); - } else { - OH_ArkUI_CustomDialog_DisposeOptions(g_dialogOption); - } -} - -napi_value CustomDialogTest::SetCustomDialog(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", "customDialogAttrsTest"); - - // 1. 获取参数 - size_t argc = 2; - napi_value argv[2]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - // 2. 检查参数数量 - if (argc < 2) { - napi_throw_error(env, nullptr, "Expected 2 arguments: nodeType (string) and nodeValue (number)"); - return nullptr; - } - - // 3. 提取第一个参数(nodeType,字符串) - int32_t nodeType; - int status = napi_get_value_int32(env, argv[0], &nodeType); - if (status != napi_ok) { - napi_throw_type_error(env, nullptr, "nodeValue must be a number"); - return nullptr; - } - // 4. 提取第二个参数(nodeValue,数字) - uint32_t nodeValue; - status = napi_get_value_uint32(env, argv[1], &nodeValue); - if (status != napi_ok) { - napi_throw_type_error(env, nullptr, "nodeValue must be a number"); - return nullptr; - } - g_env = env; - int32_t result = SetCustomDialogDialogAttribute(nodeType, nodeValue); - - // 返回 int 给 JavaScript - napi_value jsResult; - napi_create_int32(env, result, &jsResult); - return jsResult; -} - -napi_value CustomDialogTest::CloseDialog(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", "CloseDialog"); - CloseApplication(); - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - return nullptr; - } - return exports; -} - -napi_value CustomDialogTest::CloseCustomDialog(napi_env env, napi_callback_info info) -{ - if (g_dialogOption) { - std::lock_guard lock(g_dialogIdMutex); - OH_ArkUI_CustomDialog_CloseDialog(g_dialogIdState); - g_dialogOption = nullptr; - ArkUI_DialogState state = DIALOG_UNINITIALIZED; - OH_ArkUI_CustomDialog_GetState(reinterpret_cast(g_dialogOption), &state); - ShowDialogState(state); - g_isOpenDialog = false; - } - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - return nullptr; - } - return exports; -} - -napi_value CustomDialogTest::OpenCustomDialog(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", "CloseDialog"); - if (!g_isOpenDialog && !g_dialogOption) { - bool ret = CreateCustomDialog(); - if (!ret) { - return nullptr; - } - } - if (g_dialogOption) { - OH_ArkUI_CustomDialog_OpenDialog(g_dialogOption, MyCustomCallback); - } - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - return nullptr; - } - return exports; -} - -napi_value CustomDialogTest::NAPI_Global_setNapiCallback(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = { nullptr }; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - if (argc < 1 || args[0] == nullptr) { - napi_value undefinedRet; - napi_get_undefined(env, &undefinedRet); - return undefinedRet; - } - - napi_valuetype valueType; - napi_typeof(env, args[0], &valueType); - if (valueType != napi_object) { - napi_value undefinedRet; - napi_get_undefined(env, &undefinedRet); - return undefinedRet; - } - - // 保存回调对象引用,允许多次注册 - napi_ref ref = nullptr; - napi_create_reference(env, args[0], 1, &ref); - if (ref != nullptr) { - CustomDialogTest::g_callback_refs.clear(); - CustomDialogTest::g_callback_refs.push_back(ref); - } - - napi_value undefinedRet; - napi_get_undefined(env, &undefinedRet); - return undefinedRet; -} - -// 注册对话框回调事件 -void RegisterDialogControllerCallbacks() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return; - } - int32_t ret = 0; - // 注册显示前回调 - ret = g_dialogAPI3->registerOnWillAppear(globalCustomDialog, nullptr, OnWillAppear); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "registerOnWillAppear failed, ret = %{public}d", ret); - } - - // 注册显示后回调 - ret = g_dialogAPI3->registerOnDidAppear(globalCustomDialog, nullptr, OnDidAppear); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "registerOnDidAppear failed, ret = %{public}d", ret); - } - - // 注册消失前回调 - ret = g_dialogAPI3->registerOnWillDisappear(globalCustomDialog, nullptr, OnWillDisappear); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "registerOnWillDisappear failed, ret = %{public}d", ret); - } - - // 注册消失后回调 - ret = g_dialogAPI3->registerOnDidDisappear(globalCustomDialog, nullptr, OnDidDisappear); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "registerOnDidDisappear failed, ret = %{public}d", ret); - } -} - -// 设置对话框样式属性 -static void SetDialogStyles() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return; - } - int32_t ret = 0; - - ret = g_dialogAPI3->setBorderWidth(globalCustomDialog, PARAM_2, PARAM_2, PARAM_2, PARAM_2, - ARKUI_LENGTH_METRIC_UNIT_PX); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "SetDialogStyles setBorderWidth failed, ret = %{public}d ", ret); - } - - // 设置尺寸 - ret = g_dialogAPI3->setWidth(globalCustomDialog, PARAM_300, ARKUI_LENGTH_METRIC_UNIT_VP); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "SetDialogStyles setWidth failed, ret = %{public}d ", ret); - } - - ret = g_dialogAPI3->setHeight(globalCustomDialog, PARAM_200, ARKUI_LENGTH_METRIC_UNIT_VP); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "SetDialogStyles setHeight failed, ret = %{public}d ", ret); - } - RegisterDialogControllerCallbacks(); -} - -int32_t SetNativeDialogBackgroundColor(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置背景颜色 - ret = g_dialogAPI3->nativeDialogAPI1.setBackgroundColor(globalCustomDialog, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setBackgroundColor failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogCornerRadius(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置圆角 - ret = g_dialogAPI3->nativeDialogAPI1.setCornerRadius(globalCustomDialog, nodeValue, nodeValue, - nodeValue, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setCornerRadius failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogBorderColor(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置边框 - ret = g_dialogAPI3->setBorderColor(globalCustomDialog, nodeValue, nodeValue, nodeValue, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setBorderColor failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogBorderStyle(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置边框样式 - ret = g_dialogAPI3->setBorderStyle(globalCustomDialog, nodeValue, nodeValue, nodeValue, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setBorderStyle failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogShadow() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = g_dialogAPI3->setShadow(globalCustomDialog, ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setShadow failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogCustomShadow() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置自定义阴影 - ArkUI_NumberValue custom_shadow_value[] = { - {.f32 = 50}, {.i32 = {}}, {.f32 = {}}, {.f32 = {}}, - {.i32 = {}}, {.u32 = COLOR_RED}, {.u32 = PARAM_200} - }; - ArkUI_AttributeItem custom_shadow_item = { - custom_shadow_value, sizeof(custom_shadow_value) / sizeof(ArkUI_NumberValue) - }; - int32_t ret = g_dialogAPI3->setCustomShadow(globalCustomDialog, &custom_shadow_item); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setCustomShadow failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogBackgroundBlurStyle() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = g_dialogAPI3->setBackgroundBlurStyle(globalCustomDialog, ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setBackgroundBlurStyle failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogEnableHoverMode(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置弹窗是否响应悬停态。 - ret = g_dialogAPI3->enableHoverMode(globalCustomDialog, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "enableHoverMode failed, ret = %{public}d ", ret); - } - ret = g_dialogAPI3->setHoverModeArea(globalCustomDialog, ARKUI_HOVER_MODE_AREA_TYPE_BOTTOM); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setHoverModeArea failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogFocusable(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - // 设置自定义弹窗是否获取焦点。 - ret = g_dialogAPI3->setFocusable(globalCustomDialog, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setFocusable failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogHoverModeArea(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置弹窗是否响应悬停态 - int32_t ret = g_dialogAPI3->enableHoverMode(globalCustomDialog, true); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "enableHoverMode failed, ret = %{public}d ", ret); - } - ret = g_dialogAPI3->setHoverModeArea(globalCustomDialog, static_cast(nodeValue)); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setHoverModeArea failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogBackgroundBlurStyleOptions() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置背景效果选项 - ArkUI_NumberValue custom_BlurStyleOptions_value[] = { - {.i32 = ARKUI_COLOR_MODE_LIGHT}, {.i32 = ARKUI_ADAPTIVE_COLOR_AVERAGE}, - {.f32 = 1}, {.u32 = PARAM_20}, {.u32 = PARAM_20}, - {.i32 = ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_ACTIVE}, {.u32 = COLOR_RED} - }; - ArkUI_AttributeItem custom_BlurStyleOptions_item = { - custom_BlurStyleOptions_value, sizeof(custom_BlurStyleOptions_value) / sizeof(ArkUI_NumberValue) - }; - int32_t ret = g_dialogAPI3->setBackgroundBlurStyleOptions(globalCustomDialog, &custom_BlurStyleOptions_item); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setBackgroundBlurStyleOptions failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogSetupBackgroundEffect() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 背景效果 - ArkUI_NumberValue effectValues[] = { - {.f32 = 0}, {.f32 = 0}, {.f32 = 0.0001}, - {.u32 = 0x66FFFFFF}, {.i32 = 0}, {.u32 = PARAM_300}, - {.u32 = PARAM_300}, {.i32 = 1}, {.u32 = 0x00FF0000} - }; - ArkUI_AttributeItem effectItem = { - effectValues, - sizeof(effectValues) / sizeof(ArkUI_NumberValue) - }; - // 设置弹窗的背景效果参数 - int32_t ret = g_dialogAPI3->setBackgroundEffect(globalCustomDialog, &effectItem); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setBackgroundEffect failed, ret = %{public}d ", ret); - } - return ret; -} - -napi_value CustomDialogTest::SetDialogController(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", "customDialogAttrsTest"); - - // 1. 获取参数 - size_t argc = 2; - napi_value argv[2]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - // 2. 检查参数数量 - if (argc < 2) { - napi_throw_error(env, nullptr, "Expected 2 arguments: nodeType (string) and nodeValue (number)"); - return nullptr; - } - - // 3. 提取第一个参数(nodeType,字符串) - int32_t nodeType; - int status = napi_get_value_int32(env, argv[0], &nodeType); - if (status != napi_ok) { - napi_throw_type_error(env, nullptr, "nodeValue must be a number"); - return nullptr; - } - // 4. 提取第二个参数(nodeValue,数字) - uint32_t nodeValue; - status = napi_get_value_uint32(env, argv[1], &nodeValue); - if (status != napi_ok) { - napi_throw_type_error(env, nullptr, "nodeValue must be a number"); - return nullptr; - } - g_env = env; - int32_t result = OnEventReceiveTestAPI(nodeType, nodeValue); - - // 返回 int 给 JavaScript - napi_value jsResult; - napi_create_int32(env, result, &jsResult); - return jsResult; -} - -int32_t CustomDialogTest::SetDialogControllerAttribute(int32_t nodeType, uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - auto type = static_cast(nodeType); - switch (type) { - case ControllerAttributeType::NATIVE_BACKGROUND_COLOR : // 设置背景颜色 - ret = SetNativeDialogBackgroundColor(nodeValue); - break; - case ControllerAttributeType::NATIVE_CORNER_RADIUS : // 设置圆角半径 - ret = SetNativeDialogCornerRadius(nodeValue); - break; - case ControllerAttributeType::NATIVE_BORDER_COLORS: // 设置边框颜色 - ret = SetNativeDialogBorderColor(nodeValue); - break; - case ControllerAttributeType::NATIVE_BORDER_STYLE: // 设置边框样式 - ret = SetNativeDialogBorderStyle(nodeValue); - break; - case ControllerAttributeType::NATIVE_BACKBOARD_SHADOW: // 设置背板阴影 - ret = SetNativeDialogShadow(); - break; - case ControllerAttributeType::NATIVE_BACKBOARD_CUSTOM_SHADOW: // 设置自定义背板阴影 - ret = SetNativeDialogCustomShadow(); - break; - case ControllerAttributeType::NATIVE_BACKGROUND_BLUR_STYLE: // 设置背板模糊材质 - ret = SetNativeDialogBackgroundBlurStyle(); - break; - case ControllerAttributeType::NATIVE_HOVER_MODE_ENABLED: // 设置是否响应悬停态 - ret = SetNativeDialogEnableHoverMode(nodeValue); - break; - case ControllerAttributeType::NATIVE_HOVER_MODE_AREA: // 设置悬停态下自定义弹窗默认展示区域 - ret = SetNativeDialogHoverModeArea(nodeValue); - break; - case ControllerAttributeType::NATIVE_FOCUSABLE: // 设置自定义弹窗是否获取焦点 - ret = SetNativeDialogFocusable(nodeValue); - break; - case ControllerAttributeType::NATIVE_BACKGROUND_BLUR_STYLE_OPTIONS: // 设置弹窗的背景模糊效果 - ret = SetNativeDialogBackgroundBlurStyleOptions(); - break; - case ControllerAttributeType::NATIVE_BACKGROUND_EFFECT: // 设置弹窗的背景效果参数 - ret = SetNativeDialogSetupBackgroundEffect(); - break; - default: - ret = -1; - break; - } - return ret; -} - -int32_t SetNativeDialogContenAlignment() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置自定义弹窗对齐方式 - int32_t ret = g_dialogAPI3->nativeDialogAPI1.setContentAlignment(globalCustomDialog, ARKUI_ALIGNMENT_TOP, 0, 0); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setContentAlignment failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogResetContentAlignment() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 重置setContentAlignment方法设置的属性,使用系统默认的对齐方式 - int32_t ret = g_dialogAPI3->nativeDialogAPI1.resetContentAlignment(globalCustomDialog); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "resetContentAlignment failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogModalMode(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置模态 - int32_t ret = g_dialogAPI3->nativeDialogAPI1.setModalMode(globalCustomDialog, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setModalMode failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogAutoCancel(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置自定义弹窗遮罩属性 - int32_t ret = g_dialogAPI3->nativeDialogAPI1.setAutoCancel(globalCustomDialog, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setAutoCancel failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogMask() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置遮罩 - ArkUI_Rect maskRect = {PARAM_0, PARAM_0, PARAM_500, PARAM_500}; - int32_t ret = g_dialogAPI3->nativeDialogAPI1.setMask(globalCustomDialog, COLOR_RED, &maskRect); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", "setMask failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogCornerRadius() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置圆角 - float topLeft = PARAM_15; - float topRight = PARAM_15; - float bottomLeft = PARAM_15; - float bottomRight = PARAM_15; - int32_t ret = - g_dialogAPI3->nativeDialogAPI1.setCornerRadius(globalCustomDialog, topLeft, topRight, bottomLeft, bottomRight); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setCornerRadius failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogGridColumnCount(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置栅格和样式 - int32_t ret = g_dialogAPI3->nativeDialogAPI1.setGridColumnCount(globalCustomDialog, (int32_t)nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setGridColumnCount failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogCustomStyle(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 弹窗容器样式是否可以自定义 - int32_t ret = g_dialogAPI3->nativeDialogAPI1.enableCustomStyle(globalCustomDialog, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "enableCustomStyle failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogCustomAnimation(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 弹窗容器样式是否可以自定义 - int32_t ret = g_dialogAPI3->nativeDialogAPI1.enableCustomAnimation(globalCustomDialog, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "enableCustomAnimation failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogKeyboardAvoidMode(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 弹窗避让键盘模式 - int32_t ret = g_dialogAPI3->setKeyboardAvoidMode(globalCustomDialog, (ArkUI_KeyboardAvoidMode)nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setKeyboardAvoidMode failed, ret = %{public}d ", ret); - } - if (nodeValue == 0) { - ret = g_dialogAPI3->nativeDialogAPI2.setKeyboardAvoidDistance(globalCustomDialog, PARAM_100, - ARKUI_LENGTH_METRIC_UNIT_VP); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setKeyboardAvoidDistance failed, ret = %{public}d ", ret); - } - } - return ret; -} -int32_t SetNativeDialogLevelMode(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置弹窗的显示层级 - int32_t ret = g_dialogAPI3->nativeDialogAPI2.setLevelMode(globalCustomDialog, (ArkUI_LevelMode)nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setLevelMode failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogLevelUniqueId() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置弹窗显示层级页面下的节点id - int32_t ret = g_dialogAPI3->nativeDialogAPI2.setLevelUniqueId(globalCustomDialog, 0); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setLevelUniqueId failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogImmersiveMode(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置嵌入式弹窗蒙层的显示区域 - int32_t ret = g_dialogAPI3->nativeDialogAPI2.setImmersiveMode(globalCustomDialog, (ArkUI_ImmersiveMode)nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setImmersiveMode failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetNativeDialogLevelOrder(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // 设置自定义弹窗显示的顺序 - int32_t ret = g_dialogAPI3->setLevelOrder(globalCustomDialog, nodeValue); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "setLevelOrder failed, ret = %{public}d ", ret); - } - return ret; -} - -static bool CloseNativeDialogEventCallback(int32_t reason) -{ - if (reason == DIALOG_DISMISS_BACK_PRESS) { - ArkUI_NativeDialogAPI_1 *dialogAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_DIALOG, ArkUI_NativeDialogAPI_1, dialogAPI); - if (globalCustomDialog) { - dialogAPI->close(globalCustomDialog); - } - return true; - } else if (reason == DIALOG_DISMISS_TOUCH_OUTSIDE) { - ArkUI_NativeDialogAPI_1 *dialogAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_DIALOG, ArkUI_NativeDialogAPI_1, dialogAPI); - if (globalCustomDialog) { - dialogAPI->close(globalCustomDialog); - } - return true; - } else if (reason == DIALOG_DISMISS_CLOSE_BUTTON) { - ArkUI_NativeDialogAPI_1 *dialogAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_DIALOG, ArkUI_NativeDialogAPI_1, dialogAPI); - if (globalCustomDialog) { - dialogAPI->close(globalCustomDialog); - } - return true; - } else if (reason == DIALOG_DISMISS_SLIDE_DOWN) { - ArkUI_NativeDialogAPI_1 *dialogAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_DIALOG, ArkUI_NativeDialogAPI_1, dialogAPI); - if (globalCustomDialog) { - dialogAPI->close(globalCustomDialog); - } - return true; - } - return true; -} - -int32_t SetNativeDialogRegisterOnWillDismiss(uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - if (nodeValue) { - // 当触发系统定义的返回操作、键盘ESC关闭交互操作时,如果注册了该回调函数,弹窗不会立即关闭,而是由用户决定是否关闭。 - ret = g_dialogAPI3->nativeDialogAPI1.registerOnWillDismiss(globalCustomDialog, &CloseNativeDialogEventCallback); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "registerOnWillDismiss failed, ret = %{public}d ", ret); - } - } - return ret; -} - -int32_t SetNativeDialogRegisterOnWillDismissWithUserData() -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - g_isEventState = true; - // 注册系统关闭自定义弹窗的监听事件 - ret = g_dialogAPI3->nativeDialogAPI1.registerOnWillDismissWithUserData(globalCustomDialog, globalCustomDialog, - OnWillDismiss); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "registerOnWillDismissWithUserData failed, ret = %{public}d ", ret); - } - return ret; -} - -int32_t SetDialogControllerAttribute3(int32_t nodeType, uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - ControllerAttributeType type = static_cast(nodeType); - switch (type) { - case ControllerAttributeType::NATIVE_LEVEL_MODE: // 设置弹窗的显示层级 - ret = SetNativeDialogLevelMode(nodeValue); - break; - case ControllerAttributeType::NATIVE_LEVEL_UNIQUE_ID: // 设置弹窗显示层级页面下的节点id - ret = SetNativeDialogLevelUniqueId(); - break; - case ControllerAttributeType::NATIVE_IMMERSIVE_MODE: // 设置嵌入式弹窗蒙层的显示区域 - ret = SetNativeDialogImmersiveMode(nodeValue); - break; - case ControllerAttributeType::NATIVE_LEVEL_ORDER: // 设置自定义弹窗显示的顺序 - ret = SetNativeDialogLevelOrder(nodeValue); - break; - case ControllerAttributeType::NATIVE_REGISTER_ON_WILL_DISMISS: - ret = SetNativeDialogRegisterOnWillDismiss(nodeValue); - break; - case ControllerAttributeType::NATIVE_REGISTER_ON_WILL_DISMISS_WITH_USER_DATA: // 注册系统关闭自定义弹窗的监听事件 - ret = SetNativeDialogRegisterOnWillDismissWithUserData(); - break; - default: - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - return ret; -} - -int32_t SetDialogControllerAttribute2(int32_t nodeType, uint32_t nodeValue) -{ - if (!g_dialogAPI3 || !globalCustomDialog) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t ret = 0; - ControllerAttributeType type = static_cast(nodeType); - switch (type) { - case ControllerAttributeType::NATIVE_CONTENT_ALIGNMENT: // 设置自定义弹窗对齐方式 - ret = SetNativeDialogContenAlignment(); - break; - case ControllerAttributeType:: - NATIVE_RESET_CONTENT_ALIGNMENT: // 重置setContentAlignment方法设置的属性,使用系统默认的对齐方式。 - ret = SetNativeDialogResetContentAlignment(); - break; - case ControllerAttributeType::NATIVE_MODAL_MODE: // 设置自定义弹窗是否开启模态样式的弹窗 - ret = SetNativeDialogModalMode(nodeValue); - break; - case ControllerAttributeType::NATIVE_AUTO_CANCEL: // 设置自定义弹窗是否允许通过点击遮罩层退出 - ret = SetNativeDialogAutoCancel(nodeValue); - break; - case ControllerAttributeType::NATIVE_MASK: // 设置自定义弹窗遮罩属性 - ret = SetNativeDialogMask(); - break; - case ControllerAttributeType::NATIVE_CORNER_RADIUS : // 设置弹窗背板圆角半径 - ret = SetNativeDialogCornerRadius(); - break; - case ControllerAttributeType::NATIVE_COLUMN_COUNT: // 设置弹窗宽度占栅格宽度的个数 - ret = SetNativeDialogGridColumnCount(nodeValue); - break; - case ControllerAttributeType::NATIVE_CUSTOM_STYLE: // 弹窗容器样式是否可以自定义 - ret = SetNativeDialogCustomStyle(nodeValue); - break; - case ControllerAttributeType::NATIVE_CUSTOM_ANIMATION: // 弹窗容器是否使用自定义弹窗动画 - ret = SetNativeDialogCustomAnimation(nodeValue); - break; - case ControllerAttributeType::NATIVE_KEYBOARD_AVOID_MODE: // 设置自定义弹窗避让键盘模式 - ret = SetNativeDialogKeyboardAvoidMode(nodeValue); - break; - default: - ret = SetDialogControllerAttribute3(nodeType, nodeValue); - break; - } - return ret; -} - -static void HandleDialogCloseEvent() -{ - if (globalCustomDialog || g_dialogAPI3) { - // 移除内容并关闭对话框 - int32_t ret = g_dialogAPI3->nativeDialogAPI1.removeContent(globalCustomDialog); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "HandleDialogCloseEvent removeContent failed, ret = %{public}d ", ret); - } - - ret = g_dialogAPI3->nativeDialogAPI1.close(globalCustomDialog); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", - "HandleDialogCloseEvent close failed, ret = %{public}d ", ret); - } - globalCustomDialog = nullptr; - g_dialogAPI3 = nullptr; - g_isOpenController = false; - } -} - -static void NodeEventReceiver(ArkUI_NodeEvent* event) -{ - int32_t eventId = OH_ArkUI_NodeEvent_GetTargetId(event); - if (eventId == ON_CLICK_EVENT_ID4) { - HandleDialogCloseEvent(); - return; - } -} - -static ArkUI_NodeHandle CreateButtonNode(ArkUI_NativeNodeAPI_1* nodeAPI) -{ - auto button = nodeAPI->createNode(ARKUI_NODE_BUTTON); - - // 设置按钮标签 - ArkUI_AttributeItem closeText = {.string = "Close Dialog"}; - nodeAPI->setAttribute(button, NODE_BUTTON_LABEL, &closeText); - - // 设置按钮ID - ArkUI_AttributeItem id_item = {}; - id_item.string = "button"; - nodeAPI->setAttribute(button, NODE_ID, &id_item); - - // 注册点击事件 - int32_t ret = nodeAPI->registerNodeEvent(button, NODE_ON_CLICK, ON_CLICK_EVENT_ID4, nullptr); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "CreateButtonNode registerNodeEvent failed, ret = %{public}d ", ret); - } - - // 添加事件接收器 - ret = nodeAPI->addNodeEventReceiver(button, NodeEventReceiver); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogTest", - "CreateButtonNode addNodeEventReceiver failed, ret = %{public}d ", ret); - } - - return button; -} - -bool CreateDialogController() -{ - ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - g_dialogAPI3 = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_DIALOG, "ArkUI_NativeDialogAPI_3")); - if (!g_dialogAPI3 || !nodeAPI) { - return false; - } - // 创建对话框内容 - auto column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - if (!column) { - return false; - } - auto button = CreateButtonNode(nodeAPI); - if (!button) { - return false; - } - nodeAPI->addChild(column, button); - // 创建对话框 - auto customDialog = g_dialogAPI3->nativeDialogAPI1.create(); - if (!customDialog) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Error", "customDialog is null"); - return false; - } - int32_t ret = g_dialogAPI3->nativeDialogAPI1.setContent(customDialog, column); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", "setContent failed, ret = %{public}d ", - ret); - } - globalCustomDialog = customDialog; - ArkUI_DialogState state = DIALOG_UNINITIALIZED; - auto result = OH_ArkUI_CustomDialog_GetState(globalCustomDialog, &state); - ShowDialogState(state); - SetDialogStyles(); - g_isOpenController = true; - return true; -} - -int32_t CustomDialogTest::OnEventReceiveTestAPI(int32_t nodeType, uint32_t nodeValue) -{ - ArkUI_DialogState state = DIALOG_UNINITIALIZED; - int32_t result = OH_ArkUI_CustomDialog_GetState(globalCustomDialog, &state); - ShowDialogState(state); - if (!g_isOpenController || !g_dialogAPI3) { - bool ret = CreateDialogController(); - if (!ret) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - } - result = SetDialogControllerAttribute(nodeType, nodeValue); - if (result != -1) { - return result; - } - result = SetDialogControllerAttribute2(nodeType, nodeValue); - return result; -} - -napi_value CustomDialogTest::OpenNativeDialog(napi_env env, napi_callback_info info) -{ - if (!g_isOpenController || !g_dialogAPI3) { - bool ret = CreateDialogController(); - if (!ret) { - return nullptr; - } - } - - if (globalCustomDialog && g_dialogAPI3) { - int32_t ret = g_dialogAPI3->nativeDialogAPI1.show(globalCustomDialog, true); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ControllerTest", "show failed, ret = %{public}d ", - ret); - } - } - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - return nullptr; - } - return exports; -} - -napi_value CustomDialogTest::ResetDialogController(napi_env env, napi_callback_info info) -{ - if (globalCustomDialog || g_dialogAPI3) { - g_dialogAPI3->nativeDialogAPI1.removeContent(globalCustomDialog); - g_dialogAPI3->nativeDialogAPI1.close(globalCustomDialog); - globalCustomDialog = nullptr; - g_dialogAPI3 = nullptr; - g_isOpenController = false; - ArkUI_DialogState state = DIALOG_UNINITIALIZED; - int32_t result = - OH_ArkUI_CustomDialog_GetState(globalCustomDialog, &state); - ShowDialogState(state); - } - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - return nullptr; - } - return exports; -} -} // namespace ArkUICapiTest diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/customdialogexample.h b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/customdialogexample.h deleted file mode 100644 index 0e252a16de54e9ee82d5fd355f79f55fd0283570..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/customdialogexample.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef ARKUI_CAPI_CUSTOMDIALOG_EXAMPLE_H -#define ARKUI_CAPI_CUSTOMDIALOG_EXAMPLE_H - -#include "../common/common.h" -#include "utils.h" -#include -#include -#include - -struct CallBackData { - std::string willDismiss; - std::string willAppear; - std::string didAppear; - std::string willDisappear; - std::string didDisappear; -}; - -namespace ArkUICapiTest { -class CustomDialogTest { -public: - ~CustomDialogTest() = default; - - static napi_value SetCustomDialog(napi_env env, napi_callback_info info); - static int32_t SetCustomDialogDialogAttribute(int32_t nodeType = 0, uint32_t nodeValue = 0); - - static napi_value CloseDialog(napi_env env, napi_callback_info info); - static napi_value CloseCustomDialog(napi_env env, napi_callback_info info); - static napi_value OpenCustomDialog(napi_env env, napi_callback_info info); - static CallBackData callBackData; - - static napi_value SetDialogController(napi_env env, napi_callback_info info); - static napi_value OpenNativeDialog(napi_env env, napi_callback_info info); - static napi_value ResetDialogController(napi_env env, napi_callback_info info); - static int32_t SetDialogControllerAttribute(int32_t nodeType = 0, uint32_t nodeValue = 0); - static int32_t OnEventReceiveTestAPI(int32_t nodeType = 0, uint32_t nodeValue = 0); - - static napi_value NAPI_Global_setNapiCallback(napi_env env, napi_callback_info info); - static std::vector g_callback_refs; - static napi_env g_env; -}; -} // namespace ArkUICapiTest -#endif // ARKUI_CAPI_CUSTOMDIALOG_EXAMPLE_H diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/utils.h b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/utils.h deleted file mode 100644 index 42a749582e296af4b5ae71b1cb108b934d558df1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/utils.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef ARKUI_CAPI_UTILS_H -#define ARKUI_CAPI_UTILS_H - -#include "customdialogexample.h" -#include -#include -#include - -class CustomDialogUtils { -public: - ~CustomDialogUtils(); - static auto SetWidth(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle &nodeHandle, float width) - { - ArkUI_NumberValue width_value[] = {{.f32 = width}}; - ArkUI_AttributeItem width_item = {width_value, sizeof(width_value) / sizeof(ArkUI_NumberValue)}; - nodeAPI->setAttribute(nodeHandle, NODE_WIDTH, &width_item); - return nodeHandle; - } - static auto SetHeight(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle &nodeHandle, float height) - { - ArkUI_NumberValue height_value[] = {{.f32 = height}}; - ArkUI_AttributeItem height_item = {height_value, sizeof(height_value) / sizeof(ArkUI_NumberValue)}; - nodeAPI->setAttribute(nodeHandle, NODE_HEIGHT, &height_item); - return nodeHandle; - } - static auto SetBackgroundColor(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle nodeHandle, uint32_t color) - { - ArkUI_NumberValue color_value[] = {{.u32 = color}}; - ArkUI_AttributeItem color_item = {color_value, sizeof(color_value) / sizeof(ArkUI_NumberValue)}; - nodeAPI->setAttribute(nodeHandle, NODE_BACKGROUND_COLOR, &color_item); - return nodeHandle; - } - static auto SetMargin(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle &nodeHandle, float margin) - { - ArkUI_NumberValue margin_value[] = {{.f32 = margin}}; - ArkUI_AttributeItem margin_item = {margin_value, sizeof(margin_value) / sizeof(ArkUI_NumberValue)}; - nodeAPI->setAttribute(nodeHandle, NODE_MARGIN, &margin_item); - return nodeHandle; - } - static auto SetId(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle &nodeHandle, const char *id) - { - ArkUI_AttributeItem id_item = {}; - id_item.string = id; - nodeAPI->setAttribute(nodeHandle, NODE_ID, &id_item); - return nodeHandle; - } - static auto SetButton(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle &nodeHandle, - const char *id, const char *text) - { - nodeHandle = SetWidth(nodeAPI, nodeHandle, PARAM_150); - nodeHandle = SetHeight(nodeAPI, nodeHandle, PARAM_40); - ArkUI_AttributeItem label_item = {.string = text}; - nodeAPI->setAttribute(nodeHandle, NODE_BUTTON_LABEL, &label_item); - nodeHandle = SetBackgroundColor(nodeAPI, nodeHandle, 0xFF0000FF); - nodeHandle = SetId(nodeAPI, nodeHandle, id); - nodeHandle = SetMargin(nodeAPI, nodeHandle, PARAM_20); - return nodeHandle; - } - static auto SetDialog(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle &nodeHandle) - { - nodeHandle = SetWidth(nodeAPI, nodeHandle, PARAM_200); - nodeHandle = SetHeight(nodeAPI, nodeHandle, PARAM_300); - nodeHandle = SetBackgroundColor(nodeAPI, nodeHandle, COLOR_GRAY); - return nodeHandle; - } -}; - -#endif // ARKUI_CAPI_UTILS_H diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index ea4d343c9eb3f332fb1244c4cc648f4d7b759d42..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "common/common.h" -#include "customdialog/customdialogexample.h" -#include -#include "napi/native_api.h" - -namespace ArkUICapiTest { -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"setNapiCallback", nullptr, CustomDialogTest::NAPI_Global_setNapiCallback, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"setCustomDialog", nullptr, CustomDialogTest::SetCustomDialog, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"Close", nullptr, CustomDialogTest::CloseDialog, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"CloseCustomDialog", nullptr, CustomDialogTest::CloseCustomDialog, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"openCustomDialog", nullptr, CustomDialogTest::OpenCustomDialog, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"setNativeDialog", nullptr, CustomDialogTest::SetDialogController, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"openNativeDialog", nullptr, CustomDialogTest::OpenNativeDialog, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"resetDialogController", nullptr, CustomDialogTest::ResetDialogController, nullptr, nullptr, nullptr, - napi_default, nullptr}, - }; - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - return exports; -} -EXTERN_C_END - -static napi_module nativerenderModule = {.nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativerender", - .nm_priv = ((void *)0), - .reserved = {0}}; - -extern "C" __attribute__((constructor)) void RegisterModule(void) { napi_module_register(&nativerenderModule); } -} // namespace ArkUICapiTest diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/index.d.ts b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/index.d.ts deleted file mode 100644 index 0d9a8f7551fe9801f58a0a05fd199c8f6b6f6642..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - - - -export interface NapiCallback { - fromNapiCallWithStringParam(value: string):void; -} -export const setNapiCallback: (callback: NapiCallback) => void; -export const setCustomDialog: (nodeType: number, nodeValue: number) => number; -export const Close: () => void; -export const CloseCustomDialog: () => void; -export const openCustomDialog: () => void; -export const setNativeDialog: (nodeType: number, nodeValue: number) => number; -export const openNativeDialog: () => void; -export const resetDialogController: () => void; \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/oh-package.json5 b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/oh-package.json5 deleted file mode 100644 index 0d59d9e95a73f456cc4a3bb2e8f4518cacc60bd0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libnativerender.so", - "types": "./index.d.ts", - "version": "", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index a36ca588fe1aa322e8fca13744debe6f29d41d44..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -}; \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1504a74f09dfdcfae408be979f99369a2c5affab..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 82920e5f087dd0d778a11989f374da1e0a1c32ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi2 from 'libnativerender.so'; -import { common } from '@kit.AbilityKit'; - -@Entry -@Component -struct Index { - - build() { - Row() { - Column() { - Button($r('app.string.dialog_controller')) - .height(50) - .width('85%') - .margin({ top: 20, bottom: 10 }) - .onClick(() => { - this.getUIContext().getRouter().pushUrl({ - url: 'pages/IndexController', - }) - }) - Button($r('app.string.custom_dialog')) - .height(50) - .width('85%') - .margin({ top: 20, bottom: 10 }) - .onClick(() => { - this.getUIContext().getRouter().pushUrl({ - url: 'pages/IndexCustomDialog', - }) - }) - Text($r('app.string.exit_app')) - .fontSize(20) - .fontColor(0xCCCCCC) - .width('100%') - .margin({ left: 10 }) - Button($r('app.string.close_app')) - .fontSize(18) - .width(240) - .onClick(() => { - testNapi2.Close(); - let context = this.getUIContext().getHostContext() as common.UIAbilityContext - context.terminateSelf() - }) - .margin({ top: 20, bottom: 20 }) - } - .width('100%') - .height('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/IndexController.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/IndexController.ets deleted file mode 100644 index bc16ae5ca5174a568e51d6044fc927a219b8ec30..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/IndexController.ets +++ /dev/null @@ -1,586 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi2 from 'libnativerender.so'; - -enum ControllerAttributeType { - Native_Background_Color = 1, // 背景颜色 - Native_Corner_Radius, // 圆角半径 - Native_Border_Colors, // 边框颜色 - Native_Border_Style, // 边框样式 - Native_Backboard_Shadow, // 背板阴影 - Native_Backboard_CustomShadow, // 自定义背板阴影 - Native_Background_Blur_Style, // 背板模糊材质 - Native_Hover_Mode_Enabled, // 是否响应悬停态 - Native_Hover_Mode_Area, // 悬停态下弹窗默认展示区域 - Native_Focusable, // 是否获取焦点 - Native_Background_Blur_Style_Options, // 背景模糊效果 - Native_Background_Effect, // 弹窗的背景效果参数 - Native_Content_Alignment, // 设置自定义弹窗对齐方式。 - Native_Reset_Content_Alignment, // 重置setContentAlignment方法设置的属性,使用系统默认的对齐方式。 - Native_Modal_Mode, // 设置自定义弹窗是否开启模态样式的弹窗 - Native_Auto_Cancel, // 设置自定义弹窗是否允许通过点击遮罩层退出 - Native_Mask, // 设置自定义弹窗遮罩属性 - Native_Column_Count, // 设置弹窗宽度占栅格宽度的个数 - Native_Custom_Style, // 弹窗容器样式是否可以自定义 - Native_Custom_Animation, // 弹窗容器是否使用自定义弹窗动画 - Native_Keyboard_Avoid_Mode, // 设置自定义弹窗避让键盘模式 - Native_Level_Mode, // 设置弹窗的显示层级 - Native_Level_Unique_Id, // 设置弹窗显示层级页面下的节点id - Native_Immersive_Mode, // 设置嵌入式弹窗蒙层的显示区域 - Native_Level_Order, //设置自定义弹窗显示的顺序 - Native_Register_OnWill_Dismiss, // 当触发系统定义的返回操作、键盘ESC关闭交互操作时,如果注册了该回调函数,弹窗不会立即关闭,而是由用户决定是否关闭。 - Native_Register_OnWill_Dismiss_With_User_Data, // 注册系统关闭自定义弹窗的监听事件 -}; - -@Entry -@Component -struct Index { - @Provide nodeValue: number = -1; - @Provide nodeType: number = -1; - @Provide totalInfo: string = ''; - @State isCreateKey: boolean = false; // 是否创建键盘 - @State stateInfos: string = ''; - @State printDefaultText: boolean = false; // 是否打印默认文本 - @Provide place: string = ''; - - @Builder - SubMenuAttributeType() { - Menu() { - // 设置弹窗背景色 - MenuItem({ content: '背景颜色:白色' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Background_Color; - this.nodeValue = 0xFFFFFFFF; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set the background color to white\n'; - }else{ - this.totalInfo += 'Failed to set background color\n'; - } - }) - MenuItem({ content: '圆角半径: 15' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Corner_Radius; - this.nodeValue = 15; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set the corner radius: 15\n'; - }else{ - this.totalInfo += 'Failed to set border radius\n'; - } - }) - // 设置自定义弹窗对齐方式 - MenuItem({ content: '设置弹窗对齐方式' }).width('50%').onChange(() => { - this.nodeValue = 0; - this.nodeType = ControllerAttributeType.Native_Content_Alignment; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Top center\n'; - } else { - this.totalInfo += 'Failed to set contentAlignment\n'; - } - }) - // 重置setContentAlignment方法设置的属性,使用系统默认的对齐方式。 - MenuItem({ content: '使用系统默认的对齐方式' }).width('50%').onChange(() => { - this.nodeValue = 1; - this.nodeType = ControllerAttributeType.Native_Reset_Content_Alignment; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'ARKUI_ALIGNMENT_CENTER\n'; - } else { - this.totalInfo += 'Failed to reset content alignment\n'; - } - }) - // 设置自定义弹窗是否开启模态样式的弹窗 - MenuItem({ content: '是否开启模态样式的弹窗', builder: (): void => this.SubMenu_Modal_Mode() }).width('50%') - // 设置自定义弹窗是否允许通过点击遮罩层退出 - MenuItem({ content: '是否允许通过点击遮罩层退出', builder: (): void => this.SubMenu_Auto_Cancel() }).width('50%') - // 设置自定义弹窗遮罩属性 - MenuItem({ content: '设置自定义弹窗遮罩属性' }).width('50%').onChange(() => { - this.nodeValue = 1; - this.nodeType = ControllerAttributeType.Native_Mask; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set the overlay color to red\n'; - } else { - this.totalInfo += 'Failed to set mask\n'; - } - }) - // 设置弹窗宽度占栅格宽度的个数 - MenuItem({ content: '设置弹窗宽度占栅格宽度的个数' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Column_Count; - this.nodeValue = 20; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set the number of grid widths that the popup occupies to 20\n'; - } else { - this.totalInfo += 'Failed to set grid column count\n'; - } - }) - // 弹窗容器样式是否可以自定义 - MenuItem({ content: '弹窗容器样式是否可以自定义', builder: (): void => this.SubMenu_Custom_Style() }).width('50%') - - // 弹窗容器是否使用自定义弹窗动画 - MenuItem({ content: '弹窗容器使用自定义弹窗动画' }).width('50%').onChange(() => { - this.nodeValue = 1; - this.nodeType = ControllerAttributeType.Native_Custom_Animation; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Not actually displayed\n'; - } else { - this.totalInfo += 'Failed to enable custom animation\n'; - } - }) - - // 当触发系统定义的返回操作、键盘ESC关闭交互操作时,如果注册了该回调函数,弹窗不会立即关闭,而是由用户决定是否关闭。 - MenuItem({ content: '系统返回操作关闭弹窗' }).width('50%').onChange(() => { - this.nodeValue = 1; - this.nodeType = ControllerAttributeType.Native_Register_OnWill_Dismiss; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'The system-defined back operation closes the dialog\n'; - } else { - this.totalInfo += 'Failed to registerOnWillDismiss\n'; - } - }) - // 注册系统关闭自定义弹窗的监听事件 - MenuItem({ content: '注册系统关闭自定义弹窗的监听事件' }).width('50%').onChange(() => { - this.nodeValue = 1; - this.nodeType = ControllerAttributeType.Native_Register_OnWill_Dismiss_With_User_Data; - this.totalInfo += 'true\n'; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'The system-defined back operation does not close the dialog\n'; - } else { - this.totalInfo += 'Failed to registerOnWillDismiss\n'; - } - }) - // 设置弹窗的显示层级。 - MenuItem({ content: '设置弹窗的显示层级', builder: (): void => this.SubMenu_Native_Level_Mode() }).width('50%') - // 设置弹窗显示层级页面下的节点id - MenuItem({ content: '设置弹窗显示层级页面下的节点id' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Level_Unique_Id; - this.nodeValue = 0; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Sets the level uniqueId to 0 for a custom dialog box\n'; - } else { - this.totalInfo += 'Failed to set level unique id\n'; - } - }) - // 设置嵌入式弹窗蒙层的显示区域 - MenuItem({ content: '设置嵌入式弹窗蒙层的显示区域' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Immersive_Mode - this.nodeValue = 0; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'ARKUI_IMMERSIVE_MODE_DEFAULT\n'; - } else { - this.totalInfo += 'Failed to set immersive mode\n'; - } - }) - //设置自定义弹窗显示的顺序 - MenuItem({ content: '设置自定义弹窗显示的顺序' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Level_Order; - this.nodeValue = 0; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set the display order of the custom dialog box to 0\n'; - } else { - this.totalInfo += 'Failed to set level order\n'; - } - }) - // 设置自定义弹窗的边框颜色 - MenuItem({ content: '边框颜色:黄色' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Border_Colors; - this.nodeValue = 0xFFFFFF00; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set border color to yellow\n'; - }else{ - this.totalInfo += 'Failed to set border color\n'; - } - }) - // 设置自定义弹窗的边框样式 - MenuItem({ content: '边框样式:点状' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Border_Style; - this.nodeValue = 2; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set border style to dotted\n'; - }else{ - this.totalInfo += 'Failed to set border style\n'; - } - }) - // 设置自定义弹窗的背板阴影 - MenuItem({ content: '背板阴影' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Backboard_Shadow; - this.nodeValue = 0; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG\n'; - }else{ - this.totalInfo += 'Failed to set shadow\n'; - } - }) - // 设置自定义弹窗的背板阴影 - MenuItem({ content: '自定义背板阴影' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Backboard_CustomShadow; - this.nodeValue = 0; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set custom backboard shadow\n'; - }else{ - this.totalInfo += 'Failed to set custom backboard shadow\n'; - } - }) - // 设置自定义弹窗的背板模糊材质 - MenuItem({ content: '背板模糊材质' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Background_Blur_Style; - this.nodeValue = 0; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK\n'; - }else{ - this.totalInfo += 'Failed to set background blur style\n'; - } - }) - // 设置自定义弹窗避让键盘模式 - MenuItem({ content: '弹窗避让键盘模式' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Keyboard_Avoid_Mode; - this.nodeValue = 1; - this.isCreateKey = true; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Do not avoid keyboard mode\n'; - } else { - this.totalInfo += 'Failed to set avoid keyboard mode\n'; - } - }) - // 设置自定义弹窗是否响应悬停态 - MenuItem({ content: '响应悬停' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Hover_Mode_Enabled; - this.nodeValue = 1; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Effective only on foldable screens\n'; - } else { - this.totalInfo += 'Failed to SetHoverModeEnabled\n'; - } - }) - // 设置悬停态下自定义弹窗默认展示区域 - MenuItem({ content: '悬停态下弹窗默认展示区域', builder: (): void => this.SubMenu_Hover_Mode_Area() }).width('50%') - // 设置自定义弹窗是否获取焦点 - MenuItem({ content: '是否获取焦点', builder: (): void => this.SubMenu_Focusable() }).width('50%') - // 设置自定义弹窗的背景模糊效果 - MenuItem({ content: '设置弹窗的背景模糊效果' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Background_Blur_Style_Options; - this.nodeValue = 1; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set background blur effect for the dialog\n'; - } else { - this.totalInfo += 'Failed to background blur effect\n'; - } - }) - // 设置自定义弹窗的背景效果参数 - MenuItem({ content: '设置弹窗的背景效果参数' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Background_Effect; - this.nodeValue = 1; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set background effect for the dialog\n'; - } else { - this.totalInfo += 'Failed to background effect\n'; - } - }) - } - } - - @Builder - SubMenu_Hover_Mode_Area() { - Menu() { - MenuItem({ content: '上半屏' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Hover_Mode_Area; - this.nodeValue = 0; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Popup defaults to upper screen area in hover state\n'; - } else { - this.totalInfo += 'Failed to set hover mode\n'; - } - }) - } - Menu() { - MenuItem({ content: '下半屏' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Hover_Mode_Area; - this.nodeValue = 1; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Popup defaults to lower screen area in hover state\n'; - } else { - this.totalInfo += 'Failed to set hover mode\n'; - } - }) - } - } - - @Builder - SubMenu_Focusable() { - Menu() { - MenuItem({ content: '是' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Focusable; - this.nodeValue = 1; - this.isCreateKey = true; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Focus acquisition succeeded\n'; - } else { - this.totalInfo += 'Failed to set focusable\n'; - } - }) - } - Menu() { - MenuItem({ content: '否' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Focusable; - this.nodeValue = 0; - this.isCreateKey = true; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Disable focus acquisition\n'; - } else { - this.totalInfo += 'Failed to set focusable\n'; - } - }) - } - } - - @Builder - SubMenu_Modal_Mode() { - Menu() { - MenuItem({ content: '是' }).width('50%').onChange(() => { - this.nodeValue = 1; - this.nodeType = ControllerAttributeType.Native_Modal_Mode; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set the dialog to modal mode\n'; - } else { - this.totalInfo += 'Failed to set the dialog to modal mode\n'; - } - }) - } - Menu() { - MenuItem({ content: '否' }).width('50%').onChange(() => { - this.nodeValue = 0; - this.nodeType = ControllerAttributeType.Native_Modal_Mode; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set the dialog to non-modal mode\n'; - } else { - this.totalInfo += 'Failed to set the dialog to non-modal mode failed\n'; - } - }) - } - } - - @Builder - SubMenu_Auto_Cancel() { - Menu() { - MenuItem({ content: '是' }).width('50%').onChange(() => { - this.nodeValue = 1; - this.nodeType = ControllerAttributeType.Native_Auto_Cancel; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Enable closing the modal via overlay click\n'; - } else { - this.totalInfo += 'Failed to set auto cancel\n'; - } - }) - } - Menu() { - MenuItem({ content: '否' }).width('50%').onChange(() => { - this.nodeValue = 0; - this.nodeType = ControllerAttributeType.Native_Auto_Cancel; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Disable closing the modal via overlay click\n'; - } else { - this.totalInfo += 'Failed to set auto cancel\n'; - } - }) - } - } - - @Builder - SubMenu_Custom_Style() { - Menu() { - MenuItem({ content: '是' }).width('50%').onChange(() => { - this.nodeValue = 1; - this.nodeType = ControllerAttributeType.Native_Custom_Style; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Customize the pop-up container style to have no border\n'; - } else { - this.totalInfo += 'Failed to set custom style\n'; - } - }) - } - Menu() { - MenuItem({ content: '否' }).width('50%').onChange(() => { - this.nodeValue = 0; - this.nodeType = ControllerAttributeType.Native_Custom_Style; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Customize the pop-up container style to have border\n'; - } else { - this.totalInfo += 'Failed to set custom style\n'; - } - }) - } - } - - @Builder - SubMenu_Native_Level_Mode() { - Menu() { - MenuItem({ content: 'ARKUI_LEVEL_MODE_OVERLAY' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Level_Mode; - this.nodeValue = 0; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'ARKUI_LEVEL_MODE_OVERLAY\n'; - } else { - this.totalInfo += 'Failed to set level mode\n'; - } - }) - MenuItem({ content: 'ARKUI_LEVEL_MODE_EMBEDDED' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Level_Mode - this.nodeValue = 1; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'ARKUI_LEVEL_MODE_EMBEDDED\n'; - } else { - this.totalInfo += 'Failed to set level mode\n'; - } - }) - } - } - - onPageShow(): void { - testNapi2.setNapiCallback({ - fromNapiCallWithStringParam: (value: string): void => { - this.stateInfos = value; - } - }); - } - - build() { - Column() { - Text($r('app.string.dialog_controller')) - .fontColor(0x0000FF) - .height('10%') - .fontSize(15) - .margin(10) - .fontWeight(FontWeight.Bold) - Column({ space: 10 }) { - Text($r('app.string.configure_popup_properties')) - .fontSize(20) - .fontColor(0xCCCCCC) - .width('100%') - .margin({ left: 10 }) - Row() { - Button($r('app.string.set_properties')) - .width('30%') - .margin(10) - .bindMenu(this.SubMenuAttributeType) - .onClick(() => { - if (!this.printDefaultText) { - this.totalInfo += 'Default dialog dimensions and border specifications:\n'; - this.totalInfo += 'width: 300vp\n'; - this.totalInfo += 'height: 200vp\n'; - this.totalInfo += 'borderWidth: 2vp\n'; - this.printDefaultText = true; - } - }) - Button($r('app.string.reset_properties')) - .width('30%') - .margin(10) - .onClick(() => { - testNapi2.resetDialogController(); - this.totalInfo = ' '; - this.isCreateKey = false; - this.printDefaultText = false; - }) - .margin({ left: 70 }) - } - TextInput({ placeholder: $r('app.string.please_input_attribute_value') }) - .placeholderColor(Color.Red) - .width('100%') - .height(40) - .margin(10) - .type(InputType.Password) - .maxLength(15) - .showPasswordIcon(true) - .visibility(this.isCreateKey?Visibility.Visible:Visibility.Hidden) - Text($r('app.string.dialog_state')) - .fontSize(15) - .fontColor(0xCCCCCC) - .width('100%') - .height(5) - .margin({ left: 10 }) - Text(this.place + this.stateInfos) - .fontSize(15) - .height(10) - .fontColor(0xCCCCCC) - .width('100%') - .margin({ left: 10 }) - Text($r('app.string.settings_result')) - .fontSize(15) - .fontColor(0xCCCCCC) - .height(5) - .width('100%') - .margin({ left: 10 }) - Text(this.place+ this.totalInfo) - .fontSize(15) - .fontColor(0xCCCCCC) - .height(5) - .width('100%') - .margin({ left: 10 }) - Button($r('app.string.open_dialog')) - .width('40%') - .height('10%') - .margin(150) - .onClick(() => { - testNapi2.openNativeDialog(); - if (!this.printDefaultText) { - this.totalInfo += 'Default dialog dimensions and border specifications:\n'; - this.totalInfo += 'width: 300vp\n'; - this.totalInfo += 'height: 200vp\n'; - this.totalInfo += 'borderWidth: 2vp\n'; - this.printDefaultText = true; - } - }) - Button($r('app.string.return_dialog')) - .width('40%') - .height('8%') - .margin({top: -130}) - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - } - .height('100%') - .width('100%') - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/IndexCustomDialog.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/IndexCustomDialog.ets deleted file mode 100644 index 80557d1061a039ac2db878aae7c4a9c1e73cf824..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/IndexCustomDialog.ets +++ /dev/null @@ -1,517 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi2 from 'libnativerender.so'; - -enum CustomDialogAttributeType { - Background_Color = 1, // 背景颜色 - Corner_Radius, // 圆角半径 - Border_Colors, // 边框颜色 - Border_Style, // 边框样式 - Backboard_shadow, // 背板阴影 - Backboard_CustomShadow, // 自定义背板阴影 - Background_Blur_Style, // 背板模糊材质 - Align_mode, // 对齐模式 - Modal_Mode, // 模态样式 - Auto_Cancel, // 遮罩层退出 - Subwindow_Mode, // 弹窗是否在子窗口显示此弹窗 - Mask, // 自定义弹窗遮罩属性 - Keyboard_Avoid_Mode, // 弹窗的键盘避让模式 - Hover_Mode_Enabled, // 是否响应悬停态 - Hover_Mode_Area, // 悬停态下弹窗默认展示区域 - Background_Blur_Style_Options, // 背景模糊效果 - Background_Effect, // 弹窗的背景效果参数 - Level_Mode, // 设置弹窗的显示层级 - Level_Unique_Id, // 设置弹窗显示层级页面下的节点id - Immersive_Mode, // 设置嵌入式弹窗蒙层的显示区域 - Should_Block_Dismiss, // 设置需要屏蔽系统关闭弹窗行为 -}; - -@Entry -@Component -struct Index { - @Provide nodeValue: number = -1; - @Provide nodeType: number = -1; - @Provide totalInfo: string = ''; - @State isCreateKey: boolean = false; // 是否创建键盘 - @State stateInfos: string = ''; - @State printDefaultText: boolean = false; // 是否打印默认文本 - @Provide place: string = ''; - @Builder - SubMenuAttributeType() { - Menu() { - MenuItem({ content: '背景颜色:红色' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Background_Color; - this.nodeValue = 0xFFFF0000; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set the background color to red\n'; - }else{ - this.totalInfo += 'Failed to set background color\n'; - } - }) - MenuItem({ content: '圆角半径: 15' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Corner_Radius; - this.nodeValue = 15; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set the corner radius: 15\n'; - }else{ - this.totalInfo += 'Failed to set border radius\n'; - } - }) - MenuItem({ content: '边框颜色:黄色' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Border_Colors; - this.nodeValue = 0xFFFFFF00; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set border color to yellow\n'; - }else{ - this.totalInfo += 'Failed to set border color\n'; - } - }) - MenuItem({ content: '边框样式:点状' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Border_Style; - this.nodeValue = 2; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set border style to dotted\n'; - }else{ - this.totalInfo += 'Failed to set border style\n'; - } - }) - MenuItem({ content: '背板阴影' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Backboard_shadow; - this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG\n'; - }else{ - this.totalInfo += 'Failed to set shadow\n'; - } - }) - // 设置自定义弹窗的背板阴影 - MenuItem({ content: '自定义背板阴影' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Backboard_CustomShadow - this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set custom backboard shadow\n'; - }else{ - this.totalInfo += 'Failed to set custom backboard shadow\n'; - } - }) - MenuItem({ content: '轻薄材质模糊' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Background_Blur_Style; - this.nodeValue = 4; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'ARKUI_BLUR_STYLE_BACKGROUND_REGULAR\n'; - }else{ - this.totalInfo += 'Failed to set background blur style\n'; - } - }) - MenuItem({ content: '对齐模式:底部开始'}).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Align_mode; - this.nodeValue = 3; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Align content from the bottom\n'; - } else { - this.totalInfo += 'Failed to set alignment\n'; - } - }) - MenuItem({ content: '是否开启模态样式', builder: ():void=>this.SubMenu_Modal_Mode() }).width('50%') - MenuItem({ content: '遮罩层退出', builder: ():void=>this.SubMenu_Auto_Cancel() }).width('50%') - MenuItem({ content: '弹窗是否在子窗口显示此弹窗', builder: ():void=>this.SubMenu_Subwindow_Mode() }).width('50%') - MenuItem({ content: '自定义弹窗遮罩属性' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Mask; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set mask property to red\n'; - }else{ - this.totalInfo += 'Failed to set mask property\n'; - } - }) - MenuItem({ content: '避让键盘的模式', builder: ():void=>this.SubMenu_Keyboard_Avoid_Mode() }).width('50%') - MenuItem({ content: '响应悬停' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Hover_Mode_Enabled; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Effective only on foldable screens\n'; - } else { - this.totalInfo += 'Failed to SetHoverModeEnabled\n'; - } - }) - MenuItem({ content: '悬停态下弹窗默认展示区域', builder: ():void=>this.SubMenu_Hover_Mode_Area() }).width('50%') - MenuItem({ content: '背景模糊效果' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Background_Blur_Style_Options; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set background blur effect for the dialog\n'; - } else { - this.totalInfo += 'Failed to background blur effect\n'; - } - }) - MenuItem({ content: '背景效果参数' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Background_Effect; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set background effect for the dialog\n'; - } else { - this.totalInfo += 'Failed to background effect\n'; - } - }) - MenuItem({ content: '设置弹窗的显示层级', builder: ():void=>this.SubMenu_Level_Mode() }).width('50%') - MenuItem({ content: '设置弹窗显示层级页面下的节点id:0' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Level_Unique_Id; - this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set the level unique id to 0\n'; - }else{ - this.totalInfo += 'Failed to set level unique id\n'; - } - }) - MenuItem({ content: '设置嵌入式弹窗蒙层的显示区域', builder: ():void=>this.SubMenu_Immersive_Mode() }).width('50%') - MenuItem({ content: '注册系统关闭自定义弹窗的监听事件', builder: ():void=>this.SubMenu_Register_OnWill_Dismiss_Callback() }).width('50%') - } - } - - @Builder - SubMenu_Modal_Mode() { - Menu() { - MenuItem({ content: '开启' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Modal_Mode; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set the dialog to modal mode\n'; - }else{ - this.totalInfo += 'Failed to set the dialog to modal mode\n'; - } - }) - MenuItem({ content: '关闭' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Modal_Mode; - this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set the dialog to non-modal mode\n'; - }else{ - this.totalInfo += 'Failed to set the dialog to non-modal mode failed\n'; - } - }) - } - } - - @Builder - SubMenu_Auto_Cancel() { - Menu() { - MenuItem({ content: '开启' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Auto_Cancel; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Configure the dialog to dismiss on mask layer click\n'; - }else{ - this.totalInfo += 'Failed to configure the dialog to dismiss on mask layer click\n'; - } - }) - MenuItem({ content: '关闭' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Auto_Cancel; - this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Configure the dialog to dismiss on mask layer click\n'; - }else{ - this.totalInfo += 'Failed to configure the dialog to dismiss on mask layer click\n'; - } - }) - } - } - - @Builder - SubMenu_Subwindow_Mode() { - Menu() { - MenuItem({ content: '开启' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Subwindow_Mode; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Set the pop-up window to display this pop-up window in a child window\n'; - }else{ - this.totalInfo += 'Failed to set subwindow mode\n'; - } - }) - MenuItem({ content: '关闭' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Subwindow_Mode; - this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Do not set up a pop-up window to display this pop-up window in a child window\n'; - }else{ - this.totalInfo += 'Failed to set subwindow mode\n'; - } - }) - } - } - - @Builder - SubMenu_Keyboard_Avoid_Mode() { - Menu() { - MenuItem({ content: '避让' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Keyboard_Avoid_Mode; - this.nodeValue = 0; - this.isCreateKey = true; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Avoid keyboard mode\n'; - } else { - this.totalInfo += 'Failed to set avoid keyboard mode\n'; - } - }) - MenuItem({ content: '不避让' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Keyboard_Avoid_Mode; - this.nodeValue = 1; - this.isCreateKey = true; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Do not avoid keyboard mode\n'; - } else { - this.totalInfo += 'Failed to set avoid keyboard mode\n'; - } - }) - } - } - - @Builder - SubMenu_Hover_Mode_Area() { - Menu() { - MenuItem({ content: '上半屏' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Hover_Mode_Area; - this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Popup defaults to upper screen area in hover state\n'; - } else { - this.totalInfo += 'Failed to set hover mode\n'; - } - }) - } - Menu() { - MenuItem({ content: '下半屏' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Hover_Mode_Area; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Popup defaults to lower screen area in hover state\n'; - } else { - this.totalInfo += 'Failed to set hover mode\n'; - } - }) - } - } - - @Builder - SubMenu_Level_Mode() { - Menu() { - MenuItem({ content: 'ARKUI_LEVEL_MODE_OVERLAY' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Level_Mode; - this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'ARKUI_LEVEL_MODE_OVERLAY\n'; - }else{ - this.totalInfo += 'Failed to set level mode\n'; - } - }) - MenuItem({ content: 'ARKUI_LEVEL_MODE_EMBEDDED' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Level_Mode; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'ARKUI_LEVEL_MODE_EMBEDDED\n'; - }else{ - this.totalInfo += 'Failed to set level mode\n'; - } - }) - } - } - - @Builder - SubMenu_Immersive_Mode() { - Menu() { - MenuItem({ content: 'ARKUI_IMMERSIVE_MODE_DEFAULT' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Immersive_Mode; - this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'ARKUI_IMMERSIVE_MODE_DEFAULT\n'; - }else{ - this.totalInfo += 'Failed to set immersive mode\n'; - } - }) - MenuItem({ content: 'ARKUI_IMMERSIVE_MODE_EXTEND' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Immersive_Mode; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'ARKUI_IMMERSIVE_MODE_EXTEND\n'; - }else{ - this.totalInfo += 'Failed to set immersive mode\n'; - } - }) - } - } - - @Builder - SubMenu_Register_OnWill_Dismiss_Callback() { - Menu() { - MenuItem({ content: '是' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Should_Block_Dismiss; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Registered already\n'; - }else{ - this.totalInfo += 'Failed to register OnWillDismissCallback\n'; - } - }) - MenuItem({ content: '否' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Should_Block_Dismiss; - this.nodeValue = 0 - testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'Not registered\n' - }else{ - this.totalInfo += 'Failed to register OnWillDismissCallback\n'; - } - }) - } - } - - onPageShow(): void { - testNapi2.setNapiCallback({ - fromNapiCallWithStringParam: (value: string): void => { - this.stateInfos = value; - } - }); - } - - build() { - Column() { - Text($r('app.string.open_custom_dialog')) - .fontColor(0x0000FF) - .height('10%') - .fontSize(15) - .margin(10) - .fontWeight(FontWeight.Bold) - Column({ space: 10 }) { - Text($r('app.string.configure_popup_properties')) - .fontSize(20) - .fontColor(0xCCCCCC) - .width('100%') - .margin({ left: 10 }) - Row() { - Button($r('app.string.set_properties')) - .width('30%') - .margin(10) - .bindMenu(this.SubMenuAttributeType) - .onClick(() => { - if(!this.printDefaultText){ - this.totalInfo +='Default dialog dimensions and border specifications:\n'; - this.totalInfo +='width: 300vp\n'; - this.totalInfo +='height: 200vp\n'; - this.totalInfo +='borderWidth: 2vp\n'; - this.printDefaultText = true; - } - }) - Button($r('app.string.reset_properties')) - .width('30%') - .margin(10) - .onClick(() => { - testNapi2.CloseCustomDialog(); - this.totalInfo =' '; - this.isCreateKey = false; - this.printDefaultText = false; - }) - .margin({ left: 70 }) - } - TextInput({ placeholder: $r('app.string.please_input_attribute_value') }) - .placeholderColor(Color.Red) - .width('100%') - .height(40) - .margin(10) - .type(InputType.Password) - .maxLength(15) - .showPasswordIcon(true) - .visibility(this.isCreateKey?Visibility.Visible:Visibility.Hidden) - Text($r('app.string.dialog_state')) - .fontSize(15) - .fontColor(0xCCCCCC) - .width('100%') - .height(5) - .margin({ left: 10 }) - Text(this.place + this.stateInfos) - .fontSize(15) - .height(10) - .fontColor(0xCCCCCC) - .width('100%') - .margin({ left: 10 }) - Text($r('app.string.settings_result')) - .fontSize(15) - .fontColor(0xCCCCCC) - .height(5) - .width('100%') - .margin({ left: 10 }) - Text(this.place+ this.totalInfo) - .fontSize(15) - .fontColor(0xCCCCCC) - .height(5) - .width('100%') - .margin({ left: 10 }) - Button($r('app.string.open_dialog')) - .width('40%') - .height('10%') - .margin(150) - .onClick(() => { - testNapi2.openCustomDialog(); - if(!this.printDefaultText){ - this.totalInfo +='Default dialog dimensions and border specifications:\n'; - this.totalInfo +='width: 300vp\n'; - this.totalInfo +='height: 200vp\n'; - this.totalInfo +='borderWidth: 2vp\n'; - this.printDefaultText = true; - } - }) - Button($r('app.string.return_dialog')) - .width('40%') - .height('8%') - .margin({top: -130}) - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - } - .height('100%') - .width('100%') - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 b/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 deleted file mode 100644 index 776ce01475229d674487a2830790c4c87b777379..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/color.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/string.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 1955517ec7aaed7a8de03ff426d1d4eaa53e9533..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "dialog_controller", - "value": "CustomDialogController_CAPI对接示例" - }, - { - "name": "custom_dialog", - "value": "OpenCustomDialog_CAPI对接示例" - }, - { - "name": "exit_app", - "value": "退出应用" - }, - { - "name": "close_app", - "value": "关闭应用" - }, - { - "name": "configure_popup_properties", - "value": "配置弹窗属性" - }, - { - "name": "set_properties", - "value": "设置属性" - }, - { - "name": "reset_properties", - "value": "重置属性" - }, - { - "name": "please_input_attribute_value", - "value": "Close modal → Set keyboard avoidance" - }, - { - "name": "dialog_state", - "value": "弹框状态: " - }, - { - "name": "settings_result", - "value": "属性设置结果: " - }, - { - "name": "open_dialog", - "value": "点此打开弹窗" - }, - { - "name": "open_custom_dialog", - "value": "OpenCustomDialog_CAPI对接示例" - }, - { - "name": "return_dialog", - "value": "返回" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/background.png b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 7ddccbf36dcf3c44b83952bbb33634d4c4ef699b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/IndexCustomDialog", - "pages/IndexController" - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/dark/element/color.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/mock/Libentry.mock.ets b/ArkUIKit/NativeDialogSample/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 8869de34c79e795987fb4fad27b2992194b761a3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/mock/mock-config.json5 b/ArkUIKit/NativeDialogSample/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/ohosTest/module.json5 b/ArkUIKit/NativeDialogSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 9983b2ba4e55e31a172f0328c82c9a75bfa00ded..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NativeDialogSample/entry/src/test/List.test.ets b/ArkUIKit/NativeDialogSample/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NativeDialogSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/hvigor/hvigor-config.json5 b/ArkUIKit/NativeDialogSample/hvigor/hvigor-config.json5 deleted file mode 100644 index cef74543b1f97c82275e4bf3434b162395bff2eb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/ArkUIKit/NativeDialogSample/hvigorfile.ts b/ArkUIKit/NativeDialogSample/hvigorfile.ts deleted file mode 100644 index f3cb9f1a87a81687554a76283af8df27d8bda775..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/ArkUIKit/NativeDialogSample/oh-package.json5 b/ArkUIKit/NativeDialogSample/oh-package.json5 deleted file mode 100644 index eaef52736f22c14e04fca386ba01611ab32a7e4a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/NativeDialogSample/ohosTest.md b/ArkUIKit/NativeDialogSample/ohosTest.md deleted file mode 100644 index bf197ddd4e1bfaeee60c49251773698f332c8232..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDialogSample/ohosTest.md +++ /dev/null @@ -1,69 +0,0 @@ -# NativeDialogSample 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|------------------------------------------| -------------- |-------------------------------|-------------------------------------------------------| :------- | -------- | -| 显示弹框成功示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果 | 显示弹框成功 | 是 | Pass | -| 应用退出示例验证 | 应用位于首页 | 1.点击 退出应用 查看验证结果 | 应用退出成功 | 是 | Pass | -| 显示弹框成功示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果 | 显示弹框成功 | 是 | Pass | -| 弹窗关闭示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮
3.点击 点此打开弹窗按钮 查看验证结果 | 弹窗关闭成功 | 是 | Pass | -| 系统默认的对齐方式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置自定义弹窗对齐方式
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹窗位置在顶部成功 | 是 | Pass | -| 是否开启模态样式实例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击设置属性按钮
3.点击 是否开启模态样式的弹窗。
4.点击 点此打开弹窗按钮 查看验证结果
5点击弹框中Close Dialog 按钮
6点击重置属性按钮 | 选择 是 弹框周边为灰色
选择 否 弹窗周边无灰色 | 是 | Pass | -| 是否允许通过点击遮罩层退出示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否允许通过点击遮罩层退出。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 选择 是 点击弹框外弹窗可以退出
选择 否 点击弹框外弹窗不可以退出 | 是 | Pass | -| 设置自定义弹窗遮罩属性示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击设置属性按钮
3.点击 设置自定义弹窗遮罩属性。
4点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮 查看验证结果
6.点击 重置属性按钮 | 弹窗周边为红色 | 是 | Pass | -| 背景颜色示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击设置属性
3.点击 背景颜色:白色。
4.点击点此打开弹窗按钮 查看验证结果
5.点击弹框中Close Dialog 按钮
6.点击重置属性 | 弹窗中为白色 | 是 | Pass | -| 设置弹窗背板圆角半径示例验证 | 应用位于首页 | 2.点击 .CustomDialogController_CAPI对接示例按钮
3.点击 设置属性按钮
4.点击 设置弹窗背板圆角半径。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击重置属性按钮 | 弹窗中的圆角比不设置任何属性点击打开弹窗是四边圆角值小 | 是 | Pass | -| 设置弹窗宽度占栅格宽度的个数示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置弹窗宽度占栅格宽度的个数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the number of grid widths that the popup occupies to 20 | 是 | Pass | -| 弹窗容器样式是否可以自定义示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗容器样式是否可以自定义。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 选择 是 点击弹框无边框
选择 否 点击弹框有边框 | 是 | Pass | -| 弹窗容器是否使用自定义弹窗动画示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗容器是否使用自定义弹窗动画。
4.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 属性设置结果显示
Not actually displayed | 是 | Pass | -| 系统返回操作关闭弹窗示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 系统返回操作关闭弹窗。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
The system-defined back operation closes the dialog | 是 | Pass | -| 显示弹框示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 显示弹框成功 | 是 | Pass | -| 弹框关闭示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮
3.点击 弹框中Close Dialog 按钮 查看验证结果
4.点击 重置属性 按钮 | 显示弹框关闭成功 | 是 | Pass | -| 弹窗避让键盘模式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式的弹窗 选择 否
4.点击 弹窗避让键盘模式
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 输出框最右边 显示出键盘
7.点击 弹框中Close Dialog 按钮
8.点击 重置属性按钮 | 键盘覆盖了弹窗 | 是 | Pass | -| 设置弹窗的显示层级示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 选择 ARKUI_LEVEL_MODE_OVERLAY 。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示ARKUI_LEVEL_MODE_OVERLAY | 是 | Pass | -| 设置弹窗的显示层级示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 选择 ARKUI_LEVEL_MODE_EMBEDDED。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示ARKUI_LEVEL_MODE_EMBEDDED | 是 | Pass | -| 设置弹窗显示层级页面下的节点id示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击设置弹窗显示层级页面下的节点id。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the level uniqueId to 0 for a custom dialog box | 是 | Pass | -| 设置嵌入式弹窗蒙层的显示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置嵌入式弹窗蒙层的显示区域。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
ARKUI_IMMERSIVE_MODE_DEFAULT | 是 | Pass | -| 设置自定义弹窗显示的顺序示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置自定义弹窗显示的顺序。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the display order of the custom dialog box to 0 | 是 | Pass | -| 弹框状态变化示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框状态显示
DIALOG_UNINITIALIZED
DIALOG_INITIALIZED
DIALOG_APPEARING
DIALOG_DISAPPEARED | 是 | Pass | -| 边框颜色示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框颜色:黄色。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框颜色为黄色 | 是 | Pass | -| 边框样式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框样式:点状。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框样式为点状 | 是 | Pass | -| 默认边宽示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果
3.点击 重置属性按钮 | 显示弹窗有边宽
属性设置结果中 显示 width: 300vp | 是 | Pass | -| 默认边高示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果
3.点击 重置属性按钮 | 显示弹窗有边宽
属性设置结果中 显示 height: 200vp | 是 | Pass | -| 背板阴影示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板阴影。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框周围有阴影 | 是 | Pass | -| 自定义弹窗的背板阴影示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义弹窗的背板阴影。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内为红色 边框周围有阴影 | 是 | Pass | -| 背板模糊材质示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板模糊材质。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内为灰色 | 是 | Pass | -| 响应悬停示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 响应悬停。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框响应在下半屏 | 是 | Pass | -| 悬停态下自定义弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 悬停态下自定义弹窗默认展示区域 选择 上半屏 或 下半屏。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
上半屏:Popup defaults to upper screen area in hover state 下半屏:Popup defaults to lower screen area in hover state | 是 | Pass | -| 是否获取焦点示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式弹窗 选择否
4.点击 是否获取焦点 选择 是。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 点击输入框 打开键盘 点击弹框内区域 键盘自动回收 | 是 | Pass | -| 是否获取焦点示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式弹窗 选择否
4.点击 是否获取焦点 选择 否。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 点击输入框 打开键盘 点击弹框内区域 键盘不回收 | 是 | Pass | -| 设置弹窗的背景模糊效果示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的背景模糊效果。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 设置自定义弹窗的背景效果参数 | 是 | Pass | -| 设置自定义弹窗的背景效果参数示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置自定义弹窗的背景效果参数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内部颜色有变化 | 是 | Pass | -| 返回按钮 示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 返回按钮 | 返回上一层 | 是 | Pass | -| 弹框创建/打开/关闭示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框创建、打开、关闭成功 | 是 | Pass | -| 应用退出示例验证 | 应用位于首页 | 1.点击 关闭应用按钮 | 应用退出 | 是 | Pass | -| 返回按钮 示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 返回按钮 | 返回上一层 | 是 | Pass | -| 设置弹窗的显示层示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 是 / 否
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
ARKUI_LEVEL_MODE_OVERLAY / ARKUI_LEVEL_MODE_EMBEDDED | 是 | Pass | -| 设置背景颜色示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景颜色:红色
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 背景颜色:红色 | 是 | Pass | -| 圆角半径示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 圆角半径:15
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹窗中的圆角比不设置任何属性点击打开弹窗是四边圆角值小 | 是 | Pass | -| 边框颜色示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框颜色:黄色
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框颜色为 黄色 | 是 | Pass | -| 边框样式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框样式:点状
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框样式为 点状 | 是 | Pass | -| 边框宽跟高示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 属性设置结果显示
width: 300vp height: 200vp | 是 | Pass | -| 背板阴影示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板阴影
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框有阴影 | 是 | Pass | -| 自定义背板阴影示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义背板阴影
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框有阴影 弹框后有黑色边框 | 是 | Pass | -| 背板材质示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 轻薄材质模糊
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变灰色 | 是 | Pass | -| 对齐模式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 对齐模式:底部开始
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框底部开始 | 是 | Pass | -| 是否开启模态样式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式 是/否
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 是 弹框边框外颜色无变化 否 弹框边框外颜色无变化 | 是 | Pass | -| 弹窗是否在子窗口显示此弹窗示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗是否在子窗口显示此弹窗 开启/ 关闭
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 开启 再点设置属性栏 属性栏 在弹框页面下 关闭 再点设置属性栏 属性栏 在弹框页面下 | 是 | Pass | -| 自定义弹窗遮罩属性 示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义弹窗遮罩属性
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内外显示红色 | 是 | Pass | -| 避让键盘的模式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态 选择 否
4.点击 避让键盘的模式 避让 / 不避让
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 不避让 弹框在 点击输入框打开显示键盘后 弹框不避让 避让 弹框在 点击输入框打开显示键盘后 弹框向上移动 进行避让键盘 | 是 | Pass | -| 响应悬停示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 响应悬停。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框响应在下半屏 | 是 | Pass | -| 悬停态下弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮(仅折叠屏显示)
2.点击 设置属性按钮
3点击 悬停态下弹窗默认展示区域 选择 上半屏 / 下半屏
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
上半屏:Popup defaults to upper screen area in hover state 下半屏:Popup defaults to lower screen area in hover state | 是 | Pass | -| 注册系统关闭自定义弹窗的监听事件示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 注册系统关闭自定义弹窗的监听事件。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 系统返回操作失效 | 是 | Pass | -| 弹框状态示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框状态显示
DIALOG_UNINITIALIZED
DIALOG_INITIALIZED
DIALOG_APPEARING
DIALOG_DISAPPEARED | 是 | Pass | -| 背景模糊效果示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景模糊效果。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变为深色 | 是 | Pass | -| 背景效果参数示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景效果参数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变为深色 | 是 | Pass | - - - diff --git a/ArkUIKit/NativeDialogSample/screenshots/CustomDialogController.png b/ArkUIKit/NativeDialogSample/screenshots/CustomDialogController.png deleted file mode 100644 index 5f61f6bce9996973fce990f2b44c159998a14d3e..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDialogSample/screenshots/CustomDialogController.png and /dev/null differ diff --git a/ArkUIKit/NativeDialogSample/screenshots/OpenCustomDialog.png b/ArkUIKit/NativeDialogSample/screenshots/OpenCustomDialog.png deleted file mode 100644 index 3360d73e2f0d5967f9e14c097848e52b9ed8de7f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDialogSample/screenshots/OpenCustomDialog.png and /dev/null differ diff --git a/ArkUIKit/NativeDialogSample/screenshots/nativeDialog.png b/ArkUIKit/NativeDialogSample/screenshots/nativeDialog.png deleted file mode 100644 index 345cc57193787c84c6400614f7ea7e50b01b0d3c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDialogSample/screenshots/nativeDialog.png and /dev/null differ diff --git a/ArkUIKit/NativeDragDrop/.gitignore b/ArkUIKit/NativeDragDrop/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NativeDragDrop/AppScope/app.json5 b/ArkUIKit/NativeDragDrop/AppScope/app.json5 deleted file mode 100644 index 62c3614679df6e248b20d5ba1db1357dfddf83c0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.sample.ndk_drag_drop", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NativeDragDrop/AppScope/resources/base/element/string.json b/ArkUIKit/NativeDragDrop/AppScope/resources/base/element/string.json deleted file mode 100644 index 1080233f01384411ec684b58955cb8808746fdd3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - } - ] -} diff --git a/ArkUIKit/NativeDragDrop/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NativeDragDrop/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDragDrop/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NativeDragDrop/README_zh.md b/ArkUIKit/NativeDragDrop/README_zh.md deleted file mode 100644 index ccb9d80efdcd461ab696481f6879753d7ee7cb45..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/README_zh.md +++ /dev/null @@ -1,70 +0,0 @@ -# ArkUI指南文档示例 - -### 介绍 - -本示例通过使用[ArkUI指南文档](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/reference)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [拖拽C-API参考](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-drag-and-drop-h.md)。 -### 效果预览 - -| 首页 | -|------------------------------------| -| ![](screenshots/device/image1.jpg) | - -### 使用说明 - -1. 在首页可以查看多种拖拽API的使用示例,包括通用拖拽、通用异步拖拽、主动发起拖拽、主动发起拖拽(异步加载)的示例。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -entry/src/main/ets/ -|---cpp -| |---types -| |---CMakeLists.txt -| |---common.h -| |---container.cpp -| |---container.h -| |---firstmodule.h // 通用拖拽示例代码 -| |---forthmodule.h // 主动发起拖拽(异步加载)示例代码 -| |---init.cpp -| |---manager.cpp // 各模块示例入口 -| |---manager.h // manager头文件 -| |---napi_init.cpp -| |---secondmodule.h // 异步拖拽示例代码 -| |---thirdmodule.h // 主动发起拖拽示例代码 -|---ets -| |---pages -| | |---Index.ets // 应用主页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例支持仅标准系统上运行,支持设备:华为手机、华为平板。 - -2.HarmonyOS系统:HarmonyOS 6.0.0 Beta3版本及以上。 - -3.DevEco Studio版本:DevEco Studio 6.0.0 Beta3版本及以上。 - -4.HarmonyOS SDK版本:HarmonyOS 6.0.0 Beta3 SDK版本及以上。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo ArkUIKit/NativeDragDrop > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -```` \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/build-profile.json5 b/ArkUIKit/NativeDragDrop/build-profile.json5 deleted file mode 100644 index 1a4efe780afd7fdb22c76ae2f927496b12c2cf07..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/code-linter.json5 b/ArkUIKit/NativeDragDrop/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/.gitignore b/ArkUIKit/NativeDragDrop/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/build-profile.json5 b/ArkUIKit/NativeDragDrop/entry/build-profile.json5 deleted file mode 100644 index fea31f4580540c7c560b62bf531292c471c410f1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/hvigorfile.ts b/ArkUIKit/NativeDragDrop/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeDragDrop/entry/obfuscation-rules.txt b/ArkUIKit/NativeDragDrop/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NativeDragDrop/entry/oh-package.json5 b/ArkUIKit/NativeDragDrop/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 3a47dad1bd66b4a46b8a39b4deb3e554f78243e6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(MyApplication) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(nativeNode SHARED init.cpp manager.cpp container.cpp) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libnative_drawing.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so libpixelmap.so) -target_link_libraries(nativeNode PUBLIC libudmf.so) \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/common.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/common.h deleted file mode 100644 index a9d83786e3f47d36d0d346328729b2afc76d4dfc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/common.h +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef DRAGANDDROP_COMMON_H -#define DRAGANDDROP_COMMON_H - -#include "container.h" -#include -#include -#include -#include -#include -#include - -#define DEFAULT_WIDTH 200.0 -#define DEFAULT_HEIGHT 200.0 -#define DEFAULT_BG_COLOR 0xFFFFFFFF -#define DEFAULT_BORDER_WIDTH 0.0 -#define BORDER_WIDTH_1 1.0 -#define DEFAULT_MARGIN 5.0 -#define DEFAULT_BORDER_COLOR 0xFF000000 -#define DEFAULT_RADIUS 10.0 - -#define SIZE_20 20 -#define SIZE_50 50 -#define SIZE_70 70 -#define SIZE_120 120 -#define SIZE_140 140 -#define SIZE_170 170 -#define SIZE_200 200 -#define SIZE_240 240 -#define SIZE_300 300 -#define BLANK_5 5.0 -#define BLANK_10 10.0 -#define BLANK_20 20.0 - -#define DEFAULT_TEXT_FONT_SIZE 12 -#define TEXT_FONT_SIZE_15 15 -#define TEXT_FONT_SIZE_20 20 - -#define MAX_LENGTH 128 - -namespace NativeXComponentSample { - -ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; -ArkUI_ContextHandle context; -enum ArkUIModifierKeyName { - ARKUI_MODIFIER_KEY_CTRL = 1 << 0, // Ctrl 键 - ARKUI_MODIFIER_KEY_SHIFT = 1 << 1, // Shift 键 - ARKUI_MODIFIER_KEY_ALT = 1 << 2, // Alt 键 - ARKUI_MODIFIER_KEY_FN = 1 << 3 // Fn 键(如适用) -}; -char key[UDMF_KEY_BUFFER_LEN]; -int32_t g_requestIdentify = 0; -ArkUI_DragAction *action; -std::stringstream g_ss; - -void SetWidth(ArkUI_NodeHandle &node, float width = DEFAULT_WIDTH) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue widthValue[] = {width}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - nodeAPI->setAttribute(node, NODE_WIDTH, &widthItem); -} - -void SetHeight(ArkUI_NodeHandle &node, float height = DEFAULT_HEIGHT) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue heightValue[] = {height}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - nodeAPI->setAttribute(node, NODE_HEIGHT, &heightItem); -} - -void SetBackgroundColor(ArkUI_NodeHandle &node, uint32_t color = DEFAULT_BG_COLOR) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue colorValue[] = {{.u32 = color}}; - ArkUI_AttributeItem colorItem = {colorValue, 1}; - nodeAPI->setAttribute(node, NODE_BACKGROUND_COLOR, &colorItem); -} - -void SetMargin(ArkUI_NodeHandle &node, float margin = DEFAULT_MARGIN) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue marginValue[] = {margin}; - ArkUI_AttributeItem marginItem = {marginValue, 1}; - nodeAPI->setAttribute(node, NODE_MARGIN, &marginItem); -} - -void SetPadding(ArkUI_NodeHandle &node, float padding) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue paddingValue[] = {padding}; - ArkUI_AttributeItem paddingItem = {paddingValue, 1}; - nodeAPI->setAttribute(node, NODE_PADDING, &paddingItem); -} - -void SetBorderWidth(ArkUI_NodeHandle &node, float width = DEFAULT_BORDER_WIDTH) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue borderWidthValue[] = {width}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - nodeAPI->setAttribute(node, NODE_BORDER_WIDTH, &borderWidthItem); -} - -void SetBorderColor(ArkUI_NodeHandle &node, uint32_t color = DEFAULT_BORDER_COLOR) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue borderColorValue[] = {{.u32 = color}}; - ArkUI_AttributeItem borderColorItem = {borderColorValue, 1}; - nodeAPI->setAttribute(node, NODE_BORDER_COLOR, &borderColorItem); -} - -void SetBorderStyle(ArkUI_NodeHandle &node, int32_t style = ARKUI_BORDER_STYLE_DASHED, float radius = 10.0) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue borderStyleValue[] = {{.i32 = style}}; - ArkUI_AttributeItem borderStyleItem = {borderStyleValue, 1}; - nodeAPI->setAttribute(node, NODE_BORDER_STYLE, &borderStyleItem); - - ArkUI_NumberValue borderRadiusValue[] = {{.f32 = radius}}; - ArkUI_AttributeItem borderRadiusItem = {borderRadiusValue, 1}; - nodeAPI->setAttribute(node, NODE_BORDER_RADIUS, &borderRadiusItem); -} - -void SetText(ArkUI_NodeHandle &node, const char *str, float size = DEFAULT_TEXT_FONT_SIZE) -{ - if (!nodeAPI) { - return; - } - ArkUI_AttributeItem textValueItem = {.string = str}; - ArkUI_NumberValue fontSize[] = {size}; - ArkUI_AttributeItem fontItem = {fontSize, 1}; - nodeAPI->setAttribute(node, NODE_TEXT_CONTENT, &textValueItem); - nodeAPI->setAttribute(node, NODE_TEXT_FONT, &fontItem); -} - -void SetImageSrc(ArkUI_NodeHandle &node, const char *src) -{ - if (!nodeAPI) { - return; - } - ArkUI_AttributeItem imageSrcItem = {.string = src}; - nodeAPI->setAttribute(node, NODE_IMAGE_SRC, &imageSrcItem); -} - -void SetCommonAttribute(ArkUI_NodeHandle &node, float width = DEFAULT_WIDTH, float height = DEFAULT_HEIGHT, - unsigned int color = DEFAULT_BG_COLOR, float margin = DEFAULT_MARGIN) -{ - SetWidth(node, width); - SetHeight(node, height); - SetBackgroundColor(node, color); - SetMargin(node, margin); - SetBorderWidth(node, DEFAULT_BORDER_WIDTH); - SetBorderColor(node); -} - -void SetTextAttribute(ArkUI_NodeHandle &node, const char *str, float size = DEFAULT_TEXT_FONT_SIZE, - float width = DEFAULT_WIDTH, float height = DEFAULT_HEIGHT) -{ - SetCommonAttribute(node, width, height, 0); - SetText(node, str, size); -} - -void SetColumnJustifyContent(ArkUI_NodeHandle &node, int32_t alignment) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue justifyValue[] = {{.i32 = alignment}}; - ArkUI_AttributeItem justifyItem = {justifyValue, 1}; - nodeAPI->setAttribute(node, NODE_COLUMN_JUSTIFY_CONTENT, &justifyItem); -} - -void SetColumnAlignItem(ArkUI_NodeHandle &node, int32_t alignment) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue alignValue[] = {{.i32 = alignment}}; - ArkUI_AttributeItem alignItem = {alignValue, 1}; - nodeAPI->setAttribute(node, NODE_COLUMN_ALIGN_ITEMS, &alignItem); -} - -void SetRowJustifyContent(ArkUI_NodeHandle &node, int32_t alignment) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue justifyValue[] = {{.i32 = alignment}}; - ArkUI_AttributeItem justifyItem = {justifyValue, 1}; - nodeAPI->setAttribute(node, NODE_ROW_JUSTIFY_CONTENT, &justifyItem); -} - -void SetRowAlignItem(ArkUI_NodeHandle &node, int32_t alignment) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue alignValue[] = {{.i32 = alignment}}; - ArkUI_AttributeItem alignItem = {alignValue, 1}; - nodeAPI->setAttribute(node, NODE_ROW_ALIGN_ITEMS, &alignItem); -} - -void SetButtonLabel(ArkUI_NodeHandle &node, const char *label) -{ - if (!nodeAPI) { - return; - } - ArkUI_AttributeItem NODE_Button_SRC_Item = {.string = label}; - nodeAPI->setAttribute(node, NODE_BUTTON_LABEL, &NODE_Button_SRC_Item); -} - -void SetId(ArkUI_NodeHandle &node, const char *id) -{ - if (!nodeAPI) { - return; - } - ArkUI_AttributeItem idItem = {.string = id}; - nodeAPI->setAttribute(node, NODE_ID, &idItem); -} - -void SetPixelMap(std::vector &pixelVector) -{ - uint8_t data[960000]; - size_t dataSize = 960000; - for (int i = 0; i < dataSize; i++) { - data[i] = i + 1; - } - // 创建参数结构体实例,并设置参数 - OH_Pixelmap_InitializationOptions *createOpts; - OH_PixelmapInitializationOptions_Create(&createOpts); - OH_PixelmapInitializationOptions_SetWidth(createOpts, SIZE_200); - OH_PixelmapInitializationOptions_SetHeight(createOpts, SIZE_300); - OH_PixelmapInitializationOptions_SetPixelFormat(createOpts, PIXEL_FORMAT_BGRA_8888); - OH_PixelmapInitializationOptions_SetAlphaType(createOpts, PIXELMAP_ALPHA_TYPE_UNKNOWN); - // 创建Pixelmap实例 - OH_PixelmapNative *pixelmap = nullptr; - OH_PixelmapNative_CreatePixelmap(data, dataSize, createOpts, &pixelmap); - OH_PixelmapNative_Flip(pixelmap, true, true); - pixelVector.push_back(pixelmap); - int returnValue = OH_ArkUI_DragAction_SetPixelMaps(action, pixelVector.data(), pixelVector.size()); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragAction_SetPixelMaps returnValue = %{public}d", returnValue); -} - -void SetDragPreviewOption() -{ - auto *previewOptions1 = OH_ArkUI_CreateDragPreviewOption(); - OH_ArkUI_DragPreviewOption_SetScaleMode(previewOptions1, - ArkUI_DragPreviewScaleMode::ARKUI_DRAG_PREVIEW_SCALE_DISABLED); - OH_ArkUI_DragPreviewOption_SetDefaultShadowEnabled(previewOptions1, true); - OH_ArkUI_DragPreviewOption_SetDefaultRadiusEnabled(previewOptions1, true); - int returnValue = OH_ArkUI_DragAction_SetDragPreviewOption(action, previewOptions1); - OH_ArkUI_DragPreviewOption_Dispose(previewOptions1); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragAction_SetDragPreviewOption returnValue = %{public}d", returnValue); -} - -void PrintDragActionInfos() -{ - // 设置pointerId - int returnValue = OH_ArkUI_DragAction_SetPointerId(action, 0); // -1 0 10 - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragAction_SetPointerId returnValue = %{public}d", returnValue); - // 设置touchPoint - returnValue = OH_ArkUI_DragAction_SetTouchPointX(action, 200); // -1 0 200 - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragAction_SetTouchPointX returnValue = %{public}d", returnValue); - returnValue = OH_ArkUI_DragAction_SetTouchPointY(action, 200); // -1 0 200 - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragAction_SetTouchPointY returnValue = %{public}d", returnValue); -} - -} // namespace NativeXComponentSample - -#endif // DRAGANDDROP_COMMON_H \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/container.cpp b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/container.cpp deleted file mode 100644 index 080da8a0be18ae16434b854e5ee0995d3a17c528..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/container.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include - -#include -#include -#include - -#include "container.h" - -namespace NativeXComponentSample { - namespace { - void OnSurfaceCreatedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - } - - void OnSurfaceChangedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "surface changed"); - } - } - - void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container::Release(id); - } - - void DispatchTouchEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container *render = Container::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } - } - - void DispatchMouseEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchMouseEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = Container::GetInstance(id); - if (render != nullptr) { - render->OnMouseEvent(component, window); - } - } - - - void DispatchHoverEventCB(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchHoverEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnHoverEvent(component, isHover); - } - } - } // namespace - - std::unordered_map Container::instance_; - - Container::Container(const std::string &id) - { - this->id_ = id; - } - - Container *Container::GetInstance(const std::string &id) - { - if (instance_.find(id) == instance_.end()) { - Container *instance = new Container(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } - } - - void Container::Release(const std::string &id) - { - Container *render = Container::GetInstance(id); - if (render != nullptr) { - } - } - - void Container::OnSurfaceChanged(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChanged: Unable to get XComponent id"); - return; - } - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OH_NativeXComponent_GetXComponentOffset", - "offsetX = %{public}lf, offsetY = %{public}lf", offsetX, offsetY); - uint64_t width; - uint64_t height; - OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - } - - void Container::OnTouchEvent(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - std::string id(idStr); - Container *container = Container::GetInstance(id); - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, - tiltY); - } - - void Container::RegisterCallback(OH_NativeXComponent *nativeXComponent) - { - containerCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - containerCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - containerCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - containerCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &containerCallback_); - - mouseCallback_.DispatchMouseEvent = DispatchMouseEventCB; - mouseCallback_.DispatchHoverEvent = DispatchHoverEventCB; - OH_NativeXComponent_RegisterMouseEventCallback(nativeXComponent, &mouseCallback_); - OH_NativeXComponent_RegisterOnTouchInterceptCallback( - nativeXComponent, [](OH_NativeXComponent *, ArkUI_UIInputEvent *) -> HitTestMode { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "callback", - "OH_NativeXComponent_RegisterOnTouchInterceptCallback"); - return HitTestMode::HTM_TRANSPARENT; - }); - } - - void Container::OnMouseEvent(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnMouseEvent"); - OH_NativeXComponent_MouseEvent mouseEvent; - int32_t ret = OH_NativeXComponent_GetMouseEvent(component, window, &mouseEvent); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", - "MouseEvent Info: x = %{public}f, y = %{public}f, action = %{public}d, button = %{public}d", - mouseEvent.x, mouseEvent.y, mouseEvent.action, mouseEvent.button); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Container", "GetMouseEvent error"); - } - } - - void Container::OnHoverEvent(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnHoverEvent isHover_ = %{public}d", isHover); - } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/container.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/container.h deleted file mode 100644 index 4d2c090ad0ef3632520a3097ff79ee722bf88662..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/container.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MY_APPLICATION_CONTAINER_H -#define MY_APPLICATION_CONTAINER_H - -#include -#include - -#include -#include - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -namespace NativeXComponentSample { - - class Container { - public: - explicit Container(const std::string &id); - ~Container() = default; - static Container *GetInstance(const std::string &id); - static void Release(const std::string &id); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent *component, void *window); - void OnTouchEvent(OH_NativeXComponent *component, void *window); - void OnMouseEvent(OH_NativeXComponent *component, void *window); - void OnHoverEvent(OH_NativeXComponent *component, bool isHover); - void OnKeyEvent(OH_NativeXComponent *component, void *window); - void RegisterCallback(OH_NativeXComponent *nativeXComponent); - - public: - static std::unordered_map instance_; - std::string id_; - - private: - OH_NativeXComponent_Callback containerCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; - }; - -} // namespace NativeXComponentSample -#endif // MY_APPLICATION_CONTAINER_H diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/firstmodule.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/firstmodule.h deleted file mode 100644 index 091eb1fb4ef6bde8237c115ea6538a2d6e094dc4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/firstmodule.h +++ /dev/null @@ -1,534 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef DRAGANDDROP_FIRSTMODULE_H -#define DRAGANDDROP_FIRSTMODULE_H - -#include "common.h" -#include "container.h" -#include -#include -#include -#include -#include - -namespace NativeXComponentSample { - -ArkUI_NodeHandle dragText1 = nullptr; -ArkUI_NodeHandle dropText1 = nullptr; -ArkUI_NodeHandle dropText2 = nullptr; -ArkUI_NodeHandle displayIdText1 = nullptr; -ArkUI_NodeHandle bundleNameText1 = nullptr; -ArkUI_NodeHandle isRemoteText1 = nullptr; -ArkUI_NodeHandle previewTouchPointText1 = nullptr; -ArkUI_NodeHandle touchPointToWindowText1 = nullptr; -ArkUI_NodeHandle touchPointToDisplayText1 = nullptr; -ArkUI_NodeHandle touchPointToGlobalDisplayText1 = nullptr; -ArkUI_NodeHandle velocityText1 = nullptr; -ArkUI_NodeHandle modifierKeyStateText1 = nullptr; -ArkUI_NodeHandle dropArea1 = nullptr; -ArkUI_NodeHandle dropArea2 = nullptr; - -void PrintDragStartInfos(ArkUI_DragEvent* dragEvent) -{ - int32_t displayId; - OH_ArkUI_DragEvent_GetDisplayId(dragEvent, &displayId); - g_ss.str(""); - g_ss << "displayId: " << displayId; - SetText(displayIdText1, g_ss.str().c_str()); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_DRAG_START displayId = %{public}d", - displayId); - char bundleName[50] = {}; - OH_ArkUI_DragEvent_GetDragSource(dragEvent, bundleName, MAX_LENGTH); - g_ss.str(""); - g_ss << "bundleName: " << bundleName; - SetText(bundleNameText1, g_ss.str().c_str()); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_DRAG_START bundleName = %{public}s", - bundleName); - bool isRemote = false; - OH_ArkUI_DragEvent_IsRemote(dragEvent, &isRemote); - g_ss.str(""); - if (isRemote == false) { - g_ss << "isRemote: false"; - } else if (isRemote == true) { - g_ss << "isRemote: true"; - } - SetText(isRemoteText1, g_ss.str().c_str()); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_IsRemote returnValue = %{public}d", isRemote); - uint64_t modifierKeys = ARKUI_MODIFIER_KEY_CTRL; - int32_t modifierKeyState = OH_ArkUI_DragEvent_GetModifierKeyStates(dragEvent, &modifierKeys); - g_ss.str(""); - if (modifierKeyState == 0) { - g_ss << "modifierKeyState: false"; - } else if (modifierKeyState == 1) { - g_ss << "modifierKeyState: true"; - } - SetText(modifierKeyStateText1, g_ss.str().c_str()); -} - -void SetData(ArkUI_DragEvent* dragEvent) -{ - int returnValue; - OH_UdmfRecord *record = OH_UdmfRecord_Create(); - OH_UdsFileUri *imageValue = OH_UdsFileUri_Create(); - returnValue = OH_UdsFileUri_SetFileUri(imageValue, "/resources/seagull.png"); - returnValue = OH_UdmfRecord_AddFileUri(record, imageValue); - OH_UdmfData *data = OH_UdmfData_Create(); - returnValue = OH_UdmfData_AddRecord(data, record); - returnValue = OH_ArkUI_DragEvent_SetData(dragEvent, data); -} - -void GetDragMoveInfos(ArkUI_DragEvent* dragEvent) -{ - float previewTouchPointX = OH_ArkUI_DragEvent_GetPreviewTouchPointX(dragEvent); - float previewTouchPointY = OH_ArkUI_DragEvent_GetPreviewTouchPointY(dragEvent); - g_ss.str(""); - g_ss << "previewTouchPointX/Y: " << previewTouchPointX << "/" << previewTouchPointY; - SetText(previewTouchPointText1, g_ss.str().c_str()); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetPreviewTouchPointX pos = %{public}f; ", - "GetPreviewTouchPointY pos = %{public}f", - previewTouchPointX, previewTouchPointY); - float touchPointXToWindow = OH_ArkUI_DragEvent_GetTouchPointXToWindow(dragEvent); - float touchPointYToWindow = OH_ArkUI_DragEvent_GetTouchPointYToWindow(dragEvent); - g_ss.str(""); - g_ss << "touchPointX/YToWindow: " << touchPointXToWindow << "/" << touchPointYToWindow; - SetText(touchPointToWindowText1, g_ss.str().c_str()); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetTouchPointXToWindow pos = %{public}f; GetTouchPointYToWindow pos = %{public}f", - touchPointXToWindow, touchPointYToWindow); - float touchPointXToDisplay = OH_ArkUI_DragEvent_GetTouchPointXToDisplay(dragEvent); - float touchPointYToDisplay = OH_ArkUI_DragEvent_GetTouchPointYToDisplay(dragEvent); - g_ss.str(""); - g_ss << "touchPointX/YToDisplay: " << touchPointXToDisplay << "/" << touchPointYToDisplay; - SetText(touchPointToDisplayText1, g_ss.str().c_str()); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetTouchPointXToDisplay pos = %{public}f; GetTouchPointYToDisplay pos = %{public}f", - touchPointXToDisplay, touchPointYToDisplay); - float touchPointXToGlobalDisplay = OH_ArkUI_DragEvent_GetTouchPointXToGlobalDisplay(dragEvent); - float touchPointYToGlobalDisplay = OH_ArkUI_DragEvent_GetTouchPointYToGlobalDisplay(dragEvent); - g_ss.str(""); - g_ss << "touchPointX/YToGlobalDisplay: " << touchPointXToDisplay << "/" << touchPointYToDisplay; - SetText(touchPointToGlobalDisplayText1, g_ss.str().c_str()); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetTouchPointXToGlobalDisplay pos = %{public}f; ", - "GetTouchPointYToGlobalDisplay pos = %{public}f", - touchPointXToGlobalDisplay, touchPointYToGlobalDisplay); - float velocityX = OH_ArkUI_DragEvent_GetVelocityX(dragEvent); - float velocityY = OH_ArkUI_DragEvent_GetVelocityY(dragEvent); - float velocity = OH_ArkUI_DragEvent_GetVelocity(dragEvent); - g_ss.str(""); - g_ss << "velocityX: " << velocityX << " velocityY: " << velocityY << " velocity: " << velocity; - SetText(velocityText1, g_ss.str().c_str()); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetVelocityX vx = %{public}f; ", - "GetVelocityY vy = %{public}f; ", - "GetVelocity v = %{public}f", - velocityX, velocityY, velocity); -} - -void GetDragData(ArkUI_DragEvent* dragEvent) -{ - // 获取UDMF data - int returnValue; - // 创建OH_UdmfData对象 - OH_UdmfData *data = OH_UdmfData_Create(); - returnValue = OH_ArkUI_DragEvent_GetUdmfData(dragEvent, data); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_GetUdmfData returnValue = %{public}d", returnValue); - // 判断OH_UdmfData是否有对应的类型 - bool resultUdmf = OH_UdmfData_HasType(data, UDMF_META_GENERAL_FILE); - if (resultUdmf) { - // 获取OH_UdmfData的记录 - unsigned int recordsCount = 0; - OH_UdmfRecord **records = OH_UdmfData_GetRecords(data, &recordsCount); - // 获取records中的元素 - int returnStatus; - for (int i = 0; i < recordsCount; i++) { - // 从OH_UdmfRecord中获取文件类型数据 - OH_UdsFileUri *imageValue = OH_UdsFileUri_Create(); - returnStatus = OH_UdmfRecord_GetFileUri(records[i], imageValue); - const char *fileUri = OH_UdsFileUri_GetFileUri(imageValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfRecord_GetPlainText " - "returnStatus= %{public}d " - "fileUri= %{public}s", - returnStatus, fileUri); - // 使用结束后销毁指针 - OH_UdsFileUri_Destroy(imageValue); - } - if (recordsCount != 0) { - OH_ArkUI_DragEvent_SetDragResult(dragEvent, ARKUI_DRAG_RESULT_SUCCESSFUL); - ArkUI_DropOperation option; - OH_ArkUI_DragEvent_GetDropOperation(dragEvent, &option); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_GetDropOperation returnValue = %{public}d", option); - } - } else { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_UdmfData_HasType not contain UDMF_META_GENERAL_FILE"); - } - int32_t count; - OH_ArkUI_DragEvent_GetDataTypeCount(dragEvent, &count); - if (count <= 0 || count >= MAX_LENGTH) { - return; - } - char **eventTypeArray = new char *[count]; - for (int i = 0; i < count; i++) { - eventTypeArray[i] = new char[MAX_LENGTH]; - } - OH_ArkUI_DragEvent_GetDataTypes(dragEvent, eventTypeArray, count, MAX_LENGTH); - for (int i = 0; i < count; i++) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_GetDataTypes returnValue = %{public}s", eventTypeArray[i]); - } -} - -void RegisterNodeEventFirstReceiver1(ArkUI_NodeHandle &dragNode) -{ - if (!nodeAPI) { - return; - } - - nodeAPI->addNodeEventReceiver(dragNode, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventFirstReceiver called"); - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); - auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); - switch (eventType) { - case NODE_ON_PRE_DRAG: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_PRE_DRAG EventReceiver"); - break; - } - case NODE_ON_DRAG_START: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_START EventReceiver"); - PrintDragStartInfos(dragEvent); - SetData(dragEvent); - // 预览图尺寸 - float previewRectWidth = OH_ArkUI_DragEvent_GetPreviewRectWidth(dragEvent); - float previewRectHeight = OH_ArkUI_DragEvent_GetPreviewRectHeight(dragEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_DRAG_START previewRectWidth = %{public}f; previewRectHeight = %{public}f", - previewRectWidth, previewRectHeight); - break; - } - case NODE_ON_DRAG_END: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_END EventReceiver"); - ArkUI_DragResult result; - OH_ArkUI_DragEvent_GetDragResult(dragEvent, &result); - if (result == ARKUI_DRAG_RESULT_SUCCESSFUL) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "Drag Successful!"); - nodeAPI->resetAttribute(dragText1, NODE_TEXT_CONTENT); - SetText(dropText1, "drag me", TEXT_FONT_SIZE_20); - SetText(dropText2, "drag me", TEXT_FONT_SIZE_20); - } else if (result == ARKUI_DRAG_RESULT_FAILED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "Drag Failed!"); - } - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); - break; - } - } - }); -} - -void RegisterNodeEventFirstReceiver2(ArkUI_NodeHandle node) -{ - if (!nodeAPI) { - return; - } - - nodeAPI->addNodeEventReceiver(node, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventFirstReceiver called"); - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); - - auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); - switch (eventType) { - case NODE_ON_DROP: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP EventReceiver"); - GetDragData(dragEvent); - break; - } - case NODE_ON_DRAG_ENTER: { - OH_ArkUI_DragEvent_SetSuggestedDropOperation(dragEvent, ARKUI_DROP_OPERATION_COPY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_ENTER EventReceiver"); - break; - } - case NODE_ON_DRAG_MOVE: { - OH_ArkUI_DragEvent_SetSuggestedDropOperation(dragEvent, ARKUI_DROP_OPERATION_COPY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_MOVE EventReceiver"); - GetDragMoveInfos(dragEvent); - break; - } - case NODE_ON_DRAG_LEAVE: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_LEAVE EventReceiver"); - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); - break; - } - } - }); -} - -void DisplayInfo(ArkUI_NodeHandle &column1) -{ - displayIdText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(displayIdText1, "display: "); - nodeAPI->addChild(column1, displayIdText1); - - bundleNameText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(bundleNameText1, "bundleName: "); - nodeAPI->addChild(column1, bundleNameText1); - - isRemoteText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(isRemoteText1, "isRemote: "); - nodeAPI->addChild(column1, isRemoteText1); - - modifierKeyStateText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(modifierKeyStateText1, "modifierKeyState: "); - nodeAPI->addChild(column1, modifierKeyStateText1); - - previewTouchPointText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(previewTouchPointText1, "previewTouchPointX/Y: "); - nodeAPI->addChild(column1, previewTouchPointText1); - - touchPointToWindowText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(touchPointToWindowText1, "previewTouchPointX/Y: "); - nodeAPI->addChild(column1, touchPointToWindowText1); - - touchPointToDisplayText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(touchPointToDisplayText1, "touchPointX/YToDisplay: "); - nodeAPI->addChild(column1, touchPointToDisplayText1); - - touchPointToGlobalDisplayText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(touchPointToGlobalDisplayText1, "touchPointX/YToGlobalDisplay: "); - nodeAPI->addChild(column1, touchPointToGlobalDisplayText1); - - velocityText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(velocityText1, "velocityX: velocityY: velocity: "); - nodeAPI->addChild(column1, velocityText1); - - auto blank = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetHeight(blank, BLANK_5); - nodeAPI->addChild(column1, blank); -} - -void SetPreviewOption(ArkUI_NodeHandle &node) -{ - auto *previewOptionsText = OH_ArkUI_CreateDragPreviewOption(); - OH_ArkUI_DragPreviewOption_SetScaleMode(previewOptionsText, ARKUI_DRAG_PREVIEW_SCALE_DISABLED); - OH_ArkUI_DragPreviewOption_SetNumberBadgeEnabled(previewOptionsText, true); - OH_ArkUI_DragPreviewOption_SetBadgeNumber(previewOptionsText, -1); - OH_ArkUI_DragPreviewOption_SetDefaultShadowEnabled(previewOptionsText, true); - OH_ArkUI_DragPreviewOption_SetDefaultRadiusEnabled(previewOptionsText, true); - int returnValue = OH_ArkUI_DragPreviewOption_SetDefaultAnimationBeforeLiftingEnabled(previewOptionsText, true); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", - "dragTest DragPreviewOption_SetDefaultAnimationBeforeLiftingEnabled returnValue = %{public}d", - returnValue); - OH_ArkUI_SetNodeDragPreviewOption(node, previewOptionsText); - OH_ArkUI_DragPreviewOption_Dispose(previewOptionsText); -} - -void DragAreaFirst(ArkUI_NodeHandle &column1) -{ - auto dragRow1 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAlignItem(dragRow1, ARKUI_VERTICAL_ALIGNMENT_TOP); - nodeAPI->addChild(column1, dragRow1); - - // 拖拽区域 - auto dragColumn = nodeAPI->createNode(ARKUI_NODE_COLUMN); - auto dragTitle = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(dragTitle, "请长按拖拽文字", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); - auto dragArea = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetCommonAttribute(dragArea, SIZE_140, SIZE_50, DEFAULT_BG_COLOR, BLANK_5); - SetBorderWidth(dragArea, BORDER_WIDTH_1); - SetColumnJustifyContent(dragArea, ARKUI_FLEX_ALIGNMENT_CENTER); - nodeAPI->addChild(dragColumn, dragTitle); - nodeAPI->addChild(dragColumn, dragArea); - nodeAPI->addChild(dragRow1, dragColumn); - - dragText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetId(dragText1, "dragText_1"); - SetText(dragText1, "drag me", TEXT_FONT_SIZE_20); - nodeAPI->registerNodeEvent(dragText1, NODE_ON_PRE_DRAG, 1, nullptr); - nodeAPI->registerNodeEvent(dragText1, NODE_ON_DRAG_START, 1, nullptr); - nodeAPI->registerNodeEvent(dragText1, NODE_ON_DRAG_END, 1, nullptr); - OH_ArkUI_SetNodeDraggable(dragText1, true); - SetPreviewOption(dragText1); - nodeAPI->addChild(dragArea, dragText1); - - // 不可拖拽落入区域 - auto unDropColumn = nodeAPI->createNode(ARKUI_NODE_COLUMN); - auto unDropTitle = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(unDropTitle, "不可拖拽落入区域", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); - auto unDropArea = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetId(unDropArea, "unDropArea_1"); - SetCommonAttribute(unDropArea, SIZE_140, SIZE_50, DEFAULT_BG_COLOR, BLANK_5); - SetBorderWidth(unDropArea, BORDER_WIDTH_1); - SetColumnJustifyContent(unDropArea, ARKUI_FLEX_ALIGNMENT_CENTER); - OH_ArkUI_DisallowNodeAnyDropDataTypes(unDropArea); - OH_ArkUI_EnableDropDisallowedBadge(context, true); - auto unDropText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(unDropText1, "", TEXT_FONT_SIZE_20); - nodeAPI->addChild(unDropArea, unDropText1); - nodeAPI->registerNodeEvent(unDropArea, NODE_ON_DROP, 1, nullptr); - nodeAPI->addChild(unDropColumn, unDropTitle); - nodeAPI->addChild(unDropColumn, unDropArea); - nodeAPI->addChild(dragRow1, unDropColumn); -} - -void DropAreaFirst1(ArkUI_NodeHandle &dragRow2) -{ - // 拖拽落入区域1 - auto dropColumn1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - auto dropTitle1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(dropTitle1, "拖拽落入区域", TEXT_FONT_SIZE_15); - - dropArea1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetId(dropArea1, "dropArea1_1"); - SetCommonAttribute(dropArea1, SIZE_140, SIZE_200, DEFAULT_BG_COLOR, BLANK_5); - SetBorderWidth(dropArea1, BORDER_WIDTH_1); - SetColumnJustifyContent(dropArea1, ARKUI_FLEX_ALIGNMENT_SPACE_AROUND); - SetColumnAlignItem(dropArea1, ARKUI_HORIZONTAL_ALIGNMENT_CENTER); - OH_ArkUI_AllowNodeAllDropDataTypes(dropArea1); - // 仅对当前组件生效 - OH_ArkUI_SetDragEventStrictReportWithNode(dropArea1, true); - dropText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(dropText1, "", TEXT_FONT_SIZE_20); - nodeAPI->addChild(dropArea1, dropTitle1); - nodeAPI->addChild(dropArea1, dropText1); - nodeAPI->registerNodeEvent(dropArea1, NODE_ON_DROP, 1, nullptr); - nodeAPI->registerNodeEvent(dropArea1, NODE_ON_DRAG_MOVE, 1, nullptr); - nodeAPI->registerNodeEvent(dropArea1, NODE_ON_DRAG_ENTER, 1, nullptr); - nodeAPI->registerNodeEvent(dropArea1, NODE_ON_DRAG_LEAVE, 1, nullptr); - nodeAPI->addChild(dropColumn1, dropArea1); - - auto unDropArea1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetId(unDropArea1, "unDropArea1_1"); - SetCommonAttribute(unDropArea1, SIZE_120, SIZE_70, DEFAULT_BG_COLOR, BLANK_5); - SetBorderWidth(unDropArea1, BORDER_WIDTH_1); - SetColumnJustifyContent(unDropArea1, ARKUI_FLEX_ALIGNMENT_CENTER); - SetColumnAlignItem(unDropArea1, ARKUI_HORIZONTAL_ALIGNMENT_CENTER); - OH_ArkUI_DisallowNodeAnyDropDataTypes(unDropArea1); - nodeAPI->registerNodeEvent(unDropArea1, NODE_ON_DROP, 1, nullptr); - auto unDropText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(unDropText1, "其他子组件", TEXT_FONT_SIZE_15); - nodeAPI->addChild(unDropArea1, unDropText1); - nodeAPI->addChild(dropArea1, unDropArea1); - - nodeAPI->addChild(dragRow2, dropColumn1); -} - -void DropAreaFirst2(ArkUI_NodeHandle &dragRow2) -{ - // 拖拽落入区域2 - auto dropColumn2 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - auto dropTitle2 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(dropTitle2, "拖拽落入区域", TEXT_FONT_SIZE_15); - dropArea2 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetId(dropArea2, "dropArea2_1"); - SetCommonAttribute(dropArea2, SIZE_140, SIZE_200, DEFAULT_BG_COLOR, BLANK_5); - SetBorderWidth(dropArea2, BORDER_WIDTH_1); - SetColumnJustifyContent(dropArea2, ARKUI_FLEX_ALIGNMENT_SPACE_AROUND); - SetColumnAlignItem(dropArea2, ARKUI_HORIZONTAL_ALIGNMENT_CENTER); - OH_ArkUI_AllowNodeAllDropDataTypes(dropArea2); - // context上下文均生效 - OH_ArkUI_SetDragEventStrictReportWithContext(context, true); - dropText2 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(dropText2, "", TEXT_FONT_SIZE_20); - nodeAPI->addChild(dropArea2, dropTitle2); - nodeAPI->addChild(dropArea2, dropText2); - nodeAPI->registerNodeEvent(dropArea2, NODE_ON_DROP, 1, nullptr); - nodeAPI->registerNodeEvent(dropArea2, NODE_ON_DRAG_MOVE, 1, nullptr); - nodeAPI->registerNodeEvent(dropArea2, NODE_ON_DRAG_ENTER, 1, nullptr); - nodeAPI->registerNodeEvent(dropArea2, NODE_ON_DRAG_LEAVE, 1, nullptr); - nodeAPI->addChild(dropColumn2, dropArea2); - - auto unDropArea2 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetId(unDropArea2, "unDropArea2_1"); - SetCommonAttribute(unDropArea2, SIZE_120, SIZE_70, DEFAULT_BG_COLOR, BLANK_5); - SetBorderWidth(unDropArea2, BORDER_WIDTH_1); - SetColumnJustifyContent(unDropArea2, ARKUI_FLEX_ALIGNMENT_CENTER); - SetColumnAlignItem(unDropArea2, ARKUI_HORIZONTAL_ALIGNMENT_CENTER); - OH_ArkUI_DisallowNodeAnyDropDataTypes(unDropArea2); - const char* types[] = {"general.file"}; - OH_ArkUI_SetNodeAllowedDropDataTypes(unDropArea2, types, 1); - nodeAPI->registerNodeEvent(unDropArea2, NODE_ON_DROP, 1, nullptr); - auto unDropText2 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(unDropText2, "其他子组件", TEXT_FONT_SIZE_15); - nodeAPI->addChild(unDropArea2, unDropText2); - nodeAPI->addChild(dropArea2, unDropArea2); - - nodeAPI->addChild(dragRow2, dropColumn2); -} - -void FirstModule(ArkUI_NodeHandle &root) -{ - auto column1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnJustifyContent(column1, ARKUI_FLEX_ALIGNMENT_START); - SetColumnAlignItem(column1, ARKUI_HORIZONTAL_ALIGNMENT_START); - SetPadding(column1, BLANK_10); - SetBorderWidth(column1, BORDER_WIDTH_1); - SetBorderStyle(column1, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); - - auto title = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(title, "通用拖拽示例:", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); - nodeAPI->addChild(column1, title); - - DragAreaFirst(column1); - - auto dragRow2 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAlignItem(dragRow2, ARKUI_VERTICAL_ALIGNMENT_TOP); - nodeAPI->addChild(column1, dragRow2); - - DropAreaFirst1(dragRow2); - - DropAreaFirst2(dragRow2); - - DisplayInfo(column1); - - auto resetButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(resetButton, "reset"); - SetButtonLabel(resetButton, "复位"); - nodeAPI->registerNodeEvent(resetButton, NODE_ON_CLICK_EVENT, 1, nullptr); - nodeAPI->addNodeEventReceiver(resetButton, [](ArkUI_NodeEvent *event) { - nodeAPI->resetAttribute(dropText1, NODE_TEXT_CONTENT); - nodeAPI->resetAttribute(dropText2, NODE_TEXT_CONTENT); - SetText(dragText1, "drag me", TEXT_FONT_SIZE_20); - }); - nodeAPI->addChild(column1, resetButton); - - nodeAPI->addChild(root, column1); - - RegisterNodeEventFirstReceiver1(dragText1); - RegisterNodeEventFirstReceiver2(dropArea1); - RegisterNodeEventFirstReceiver2(dropArea2); -} - -} // namespace NativeXComponentSample - -#endif // DRAGANDDROP_FIRSTMODULE_H \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/forthmodule.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/forthmodule.h deleted file mode 100644 index fd778e3b49b68edc4a51709d4f05387dea2f2f6c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/forthmodule.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef DRAGANDDROP_FORTHMODULE_H -#define DRAGANDDROP_FORTHMODULE_H - -#include "common.h" -#include "container.h" -#include -#include -#include -#include -#include -namespace NativeXComponentSample { - -ArkUI_NodeHandle button4_1 = nullptr; -ArkUI_NodeHandle button4_2 = nullptr; - -void SetTextDataLoadParams() -{ - // 异步传输拖拽数据 - OH_UdmfDataLoadParams *dataLoadParams = OH_UdmfDataLoadParams_Create(); - OH_UdmfDataLoadInfo *info = OH_UdmfDataLoadInfo_Create(); - OH_UdmfDataLoadInfo_SetRecordCount(info, 1); - OH_UdmfDataLoadParams_SetDataLoadInfo(dataLoadParams, info); - OH_Udmf_DataLoadHandler dataLoadHandler = [](OH_UdmfDataLoadInfo *acceptableInfo) { - OH_UdmfRecord *record = OH_UdmfRecord_Create(); - // 向OH_UdmfRecord中添加纯文本类型数据 - OH_UdsPlainText *plainText = OH_UdsPlainText_Create(); - int returnStatus; - OH_UdsPlainText_SetAbstract(plainText, "this is plainText Abstract example"); - OH_UdsPlainText_SetContent(plainText, "this is plainText Content example"); - returnStatus = OH_UdmfRecord_AddPlainText(record, plainText); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfRecord_AddPlainText returnStatus = %{public}d", returnStatus); - // 创建OH_UdmfData对象 - OH_UdmfData *data4 = OH_UdmfData_Create(); - int returnValue; - for (int i = 0; i < 1; i++) { - returnValue = OH_UdmfData_AddRecord(data4, record); - } - return data4; - }; - OH_UdmfDataLoadParams_SetLoadHandler(dataLoadParams, dataLoadHandler); - OH_ArkUI_DragAction_SetDataLoadParams(action, dataLoadParams); -} - -void StartDataLoadingForth(ArkUI_DragEvent* dragEvent) -{ - // 异步流程 - OH_Udmf_DataProgressListener dataProgressListener = [](OH_Udmf_ProgressInfo *progressInfo, - OH_UdmfData *data) { - int32_t progress = OH_UdmfProgressInfo_GetProgress(progressInfo); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_StartDataLoading progressInfo = %{public}d", progress); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "dataProgressListener callback"); - bool resultUdmf = OH_UdmfData_HasType(data, UDMF_META_PLAIN_TEXT); - if (resultUdmf) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_DROP has UDMF_META_PLAIN_TEXT"); - unsigned int recordsCount = 0; - OH_UdmfRecord **records = OH_UdmfData_GetRecords(data, &recordsCount); - // 获取records中的元素 - int returnStatus; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "recordsCount= %{public}d", - recordsCount); - for (int i = 0; i < recordsCount; i++) { - // 从OH_UdmfRecord中获取纯文本类型数据 - OH_UdsPlainText *plainTextValue = OH_UdsPlainText_Create(); - returnStatus = OH_UdmfRecord_GetPlainText(records[i], plainTextValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfRecord_GetPlainText " - "returnStatus = %{public}d", - returnStatus); - auto getAbstract = OH_UdsPlainText_GetAbstract(plainTextValue); - auto getContent = OH_UdsPlainText_GetContent(plainTextValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_UdsPlainText_GetAbstract = " - "%{public}s, OH_UdsPlainText_GetContent = " - "%{public}s", - getAbstract, getContent); - // 使用结束后销毁指针 - OH_UdsPlainText_Destroy(plainTextValue); - } - OH_ArkUI_NotifyDragResult(g_requestIdentify, ARKUI_DRAG_RESULT_SUCCESSFUL); - OH_ArkUI_NotifyDragEndPendingDone(g_requestIdentify); - } - }; - OH_UdmfGetDataParams *params = OH_UdmfGetDataParams_Create(); - OH_UdmfGetDataParams_SetFileConflictOptions(params, Udmf_FileConflictOptions::UDMF_OVERWRITE); - OH_UdmfGetDataParams_SetProgressIndicator(params, Udmf_ProgressIndicator::UDMF_DEFAULT); - OH_UdmfGetDataParams_SetDataProgressListener(params, dataProgressListener); - OH_ArkUI_DragEvent_StartDataLoading(dragEvent, params, key, UDMF_KEY_BUFFER_LEN); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_StartDataLoading key = %{public}s", key); - OH_UdmfGetDataParams_Destroy(params); -} - -void RegisterNodeEventForthReceiver1() -{ - if (!nodeAPI) { - return; - } - - nodeAPI->addNodeEventReceiver(button4_1, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventForthReceiver called"); - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); - - switch (eventType) { - case NODE_ON_TOUCH_INTERCEPT: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_TOUCH_INTERCEPT EventReceiver"); - // 创建DragAction - auto context = OH_ArkUI_GetContextByNode(button4_1); - action = OH_ArkUI_CreateDragActionWithContext(context); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_CreateDragActionWithContext returnValue = %{public}p", action); - std::vector pixelVector; - // 设置pixelMap - SetPixelMap(pixelVector); - // 设置DragPreviewOption - SetDragPreviewOption(); - PrintDragActionInfos(); - SetTextDataLoadParams(); - // startDrag - int returnValue = OH_ArkUI_StartDrag(action); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_StartDrag returnValue = %{public}d", - returnValue); - OH_ArkUI_DragAction_Dispose(action); - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); - break; - } - } - }); -} - -void RegisterNodeEventForthReceiver2() -{ - if (!nodeAPI) { - return; - } - - nodeAPI->addNodeEventReceiver(button4_2, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventForthReceiver called"); - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); - - auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); - switch (eventType) { - case NODE_ON_DROP: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP EventReceiver"); - StartDataLoadingForth(dragEvent); - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); - break; - } - } - }); -} - -void ForthModule(ArkUI_NodeHandle &root) -{ - auto column4 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnJustifyContent(column4, ARKUI_FLEX_ALIGNMENT_START); - SetColumnAlignItem(column4, ARKUI_HORIZONTAL_ALIGNMENT_START); - SetPadding(column4, BLANK_10); - SetBorderWidth(column4, BORDER_WIDTH_1); - SetBorderStyle(column4, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); - - auto title4 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(title4, "主动发起拖拽示例(异步加载):", TEXT_FONT_SIZE_15, SIZE_240, SIZE_20); - nodeAPI->addChild(column4, title4); - - auto row4 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAlignItem(row4, ARKUI_VERTICAL_ALIGNMENT_TOP); - nodeAPI->addChild(column4, row4); - - button4_1 = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(button4_1, "dragBt4"); - SetCommonAttribute(button4_1, SIZE_70, SIZE_50, 0xFFFF0000, BLANK_20); - SetButtonLabel(button4_1, "拖起"); - nodeAPI->registerNodeEvent(button4_1, NODE_ON_TOUCH_INTERCEPT, 1, nullptr); - nodeAPI->addChild(row4, button4_1); - - button4_2 = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(button4_2, "dropBt4"); - SetCommonAttribute(button4_2, SIZE_140, SIZE_50, 0xFFFF0000, BLANK_20); - SetButtonLabel(button4_2, "拖拽至此处"); - nodeAPI->registerNodeEvent(button4_2, NODE_ON_DROP, 1, nullptr); - nodeAPI->addChild(row4, button4_2); - - nodeAPI->addChild(root, column4); - - RegisterNodeEventForthReceiver1(); - RegisterNodeEventForthReceiver2(); -} - -} // namespace NativeXComponentSample - -#endif // DRAGANDDROP_FORTHMODULE_H \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/init.cpp b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/init.cpp deleted file mode 100644 index c0a59c6e508ef0e7e7babfe349fce391e8591e7a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/init.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include "manager.h" - -namespace NativeXComponentSample { - EXTERN_C_START - static napi_value Init(napi_env env, napi_value exports) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"getContext", nullptr, Manager::GetContext, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeNode", nullptr, Manager::CreateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"upDateNativeNode", nullptr, Manager::UpdateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}}; - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - - Manager::GetInstance()->Export(env, exports); - return exports; - } - EXTERN_C_END - - static napi_module nativeNodeModule = {.nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativeNode", - .nm_priv = ((void *)0), - .reserved = {0}}; - - extern "C" __attribute__((constructor)) void RegisterModule(void) { napi_module_register(&nativeNodeModule); } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.cpp b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.cpp deleted file mode 100644 index d58e78d745aa310692a718251a4069d3d04650a3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "common.h" -#include "firstmodule.h" -#include "secondmodule.h" -#include "thirdmodule.h" -#include "forthmodule.h" -#include "napi/native_api.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "manager.h" - -namespace NativeXComponentSample { -Manager Manager::manager_; - -Manager::~Manager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "~Manager"); - for (auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for (auto iter = containerMap_.begin(); iter != containerMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - containerMap_.clear(); -} - -void SampleEntry(napi_env env, napi_value arg, OH_NativeXComponent *component) -{ - // 根节点 - auto column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetBorderWidth(column, DEFAULT_BORDER_WIDTH); - SetColumnJustifyContent(column, ARKUI_FLEX_ALIGNMENT_START); - SetColumnAlignItem(column, ARKUI_HORIZONTAL_ALIGNMENT_START); - SetPadding(column, BLANK_10); - - FirstModule(column); - - auto blank1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetHeight(blank1, BLANK_10); - nodeAPI->addChild(column, blank1); - - SecondModule(column); - - auto blank2 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetHeight(blank2, BLANK_10); - nodeAPI->addChild(column, blank2); - - ThirdModule(column); - - auto blank3 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetHeight(blank3, BLANK_10); - nodeAPI->addChild(column, blank3); - - ForthModule(column); - - OH_NativeXComponent_AttachNativeRootNode(component, column); -} - -napi_value Manager::CreateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - if (argCnt < 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - - if (nodeAPI != nullptr) { - if (nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { - SampleEntry(env, args[1], component); - } - } - - return nullptr; -} - -napi_value Manager::UpdateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode env or info is null"); - return nullptr; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "UpdateNativeNode 1111"); - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "CreateNativeNode %{public}s", idStr); - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - - if ((env == nullptr) || (info == nullptr || component == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - return nullptr; -} - -napi_value Manager::GetContext(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_number) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - int64_t value; - if (napi_get_value_int64(env, args[0], &value) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_create_object failed"); - return nullptr; - } - - return exports; -} - -void Manager::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", - "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto manager = Manager::GetInstance(); - if ((manager != nullptr) && (nativeXComponent != nullptr)) { - manager->SetNativeXComponent(id, nativeXComponent); - } -} - -void Manager::SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent) -{ - if (nativeXComponent == nullptr) { - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent *tmp = nativeXComponentMap_[id]; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -OH_NativeXComponent *Manager::GetNativeXComponent(const std::string &id) { return nativeXComponentMap_[id]; } -} // namespace NativeXComponentSample \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.h deleted file mode 100644 index c4da32804a827832b285ee0bc9e1dfcf4ad8ec31..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "container.h" -namespace NativeXComponentSample { -const int MAX_SIZE = 11; -class Manager { -public: - ~Manager(); - - static Manager *GetInstance() { return &Manager::manager_; } - - static napi_value GetContext(napi_env env, napi_callback_info info); - static napi_value CreateNativeNode(napi_env env, napi_callback_info info); - static napi_value UpdateNativeNode(napi_env env, napi_callback_info info); - - void SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent); - OH_NativeXComponent *GetNativeXComponent(const std::string &id); - - void Export(napi_env env, napi_value exports); - -private: - static Manager manager_; - - std::unordered_map nativeXComponentMap_; - std::unordered_map containerMap_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index f4fb7fabbc60dffb99d41d578848f7fb0b50c5a6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/secondmodule.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/secondmodule.h deleted file mode 100644 index 14b7079512604191ff12bf25d8cd88648987e3ba..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/secondmodule.h +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef DRAGANDDROP_SECONDMODULE_H -#define DRAGANDDROP_SECONDMODULE_H - -#include "common.h" -#include "container.h" -#include <__charconv/chars_format.h> -#include -#include -#include -#include -#include -#include - -namespace NativeXComponentSample { - -ArkUI_NodeHandle dragImage = nullptr; -ArkUI_NodeHandle dropImage = nullptr; -ArkUI_NodeHandle displayIdText2 = nullptr; -ArkUI_NodeHandle bundleNameText2 = nullptr; -ArkUI_NodeHandle isRemoteText2 = nullptr; -ArkUI_NodeHandle previewTouchPointText2 = nullptr; -ArkUI_NodeHandle touchPointToWindowText2 = nullptr; -ArkUI_NodeHandle touchPointToDisplayText2 = nullptr; -ArkUI_NodeHandle touchPointToGlobalDisplayText2 = nullptr; -ArkUI_NodeHandle velocityText2 = nullptr; - -void SetImageDataLoadParams(ArkUI_DragEvent* dragEvent) -{ - // 异步传输拖拽数据 - OH_UdmfDataLoadParams *dataLoadParams = OH_UdmfDataLoadParams_Create(); - OH_UdmfDataLoadInfo *info = OH_UdmfDataLoadInfo_Create(); - OH_UdmfDataLoadInfo_SetType(info, "general.image"); - OH_UdmfDataLoadInfo_SetRecordCount(info, 1); - OH_UdmfDataLoadParams_SetDataLoadInfo(dataLoadParams, info); - OH_Udmf_DataLoadHandler dataLoadHandler = [](OH_UdmfDataLoadInfo *acceptableInfo) { - OH_UdmfRecord *record = OH_UdmfRecord_Create(); - OH_UdsFileUri *imageValue = OH_UdsFileUri_Create(); - int returnValue = OH_UdsFileUri_SetFileUri(imageValue, "/resources/seagull.png"); - returnValue = OH_UdmfRecord_AddFileUri(record, imageValue); - OH_UdmfData *data = OH_UdmfData_Create(); - for (int i = 0; i < 1; i++) { - returnValue = OH_UdmfData_AddRecord(data, record); - } - return data; - }; - OH_UdmfDataLoadParams_SetLoadHandler(dataLoadParams, dataLoadHandler); - OH_ArkUI_DragEvent_SetDataLoadParams(dragEvent, dataLoadParams); -} - -void StartDataLoadingSecond(ArkUI_DragEvent* dragEvent) -{ - // 异步流程 - int32_t count = 0; - int returnValue = OH_ArkUI_DragEvent_GetDataTypeCount(dragEvent, &count); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "GetDataTypesCount = %{public}d", count); - - char stringArray[count][128]; - char *dataTypes[128]; - for (int i = 0; i < count; i++) { - dataTypes[i] = stringArray[i]; - } - returnValue = OH_ArkUI_DragEvent_GetDataTypes(dragEvent, dataTypes, count, MAX_LENGTH); - for (int32_t i = 0; i < count; ++i) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "GetDataTypes result [ %{public}d ] = %{public}s", i, dataTypes[i]); - } - - OH_Udmf_DataProgressListener dataProgressListener = [](OH_Udmf_ProgressInfo *progressInfo, - OH_UdmfData *data) { - int32_t progress = OH_UdmfProgressInfo_GetProgress(progressInfo); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_StartDataLoading progressInfo = %{public}d", progress); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "dataProgressListener callback"); - bool resultUdmf = OH_UdmfData_HasType(data, UDMF_META_GENERAL_FILE); - if (resultUdmf) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_DROP has UDMF_META_GENERAL_FILE"); - unsigned int recordsCount = 0; - OH_UdmfRecord **records = OH_UdmfData_GetRecords(data, &recordsCount); - // 获取records中的元素 - int returnStatus; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "recordsCount = %{public}d", - recordsCount); - for (int i = 0; i < recordsCount; i++) { - // 从OH_UdmfRecord中获取文件类型数据 - OH_UdsFileUri *imageValue = OH_UdsFileUri_Create(); - returnStatus = OH_UdmfRecord_GetFileUri(records[i], imageValue); - const char *fileUri = OH_UdsFileUri_GetFileUri(imageValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "returnStatus = %{public}d fileUri = %{public}s", returnStatus, fileUri); - // 使用结束后销毁指针 - OH_UdsFileUri_Destroy(imageValue); - } - OH_ArkUI_NotifyDragResult(g_requestIdentify, ARKUI_DRAG_RESULT_SUCCESSFUL); - OH_ArkUI_NotifyDragEndPendingDone(g_requestIdentify); - } - }; - OH_UdmfGetDataParams *params = OH_UdmfGetDataParams_Create(); - OH_UdmfGetDataParams_SetFileConflictOptions(params, Udmf_FileConflictOptions::UDMF_OVERWRITE); - OH_UdmfGetDataParams_SetProgressIndicator(params, Udmf_ProgressIndicator::UDMF_DEFAULT); - OH_UdmfGetDataParams_SetDataProgressListener(params, dataProgressListener); - OH_ArkUI_DragEvent_StartDataLoading(dragEvent, params, key, UDMF_KEY_BUFFER_LEN); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_StartDataLoading key = %{public}s", key); - OH_UdmfGetDataParams_Destroy(params); -} - -void GetSecondDragResult(ArkUI_DragEvent* dragEvent) -{ - ArkUI_DragResult result; - OH_ArkUI_DragEvent_GetDragResult(dragEvent, &result); - if (result == ARKUI_DRAG_RESULT_SUCCESSFUL) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "Drag Successful!"); - nodeAPI->resetAttribute(dragImage, NODE_IMAGE_SRC); - SetImageSrc(dropImage, "/resources/seagull.png"); - } else if (result == ARKUI_DRAG_RESULT_FAILED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "Drag Failed!"); - } -} - -void RegisterNodeEventSecondReceiver1(ArkUI_NodeHandle &dragNode) -{ - if (!nodeAPI) { - return; - } - - nodeAPI->addNodeEventReceiver(dragNode, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventSecondReceiver called"); - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); - - auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); - switch (eventType) { - case NODE_ON_PRE_DRAG: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_PRE_DRAG EventReceiver"); - break; - } - case NODE_ON_DRAG_START: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_START EventReceiver"); - SetImageDataLoadParams(dragEvent); - // 预览图尺寸 - float previewRectWidth = OH_ArkUI_DragEvent_GetPreviewRectWidth(dragEvent); - float previewRectHeight = OH_ArkUI_DragEvent_GetPreviewRectHeight(dragEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_DRAG_START previewRectWidth = %{public}f; previewRectHeight = %{public}f", - previewRectWidth, previewRectHeight); - break; - } - case NODE_ON_DRAG_END: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_END EventReceiver"); - GetSecondDragResult(dragEvent); - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); - break; - } - } - }); -} - -void RegisterNodeEventSecondReceiver2(ArkUI_NodeHandle &dropNode) -{ - if (!nodeAPI) { - return; - } - - nodeAPI->addNodeEventReceiver(dropNode, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventSecondReceiver called"); - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "eventType = %{public}d, preDragStatus = %{public}d", - eventType, preDragStatus); - - auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); - switch (eventType) { - case NODE_ON_DROP: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP EventReceiver"); - OH_ArkUI_DragEvent_DisableDefaultDropAnimation(dragEvent, true); - OH_ArkUI_DragEvent_RequestDragEndPending(dragEvent, &g_requestIdentify); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_RequestDragEndPending called"); - StartDataLoadingSecond(dragEvent); - break; - } - case NODE_ON_DRAG_ENTER: { - OH_ArkUI_DragEvent_SetSuggestedDropOperation(dragEvent, ARKUI_DROP_OPERATION_COPY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_ENTER EventReceiver"); - break; - } - case NODE_ON_DRAG_MOVE: { - OH_ArkUI_DragEvent_SetSuggestedDropOperation(dragEvent, ARKUI_DROP_OPERATION_COPY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_MOVE EventReceiver"); - break; - } - case NODE_ON_DRAG_LEAVE: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_LEAVE EventReceiver"); - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); - break; - } - } - }); -} - -void SecondButtonModule(ArkUI_NodeHandle &column) -{ - auto buttonRow = nodeAPI->createNode(ARKUI_NODE_ROW); - nodeAPI->addChild(column, buttonRow); - - auto resetButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetButtonLabel(resetButton, "复位"); - nodeAPI->registerNodeEvent(resetButton, NODE_ON_CLICK_EVENT, 1, nullptr); - nodeAPI->addNodeEventReceiver(resetButton, [](ArkUI_NodeEvent *event) { - nodeAPI->resetAttribute(dropImage, NODE_IMAGE_SRC); - SetImageSrc(dragImage, "/resources/seagull.png"); - }); - nodeAPI->addChild(buttonRow, resetButton); - - auto blank = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetWidth(blank, BLANK_10); - nodeAPI->addChild(buttonRow, blank); - - auto cancelLoadButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetButtonLabel(cancelLoadButton, "取消异步获取拖拽数据"); - nodeAPI->registerNodeEvent(cancelLoadButton, NODE_ON_CLICK_EVENT, 1, nullptr); - nodeAPI->addNodeEventReceiver(cancelLoadButton, [](ArkUI_NodeEvent *event) { - int ret = OH_ArkUI_CancelDataLoading(context, key); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "30079408 button test ret:%{public}s", key); - }); - nodeAPI->addChild(buttonRow, cancelLoadButton); -} - -void SecondModule(ArkUI_NodeHandle &root) -{ - auto column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnJustifyContent(column, ARKUI_FLEX_ALIGNMENT_START); - SetColumnAlignItem(column, ARKUI_HORIZONTAL_ALIGNMENT_START); - SetPadding(column, BLANK_10); - SetBorderWidth(column, BORDER_WIDTH_1); - SetBorderStyle(column, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); - - auto title = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(title, "异步拖拽示例:", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); - nodeAPI->addChild(column, title); - - auto dragRow = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAlignItem(dragRow, ARKUI_VERTICAL_ALIGNMENT_TOP); - - nodeAPI->addChild(column, dragRow); - - // 拖拽图像 - auto dragColumn = nodeAPI->createNode(ARKUI_NODE_COLUMN); - auto dragText = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(dragText, "请长按拖拽图像", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); - dragImage = nodeAPI->createNode(ARKUI_NODE_IMAGE); - SetId(dragImage, "dragImage"); - SetCommonAttribute(dragImage, SIZE_140, SIZE_140, DEFAULT_BG_COLOR, BLANK_5); - SetImageSrc(dragImage, "/resources/seagull.png"); - OH_ArkUI_SetNodeDraggable(dragImage, true); - nodeAPI->registerNodeEvent(dragImage, NODE_ON_PRE_DRAG, 1, nullptr); - nodeAPI->registerNodeEvent(dragImage, NODE_ON_DRAG_START, 1, nullptr); - nodeAPI->registerNodeEvent(dragImage, NODE_ON_DRAG_END, 1, nullptr); - nodeAPI->addChild(dragColumn, dragText); - nodeAPI->addChild(dragColumn, dragImage); - - nodeAPI->addChild(dragRow, dragColumn); - - // 拖拽落入区域 - auto dropColumn = nodeAPI->createNode(ARKUI_NODE_COLUMN); - auto dropText = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(dropText, "拖拽落入区域", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); - dropImage = nodeAPI->createNode(ARKUI_NODE_IMAGE); - SetId(dropImage, "dropImage"); - SetCommonAttribute(dropImage, SIZE_140, SIZE_140, DEFAULT_BG_COLOR, BLANK_5); - SetBorderWidth(dropImage, BORDER_WIDTH_1); - OH_ArkUI_SetNodeDraggable(dropImage, false); - OH_ArkUI_DisableDropDataPrefetchOnNode(dropImage, true); - nodeAPI->registerNodeEvent(dropImage, NODE_ON_DROP, 1, nullptr); - nodeAPI->registerNodeEvent(dropImage, NODE_ON_DRAG_MOVE, 1, nullptr); - nodeAPI->registerNodeEvent(dropImage, NODE_ON_DRAG_ENTER, 1, nullptr); - nodeAPI->registerNodeEvent(dropImage, NODE_ON_DRAG_LEAVE, 1, nullptr); - nodeAPI->addChild(dropColumn, dropText); - nodeAPI->addChild(dropColumn, dropImage); - - nodeAPI->addChild(dragRow, dropColumn); - - SecondButtonModule(column); - - nodeAPI->addChild(root, column); - - RegisterNodeEventSecondReceiver1(dragImage); - RegisterNodeEventSecondReceiver2(dropImage); -} - -} // namespace NativeXComponentSample - -#endif // DRAGANDDROP_SECONDMODULE_H \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/thirdmodule.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/thirdmodule.h deleted file mode 100644 index 483f43c653ca108ecb34c9ad63891215507f4037..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/thirdmodule.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef DRAGANDDROP_THIRDMODULE_H -#define DRAGANDDROP_THIRDMODULE_H - -#include "common.h" -#include "container.h" -#include -#include -#include -#include -#include -#include -namespace NativeXComponentSample { - -ArkUI_NodeHandle dragButton = nullptr; -ArkUI_NodeHandle dropButton = nullptr; - -void DragStatusListener(ArkUI_DragAndDropInfo *info, void *userData) -{ - auto dragStatus = OH_ArkUI_DragAndDropInfo_GetDragStatus(info); - auto dragEvent = OH_ArkUI_DragAndDropInfo_GetDragEvent(info); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "DragStatusListener called"); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "dragStatus = %{public}d, &dragEvent = %{public}p", - dragStatus, dragEvent); -} - -void SetDragActionData() -{ - // 创建OH_UdmfRecord对象 - OH_UdmfRecord *record = OH_UdmfRecord_Create(); - // 向OH_UdmfRecord中添加纯文本类型数据 - OH_UdsPlainText *plainText = OH_UdsPlainText_Create(); - int returnStatus; - OH_UdsPlainText_SetAbstract(plainText, "this is plainText Abstract example"); - OH_UdsPlainText_SetContent(plainText, "this is plainText Content example"); - returnStatus = OH_UdmfRecord_AddPlainText(record, plainText); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfRecord_AddPlainText returnStatus = %{public}d", returnStatus); - // 创建OH_UdmfData对象 - OH_UdmfData *data = OH_UdmfData_Create(); - // 向OH_UdmfData中添加OH_UdmfRecord - returnStatus = OH_UdmfData_AddRecord(data, record); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfData_AddRecord returnStatus = %{public}d", returnStatus); - int returnValue = OH_ArkUI_DragAction_SetData(action, data); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragAction_SetData returnValue = %{public}d", returnValue); - // 注册拖拽状态监听回调 - OH_ArkUI_DragAction_RegisterStatusListener(action, data, &DragStatusListener); -} - -void GetUdmfDataText(ArkUI_DragEvent* dragEvent) -{ - // 获取UDMF data - int returnValue; - // 创建OH_UdmfData对象 - OH_UdmfData *data = OH_UdmfData_Create(); - returnValue = OH_ArkUI_DragEvent_GetUdmfData(dragEvent, data); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_GetUdmfData returnValue = %{public}d", returnValue); - // 判断OH_UdmfData是否有对应的类型 - bool resultUdmf = OH_UdmfData_HasType(data, UDMF_META_PLAIN_TEXT); - if (resultUdmf) { - // 获取OH_UdmfData的记录 - unsigned int recordsCount = 0; - OH_UdmfRecord **records = OH_UdmfData_GetRecords(data, &recordsCount); - // 获取records中的元素 - int returnStatus; - for (int i = 0; i < recordsCount; i++) { - // 从OH_UdmfRecord中获取纯文本类型数据 - OH_UdsPlainText *plainTextValue = OH_UdsPlainText_Create(); - returnStatus = OH_UdmfRecord_GetPlainText(records[i], plainTextValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfRecord_GetPlainText " - "returnStatus= %{public}d", - returnStatus); - auto getAbstract = OH_UdsPlainText_GetAbstract(plainTextValue); - auto getContent = OH_UdsPlainText_GetContent(plainTextValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_UdsPlainText_GetAbstract = " - "%{public}s, OH_UdsPlainText_GetContent = " - "%{public}s", - getAbstract, getContent); - // 使用结束后销毁指针 - OH_UdsPlainText_Destroy(plainTextValue); - } - } else { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_UdmfData_HasType not contain UDMF_META_PLAIN_TEXT"); - } - OH_UdmfData_Destroy(data); -} - -void RegisterNodeEventThirdReceiver1() -{ - if (!nodeAPI) { - return; - } - - nodeAPI->addNodeEventReceiver(dragButton, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventThirdReceiver called"); - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); - - auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); - switch (eventType) { - case NODE_ON_TOUCH_INTERCEPT: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_TOUCH_INTERCEPT EventReceiver"); - // 创建DragAction - action = OH_ArkUI_CreateDragActionWithNode(dragButton); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_CreateDragActionWithNode returnValue = %{public}p", action); - // 设置pixelMap - std::vector pixelVector; - SetPixelMap(pixelVector); - // 设置DragPreviewOption - SetDragPreviewOption(); - // 设置pointerId、touchPoint - PrintDragActionInfos(); - // 设置unifiedData - SetDragActionData(); - // startDrag - int returnValue = OH_ArkUI_StartDrag(action); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_StartDrag returnValue = %{public}d", - returnValue); - OH_ArkUI_DragAction_Dispose(action); - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); - break; - } - } - }); -} - -void RegisterNodeEventThirdReceiver2() -{ - if (!nodeAPI) { - return; - } - - nodeAPI->addNodeEventReceiver(dropButton, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventThirdReceiver called"); - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); - - auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); - switch (eventType) { - case NODE_ON_DROP: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP EventReceiver"); - GetUdmfDataText(dragEvent); - OH_ArkUI_DragAction_UnregisterStatusListener(action); - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); - break; - } - } - }); -} - -void ThirdModule(ArkUI_NodeHandle &root) -{ - auto column3 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnJustifyContent(column3, ARKUI_FLEX_ALIGNMENT_START); - SetColumnAlignItem(column3, ARKUI_HORIZONTAL_ALIGNMENT_START); - SetPadding(column3, BLANK_10); - SetBorderWidth(column3, BORDER_WIDTH_1); - SetBorderStyle(column3, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); - - auto title3 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(title3, "主动发起拖拽示例:", TEXT_FONT_SIZE_15, SIZE_170, SIZE_20); - nodeAPI->addChild(column3, title3); - - auto dragRow = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAlignItem(dragRow, ARKUI_VERTICAL_ALIGNMENT_TOP); - nodeAPI->addChild(column3, dragRow); - - dragButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(dragButton, "dragBt3"); - SetCommonAttribute(dragButton, SIZE_70, SIZE_50, 0xFFFF0000, BLANK_20); - SetButtonLabel(dragButton, "拖起"); - nodeAPI->registerNodeEvent(dragButton, NODE_ON_TOUCH_INTERCEPT, 1, nullptr); - nodeAPI->addChild(dragRow, dragButton); - - dropButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(dropButton, "dropBt3"); - SetCommonAttribute(dropButton, SIZE_140, SIZE_50, 0xFFFF0000, BLANK_20); - SetButtonLabel(dropButton, "拖拽至此处"); - nodeAPI->registerNodeEvent(dropButton, NODE_ON_DROP, 1, nullptr); - nodeAPI->addChild(dragRow, dropButton); - - nodeAPI->addChild(root, column3); - - RegisterNodeEventThirdReceiver1(); - RegisterNodeEventThirdReceiver2(); -} - -} // namespace NativeXComponentSample - -#endif // DRAGANDDROP_THIRDMODULE_H \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NativeDragDrop/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index c5539bddd7a772710f55da0ddd7b5676305469de..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeDragDrop/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NativeDragDrop/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeDragDrop/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeDragDrop/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 45f3c16017e53efdeafcb740d714c0980d9110c5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,78 +0,0 @@ -/* - -Copyright (c) 2025 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 nativeNode from 'libnativeNode.so'; - -@Builder -function title() { - Column() { - Text('拖拽CAPI功能示例') - .fontSize(24) - .fontWeight(FontWeight.Bold) - .margin({ top: 15, bottom: 15 }) - .fontColor(Color.White) - .textAlign(TextAlign.Center) - .width('100%') - } - .width('100%') - .backgroundColor('#0000FF') - .linearGradient({ - angle: 90, - colors: [ - [0x0000FF, 0.0], - [0x4169E1, 1.0] - ] - }) -} - -@Component -struct NativeDragDropExample { - build() { - Column() { - XComponent({ - id: 'dragAndDrop', - type: XComponentType.NODE, - libraryname: 'nativeNode' - }) - .height(1150) - .onAppear(() => { - nativeNode.createNativeNode('dragAndDrop', this.getUIContext()); - }) - } - .backgroundColor('#ffeff5f5') - } -} - -@Entry -@Component -struct Index { - - build() { - Column() { - title() - Scroll() { - Column({space: 10}) { - NativeDragDropExample() - } - .alignItems(HorizontalAlign.Start) - } - .id('scroll') - .layoutWeight(1) - } - .width('100%') - .height('100%') - - } - -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/ets/resources/seagull.png b/ArkUIKit/NativeDragDrop/entry/src/main/ets/resources/seagull.png deleted file mode 100644 index b635c67bc98be553dc2ff2de88f480a6c20f20b1..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDragDrop/entry/src/main/ets/resources/seagull.png and /dev/null differ diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/module.json5 b/ArkUIKit/NativeDragDrop/entry/src/main/module.json5 deleted file mode 100644 index f09d09a7bc661e848418aaf40ba4506a86649bb1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/element/color.json b/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/element/string.json b/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 562ed6da2f6fb6d3a3aa4a5e5a181edea0af6b52..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DragAndDropDemo" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/background.png b/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NativeDragDrop/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 562ed6da2f6fb6d3a3aa4a5e5a181edea0af6b52..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DragAndDropDemo" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NativeDragDrop/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 92421dc7b49fe15f991cf8d7b88d12294808ae78..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DragAndDropDemo" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/mock/mock-config.json5 b/ArkUIKit/NativeDragDrop/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeDragDrop/entry/src/ohosTest/ets/test/DragDropTest.test.ets b/ArkUIKit/NativeDragDrop/entry/src/ohosTest/ets/test/DragDropTest.test.ets deleted file mode 100644 index 45be80ee18dfab33f7f52797baa37fd6e0226a8f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/ohosTest/ets/test/DragDropTest.test.ets +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestType } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON, MouseButton, UiDirection } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -export default function DragDropTest() { - describe('DragDropTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - beforeEach(async () => { - }) - - afterEach(() => { - hilog.info(0x0000, 'DragDropTest', 'DragDrop interface test case completed'); - }) - - afterAll(() => { - hilog.info(0x0000, 'DragDropTest', 'All dragDrop interface tests completed'); - }) - - /** - * @tc.number DragDropTest_001 - * @tc.name testDefaultDrag - * @tc.desc 测试默认拖拽接口 - 测试通用拖拽能力 - */ - it('testDefaultDrag', TestType.FUNCTION, async (done: Function) => { - hilog.info(0x0000, 'DragDropTest', 'testDefaultDrag begin'); - try { - let driver = Driver.create(); - await driver.delayMs(1000); - // 获取拖拽及落入相关组件 - let dragMe = await driver.findComponent(ON.id('dragText_1')); - const unDropArea = await driver.findComponent(ON.id('unDropArea_1')); - const dropArea1 = await driver.findComponent(ON.id('dropArea1_1')); - const unDropArea1 = await driver.findComponent(ON.id('unDropArea1_1')); - const dropArea2 = await driver.findComponent(ON.id('dropArea2_1')); - const unDropArea2 = await driver.findComponent(ON.id('unDropArea2_1')); - const reset = await driver.findComponent(ON.id('reset')); - // 测试拖拽至禁入区域 - await dragMe.dragTo(unDropArea); - // 测试拖拽至可落入区域1 - await dragMe.dragTo(dropArea1); - await reset.click(); - // 测试拖拽至不可落入区域1 - await dragMe.dragTo(unDropArea1); - // 测试拖拽至可落入区域2 - await dragMe.dragTo(dropArea2); - await driver.delayMs(300); - } catch (error) { - hilog.error(0x0000, 'DragDropTest', 'testDefaultDrag failed: %{public}s', error.message); - expect().assertFail(); - } - done(); - hilog.info(0x0000, 'DragDropTest', 'testDefaultDrag end'); - }) - - /** - * @tc.number DragDropTest_002 - * @tc.name testSpringLoadingDrag - * @tc.desc 测试异步加载拖拽接口 - 测试拖拽中的异步加载能力 - */ - it('testSpringLoadingDrag', TestType.FUNCTION, async (done: Function) => { - hilog.info(0x0000, 'DragDropTest', 'testSpringLoadingDrag begin'); - try { - let driver = Driver.create(); - await driver.delayMs(2000); - // 滚动至相应模块 - const scroll = await driver.findComponent(ON.id('scroll')); - expect(scroll == null).assertFalse(); - await scroll.scrollToBottom(6000); - // 发起拖拽 - const dragImage = await driver.findComponent(ON.id('dragImage')); - const dropImage = await driver.findComponent(ON.id('dropImage')); - await dragImage.dragTo(dropImage); - await driver.delayMs(1000); - } catch (error) { - hilog.error(0x0000, 'DragDropTest', 'testSpringLoadingDrag failed: %{public}s', error.message); - expect().assertFail(); - } - done(); - hilog.info(0x0000, 'DragDropTest', 'testSpringLoadingDrag end'); - }) - - /** - * @tc.number DragDropTest_003 - * @tc.name testDragAction - * @tc.desc 测试主动发起拖拽接口 - 测试主动发起拖拽能力 - */ - it('testDragAction', TestType.FUNCTION, async (done: Function) => { - hilog.info(0x0000, 'DragDropTest', 'testDragAction begin'); - try { - let driver = Driver.create(); - await driver.delayMs(2000); - // 滚动至相应模块 - const scroll = await driver.findComponent(ON.id('scroll')); - expect(scroll == null).assertFalse(); - await scroll.scrollToBottom(6000); - // 发起拖拽 - const dragButton = await driver.findComponent(ON.id('dragBt3')); - const dropButton = await driver.findComponent(ON.id('dropBt3')); - await dragButton.dragTo(dropButton); - await driver.delayMs(1000); - } catch (error) { - hilog.error(0x0000, 'DragDropTest', 'testDragAction failed: %{public}s', error.message); - expect().assertFail(); - } - done(); - hilog.info(0x0000, 'DragDropTest', 'testDragAction end'); - }) - - /** - * @tc.number DragDropTest_004 - * @tc.name testSpringLoadingDragAction - * @tc.desc 测试主动发起拖拽的异步加载接口 - 测试主动发起拖拽中异步加载数据的能力 - */ - it('testSpringLoadingDragAction', TestType.FUNCTION, async (done: Function) => { - hilog.info(0x0000, 'DragDropTest', 'testSpringLoadingDragAction begin'); - try { - let driver = Driver.create(); - await driver.delayMs(2000); - // 滚动至相应模块 - const scroll = await driver.findComponent(ON.id('scroll')); - expect(scroll == null).assertFalse(); - await scroll.scrollToBottom(6000); - // 发起拖拽 - const dragButton = await driver.findComponent(ON.id('dragBt4')); - const dropButton = await driver.findComponent(ON.id('dropBt4')); - await dragButton.dragTo(dropButton); - await driver.delayMs(5000); - } catch (error) { - hilog.error(0x0000, 'DragDropTest', 'testSpringLoadingDragAction failed: %{public}s', error.message); - expect().assertFail(); - } - done(); - hilog.info(0x0000, 'DragDropTest', 'testSpringLoadingDragAction end'); - }) - - }) -} diff --git a/ArkUIKit/NativeDragDrop/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NativeDragDrop/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 46d4baef6b48d01dda183441295ada3e712feccf..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 DragDropTest from './DragDropTest.test'; - -export default function testsuite() { - DragDropTest(); -} diff --git a/ArkUIKit/NativeDragDrop/entry/src/ohosTest/module.json5 b/ArkUIKit/NativeDragDrop/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NativeDragDrop/entry/src/test/List.test.ets b/ArkUIKit/NativeDragDrop/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NativeDragDrop/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/hvigor/hvigor-config.json5 b/ArkUIKit/NativeDragDrop/hvigor/hvigor-config.json5 deleted file mode 100644 index bbefea7a134e2f917ca278c2d7c094385972786d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.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*/ - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/hvigorfile.ts b/ArkUIKit/NativeDragDrop/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeDragDrop/oh-package.json5 b/ArkUIKit/NativeDragDrop/oh-package.json5 deleted file mode 100644 index c4a0b97e2e32a745a7841d489da3a9f0739daa93..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/ohTest.md b/ArkUIKit/NativeDragDrop/ohTest.md deleted file mode 100644 index 8fd074413b8f26c485bb3fee98a545438890b3b3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeDragDrop/ohTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# NativeDragDrop 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|------------------------------------------| -------------- |-------------------------------|-------------------------------------------------------| :------- | -------- | -| 通用拖拽示例验证 | 设备正常运行 | 进入首页,在第一个模块中长按拖拽文字 | 文字能够在可拖拽落入区域落入,在不可拖拽落入区域无法落入 | 是 | Pass | -| 异步拖拽示例验证 | 设备正常运行 | 进入首页,在第二个模块中长按拖拽图像 | 图像在拖拽落入区域落入 | 是 | Pass | -| 主动发起拖拽示例验证 | 设备正常运行 | 进入首页,在第三个模块中点击拖起按钮发起拖拽 | 拖拽至“拖拽至此处”按钮,能够打印拖拽成功的日志 | 是 | Pass | -| 主动发起拖拽(异步加载)示例验证 | 设备正常运行 | 进入首页,在第四个模块中点击拖起按钮发起拖拽 | 拖拽至“拖拽至此处”按钮,能够打印拖拽成功的日志 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/screenshots/device/image1.jpg b/ArkUIKit/NativeDragDrop/screenshots/device/image1.jpg deleted file mode 100644 index ea49c55fa13fb27dd05c1e70ccefaed562fe0ead..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeDragDrop/screenshots/device/image1.jpg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/.gitignore b/ArkUIKit/NativeNodeBaseSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NativeNodeBaseSample/AppScope/app.json5 b/ArkUIKit/NativeNodeBaseSample/AppScope/app.json5 deleted file mode 100644 index b20ebf274b647256ab9060f4b17f617cdeb25011..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.native_node_sample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/element/string.json b/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/element/string.json deleted file mode 100644 index de144fc6328cdefd4b32c4a70a3288f1f4606856..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "native_node_sample" - } - ] -} diff --git a/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/media/background.png b/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/media/foreground.png b/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/media/layered_image.json b/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/README.md b/ArkUIKit/NativeNodeBaseSample/README.md deleted file mode 100644 index 7ee39407c7da7607c6405394af9fb195f87528c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/README.md +++ /dev/null @@ -1,181 +0,0 @@ -# Native_node_Sample - -## 介绍 - -本示例展示了如何创建文本、输入框、文本域、Grid、滑动容器、Form表单类、信息选择图片类等组件,配置其样式、属性与事件,还含 UI 任务、反色设置,可见区域变化监听等功能,构建文本页面。该工程中展示的接口详细描述可查如下链接: - -[native_node.h](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/capi-native-node-h) - -## 效果预览 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
首页TextSwiperWaterFlowGridScrollRefreshListXComponentPublicForm表单类信息选择图片类
- -## 使用说明 -1. 安装编译生成的hap包,并打开应用; -2. 进入首页,可选择不同模块页面。 -3. 点击Text选择框进入Text组件的CAPI接口展示界面; -4. 点击Swiper选择框进入Swiper组件的CAPI接口展示界面; -5. 点击Public选择框进入通用属性的CAPI接口展示界面; -6. 点击"Form表单类"选择框进入表单组件的CAPI接口展示界面;
- a.点击“选择节点类型”按钮选择要创建的组件类型,如“TOGGLE”
- b.点击"创建"按钮进行节点创建,当前状态会显示创建成功
- c.点击下边“选择节点属性”,先选择对应节点类型,如“TOGGLE”,再选择要设置的属性类型
- d.点击“设置属性值”,进行属性设置;点击“获取属性值”,返回值文本框中可以显示当前属性值;点击“重置属性值”会进行属性重置
- e.点击“清理”清理已创建“TOGGLE”节点。 -7. 点击"信息选择图片类"选择框进入多个组件的CAPI接口展示界面;属性值设置为“none”时,图片效果以代码默认值展示。 - "信息选择图片类"界面使用步骤如下:
- a.点击“选择节点类型”按钮选择要创建的组件类型,如“IMAGE_SPAN”
- b.点击"创建"按钮进行节点创建,当前状态会显示创建成功
- c.点击下边“选择节点属性”,先选择对应节点类型,如“IMAGE_SPAN”,再选择要设置的属性类型
- d.点击“设置属性值”,进行属性设置;点击“获取属性值”,返回值文本框中可以显示当前属性值;点击“重置属性值”会进行属性重置
- e.创建DatePicker、TimePicker、TextPicker、CalendarPicker组件时,会自动触发相关事件注册, - 可以在DevEco Studio开发环境中的日志界面看到如下相关日志信息: -``` -"BIND_EVENT success" -``` - -## 工程目录 - -``` -native_node_sample -entry/src/main/cpp/ -├── ArkUINode.h -├── ArkUINodeAdapter.h -├── baseUtils.cpp -├── baseUtils.h -├── CMakeLists.txt (CMake脚本) -├── form_manager.cpp -├── form_manager.h -├── GridMaker.cpp -├── GridMaker.h -├── imagespan_manager.cpp -├── imagespan_manager.h -├── ListItemGroup.h -├── ListItemSwipe.h -├── ListMaker.cpp -├── ListMaker.h -├── manager.cpp -├── manager.h -├── napi_init.cpp -├── PublicEvent.cpp -├── PublicEvent.h -├── RefreshMaker.cpp -├── RefreshMaker.h -├── ScrollEvent.h -├── ScrollMaker.cpp -├── ScrollMaker.h -├── ScrollUtils.cpp -├── ScrollUtils.h -├── SwiperMaker.cpp -├── SwiperMaker.h -├── TextMaker.cpp -├── TextMaker.h -├── WaterFlowMaker.cpp -├── WaterFlowMaker.h -├── WaterFlowSection.h -├── XComponentMaker.cpp -└── XComponentMaker.h - └── types/libentry - ├── Index.d.ts (函数对应的js映射) - └── oh-package.json5 - -entry/src/main/ets/ -├── entryability -│ └── EntryAbility.ets -├── entrybackupability -│ └── EntryBackupAbility.ets -└── pages - ├── Index.ets (获取导航页面) - ├── page_form.ets (Form页面) - ├── page_grid.ets (Grid页面) - ├── page_imagespan.ets (imagespan页面) - ├── page_list.ets (List页面) - ├── page_refresh.ets (Refresh页面) - ├── page_scroll.ets (Scroll页面) - ├── page_swiper.ets (Swiper页面) - ├── page_text.ets (文本界面) - ├──page_xcomponent.ets (XComponent界面) - ├── page_waterflow.ets (WaterFlow界面) - ├──page_waterflow.ets (WaterFlow界面) - └── page_public_event.ets (通用属性界面) - -entry/src/main/resources/ -├── base -│ ├── element -│ │ ├── color.json -│ │ ├── float.json -│ │ └── string.json -│ ├── media -│ │ ├── background.png -│ │ ├── foreground.png -│ │ ├── layered_image.json -│ │ └── startIcon.png -│ └── profile -│ ├── backup_config.json -│ └── main_pages.json -├── dark -│ └── element -│ └── color.json -└── rawfile - -entry/src/ohosTest/ets/test -├── Ability.test.ets -├── List.test.ets -└── Public.test.ets (通用属性测试用例) -``` - -## 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束和限制 - -1. 本示例支持标准系统上运行,支持设备:RK3568; - -2. 本示例支持API22版本SDK,版本号:6.0.2.54; - -3. 本示例已支持使DevEco Studio 5.1.1 Release (构建版本:5.1.1.840,构建 2025年9月20日)编译运行 - -## 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/native_node_sample > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/build-profile.json5 b/ArkUIKit/NativeNodeBaseSample/build-profile.json5 deleted file mode 100644 index 1eb917dd7d248b87bfad3f1556dca74d57166c6d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "6.0.0(22)", - "compatibleSdkVersion": "6.0.0(22)", - "targetSdkVersion": "6.0.0(22)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/code-linter.json5 b/ArkUIKit/NativeNodeBaseSample/code-linter.json5 deleted file mode 100644 index 4c531be90a6c875995767bd87f2de3cbd6b55160..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/.gitignore b/ArkUIKit/NativeNodeBaseSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/build-profile.json5 b/ArkUIKit/NativeNodeBaseSample/entry/build-profile.json5 deleted file mode 100644 index cde7025c2f1abfabf3018c66ae28c544ed107210..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a", "x86_64" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/hvigorfile.ts b/ArkUIKit/NativeNodeBaseSample/entry/hvigorfile.ts deleted file mode 100644 index 10f881f112b08550ed5c8a3ceb7d0148be2a0b6e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/obfuscation-rules.txt b/ArkUIKit/NativeNodeBaseSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NativeNodeBaseSample/entry/oh-package.json5 b/ArkUIKit/NativeNodeBaseSample/entry/oh-package.json5 deleted file mode 100644 index 9f254ab4d0e3a4de30318e04483b785b552ce977..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/AccessibilityMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/AccessibilityMaker.cpp deleted file mode 100644 index 99c94a69ca54d79d580debb8231eb399a605977e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/AccessibilityMaker.cpp +++ /dev/null @@ -1,680 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include -#include -#include "AccessibilityMaker.h" - -constexpr int32_t ACCESSIBILITY_VALUE_MIN = 0; -constexpr int32_t ACCESSIBILITY_VALUE_MAX = 100; -constexpr int32_t ACCESSIBILITY_VALUE_CURRENT = 50; -constexpr const char* ACCESSIBILITY_VALUE_TEXT = "Value"; -constexpr int32_t ACCESSIBILITY_RANGE_MIN = 0; -constexpr int32_t ACCESSIBILITY_RANGE_MAX = 10; -constexpr int32_t ACCESSIBILITY_RANGE_CURRENT = 5; -constexpr float COL_WIDTH_PX = 300.0f; -constexpr float TEXT_WIDTH_PX = 300.0f; -constexpr float TEXT_HEIGHT_PX = 100.0f; -constexpr float BORDER_WIDTH_PX = 1.0f; -constexpr float BUTTON_WIDTH_PX = 200.0f; -constexpr float BUTTON_HEIGHT_PX = 50.0f; -constexpr float BUTTON_MARGIN_PX = 5.0f; -constexpr int EVENT_ID = 11111; -constexpr const char* SAMPLE_TEXT = "Hello Accessibility Sample"; -static ArkUI_AccessibilityState* accessibilityState_; -static ArkUI_AccessibilityValue* accessibilityValue_; - -void AccessibilityMaker::CreateAccessibilitySelectedSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "1. 通过 OH_ArkUI_AccessibilityState_SetSelected 设置无障碍状态:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, "Hello Accessibility Sample(non-selected)"); - ArkUI_NodeHandle text3 = BuildTextNode(nodeApi, "Hello Accessibility Sample(selected)"); - CreateAccessibilityState(); - SetAccessibilityDisabled(false); - bool disabled = IsAccessibilityDisabled(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "IsAccessibilityDisabled: disabled=%{public}d", - disabled); - SetAccessibilitySelected(true); - bool selected = IsAccessibilitySelected(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "IsAccessibilitySelected: selected=%{public}d", - selected); - ArkUI_AttributeItem accessibilityItem = { .object = accessibilityState_ }; - nodeApi->setAttribute(text3, NODE_ACCESSIBILITY_STATE, &accessibilityItem); - SetAccessibilitySelected(false); - accessibilityItem = { .object = accessibilityState_ }; - nodeApi->setAttribute(text2, NODE_ACCESSIBILITY_STATE, &accessibilityItem); - nodeApi->addChild(column, text2); - nodeApi->addChild(column, text3); - nodeApi->addChild(parent, column); -} - -void AccessibilityMaker::CreateAccessibilityCheckedSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "2. 通过 OH_ArkUI_AccessibilityState_SetCheckedState 设置无障碍状态:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - ArkUI_NodeHandle checkbox = nodeApi->createNode(ARKUI_NODE_CHECKBOX); - ArkUI_NodeHandle checkbox2 = nodeApi->createNode(ARKUI_NODE_CHECKBOX); - CreateAccessibilityState(); - SetAccessibilityDisabled(false); - bool disabled = IsAccessibilityDisabled(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "IsAccessibilityDisabled: disabled=%{public}d", - disabled); - SetAccessibilityCheckedState(ARKUI_ACCESSIBILITY_UNCHECKED); - int32_t checkedState = GetAccessibilityCheckedState(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityCheckedState: state=%{public}d", - checkedState); - ArkUI_AttributeItem accessibilityItem = { .object = accessibilityState_ }; - nodeApi->setAttribute(parent, NODE_ACCESSIBILITY_STATE, &accessibilityItem); - SetAccessibilityCheckedState(ARKUI_ACCESSIBILITY_CHECKED); - accessibilityItem = { .object = accessibilityState_ }; - nodeApi->setAttribute(checkbox2, NODE_ACCESSIBILITY_STATE, &accessibilityItem); - nodeApi->addChild(column, checkbox); - nodeApi->addChild(column, checkbox2); - nodeApi->addChild(parent, column); -} - -void AccessibilityMaker::CreateAccessibilityValueSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "3. 通过 NODE_ACCESSIBILITY_VALUE 设置无障碍信息属性:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - CreateAccessibilityValue(); - SetAccessibilityValueMin(ACCESSIBILITY_VALUE_MIN); - int32_t valueMin = GetAccessibilityValueMin(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityValueMin: min=%{public}d", valueMin); - SetAccessibilityValueMax(ACCESSIBILITY_VALUE_MAX); - int32_t valueMax = GetAccessibilityValueMax(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityValueMax: max=%{public}d", valueMax); - SetAccessibilityValueCurrent(ACCESSIBILITY_VALUE_CURRENT); - int32_t valueCurrent = GetAccessibilityValueCurrent(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityValueCurrent: current=%{public}d", - valueCurrent); - SetAccessibilityValueText(ACCESSIBILITY_VALUE_TEXT); - const char* valueText = GetAccessibilityValueText(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityValueText: text=%{public}s", - valueText); - SetAccessibilityRangeMin(ACCESSIBILITY_RANGE_MIN); - int32_t rangeMin = GetAccessibilityRangeMin(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityRangeMin: min=%{public}d", rangeMin); - SetAccessibilityRangeMax(ACCESSIBILITY_RANGE_MAX); - int32_t rangeMax = GetAccessibilityValueMax(); - rangeMax = GetAccessibilityRangeMax(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityRangeMax: max=%{public}d", rangeMax); - SetAccessibilityRangeCurrent(ACCESSIBILITY_RANGE_CURRENT); - int32_t rangeCurrent = GetAccessibilityRangeCurrent(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityRangeCurrent: current=%{public}d", - rangeCurrent); - ArkUI_AttributeItem accessibilityValueItem = { .object = accessibilityValue_ }; - nodeApi->setAttribute(text2, NODE_ACCESSIBILITY_VALUE, &accessibilityValueItem); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityNodeIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, "4. 通过 NODE_ID 获取无障碍节点ID:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - SetNodeId(nodeApi, text2, "test node id"); - const char* nodeId = GetNodeId(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetNodeId: id=%{public}s", nodeId); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityGroupSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "5. 通过 NODE_ACCESSIBILITY_GROUP 设置无障碍分组:"); - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, "column子节点1"); - ArkUI_NodeHandle text3 = BuildTextNode(nodeApi, "column子节点2"); - SetAccessibilityGroup(nodeApi, column, true); - bool isGroup = GetAccessibilityGroup(nodeApi, column); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityGroup: isGroup=%{public}d", isGroup); - nodeApi->addChild(column, text2); - nodeApi->addChild(column, text3); - nodeApi->addChild(parent, text1); - nodeApi->addChild(parent, column); -} - -void AccessibilityMaker::CreateAccessibilityModeSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "6. 通过 NODE_ACCESSIBILITY_MODE 设置无障碍辅助服务模式(ACCESSIBILITY_MODE):"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, "Hello Accessibility Sample(DISABLED, 不可被无障碍辅助服务所识别)"); - SetAccessibilityMode(nodeApi, text2, ARKUI_ACCESSIBILITY_MODE_DISABLED); - ArkUI_AccessibilityMode mode = GetAccessibilityMode(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityMode: mode=%{public}d", mode); - nodeApi->addChild(parent, text2); -} - - -void AccessibilityMaker::CreateAccessibilityTextSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "7. 通过 NODE_ACCESSIBILITY_TEXT 设置无障碍文本:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - SetAccessibilityText(nodeApi, text2, "This is a text"); - const char* accessibilityText = GetAccessibilityText(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityText: text=%{public}s", - accessibilityText); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityDescriptionSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "8. 通过 NODE_ACCESSIBILITY_DESCRIPTION 设置无障碍描述:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - SetAccessibilityDescription(nodeApi, text2, "This is accessibility description"); - const char* description = GetAccessibilityDescription(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityDescription: description=%{public}s", - description); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "9. 通过 NODE_ACCESSIBILITY_ID 获取无障碍ID:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - int accessibilityId = GetAccessibilityId(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityId: id=%{public}d", accessibilityId); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityActionsSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, "10. 设置无障碍支持操作事件:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle button = nodeApi->createNode(ARKUI_NODE_BUTTON); - ArkUI_NumberValue button_widthValue[] = {BUTTON_WIDTH_PX}; - ArkUI_AttributeItem button_widthItem = {button_widthValue, 1}; - ArkUI_NumberValue button_heightValue1[] = {BUTTON_HEIGHT_PX}; - ArkUI_AttributeItem button_heightItem = {button_heightValue1, 1}; - ArkUI_NumberValue marginValue[] = {BUTTON_MARGIN_PX}; - ArkUI_AttributeItem marginItem = {marginValue, 1}; - nodeApi->setAttribute(button, NODE_WIDTH, &button_widthItem); - nodeApi->setAttribute(button, NODE_HEIGHT, &button_heightItem); - nodeApi->setAttribute(button, NODE_MARGIN, &marginItem); - SetAccessibilityActions(nodeApi, button); - nodeApi->registerNodeEvent(button, NODE_ON_CLICK, 0, nullptr); - nodeApi->registerNodeEvent(button, NODE_ON_ACCESSIBILITY_ACTIONS, EVENT_ID, nullptr); - nodeApi->registerNodeEventReceiver([](ArkUI_NodeEvent *event) { - auto eventId = OH_ArkUI_NodeEvent_GetTargetId(event); - if (eventId == EVENT_ID) { - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - auto actionType = componentEvent->data[0].u32; - switch (actionType) { - case ARKUI_ACCESSIBILITY_ACTION_CLICK: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ARKUI_ACCESSIBILITY_ACTION_CLICK"); - break; - default: - break; - } - } - }); - nodeApi->addChild(parent, button); -} - -void AccessibilityMaker::CreateAccessibilityRoleSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "11. 通过 NODE_ACCESSIBILITY_ROLE 设置无障碍组件类型:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - SetAccessibilityRole(nodeApi, text2, ARKUI_NODE_TEXT); - uint32_t role = GetAccessibilityRole(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityRole: role=%{public}u", role); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateUniqueIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "12. 通过 NODE_UNIQUE_ID 获取唯一ID:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - GetUniqueId(nodeApi, text2); - nodeApi->addChild(parent, text2); -} - -ArkUI_NodeHandle AccessibilityMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return nullptr; - } - // 创建一个Column容器组件 - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - // 创建Text组件 - ArkUI_NodeHandle text = BuildTextNode(nodeApi, SAMPLE_TEXT); - - auto scrollNode = nodeApi->createNode(ARKUI_NODE_SCROLL); - nodeApi->addChild(scrollNode, column); - - CreateAccessibilitySelectedSection(nodeApi, column); - CreateAccessibilityCheckedSection(nodeApi, column); - CreateAccessibilityValueSection(nodeApi, column); - CreateAccessibilityNodeIdSection(nodeApi, column); - CreateAccessibilityGroupSection(nodeApi, column); - CreateAccessibilityModeSection(nodeApi, column); - CreateAccessibilityTextSection(nodeApi, column); - CreateAccessibilityDescriptionSection(nodeApi, column); - CreateAccessibilityIdSection(nodeApi, column); - CreateAccessibilityActionsSection(nodeApi, column); - CreateAccessibilityRoleSection(nodeApi, column); - CreateUniqueIdSection(nodeApi, column); - - // Column作为XComponent子组件 - return scrollNode; -} - -ArkUI_NodeHandle AccessibilityMaker::BuildTextNodeWithoutAccessibilityFocus(ArkUI_NativeNodeAPI_1* nodeApi, - const char* content) -{ - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = TEXT_WIDTH_PX}}; - ArkUI_AttributeItem textWidthItem = { textWidth, sizeof(textWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = TEXT_HEIGHT_PX}}; - ArkUI_AttributeItem textHeightItem = { textHeight, sizeof(textHeight) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - ArkUI_AttributeItem valueItem = {.string = content}; - nodeApi->setAttribute(text, NODE_TEXT_CONTENT, &valueItem); - SetAccessibilityMode(nodeApi, text, ARKUI_ACCESSIBILITY_MODE_DISABLED); - return text; -} -ArkUI_NodeHandle AccessibilityMaker::BuildTextNode(ArkUI_NativeNodeAPI_1* nodeApi, const char* content) -{ - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = TEXT_WIDTH_PX}}; - ArkUI_AttributeItem textWidthItem = { textWidth, sizeof(textWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = TEXT_HEIGHT_PX}}; - ArkUI_AttributeItem textHeightItem = { textHeight, sizeof(textHeight) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - ArkUI_AttributeItem valueItem = {.string = content}; - nodeApi->setAttribute(text, NODE_TEXT_CONTENT, &valueItem); - return text; -} - -ArkUI_NodeHandle AccessibilityMaker::BuildColumnNode(ArkUI_NativeNodeAPI_1* nodeApi) -{ - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = COL_WIDTH_PX}}; - ArkUI_AttributeItem widthItem = { colWidth, sizeof(colWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - return column; -} - -AccessibilityMaker::~AccessibilityMaker() -{ - DisposeAccessibilityState(); - DisposeAccessibilityValue(); -} - -void AccessibilityMaker::CreateAccessibilityState() -{ - if (!accessibilityState_) { - accessibilityState_ = OH_ArkUI_AccessibilityState_Create(); - } -} - -void AccessibilityMaker::SetAccessibilityDisabled(bool isDisabled) -{ - if (accessibilityState_) { - OH_ArkUI_AccessibilityState_SetDisabled(accessibilityState_, isDisabled); - } -} - -bool AccessibilityMaker::IsAccessibilityDisabled() -{ - if (accessibilityState_) { - return OH_ArkUI_AccessibilityState_IsDisabled(accessibilityState_); - } - return false; -} - -void AccessibilityMaker::SetAccessibilitySelected(bool isSelected) -{ - if (accessibilityState_) { - OH_ArkUI_AccessibilityState_SetSelected(accessibilityState_, isSelected); - } -} - -bool AccessibilityMaker::IsAccessibilitySelected() -{ - if (accessibilityState_) { - return OH_ArkUI_AccessibilityState_IsSelected(accessibilityState_); - } - return false; -} - -void AccessibilityMaker::SetAccessibilityCheckedState(int32_t checkedState) -{ - if (accessibilityState_) { - OH_ArkUI_AccessibilityState_SetCheckedState(accessibilityState_, checkedState); - } -} - -int32_t AccessibilityMaker::GetAccessibilityCheckedState() -{ - if (accessibilityState_) { - return OH_ArkUI_AccessibilityState_GetCheckedState(accessibilityState_); - } - return 0; -} - -void AccessibilityMaker::DisposeAccessibilityState() -{ - if (accessibilityState_) { - OH_ArkUI_AccessibilityState_Dispose(accessibilityState_); - accessibilityState_ = nullptr; - } -} - -void AccessibilityMaker::CreateAccessibilityValue() -{ - if (!accessibilityValue_) { - accessibilityValue_ = OH_ArkUI_AccessibilityValue_Create(); - } -} - -void AccessibilityMaker::DisposeAccessibilityValue() -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_Dispose(accessibilityValue_); - accessibilityValue_ = nullptr; - } -} - -void AccessibilityMaker::SetAccessibilityValueMin(int32_t min) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetMin(accessibilityValue_, min); - } -} - -int32_t AccessibilityMaker::GetAccessibilityValueMin() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetMin(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityValueMax(int32_t max) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetMax(accessibilityValue_, max); - } -} - -int32_t AccessibilityMaker::GetAccessibilityValueMax() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetMax(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityValueCurrent(int32_t current) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetCurrent(accessibilityValue_, current); - } -} - -int32_t AccessibilityMaker::GetAccessibilityValueCurrent() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetCurrent(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityValueText(const char* text) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetText(accessibilityValue_, text); - } -} - -const char* AccessibilityMaker::GetAccessibilityValueText() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetText(accessibilityValue_); - } - return nullptr; -} - -void AccessibilityMaker::SetAccessibilityRangeMin(int32_t rangeMin) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetRangeMin(accessibilityValue_, rangeMin); - } -} - -int32_t AccessibilityMaker::GetAccessibilityRangeMin() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetRangeMin(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityRangeMax(int32_t rangeMax) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetRangeMax(accessibilityValue_, rangeMax); - } -} - -int32_t AccessibilityMaker::GetAccessibilityRangeMax() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetRangeMax(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityRangeCurrent(int32_t rangeCurrent) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetRangeCurrent(accessibilityValue_, rangeCurrent); - } -} - -int32_t AccessibilityMaker::GetAccessibilityRangeCurrent() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetRangeCurrent(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetNodeId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const char* id) -{ - if (nodeApi && node) { - ArkUI_AttributeItem idItem = {.string = id}; - nodeApi->setAttribute(node, NODE_ID, &idItem); - } -} - -const char* AccessibilityMaker::GetNodeId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attributeItem = nodeApi->getAttribute(node, NODE_ID); - if (attributeItem) { - return attributeItem->string; - } - } - return nullptr; -} - -void AccessibilityMaker::SetAccessibilityGroup(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, bool isGroup) -{ - if (nodeApi && node) { - ArkUI_NumberValue value[] = {{.i32 = isGroup}}; - ArkUI_AttributeItem item = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_GROUP, &item); - } -} - -bool AccessibilityMaker::GetAccessibilityGroup(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attributeItem = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_GROUP); - if (attributeItem) { - return attributeItem->value[0].i32; - } - } - return false; -} - -void AccessibilityMaker::SetAccessibilityMode(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - ArkUI_AccessibilityMode mode) -{ - if (nodeApi && node) { - ArkUI_NumberValue value[] = {{.i32 = mode}}; - ArkUI_AttributeItem item = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_MODE, &item); - } -} - -ArkUI_AccessibilityMode AccessibilityMaker::GetAccessibilityMode(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_MODE); - if (attr && attr->size > 0) { - return static_cast(attr->value[0].i32); - } - } - return ARKUI_ACCESSIBILITY_MODE_AUTO; -} - -void AccessibilityMaker::SetAccessibilityDescription(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - const char* description) -{ - if (nodeApi && node) { - ArkUI_AttributeItem item = {.string = description}; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_DESCRIPTION, &item); - } -} - -const char* AccessibilityMaker::GetAccessibilityDescription(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_DESCRIPTION); - if (attr) { - return attr->string; - } - } - return nullptr; -} - -int AccessibilityMaker::GetAccessibilityId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_ID); - if (attr && attr->size > 0) { - return attr->value[0].i32; - } - } - return -1; -} - -void AccessibilityMaker::SetAccessibilityText(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const char* text) -{ - if (nodeApi && node) { - ArkUI_AttributeItem item = {.string = text}; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_TEXT, &item); - } -} - -const char* AccessibilityMaker::GetAccessibilityText(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_TEXT); - if (attr) { - return attr->string; - } - } - return nullptr; -} - -void AccessibilityMaker::SetAccessibilityActions(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - ArkUI_NumberValue value[] = {{ .u32 = ARKUI_ACCESSIBILITY_ACTION_CLICK}}; - ArkUI_AttributeItem item = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_ACTIONS, &item); - } -} - -uint32_t AccessibilityMaker::GetAccessibilityActions(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_ACTIONS); - if (attr && attr->size > 0) { - return attr->value[0].u32; - } - } - return 0U; -} - -void AccessibilityMaker::SetAccessibilityRole(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - const uint32_t role) -{ - if (nodeApi && node) { - ArkUI_NumberValue value[] = {{ .u32 = role}}; - ArkUI_AttributeItem item = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_ROLE, &item); - } -} - -uint32_t AccessibilityMaker::GetAccessibilityRole(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_ROLE); - if (attr && attr->size > 0) { - return attr->value[0].u32; - } - } - return 0U; -} - -void AccessibilityMaker::GetUniqueId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem *attributeItem = nodeApi->getAttribute(node, NODE_UNIQUE_ID); - // 组件id作为targetid来区分不同组件的事件。 - auto id = attributeItem->value[0].i32; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetUniqueId: id=%{public}d", id); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/AccessibilityMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/AccessibilityMaker.h deleted file mode 100644 index 7b92b4a8a34bb1172c7b1139c38b95b227848fbd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/AccessibilityMaker.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_NODE_SAMPLE_ACCESSIBILITYMAKER_H -#define NATIVE_NODE_SAMPLE_ACCESSIBILITYMAKER_H - -#include -#include -#include -#include -#include "manager.h" - -class AccessibilityMaker { -public: - AccessibilityMaker(){}; - ~AccessibilityMaker(); - static ArkUI_NodeHandle CreateNativeNode(); - static ArkUI_NodeHandle BuildTextNode(ArkUI_NativeNodeAPI_1* nodeApi, const char* content); - static ArkUI_NodeHandle BuildTextNodeWithoutAccessibilityFocus(ArkUI_NativeNodeAPI_1* nodeApi, const char* content); - static void CreateAccessibilityState(); - static void SetAccessibilityDisabled(bool isDisabled); - static bool IsAccessibilityDisabled(); - static void SetAccessibilitySelected(bool isSelected); - static bool IsAccessibilitySelected(); - static void SetAccessibilityCheckedState(int32_t checkedState); - static int32_t GetAccessibilityCheckedState(); - static void DisposeAccessibilityState(); - static ArkUI_NodeHandle BuildColumnNode(ArkUI_NativeNodeAPI_1* nodeApi); - static void CreateAccessibilityValue(); - static void DisposeAccessibilityValue(); - static void SetAccessibilityValueMin(int32_t min); - static int32_t GetAccessibilityValueMin(); - static void SetAccessibilityValueMax(int32_t max); - static int32_t GetAccessibilityValueMax(); - static void SetAccessibilityValueCurrent(int32_t current); - static int32_t GetAccessibilityValueCurrent(); - static void SetAccessibilityValueText(const char* text); - static const char* GetAccessibilityValueText(); - static void SetAccessibilityRangeMin(int32_t rangeMin); - static int32_t GetAccessibilityRangeMin(); - static void SetAccessibilityRangeMax(int32_t rangeMax); - static int32_t GetAccessibilityRangeMax(); - static void SetAccessibilityRangeCurrent(int32_t rangeCurrent); - static int32_t GetAccessibilityRangeCurrent(); - static void SetNodeId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const char* id); - static const char* GetNodeId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityGroup(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, bool isGroup); - static bool GetAccessibilityGroup(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityMode(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - ArkUI_AccessibilityMode mode); - static ArkUI_AccessibilityMode GetAccessibilityMode(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityText(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const char* text); - static const char* GetAccessibilityText(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityDescription(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - const char* description); - static const char* GetAccessibilityDescription(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static int GetAccessibilityId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityActions(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static uint32_t GetAccessibilityActions(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityRole(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const uint32_t role); - static uint32_t GetAccessibilityRole(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void GetUniqueId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void CreateAccessibilityCheckedSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilitySelectedSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityValueSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityNodeIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityGroupSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityModeSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityTextSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityDescriptionSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityActionsSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityRoleSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateUniqueIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void OnErrorCallback(int32_t code, const char* name, const char* message); - static void OnTerminatedCallback(int32_t code, AbilityBase_Want* want); -}; - -#endif // NATIVE_NODE_SAMPLE_ACCESSIBILITYMAKER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ArkUINodeAdapter.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ArkUINodeAdapter.h deleted file mode 100644 index e8b0da0a9df3c39f28b104460cd1e993ba51800f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ArkUINodeAdapter.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef ARKUINODEADAPTER_H -#define ARKUINODEADAPTER_H - -#include -#include -#include - -#include -#include -#include - -#include "ScrollableUtils.h" - -/** - * 通用 NodeAdapter 封装 - */ -struct NodeAdapterCallbacks { - std::function getTotalCount; - std::function getStableId; - std::function onCreate; - std::function onBind; - std::function onRecycle; -}; - -class ArkUINodeAdapter { -public: - using Callbacks = NodeAdapterCallbacks; - - ArkUINodeAdapter() : placeholderNodeType_(kInvalidNodeType) { InitializeApiAndAdapter(); } - - explicit ArkUINodeAdapter(int32_t placeholderNodeType) : placeholderNodeType_(placeholderNodeType) - { - InitializeApiAndAdapter(); - } - - ~ArkUINodeAdapter() - { - ClearNodeCache(); - OH_ArkUI_NodeAdapter_UnregisterEventReceiver(adapterHandle_); - OH_ArkUI_NodeAdapter_Dispose(adapterHandle_); - adapterHandle_ = nullptr; - } - - ArkUI_NodeAdapterHandle GetAdapter() const { return adapterHandle_; } - - void SetPlaceholderType(int32_t placeholderNodeType) { placeholderNodeType_ = placeholderNodeType; } - - void EnsurePlaceholderTypeOr(int32_t fallbackNodeType) - { - if (placeholderNodeType_ < 0) { - placeholderNodeType_ = fallbackNodeType; - } - } - - void SetCallbacks(const NodeAdapterCallbacks &callbacks) - { - callbacks_ = callbacks; - SynchronizeItemCount(GetTotalItemCount()); - } - - // ======================================== - // 数据变动通知接口 - // ======================================== - void ReloadAllItems() { OH_ArkUI_NodeAdapter_ReloadAllItems(adapterHandle_); } - - void InsertRange(int32_t index, int32_t count) - { - if (count <= 0) { - return; - } - int32_t validIndex = ClampIndexToRange(index, GetTotalItemCount()); - OH_ArkUI_NodeAdapter_InsertItem(adapterHandle_, validIndex, count); - SynchronizeItemCount(GetTotalItemCount()); - } - - void RemoveRange(int32_t index, int32_t count) - { - if (count <= 0) { - return; - } - if (!IsValidIndex(index, GetTotalItemCount())) { - return; - } - OH_ArkUI_NodeAdapter_RemoveItem(adapterHandle_, index, count); - SynchronizeItemCount(GetTotalItemCount()); - } - -protected: - // ======================================== - // 事件分发处理 - // ======================================== - static void OnStaticEvent(ArkUI_NodeAdapterEvent *event) - { - auto *self = reinterpret_cast(OH_ArkUI_NodeAdapterEvent_GetUserData(event)); - if (IsNotNull(self)) { - self->OnEvent(event); - } - } - - void OnEvent(ArkUI_NodeAdapterEvent *event) - { - const int32_t eventType = OH_ArkUI_NodeAdapterEvent_GetType(event); - switch (eventType) { - case NODE_ADAPTER_EVENT_ON_GET_NODE_ID: { - HandleGetNodeId(event); - break; - } - case NODE_ADAPTER_EVENT_ON_ADD_NODE_TO_ADAPTER: { - HandleAddNodeToAdapter(event); - break; - } - case NODE_ADAPTER_EVENT_ON_REMOVE_NODE_FROM_ADAPTER: { - HandleRemoveNodeFromAdapter(event); - break; - } - default: { - break; - } - } - } - -private: - // ======================================== - // 私有常量和工具方法 - // ======================================== - static constexpr int32_t kInvalidNodeType = -1; - - void InitializeApiAndAdapter() - { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeApi_); - adapterHandle_ = OH_ArkUI_NodeAdapter_Create(); - OH_ArkUI_NodeAdapter_RegisterEventReceiver(adapterHandle_, this, &ArkUINodeAdapter::OnStaticEvent); - SynchronizeItemCount(GetTotalItemCount()); - } - - void ClearNodeCache() - { - while (!nodeCache_.empty()) { - nodeCache_.pop(); - } - } - - int32_t GetTotalItemCount() const - { - if (callbacks_.getTotalCount) { - return callbacks_.getTotalCount(); - } - return 0; - } - - int32_t ClampIndexToRange(int32_t index, int32_t maxCount) const - { - if (index < 0) { - return 0; - } - if (index > maxCount) { - return maxCount; - } - return index; - } - - void SynchronizeItemCount(int32_t count) - { - OH_ArkUI_NodeAdapter_SetTotalNodeCount(adapterHandle_, static_cast(count)); - } - - ArkUI_NodeHandle PopFromCacheOrCreate(int32_t index) - { - if (!nodeCache_.empty()) { - ArkUI_NodeHandle handle = nodeCache_.top(); - nodeCache_.pop(); - return handle; - } - if (callbacks_.onCreate) { - return callbacks_.onCreate(nodeApi_, index); - } - const ArkUI_NodeType nodeType = (placeholderNodeType_ >= 0) ? static_cast(placeholderNodeType_) - : ARKUI_NODE_LIST_ITEM; - return nodeApi_->createNode(nodeType); - } - - // ======================================== - // 事件处理实现 - // ======================================== - void HandleGetNodeId(ArkUI_NodeAdapterEvent *event) - { - const int32_t index = OH_ArkUI_NodeAdapterEvent_GetItemIndex(event); - uint64_t nodeId = static_cast(index); - - if (IsValidIndex(index, GetTotalItemCount()) && callbacks_.getStableId) { - nodeId = callbacks_.getStableId(index); - } - OH_ArkUI_NodeAdapterEvent_SetNodeId(event, nodeId); - } - - void HandleAddNodeToAdapter(ArkUI_NodeAdapterEvent *event) - { - const int32_t index = OH_ArkUI_NodeAdapterEvent_GetItemIndex(event); - ArkUI_NodeHandle item = PopFromCacheOrCreate(index); - - if (callbacks_.onBind && IsValidIndex(index, GetTotalItemCount())) { - callbacks_.onBind(nodeApi_, item, index); - } - OH_ArkUI_NodeAdapterEvent_SetItem(event, item); - } - - void HandleRemoveNodeFromAdapter(ArkUI_NodeAdapterEvent *event) - { - ArkUI_NodeHandle node = OH_ArkUI_NodeAdapterEvent_GetRemovedNode(event); - if (!IsNotNull(node)) { - return; - } - - if (callbacks_.onRecycle) { - callbacks_.onRecycle(nodeApi_, node); - } - nodeCache_.push(node); - } - -private: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - ArkUI_NodeAdapterHandle adapterHandle_ = nullptr; - NodeAdapterCallbacks callbacks_; - std::stack nodeCache_; - int32_t placeholderNodeType_ = kInvalidNodeType; -}; - -#endif // COMMON_ARKUINODEADAPTER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index b39d7715c7094cf3cfaa4e7b8ff0293410d2b7de..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.28.0) -project(native_node_sample) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -file(GLOB_RECURSE ENTRY_SOURCES CONFIGURE_DEPENDS - "${NATIVERENDER_ROOT_PATH}/*.cpp" -) - -add_library(entry SHARED ${ENTRY_SOURCES}) - -find_library( - # Sets the name of the path variable. - hilog-lib - libace-lib - libnapi-lib - ace_napi.z - EGL-lib - EGL - GLES-lib - GLESv3 -) -target_link_libraries(entry PUBLIC - libace_ndk.z.so - libace_napi.z.so - libhilog_ndk.z.so - libnative_drawing.so - libability_base_want.so -) - -target_link_libraries(entry PUBLIC ${libace-lib} libace_napi.z.so libnative_drawing.so libhilog_ndk.z.so) -target_link_libraries(entry PUBLIC ${EGL-lib} ${GLES-lib} libace_napi.z.so libhilog_ndk.z.so libace_ndk.z.so libnative_window.so) -target_link_libraries(entry PUBLIC ${libace-lib} libace_napi.z.so libnative_drawing.so libhilog_ndk.z.so libability_base_want.so) \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/EmbeddedComponentMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/EmbeddedComponentMaker.cpp deleted file mode 100644 index d9ca27d9e301430d88cfc1c0e3062c4560fe3732..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/EmbeddedComponentMaker.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "EmbeddedComponentMaker.h" -#include -#include -#include -#include - -constexpr float TEXT_WIDTH_PX = 300.0f; -constexpr float TEXT_HEIGHT_PX = 100.0f; -constexpr int EMBEDDED_COMPONENT_WIDTH = 480; -constexpr int WANT_STR_BUF_LEN = 10; -constexpr int WANT_STR_COPY_LEN = 5; -constexpr int WANT_URI_BUF_LEN = 10; -constexpr int WANT_URI_COPY_LEN = 5; -constexpr float COL_WIDTH_PX = 300.0f; -static ArkUI_EmbeddedComponentOption* embeddedComponentOption_; - -ArkUI_NodeHandle EmbeddedComponentMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return nullptr; - } - // 创建一个Column容器组件 - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - - // 创建一个EmbeddedComponent组件节点 - ArkUI_NodeHandle embeddedNode = BuildEmbeddedComponentSection(nodeApi); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, "嵌入式组件:"); - nodeApi->addChild(column, text2); - - // 将嵌入式组件添加到列容器 - nodeApi->addChild(column, embeddedNode); - // Column作为XComponent子组件 - return column; -} - -ArkUI_NodeHandle EmbeddedComponentMaker::BuildColumnNode(ArkUI_NativeNodeAPI_1* nodeApi) -{ - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = COL_WIDTH_PX}}; - ArkUI_AttributeItem widthItem = { colWidth, sizeof(colWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - return column; -} - -ArkUI_NodeHandle EmbeddedComponentMaker::BuildTextNode(ArkUI_NativeNodeAPI_1* nodeApi, const char* content) -{ - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = TEXT_WIDTH_PX}}; - ArkUI_AttributeItem textWidthItem = { textWidth, sizeof(textWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = TEXT_HEIGHT_PX}}; - ArkUI_AttributeItem textHeightItem = { textHeight, sizeof(textHeight) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - ArkUI_AttributeItem valueItem = {.string = content}; - nodeApi->setAttribute(text, NODE_TEXT_CONTENT, &valueItem); - return text; -} - -EmbeddedComponentMaker::~EmbeddedComponentMaker() -{ - DisposeEmbeddedComponentOption(); -} - -ArkUI_NodeHandle EmbeddedComponentMaker::BuildEmbeddedComponentSection(ArkUI_NativeNodeAPI_1* nodeApi) -{ - // 创建嵌入式组件选项 - CreateEmbeddedComponentOption(); - // 设置错误回调 - SetEmbeddedComponentOnError(); - // 设置终止回调 - SetEmbeddedComponentOnTerminated(); - // 创建嵌入式组件节点 - ArkUI_NodeHandle embeddedNode = nodeApi->createNode(ARKUI_NODE_EMBEDDED_COMPONENT); - // 设置嵌入式组件的want - SetEmbeddedComponentWant(nodeApi, embeddedNode); - // 将嵌入式组件选项设置给嵌入式组件 - ArkUI_AttributeItem embeddedComponentOptionItem = { .object = embeddedComponentOption_ }; - nodeApi->setAttribute(embeddedNode, NODE_EMBEDDED_COMPONENT_OPTION, &embeddedComponentOptionItem); - ArkUI_NumberValue value[] = { EMBEDDED_COMPONENT_WIDTH }; - ArkUI_AttributeItem embeddedWidthItem = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(embeddedNode, NODE_WIDTH, &embeddedWidthItem); - nodeApi->setAttribute(embeddedNode, NODE_HEIGHT, &embeddedWidthItem); - return embeddedNode; -} - -void EmbeddedComponentMaker::CreateEmbeddedComponentOption() -{ - if (!embeddedComponentOption_) { - embeddedComponentOption_ = OH_ArkUI_EmbeddedComponentOption_Create(); - } -} - -void EmbeddedComponentMaker::DisposeEmbeddedComponentOption() -{ - if (embeddedComponentOption_) { - OH_ArkUI_EmbeddedComponentOption_Dispose(embeddedComponentOption_); - embeddedComponentOption_ = nullptr; - } -} - -void EmbeddedComponentMaker::SetEmbeddedComponentOnError() -{ - if (embeddedComponentOption_) { - OH_ArkUI_EmbeddedComponentOption_SetOnError(embeddedComponentOption_, OnErrorCallback); - } -} - -void EmbeddedComponentMaker::SetEmbeddedComponentOnTerminated() -{ - if (embeddedComponentOption_) { - OH_ArkUI_EmbeddedComponentOption_SetOnTerminated(embeddedComponentOption_, OnTerminatedCallback); - } -} - -void EmbeddedComponentMaker::SetEmbeddedComponentWant(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - // 创建一个Want对象并设置相关属性 - AbilityBase_Element element = { - .bundleName = "com.example.native_node_napi", - .abilityName = "SampleEmbeddedAbility", - .moduleName = "" - }; - AbilityBase_Want* want = OH_AbilityBase_CreateWant(element); - ArkUI_AttributeItem itemObjWant = {.object = want}; - nodeApi->setAttribute(node, NODE_EMBEDDED_COMPONENT_WANT, &itemObjWant); - } -} - -void EmbeddedComponentMaker::OnErrorCallback(int32_t code, const char* name, const char* msg) -{ - // 用户自定义的错误处理逻辑 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnErrorCallback:\ - code=%{public}d, name=%{public}s, message=%{public}s", code, name, msg); -} - -void EmbeddedComponentMaker::OnTerminatedCallback(int32_t code, AbilityBase_Want* want) -{ - // 用户自定义的终止处理逻辑 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: code=%{public}d", code); - if (want == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: want is nullptr"); - return; - } - - AbilityBase_Element element; - auto error = OH_AbilityBase_GetWantElement(want, &element); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: bundleName=%{public}s,\ - abilityName=%{public}s, moduleName=%{public}s", element.bundleName, element.abilityName, element.moduleName); - int wantInt = 0; - error = OH_AbilityBase_GetWantInt32Param(want, "int", &wantInt); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantInt=%{public}d", wantInt); - bool wantBool = false; - error = OH_AbilityBase_GetWantBoolParam(want, "bool2", &wantBool); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantBool=%{public}d", - wantBool); - char wantString[WANT_STR_BUF_LEN]; - error = OH_AbilityBase_GetWantCharParam(want, "string", wantString, WANT_STR_COPY_LEN); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantString=%{public}s", - wantString); - char wantUri[WANT_URI_BUF_LEN]; - error = OH_AbilityBase_GetWantUri(want, wantUri, WANT_URI_COPY_LEN); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantUri=%{public}s", wantUri); - int wantFd = 0; - error = OH_AbilityBase_GetWantFd(want, "keyFd2", &wantFd); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantFd=%{public}d", wantFd); -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/EmbeddedComponentMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/EmbeddedComponentMaker.h deleted file mode 100644 index 30602fb6fbe89d59d1fb2c82b2974bf307cdf0ef..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/EmbeddedComponentMaker.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_NODE_SAMPLE_EMBEDDED_COMPONENT_MAKER_H -#define NATIVE_NODE_SAMPLE_EMBEDDED_COMPONENT_MAKER_H - -#include -#include -#include -#include -#include "manager.h" - -class EmbeddedComponentMaker { -public: - EmbeddedComponentMaker(){}; - ~EmbeddedComponentMaker(); - static ArkUI_NodeHandle CreateNativeNode(); - static ArkUI_NodeHandle BuildEmbeddedComponentSection(ArkUI_NativeNodeAPI_1* nodeApi); - static ArkUI_NodeHandle BuildTextNode(ArkUI_NativeNodeAPI_1* nodeApi, const char* content); - static ArkUI_NodeHandle BuildColumnNode(ArkUI_NativeNodeAPI_1* nodeApi); - static void CreateEmbeddedComponentOption(); - static void DisposeEmbeddedComponentOption(); - static void SetEmbeddedComponentOnError(); - static void SetEmbeddedComponentOnTerminated(); - static void SetEmbeddedComponentWant(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void OnErrorCallback(int32_t code, const char* name, const char* message); - static void OnTerminatedCallback(int32_t code, AbilityBase_Want* want); -}; - -#endif // NATIVE_NODE_SAMPLE_EMBEDDED_COMPONENT_MAKER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/GridMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/GridMaker.cpp deleted file mode 100644 index 1e886c1f0f67d2e64b6e72422293e38419ff077c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/GridMaker.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (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. - */ - -#include -#include -#include -#include // snprintf -#include -#include - -#include -#include - -#include "ScrollableNode.h" -#include "ArkUINodeAdapter.h" -#include "GridMaker.h" - -namespace { -// ===== 布局与样式常量 ===== -constexpr char K_ROWS_TEMPLATE[] = "auto"; -constexpr char K_COLUMNS_TEMPLATE[] = "1fr 1fr"; -constexpr float K_COLUMNS_GAP = 10.0f; -constexpr float K_ROWS_GAP = 15.0f; -constexpr uint32_t K_ITEM_BG_COLOR = 0xFFF1F3F5U; - -constexpr uint32_t K_GRID_CACHED_COUNT = 32; -constexpr bool K_GRID_SYNC_LOAD = true; -constexpr ArkUI_FocusWrapMode K_FOCUS_WRAP_MODE = ARKUI_FOCUS_WRAP_MODE_DEFAULT; - -constexpr int K_ITEM_COUNT = 60; -constexpr float K_ITEM_HEIGHT = 72.0f; -constexpr int K_GRID_INDEX_WIDTH = 2; -} // namespace - -// ---------- 生成数据:Grid01 ~ Grid60 ---------- -static std::vector MakeServicesData(size_t count = K_ITEM_COUNT) -{ - std::vector out; - out.reserve(count); - for (size_t i = 1; i <= count; ++i) { - std::ostringstream oss; - oss << "Grid" << std::setw(K_GRID_INDEX_WIDTH) << std::setfill('0') << i; - out.emplace_back(oss.str()); - } - return out; -} - -// ---------- 配置 Grid 外观/交互 ---------- -static void ConfigureGrid(const std::shared_ptr &grid) -{ - grid->SetWidthPercent(1.0f); - grid->SetDefaultScrollStyle(); - grid->SetColumnsTemplate(K_COLUMNS_TEMPLATE); - grid->SetCachedCount(K_GRID_CACHED_COUNT); - grid->SetFocusWrapMode(K_FOCUS_WRAP_MODE); - grid->SetSyncLoad(K_GRID_SYNC_LOAD); - grid->SetColumnsGap(K_COLUMNS_GAP); - grid->SetRowsGap(K_ROWS_GAP); -} - -// ---------- 适配器回调(创建/绑定) ---------- -static ArkUI_NodeHandle GridCreateItem(ArkUI_NativeNodeAPI_1 *api) -{ - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle item = api->createNode(ARKUI_NODE_GRID_ITEM); - api->addChild(item, text); - return item; -} - -static void GridBindItem(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index, - const std::shared_ptr> &data) -{ - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, K_ITEM_BG_COLOR); - SetAttributeFloat32(api, item, NODE_HEIGHT, K_ITEM_HEIGHT); - - ArkUI_NodeHandle text = api->getFirstChild(item); - if (!text) { - return; - } - - const int32_t n = static_cast(data->size()); - const char *s = (index >= 0 && index < n) ? (*data)[static_cast(index)].c_str() : ""; - SetTextContent(api, text, s); -} - -// ---------- 构建 Adapter ---------- -static std::shared_ptr MakeGridAdapter(const std::shared_ptr> &data) -{ - auto adapter = std::make_shared(); - adapter->EnsurePlaceholderTypeOr(static_cast(ARKUI_NODE_GRID_ITEM)); - - ArkUINodeAdapter::Callbacks cb{}; - cb.getTotalCount = [data]() -> int32_t { return static_cast(data->size()); }; - cb.getStableId = [data](int32_t i) -> uint64_t { - const int32_t n = static_cast(data->size()); - if (i >= 0 && i < n) { - return static_cast(std::hash{}((*data)[static_cast(i)])); - } - return static_cast(i); - }; - cb.onCreate = [](ArkUI_NativeNodeAPI_1 *api, int32_t /*index*/) -> ArkUI_NodeHandle { return GridCreateItem(api); }; - cb.onBind = [data](ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index) { - GridBindItem(api, item, index, data); - }; - - adapter->SetCallbacks(cb); - return adapter; -} - -// ---------- 整体构建 Grid ---------- -static std::shared_ptr BuildGrid() -{ - auto grid = std::make_shared(); - ConfigureGrid(grid); - - auto data = std::make_shared>(MakeServicesData(K_ITEM_COUNT)); - auto adapter = MakeGridAdapter(data); - grid->SetLazyAdapter(adapter); - adapter->ReloadAllItems(); - GetKeepAliveContainer().emplace_back(grid); - return grid; -} - -ArkUI_NodeHandle GridMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (api == nullptr) { - return nullptr; - } - - // 根容器全屏 - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (page == nullptr) { - return nullptr; - } - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - // 构建 Grid - std::shared_ptr grid = BuildGrid(); - if (grid && grid->GetHandle() != nullptr) { - SetAttributeFloat32(api, grid->GetHandle(), NODE_LAYOUT_WEIGHT, 1.0f); - api->addChild(page, grid->GetHandle()); - } - - return page; -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/GridMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/GridMaker.h deleted file mode 100644 index 125550fc86c347a716598dfeb4942725383c81b4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/GridMaker.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef GRID_NODE_H -#define GRID_NODE_H - -#include - -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollableEvent.h" -#include "ArkUINodeAdapter.h" - -class GridMaker : public BaseNode { -public: - static ArkUI_NodeHandle CreateNativeNode(); - - GridMaker() - : BaseNode(NodeApiInstance::GetInstance()->GetNativeNodeAPI()->createNode(ARKUI_NODE_GRID)), - nodeApi_(NodeApiInstance::GetInstance()->GetNativeNodeAPI()) - { - if (!IsNotNull(nodeApi_) || !IsNotNull(GetHandle())) { - return; - } - - nodeApi_->addNodeEventReceiver(GetHandle(), StaticEventReceiver); - scrollEventGuard_.Bind(nodeApi_, GetHandle(), this, SCROLL_EVT_ALL); - } - - ~GridMaker() override - { - scrollEventGuard_.Release(); - nodeAdapter_.reset(); - } - - // ======================================== - // 尺寸设置接口 - // ======================================== - void SetGridSize(float width, float height) - { - SetSize(width, height); - } - - void SetGridSizePercent(float widthPercent, float heightPercent) - { - SetSizePercent(widthPercent, heightPercent); - } - - // ======================================== - // 模板和间距设置 - // ======================================== - void SetRowsTemplate(const char *rowsTemplate) - { - SetAttributeString(nodeApi_, GetHandle(), NODE_GRID_ROW_TEMPLATE, rowsTemplate); - } - - void SetColumnsTemplate(const char *columnsTemplate) - { - SetAttributeString(nodeApi_, GetHandle(), NODE_GRID_COLUMN_TEMPLATE, columnsTemplate); - } - - void SetColumnsGap(float gap) - { - SetAttributeFloat32(nodeApi_, GetHandle(), NODE_GRID_COLUMN_GAP, gap); - } - - void SetRowsGap(float gap) - { - SetAttributeFloat32(nodeApi_, GetHandle(), NODE_GRID_ROW_GAP, gap); - } - - // ======================================== - // 行为和性能设置 - // ======================================== - void SetCachedCount(uint32_t count) - { - SetAttributeUInt32(nodeApi_, GetHandle(), NODE_GRID_CACHED_COUNT, count); - } - - void SetFocusWrapMode(ArkUI_FocusWrapMode mode) - { - SetAttributeInt32(nodeApi_, GetHandle(), NODE_GRID_FOCUS_WRAP_MODE, static_cast(mode)); - } - - void SetSyncLoad(bool enabled) - { - SetAttributeInt32(nodeApi_, GetHandle(), NODE_GRID_SYNC_LOAD, enabled ? 1 : 0); - } - - void SetDefaultScrollStyle() - { - ::SetDefaultScrollStyle(nodeApi_, GetHandle()); - } - - // ======================================== - // 适配器设置 - // ======================================== - void SetLazyAdapter(const std::shared_ptr &adapter) - { - if (!IsNotNull(adapter)) { - return; - } - ArkUI_AttributeItem item{nullptr, 0, nullptr, adapter->GetAdapter()}; - nodeApi_->setAttribute(GetHandle(), NODE_GRID_NODE_ADAPTER, &item); - nodeAdapter_ = adapter; - } - -protected: - void OnNodeEvent(ArkUI_NodeEvent *event) override - { - BaseNode::OnNodeEvent(event); - } - -private: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - std::shared_ptr nodeAdapter_; - ScrollEventGuard scrollEventGuard_; -}; - -#endif // SCROLLABLENDK_GRID_NODE_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListItemGroup.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListItemGroup.h deleted file mode 100644 index 014ebd987ec6edffb03e30ff57fa12f6a262c336..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListItemGroup.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef LIST_ITEM_GROUP_H -#define LIST_ITEM_GROUP_H - -#include -#include -#include - -#include "ScrollableNode.h" -#include "ArkUINodeAdapter.h" - -/** 轻量封装:分组节点,仅提供示例所需 API */ -class ListItemGroupNode : public BaseNode { -public: - ListItemGroupNode() - : BaseNode(NodeApiInstance::GetInstance()->GetNativeNodeAPI()->createNode(ARKUI_NODE_LIST_ITEM_GROUP)), - api_(NodeApiInstance::GetInstance()->GetNativeNodeAPI()) - { - } - - ~ListItemGroupNode() override - { - if (!api_) { - return; - } - - // 清空 adapter - if (adapter_) { - ArkUI_AttributeItem it{nullptr, 0, nullptr, nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_NODE_ADAPTER, &it); - adapter_.reset(); - } - - // 清空 header / footer —— 传 nullptr 给同一属性即可 - if (header_) { - ArkUI_AttributeItem it{nullptr, 0, nullptr, nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_HEADER, &it); - header_.reset(); - } - if (footer_) { - ArkUI_AttributeItem it{nullptr, 0, nullptr, nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_FOOTER, &it); - footer_.reset(); - } - } - - // 设置/清空 Header:传 nullptr 即清空 - void SetHeader(const std::shared_ptr &header) - { - ArkUI_AttributeItem it{nullptr, 0, nullptr, header ? header->GetHandle() : nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_HEADER, &it); - header_ = header; - } - - // 设置/清空 Footer:传 nullptr 即清空 - void SetFooter(const std::shared_ptr &footer) - { - ArkUI_AttributeItem it{nullptr, 0, nullptr, footer ? footer->GetHandle() : nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_FOOTER, &it); - footer_ = footer; - } - - void SetLazyAdapter(const std::shared_ptr &adapter) - { - if (!adapter) { - ArkUI_AttributeItem it{nullptr, 0, nullptr, nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_NODE_ADAPTER, &it); - adapter_.reset(); - return; - } - adapter->EnsurePlaceholderTypeOr(static_cast(ARKUI_NODE_LIST_ITEM)); - ArkUI_AttributeItem it{nullptr, 0, nullptr, adapter->GetAdapter()}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_NODE_ADAPTER, &it); - adapter_ = adapter; - } - - // 可选:分组 divider - void SetDivider(float widthPx) - { - ArkUI_NumberValue v{.f32 = widthPx}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_DIVIDER, &it); - } - - // 可选:分组 children main size - void SetChildrenMainSizeOption(ArkUI_ListChildrenMainSize *opt) - { - ArkUI_AttributeItem it{nullptr, 0, nullptr, opt}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_CHILDREN_MAIN_SIZE, &it); - } - -private: - ArkUI_NativeNodeAPI_1 *api_ = nullptr; - std::shared_ptr adapter_; - std::shared_ptr header_; - std::shared_ptr footer_; -}; - -#endif // LIST_ITEM_GROUP_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListItemSwipe.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListItemSwipe.h deleted file mode 100644 index 33e8f06d08e62f4ddf867b7706b4abbf41800f98..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListItemSwipe.h +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef LIST_ITEM_SWIPE_H -#define LIST_ITEM_SWIPE_H - -#include - -#include -#include -#include - -#ifndef LOG_TAG -#define LOG_TAG "ListItemSwipe" -#endif - -/** - * 轻量封装:为 ARKUI_NODE_LIST_ITEM 配置 Swipe Action(左右动作区、阈值、回调等) - */ -class ListItemSwipe { -public: - explicit ListItemSwipe(ArkUI_NativeNodeAPI_1 *api) : api_(api) {} - ~ListItemSwipe() - { - if (option_) { - OH_ArkUI_ListItemSwipeActionOption_Dispose(option_); - option_ = nullptr; - } - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_Dispose(startItem_); - startItem_ = nullptr; - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_Dispose(endItem_); - endItem_ = nullptr; - } - } - - // ====== 构建左右动作区 ====== - ListItemSwipe &BuildStartArea(const std::function &builder) - { - EnsureOption(); - if (!startItem_) { - startItem_ = OH_ArkUI_ListItemSwipeActionItem_Create(); - } - ArkUI_NodeHandle node = builder ? builder(api_) : nullptr; - OH_ArkUI_ListItemSwipeActionItem_SetContent(startItem_, node); - OH_ArkUI_ListItemSwipeActionOption_SetStart(option_, startItem_); - return *this; - } - - ListItemSwipe &BuildEndArea(const std::function &builder) - { - EnsureOption(); - if (!endItem_) { - endItem_ = OH_ArkUI_ListItemSwipeActionItem_Create(); - } - ArkUI_NodeHandle node = builder ? builder(api_) : nullptr; - OH_ArkUI_ListItemSwipeActionItem_SetContent(endItem_, node); - OH_ArkUI_ListItemSwipeActionOption_SetEnd(option_, endItem_); - return *this; - } - - // ====== 阈值(长距离删除阈值) ====== - ListItemSwipe &SetActionAreaDistance(float distance) - { - EnsureStartEnd(); - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetActionAreaDistance(startItem_, distance); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetActionAreaDistance(endItem_, distance); - } - return *this; - } - - float GetActionAreaDistanceStart() const - { - if (startItem_) { - return OH_ArkUI_ListItemSwipeActionItem_GetActionAreaDistance(startItem_); - } - return -1.0f; - } - - float GetActionAreaDistanceEnd() const - { - if (endItem_) { - return OH_ArkUI_ListItemSwipeActionItem_GetActionAreaDistance(endItem_); - } - return -1.0f; - } - - // ====== 进入/退出/触发/状态变化 ====== - ListItemSwipe &OnEnter(const std::function &cb) - { - EnsureStartEnd(); - enter_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionArea(startItem_, &ThunkEnter); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionArea(endItem_, &ThunkEnter); - } - return *this; - } - - ListItemSwipe &OnExit(const std::function &cb) - { - EnsureStartEnd(); - exit_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionArea(startItem_, &ThunkExit); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionArea(endItem_, &ThunkExit); - } - return *this; - } - - ListItemSwipe &OnAction(const std::function &cb) - { - EnsureStartEnd(); - action_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnAction(startItem_, &ThunkAction); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnAction(endItem_, &ThunkAction); - } - return *this; - } - - ListItemSwipe &OnStateChange(const std::function &cb) - { - EnsureStartEnd(); - state_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnStateChange(startItem_, &ThunkState); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnStateChange(endItem_, &ThunkState); - } - return *this; - } - - ListItemSwipe &OnEnterWithUserData(const std::function &cb) - { - EnsureStartEnd(); - enterUD_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionAreaWithUserData(startItem_, this, &ThunkEnterUD); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionAreaWithUserData(endItem_, this, &ThunkEnterUD); - } - return *this; - } - - ListItemSwipe &OnExitWithUserData(const std::function &cb) - { - EnsureStartEnd(); - exitUD_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionAreaWithUserData(startItem_, this, &ThunkExitUD); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionAreaWithUserData(endItem_, this, &ThunkExitUD); - } - return *this; - } - - ListItemSwipe &OnActionWithUserData(const std::function &cb) - { - EnsureStartEnd(); - actionUD_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnActionWithUserData(startItem_, this, &ThunkActionUD); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnActionWithUserData(endItem_, this, &ThunkActionUD); - } - return *this; - } - - ListItemSwipe &OnStateChangeWithUserData(const std::function &cb) - { - EnsureStartEnd(); - stateUD_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnStateChangeWithUserData(startItem_, this, &ThunkStateUD); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnStateChangeWithUserData(endItem_, this, &ThunkStateUD); - } - return *this; - } - - // ====== Edge Effect / Offset 回调 ====== - ListItemSwipe &SetEdgeEffect(int edgeEffect /*ArkUI_ListItemSwipeEdgeEffect*/) - { - EnsureOption(); - OH_ArkUI_ListItemSwipeActionOption_SetEdgeEffect( - option_, static_cast(edgeEffect)); - return *this; - } - - int GetEdgeEffect() const - { - if (option_) { - return OH_ArkUI_ListItemSwipeActionOption_GetEdgeEffect(option_); - } - return -1; - } - - ListItemSwipe &OnOffsetChange(const std::function &cb) - { - EnsureOption(); - offset_ = cb; - OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChange(option_, &ThunkOffset); - return *this; - } - - ListItemSwipe &OnOffsetChangeWithUserData(const std::function &cb) - { - EnsureOption(); - offsetUD_ = cb; - OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChangeWithUserData(option_, this, &ThunkOffsetUD); - return *this; - } - - // ====== 挂载到指定 LIST_ITEM 节点 ====== - void AttachToListItem(ArkUI_NodeHandle listItem) - { - if (!api_ || !listItem) { - return; - } - EnsureOption(); - ArkUI_AttributeItem it{nullptr, 0, nullptr, option_}; - api_->setAttribute(listItem, NODE_LIST_ITEM_SWIPE_ACTION, &it); - - (void)GetActionAreaDistanceStart(); - (void)GetActionAreaDistanceEnd(); - (void)GetEdgeEffect(); - } - -private: - void EnsureOption() - { - if (!option_) { - option_ = OH_ArkUI_ListItemSwipeActionOption_Create(); - } - } - - void EnsureStartEnd() - { - EnsureOption(); - if (!startItem_) { - startItem_ = OH_ArkUI_ListItemSwipeActionItem_Create(); - } - if (!endItem_) { - endItem_ = OH_ArkUI_ListItemSwipeActionItem_Create(); - } - OH_ArkUI_ListItemSwipeActionOption_SetStart(option_, startItem_); - OH_ArkUI_ListItemSwipeActionOption_SetEnd(option_, endItem_); - } - - static void ThunkEnter() {} - static void ThunkExit() {} - static void ThunkAction() {} - static void ThunkState(ArkUI_ListItemSwipeActionState state) { (void)state; } - static void ThunkOffset(float offset) { (void)offset; } - - static void ThunkEnterUD(void *ud) - { - if (auto *self = static_cast(ud); self && self->enterUD_) { - self->enterUD_(ud); - } - } - - static void ThunkExitUD(void *ud) - { - if (auto *self = static_cast(ud); self && self->exitUD_) { - self->exitUD_(ud); - } - } - - static void ThunkActionUD(void *ud) - { - if (auto *self = static_cast(ud); self && self->actionUD_) { - self->actionUD_(ud); - } - } - - static void ThunkStateUD(ArkUI_ListItemSwipeActionState state, void *ud) - { - if (auto *self = static_cast(ud); self && self->stateUD_) { - self->stateUD_(static_cast(state), ud); - } - if (auto *self2 = static_cast(ud); self2 && self2->state_) { - self2->state_(static_cast(state)); - } - } - - static void ThunkOffsetUD(float offset, void *ud) - { - if (auto *self = static_cast(ud); self && self->offsetUD_) { - self->offsetUD_(offset, ud); - } - } - -private: - ArkUI_NativeNodeAPI_1 *api_{nullptr}; - - ArkUI_ListItemSwipeActionItem *startItem_{nullptr}; - ArkUI_ListItemSwipeActionItem *endItem_{nullptr}; - ArkUI_ListItemSwipeActionOption *option_{nullptr}; - - // 无 userData 回调 - std::function enter_; - std::function exit_; - std::function action_; - std::function state_; - std::function offset_; - - // 带 userData 回调 - std::function enterUD_; - std::function exitUD_; - std::function actionUD_; - std::function stateUD_; - std::function offsetUD_; -}; - -#endif // LIST_ITEM_SWIPE_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListMaker.cpp deleted file mode 100644 index 1d627c50ab03ef467ca74e2e6c28e0539d14e176..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListMaker.cpp +++ /dev/null @@ -1,730 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "ScrollableUtils.h" - -#ifndef LOG_TAG -#define LOG_TAG "ListMaker" -#endif - -#include "ScrollableNode.h" -#include "ArkUINodeAdapter.h" -#include "ListMaker.h" -#include "ListItemGroup.h" -#include "ListItemSwipe.h" - -/** ======================== 常量配置:布局/样式/文案 ======================== */ -namespace { -constexpr int K_ALPHABET_COUNT = 26; -constexpr int K_INDEX_ITEM_HEIGHT = 22; -constexpr int32_t K_FIRST_GROUP_INDEX = 0; - -constexpr float K_LIST_WIDTH_PERCENT = 0.82f; -constexpr float K_FULL_PERCENT = 1.0f; -constexpr float K_LIST_SPACE = 8.0f; - -constexpr float K_ITEM_FONT_SIZE = 16.0f; -constexpr float K_INDEX_FONT_SIZE = 14.0f; -constexpr float K_ROW_HEIGHT = 80.0f; - -constexpr float K_DELETE_WIDTH = 88.0f; - -constexpr float K_INDEX_BAR_WIDTH = 56.0f; -constexpr float K_INDEX_BAR_PAD_TOP = 0.0f; -constexpr float K_INDEX_BAR_PAD_RIGHT = 0.0f; -constexpr float K_INDEX_BAR_PAD_BOTTOM = 0.0f; -constexpr float K_INDEX_BAR_PAD_LEFT = 8.0f; - -constexpr float K_HEADER_HEIGHT = 40.0f; -constexpr float K_FOOTER_HEIGHT = 28.0f; - -constexpr uint32_t K_COLOR_WHITE = 0xFFFFFFFFU; -constexpr uint32_t K_COLOR_BLACK = 0xFF000000U; -constexpr uint32_t K_COLOR_DELETE_BG = 0xFFE53935U; -constexpr uint32_t K_COLOR_INDEX_ACTIVE = 0xFF003366U; -constexpr uint32_t K_COLOR_INDEX_INACTIVE = 0xFF222222U; -constexpr uint32_t K_COLOR_INDEX_ACTIVE_BG = 0xFFE0F0FFU; -constexpr uint32_t K_COLOR_INDEX_INACTIVE_BG = 0x00000000U; - -constexpr uint32_t K_COLOR_HEADER_BG = 0xFFEFEFEFU; -constexpr uint32_t K_COLOR_FOOTER_BG = 0xFFF7F7F7U; - -constexpr int K_EDGE_EFFECT_NONE = 0; - -constexpr const char *K_DELETE_TEXT = "Delete"; -constexpr const char *K_FOOTER_TEXT = "—— 已到底 ——"; -constexpr const char *K_INVALID_TEXT = ""; - -constexpr unsigned int K_LOG_DOMAIN = 0xFF00; -} // namespace - -static const char *const NAMES_A[] = {"Alice", "Andrew", "Amy", "Aaron", "安娜", "安琪", "爱华", "阿明"}; -static const char *const NAMES_B[] = {"Ben", "Bella", "Brian", "Brandon", "博文", "斌", "白雪", "彬彬"}; -static const char *const NAMES_C[] = {"Chris", "Charlotte", "Cindy", "Caleb", "晨曦", "承泽", "楚怡", "春燕"}; -static const char *const NAMES_D[] = {"Daniel", "David", "Diana", "Dylan", "大伟", "东旭", "德华", "丹妮"}; -static const char *const NAMES_E[] = {"Emma", "Ethan", "Emily", "Eric", "恩泽", "恩雅", "尔雅", "恩宁"}; -static const char *const NAMES_F[] = {"Frank", "Fiona", "Felix", "Fred", "方圆", "芙蓉", "芳怡", "飞扬"}; -static const char *const NAMES_G[] = {"Grace", "George", "Gavin", "Gloria", "国强", "国华", "光耀", "桂英"}; -static const char *const NAMES_H[] = {"Henry", "Hannah", "Helen", "Harry", "海峰", "红梅", "宏伟", "浩然"}; -static const char *const NAMES_I[] = {"Isaac", "Ice", "Ian", "Isabella", "一涵", "一诺", "怡君", "依琳"}; -static const char *const NAMES_J[] = {"Jack", "James", "Jason", "Julia", "佳怡", "建国", "靖雯", "俊杰"}; -static const char *const NAMES_K[] = {"Kevin", "Kate", "Kelly", "Kyle", "可欣", "可可", "昆明", "康宁"}; -static const char *const NAMES_L[] = {"Lucas", "Leo", "Lily", "Lauren", "丽丽", "丽华", "立国", "林涛"}; -static const char *const NAMES_M[] = {"Michael", "Mary", "Mark", "Molly", "美玲", "明慧", "明杰", "梦瑶"}; -static const char *const NAMES_N[] = {"Nancy", "Nathan", "Nick", "Nora", "楠楠", "宁静", "娜娜", "乃文"}; -static const char *const NAMES_O[] = {"Oliver", "Olivia", "Owen", "Oscar", "欧阳娜", "欧莉", "欧阳晨", "欧文"}; -static const char *const NAMES_P[] = {"Peter", "Paul", "Philip", "Penny", "佩琪", "佩华", "平安", "鹏飞"}; -static const char *const NAMES_Q[] = {"Quentin", "Queenie", "Quinn", "Quincy", "琪琳", "倩倩", "清华", "强辉"}; -static const char *const NAMES_R[] = {"Robert", "Rachel", "Ryan", "Ruby", "荣辉", "若曦", "瑞雪", "日新"}; -static const char *const NAMES_S[] = {"Steven", "Susan", "Sarah", "Simon", "思远", "素芳", "诗涵", "少华"}; -static const char *const NAMES_T[] = {"Thomas", "Tony", "Tina", "Taylor", "天宇", "婷怡", "涛涛", "同辉"}; -static const char *const NAMES_U[] = {"Ulysses", "Uma", "Ulrich", "Ursula", "宇航", "宇轩", "宇宁", "宇泽"}; -static const char *const NAMES_V[] = {"Victor", "Victoria", "Vincent", "Vivian", "薇薇", "维娜", "维德", "维琪"}; -static const char *const NAMES_W[] = {"William", "Wendy", "Walter", "Willow", "伟强", "文静", "文博", "卫东"}; -static const char *const NAMES_X[] = {"Xavier", "Xander", "Xenia", "Xiomara", "晓明", "欣怡", "旭东", "霞"}; -static const char *const NAMES_Y[] = {"Yvonne", "Yolanda", "Yara", "Yvette", "怡然", "颖颖", "逸飞", "毅然"}; -static const char *const NAMES_Z[] = {"Zoe", "Zachary", "Zane", "Zara", "紫琪", "志强", "梓涵", "泽宇"}; - -struct GroupNames { - char letter; - const char *const *arr; - int size; -}; - -static const GroupNames g_groups[] = { - {'A', NAMES_A, ArrSize(NAMES_A)}, {'B', NAMES_B, ArrSize(NAMES_B)}, {'C', NAMES_C, ArrSize(NAMES_C)}, - {'D', NAMES_D, ArrSize(NAMES_D)}, {'E', NAMES_E, ArrSize(NAMES_E)}, {'F', NAMES_F, ArrSize(NAMES_F)}, - {'G', NAMES_G, ArrSize(NAMES_G)}, {'H', NAMES_H, ArrSize(NAMES_H)}, {'I', NAMES_I, ArrSize(NAMES_I)}, - {'J', NAMES_J, ArrSize(NAMES_J)}, {'K', NAMES_K, ArrSize(NAMES_K)}, {'L', NAMES_L, ArrSize(NAMES_L)}, - {'M', NAMES_M, ArrSize(NAMES_M)}, {'N', NAMES_N, ArrSize(NAMES_N)}, {'O', NAMES_O, ArrSize(NAMES_O)}, - {'P', NAMES_P, ArrSize(NAMES_P)}, {'Q', NAMES_Q, ArrSize(NAMES_Q)}, {'R', NAMES_R, ArrSize(NAMES_R)}, - {'S', NAMES_S, ArrSize(NAMES_S)}, {'T', NAMES_T, ArrSize(NAMES_T)}, {'U', NAMES_U, ArrSize(NAMES_U)}, - {'V', NAMES_V, ArrSize(NAMES_V)}, {'W', NAMES_W, ArrSize(NAMES_W)}, {'X', NAMES_X, ArrSize(NAMES_X)}, - {'Y', NAMES_Y, ArrSize(NAMES_Y)}, {'Z', NAMES_Z, ArrSize(NAMES_Z)}}; - -struct ClickCtx { - ArkUI_NativeNodeAPI_1 *api{nullptr}; - std::shared_ptr> items; - std::weak_ptr adapter; - int index{-1}; - uint64_t stableId{0}; - ArkUI_NodeHandle itemHandle{nullptr}; -}; - -static std::unordered_map> s_btnCtx; -static std::unordered_map s_itemToDeleteBtn; - -struct ItemCtx { - std::shared_ptr> items; - std::weak_ptr adapter; - int index{-1}; - uint64_t stableId{0}; -}; -static std::unordered_map s_itemCtx; - -static int FindIndexByStableId(const std::vector &items, uint64_t sid) -{ - const int n = static_cast(items.size()); - for (int i = 0; i < n; ++i) { - uint64_t v = static_cast(std::hash{}(items[static_cast(i)])); - if (v == sid) { - return i; - } - } - return -1; -} - -static int ClampFallbackIndex(int fallback, int n) -{ - if (n <= 0) { - return -1; - } - int idx = fallback; - if (idx < 0) { - idx = 0; - } - if (idx >= n) { - idx = n - 1; - } - return idx; -} - -static int ResolveDeleteIndex(const ItemCtx &cur, const std::vector &vec) -{ - const int n = static_cast(vec.size()); - if (n <= 0) { - return -1; - } - - if (cur.stableId != 0) { - const int idx = FindIndexByStableId(vec, cur.stableId); - if (idx >= 0) { - return idx; - } - } - - if (cur.index >= 0 && cur.index < n) { - const uint64_t sidAt = static_cast(std::hash{}(vec[static_cast(cur.index)])); - if (sidAt == cur.stableId || cur.stableId == 0) { - return cur.index; - } - } - - if (cur.stableId != 0) { - const int s = std::max(0, cur.index - 2); - const int e = std::min(n - 1, cur.index + 2); - for (int i = s; i <= e; ++i) { - const uint64_t sid = static_cast(std::hash{}(vec[static_cast(i)])); - if (sid == cur.stableId) { - return i; - } - } - } - - return ClampFallbackIndex(cur.index, n); -} - -static void DetachItemCtx(ItemCtx &cur) -{ - cur.items.reset(); - cur.index = -1; - cur.stableId = 0; -} - -static void EraseAndNotify(std::shared_ptr> &holdItems, int idx, - const std::weak_ptr &adapterWeak) -{ - auto &vecRef = *holdItems; - if (idx >= 0 && idx < static_cast(vecRef.size())) { - vecRef.erase(vecRef.begin() + idx); - } - if (auto ad = adapterWeak.lock()) { - ad->RemoveRange(idx, 1); // 触发 UI 回收/重绑 - } -} - -static ArkUI_NativeNodeAPI_1 *FindApiFromItem(ArkUI_NodeHandle item) -{ - auto itBtn = s_itemToDeleteBtn.find(item); - if (itBtn == s_itemToDeleteBtn.end()) { - return nullptr; - } - auto itCtx = s_btnCtx.find(itBtn->second); - if (itCtx == s_btnCtx.end() || !itCtx->second) { - return nullptr; - } - return itCtx->second->api; -} - -static void CollapseTailVisualIfNeeded(ArkUI_NodeHandle item, int erasedIdx, int prevSize, ArkUI_NativeNodeAPI_1 *api) -{ - if (!api || !item) { - return; - } - if (prevSize <= 0 || erasedIdx != prevSize - 1) { - return; - } - ArkUI_NodeHandle text = api->getFirstChild(item); - if (text) { - SetTextContent(api, text, ""); - SetAttributeFloat32(api, text, NODE_HEIGHT, 0.0f); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, 0.0f); - } - SetAttributeFloat32(api, item, NODE_HEIGHT, 0.0f); -} - -static void LogDeleteOutcome(const std::string &del, int idx, int newSize, bool wasLast) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: [%s] at idx=%d, newSize=%d (last=%s)", - del.c_str(), idx, newSize, wasLast ? "yes" : "no"); -} - -static bool DeleteByItem(ArkUI_NodeHandle item) -{ - auto it = s_itemCtx.find(item); - if (it == s_itemCtx.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: no ctx for item=%p", item); - return false; - } - - ItemCtx &cur = it->second; - if (!cur.items) { - OH_LOG_Print(LOG_APP, LOG_WARN, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: ignored (already consumed) item=%p", - item); - return false; - } - - auto &vec = *cur.items; - const int prevSize = static_cast(vec.size()); - if (prevSize <= 0) { - OH_LOG_Print(LOG_APP, LOG_WARN, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: empty vector"); - return false; - } - - const int idx = ResolveDeleteIndex(cur, vec); - if (idx < 0 || idx >= prevSize) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: invalid idx (bind=%d size=%d sid=%llu)", - cur.index, prevSize, static_cast(cur.stableId)); - return false; - } - - const std::string del = vec[static_cast(idx)]; - std::shared_ptr> holdItems = cur.items; - auto adapterWeak = cur.adapter; - - DetachItemCtx(cur); - EraseAndNotify(holdItems, idx, adapterWeak); - CollapseTailVisualIfNeeded(item, idx, prevSize, FindApiFromItem(item)); - LogDeleteOutcome(del, idx, static_cast(holdItems->size()), idx == prevSize - 1); - return true; -} - -static void StaticDeleteBtnEvent(ArkUI_NodeEvent *ev) -{ - if (ev == nullptr) { - return; - } - - const int et = OH_ArkUI_NodeEvent_GetEventType(ev); - if (et != NODE_ON_CLICK && et != NODE_ON_CLICK_EVENT) { - return; - } - - auto *ctx = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(ev)); - if (ctx == nullptr) { - return; - } - - if (!DeleteByItem(ctx->itemHandle)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "StaticDeleteBtnEvent: DeleteByItem failed (item=%p)", - ctx->itemHandle); - } -} - -static std::shared_ptr MakeText(const char *s, float h, uint32_t bg) -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - std::shared_ptr node = std::make_shared(text); - - SetTextContent(api, text, s); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_ITEM_FONT_SIZE); - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, K_FULL_PERCENT); - SetAttributeFloat32(api, text, NODE_HEIGHT, h); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, h); - SetAttributeInt32(api, text, NODE_TEXT_ALIGN, ARKUI_TEXT_ALIGNMENT_CENTER); - SetAttributeUInt32(api, text, NODE_BACKGROUND_COLOR, bg); - return node; -} - -static void SetIndexTextStyle(ArkUI_NodeHandle text, int h, bool active) -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_INDEX_FONT_SIZE); - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, K_FULL_PERCENT); - SetAttributeFloat32(api, text, NODE_HEIGHT, static_cast(h)); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, static_cast(h)); - SetAttributeInt32(api, text, NODE_TEXT_ALIGN, ARKUI_TEXT_ALIGNMENT_CENTER); - SetAttributeUInt32(api, text, NODE_FONT_COLOR, active ? K_COLOR_INDEX_ACTIVE : K_COLOR_INDEX_INACTIVE); - SetAttributeUInt32(api, text, NODE_BACKGROUND_COLOR, active ? K_COLOR_INDEX_ACTIVE_BG : K_COLOR_INDEX_INACTIVE_BG); -} - -struct IndexState { - std::vector> letters; - int selected; - std::vector groupVisible; - IndexState() : selected(-1) - { - } -}; - -static void UpdateIndexHighlight(const std::shared_ptr &st, int idx) -{ - if (!st) { - return; - } - if (st->selected == idx) { - return; - } - - int prev = st->selected; - if (prev >= 0 && prev < static_cast(st->letters.size())) { - ArkUI_NodeHandle prevHandle = st->letters[static_cast(prev)]->GetHandle(); - SetIndexTextStyle(prevHandle, K_INDEX_ITEM_HEIGHT, false); - } - if (idx >= 0 && idx < static_cast(st->letters.size())) { - ArkUI_NodeHandle nowHandle = st->letters[static_cast(idx)]->GetHandle(); - SetIndexTextStyle(nowHandle, K_INDEX_ITEM_HEIGHT, true); - st->selected = idx; - } -} - -static std::shared_ptr BuildRightIndexColumn(const std::shared_ptr &list, - const std::shared_ptr &st) -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - ArkUI_NodeHandle colHandle = api->createNode(ARKUI_NODE_COLUMN); - std::shared_ptr col = std::make_shared(colHandle); - - col->SetWidth(K_INDEX_BAR_WIDTH); - col->SetHeightPercent(K_FULL_PERCENT); - - SetPadding(api, col->GetHandle(), - Padding::Only(K_INDEX_BAR_PAD_TOP, K_INDEX_BAR_PAD_RIGHT, K_INDEX_BAR_PAD_BOTTOM, K_INDEX_BAR_PAD_LEFT)); - - st->letters.reserve(K_ALPHABET_COUNT); - for (int i = 0; i < K_ALPHABET_COUNT; ++i) { - char label[2]; - label[0] = static_cast('A' + i); - label[1] = '\0'; - - ArkUI_NodeHandle textHandle = api->createNode(ARKUI_NODE_TEXT); - std::shared_ptr t = std::make_shared(textHandle); - - SetTextContent(api, textHandle, label); - SetIndexTextStyle(textHandle, K_INDEX_ITEM_HEIGHT, false); - - int group = i; - t->RegisterOnClick([list, st, i, group](ArkUI_NodeEvent *) { - UpdateIndexHighlight(st, i); - list->ScrollToIndexInGroup(group, 0); - }); - - col->AddChild(t); - st->letters.emplace_back(t); - } - return col; -} - -static std::shared_ptr ApplyListSafeProps() -{ - std::shared_ptr list = std::make_shared(); - list->SetWidthPercent(K_LIST_WIDTH_PERCENT); - list->SetHeightPercent(K_FULL_PERCENT); - list->SetScrollBarState(true); - list->SetClipContent(true); - list->SetSpace(K_LIST_SPACE); - list->SetNestedScrollMode(ListMaker::kNestedScrollParentFirst); - return list; -} - -static ArkUI_NodeHandle CreateDeleteButton(ArkUI_NativeNodeAPI_1 *api) -{ - ArkUI_NodeHandle btn = api->createNode(ARKUI_NODE_BUTTON); - - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - SetTextContent(api, text, K_DELETE_TEXT); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_INDEX_FONT_SIZE); - SetAttributeUInt32(api, text, NODE_FONT_COLOR, K_COLOR_WHITE); - - ArkUI_NumberValue ta = {.i32 = ARKUI_TEXT_ALIGNMENT_CENTER}; - ArkUI_AttributeItem taItem = {&ta, 1}; - api->setAttribute(text, NODE_TEXT_ALIGN, &taItem); - - ArkUI_NumberValue hitValChild = {.i32 = ARKUI_HIT_TEST_MODE_TRANSPARENT}; - ArkUI_AttributeItem hitItemChild = {&hitValChild, 1}; - api->setAttribute(text, NODE_HIT_TEST_BEHAVIOR, &hitItemChild); - - api->addChild(btn, text); - - SetAttributeFloat32(api, btn, NODE_WIDTH, K_DELETE_WIDTH); - SetAttributeFloat32(api, btn, NODE_HEIGHT, K_ROW_HEIGHT); - SetAttributeUInt32(api, btn, NODE_BACKGROUND_COLOR, K_COLOR_DELETE_BG); - - ArkUI_NumberValue alignSelf = {.i32 = ARKUI_ITEM_ALIGNMENT_STRETCH}; - ArkUI_AttributeItem alignSelfItem = {&alignSelf, 1}; - api->setAttribute(btn, NODE_ALIGN_SELF, &alignSelfItem); - - ArkUI_NumberValue buttonTypeValue = {.i32 = ARKUI_BUTTON_TYPE_NORMAL}; - ArkUI_AttributeItem buttonTypeItem = {&buttonTypeValue, 1}; - api->setAttribute(btn, NODE_BUTTON_TYPE, &buttonTypeItem); - - ArkUI_NumberValue hitVal = {.i32 = ARKUI_HIT_TEST_MODE_BLOCK}; - ArkUI_AttributeItem hitItem = {&hitVal, 1}; - api->setAttribute(btn, NODE_HIT_TEST_BEHAVIOR, &hitItem); - - return btn; -} - -static void SetupSwipeForListItem(ArkUI_NodeHandle item, ArkUI_NativeNodeAPI_1 *api, - const std::shared_ptr> &items, - const std::weak_ptr &adapterWeak) -{ - static std::vector> s_swipeKeep; - std::unique_ptr swipe = std::make_unique(api); - - auto makeDeleteBtn = [items, adapterWeak, item](ArkUI_NativeNodeAPI_1 *apiInner) -> ArkUI_NodeHandle { - ArkUI_NodeHandle btn = CreateDeleteButton(apiInner); - if (!btn) { - return nullptr; - } - - std::shared_ptr ctx = std::make_shared(); - ctx->api = apiInner; - ctx->items = items; - ctx->adapter = adapterWeak; - ctx->itemHandle = item; - ctx->index = -1; - ctx->stableId = 0; - - s_itemToDeleteBtn[item] = btn; - s_btnCtx[btn] = ctx; - - apiInner->addNodeEventReceiver(btn, &StaticDeleteBtnEvent); - apiInner->registerNodeEvent(btn, NODE_ON_CLICK, 0, ctx.get()); - apiInner->registerNodeEvent(btn, NODE_ON_CLICK_EVENT, 0, ctx.get()); - return btn; - }; - - swipe->BuildEndArea(makeDeleteBtn) - .SetActionAreaDistance(K_DELETE_WIDTH) - .SetEdgeEffect(K_EDGE_EFFECT_NONE) - .OnActionWithUserData([item](void *) { DeleteByItem(item); }); - - swipe->AttachToListItem(item); - s_swipeKeep.emplace_back(std::move(swipe)); -} - -static ArkUI_NodeHandle CreateListItemWithSwipe(ArkUI_NativeNodeAPI_1 *api, - const std::shared_ptr> &items, - const std::weak_ptr &adapterWeak) -{ - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle item = api->createNode(ARKUI_NODE_LIST_ITEM); - api->addChild(item, text); - - SetAttributeFloat32(api, item, NODE_WIDTH_PERCENT, K_FULL_PERCENT); - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, K_FULL_PERCENT); - - SetupSwipeForListItem(item, api, items, adapterWeak); - return item; -} - -static void BindListItemContent(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index, - const std::shared_ptr> &items, - const std::weak_ptr &adapterWeak) -{ - if (!ValidateApiAndNode(api, item, "BindListItemContent")) { - return; - } - if (!IsNotNull(items)) { - return; - } - - ArkUI_NodeHandle text = api->getFirstChild(item); - if (!IsNotNull(text)) { - return; - } - - const int32_t n = static_cast(items->size()); - const bool valid = IsValidIndex(index, n); - const char *content = valid ? (*items)[static_cast(index)].c_str() : K_INVALID_TEXT; - - SetTextContent(api, text, content); - SetBackgroundColor(api, item, K_COLOR_WHITE); - SetTextStyle(api, text, K_ITEM_FONT_SIZE, K_COLOR_BLACK, ARKUI_TEXT_ALIGNMENT_CENTER); - SetAttributeFloat32(api, text, NODE_HEIGHT, K_ROW_HEIGHT); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, K_ROW_HEIGHT); - - // 更新上下文:保证删除时能稳定位中目标项 - auto itBtn = s_itemToDeleteBtn.find(item); - if (itBtn != s_itemToDeleteBtn.end()) { - auto itCtx = s_btnCtx.find(itBtn->second); - if (itCtx != s_btnCtx.end() && itCtx->second) { - ClickCtx &ctx = *itCtx->second; - ctx.index = index; - ctx.items = items; - ctx.adapter = adapterWeak; - ctx.stableId = - valid ? static_cast(std::hash{}((*items)[static_cast(index)])) : 0ULL; - } - } - - // 保存条目上下文 - ItemCtx &ic = s_itemCtx[item]; - ic.items = items; - ic.adapter = adapterWeak; - ic.index = index; - ic.stableId = valid ? static_cast(std::hash{}((*items)[static_cast(index)])) : 0ULL; - - OH_LOG_Print(LOG_APP, LOG_DEBUG, K_LOG_DOMAIN, LOG_TAG, - "BindListItemContent: item=%p index=%d/%d content=%s stableId=%llu", item, index, n, content, - static_cast(ic.stableId)); -} - -static NodeAdapterCallbacks CreateGroupCallbacks(const std::shared_ptr> &items) -{ - NodeAdapterCallbacks cb{}; - cb.getTotalCount = [items]() -> int32_t { return static_cast(items->size()); }; - cb.getStableId = [items](int32_t i) -> uint64_t { - const int32_t n = static_cast(items->size()); - if (i >= 0 && i < n) { - return static_cast(std::hash{}((*items)[static_cast(i)])); - } - return static_cast(i); - }; - return cb; -} - -static std::shared_ptr> CreateGroupItemsData(const GroupNames &gn) -{ - std::shared_ptr> items = std::make_shared>(); - items->reserve(static_cast(gn.size)); - for (int i = 0; i < gn.size; ++i) { - items->emplace_back(gn.arr[i]); - } - return items; -} - -/** 组头/组尾:头为字母,footer 显示“已到底” */ -static void SetupGroupHeaderAndFooter(std::shared_ptr &group, const GroupNames &gn, bool isLast) -{ - char title[16]{}; - title[0] = gn.letter; - title[1] = '\0'; - - std::shared_ptr header = MakeText(title, K_HEADER_HEIGHT, K_COLOR_HEADER_BG); - group->SetHeader(header); - - if (isLast) { - std::shared_ptr footer = MakeText(K_FOOTER_TEXT, K_FOOTER_HEIGHT, K_COLOR_FOOTER_BG); - group->SetFooter(footer); - } -} - -/** 为组创建 Adapter 回调:onCreate 生成可滑动条目,onBind 写入文案与上下文 */ -static NodeAdapterCallbacks CreateGroupAdapterCallbacks(const std::shared_ptr> &items, - std::shared_ptr adapter) -{ - NodeAdapterCallbacks cb = CreateGroupCallbacks(items); - - cb.onCreate = [items, adapterWeak = std::weak_ptr(adapter)]( - ArkUI_NativeNodeAPI_1 *api, int32_t /*index*/) -> ArkUI_NodeHandle { - OH_LOG_Print(LOG_APP, LOG_DEBUG, K_LOG_DOMAIN, LOG_TAG, "Creating list item"); - return CreateListItemWithSwipe(api, items, adapterWeak); - }; - - cb.onBind = [items, adapterWeak = std::weak_ptr(adapter)](ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle item, int32_t index) { - OH_LOG_Print(LOG_APP, LOG_DEBUG, K_LOG_DOMAIN, LOG_TAG, "Binding item at index=%d", index); - BindListItemContent(api, item, index, items, adapterWeak); - }; - - return cb; -} - -static std::shared_ptr BuildGroup(int gIndex, bool isLast, - const std::shared_ptr & /*st*/) -{ - const GroupNames &gn = g_groups[static_cast(gIndex)]; - std::shared_ptr group = std::make_shared(); - - SetupGroupHeaderAndFooter(group, gn, isLast); - - std::shared_ptr> items = CreateGroupItemsData(gn); - std::shared_ptr adapter = - std::make_shared(static_cast(ARKUI_NODE_LIST_ITEM)); - NodeAdapterCallbacks cb = CreateGroupAdapterCallbacks(items, adapter); - - adapter->SetCallbacks(cb); - group->SetLazyAdapter(adapter); - return group; -} - -/** 创建根布局:左侧列表 + 右侧索引条;支持滚动联动索引高亮与触底高亮 */ -std::shared_ptr CreateAlphabetIndexedListExample() -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - ArkUI_NodeHandle rootHandle = api->createNode(ARKUI_NODE_ROW); - std::shared_ptr root = std::make_shared(rootHandle); - - root->SetWidthPercent(K_FULL_PERCENT); - root->SetHeightPercent(K_FULL_PERCENT); - - std::shared_ptr list = ApplyListSafeProps(); - std::shared_ptr st = std::make_shared(); - st->groupVisible.assign(K_ALPHABET_COUNT, false); - - for (int g = 0; g < K_ALPHABET_COUNT; ++g) { - bool isLast = (g == K_ALPHABET_COUNT - 1); - std::shared_ptr grp = BuildGroup(g, isLast, st); - list->AddChild(std::static_pointer_cast(grp)); - } - - std::shared_ptr right = BuildRightIndexColumn(list, st); - list->RegisterOnScrollIndex([st](int32_t first, int32_t last) { - int idx = first; - if (last == K_ALPHABET_COUNT - 1) { - idx = last; - } - if (idx < 0) { - return; - } - if (idx >= K_ALPHABET_COUNT) { - idx = K_ALPHABET_COUNT - 1; - } - UpdateIndexHighlight(st, idx); - }); - - // 触底时强制高亮最后一组 - list->RegisterOnReachEnd([st]() { UpdateIndexHighlight(st, K_ALPHABET_COUNT - 1); }); - - // 初始高亮 A 组 - UpdateIndexHighlight(st, K_FIRST_GROUP_INDEX); - - root->AddChild(list); - root->AddChild(right); - - static std::vector> g_keepAlive; - g_keepAlive.emplace_back(root); - return root; -} - -ArkUI_NodeHandle ListMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (api == nullptr) { - return nullptr; - } - - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (page == nullptr) { - return nullptr; - } - - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - std::shared_ptr root = CreateAlphabetIndexedListExample(); - if (root && root->GetHandle() != nullptr) { - SetAttributeFloat32(api, root->GetHandle(), NODE_LAYOUT_WEIGHT, 1.0f); - api->addChild(page, root->GetHandle()); - } - return page; -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListMaker.h deleted file mode 100644 index 541fa3b460e74d7abdffcd339bcdf0b955f8e2bd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ListMaker.h +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef LIST_MAKER_H -#define LIST_MAKER_H - -#include -#include - -#include -#include -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollableEvent.h" -#include "ArkUINodeAdapter.h" - -#ifndef LOG_TAG -#define LOG_TAG "ListMaker" -#endif - -class ListMaker : public BaseNode { -public: - static ArkUI_NodeHandle CreateNativeNode(); - - // 嵌套滚动模式常量 - static constexpr int32_t kNestedScrollParentFirst = 0; - static constexpr int32_t kNestedScrollChildFirst = 1; - static constexpr int32_t kNestedScrollSelfFirst = 2; - - // 组件事件数据数组索引常量 - static constexpr int32_t kScrollIndexFirstDataIndex = 0; - static constexpr int32_t kScrollIndexLastDataIndex = 3; - - static constexpr int32_t kVisibleChangeFirstChildDataIndex = 0; - static constexpr int32_t kVisibleChangeStartAreaDataIndex = 1; - static constexpr int32_t kVisibleChangeStartIndexDataIndex = 2; - static constexpr int32_t kVisibleChangeLastChildDataIndex = 3; - static constexpr int32_t kVisibleChangeEndAreaDataIndex = 4; - static constexpr int32_t kVisibleChangeEndIndexDataIndex = 5; - - static constexpr int32_t kScrollFrameBeginDataIndex = 0; - - static constexpr uint32_t kColorTransparent = 0x00000000U; - - // —— 可视内容变化事件数据 —— // - struct VisibleContentChange { - int32_t firstChildIndex = -1; // 可视区域首个“子组件”(item/header/footer)索引 - ArkUI_ListItemGroupArea startArea = ARKUI_LIST_ITEM_GROUP_AREA_OUTSIDE; // 起点区 - int32_t startItemIndex = -1; // 若起点不是 item,则为 -1 - - int32_t lastChildIndex = -1; // 可视区域最后一个“子组件”索引 - ArkUI_ListItemGroupArea endArea = ARKUI_LIST_ITEM_GROUP_AREA_OUTSIDE; // 终点区 - int32_t endItemIndex = -1; // 若终点不是 item,则为 -1 - - bool StartOnItem() const { return startArea == ARKUI_LIST_ITEM_SWIPE_AREA_ITEM && startItemIndex >= 0; } - bool EndOnItem() const { return endArea == ARKUI_LIST_ITEM_SWIPE_AREA_ITEM && endItemIndex >= 0; } - }; - -public: - ListMaker() - : BaseNode(NodeApiInstance::GetInstance()->GetNativeNodeAPI()->createNode(ARKUI_NODE_LIST)), - nodeApi_(NodeApiInstance::GetInstance()->GetNativeNodeAPI()) - { - if (!IsNotNull(nodeApi_) || !IsNotNull(GetHandle())) { - return; - } - - nodeApi_->addNodeEventReceiver(GetHandle(), &ListMaker::StaticEventReceiver); - const uint32_t scrollEventMask = SCROLL_EVT_FRAME_BEGIN | SCROLL_EVT_REACH_END; - scrollEventGuard_.Bind(nodeApi_, GetHandle(), this, scrollEventMask); - } - - ~ListMaker() override - { - scrollEventGuard_.Release(); - - if (!IsNotNull(nodeApi_)) { - return; - } - UnregisterSpecificEvents(); - ResetListAdapter(); - CleanupChildrenMainSizeOption(); - } - - // ======================================== - // 通用属性设置接口 - // ======================================== - void SetClipContent(bool clipEnabled) - { - SetAttributeInt32(nodeApi_, GetHandle(), NODE_SCROLL_CLIP_CONTENT, clipEnabled ? 1 : 0); - } - - void SetEdgeEffectSpring(bool springEnabled) - { - int32_t effectValue = springEnabled ? ARKUI_EDGE_EFFECT_SPRING : ARKUI_EDGE_EFFECT_NONE; - SetAttributeInt32(nodeApi_, GetHandle(), NODE_SCROLL_EDGE_EFFECT, effectValue); - } - - void SetScrollBarVisible(bool visible) - { - int32_t displayMode = visible ? ARKUI_SCROLL_BAR_DISPLAY_MODE_ON : ARKUI_SCROLL_BAR_DISPLAY_MODE_OFF; - SetAttributeInt32(nodeApi_, GetHandle(), NODE_SCROLL_BAR_DISPLAY_MODE, displayMode); - } - - void SetItemSpacing(float spacing) { SetAttributeFloat32(nodeApi_, GetHandle(), NODE_LIST_SPACE, spacing); } - - void SetScrollBarState(bool visible) { SetScrollBarVisible(visible); } - void SetSpace(float spacing) { SetItemSpacing(spacing); } - - void SetNestedScrollMode(int32_t mode) - { - SetAttributeInt32(nodeApi_, GetHandle(), NODE_SCROLL_NESTED_SCROLL, mode); - } - - // ======================================== - // 滚动控制接口 - // ======================================== - void ScrollToIndex(int32_t index) { ScrollToIndex(index, false, ARKUI_SCROLL_ALIGNMENT_START); } - - void ScrollToIndex(int32_t index, bool smooth, ArkUI_ScrollAlignment align) - { - ArkUI_NumberValue v[3]; - v[0].i32 = index; // value[0] - v[1].i32 = smooth ? 1 : 0; // value[1] (optional) - v[2].i32 = static_cast(align); // value[2] (optional) - - ArkUI_AttributeItem it{v, 3}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_SCROLL_TO_INDEX, &it); - } - - void ScrollToIndexInGroup(int32_t groupIndex, int32_t itemIndex) - { - ArkUI_NumberValue values[] = {{.i32 = groupIndex}, {.i32 = itemIndex}}; - ArkUI_AttributeItem item{values, 2}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_SCROLL_TO_INDEX_IN_GROUP, &item); - } - - // ======================================== - // 适配器设置接口 - // ======================================== - void SetLazyAdapter(const std::shared_ptr &adapter) - { - if (!IsNotNull(adapter)) { - nodeApi_->resetAttribute(GetHandle(), NODE_LIST_NODE_ADAPTER); - listAdapter_.reset(); - return; - } - adapter->EnsurePlaceholderTypeOr(static_cast(ARKUI_NODE_LIST_ITEM)); - ArkUI_AttributeItem item{nullptr, 0, nullptr, adapter->GetAdapter()}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_NODE_ADAPTER, &item); - listAdapter_ = adapter; - } - - // —— 扩展属性 —— // - void SetDirection(ArkUI_Axis axis) - { - ArkUI_NumberValue v0{}; - v0.i32 = static_cast(axis); - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_DIRECTION, &it); - } - - void SetSticky(ArkUI_StickyStyle sticky) - { - ArkUI_NumberValue v0{}; - v0.i32 = static_cast(sticky); - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_STICKY, &it); - } - - void SetCachedCount(int32_t count) - { - ArkUI_NumberValue v0{}; - v0.i32 = count; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_CACHED_COUNT, &it); - } - - void SetInitialIndex(int32_t index) - { - ArkUI_NumberValue v0{}; - v0.i32 = index; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_INITIAL_INDEX, &it); - } - - void SetDivider(float widthPx) - { - ArkUI_NumberValue v0{}; - v0.f32 = widthPx; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_DIVIDER, &it); - } - - void SetAlignListItem(ArkUI_ListItemAlignment align) - { - ArkUI_NumberValue v0{}; - v0.i32 = static_cast(align); - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_ALIGN_LIST_ITEM, &it); - } - - void SetChildrenMainSizeOption(ArkUI_ListChildrenMainSize *opt) - { - ArkUI_AttributeItem it{nullptr, 0, nullptr, opt}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_CHILDREN_MAIN_SIZE, &it); - childrenMainSizeOption_ = opt; - } - - void SetFocusWrapMode(int mode) - { - ArkUI_NumberValue v0{}; - v0.i32 = mode; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_FOCUS_WRAP_MODE, &it); - } - - void SetMaintainVisibleContentPosition(bool on) - { - ArkUI_NumberValue v0{}; - v0.i32 = on ? 1 : 0; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_MAINTAIN_VISIBLE_CONTENT_POSITION, &it); - } - - void SetStackFromEnd(bool on) - { - ArkUI_NumberValue v0{}; - v0.i32 = on ? 1 : 0; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_STACK_FROM_END, &it); - } - - void SetSyncLoad(bool on) - { - ArkUI_NumberValue v0{}; - v0.i32 = on ? 1 : 0; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_SYNC_LOAD, &it); - } - - void SetScrollSnapAlign(int align /*ARKUI_SCROLL_SNAP_ALIGN_**/) - { - ArkUI_NumberValue v0{}; - v0.i32 = align; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_SCROLL_SNAP_ALIGN, &it); - } - - void SetLanes(int lanes) - { - ArkUI_NumberValue v0{}; - v0.i32 = lanes; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_LANES, &it); - } - - void SetContentOffsets(float startPx, float endPx) - { - ArkUI_NumberValue v0{}; - v0.f32 = startPx; - ArkUI_AttributeItem it0{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_SCROLL_CONTENT_START_OFFSET, &it0); - - ArkUI_NumberValue v1{}; - v1.f32 = endPx; - ArkUI_AttributeItem it1{&v1, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_SCROLL_CONTENT_END_OFFSET, &it1); - } - - // ======================================== - // 事件注册接口 - // ======================================== - void RegisterOnScrollIndex(const std::function &callback) - { - onScrollIndexCallback_ = callback; - if (!isScrollIndexEventRegistered_) { - nodeApi_->registerNodeEvent(GetHandle(), NODE_LIST_ON_SCROLL_INDEX, 0, this); - isScrollIndexEventRegistered_ = true; - } - } - - // 可视区域变化 - void RegisterOnVisibleContentChange(const std::function &callback) - { - onVisibleChangeCallback_ = callback; - if (!isVisibleChangeEventRegistered_) { - nodeApi_->registerNodeEvent(GetHandle(), NODE_LIST_ON_SCROLL_VISIBLE_CONTENT_CHANGE, 0, this); - isVisibleChangeEventRegistered_ = true; - } - } - - void RegisterOnWillScroll(const std::function &callback) - { - onWillScrollCallback_ = callback; - if (!isWillScrollEventRegistered_) { - nodeApi_->registerNodeEvent(GetHandle(), NODE_LIST_ON_WILL_SCROLL, 0, this); - isWillScrollEventRegistered_ = true; - } - } - - void RegisterOnDidScroll(const std::function &callback) - { - onDidScrollCallback_ = callback; - if (!isDidScrollEventRegistered_) { - nodeApi_->registerNodeEvent(GetHandle(), NODE_LIST_ON_DID_SCROLL, 0, this); - isDidScrollEventRegistered_ = true; - } - } - - void RegisterOnReachEnd(const std::function &callback) { onReachEndCallback_ = callback; } - - void RegisterOnScrollFrameBegin(const std::function &callback) - { - onScrollFrameBeginCallback_ = callback; - } - -protected: - void OnNodeEvent(ArkUI_NodeEvent *event) override - { - BaseNode::OnNodeEvent(event); - - ArkUI_NodeComponentEvent *componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (!IsNotNull(componentEvent)) { - return; - } - - int32_t eventType = OH_ArkUI_NodeEvent_GetEventType(event); - HandleSpecificListEvent(eventType, componentEvent); - } - -private: - void UnregisterSpecificEvents() - { - if (isScrollIndexEventRegistered_) { - nodeApi_->unregisterNodeEvent(GetHandle(), NODE_LIST_ON_SCROLL_INDEX); - } - if (isVisibleChangeEventRegistered_) { - nodeApi_->unregisterNodeEvent(GetHandle(), NODE_LIST_ON_SCROLL_VISIBLE_CONTENT_CHANGE); - } - if (isWillScrollEventRegistered_) { - nodeApi_->unregisterNodeEvent(GetHandle(), NODE_LIST_ON_WILL_SCROLL); - } - if (isDidScrollEventRegistered_) { - nodeApi_->unregisterNodeEvent(GetHandle(), NODE_LIST_ON_DID_SCROLL); - } - } - - void ResetListAdapter() - { - if (IsNotNull(listAdapter_)) { - nodeApi_->resetAttribute(GetHandle(), NODE_LIST_NODE_ADAPTER); - listAdapter_.reset(); - } - } - - void CleanupChildrenMainSizeOption() - { - if (IsNotNull(childrenMainSizeOption_)) { - nodeApi_->resetAttribute(GetHandle(), NODE_LIST_CHILDREN_MAIN_SIZE); - OH_ArkUI_ListChildrenMainSizeOption_Dispose(childrenMainSizeOption_); - childrenMainSizeOption_ = nullptr; - } - } - - void OnScrollIndexEvt(const ArkUI_NodeComponentEvent *ev) - { - if (!onScrollIndexCallback_) { - return; - } - const int32_t firstIndex = ev->data[kScrollIndexFirstDataIndex].i32; - const int32_t lastIndex = ev->data[kScrollIndexLastDataIndex].i32; - onScrollIndexCallback_(firstIndex, lastIndex); - } - - void OnVisibleChangeEvt(const ArkUI_NodeComponentEvent *ev) - { - if (!onVisibleChangeCallback_) { - return; - } - VisibleContentChange v{}; - v.firstChildIndex = ev->data[kVisibleChangeFirstChildDataIndex].i32; - v.startArea = static_cast(ev->data[kVisibleChangeStartAreaDataIndex].i32); - v.startItemIndex = ev->data[kVisibleChangeStartIndexDataIndex].i32; - v.lastChildIndex = ev->data[kVisibleChangeLastChildDataIndex].i32; - v.endArea = static_cast(ev->data[kVisibleChangeEndAreaDataIndex].i32); - v.endItemIndex = ev->data[kVisibleChangeEndIndexDataIndex].i32; - onVisibleChangeCallback_(v); - } - - void OnReachEndEvt() - { - if (onReachEndCallback_) { - onReachEndCallback_(); - } - } - - void OnScrollFrameBeginEvt(const ArkUI_NodeComponentEvent *ev) - { - if (onScrollFrameBeginCallback_) { - onScrollFrameBeginCallback_(ev->data[kScrollFrameBeginDataIndex].f32); - } - } - - void OnWillScrollEvt() - { - if (onWillScrollCallback_) { - onWillScrollCallback_(); - } - } - - void OnDidScrollEvt() - { - if (onDidScrollCallback_) { - onDidScrollCallback_(); - } - } - - void HandleSpecificListEvent(int32_t eventType, ArkUI_NodeComponentEvent *ev) - { - switch (eventType) { - case NODE_LIST_ON_SCROLL_INDEX: - OnScrollIndexEvt(ev); - break; - case NODE_LIST_ON_SCROLL_VISIBLE_CONTENT_CHANGE: - OnVisibleChangeEvt(ev); - break; - case NODE_SCROLL_EVENT_ON_REACH_END: - OnReachEndEvt(); - break; - case NODE_SCROLL_EVENT_ON_SCROLL_FRAME_BEGIN: - OnScrollFrameBeginEvt(ev); - break; - case NODE_LIST_ON_WILL_SCROLL: - OnWillScrollEvt(); - break; - case NODE_LIST_ON_DID_SCROLL: - OnDidScrollEvt(); - break; - default: - break; - } - } - - ArkUI_ListChildrenMainSize *EnsureChildrenMainSizeOption() - { - if (!childrenMainSizeOption_) { - auto *opt = OH_ArkUI_ListChildrenMainSizeOption_Create(); - SetChildrenMainSizeOption(opt); - } - return childrenMainSizeOption_; - } - - void ChildrenMainSizeSetDefault(float mainSize) - { - auto *opt = EnsureChildrenMainSizeOption(); - if (!opt) { - return; - } - OH_ArkUI_ListChildrenMainSizeOption_SetDefaultMainSize(opt, mainSize); - } - - float ChildrenMainSizeGetDefault() const - { - if (!childrenMainSizeOption_) { - return 0.0f; - } - return OH_ArkUI_ListChildrenMainSizeOption_GetDefaultMainSize(childrenMainSizeOption_); - } - - void ChildrenMainSizeResize(int32_t size) - { - auto *opt = EnsureChildrenMainSizeOption(); - if (!opt) { - return; - } - OH_ArkUI_ListChildrenMainSizeOption_Resize(opt, size); - } - - void ChildrenMainSizeSplice(int32_t index, int32_t deleteCount, int32_t addCount) - { - auto *opt = EnsureChildrenMainSizeOption(); - if (!opt) { - return; - } - OH_ArkUI_ListChildrenMainSizeOption_Splice(opt, index, deleteCount, addCount); - } - - void ChildrenMainSizeUpdate(int32_t index, float mainSize) - { - auto *opt = EnsureChildrenMainSizeOption(); - if (!opt) { - return; - } - OH_ArkUI_ListChildrenMainSizeOption_UpdateSize(opt, index, mainSize); - } - - float ChildrenMainSizeGet(int32_t index) const - { - if (!childrenMainSizeOption_) { - return 0.0f; - } - return OH_ArkUI_ListChildrenMainSizeOption_GetMainSize(childrenMainSizeOption_, index); - } - -private: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - std::shared_ptr listAdapter_; - ArkUI_ListChildrenMainSize *childrenMainSizeOption_ = nullptr; - - // 事件回调函数 - std::function onScrollIndexCallback_; - std::function onVisibleChangeCallback_; - std::function onReachEndCallback_; - std::function onScrollFrameBeginCallback_; - std::function onWillScrollCallback_; - std::function onDidScrollCallback_; - - // 事件注册状态 - bool isScrollIndexEventRegistered_ = false; - bool isVisibleChangeEventRegistered_ = false; - bool isWillScrollEventRegistered_ = false; - bool isDidScrollEventRegistered_ = false; - - ScrollEventGuard scrollEventGuard_; -}; - -#endif // LIST_MAKER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/PublicEvent.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/PublicEvent.cpp deleted file mode 100644 index 3176fef2e7d0c1c63d68ea26d81308fb8c5442d2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/PublicEvent.cpp +++ /dev/null @@ -1,1023 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "manager.h" -#include "PublicEvent.h" - -const int32_t TARGET_ID_2 = 2; -const int32_t TARGET_ID_3 = 3; -const int32_t TARGET_ID_4 = 4; -const int32_t TARGET_ID_5 = 5; -const int32_t TARGET_ID_6 = 6; -const int32_t TARGET_ID_7 = 7; -const int32_t TARGET_ID_8 = 8; -const int32_t TARGET_ID_9 = 9; -const int32_t TARGET_ID_10 = 10; -const int32_t TARGET_ID_11 = 11; -const int32_t TARGET_ID_12 = 12; -const int32_t TARGET_ID_13 = 13; -const int32_t TARGET_ID_14 = 14; -const int32_t TARGET_ID_15 = 15; -const int32_t TARGET_ID_16 = 16; -const int32_t TARGET_ID_17 = 17; - -typedef struct { - ArkUI_NodeHandle columnControl; - ArkUI_NodeHandle buttonTwo; -} MyData; - -void CreateNodeWithCommonAttribute(ArkUI_NodeHandle parent, const char *attributeName, - std::function func) -{ - if (!Manager::nodeAPI_ || !parent) { - return; - } - static auto column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - ArkUI_NodeHandle row = Manager::nodeAPI_->createNode(ARKUI_NODE_ROW); - ArkUI_NodeHandle text = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - // row设置宽高、边框 - ArkUI_NumberValue rowWidthValue[] = {400}; - ArkUI_AttributeItem rowWidthItem = {rowWidthValue, 1}; - ArkUI_NumberValue rowHeightValue[] = {400}; - ArkUI_AttributeItem rowHeightItem = {rowHeightValue, 1}; - ArkUI_NumberValue borderWidthValue[] = {2}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - ArkUI_AttributeItem idItem = {.string = attributeName}; - Manager::nodeAPI_->setAttribute(row, NODE_WIDTH, &rowWidthItem); - Manager::nodeAPI_->setAttribute(row, NODE_HEIGHT, &rowHeightItem); - Manager::nodeAPI_->setAttribute(row, NODE_BORDER_WIDTH, &borderWidthItem); - Manager::nodeAPI_->setAttribute(row, NODE_ID, &idItem); - func(row); - // text设置文本内容 - std::string str = "通用属性: "; - str += attributeName; - ArkUI_AttributeItem contentItem = {.string = str.c_str()}; - ArkUI_NumberValue marginWidthValue[] = {5}; - ArkUI_AttributeItem marginWidthItem = {marginWidthValue, 1}; - Manager::nodeAPI_->setAttribute(text, NODE_TEXT_CONTENT, &contentItem); - Manager::nodeAPI_->setAttribute(text, NODE_MARGIN, &marginWidthItem); - Manager::nodeAPI_->addChild(column, text); - Manager::nodeAPI_->addChild(column, row); - Manager::nodeAPI_->addChild(parent, column); -} - -void StatesChangeHandler(int32_t currentStates, void *userData) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "UIStates", "UI state changed to: %{public}d", currentStates); - - // 根据当前状态调整UI样式 - if (currentStates == ArkUI_UIState::UI_STATE_NORMAL) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "UIStates", "Button is in NORMAL state"); - } else { - if (currentStates & ArkUI_UIState::UI_STATE_PRESSED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo UIStates", "Button is PRESSED"); - } - if (currentStates & ArkUI_UIState::UI_STATE_FOCUSED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo UIStates", "Button is FOCUSED"); - } - if (currentStates & ArkUI_UIState::UI_STATE_DISABLED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo UIStates", "Button is DISABLED"); - } - if (currentStates & ArkUI_UIState::UI_STATE_SELECTED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo UIStates", "Button is SELECTED"); - } - } -} - -void SetScrollAttribute(ArkUI_NodeHandle &scroll) -{ - if (!Manager::nodeAPI_) { - return; - } - ArkUI_NumberValue scrollWidthValue[] = {500}; - ArkUI_AttributeItem scrollWidthItem = {scrollWidthValue, 1}; - Manager::nodeAPI_->setAttribute(scroll, NODE_WIDTH, &scrollWidthItem); - ArkUI_NumberValue scrollHeightValue[] = {750}; - ArkUI_AttributeItem scrollHeightItem = {scrollHeightValue, 1}; - Manager::nodeAPI_->setAttribute(scroll, NODE_HEIGHT, &scrollHeightItem); - ArkUI_AttributeItem scrollNodeIdItem = {.string = "testScroll"}; - Manager::nodeAPI_->setAttribute(scroll, NODE_ID, &scrollNodeIdItem); -} - -void CreateNodeBackGroundColor(ArkUI_NodeHandle &scroll, ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_BACKGROUND_COLOR", [](ArkUI_NodeHandle node) { - if (node) { - ArkUI_NumberValue backColorValue[] = {{.u32 = 0xFF009A61}}; - ArkUI_AttributeItem backColorItem = {backColorValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BACKGROUND_COLOR, &backColorItem); - - ArkUI_AttributeItem idItem = {.string = "backgroundColumn"}; - Manager::nodeAPI_->setAttribute(node, NODE_ID, &idItem); - } - }); -} - -void CreateNodeEnabled(ArkUI_NodeHandle &scroll, ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_ENABLED", [](ArkUI_NodeHandle node) { - if (!Manager::nodeAPI_ || !node) { - return; - } - ArkUI_NodeHandle row = Manager::nodeAPI_->createNode(ARKUI_NODE_ROW); - ArkUI_NumberValue rowWidthValue[] = {400}; - ArkUI_AttributeItem rowWidthItem = {rowWidthValue, 1}; - ArkUI_NumberValue rowHeightValue[] = {100}; - ArkUI_AttributeItem rowHeightItem = {rowHeightValue, 1}; - Manager::nodeAPI_->setAttribute(row, NODE_WIDTH, &rowWidthItem); - Manager::nodeAPI_->setAttribute(row, NODE_HEIGHT, &rowHeightItem); - ArkUI_NodeHandle button1 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_NodeHandle button2 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_NumberValue btnWidthValue[] = {150}; - ArkUI_AttributeItem btnWidthItem = {btnWidthValue, 1}; - ArkUI_NumberValue btnHeightValue[] = {60}; - ArkUI_AttributeItem btnHeightItem = {btnHeightValue, 1}; - ArkUI_NumberValue btnMarginValue[] = {20}; - ArkUI_AttributeItem btnMarginItem = {btnMarginValue, 1}; - Manager::nodeAPI_->setAttribute(button1, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(button1, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(button1, NODE_MARGIN, &btnMarginItem); - Manager::nodeAPI_->setAttribute(button2, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(button2, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(button2, NODE_MARGIN, &btnMarginItem); - ArkUI_AttributeItem btn1TextItem = {.string = "Enabled Button"}; - Manager::nodeAPI_->setAttribute(button1, NODE_BUTTON_LABEL, &btn1TextItem); - ArkUI_AttributeItem idItem = {.string = "enabledButton"}; - Manager::nodeAPI_->setAttribute(button1, NODE_ID, &idItem); - ArkUI_AttributeItem btn2TextItem = {.string = "Not Enabled Button"}; - Manager::nodeAPI_->setAttribute(button2, NODE_BUTTON_LABEL, &btn2TextItem); - ArkUI_AttributeItem idItem1 = {.string = "notEnabledButton"}; - Manager::nodeAPI_->setAttribute(button2, NODE_ID, &idItem1); - // 为button1设置NODE_ENABLED属性 - ArkUI_NumberValue enableValue[] = {{.i32 = false}}; - ArkUI_AttributeItem enableItem = {enableValue, 1}; - Manager::nodeAPI_->setAttribute(button1, NODE_ENABLED, &enableItem); - // 将按钮添加到Row中 - Manager::nodeAPI_->addChild(row, button1); - Manager::nodeAPI_->addChild(row, button2); - // 将Row添加到传入的node中 - Manager::nodeAPI_->addChild(node, row); - }); -} - -ArkUI_NodeHandle CreateNodeZIndexStack() -{ - ArkUI_NodeHandle stack = Manager::nodeAPI_->createNode(ARKUI_NODE_STACK); - ArkUI_NumberValue stackWidthValue[] = {400}; - ArkUI_AttributeItem stackWidthItem = {stackWidthValue, 1}; - ArkUI_NumberValue stackHeightValue[] = {400}; - ArkUI_AttributeItem stackHeightItem = {stackHeightValue, 1}; - Manager::nodeAPI_->setAttribute(stack, NODE_WIDTH, &stackWidthItem); - Manager::nodeAPI_->setAttribute(stack, NODE_HEIGHT, &stackHeightItem); - return stack; -} - -ArkUI_NodeHandle CreateNodeZIndexText1() -{ - ArkUI_NodeHandle text1 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue text1WidthValue1[] = {100}; - ArkUI_AttributeItem text1WidthItem1 = {text1WidthValue1, 1}; - ArkUI_NumberValue text1HeightValue1[] = {100}; - ArkUI_AttributeItem text1HeightItem1 = {text1HeightValue1, 1}; - ArkUI_NumberValue backColorValue1[] = {{.u32 = 0xFFbbb2cb}}; - ArkUI_AttributeItem backColorItem1 = {backColorValue1, 1}; - Manager::nodeAPI_->setAttribute(text1, NODE_WIDTH, &text1WidthItem1); - Manager::nodeAPI_->setAttribute(text1, NODE_HEIGHT, &text1HeightItem1); - Manager::nodeAPI_->setAttribute(text1, NODE_BACKGROUND_COLOR, &backColorItem1); - ArkUI_AttributeItem idItem1 = {.string = "zIndexText1"}; - Manager::nodeAPI_->setAttribute(text1, NODE_ID, &idItem1); - ArkUI_NumberValue zIndexValue1[] = {{.i32 = 2}}; - ArkUI_AttributeItem zIndexItem1 = {zIndexValue1, 1}; - Manager::nodeAPI_->setAttribute(text1, NODE_Z_INDEX, &zIndexItem1); - ArkUI_AttributeItem text1TextItem = {.string = "text1 \nzindex(2)"}; - Manager::nodeAPI_->setAttribute(text1, NODE_TEXT_CONTENT, &text1TextItem); - return text1; -} - -ArkUI_NodeHandle CreateNodeZIndexText2() -{ - ArkUI_NodeHandle text2 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue text2WidthValue2[] = {200}; - ArkUI_AttributeItem text2WidthItem2 = {text2WidthValue2, 1}; - ArkUI_NumberValue text2HeightValue2[] = {200}; - ArkUI_AttributeItem text2HeightItem2 = {text2HeightValue2, 1}; - ArkUI_NumberValue backColorValue2[] = {{.u32 = 0xFFd2cab3}}; - ArkUI_AttributeItem backColorItem2 = {backColorValue2, 1}; - Manager::nodeAPI_->setAttribute(text2, NODE_WIDTH, &text2WidthItem2); - Manager::nodeAPI_->setAttribute(text2, NODE_HEIGHT, &text2HeightItem2); - Manager::nodeAPI_->setAttribute(text2, NODE_BACKGROUND_COLOR, &backColorItem2); - ArkUI_AttributeItem idItem2 = {.string = "zIndexText2"}; - Manager::nodeAPI_->setAttribute(text2, NODE_ID, &idItem2); - ArkUI_NumberValue zIndexValue2[] = {{.i32 = 1}}; - ArkUI_AttributeItem zIndexItem2 = {zIndexValue2, 1}; - Manager::nodeAPI_->setAttribute(text2, NODE_Z_INDEX, &zIndexItem2); - ArkUI_AttributeItem text2TextItem = {.string = "text2 \nzindex\n(1)"}; - Manager::nodeAPI_->setAttribute(text2, NODE_TEXT_CONTENT, &text2TextItem); - - return text2; -} - -void CreateNodeZIndex(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_Z_INDEX", [](ArkUI_NodeHandle node) { - auto stack = CreateNodeZIndexStack(); - auto text1 = CreateNodeZIndexText1(); - auto text2 = CreateNodeZIndexText2(); - - ArkUI_NodeHandle text3 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue text3WidthValue3[] = {300}; - ArkUI_AttributeItem text3WidthItem3 = {text3WidthValue3, 1}; - ArkUI_NumberValue text3HeightValue3[] = {300}; - ArkUI_AttributeItem text3HeightItem3 = {text3HeightValue3, 1}; - ArkUI_NumberValue backColorValue3[] = {{.u32 = 0xFFc1ccab}}; - ArkUI_AttributeItem backColorItem3 = {backColorValue3, 1}; - - Manager::nodeAPI_->setAttribute(text3, NODE_WIDTH, &text3WidthItem3); - Manager::nodeAPI_->setAttribute(text3, NODE_HEIGHT, &text3HeightItem3); - Manager::nodeAPI_->setAttribute(text3, NODE_BACKGROUND_COLOR, &backColorItem3); - - ArkUI_AttributeItem idItem3 = {.string = "zIndexText3"}; - Manager::nodeAPI_->setAttribute(text3, NODE_ID, &idItem3); - - ArkUI_NumberValue zIndexValue3[] = {{.i32 = 0}}; - ArkUI_AttributeItem zIndexItem3 = {zIndexValue3, 1}; - Manager::nodeAPI_->setAttribute(text3, NODE_Z_INDEX, &zIndexItem3); - - ArkUI_AttributeItem text3TextItem = {.string = "text3 \nzindex\n(0)"}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_CONTENT, &text3TextItem); - Manager::nodeAPI_->addChild(stack, text1); - Manager::nodeAPI_->addChild(stack, text2); - Manager::nodeAPI_->addChild(stack, text3); - Manager::nodeAPI_->addChild(node, stack); - }); -} - -ArkUI_NodeHandle CreateNodeVisibilityColumn() -{ - ArkUI_NodeHandle column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue columnWidthValue[] = {400}; - ArkUI_AttributeItem columnWidthItem = {columnWidthValue, 1}; - ArkUI_NumberValue columnHeightValue[] = {400}; - ArkUI_AttributeItem columnHeightItem = {columnHeightValue, 1}; - Manager::nodeAPI_->setAttribute(column, NODE_WIDTH, &columnWidthItem); - Manager::nodeAPI_->setAttribute(column, NODE_HEIGHT, &columnHeightItem); - return column; -} - -ArkUI_NodeHandle CreateNodeVisibilityRow1() -{ - ArkUI_NodeHandle row1 = Manager::nodeAPI_->createNode(ARKUI_NODE_ROW); - ArkUI_NumberValue row1WidthValue1[] = {100}; - ArkUI_AttributeItem row1WidthItem1 = {row1WidthValue1, 1}; - ArkUI_NumberValue row1HeightValue1[] = {100}; - ArkUI_AttributeItem row1HeightItem1 = {row1HeightValue1, 1}; - ArkUI_NumberValue backColorValue1[] = {{.u32 = 0xFFbbb2cb}}; - ArkUI_AttributeItem backColorItem1 = {backColorValue1, 1}; - ArkUI_NumberValue row1MarginValue[] = {20}; - ArkUI_AttributeItem row1MarginItem = {row1MarginValue, 1}; - Manager::nodeAPI_->setAttribute(row1, NODE_WIDTH, &row1WidthItem1); - Manager::nodeAPI_->setAttribute(row1, NODE_HEIGHT, &row1HeightItem1); - Manager::nodeAPI_->setAttribute(row1, NODE_BACKGROUND_COLOR, &backColorItem1); - Manager::nodeAPI_->setAttribute(row1, NODE_MARGIN, &row1MarginItem); - ArkUI_NumberValue visibility1Value[] = {{.i32 = ARKUI_VISIBILITY_NONE}}; - ArkUI_AttributeItem visibility1Item = {visibility1Value, 1}; - Manager::nodeAPI_->setAttribute(row1, NODE_VISIBILITY, &visibility1Item); - ArkUI_AttributeItem idItem = {.string = "visibilityRow1"}; - Manager::nodeAPI_->setAttribute(row1, NODE_ID, &idItem); - return row1; -} - -ArkUI_NodeHandle CreateNodeVisibilityRow2() -{ - ArkUI_NodeHandle row2 = Manager::nodeAPI_->createNode(ARKUI_NODE_ROW); - ArkUI_NumberValue row2WidthValue2[] = {100}; - ArkUI_AttributeItem row2WidthItem2 = {row2WidthValue2, 1}; - ArkUI_NumberValue row2HeightValue2[] = {100}; - ArkUI_AttributeItem row2HeightItem2 = {row2HeightValue2, 1}; - ArkUI_NumberValue backColorValue2[] = {{.u32 = 0xFFd2cab3}}; - ArkUI_AttributeItem backColorItem2 = {backColorValue2, 1}; - ArkUI_NumberValue row2MarginValue[] = {20}; - ArkUI_AttributeItem row2MarginItem = {row2MarginValue, 1}; - Manager::nodeAPI_->setAttribute(row2, NODE_WIDTH, &row2WidthItem2); - Manager::nodeAPI_->setAttribute(row2, NODE_HEIGHT, &row2HeightItem2); - Manager::nodeAPI_->setAttribute(row2, NODE_BACKGROUND_COLOR, &backColorItem2); - Manager::nodeAPI_->setAttribute(row2, NODE_MARGIN, &row2MarginItem); - ArkUI_NumberValue visibility2Value[] = {{.i32 = ARKUI_VISIBILITY_HIDDEN}}; - ArkUI_AttributeItem visibility2Item = {visibility2Value, 1}; - Manager::nodeAPI_->setAttribute(row2, NODE_VISIBILITY, &visibility2Item); - ArkUI_AttributeItem idItem = {.string = "visibilityRow2"}; - Manager::nodeAPI_->setAttribute(row2, NODE_ID, &idItem); - return row2; -} - -ArkUI_NodeHandle CreateNodeVisibilityRow3() -{ - ArkUI_NodeHandle row3 = Manager::nodeAPI_->createNode(ARKUI_NODE_ROW); - ArkUI_NumberValue row3WidthValue3[] = {100}; - ArkUI_AttributeItem row3WidthItem3 = {row3WidthValue3, 1}; - ArkUI_NumberValue row3HeightValue3[] = {100}; - ArkUI_AttributeItem row3HeightItem3 = {row3HeightValue3, 1}; - ArkUI_NumberValue backColorValue3[] = {{.u32 = 0xFFc1ccab}}; - ArkUI_AttributeItem backColorItem3 = {backColorValue3, 1}; - ArkUI_NumberValue row3MarginValue[] = {20}; - ArkUI_AttributeItem row3MarginItem = {row3MarginValue, 1}; - Manager::nodeAPI_->setAttribute(row3, NODE_WIDTH, &row3WidthItem3); - Manager::nodeAPI_->setAttribute(row3, NODE_HEIGHT, &row3HeightItem3); - Manager::nodeAPI_->setAttribute(row3, NODE_BACKGROUND_COLOR, &backColorItem3); - Manager::nodeAPI_->setAttribute(row3, NODE_MARGIN, &row3MarginItem); - ArkUI_NumberValue visibility3Value[] = {{.i32 = ARKUI_VISIBILITY_VISIBLE}}; - ArkUI_AttributeItem visibility3Item = {visibility3Value, 1}; - Manager::nodeAPI_->setAttribute(row3, NODE_VISIBILITY, &visibility3Item); - ArkUI_AttributeItem idItem = {.string = "visibilityRow3"}; - Manager::nodeAPI_->setAttribute(row3, NODE_ID, &idItem); - return row3; -} - -void CreateNodeVisibility(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_VISIBILITY", [](ArkUI_NodeHandle node) { - auto column = CreateNodeVisibilityColumn(); - // 创建两个Button按钮 - ArkUI_NodeHandle text1 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle text2 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle text3 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - auto row1 = CreateNodeVisibilityRow1(); - auto row2 = CreateNodeVisibilityRow2(); - auto row3 = CreateNodeVisibilityRow3(); - // 为button1设置文本内容 - ArkUI_AttributeItem text1TextItem = {.string = "ARKUI_VISIBILITY_NONE"}; - Manager::nodeAPI_->setAttribute(text1, NODE_TEXT_CONTENT, &text1TextItem); - // 为button2设置文本内容 - ArkUI_AttributeItem text2TextItem = {.string = "ARKUI_VISIBILITY_HIDDEN"}; - Manager::nodeAPI_->setAttribute(text2, NODE_TEXT_CONTENT, &text2TextItem); - // 为button2设置文本内容 - ArkUI_AttributeItem text3TextItem = {.string = "ARKUI_VISIBILITY_VISIBLE"}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_CONTENT, &text3TextItem); - // 将按钮添加到Row中 - Manager::nodeAPI_->addChild(column, text1); - Manager::nodeAPI_->addChild(column, row1); - Manager::nodeAPI_->addChild(column, text2); - Manager::nodeAPI_->addChild(column, row2); - Manager::nodeAPI_->addChild(column, text3); - Manager::nodeAPI_->addChild(column, row3); - // 将Row添加到传入的node中 - Manager::nodeAPI_->addChild(node, column); - }); -} - -ArkUI_NodeHandle CreateNodeHitTestBehaviorColumn() -{ - ArkUI_NodeHandle column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue columnWidthValue[] = {200}; - ArkUI_AttributeItem columnWidthItem = {columnWidthValue, 1}; - ArkUI_NumberValue columnHeightValue[] = {400}; - ArkUI_AttributeItem columnHeightItem = {columnHeightValue, 1}; - Manager::nodeAPI_->setAttribute(column, NODE_WIDTH, &columnWidthItem); - Manager::nodeAPI_->setAttribute(column, NODE_HEIGHT, &columnHeightItem); - return column; -} - -ArkUI_NodeHandle CreateNodeHitTestBehaviorRow() -{ - ArkUI_NodeHandle row = Manager::nodeAPI_->createNode(ARKUI_NODE_ROW); - ArkUI_NumberValue rowWidthValue[] = {200}; - ArkUI_AttributeItem rowWidthItem = {rowWidthValue, 1}; - ArkUI_NumberValue rowHeightValue[] = {100}; - ArkUI_AttributeItem rowHeightItem = {rowHeightValue, 1}; - Manager::nodeAPI_->setAttribute(row, NODE_WIDTH, &rowWidthItem); - Manager::nodeAPI_->setAttribute(row, NODE_HEIGHT, &rowHeightItem); - return row; -} - -ArkUI_NodeHandle CreateNodeHitTestBehaviorRow1() -{ - ArkUI_NodeHandle row1 = Manager::nodeAPI_->createNode(ARKUI_NODE_ROW); - // 设置Row属性 - ArkUI_NumberValue rowWidthValue[] = {200}; - ArkUI_AttributeItem rowWidthItem = {rowWidthValue, 1}; - ArkUI_NumberValue rowHeightValue[] = {100}; - ArkUI_AttributeItem rowHeightItem = {rowHeightValue, 1}; - Manager::nodeAPI_->setAttribute(row1, NODE_WIDTH, &rowWidthItem); - Manager::nodeAPI_->setAttribute(row1, NODE_HEIGHT, &rowHeightItem); - return row1; -} - -ArkUI_NodeHandle CreateNodeHitTestBehaviorText() -{ - static ArkUI_NodeHandle text = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue btnHeightValue[] = {60}; - ArkUI_AttributeItem btnHeightItem = {btnHeightValue, 1}; - ArkUI_NumberValue btnMarginValue[] = {20}; - ArkUI_AttributeItem btnMarginItem = {btnMarginValue, 1}; - ArkUI_NumberValue btnWidthValue1[] = {300}; - ArkUI_AttributeItem btnWidthItem1 = {btnWidthValue1, 1}; - Manager::nodeAPI_->setAttribute(text, NODE_WIDTH, &btnWidthItem1); - Manager::nodeAPI_->setAttribute(text, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(text, NODE_MARGIN, &btnMarginItem); - ArkUI_AttributeItem TextItem = {.string = "NODE_HIT_TEST_BEHAVIOR"}; - Manager::nodeAPI_->setAttribute(text, NODE_TEXT_CONTENT, &TextItem); - return text; -} - -ArkUI_NodeHandle CreateNodeHitTestBehaviorButton1() -{ - ArkUI_NodeHandle button1 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_NumberValue btnWidthValue[] = {150}; - ArkUI_AttributeItem btnWidthItem = {btnWidthValue, 1}; - ArkUI_NumberValue btnHeightValue[] = {60}; - ArkUI_AttributeItem btnHeightItem = {btnHeightValue, 1}; - ArkUI_NumberValue btnMarginValue[] = {20}; - ArkUI_AttributeItem btnMarginItem = {btnMarginValue, 1}; - Manager::nodeAPI_->setAttribute(button1, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(button1, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(button1, NODE_MARGIN, &btnMarginItem); - ArkUI_AttributeItem btn1TextItem = {.string = "Hit Test Button 1"}; - Manager::nodeAPI_->setAttribute(button1, NODE_BUTTON_LABEL, &btn1TextItem); - ArkUI_NumberValue enableValue[] = {{.i32 = ARKUI_HIT_TEST_MODE_DEFAULT}}; - ArkUI_AttributeItem enableItem = {enableValue, 1}; - Manager::nodeAPI_->setAttribute(button1, NODE_HIT_TEST_BEHAVIOR, &enableItem); - return button1; -} - -void CreateNodeHitTestBehavior(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_HIT_TEST_BEHAVIOR", [](ArkUI_NodeHandle node) { - auto column = CreateNodeHitTestBehaviorColumn(); - auto row = CreateNodeHitTestBehaviorRow(); - auto row1 = CreateNodeHitTestBehaviorRow1(); - auto text = CreateNodeHitTestBehaviorText(); - // 创建两个Button按钮 - auto button1 = CreateNodeHitTestBehaviorButton1(); - ArkUI_NodeHandle button2 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_NumberValue btnWidthValue[] = {150}; - ArkUI_AttributeItem btnWidthItem = {btnWidthValue, 1}; - ArkUI_NumberValue btnHeightValue[] = {60}; - ArkUI_AttributeItem btnHeightItem = {btnHeightValue, 1}; - ArkUI_NumberValue btnMarginValue[] = {20}; - ArkUI_AttributeItem btnMarginItem = {btnMarginValue, 1}; - - Manager::nodeAPI_->setAttribute(button2, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(button2, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(button2, NODE_MARGIN, &btnMarginItem); - - // 为button2设置文本内容 - ArkUI_AttributeItem btn2TextItem = {.string = "Hit Test Button 2"}; - Manager::nodeAPI_->setAttribute(button2, NODE_BUTTON_LABEL, &btn2TextItem); - - ArkUI_NumberValue enableValue2[] = {{.i32 = ARKUI_HIT_TEST_MODE_BLOCK}}; - ArkUI_AttributeItem enableItem2 = {enableValue2, 1}; - Manager::nodeAPI_->setAttribute(button2, NODE_HIT_TEST_BEHAVIOR, &enableItem2); - - // 为button1创建点击手势并绑定回调 - Manager::nodeAPI_->registerNodeEvent(button1, NODE_ON_CLICK_EVENT, TARGET_ID_9, text); - Manager::nodeAPI_->registerNodeEvent(button2, NODE_ON_CLICK_EVENT, TARGET_ID_17, text); - - // 将按钮添加到Row中 - Manager::nodeAPI_->addChild(row, button1); - Manager::nodeAPI_->addChild(row, button2); - Manager::nodeAPI_->addChild(row1, text); - - // 将Row添加到传入的node中 - Manager::nodeAPI_->addChild(column, row); - Manager::nodeAPI_->addChild(column, row1); - Manager::nodeAPI_->addChild(node, column); - }); -} - -void CreateNodeClickDistance(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_CLICK_DISTANCE", [](ArkUI_NodeHandle node) { - // 创建Row容器 - ArkUI_NodeHandle column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - // 设置Row属性 - ArkUI_NumberValue rowWidthValue[] = {400}; - ArkUI_AttributeItem rowWidthItem = {rowWidthValue, 1}; - ArkUI_NumberValue rowHeightValue[] = {400}; - ArkUI_AttributeItem rowHeightItem = {rowHeightValue, 1}; - Manager::nodeAPI_->setAttribute(column, NODE_WIDTH, &rowWidthItem); - Manager::nodeAPI_->setAttribute(column, NODE_HEIGHT, &rowHeightItem); - - // 创建Button按钮 - ArkUI_NodeHandle button1 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - static ArkUI_NodeHandle text = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - - ArkUI_NumberValue btnWidthValue[] = {150}; - ArkUI_AttributeItem btnWidthItem = {btnWidthValue, 1}; - ArkUI_NumberValue btnHeightValue[] = {60}; - ArkUI_AttributeItem btnHeightItem = {btnHeightValue, 1}; - ArkUI_NumberValue btnMarginValue[] = {25}; - ArkUI_AttributeItem btnMarginItem = {btnMarginValue, 1}; - - Manager::nodeAPI_->setAttribute(button1, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(button1, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(button1, NODE_MARGIN, &btnMarginItem); - ArkUI_NumberValue enableValue[] = {{.i32 = 5}}; - ArkUI_AttributeItem enableItem = {enableValue, 1}; - Manager::nodeAPI_->setAttribute(button1, NODE_CLICK_DISTANCE, &enableItem); - Manager::nodeAPI_->registerNodeEvent(button1, NODE_ON_CLICK_EVENT, TARGET_ID_8, text); - - ArkUI_NumberValue btnWidthValue1[] = {150}; - ArkUI_AttributeItem btnWidthItem1 = {btnWidthValue1, 1}; - Manager::nodeAPI_->setAttribute(text, NODE_WIDTH, &btnWidthItem1); - Manager::nodeAPI_->setAttribute(text, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(text, NODE_MARGIN, &btnMarginItem); - - Manager::nodeAPI_->addChild(column, button1); - Manager::nodeAPI_->addChild(column, text); - // 将Row添加到传入的node中 - Manager::nodeAPI_->addChild(node, column); - }); -} - -void CreateNodeVisibleAreaApproximateChangeRatio(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_VISIBLE_AREA_APPROXIMATE_CHANGE_RATIO ", [](ArkUI_NodeHandle node) { - // 创建Row容器 - ArkUI_NodeHandle row = Manager::nodeAPI_->createNode(ARKUI_NODE_ROW); - ArkUI_NumberValue rowWidthValue[] = {400}; - ArkUI_AttributeItem rowWidthItem = {rowWidthValue, 1}; - ArkUI_NumberValue rowHeightValue[] = {100}; - ArkUI_AttributeItem rowHeightItem = {rowHeightValue, 1}; - Manager::nodeAPI_->setAttribute(row, NODE_WIDTH, &rowWidthItem); - Manager::nodeAPI_->setAttribute(row, NODE_HEIGHT, &rowHeightItem); - - ArkUI_NumberValue areaApproximateValue[] = {0.5}; - ArkUI_AttributeItem areaApproximateItem = {areaApproximateValue, 1}; - - auto *option = OH_ArkUI_VisibleAreaEventOptions_Create(); - OH_ArkUI_VisibleAreaEventOptions_Dispose(option); - auto *options = OH_ArkUI_VisibleAreaEventOptions_Create(); - float *ratiosArray = new float[1]; - ratiosArray[0] = 0; - ratiosArray[1] = 1.0; - OH_ArkUI_VisibleAreaEventOptions_SetRatios(options, ratiosArray, TARGET_ID_2); - auto value = 1000; - OH_ArkUI_VisibleAreaEventOptions_SetExpectedUpdateInterval(options, value); - ArkUI_AttributeItem areaItem = {.object = options}; - - Manager::nodeAPI_->setAttribute(row, NODE_VISIBLE_AREA_APPROXIMATE_CHANGE_RATIO, &areaItem); - auto item = Manager::nodeAPI_->getAttribute(row, NODE_VISIBLE_AREA_APPROXIMATE_CHANGE_RATIO); - auto optionObject = reinterpret_cast(item->object); - int size = 3; - float *ratiosGet = new float[3]; - - OH_ArkUI_VisibleAreaEventOptions_GetRatios(optionObject, ratiosGet, &size); - - auto expectedUpdateInterva = OH_ArkUI_VisibleAreaEventOptions_GetExpectedUpdateInterval(optionObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "CreateNativeNode size == %{public}d", size); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "CreateNativeNode ratiosGet ratiosGet[0] == %{public}f ratiosGet[1] == %{public}f", ratiosGet[0], - ratiosGet[1]); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "CreateNativeNode expectedUpdateInterva == %{public}d", expectedUpdateInterva); - Manager::nodeAPI_->registerNodeEvent(row, NODE_VISIBLE_AREA_APPROXIMATE_CHANGE_EVENT, 0, nullptr); - Manager::nodeAPI_->addChild(node, row); - }); -} - -void CreateNodeTouchEvent(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_TOUCH_EVENT ", [](ArkUI_NodeHandle node) { - if (!Manager::nodeAPI_ || !node) { - return; - } - ArkUI_NodeHandle button1 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_NumberValue btnWidthValue[] = {150}; - ArkUI_AttributeItem btnWidthItem = {btnWidthValue, 1}; - ArkUI_NumberValue btnHeightValue[] = {60}; - ArkUI_AttributeItem btnHeightItem = {btnHeightValue, 1}; - ArkUI_NumberValue btnMarginValue[] = {20}; - ArkUI_AttributeItem btnMarginItem = {btnMarginValue, 1}; - - ArkUI_AttributeItem buttonLabel1 = {.string = "button1"}; - Manager::nodeAPI_->setAttribute(button1, NODE_BUTTON_LABEL, &buttonLabel1); - - Manager::nodeAPI_->setAttribute(button1, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(button1, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(button1, NODE_MARGIN, &btnMarginItem); - Manager::nodeAPI_->registerNodeEvent(button1, NODE_TOUCH_EVENT, 1, nullptr); - Manager::nodeAPI_->registerNodeEvent(node, NODE_TOUCH_EVENT, TARGET_ID_2, nullptr); - Manager::nodeAPI_->addChild(node, button1); - }); -} - -void CreateNodeEventOnAreaChange(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_EVENT_ON_AREA_CHANGE ", [](ArkUI_NodeHandle node) { - if (!Manager::nodeAPI_ || !node) { - return; - } - - // 清除原有的子节点 - Manager::nodeAPI_->removeAllChildren(node); - - auto column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue rowWidthValue[] = {400}; - ArkUI_AttributeItem rowWidthItem = {rowWidthValue, 1}; - ArkUI_NumberValue rowHeightValue[] = {400}; - ArkUI_AttributeItem rowHeightItem = {rowHeightValue, 1}; - Manager::nodeAPI_->setAttribute(column, NODE_WIDTH, &rowWidthItem); - Manager::nodeAPI_->setAttribute(column, NODE_HEIGHT, &rowHeightItem); - - Manager::nodeAPI_->registerNodeEvent(column, NODE_EVENT_ON_AREA_CHANGE, TARGET_ID_7, nullptr); - Manager::nodeAPI_->addChild(node, column); - }); -} - -void CreateNodeOnHover(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_ON_HOVER", [](ArkUI_NodeHandle node) { - if (!Manager::nodeAPI_ || !node) { - return; - } - Manager::nodeAPI_->registerNodeEvent(node, NODE_ON_HOVER, TARGET_ID_10, nullptr); - }); -} - -void CreateNodeOnMouse(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_ON_MOUSE", [](ArkUI_NodeHandle node) { - if (!Manager::nodeAPI_ || !node) { - return; - } - Manager::nodeAPI_->registerNodeEvent(node, NODE_ON_MOUSE, TARGET_ID_11, nullptr); - }); -} - -void CreateNodeOnFocusAxis(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_ON_FOCUS_AXIS", [](ArkUI_NodeHandle node) { - if (!Manager::nodeAPI_ || !node) { - return; - } - ArkUI_NumberValue btnWidthValue[] = {150}; - ArkUI_AttributeItem btnWidthItem = {btnWidthValue, 1}; - ArkUI_NumberValue btnHeightValue[] = {60}; - ArkUI_AttributeItem btnHeightItem = {btnHeightValue, 1}; - ArkUI_NumberValue btnMarginValue[] = {20}; - ArkUI_AttributeItem btnMarginItem = {btnMarginValue, 1}; - - auto button = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - - ArkUI_AttributeItem buttonLabel1 = {.string = "NODE_ON_FOCUS_AXIS"}; - Manager::nodeAPI_->setAttribute(button, NODE_BUTTON_LABEL, &buttonLabel1); - - Manager::nodeAPI_->setAttribute(button, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(button, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(button, NODE_MARGIN, &btnMarginItem); - Manager::nodeAPI_->registerNodeEvent(button, NODE_ON_FOCUS_AXIS, TARGET_ID_14, nullptr); - Manager::nodeAPI_->addChild(node, button); - }); -} - -void CreateNodeOnHoverEvent(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_ON_HOVER_EVENT", [](ArkUI_NodeHandle node) { - if (!Manager::nodeAPI_ || !node) { - return; - } - Manager::nodeAPI_->registerNodeEvent(node, NODE_ON_HOVER_EVENT, TARGET_ID_15, nullptr); - }); -} - -void CreateNodeOnHoverMove(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_ON_HOVER_MOVE", [](ArkUI_NodeHandle node) { - if (!Manager::nodeAPI_ || !node) { - return; - } - Manager::nodeAPI_->registerNodeEvent(node, NODE_ON_HOVER_MOVE, TARGET_ID_16, nullptr); - }); -} - -void AllRegisterNodeEventReceiverOne(int32_t targetId, ArkUI_NodeEvent *event) -{ - switch (targetId) { - case 0: { - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "CreateNativeNode componentEvent->data[0].i32 == %{public}d", componentEvent->data[0].i32); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "CreateNativeNode componentEvent->data[1].f32 == %{public}f", componentEvent->data[1].f32); - break; - } - case 1: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "CreateNativeNode button1 onTouch"); - auto uiEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); - auto result = OH_ArkUI_PointerEvent_SetStopPropagation(uiEvent, true); - break; - } - case TARGET_ID_2: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "CreateNativeNode column onTouch"); - break; - } - case TARGET_ID_12: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "NODE_EVENT_ON_ATTACH ,the component on the tree"); - ArkUI_NumberValue *value; - auto errorCode = OH_ArkUI_NodeEvent_GetNumberValue(event, 16, value); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "errorCode is %{public}d", errorCode); - } - default: - break; - } -} - -void AllRegisterNodeEventReceiverTwo(int32_t targetId, ArkUI_NodeEvent *event) -{ - switch (targetId) { - case TARGET_ID_3: { - auto uiNode = OH_ArkUI_NodeEvent_GetNodeHandle(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "buttonTwo of the type = %{public}d onAppear", - OH_ArkUI_NodeUtils_GetNodeType(uiNode)); - auto snapshotOptions = OH_ArkUI_CreateSnapshotOptions(); - OH_PixelmapNative *pixelmap; - auto errorCode = OH_ArkUI_GetNodeSnapshot(uiNode, snapshotOptions, &pixelmap); - if (errorCode) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "errorCode is %{public}d", errorCode); - } - break; - } - case TARGET_ID_13: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "NODE_EVENT_ON_DETACH ,the component is moved on the tree"); - ArkUI_NumberValue *value; - auto errorCode = OH_ArkUI_NodeEvent_SetReturnNumberValue(event, value, 10); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "errorCode is %{public}d", errorCode); - } - case TARGET_ID_4: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "buttonTwo onDisAppear"); - break; - } - case TARGET_ID_5: { - MyData *component = (MyData *)OH_ArkUI_NodeEvent_GetUserData(event); - Manager::nodeAPI_->addChild(component->columnControl, component->buttonTwo); - break; - } - case TARGET_ID_6: { - MyData *component = (MyData *)OH_ArkUI_NodeEvent_GetUserData(event); - Manager::nodeAPI_->removeChild(component->columnControl, component->buttonTwo); - break; - } - case TARGET_ID_7: { - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "CreateNativeNode componentEvent->data[0].i32 == %{public}d", componentEvent->data[0].i32); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "NODE_EVENT_ON_AREA_CHANGE"); - auto uiEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); - auto result = OH_ArkUI_PointerEvent_SetStopPropagation(uiEvent, true); - break; - } - default: - break; - } -} - -void AllRegisterNodeEventReceiverThree(int32_t targetId, ArkUI_NodeEvent *event) -{ - switch (targetId) { - case TARGET_ID_8: { - auto text = OH_ArkUI_NodeEvent_GetUserData(event); - ArkUI_AttributeItem TextItem = {.string = "click distance is true"}; - Manager::nodeAPI_->setAttribute(static_cast(text), NODE_TEXT_CONTENT, &TextItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "click distance is true"); - break; - } - case TARGET_ID_9: { - auto text = OH_ArkUI_NodeEvent_GetUserData(event); - ArkUI_AttributeItem TextItem = {.string = "ARKUI_HIT_TEST_MODE_DEFAULT"}; - Manager::nodeAPI_->setAttribute(static_cast(text), NODE_TEXT_CONTENT, &TextItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "HitTestMode inner button touched type ARKUI_HIT_TEST_MODE_DEFAULT: = %{public}p", - OH_ArkUI_NodeEvent_GetEventType(event)); - break; - } - case TARGET_ID_10: { - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "NODE_ON_HOVER ,the mouse on the component : %{public}p", componentEvent->data[0].i32); - break; - } - case TARGET_ID_11: { - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "NODE_ON_MOUSE ,the mouse click or move on the component : %{public}p", - componentEvent->data[0].i32); - break; - } - case TARGET_ID_14: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "NODE_ON_FOCUS_AXIS is used"); - break; - } - - case TARGET_ID_15: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "NODE_ON_HOVER_EVENT is used"); - break; - } - case TARGET_ID_16: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "NODE_ON_HOVER_MOVE is used"); - break; - } - default: - break; - } -} - -void AllRegisterNodeEventReceiver() -{ - Manager::nodeAPI_->registerNodeEventReceiver([](ArkUI_NodeEvent *event) { - auto targetId = OH_ArkUI_NodeEvent_GetTargetId(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "CreateNativeNode targetId == %{public}d", - targetId); - switch (targetId) { - case 0: - case 1: - case TARGET_ID_2: - case TARGET_ID_12: { - AllRegisterNodeEventReceiverOne(targetId, event); - } - case TARGET_ID_3: - case TARGET_ID_13: - case TARGET_ID_4: - case TARGET_ID_5: - case TARGET_ID_6: - case TARGET_ID_7: { - AllRegisterNodeEventReceiverTwo(targetId, event); - break; - } - case TARGET_ID_8: - case TARGET_ID_9: - case TARGET_ID_10: - case TARGET_ID_11: - case TARGET_ID_14: - case TARGET_ID_15: - case TARGET_ID_16: { - AllRegisterNodeEventReceiverThree(targetId, event); - break; - } - case TARGET_ID_17: { - auto text = OH_ArkUI_NodeEvent_GetUserData(event); - ArkUI_AttributeItem TextItem = {.string = "ARKUI_HIT_TEST_MODE_BLOCK"}; - Manager::nodeAPI_->setAttribute(static_cast(text), NODE_TEXT_CONTENT, &TextItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "HitTestMode inner button touched type ARKUI_HIT_TEST_MODE_BLOCK: = %{public}p", - OH_ArkUI_NodeEvent_GetEventType(event)); - break; - } - default: - break; - } - }); -} - -void AddAndRemoveUIStates(ArkUI_NodeHandle &buttonControl1) -{ - int32_t targetStates = ArkUI_UIState::UI_STATE_SELECTED | ArkUI_UIState::UI_STATE_PRESSED; - auto arkUIErrorCode = - OH_ArkUI_AddSupportedUIStates(buttonControl1, targetStates, StatesChangeHandler, false, nullptr); - if (arkUIErrorCode) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", "AddSupportedUIStates errorCode is %{public}d", - arkUIErrorCode); - } - auto result = OH_ArkUI_RemoveSupportedUIStates(buttonControl1, - ArkUI_UIState::UI_STATE_SELECTED | ArkUI_UIState::UI_STATE_PRESSED); - if (result) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo", - "RemoveSupportedUIStates errorCode is %{public}d", result); - } -} - -ArkUI_NodeHandle CreateNodeEventOnAppearColumnControl() -{ - static auto columnControl = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue rowWidthValue[] = {400}; - ArkUI_AttributeItem rowWidthItem = {rowWidthValue, 1}; - ArkUI_NumberValue rowHeightValue[] = {400}; - ArkUI_AttributeItem rowHeightItem = {rowHeightValue, 1}; - Manager::nodeAPI_->setAttribute(columnControl, NODE_WIDTH, &rowWidthItem); - Manager::nodeAPI_->setAttribute(columnControl, NODE_HEIGHT, &rowHeightItem); - return columnControl; -} - -void CreateNodeEventOnAppear(ArkUI_NodeHandle &column) -{ - CreateNodeWithCommonAttribute(column, "NODE_EVENT_ON_APPEAR NODE_EVENT_ON_DISAPPEAR", [](ArkUI_NodeHandle node) { - auto columnControl = CreateNodeEventOnAppearColumnControl(); - static auto buttonControl = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - static auto buttonControl1 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - static auto buttonTwo = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_NumberValue btnWidthValue[] = {150}; - ArkUI_AttributeItem btnWidthItem = {btnWidthValue, 1}; - ArkUI_NumberValue btnHeightValue[] = {60}; - ArkUI_AttributeItem btnHeightItem = {btnHeightValue, 1}; - ArkUI_NumberValue btnMarginValue[] = {20}; - ArkUI_AttributeItem btnMarginItem = {btnMarginValue, 1}; - ArkUI_AttributeItem buttonLabel1 = {.string = "appear buttonTwo"}; - Manager::nodeAPI_->setAttribute(buttonControl, NODE_BUTTON_LABEL, &buttonLabel1); - Manager::nodeAPI_->setAttribute(buttonControl, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(buttonControl, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(buttonControl, NODE_MARGIN, &btnMarginItem); - ArkUI_AttributeItem buttonLabel2 = {.string = "disappear buttonTwo"}; - Manager::nodeAPI_->setAttribute(buttonControl1, NODE_BUTTON_LABEL, &buttonLabel2); - Manager::nodeAPI_->setAttribute(buttonControl1, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(buttonControl1, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(buttonControl1, NODE_MARGIN, &btnMarginItem); - ArkUI_AttributeItem buttonLabel3 = {.string = "buttonTwo"}; - Manager::nodeAPI_->setAttribute(buttonTwo, NODE_BUTTON_LABEL, &buttonLabel3); - Manager::nodeAPI_->setAttribute(buttonTwo, NODE_WIDTH, &btnWidthItem); - Manager::nodeAPI_->setAttribute(buttonTwo, NODE_HEIGHT, &btnHeightItem); - Manager::nodeAPI_->setAttribute(buttonTwo, NODE_MARGIN, &btnMarginItem); - Manager::nodeAPI_->registerNodeEvent(buttonTwo, NODE_EVENT_ON_APPEAR, TARGET_ID_3, nullptr); - Manager::nodeAPI_->registerNodeEvent(buttonTwo, NODE_EVENT_ON_DISAPPEAR, TARGET_ID_4, nullptr); - static MyData component; - component.buttonTwo = buttonTwo; - component.columnControl = columnControl; - Manager::nodeAPI_->registerNodeEvent(buttonControl, NODE_ON_CLICK_EVENT, TARGET_ID_5, &component); - Manager::nodeAPI_->registerNodeEvent(buttonControl1, NODE_ON_CLICK_EVENT, TARGET_ID_6, &component); - Manager::nodeAPI_->registerNodeEvent(buttonTwo, NODE_EVENT_ON_ATTACH, TARGET_ID_12, nullptr); - Manager::nodeAPI_->registerNodeEvent(buttonTwo, NODE_EVENT_ON_DETACH, TARGET_ID_13, nullptr); - AddAndRemoveUIStates(buttonControl1); - AllRegisterNodeEventReceiver(); - Manager::nodeAPI_->addChild(columnControl, buttonControl); - Manager::nodeAPI_->addChild(columnControl, buttonControl1); - Manager::nodeAPI_->addChild(columnControl, buttonTwo); - Manager::nodeAPI_->addChild(node, columnControl); - }); -} - -void AddScrollChild(ArkUI_NodeHandle &scroll) -{ - if (!Manager::nodeAPI_) { - return; - } - ArkUI_NodeHandle column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - // NODE_BACKGROUND_COLOR - CreateNodeBackGroundColor(scroll, column); - // NODE_ENABLED - CreateNodeEnabled(scroll, column); - // NODE_Z_INDEX - CreateNodeZIndex(column); - // NODE_VISIBILITY - CreateNodeVisibility(column); - // NODE_HIT_TEST_BEHAVIOR - CreateNodeHitTestBehavior(column); - // NODE_CLICK_DISTANCE - CreateNodeClickDistance(column); - // NODE_VISIBLE_AREA_APPROXIMATE_CHANGE_RATIO - CreateNodeVisibleAreaApproximateChangeRatio(column); - // NODE_TOUCH_EVENT - CreateNodeTouchEvent(column); - // NODE_EVENT_ON_AREA_CHANGE - CreateNodeEventOnAreaChange(column); - // NODE_ON_HOVER - CreateNodeOnHover(column); - // NODE_ON_MOUSE - CreateNodeOnMouse(column); - // NODE_ON_FOCUS_AXIS - CreateNodeOnFocusAxis(column); - // NODE_ON_HOVER_EVENT - CreateNodeOnHoverEvent(column); - // NODE_ON_HOVER_MOVE - CreateNodeOnHoverMove(column); - // NODE_EVENT_ON_APPEAR NODE_EVENT_ON_DISAPPEAR - CreateNodeEventOnAppear(column); - Manager::nodeAPI_->addChild(scroll, column); -} - -ArkUI_NodeHandle PublicMaker::CreateNativeNode() -{ - // 创建父子滚动容器 - ArkUI_NodeHandle scroll = Manager::nodeAPI_->createNode(ARKUI_NODE_SCROLL); - // 设置属性 - SetScrollAttribute(scroll); - AddScrollChild(scroll); - return scroll; -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/PublicEvent.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/PublicEvent.h deleted file mode 100644 index f4746c531e5b782e588590fafdcb825a02ca8983..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/PublicEvent.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -const int MAX_SIZE = 11; -class PublicMaker { -public: - PublicMaker(){}; - ~PublicMaker(){}; - - static ArkUI_NodeHandle CreateNativeNode(); -}; -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/RefreshMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/RefreshMaker.cpp deleted file mode 100644 index 76a9bfbe6d8c0b0ddcaf1299a9756bdc712358df..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/RefreshMaker.cpp +++ /dev/null @@ -1,617 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "ListMaker.h" -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#ifndef LOG_TAG -#define LOG_TAG "RefreshMaker" -#endif - -#include "ScrollableNode.h" -#include "ArkUINodeAdapter.h" -#include "ListItemGroup.h" -#include "ListItemSwipe.h" -#include "RefreshMaker.h" - -// ================= 业务常量 ================= -namespace { - -constexpr uint32_t K_COLOR_PAGE_BG = 0xFFF1F3F5U; -constexpr uint32_t K_ITEM_BG_COLOR = 0xFFFFFFFFU; -constexpr const char* K_LOADING_TEXT = "加载中…"; -constexpr float K_ITEM_FONT_SIZE = 16.0f; - -constexpr int K_INIT_COUNT = 10; -constexpr int K_LOAD_BATCH = 10; -constexpr int K_MAX_ITEMS = 100; -constexpr int K_REFRESH_PREPEND_COUNT = 5; -constexpr int K_MIN_REFRESH_MS = 350; - -constexpr float K_WIDTH_PERCENT_FULL = 1.0f; -constexpr float K_HEIGHT_PERCENT_FULL = 1.0f; -constexpr float K_LIST_SPACE = 12.0f; - -constexpr float K_REFRESH_OFFSET_VP = 64.0f; -constexpr float K_MAX_PULL_VP = 128.0f; -constexpr float K_PULL_DOWN_RATIO = 0.6f; - -constexpr bool K_LIST_CLIP_CONTENT = true; -constexpr bool K_LIST_EDGE_SPRING = true; -constexpr bool K_LIST_SCROLLBAR_VISIBLE = false; - -constexpr int K_MIN_INDEX = 0; -constexpr int K_LAST_INDEX_OFFSET = 1; - -// 样式 -constexpr float K_ROW_HEIGHT = 80.0f; -constexpr float K_FOOTER_HEIGHT = 64.0f; - -constexpr int64_t K_FOOTER_STABLE_ID = -16; - -} // namespace - -namespace { -constexpr int RET_OK = 0; - -inline bool Ok(int rc, const char* what) -{ - if (rc != RET_OK) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, - "%{public}s failed rc=%{public}d", what, rc); - return false; - } - return true; -} -} // namespace - -// ================= 状态 ================= -namespace { - -struct RefreshListState { - std::shared_ptr adapter; - std::vector data; - bool showLoadingFooter = false; - - int total = K_INIT_COUNT; // 逻辑总数(与 data.size() 同步增长) - int lastTriggeredTot = -1; - bool loading = false; - - bool NoMore() const { return total >= K_MAX_ITEMS; } - - int ItemsCount() const { return static_cast(data.size()); } - int RenderCount() const { return ItemsCount() + (showLoadingFooter ? 1 : 0); } -}; - -} // namespace - -// ================= 业务工具 ================= -namespace { - -/** - * 添加加载状态尾部 - * @param st 刷新列表状态 - */ -inline void AddLoadingFooter(const std::shared_ptr &st) -{ - const int footerIndex = st->ItemsCount(); - st->adapter->InsertRange(footerIndex, 1); - st->showLoadingFooter = true; -} - -/** - * 移除加载状态尾部 - * @param st 刷新列表状态 - */ -inline void RemoveLoadingFooter(const std::shared_ptr &st) -{ - const int footerIndex = st->ItemsCount(); - st->adapter->RemoveRange(footerIndex, 1); - st->showLoadingFooter = false; -} - -/** - * 切换加载状态尾部显示 - * @param st 刷新列表状态 - * @param on 是否显示 - */ -static void ToggleLoadingFooter(const std::shared_ptr &st, bool on) -{ - if (!st || !st->adapter) { - return; - } - - if (on && !st->showLoadingFooter) { - AddLoadingFooter(st); - } else if (!on && st->showLoadingFooter) { - RemoveLoadingFooter(st); - } -} - -/** - * 末尾追加批量数据 - * @param st 刷新列表状态 - * @param add 添加数量 - */ -static void AppendTailBatch(const std::shared_ptr &st, int add) -{ - if (!st || !st->adapter) { - return; - } - - const int base = st->total; - const int addClamped = std::min(add, K_MAX_ITEMS - base); - if (addClamped <= 0) { - return; - } - - // 先去掉 footer,再插入数据,再恢复 footer(避免 index 混淆) - const bool hadFooter = st->showLoadingFooter; - ToggleLoadingFooter(st, false); - - st->data.reserve(st->data.size() + static_cast(addClamped)); - for (int i = 0; i < addClamped; ++i) { - st->data.emplace_back(std::to_string(base + i)); - } - st->adapter->InsertRange(base, addClamped); - - st->total += addClamped; - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, - "AppendTailBatch add=%{public}d total=%{public}d", addClamped, st->total); - - if (hadFooter) { - ToggleLoadingFooter(st, true); - } -} - -} // namespace - -// ================= 适配器回调(通用 ArkUINodeAdapter) ================= -namespace { - -/** - * 创建列表项 - * @param api 原生节点API接口 - * @return 列表项节点句柄 - */ -static ArkUI_NodeHandle CreateListItem(ArkUI_NativeNodeAPI_1 *api) -{ - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - if (text == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, "create TEXT node null"); - return nullptr; - } - ArkUI_NodeHandle item = api->createNode(ARKUI_NODE_LIST_ITEM); - if (item == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, "create LIST_ITEM node null"); - return nullptr; - } - - if (int rc = api->addChild(item, text); !Ok(rc, "addChild(item,text)")) { - return nullptr; - } - - SetAttributeFloat32(api, item, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, K_ITEM_BG_COLOR); - - // 让文本也占满宽度 - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, 1.0f); - return item; -} - -/** - * 绑定为普通列表项 - * @param api 原生节点API接口 - * @param item 列表项节点句柄 - * @param txt 文本内容 - */ -static void BindAsNormal(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, const char *txt) -{ - ArkUI_NodeHandle text = api->getFirstChild(item); - if (!text) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, "BindAsNormal getFirstChild null"); - return; - } - - // 背景放在 item 上 - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, K_ITEM_BG_COLOR); - - // 文本占满宽度 - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, 1.0f); - - SetTextContent(api, text, txt); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_ITEM_FONT_SIZE); - SetAttributeFloat32(api, text, NODE_HEIGHT, K_ROW_HEIGHT); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, K_ROW_HEIGHT); - SetAttributeInt32(api, text, NODE_TEXT_ALIGN, ARKUI_TEXT_ALIGNMENT_CENTER); -} - -/** - * 绑定为加载尾部项 - * @param api 原生节点API接口 - * @param item 列表项节点句柄 - */ -static void BindAsFooter(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item) -{ - ArkUI_NodeHandle text = api->getFirstChild(item); - if (!text) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, "BindAsFooter getFirstChild null"); - return; - } - - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, K_ITEM_BG_COLOR); - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, 1.0f); - - SetTextContent(api, text, K_LOADING_TEXT); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_ITEM_FONT_SIZE); - SetAttributeFloat32(api, text, NODE_HEIGHT, K_FOOTER_HEIGHT); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, K_FOOTER_HEIGHT); - SetAttributeInt32(api, text, NODE_TEXT_ALIGN, ARKUI_TEXT_ALIGNMENT_CENTER); -} - -/** - * 创建节点适配器回调 - * @param st 刷新列表状态 - * @return 节点适配器回调结构 - */ -static NodeAdapterCallbacks MakeCallbacks(const std::shared_ptr &st) -{ - NodeAdapterCallbacks cb{}; - - cb.getTotalCount = [st]() -> int32_t { - return st ? st->RenderCount() : 0; - }; - - cb.getStableId = [st](int32_t i) -> uint64_t { - if (!st) { - return static_cast(i); - } - const int items = st->ItemsCount(); - if (st->showLoadingFooter && i == items) { - return static_cast(K_FOOTER_STABLE_ID); - } - if (i >= 0 && i < items) { - return static_cast(std::hash{}(st->data[static_cast(i)])); - } - return static_cast(i); - }; - - cb.onCreate = [](ArkUI_NativeNodeAPI_1 *api, int32_t /*index*/) -> ArkUI_NodeHandle { - return CreateListItem(api); - }; - - cb.onBind = [st](ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index) { - if (!st) { - return; - } - - const int items = st->ItemsCount(); - if (st->showLoadingFooter && index == items) { - BindAsFooter(api, item); - return; - } - if (index >= 0 && index < items) { - BindAsNormal(api, item, st->data[static_cast(index)].c_str()); - return; - } - BindAsNormal(api, item, ""); - }; - - return cb; -} - -/** - * 创建 ArkUINodeAdapter - */ -static std::shared_ptr MakeListAdapter(const std::shared_ptr &st) -{ - std::shared_ptr adapter = - std::make_shared(static_cast(ARKUI_NODE_LIST_ITEM)); - adapter->SetCallbacks(MakeCallbacks(st)); - return adapter; -} - -} // namespace - -// ================= 视图拼装 ================= -namespace { - -/** - * 创建根节点 - * @return 根节点智能指针 - */ -static std::shared_ptr MakeRoot() -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - ArkUI_NodeHandle h = api->createNode(ARKUI_NODE_COLUMN); - - std::shared_ptr root = std::make_shared(h); - root->SetWidthPercent(K_WIDTH_PERCENT_FULL); - root->SetHeightPercent(K_HEIGHT_PERCENT_FULL); - SetAttributeUInt32(api, root->GetHandle(), NODE_BACKGROUND_COLOR, K_COLOR_PAGE_BG); - return root; -} - -static void ConfigureList(const std::shared_ptr &list) -{ - list->SetWidthPercent(K_WIDTH_PERCENT_FULL); - list->SetHeightPercent(K_HEIGHT_PERCENT_FULL); - list->SetTransparentBackground(); - list->SetClipContent(K_LIST_CLIP_CONTENT); - list->SetEdgeEffectSpring(K_LIST_EDGE_SPRING); - list->SetScrollBarState(K_LIST_SCROLLBAR_VISIBLE); - list->SetSpace(K_LIST_SPACE); - list->SetNestedScrollMode(ListMaker::kNestedScrollParentFirst); -} - -/** - * 创建列表节点 - * @param group 列表项组节点 - * @return 列表节点智能指针 - */ -inline std::shared_ptr MakeList(const std::shared_ptr &group) -{ - std::shared_ptr list = std::make_shared(); - ConfigureList(list); - list->AddChild(std::static_pointer_cast(group)); - return list; -} - -/** - * 创建刷新节点 - * @param list 列表节点 - * @return 刷新节点智能指针 - */ -static std::shared_ptr MakeRefresh(const std::shared_ptr &list) -{ - std::shared_ptr refresh = std::make_shared(); - refresh->AttachChild(list); - refresh->SetTransparentBackground(); - refresh->SetPullToRefresh(true); - refresh->SetRefreshOffset(K_REFRESH_OFFSET_VP); - refresh->SetPullDownRatio(K_PULL_DOWN_RATIO); - refresh->SetMaxPullDownDistance(K_MAX_PULL_VP); - return refresh; -} - -// 触底加载 -static void WireReachEnd(const std::shared_ptr &st, const std::shared_ptr &list) -{ - list->RegisterOnReachEnd([st, list]() { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnReachEnd triggered"); - - if (!st || st->loading || st->lastTriggeredTot == st->total) { - return; - } - st->lastTriggeredTot = st->total; - - if (st->NoMore()) { - const int count = st->RenderCount(); - const int idx = std::max(K_MIN_INDEX, count - K_LAST_INDEX_OFFSET); - list->ScrollToIndex(idx); - return; - } - - st->loading = true; - ToggleLoadingFooter(st, true); - AppendTailBatch(st, K_LOAD_BATCH); - ToggleLoadingFooter(st, false); - st->loading = false; - }); -} - -static void OnVisibleChangeCore(const std::shared_ptr &st, - const std::shared_ptr &list, - int32_t endIdxInGroup) -{ - if (!st) { - return; - } - - const int items = st->ItemsCount(); - if (items <= 0) { - return; - } - - if (endIdxInGroup < items - K_LAST_INDEX_OFFSET) { - return; - } - - if (st->loading || st->lastTriggeredTot == st->total) { - return; - } - - st->lastTriggeredTot = st->total; - - if (st->NoMore()) { - const int count = st->RenderCount(); - const int idx = std::max(K_MIN_INDEX, count - K_LAST_INDEX_OFFSET); - list->ScrollToIndex(idx); - return; - } - - st->loading = true; - ToggleLoadingFooter(st, true); - AppendTailBatch(st, K_LOAD_BATCH); - ToggleLoadingFooter(st, false); - st->loading = false; -} - -inline void WireVisibleChange(const std::shared_ptr &st, const std::shared_ptr &list) -{ - using V = ListMaker::VisibleContentChange; - list->RegisterOnVisibleContentChange([st, list](const V &ev) { - const int32_t endIdx = ev.EndOnItem() ? ev.endItemIndex : -1; - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnVisibleContentChange endIdxInGroup=%{public}d", - endIdx); - OnVisibleChangeCore(st, list, endIdx); - }); -} - -static void PrependNewData(const std::shared_ptr &st) -{ - std::vector news; - news.reserve(K_REFRESH_PREPEND_COUNT); - for (int i = 0; i < K_REFRESH_PREPEND_COUNT; ++i) { - news.emplace_back(std::string("New Item ") + std::to_string(i)); - } - - const bool hadFooter = st->showLoadingFooter; - ToggleLoadingFooter(st, false); - - st->data.insert(st->data.begin(), news.begin(), news.end()); - st->adapter->InsertRange(0, K_REFRESH_PREPEND_COUNT); - - st->total = std::min(st->total + K_REFRESH_PREPEND_COUNT, K_MAX_ITEMS); - st->lastTriggeredTot = -1; - - if (hadFooter) { - ToggleLoadingFooter(st, true); - } - - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, - "OnRefresh prepend=%{public}d total=%{public}d", - K_REFRESH_PREPEND_COUNT, st->total); -} - -/** - * 刷新行为 - */ -static void WireRefreshBehavior(const std::shared_ptr &st, - const std::shared_ptr &refresh) -{ - static std::atomic_bool sRefreshing{false}; - - refresh->RegisterOnRefresh([st, refresh]() { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnRefresh triggered"); - - if (sRefreshing.exchange(true)) { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnRefresh ignored: busy"); - return; - } - - using Clock = std::chrono::steady_clock; - const auto t0 = Clock::now(); - - if (st && !st->NoMore()) { - PrependNewData(st); - } - - const int elapsedMs = - static_cast(std::chrono::duration_cast(Clock::now() - t0).count()); - const int delay = std::max(0, K_MIN_REFRESH_MS - elapsedMs); - - PostDelayedTask(delay, [refresh]() { - refresh->SetRefreshing(false); - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnRefresh complete"); - }); - - sRefreshing = false; - }); -} - -inline void WireRefreshLogs(const std::shared_ptr &refresh) -{ - refresh->RegisterOnOffsetChange([](float offsetVp) { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnOffsetChange offsetVp=%{public}f", offsetVp); - }); - refresh->RegisterOnStateChange([](int32_t state) { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnStateChange state=%{public}d", state); - }); -} - -/** - * Build - */ -static std::shared_ptr Build() -{ - // 根节点 - std::shared_ptr root = MakeRoot(); - - // 分组 + 列表 - std::shared_ptr group = std::make_shared(); - std::shared_ptr list = MakeList(group); - - // 刷新容器 - std::shared_ptr refresh = MakeRefresh(list); - - // 状态 - std::shared_ptr st = std::make_shared(); - st->data.reserve(K_MAX_ITEMS); - for (int i = 0; i < K_INIT_COUNT; ++i) { - st->data.emplace_back(std::to_string(i)); - } - st->total = K_INIT_COUNT; - - // 适配器 - st->adapter = MakeListAdapter(st); - group->SetLazyAdapter(st->adapter); - - // 行为绑定 - WireReachEnd(st, list); - WireVisibleChange(st, list); - WireRefreshBehavior(st, refresh); - WireRefreshLogs(refresh); - - // 组装 - root->AddChild(refresh); - - // keep alive - GetKeepAliveContainer().emplace_back(root); - GetKeepAliveContainer().emplace_back(refresh); - GetKeepAliveContainer().emplace_back(list); - GetKeepAliveContainer().emplace_back(group); - static std::vector> g_states; - g_states.emplace_back(st); - - return root; -} -} // namespace - -ArkUI_NodeHandle RefreshMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (api == nullptr) { - return nullptr; - } - - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (page == nullptr) { - return nullptr; - } - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - std::shared_ptr root = Build(); - if (root && root->GetHandle() != nullptr) { - SetAttributeFloat32(api, root->GetHandle(), NODE_LAYOUT_WEIGHT, 1.0f); - api->addChild(page, root->GetHandle()); - } - - return page; -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/RefreshMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/RefreshMaker.h deleted file mode 100644 index 6a7903b06fed6fff0639f990e49fa64d53d85345..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/RefreshMaker.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef REFRESH_MAKER_H -#define REFRESH_MAKER_H - -#include -#include - -#include -#include - -#include "ScrollableNode.h" - -inline constexpr int32_t K_REFRESH_OFFSET_DATA_INDEX = 0; -inline constexpr int32_t K_REFRESH_STATE_DATA_INDEX = 0; - -class RefreshMaker : public BaseNode { -public: - static ArkUI_NodeHandle CreateNativeNode(); - - RefreshMaker() - : BaseNode(NodeApiInstance::GetInstance()->GetNativeNodeAPI()->createNode(ARKUI_NODE_REFRESH)), - registrar_(nodeApi_, GetHandle()) - { - nodeApi_->addNodeEventReceiver(GetHandle(), StaticEvent); - } - - // ===== 属性(组件范围)===== - void SetRefreshing(bool refreshing) - { - ArkUI_NumberValue v[]{{.i32 = refreshing ? 1 : 0}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_REFRESHING, &item); - } - - void SetHeaderContent(const std::shared_ptr &header) - { - if (header == nullptr) { - nodeApi_->resetAttribute(GetHandle(), NODE_REFRESH_CONTENT); - header_.reset(); - return; - } - ArkUI_AttributeItem item{nullptr, 0, nullptr, header->GetHandle()}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_CONTENT, &item); - header_ = header; - } - - void SetPullDownRatio(float ratio) - { - ArkUI_NumberValue v[]{{.f32 = ratio}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_PULL_DOWN_RATIO, &item); - } - - void SetRefreshOffset(float vp) - { - ArkUI_NumberValue v[]{{.f32 = vp}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_OFFSET, &item); - } - - void SetPullToRefresh(bool enable) - { - ArkUI_NumberValue v[]{{.i32 = enable ? 1 : 0}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_PULL_TO_REFRESH, &item); - } - - void SetMaxPullDownDistance(float vp) - { - ArkUI_NumberValue v[]{{.f32 = vp}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_MAX_PULL_DOWN_DISTANCE, &item); - } - - void AttachChild(const std::shared_ptr &child) - { - if (child != nullptr) { - AddChild(child); - } - } - - // ===== 事件注册 ===== - void RegisterOnRefresh(const std::function &cb) - { - onRefresh_ = cb; - registrar_.RegisterEvent(NODE_REFRESH_ON_REFRESH, this); - } - - void RegisterOnOffsetChange(const std::function &cb) - { - onOffsetChange_ = cb; - registrar_.RegisterEvent(NODE_REFRESH_ON_OFFSET_CHANGE, this); - } - - void RegisterOnStateChange(const std::function &cb) - { - onStateChange_ = cb; - registrar_.RegisterEvent(NODE_REFRESH_STATE_CHANGE, this); - } - -private: - static void StaticEvent(ArkUI_NodeEvent *ev) - { - if (ev == nullptr) { - return; - } - auto *self = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(ev)); - if (self == nullptr) { - return; - } - self->OnNodeEvent(ev); - } - - void OnNodeEvent(ArkUI_NodeEvent *ev) override - { - const int32_t type = OH_ArkUI_NodeEvent_GetEventType(ev); - ArkUI_NodeComponentEvent *ce = OH_ArkUI_NodeEvent_GetNodeComponentEvent(ev); - - switch (type) { - case NODE_REFRESH_ON_REFRESH: - if (onRefresh_) { - onRefresh_(); - } - break; - case NODE_REFRESH_ON_OFFSET_CHANGE: - if (ce != nullptr && onOffsetChange_) { - onOffsetChange_(ce->data[K_REFRESH_OFFSET_DATA_INDEX].f32); - } - break; - case NODE_REFRESH_STATE_CHANGE: - if (ce != nullptr && onStateChange_) { - onStateChange_(ce->data[K_REFRESH_STATE_DATA_INDEX].i32); - } - break; - default: - break; - } - } - -private: - std::shared_ptr header_; - std::function onRefresh_; - std::function onOffsetChange_; - std::function onStateChange_; - - NodeEventRegistrar registrar_; -}; - -#endif // REFRESH_MAKER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollMaker.cpp deleted file mode 100644 index 6d5c146d2f91aa66e4dc317f52c3c38ef6db7b67..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollMaker.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollMaker.h" - -#include -#ifndef LOG_TAG -#define LOG_TAG "ScrollMaker" -#endif - -// ===== 业务常量 ===== -namespace { -constexpr float K_WIDTH_PERCENT_FULL = 1.0f; -constexpr float K_HEIGHT_PERCENT_FULL = 1.0f; -constexpr uint32_t K_PAGE_BG = 0xFFFFFF00U; // Yellow - -constexpr uint32_t K_COLOR_BROWN = 0xFFA52A2AU; -constexpr uint32_t K_COLOR_BLUE = 0xFF0000FFU; -constexpr uint32_t K_COLOR_GREEN = 0xFF008000U; - -constexpr float K_TEXT_SIZE = 100.0f; - -// 其他行为参数 -constexpr float K_FRICTION = 0.9f; -constexpr float K_FLING_LIMIT = 12000.0f; - -constexpr unsigned int K_LOG_DOMAIN = 0xFF00; - -// 事件数据数组索引常量 -constexpr int32_t K_PRIMARY_DELTA_DATA_INDEX = 0; -constexpr int32_t K_SECONDARY_DELTA_DATA_INDEX = 1; -constexpr int32_t K_AREA_HEIGHT_FALLBACK_DATA_INDEX = 6; -constexpr int32_t K_AREA_HEIGHT_PRIMARY_DATA_INDEX = 7; -} // namespace - -// ===== 全局状态 ===== -static ArkUI_NativeNodeAPI_1 *gApi{nullptr}; -static std::shared_ptr gScroll; -static ArkUI_NodeHandle gRoot{nullptr}; -static ArkUI_NodeHandle gPageTop{nullptr}; -static ArkUI_NodeHandle gPageMid{nullptr}; -static ArkUI_NodeHandle gPageBot{nullptr}; - -static float g_selfH{0.0f}; -static float g_yOffset{0.0f}; - -// ===== 工具:页面创建与布局 ===== -/** - * 创建页面节点 - * @param bg 背景色 - * @param label 标签文本 - * @return 页面节点句柄 - */ -static ArkUI_NodeHandle CreatePage(uint32_t bg, const char *label) -{ - if (gApi == nullptr) { - return nullptr; - } - - ArkUI_NodeHandle page = gApi->createNode(ARKUI_NODE_STACK); - SetAttributeFloat32(gApi, page, NODE_WIDTH_PERCENT, K_WIDTH_PERCENT_FULL); - SetAttributeFloat32(gApi, page, NODE_HEIGHT_PERCENT, K_HEIGHT_PERCENT_FULL); - SetAttributeUInt32(gApi, page, NODE_BACKGROUND_COLOR, bg); - - ArkUI_NodeHandle text = gApi->createNode(ARKUI_NODE_TEXT); - SetTextContent(gApi, text, label); - SetAttributeFloat32(gApi, text, NODE_FONT_SIZE, K_TEXT_SIZE); - - gApi->addChild(page, text); - return page; -} - -/** - * 根据索引获取偏移量 - * @param index 索引值 - * @return 偏移量 - */ -static inline float GetOffsetByIndex(int index) -{ - float off = g_yOffset - static_cast(index) * g_selfH; - if (off > 1.5f * g_selfH) { - off -= 3.0f * g_selfH; - } else if (off < -1.5f * g_selfH) { - off += 3.0f * g_selfH; - } - return off; -} - -static void ApplyTranslate(ArkUI_NodeHandle n, float ty) -{ - ArkUI_NumberValue vx{.f32 = 0.0f}; - ArkUI_NumberValue vy{.f32 = ty}; - ArkUI_NumberValue vz{.f32 = 0.0f}; - - ArkUI_NumberValue v[] = {vx, vy, vz}; - ArkUI_AttributeItem it{v, 3}; - - gApi->setAttribute(n, NODE_TRANSLATE, &it); -} - -static void SyncAllTranslate() -{ - if (gApi == nullptr) { - return; - } - ApplyTranslate(gPageTop, -GetOffsetByIndex(-1)); - ApplyTranslate(gPageMid, -GetOffsetByIndex(0)); - ApplyTranslate(gPageBot, -GetOffsetByIndex(1)); -} - -// ===== 事件读取辅助 ===== -static inline float ReadDeltaPrimary(ArkUI_NodeComponentEvent *ce) { return ce->data[K_PRIMARY_DELTA_DATA_INDEX].f32; } -static inline float ReadDeltaSecondary(ArkUI_NodeComponentEvent *ce) -{ - return ce->data[K_SECONDARY_DELTA_DATA_INDEX].f32; -} - -// ===== 事件处理 ===== -static void OnAreaChange(ArkUI_NodeComponentEvent *ce) -{ - if (ce == nullptr) { - return; - } - - float h = ce->data[K_AREA_HEIGHT_PRIMARY_DATA_INDEX].f32; - if (h <= 0.0f) { - h = ce->data[K_AREA_HEIGHT_FALLBACK_DATA_INDEX].f32; - } - - if (h > 0.0f && std::fabs(h - g_selfH) > 0.5f) { - g_selfH = h; - SyncAllTranslate(); - } -} - -static void ApplyScrollDelta(float delta) -{ - if (std::fabs(delta) <= 1e-5f) { - return; - } - - g_yOffset += delta; - - const float period = 3.0f * g_selfH; - if (g_selfH > 0.0f && period > 0.0f) { - while (g_yOffset < 0.0f) { - g_yOffset += period; - } - while (g_yOffset >= period) { - g_yOffset -= period; - } - } - - SyncAllTranslate(); -} - -static void OnScrollFrameBegin(ArkUI_NodeComponentEvent *ce) -{ - if (ce == nullptr) { - return; - } - - float delta = ReadDeltaPrimary(ce); - if (std::fabs(delta) < 1e-5f) { - delta = ReadDeltaSecondary(ce); - } - - ApplyScrollDelta(delta); - - ce->data[K_PRIMARY_DELTA_DATA_INDEX].f32 = 0.0f; - ce->data[K_SECONDARY_DELTA_DATA_INDEX].f32 = 0.0f; -} - -static void OnScroll(ArkUI_NodeComponentEvent *ce) -{ - if (ce == nullptr) { - return; - } - float delta = ReadDeltaPrimary(ce); - if (std::fabs(delta) < 1e-5f) { - delta = ReadDeltaSecondary(ce); - } - ApplyScrollDelta(delta); -} - -static void OnSimpleLog(const char *tag) -{ - OH_LOG_Print(LOG_APP, LOG_DEBUG, K_LOG_DOMAIN, LOG_TAG, "%{public}s", tag); -} - -static bool HandleCoreScrollEvents(int32_t type, ArkUI_NodeComponentEvent *ce) -{ - switch (type) { - case NODE_SCROLL_EVENT_ON_SCROLL_FRAME_BEGIN: - OnScrollFrameBegin(ce); - return true; - case NODE_SCROLL_EVENT_ON_WILL_SCROLL: - OnSimpleLog("OnWillScroll"); - return true; - case NODE_SCROLL_EVENT_ON_SCROLL: - OnScroll(ce); - return true; - case NODE_SCROLL_EVENT_ON_DID_SCROLL: - OnSimpleLog("OnDidScroll"); - return true; - case NODE_SCROLL_EVENT_ON_SCROLL_START: - OnSimpleLog("OnScrollStart"); - return true; - case NODE_SCROLL_EVENT_ON_SCROLL_STOP: - OnSimpleLog("OnScrollStop"); - return true; - default: - return false; - } -} - -static bool HandleBoundaryEvents(int32_t type, ArkUI_NodeComponentEvent * /*ce*/) -{ - switch (type) { - case NODE_SCROLL_EVENT_ON_REACH_START: - OnSimpleLog("OnReachStart"); - return true; - case NODE_SCROLL_EVENT_ON_REACH_END: - OnSimpleLog("OnReachEnd"); - return true; - case NODE_SCROLL_EVENT_ON_WILL_STOP_DRAGGING: - OnSimpleLog("OnWillStopDragging"); - return true; - case NODE_SCROLL_EVENT_ON_SCROLL_EDGE: - OnSimpleLog("OnScrollEdge"); - return true; - default: - return false; - } -} - -static bool HandleZoomEvents(int32_t type, ArkUI_NodeComponentEvent * /*ce*/) -{ - switch (type) { - case NODE_SCROLL_EVENT_ON_ZOOM_START: - OnSimpleLog("OnZoomStart"); - return true; - case NODE_SCROLL_EVENT_ON_ZOOM_STOP: - OnSimpleLog("OnZoomStop"); - return true; - case NODE_SCROLL_EVENT_ON_DID_ZOOM: - OnSimpleLog("OnDidZoom"); - return true; - default: - return false; - } -} - -static void HandleNodeEvent(ArkUI_NodeEvent *ev) -{ - if (ev == nullptr) { - return; - } - - int32_t type = OH_ArkUI_NodeEvent_GetEventType(ev); - ArkUI_NodeComponentEvent *ce = OH_ArkUI_NodeEvent_GetNodeComponentEvent(ev); - - if (type == NODE_EVENT_ON_AREA_CHANGE) { - OnAreaChange(ce); - return; - } - - if (HandleCoreScrollEvents(type, ce)) { - return; - } - if (HandleBoundaryEvents(type, ce)) { - return; - } - if (HandleZoomEvents(type, ce)) { - return; - } -} - -// ===== 组装构建 ===== -static void SetupScroll() -{ - gScroll = std::make_shared(); - - gScroll->SetWidthPercent(K_WIDTH_PERCENT_FULL); - gScroll->SetHeightPercent(K_HEIGHT_PERCENT_FULL); - gScroll->SetBackgroundColor(K_PAGE_BG); - - gScroll->SetDirection(ARKUI_SCROLL_DIRECTION_VERTICAL); - gScroll->SetScrollBarDisplayMode(ARKUI_SCROLL_BAR_DISPLAY_MODE_OFF); - gScroll->SetScrollBarWidth(2.0f); - gScroll->SetScrollBarColor(0x66000000U); - gScroll->SetScrollBarMargin(0.0f, 0.0f, 0.0f, 0.0f); - - gScroll->SetEnableScrollInteraction(true); - gScroll->SetFriction(K_FRICTION); - gScroll->SetClipContent(true); - gScroll->SetPageEnabled(false); - gScroll->SetBackToTopEnabled(false); - gScroll->SetFadingEdge(0.0f); - gScroll->SetFlingSpeedLimit(K_FLING_LIMIT); - gScroll->SetEdgeEffect(ARKUI_EDGE_EFFECT_SPRING, true, - static_cast(ARKUI_EFFECT_EDGE_START | ARKUI_EFFECT_EDGE_END)); -} - -static void SetupRootAndPages() -{ - gRoot = gApi->createNode(ARKUI_NODE_STACK); - SetAttributeFloat32(gApi, gRoot, NODE_WIDTH_PERCENT, K_WIDTH_PERCENT_FULL); - SetAttributeFloat32(gApi, gRoot, NODE_HEIGHT_PERCENT, K_HEIGHT_PERCENT_FULL); - - gPageTop = CreatePage(K_COLOR_BROWN, "3"); - gPageMid = CreatePage(K_COLOR_BLUE, "1"); - gPageBot = CreatePage(K_COLOR_GREEN, "2"); - - gApi->addChild(gRoot, gPageTop); - gApi->addChild(gRoot, gPageMid); - gApi->addChild(gRoot, gPageBot); - - gScroll->AddChild(gRoot); -} - -static void RegisterEvents() -{ - gApi->addNodeEventReceiver(gScroll->GetScroll(), &HandleNodeEvent); - gApi->addNodeEventReceiver(gRoot, &HandleNodeEvent); - gApi->registerNodeEvent(gRoot, NODE_EVENT_ON_AREA_CHANGE, 0, nullptr); -} - -/** - * 构建滚动视图 - * @return 滚动节点句柄 - */ -static ArkUI_NodeHandle Build() -{ - gApi = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - if (gApi == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "GetNativeNodeAPI failed"); - return nullptr; - } - - SetupScroll(); - SetupRootAndPages(); - RegisterEvents(); - SyncAllTranslate(); - - return gScroll->GetScroll(); -} - -ArkUI_NodeHandle ScrollMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (api == nullptr) { - return nullptr; - } - - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (page == nullptr) { - return nullptr; - } - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - ArkUI_NodeHandle scroll = Build(); - if (scroll != nullptr) { - SetAttributeFloat32(api, scroll, NODE_LAYOUT_WEIGHT, 1.0f); - api->addChild(page, scroll); - } - - return page; -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollMaker.h deleted file mode 100644 index b1a8de21a96d047cbd7011254f98fc30e737bfb6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollMaker.h +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef SCROLL_MAKER_H -#define SCROLL_MAKER_H - -#include -#include - -#include -#include -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollableEvent.h" - -/** - * @brief ArkUI Scroll 节点轻封装 - */ -class ScrollMaker { -public: - using OnScrollState = std::function; - using OnWillScroll = std::function; - using OnDidScroll = std::function; - - void SetOnScrollStateChanged(OnScrollState cb) { onState_ = std::move(cb); } - void SetOnWillScroll(OnWillScroll cb) { onWill_ = std::move(cb); } - void SetOnDidScroll(OnDidScroll cb) { onDid_ = std::move(cb); } - - static ArkUI_NodeHandle CreateNativeNode(); - -public: - ScrollMaker() - { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api_); - scroll_ = api_->createNode(ARKUI_NODE_SCROLL); - api_->addNodeEventReceiver(scroll_, StaticEvent); - scrollGuard_.Bind(api_, scroll_, this, SCROLL_EVT_ALL); - } - - ~ScrollMaker() - { - scrollGuard_.Release(); - scroll_ = nullptr; - api_ = nullptr; - } - - // ===== 通用布局/外观 ===== - void SetWidthPercent(float percent) { SetAttributeFloat32(api_, scroll_, NODE_WIDTH_PERCENT, percent); } - void SetHeightPercent(float percent) { SetAttributeFloat32(api_, scroll_, NODE_HEIGHT_PERCENT, percent); } - void SetBackgroundColor(uint32_t color) { SetAttributeUInt32(api_, scroll_, NODE_BACKGROUND_COLOR, color); } - - void SetDirection(ArkUI_ScrollDirection direction) - { - ArkUI_NumberValue v{.i32 = static_cast(direction)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_SCROLL_DIRECTION, &it); - } - - void SetScrollBarDisplayMode(ArkUI_ScrollBarDisplayMode displayMode) - { - ArkUI_NumberValue v{.i32 = static_cast(displayMode)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_BAR_DISPLAY_MODE, &it); - } - - void SetScrollBarWidth(float w) - { - ArkUI_NumberValue v{.f32 = w}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_BAR_WIDTH, &it); - } - - void SetScrollBarColor(uint32_t argb) - { - ArkUI_NumberValue v{.u32 = argb}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_BAR_COLOR, &it); - } - - /** @brief 滚动条外边距:top,right,bottom,left(单位:vp) */ - void SetScrollBarMargin(float top, float right, float bottom, float left) - { - ArkUI_NumberValue vTop{.f32 = top}; - ArkUI_NumberValue vRight{.f32 = right}; - ArkUI_NumberValue vBottom{.f32 = bottom}; - ArkUI_NumberValue vLeft{.f32 = left}; - ArkUI_NumberValue v[] = {vTop, vRight, vBottom, vLeft}; - ArkUI_AttributeItem it{v, 4}; - api_->setAttribute(scroll_, NODE_SCROLL_BAR_MARGIN, &it); - } - - void SetEnableScrollInteraction(bool enable) - { - ArkUI_NumberValue v{.i32 = enable ? 1 : 0}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_ENABLE_SCROLL_INTERACTION, &it); - } - - void SetFriction(float friction) { SetAttributeFloat32(api_, scroll_, NODE_SCROLL_FRICTION, friction); } - - void SetNestedMode(ArkUI_ScrollNestedMode mode) - { - ArkUI_NumberValue v{.i32 = static_cast(mode)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_NESTED_SCROLL, &it); - } - - void SetScrollEdge(ArkUI_ScrollEdge edge) - { - ArkUI_NumberValue v{.i32 = static_cast(edge)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_EDGE, &it); - } - - void SetContentClipMode(ArkUI_ContentClipMode clipMode) - { - ArkUI_NumberValue v{.i32 = static_cast(clipMode)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_CLIP_CONTENT, &it); - } - - void SetClipContent(bool clip) - { - ArkUI_NumberValue v{.i32 = clip ? 1 : 0}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_CLIP_CONTENT, &it); - } - - void SetPageEnabled(bool enable) - { - ArkUI_NumberValue v{.i32 = enable ? 1 : 0}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_PAGE, &it); - } - - void SetBackToTopEnabled(bool enable) - { - ArkUI_NumberValue v{.i32 = enable ? 1 : 0}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_BACK_TO_TOP, &it); - } - - // 偏移/尺寸/By/Fling/渐隐/限速 - void SetOffset(float x, float y) - { - ArkUI_NumberValue vx{.f32 = x}; - ArkUI_NumberValue vy{.f32 = y}; - ArkUI_NumberValue v[] = {vx, vy}; - ArkUI_AttributeItem it{v, 2}; - api_->setAttribute(scroll_, NODE_SCROLL_OFFSET, &it); - } - - void SetSize(float w, float h) - { - ArkUI_NumberValue vw{.f32 = w}; - ArkUI_NumberValue vh{.f32 = h}; - ArkUI_NumberValue v[] = {vw, vh}; - ArkUI_AttributeItem it{v, 2}; - api_->setAttribute(scroll_, NODE_SCROLL_SIZE, &it); - } - - void ScrollBy(float dx, float dy) - { - ArkUI_NumberValue vx{.f32 = dx}; - ArkUI_NumberValue vy{.f32 = dy}; - ArkUI_NumberValue v[] = {vx, vy}; - ArkUI_AttributeItem it{v, 2}; - api_->setAttribute(scroll_, NODE_SCROLL_BY, &it); - } - - void Fling(float velocity) - { - ArkUI_NumberValue v{.f32 = velocity}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_FLING, &it); - } - - void SetFadingEdge(float len) - { - ArkUI_NumberValue v{.f32 = len}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_FADING_EDGE, &it); - } - - void SetFlingSpeedLimit(float limit) - { - ArkUI_NumberValue v{.f32 = limit}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_FLING_SPEED_LIMIT, &it); - } - - /** - * @brief 设置 Scroll 组件的边缘效果(越界回弹/发光等)。 - * @param effect [IN] 边缘效果类型,取值为 ArkUI_EdgeEffect(如 ARKUI_EDGE_EFFECT_NONE、ARKUI_EDGE_EFFECT_SPRING)。 - * @param enableWhenContentSmaller [IN] 当内容尺寸小于组件本身时是否仍启用边缘效果(1 启用,0 禁用)。 - * @param edge [IN] 生效方向,ArkUI_EffectEdge,可位或组合(如 ARKUI_EFFECT_EDGE_START | ARKUI_EFFECT_EDGE_END)。 - * @note 对应属性:NODE_SCROLL_EDGE_EFFECT;ArkUI_AttributeItem.value - * 含义:[0].i32=effect,[1].i32=enableWhenContentSmaller,[2].i32=edge。 - */ - void SetEdgeEffect(ArkUI_EdgeEffect effect, bool enableWhenContentSmaller, ArkUI_EffectEdge edge) - { - ArkUI_NumberValue v[3]; - v[0].i32 = static_cast(effect); // [0] 效果类型 - v[1].i32 = enableWhenContentSmaller ? 1 : 0; // [1] 小内容是否启用 - v[2].i32 = static_cast(edge); // [2] 生效边(位掩码) - - ArkUI_AttributeItem it{v, 3}; - api_->setAttribute(scroll_, NODE_SCROLL_EDGE_EFFECT, &it); - } - - void SetSnapAlign(ArkUI_ScrollSnapAlign align) - { - ArkUI_NumberValue v{.i32 = static_cast(align)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_SNAP, &it); - } - - // ===== 子节点 ===== - void AddChild(ArkUI_NodeHandle child) - { - if (child != nullptr) { - api_->addChild(scroll_, child); - } - } - - ArkUI_NodeHandle GetScroll() const { return scroll_; } - -private: - inline void HandleScrollStateChanged(const ArkUI_NodeComponentEvent *comp) - { - if (!onState_) { - return; - } - auto state = static_cast(comp->data[0].i32); - onState_(state); - } - - inline void HandleWillScroll(const ArkUI_NodeComponentEvent *comp) - { - if (!onWill_) { - return; - } - float dx = comp->data[0].f32; - float dy = comp->data[1].f32; - auto state = static_cast(comp->data[2].i32); - auto src = static_cast(comp->data[3].i32); - onWill_(dx, dy, state, src); - } - - inline void HandleDidScroll(const ArkUI_NodeComponentEvent *comp) - { - if (!onDid_) { - return; - } - float dx = comp->data[0].f32; - float dy = comp->data[1].f32; - auto state = static_cast(comp->data[2].i32); - onDid_(dx, dy, state); - } - - inline void HandleListWillScroll(const ArkUI_NodeComponentEvent *comp) - { - if (!onWill_) { - return; - } - float dy = comp->data[0].f32; - auto state = static_cast(comp->data[1].i32); - auto src = static_cast(comp->data[2].i32); - onWill_(0.0f, dy, state, src); - } - - inline void HandleOnWillScroll(const ArkUI_NodeComponentEvent *comp) - { - if (!onWill_) { - return; - } - float d = comp->data[0].f32; // 单轴按约定复用 dy - auto state = static_cast(comp->data[1].i32); - auto src = static_cast(comp->data[2].i32); - onWill_(0.0f, d, state, src); - } - - static void StaticEvent(ArkUI_NodeEvent *ev) - { - if (!ev) { - return; - } - auto *self = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(ev)); - if (!self) { - return; - } - - const auto *comp = OH_ArkUI_NodeEvent_GetNodeComponentEvent(ev); - if (!comp) { - return; - } - - switch (OH_ArkUI_NodeEvent_GetEventType(ev)) { - case NODE_SWIPER_EVENT_ON_SCROLL_STATE_CHANGED: - self->HandleScrollStateChanged(comp); - break; - case NODE_SCROLL_EVENT_ON_WILL_SCROLL: - self->HandleWillScroll(comp); - break; - case NODE_SCROLL_EVENT_ON_DID_SCROLL: - self->HandleDidScroll(comp); - break; - case NODE_LIST_ON_WILL_SCROLL: - self->HandleListWillScroll(comp); - break; - case NODE_ON_WILL_SCROLL: - self->HandleOnWillScroll(comp); - break; - default: - break; - } - } - -private: - ArkUI_NativeNodeAPI_1 *api_{nullptr}; - ArkUI_NodeHandle scroll_{nullptr}; - ScrollEventGuard scrollGuard_{}; - - OnScrollState onState_{}; - OnWillScroll onWill_{}; - OnDidScroll onDid_{}; -}; -#endif // SCROLL_MAKER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableEvent.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableEvent.h deleted file mode 100644 index 6115991241c8b038f41e8ca645ca02eda926f0bf..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableEvent.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef SCROLL_EVENT_H -#define SCROLL_EVENT_H - -#include -#include - -/** - * 滚动事件掩码 - */ -enum : uint32_t { - SCROLL_EVT_FRAME_BEGIN = 1u << 0, - SCROLL_EVT_START = 1u << 1, - SCROLL_EVT_STOP = 1u << 2, - SCROLL_EVT_REACH_START = 1u << 3, - SCROLL_EVT_REACH_END = 1u << 4, - SCROLL_EVT_WILL_STOP_DRAG = 1u << 5, - SCROLL_EVT_ALL = SCROLL_EVT_FRAME_BEGIN | SCROLL_EVT_START | SCROLL_EVT_STOP | SCROLL_EVT_REACH_START | - SCROLL_EVT_REACH_END | SCROLL_EVT_WILL_STOP_DRAG -}; - -/** - * 事件 map - */ -struct ScrollEvtMap { - uint32_t bit; - ArkUI_NodeEventType evt; -}; - -inline constexpr ScrollEvtMap K_SCROLL_EVT_MAP[] = { - {SCROLL_EVT_FRAME_BEGIN, NODE_SCROLL_EVENT_ON_SCROLL_FRAME_BEGIN}, - {SCROLL_EVT_START, NODE_SCROLL_EVENT_ON_SCROLL_START}, - {SCROLL_EVT_STOP, NODE_SCROLL_EVENT_ON_SCROLL_STOP}, - {SCROLL_EVT_REACH_START, NODE_SCROLL_EVENT_ON_REACH_START}, - {SCROLL_EVT_REACH_END, NODE_SCROLL_EVENT_ON_REACH_END}, - {SCROLL_EVT_WILL_STOP_DRAG, NODE_SCROLL_EVENT_ON_WILL_STOP_DRAGGING}, -}; - -template inline void ForEachScrollEvt(uint32_t mask, F &&fn) -{ - for (const auto &m : K_SCROLL_EVT_MAP) { - if (mask & m.bit) { - fn(m.evt); - } - } -} - -/** - * 批量注册事件 - */ -inline void RegisterScrollEvents(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, void *userData, - uint32_t mask = SCROLL_EVT_ALL) -{ - if (!api || !node) { - return; - } - ForEachScrollEvt(mask, [&](ArkUI_NodeEventType evt) { api->registerNodeEvent(node, evt, 0, userData); }); -} - -/** - * 批量取消注册事件 - */ -inline void UnregisterScrollEvents(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, uint32_t mask = SCROLL_EVT_ALL) -{ - if (!api || !node) { - return; - } - ForEachScrollEvt(mask, [&](ArkUI_NodeEventType evt) { api->unregisterNodeEvent(node, evt); }); -} - -/** - * 滚动事件自动注册/注销 - */ -class ScrollEventGuard { -public: - ScrollEventGuard() = default; - - ScrollEventGuard(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, void *userData, uint32_t mask = SCROLL_EVT_ALL) - { - Bind(api, node, userData, mask); - } - - void Bind(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, void *userData, uint32_t mask = SCROLL_EVT_ALL) - { - api_ = api; - node_ = node; - user_ = userData; - mask_ = mask; - RegisterScrollEvents(api_, node_, user_, mask_); - armed_ = true; - } - - void Release() - { - if (armed_) { - UnregisterScrollEvents(api_, node_, mask_); - armed_ = false; - } - } - - ~ScrollEventGuard() - { - if (armed_) { - UnregisterScrollEvents(api_, node_, mask_); - } - } - -private: - ArkUI_NativeNodeAPI_1 *api_ = nullptr; - ArkUI_NodeHandle node_ = nullptr; - void *user_ = nullptr; - uint32_t mask_ = SCROLL_EVT_ALL; - bool armed_ = false; -}; - -#endif // SCROLL_EVENT_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableNode.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableNode.h deleted file mode 100644 index de11efca4c331349d441f689d56324654d3b227f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableNode.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef ARKUINODE_H -#define ARKUINODE_H - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "ScrollableUtils.h" - -class NodeApiInstance { -public: - static NodeApiInstance *GetInstance() - { - static NodeApiInstance instance; - return &instance; - } - ArkUI_NativeNodeAPI_1 *GetNativeNodeAPI() const { return nodeApi_; } - -private: - NodeApiInstance() { OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeApi_); } - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - - NodeApiInstance(const NodeApiInstance &) = delete; - NodeApiInstance &operator=(const NodeApiInstance &) = delete; -}; - -class BaseNode : public std::enable_shared_from_this { -public: - explicit BaseNode(ArkUI_NodeHandle handle) - : nodeApi_(NodeApiInstance::GetInstance()->GetNativeNodeAPI()), nodeHandle_(handle) - { - if (!IsNotNull(nodeApi_) || !IsNotNull(nodeHandle_)) { - return; - } - RegisterClickEvent(); - } - - virtual ~BaseNode() - { - UnregisterClickEvent(); - ClearChildren(); - nodeHandle_ = nullptr; - } - - BaseNode(const BaseNode &) = delete; - BaseNode &operator=(const BaseNode &) = delete; - - ArkUI_NodeHandle GetHandle() const { return nodeHandle_; } - - void AddChild(const std::shared_ptr &child) - { - if (!IsNotNull(child)) { - return; - } - children_.push_back(child); - nodeApi_->addChild(nodeHandle_, child->GetHandle()); - } - - void RemoveChild(const std::shared_ptr &child) - { - if (!IsNotNull(child)) { - return; - } - auto it = std::find(children_.begin(), children_.end(), child); - if (it != children_.end()) { - nodeApi_->removeChild(nodeHandle_, child->GetHandle()); - children_.erase(it); - } - } - - // ---------------- 通用属性 ---------------- - - void SetWidth(float width) { SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_WIDTH, width); } - void SetHeight(float height) { SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_HEIGHT, height); } - void SetWidthPercent(float percent) - { - SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_WIDTH_PERCENT, percent); - } - void SetHeightPercent(float percent) - { - SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_HEIGHT_PERCENT, percent); - } - void SetSize(float w, float h) { ::SetSize(nodeApi_, nodeHandle_, w, h); } - void SetSizePercent(float wp, float hp) { ::SetSizePercent(nodeApi_, nodeHandle_, wp, hp); } - void SetFullSize() { ::SetFullSize(nodeApi_, nodeHandle_); } - - void SetBackgroundColor(uint32_t color) { ::SetBackgroundColor(nodeApi_, nodeHandle_, color); } - - virtual void SetTransparentBackground() final { ::SetTransparentBackground(nodeApi_, nodeHandle_); } - - void SetOpacity(float opacity) - { - if (!ValidateApiAndNode(nodeApi_, nodeHandle_, "BaseNode::SetOpacity")) { - return; - } - SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_OPACITY, opacity); - } - - // ---------------- 事件 ---------------- - - void RegisterOnClick(const std::function &callback) { onClickCallback_ = callback; } - -protected: - virtual void OnNodeEvent(ArkUI_NodeEvent *event) - { - if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_CLICK && onClickCallback_) { - onClickCallback_(event); - } - } - - static void StaticEventReceiver(ArkUI_NodeEvent *event) - { - auto *self = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(event)); - if (IsNotNull(self)) { - self->OnNodeEvent(event); - } - } - -private: - void RegisterClickEvent() - { - if (IsNotNull(nodeApi_) && IsNotNull(nodeHandle_)) { - nodeApi_->registerNodeEvent(nodeHandle_, NODE_ON_CLICK, 0, this); - hasClickEventRegistered_ = true; - } - } - - void UnregisterClickEvent() - { - if (IsNotNull(nodeApi_) && IsNotNull(nodeHandle_) && hasClickEventRegistered_) { - nodeApi_->unregisterNodeEvent(nodeHandle_, NODE_ON_CLICK); - hasClickEventRegistered_ = false; - } - } - - void ClearChildren() { children_.clear(); } - -protected: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - ArkUI_NodeHandle nodeHandle_ = nullptr; - std::list> children_; - std::function onClickCallback_; - bool hasClickEventRegistered_ = false; -}; - -// 保活容器 -template inline std::vector> &GetKeepAliveContainer() -{ - static std::vector> keepAliveContainer; - return keepAliveContainer; -} - -#endif // ARKUINODE_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableUtils.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableUtils.cpp deleted file mode 100644 index 3f138967c5a9f9fe1b4815812132df4d6a89064b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableUtils.cpp +++ /dev/null @@ -1,425 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "ScrollableUtils.h" - -#include -#include -#include - -// ------------------------------ -// 常量 -// ------------------------------ -namespace { -constexpr int K_EDGES = 4; -constexpr int K_EDGE_TOP = 0; -constexpr int K_EDGE_RIGHT = 1; -constexpr int K_EDGE_BOTTOM = 2; -constexpr int K_EDGE_LEFT = 3; - -constexpr int K_ENABLED = 1; - -constexpr float K_PERCENT_FULL = 1.0f; - -constexpr uint32_t K_COLOR_TRANSPARENT = 0x00000000U; -constexpr float K_DEFAULT_SCROLL_BAR_WIDTH = 4.0f; -constexpr uint32_t K_DEFAULT_SCROLL_BAR_COLOR = 0x66000000U; -constexpr float K_DEFAULT_SCROLL_FRICTION = 0.015f; -constexpr int32_t K_DEFAULT_FADING_EDGE = 12; - -// 属性数组的最大容量 -constexpr int K_MAX_ATTR_VALUES = 8; - -constexpr unsigned int K_LOG_DOMAIN = 0xFF00; - -struct NodeAttrTarget { - ArkUI_NativeNodeAPI_1 *api; - ArkUI_NodeHandle node; - ArkUI_NodeAttributeType attr; - const char *debugName; -}; -} // namespace - -// ------------------------------ -// 判空 / 校验 -// ------------------------------ -bool IsValidRange(int32_t start, int32_t end, int32_t count) -{ - if (!IsValidIndex(start, count)) { - return false; - } - if (end < start) { - return false; - } - if (end > count) { - return false; - } - return true; -} - -bool ValidateApiAndNode(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, const char *functionName) -{ - if (!IsNotNull(api)) { - if (functionName != nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "%{public}s: api is null", functionName); - } - return false; - } - if (!IsNotNull(node)) { - if (functionName != nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "%{public}s: node is null", functionName); - } - return false; - } - return true; -} - -// ------------------------------ -// 通用属性设置 -// ------------------------------ -void SetAttributeFloat32(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, ArkUI_NodeAttributeType attr, float value) -{ - if (!ValidateApiAndNode(api, node, "SetAttributeFloat32")) { - return; - } - ArkUI_NumberValue numberValue{}; - numberValue.f32 = value; - - ArkUI_AttributeItem item{&numberValue, 1}; - api->setAttribute(node, attr, &item); -} - -void SetAttributeUInt32(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, ArkUI_NodeAttributeType attr, uint32_t value) -{ - if (!ValidateApiAndNode(api, node, "SetAttributeUInt32")) { - return; - } - ArkUI_NumberValue numberValue{}; - numberValue.u32 = value; - - ArkUI_AttributeItem item{&numberValue, 1}; - api->setAttribute(node, attr, &item); -} - -void SetAttributeInt32(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, ArkUI_NodeAttributeType attr, int32_t value) -{ - if (!ValidateApiAndNode(api, node, "SetAttributeInt32")) { - return; - } - ArkUI_NumberValue numberValue{}; - numberValue.i32 = value; - - ArkUI_AttributeItem item{&numberValue, 1}; - api->setAttribute(node, attr, &item); -} - -void SetAttributeString(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, ArkUI_NodeAttributeType attr, - const char *value) -{ - if (!ValidateApiAndNode(api, node, "SetAttributeString")) { - return; - } - if (!IsNotNull(value)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "SetAttributeString: value is null"); - return; - } - - ArkUI_AttributeItem item{nullptr, 0, value}; - api->setAttribute(node, attr, &item); -} - -// 设置 float 数组属性 -static void ApplyFloatArrayAttribute(const NodeAttrTarget &target, const float *values, int count) -{ - if (!ValidateApiAndNode(target.api, target.node, target.debugName)) { - return; - } - if (values == nullptr || count <= 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "%{public}s: invalid values", - target.debugName ? target.debugName : "ApplyFloatArrayAttribute"); - return; - } - - std::array buf{}; - int capped = count; - if (capped > static_cast(buf.size())) { - OH_LOG_Print(LOG_APP, LOG_WARN, K_LOG_DOMAIN, LOG_TAG, "%{public}s: count too large=%{public}d", - target.debugName ? target.debugName : "ApplyFloatArrayAttribute", count); - capped = static_cast(buf.size()); - } - for (int i = 0; i < capped; ++i) { - buf[static_cast(i)].f32 = values[i]; - } - - ArkUI_AttributeItem item{buf.data(), static_cast(capped)}; - target.api->setAttribute(target.node, target.attr, &item); -} - -// ------------------------------ -// 尺寸 / 背景 -// ------------------------------ -void SetSize(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, float width, float height) -{ - SetAttributeFloat32(api, node, NODE_WIDTH, width); - SetAttributeFloat32(api, node, NODE_HEIGHT, height); -} - -void SetSizePercent(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, float widthPercent, float heightPercent) -{ - SetAttributeFloat32(api, node, NODE_WIDTH_PERCENT, widthPercent); - SetAttributeFloat32(api, node, NODE_HEIGHT_PERCENT, heightPercent); -} - -void SetFullSize(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node) -{ - SetSizePercent(api, node, K_PERCENT_FULL, K_PERCENT_FULL); -} - -void SetBackgroundColor(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, uint32_t color) -{ - SetAttributeUInt32(api, node, NODE_BACKGROUND_COLOR, color); -} - -void SetTransparentBackground(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node) -{ - SetBackgroundColor(api, node, K_COLOR_TRANSPARENT); -} - -void SetPadding(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, const Padding &padding) -{ - const float vals[K_EDGES] = {padding.top, padding.right, padding.bottom, padding.left}; - ApplyFloatArrayAttribute(NodeAttrTarget{api, node, NODE_PADDING, "SetPadding"}, vals, K_EDGES); -} - -// ------------------------------ -// 文本 -// ------------------------------ -ArkUI_NodeHandle CreateTextNode(ArkUI_NativeNodeAPI_1 *api, const char *text) -{ - if (!IsNotNull(api) || !IsNotNull(text)) { - return nullptr; - } - - ArkUI_NodeHandle textNode = api->createNode(ARKUI_NODE_TEXT); - if (!IsNotNull(textNode)) { - return nullptr; - } - - SetAttributeString(api, textNode, NODE_TEXT_CONTENT, text); - return textNode; -} - -void SetTextStyle(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle textNode, float fontSize, uint32_t fontColor, - int32_t textAlign) -{ - if (!ValidateApiAndNode(api, textNode, "SetTextStyle")) { - return; - } - SetAttributeFloat32(api, textNode, NODE_FONT_SIZE, fontSize); - SetAttributeUInt32(api, textNode, NODE_FONT_COLOR, fontColor); - SetAttributeInt32(api, textNode, NODE_TEXT_ALIGN, textAlign); -} - -void SetTextContent(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle textNode, const char *text) -{ - SetAttributeString(api, textNode, NODE_TEXT_CONTENT, text); -} - -// ------------------------------ -// 滚动 -// ------------------------------ -void SetScrollBarStyle(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, bool visible, float width, uint32_t color) -{ - if (!ValidateApiAndNode(api, node, "SetScrollBarStyle")) { - return; - } - - int32_t displayMode = visible ? ARKUI_SCROLL_BAR_DISPLAY_MODE_AUTO : ARKUI_SCROLL_BAR_DISPLAY_MODE_OFF; - SetAttributeInt32(api, node, NODE_SCROLL_BAR_DISPLAY_MODE, displayMode); - if (visible) { - SetAttributeFloat32(api, node, NODE_SCROLL_BAR_WIDTH, width); - SetAttributeUInt32(api, node, NODE_SCROLL_BAR_COLOR, color); - } -} - -void SetDefaultScrollStyle(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node) -{ - if (!ValidateApiAndNode(api, node, "SetDefaultScrollStyle")) { - return; - } - SetScrollBarStyle(api, node, true, K_DEFAULT_SCROLL_BAR_WIDTH, K_DEFAULT_SCROLL_BAR_COLOR); - SetAttributeInt32(api, node, NODE_SCROLL_EDGE_EFFECT, ARKUI_EDGE_EFFECT_SPRING); - SetAttributeInt32(api, node, NODE_SCROLL_ENABLE_SCROLL_INTERACTION, K_ENABLED); - SetAttributeFloat32(api, node, NODE_SCROLL_FRICTION, K_DEFAULT_SCROLL_FRICTION); - SetAttributeInt32(api, node, NODE_SCROLL_NESTED_SCROLL, ARKUI_SCROLL_NESTED_MODE_SELF_FIRST); - SetAttributeInt32(api, node, NODE_SCROLL_FADING_EDGE, K_DEFAULT_FADING_EDGE); -} - -// ------------------------------ -// 异步任务 -// ------------------------------ -void PostDelayedTask(int32_t delayMs, std::function task) -{ - if (!task) { - return; - } - - int32_t safeDelayMs = delayMs; - if (safeDelayMs < 0) { - safeDelayMs = 0; - } - - std::thread worker([safeDelayMs, fn = std::move(task)]() mutable { - if (safeDelayMs > 0) { - std::this_thread::sleep_for(std::chrono::milliseconds(safeDelayMs)); - } - fn(); - }); - worker.detach(); -} - -// ------------------------------ -// N-API 工具 -// ------------------------------ -std::string GetStringFromNapi(napi_env env, napi_value value) -{ - if (!IsNotNull(env) || !IsNotNull(value)) { - return std::string(); - } - - size_t length = 0; - napi_status s0 = napi_get_value_string_utf8(env, value, nullptr, 0, &length); - if (s0 != napi_ok) { - return std::string(); - } - - std::string result(length, '\0'); - size_t written = 0; - napi_status s1 = napi_get_value_string_utf8(env, value, result.data(), length + 1, &written); - if (s1 != napi_ok) { - return std::string(); - } - - return result; -} - -bool IsNapiArray(napi_env env, napi_value value) -{ - if (!IsNotNull(env) || !IsNotNull(value)) { - return false; - } - - bool isArray = false; - napi_status status = napi_is_array(env, value, &isArray); - if (status != napi_ok) { - return false; - } - - return isArray; -} - -ArkUI_NodeContentHandle GetNodeContentFromNapi(napi_env env, napi_callback_info info) -{ - if (!IsNotNull(env) || !IsNotNull(info)) { - return nullptr; - } - - size_t argc = 1; - napi_value arg0 = nullptr; - napi_status st = napi_get_cb_info(env, info, &argc, &arg0, nullptr, nullptr); - if (st != napi_ok || argc < 1) { - return nullptr; - } - - ArkUI_NodeContentHandle content = nullptr; - OH_ArkUI_GetNodeContentFromNapiValue(env, arg0, &content); - return content; -} - -void AddNodeToContent(ArkUI_NodeContentHandle content, ArkUI_NodeHandle node) -{ - if (!IsNotNull(content) || !IsNotNull(node)) { - return; - } - OH_ArkUI_NodeContent_AddNode(content, node); -} - -// ------------------------------ -// NodeEventRegistrar -// ------------------------------ -NodeEventRegistrar::NodeEventRegistrar(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node) - : nodeApi_(api), nodeHandle_(node) -{ - if (!ValidateApiAndNode(api, node, "NodeEventRegistrar::Constructor")) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "NodeEventRegistrar: invalid api or node"); - } -} - -NodeEventRegistrar::~NodeEventRegistrar() -{ - if (!IsNotNull(nodeApi_) || !IsNotNull(nodeHandle_)) { - return; - } - for (ArkUI_NodeEventType eventType : registeredEventTypes_) { - nodeApi_->unregisterNodeEvent(nodeHandle_, eventType); - } - registeredEventTypes_.clear(); -} - -void NodeEventRegistrar::RegisterEvent(ArkUI_NodeEventType eventType, void *userData) -{ - if (!ValidateApiAndNode(nodeApi_, nodeHandle_, "NodeEventRegistrar::RegisterEvent")) { - return; - } - nodeApi_->registerNodeEvent(nodeHandle_, eventType, 0, userData); - registeredEventTypes_.push_back(eventType); -} - -void NodeEventRegistrar::RegisterMultipleEvents(std::initializer_list eventTypes, void *userData) -{ - for (ArkUI_NodeEventType eventType : eventTypes) { - RegisterEvent(eventType, userData); - } -} - -// ------------------------------ -// AdapterEventRegistrar -// ------------------------------ -AdapterEventRegistrar::AdapterEventRegistrar(ArkUI_NodeAdapterHandle adapter, void *userData, - void (*callback)(ArkUI_NodeAdapterEvent *)) - : adapterHandle_(adapter) -{ - if (!IsNotNull(adapterHandle_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "AdapterEventRegistrar: adapter is null"); - return; - } - if (!IsNotNull(callback)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "AdapterEventRegistrar: callback is null"); - return; - } - - int32_t result = OH_ArkUI_NodeAdapter_RegisterEventReceiver(adapterHandle_, userData, callback); - if (result != 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, - "AdapterEventRegistrar: failed to register event receiver, result=%{public}d", result); - } -} - -AdapterEventRegistrar::~AdapterEventRegistrar() -{ - if (IsNotNull(adapterHandle_)) { - OH_ArkUI_NodeAdapter_UnregisterEventReceiver(adapterHandle_); - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableUtils.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableUtils.h deleted file mode 100644 index d3807641a418de7050d71a470f90a215124df409..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/ScrollableUtils.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef SCROLL_UTILS_H -#define SCROLL_UTILS_H - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#ifndef LOG_TAG -#define LOG_TAG "ScrollUtils" -#endif - -// ============================== -// 判空 / 校验 -// ============================== -template -inline bool IsNotNull(const T *ptr) -{ - return ptr != nullptr; -} - -template -inline bool IsNotNull(const std::shared_ptr &ptr) -{ - return ptr != nullptr; -} - -template -inline bool IsNotNull(T *ptr) -{ - return ptr != nullptr; -} - -inline bool IsValidIndex(int32_t index, int32_t count) -{ - return (index >= 0) && (index < count); -} - -inline bool IsValidRange(int32_t start, int32_t end, int32_t count); - -bool ValidateApiAndNode(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - const char *functionName = nullptr); - -template -constexpr int ArrSize(const T (&arr)[N]) noexcept -{ - return static_cast(N); -} - -// ============================== -// 尺寸 / 背景 -// ============================== - -struct Padding { - float top {0.f}; - float right {0.f}; - float bottom {0.f}; - float left {0.f}; - - static Padding All(float v) { return Padding{v, v, v, v}; } - static Padding Symmetric(float vertical, float horizontal) - { - return Padding{vertical, horizontal, vertical, horizontal}; - } - static Padding Only(float t, float r, float b, float l) - { - return Padding{t, r, b, l}; - } -}; - -void SetSize(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, float width, float height); - -void SetSizePercent(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - float widthPercent, - float heightPercent); - -void SetFullSize(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node); - -void SetBackgroundColor(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, uint32_t color); - -void SetTransparentBackground(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node); - -void SetPadding(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, const Padding &padding); - -// ============================== -// 通用属性设置 -// ============================== -void SetAttributeFloat32(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - ArkUI_NodeAttributeType attr, - float value); - -void SetAttributeUInt32(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - ArkUI_NodeAttributeType attr, - uint32_t value); - -void SetAttributeInt32(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - ArkUI_NodeAttributeType attr, - int32_t value); - -void SetAttributeString(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - ArkUI_NodeAttributeType attr, - const char *value); - -// ============================== -// 文本节点工具 -// ============================== -ArkUI_NodeHandle CreateTextNode(ArkUI_NativeNodeAPI_1 *api, const char *text); - -void SetTextStyle(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle textNode, - float fontSize, - uint32_t fontColor, - int32_t textAlign); - -void SetTextContent(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle textNode, const char *text); - -// ============================== -// 滚动相关 -// ============================== -void SetScrollBarStyle(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - bool visible, - float width, - uint32_t color); - -void SetDefaultScrollStyle(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node); - -// ============================== -// 异步任务 -// ============================== -void PostDelayedTask(int32_t delayMs, std::function task); - -// ============================== -// N-API 工具 -// ============================== -std::string GetStringFromNapi(napi_env env, napi_value value); - -bool IsNapiArray(napi_env env, napi_value value); - -ArkUI_NodeContentHandle GetNodeContentFromNapi(napi_env env, napi_callback_info info); - -void AddNodeToContent(ArkUI_NodeContentHandle content, ArkUI_NodeHandle node); - -// ============================== -// 节点事件注册器 -// ============================== -class NodeEventRegistrar { -public: - NodeEventRegistrar(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node); - ~NodeEventRegistrar(); - - void RegisterEvent(ArkUI_NodeEventType eventType, void *userData); - void RegisterMultipleEvents(std::initializer_list eventTypes, void *userData); - -private: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - ArkUI_NodeHandle nodeHandle_ = nullptr; - std::vector registeredEventTypes_; -}; - -// ============================== -// Adapter 事件接收器 -// ============================== -class AdapterEventRegistrar { -public: - AdapterEventRegistrar(ArkUI_NodeAdapterHandle adapter, - void *userData, - void (*callback)(ArkUI_NodeAdapterEvent *)); - ~AdapterEventRegistrar(); - -private: - ArkUI_NodeAdapterHandle adapterHandle_ = nullptr; -}; - -#endif // SCROLL_UTILS_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/SwiperMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/SwiperMaker.cpp deleted file mode 100644 index 7bb75338251082860284e4034264a4084624e7cc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/SwiperMaker.cpp +++ /dev/null @@ -1,764 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "SwiperMaker.h" -#include "baseUtils.h" -#include -#include - -namespace ConstIde { - const float TEXT_WIDTH_VP = 500.0f; // 宽度 - const float TEXT_HEIGHT_VP = 200.0f; // 高度 - const uint32_t TEXT_BG_COLOR = 0xFFAFEEEE; // 淡蓝色 - const int32_t TEXT_ALIGN_CENTER = 1; // 居中 - const float TEXT_FONT_SIZE_VP = 30.0f; // 字体大小 - - const uint32_t SHOW_BACKGROUND_ENABLED = 1; - const uint32_t SHOW_SIDEBAR_MIDDLE_ENABLED = 1; - const float ARROW_BACKGROUND_SIZE = 50.0; - const uint32_t ARROW_BACKGROUND_COLOR = 0xffffffff; // 白色 - const float ARROW_SIZE = 37.5; - const uint32_t ARROW_COLOR = 0xa9a9a9; // 浅灰色 - - const float INDICATOR_START_DISTANCE_VP = 10.0; // 距左侧 - const float INDICATOR_END_DISTANCE_VP = 0.0; // 距右侧 - const float INDICATOR_TOP_DISTANCE_VP = 10.0; // 距顶部 - const float INDICATOR_BOTTOM_DISTANCE_VP = 0.0; // 距底部 - const float ITEM_WIDTH_VP = 12.0; - const float ITEM_HEIGHT_VP = 6.0; - const float SELECTED_ITEM_WIDTH_VP = 20.0; - const float SELECTED_ITEM_HEIGHT_VP = 10.0; - const uint32_t IGNORE_BOTTOM_SIZE_DISABLED = 0; // 不忽略 SetBottomPosition - const uint32_t MASK_ENABLED = 1; // 显示蒙版 - const uint32_t INDICATOR_COLOR_DEFAULT = 0xA9A9A9A9; // 灰色 - const uint32_t INDICATOR_COLOR_SELECTED = 0xFFFF0000; // 红色 - const uint32_t MAX_DISPLAY_COUNT = 6; // 有效范围 [6,9] - - const float DIGIT_INDICATOR_START_DISTANCE_VP = 10.0; // 距左侧 - const float DIGIT_INDICATOR_END_DISTANCE_VP = 0.0; // 距右侧 - const float DIGIT_INDICATOR_TOP_DISTANCE_VP = 10.0; // 距顶部 - const float DIGIT_INDICATOR_BOTTOM_DISTANCE_VP = 0.0; // 距底部 - const uint32_t DIGIT_FONT_COLOR_DEFAULT = 0xA9A9A9A9; // 淡灰色 - const uint32_t DIGIT_FONT_COLOR_SELECTED = 0xFFFF0000; // 红色 - const float DIGIT_FONT_SIZE_DEFAULT = 30.0; // 默认字体大小 - const float DIGIT_FONT_SIZE_SELECTED = 50.0; // 选中字体大小 - - const uint32_t NUMBER_0 = 0; - const uint32_t NUMBER_1 = 1; - const uint32_t NUMBER_2 = 2; - const uint32_t NUMBER_10 = 10; - const uint32_t MARGIN_NUMBER_30 = 30; - const float NUMBER_5_F = 5.0; - const float NUMBER_400_F = 400.0; - const float NUMBER_3000_MS = 3000.0; - const uint32_t BACKGROUND_COLOR = 0x2AA1A6B1; - const uint32_t DURATION = 1000; -} // namespace ConstIde - -void SwiperMaker::createSwiperNode(ArkUI_NodeHandle &swiper) -{ - const int size = 11; - // 设置swiper内容为0,1,2…… - const char *arr[size] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}; - - for (int j = ConstIde::NUMBER_0; j < size; j++) { - ArkUI_NodeHandle textNode = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_AttributeItem content = {.string = arr[j]}; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_CONTENT, &content); - - ArkUI_NumberValue value[] = {0}; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[ConstIde::NUMBER_0].f32 = ConstIde::TEXT_WIDTH_VP; - Manager::nodeAPI_->setAttribute(textNode, NODE_WIDTH, &item); - value[ConstIde::NUMBER_0].f32 = ConstIde::TEXT_HEIGHT_VP; - Manager::nodeAPI_->setAttribute(textNode, NODE_HEIGHT, &item); - value[ConstIde::NUMBER_0].u32 = ConstIde::TEXT_BG_COLOR; - Manager::nodeAPI_->setAttribute(textNode, NODE_BACKGROUND_COLOR, &item); - value[ConstIde::NUMBER_0].i32 = ConstIde::TEXT_ALIGN_CENTER; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_ALIGN, &item); - value[ConstIde::NUMBER_0].f32 = ConstIde::TEXT_FONT_SIZE_VP; - Manager::nodeAPI_->setAttribute(textNode, NODE_FONT_SIZE, &item); - - ArkUI_AttributeItem textId = {.string = "SwiperAutoPlayText"}; - Manager::nodeAPI_->setAttribute(textNode, NODE_ID, &textId); - Manager::nodeAPI_->addChild(swiper, textNode); - } - BaseUtils::SetNodeMargin(swiper, ConstIde::MARGIN_NUMBER_30); // 设置边距宽度为30vp -} - -void SwiperMaker::SetSwiperArrowStyle(ArkUI_NodeHandle &swiper) -{ - ArkUI_SwiperArrowStyle *arrowStyle = OH_ArkUI_SwiperArrowStyle_Create(); - OH_ArkUI_SwiperArrowStyle_SetShowBackground(arrowStyle, ConstIde::SHOW_BACKGROUND_ENABLED); - OH_ArkUI_SwiperArrowStyle_SetShowSidebarMiddle(arrowStyle, ConstIde::SHOW_SIDEBAR_MIDDLE_ENABLED); - OH_ArkUI_SwiperArrowStyle_SetBackgroundSize(arrowStyle, ConstIde::ARROW_BACKGROUND_SIZE); - OH_ArkUI_SwiperArrowStyle_SetBackgroundColor(arrowStyle, ConstIde::ARROW_BACKGROUND_COLOR); - OH_ArkUI_SwiperArrowStyle_SetArrowSize(arrowStyle, ConstIde::ARROW_SIZE); - OH_ArkUI_SwiperArrowStyle_SetArrowColor(arrowStyle, ConstIde::ARROW_COLOR); - - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1, .object = arrowStyle}; - value[ConstIde::NUMBER_0].i32 = ARKUI_SWIPER_ARROW_SHOW; // default ARKUI_SWIPER_ARROW_HIDE - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_SHOW_DISPLAY_ARROW, &item); - OH_ArkUI_SwiperArrowStyle_Destroy(arrowStyle); -} - -void SwiperMaker::GetSwiperArrowStyle(ArkUI_NodeHandle swiper) -{ - auto nodeSwiperShowDisplayArrow = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_SHOW_DISPLAY_ARROW); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow NODE_SWIPER_SHOW_DISPLAY_ARROW %{public}d", - nodeSwiperShowDisplayArrow->value[ConstIde::NUMBER_0].i32); - auto arrowStyleObject = static_cast(nodeSwiperShowDisplayArrow->object); - auto iRet = OH_ArkUI_SwiperArrowStyle_GetShowBackground(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetShowBackground %{public}d", iRet); - iRet = OH_ArkUI_SwiperArrowStyle_GetShowSidebarMiddle(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetShowSidebarMiddle %{public}d", iRet); - auto fRet = OH_ArkUI_SwiperArrowStyle_GetBackgroundSize(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetBackgroundSize %{public}f", fRet); - auto uRet = OH_ArkUI_SwiperArrowStyle_GetBackgroundColor(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetBackgroundColor %{public}x", uRet); - fRet = OH_ArkUI_SwiperArrowStyle_GetArrowSize(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetArrowSize %{public}f", fRet); - uRet = OH_ArkUI_SwiperArrowStyle_GetArrowColor(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetArrowColor %{public}x", uRet); -} - -void SwiperMaker::SetSwiperIndicatorTypeDot(ArkUI_NodeHandle &swiper) -{ - ArkUI_SwiperIndicator *swiperIndicatorStyle = OH_ArkUI_SwiperIndicator_Create(ARKUI_SWIPER_INDICATOR_TYPE_DOT); - OH_ArkUI_SwiperIndicator_SetStartPosition(swiperIndicatorStyle, ConstIde::INDICATOR_START_DISTANCE_VP); - OH_ArkUI_SwiperIndicator_SetEndPosition(swiperIndicatorStyle, ConstIde::INDICATOR_END_DISTANCE_VP); - OH_ArkUI_SwiperIndicator_SetTopPosition(swiperIndicatorStyle, ConstIde::INDICATOR_TOP_DISTANCE_VP); - OH_ArkUI_SwiperIndicator_SetBottomPosition(swiperIndicatorStyle, ConstIde::INDICATOR_BOTTOM_DISTANCE_VP); - OH_ArkUI_SwiperIndicator_SetIgnoreSizeOfBottom(swiperIndicatorStyle, ConstIde::IGNORE_BOTTOM_SIZE_DISABLED); - OH_ArkUI_SwiperIndicator_SetItemWidth(swiperIndicatorStyle, ConstIde::ITEM_WIDTH_VP); - OH_ArkUI_SwiperIndicator_SetItemHeight(swiperIndicatorStyle, ConstIde::ITEM_HEIGHT_VP); - OH_ArkUI_SwiperIndicator_SetSelectedItemWidth(swiperIndicatorStyle, ConstIde::SELECTED_ITEM_WIDTH_VP); - OH_ArkUI_SwiperIndicator_SetSelectedItemHeight(swiperIndicatorStyle, ConstIde::SELECTED_ITEM_HEIGHT_VP); - OH_ArkUI_SwiperIndicator_SetMask(swiperIndicatorStyle, ConstIde::MASK_ENABLED); - OH_ArkUI_SwiperIndicator_SetColor(swiperIndicatorStyle, ConstIde::INDICATOR_COLOR_DEFAULT); - OH_ArkUI_SwiperIndicator_SetSelectedColor(swiperIndicatorStyle, ConstIde::INDICATOR_COLOR_SELECTED); - OH_ArkUI_SwiperIndicator_SetMaxDisplayCount(swiperIndicatorStyle, ConstIde::MAX_DISPLAY_COUNT); - - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1, .object = swiperIndicatorStyle}; - value[ConstIde::NUMBER_0].i32 = ARKUI_SWIPER_INDICATOR_TYPE_DOT; // Different enum use different objects - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_INDICATOR, &item); - - OH_ArkUI_SwiperIndicator_Dispose(swiperIndicatorStyle); -} - -void SwiperMaker::GetSwiperIndicatorTypeDot(ArkUI_NodeHandle swiper) -{ - auto nodeSwiperIndicator = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_INDICATOR); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "NODE_SWIPER_INDICATOR %{public}d", - nodeSwiperIndicator->value[ConstIde::NUMBER_0].i32); - auto swiperIndicatorStyleObject = static_cast(nodeSwiperIndicator->object); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "StartPosition: %{public}f", - OH_ArkUI_SwiperIndicator_GetStartPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "EndPosition: %{public}f", - OH_ArkUI_SwiperIndicator_GetEndPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "TopPosition: %{public}f", - OH_ArkUI_SwiperIndicator_GetTopPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "BottomPosition: %{public}f", - OH_ArkUI_SwiperIndicator_GetBottomPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "IgnoreSizeOfBottom: %{public}d", - OH_ArkUI_SwiperIndicator_GetIgnoreSizeOfBottom(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ItemWidth: %{public}f", - OH_ArkUI_SwiperIndicator_GetItemWidth(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ItemHeight: %{public}f", - OH_ArkUI_SwiperIndicator_GetItemHeight(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ItemHeight: %{public}f", - OH_ArkUI_SwiperIndicator_GetSelectedItemWidth(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ItemHeight: %{public}f", - OH_ArkUI_SwiperIndicator_GetSelectedItemHeight(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Mask: %{public}d", - OH_ArkUI_SwiperIndicator_GetMask(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Color: %{public}x", - OH_ArkUI_SwiperIndicator_GetColor(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "SelectedColor: %{public}x", - OH_ArkUI_SwiperIndicator_GetSelectedColor(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "MaxDisplayCount: %{public}d", - OH_ArkUI_SwiperIndicator_GetMaxDisplayCount(swiperIndicatorStyleObject)); -} - -void SwiperMaker::SetSwiperIndicatorTypeDigit(ArkUI_NodeHandle &swiper) -{ - ArkUI_SwiperDigitIndicator *swiperIndicatorStyle = OH_ArkUI_SwiperDigitIndicator_Create(); - OH_ArkUI_SwiperDigitIndicator_SetStartPosition(swiperIndicatorStyle, ConstIde::DIGIT_INDICATOR_START_DISTANCE_VP); - OH_ArkUI_SwiperDigitIndicator_SetEndPosition(swiperIndicatorStyle, ConstIde::DIGIT_INDICATOR_END_DISTANCE_VP); - OH_ArkUI_SwiperDigitIndicator_SetTopPosition(swiperIndicatorStyle, ConstIde::DIGIT_INDICATOR_TOP_DISTANCE_VP); - OH_ArkUI_SwiperDigitIndicator_SetBottomPosition(swiperIndicatorStyle, ConstIde::DIGIT_INDICATOR_BOTTOM_DISTANCE_VP); - OH_ArkUI_SwiperDigitIndicator_SetFontColor(swiperIndicatorStyle, ConstIde::DIGIT_FONT_COLOR_DEFAULT); - OH_ArkUI_SwiperDigitIndicator_SetSelectedFontColor(swiperIndicatorStyle, ConstIde::DIGIT_FONT_COLOR_SELECTED); - OH_ArkUI_SwiperDigitIndicator_SetFontSize(swiperIndicatorStyle, ConstIde::DIGIT_FONT_SIZE_DEFAULT); - OH_ArkUI_SwiperDigitIndicator_SetSelectedFontSize(swiperIndicatorStyle, ConstIde::DIGIT_FONT_SIZE_SELECTED); - OH_ArkUI_SwiperDigitIndicator_SetFontWeight(swiperIndicatorStyle, ARKUI_FONT_WEIGHT_W200); - OH_ArkUI_SwiperDigitIndicator_SetSelectedFontWeight(swiperIndicatorStyle, ARKUI_FONT_WEIGHT_W700); - - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1, .object = swiperIndicatorStyle}; - value[ConstIde::NUMBER_0].i32 = ARKUI_SWIPER_INDICATOR_TYPE_DIGIT; // Different enum use different objects - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_INDICATOR, &item); - - OH_ArkUI_SwiperDigitIndicator_Destroy(swiperIndicatorStyle); -} - -void SwiperMaker::GetSwiperIndicatorTypeDigit(ArkUI_NodeHandle swiper) -{ - auto nodeSwiperIndicator = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_INDICATOR); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "NODE_SWIPER_INDICATOR %{public}d", - nodeSwiperIndicator->value[ConstIde::NUMBER_0].i32); - auto swiperIndicatorStyleObject = static_cast(nodeSwiperIndicator->object); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "StartPosition: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetStartPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "EndPosition: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetEndPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "TopPosition: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetBottomPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "BottomPosition: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetTopPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "FontColor: %{public}x", - OH_ArkUI_SwiperDigitIndicator_GetFontColor(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "SelectedFontColor: %{public}x", - OH_ArkUI_SwiperDigitIndicator_GetSelectedFontColor(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "FontSize: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetFontSize(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "SelectedFontColor: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetSelectedFontSize(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "FontWeight: %{public}d", - OH_ArkUI_SwiperDigitIndicator_GetFontWeight(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "SelectedFontWeight: %{public}d", - OH_ArkUI_SwiperDigitIndicator_GetSelectedFontWeight(swiperIndicatorStyleObject)); -} - -void SwiperMaker::SetSwiperAttributeLoop(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value=value, .size=1}; - value[0].i32 = 1; // default 1 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_LOOP, &item); - - auto nodeSwiperLoop = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_LOOP); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_LOOP %{public}d", nodeSwiperLoop->value[0].i32); -} - -void SwiperMaker::SetSwiperAttributeAutoPlay(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[2]; - ArkUI_AttributeItem item = {.value=value, .size=2}; - value[0].i32 = 1; // default 0 - value[1].i32 = 0; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_AUTO_PLAY, &item); - - auto nodeSwiperAutoPlay = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_AUTO_PLAY); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_AUTO_PLAY_0 %{public}d", - nodeSwiperAutoPlay->value[0].i32); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_AUTO_PLAY_1 %{public}d", - nodeSwiperAutoPlay->value[1].i32); -} - -void SwiperMaker::SetSwiperAttributeShowIndicator(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].i32 = 0; // default 1 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_SHOW_INDICATOR, &item); - - auto nodeSwiperShowIndicator = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_SHOW_INDICATOR); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_SHOW_INDICATOR %{public}d", - nodeSwiperShowIndicator->value[0].i32); -} - -void SwiperMaker::SetSwiperAttributeInterval(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].f32 = ConstIde::NUMBER_3000_MS; - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_INTERVAL, &item); - - auto nodeSwiperInterval = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_INTERVAL); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_INTERVAL %{public}f", - nodeSwiperInterval->value[0].f32); -} - -void SwiperMaker::SetSwiperAttributeVertical(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].i32 = 0; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_VERTICAL, &item); - - auto nodeSwiperVertical = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_VERTICAL); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_VERTICAL %{public}d", - nodeSwiperVertical->value[0].i32); -} - -void SwiperMaker::SetSwiperAttributeDuration(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].f32 = ConstIde::DURATION; // default 400 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_DURATION, &item); - - auto nodeSwiperDuration = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_DURATION); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_DURATION %{public}f", - nodeSwiperDuration->value[0].f32); -} - -void SwiperMaker::SetSwiperAttributeCurve(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].i32 = ARKUI_CURVE_LINEAR; // default ARKUI_CURVE_LINEAR - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_CURVE, &item); - - auto nodeSwiperCurve = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_CURVE); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_CURVE %{public}d", nodeSwiperCurve->value[0].i32); -} - -void SwiperMaker::SetSwiperAttributeItemSpace(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].f32 = ConstIde::NUMBER_5_F; - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_ITEM_SPACE, &item); - - auto nodeSwiperItemSpace = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_ITEM_SPACE); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_ITEM_SPACE %{public}f", - nodeSwiperItemSpace->value[0].f32); -} - -void SwiperMaker::SetSwiperAttributeIndex(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[2]; - ArkUI_AttributeItem item = {.value = value, .size = 2}; - value[0].i32 = 1; - value[1].i32 = ARKUI_SWIPER_NO_ANIMATION; - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_INDEX, &item); - - auto nodeSwiperIndex = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_INDEX); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_INDEX %{public}d", nodeSwiperIndex->value[0].i32); -} - -void SwiperMaker::SetSwiperAttributeDisplayCount(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[2]; - ArkUI_AttributeItem item = {.value = value, .size = 2}; - value[0].i32 = ConstIde::NUMBER_2; - value[1].i32 = 0; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_DISPLAY_COUNT, &item); - - auto nodeSwiperDisplayCount = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_DISPLAY_COUNT); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_DISPLAY_COUNT_0 %{public}d", - nodeSwiperDisplayCount->value[0].i32); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_DISPLAY_COUNT_1 %{public}i", - nodeSwiperDisplayCount->value[1].i32); -} - -void SwiperMaker::SetSwiperAttributeDisableSwipe(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].i32 = 0; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_DISABLE_SWIPE, &item); - - auto nodeSwiperDisableSwipe = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_DISABLE_SWIPE); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_DISABLE_SWIPE %{public}d", - nodeSwiperDisableSwipe->value[0].i32); -} - -void SwiperMaker::SetSwiperAttributeEdgeEffectMode(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].i32 = ARKUI_EDGE_EFFECT_SPRING; // default ARKUI_EDGE_EFFECT_SPRING - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_EDGE_EFFECT_MODE, &item); - - auto nodeSwiperEdgeEffectMode = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_EDGE_EFFECT_MODE); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_EDGE_EFFECT_MODE %{public}d", - nodeSwiperEdgeEffectMode->value[0].i32); -} - -ArkUI_NodeAdapterHandle SwiperMaker::creatNodeAdapter() -{ - ArkUI_NodeAdapterHandle adapter = OH_ArkUI_NodeAdapter_Create(); - OH_ArkUI_NodeAdapter_SetTotalNodeCount(adapter, ConstIde::NUMBER_10); - - UserCallback *adapterCallback = new UserCallback(); - adapterCallback->callback = [](void *event) { - auto *adapterEvent = reinterpret_cast(event); - auto type = OH_ArkUI_NodeAdapterEvent_GetType(adapterEvent); - switch (type) { - case NODE_ADAPTER_EVENT_WILL_ATTACH_TO_NODE: { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "Adapter attach to node."); - break; - } - case NODE_ADAPTER_EVENT_WILL_DETACH_FROM_NODE: { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "Adapter detach from node."); - break; - } - case NODE_ADAPTER_EVENT_ON_GET_NODE_ID: { - auto index = OH_ArkUI_NodeAdapterEvent_GetItemIndex(adapterEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "On get node id. %{public}d", index); - // ...... - break; - } - case NODE_ADAPTER_EVENT_ON_ADD_NODE_TO_ADAPTER: { - auto index = OH_ArkUI_NodeAdapterEvent_GetItemIndex(adapterEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "On add node to adapter. %{public}d", index); - // ...... - break; - } - case NODE_ADAPTER_EVENT_ON_REMOVE_NODE_FROM_ADAPTER: { - auto index = OH_ArkUI_NodeAdapterEvent_GetItemIndex(adapterEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "On remove node from adapter. %{public}d", index); - // ...... - break; - } - } - }; - OH_ArkUI_NodeAdapter_RegisterEventReceiver(adapter, adapterCallback, [](ArkUI_NodeAdapterEvent *event) { - auto *userData = reinterpret_cast(OH_ArkUI_NodeAdapterEvent_GetUserData(event)); - userData->callback(event); - }); - return adapter; -} - -void SwiperMaker::SetSwiperAttributeNodeAdapter(ArkUI_NodeHandle &swiper) -{ - ArkUI_NodeAdapterHandle adapter = creatNodeAdapter(); - ArkUI_AttributeItem item = {.object = adapter}; - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_NODE_ADAPTER, &item); - - auto elementSize = OH_ArkUI_NodeAdapter_GetTotalNodeCount(adapter); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NodeAdapter_SetTotalNodeCount %{public}d", elementSize); -} - -void SwiperMaker::SetSwiperAttributeCachedCount(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[2]; - ArkUI_AttributeItem item = {.value = value, .size = 2}; - value[0].i32 = ConstIde::NUMBER_2; - value[1].i32 = 0; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_CACHED_COUNT, &item); - - auto nodeSwiperCachedCount = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_CACHED_COUNT); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_CACHED_COUNT_0 %{public}d", - nodeSwiperCachedCount->value[0].i32); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_CACHED_COUNT_1 %{public}d", - nodeSwiperCachedCount->value[1].i32); -} - -void SwiperMaker::SetSwiperAttributePrevMargin(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[2]; - ArkUI_AttributeItem item = {.value = value, .size = 2}; - value[0].f32 = ConstIde::NUMBER_5_F; - value[1].i32 = 1; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_PREV_MARGIN, &item); - - auto nodeSwiperPrevMargin = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_PREV_MARGIN); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_PREV_MARGIN_0 %{public}f", - nodeSwiperPrevMargin->value[0].f32); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_PREV_MARGIN_1 %{public}d", - nodeSwiperPrevMargin->value[1].i32); -} - -void SwiperMaker::SetSwiperAttributeNextMargin(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[2]; - ArkUI_AttributeItem item = {.value = value, .size = 2}; - value[0].f32 = ConstIde::NUMBER_5_F; - value[1].i32 = 1; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_NEXT_MARGIN, &item); - - auto nodeSwiperNextMargin = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_NEXT_MARGIN); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_NEXT_MARGIN_0 %{public}f", - nodeSwiperNextMargin->value[0].f32); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_NEXT_MARGIN_1 %{public}d", - nodeSwiperNextMargin->value[1].i32); -} - -void SwiperMaker::SetSwiperAttributeNestedScroll(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].i32 = ARKUI_SWIPER_NESTED_SRCOLL_SELF_ONLY; // default ARKUI_SWIPER_NESTED_SRCOLL_SELF_ONLY - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_NESTED_SCROLL, &item); - - auto nodeSwiperNestedScroll = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_NESTED_SCROLL); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_NESTED_SCROLL %{public}d", - nodeSwiperNestedScroll->value[0].i32); -} - -void SwiperMaker::SetSwiperAttributeSwipeToIndex(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[2]; - ArkUI_AttributeItem item = {.value = value, .size = 2}; - value[0].i32 = 1; - value[1].i32 = 1; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_SWIPE_TO_INDEX, &item); -} - -void SwiperMaker::SetSwiperAttributeIndicatorInteractive(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].i32 = 1; // default 1 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_INDICATOR_INTERACTIVE, &item); - - auto nodeSwiperIndicatorInteractive = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_INDICATOR_INTERACTIVE); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_INDICATOR_INTERACTIVE %{public}d", - nodeSwiperIndicatorInteractive->value[0].i32); -} - -void SwiperMaker::SetSwiperAttributePageFlipMode(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].i32 = ARKUI_PAGE_FLIP_MODE_SINGLE; // ARKUI_PAGE_FLIP_MODE_CONTINUOUS or ARKUI_PAGE_FLIP_MODE_SINGLE - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_PAGE_FLIP_MODE, &item); - - auto nodeSwiperPageFlipMode = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_PAGE_FLIP_MODE); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_PAGE_FLIP_MODE %{public}d", - nodeSwiperPageFlipMode->value[0].i32); -} - -void SwiperMaker::SetSwiperAttributeAutoFill(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[2]; - ArkUI_AttributeItem item = {.value = value, .size = 2}; - value[0].f32 = ConstIde::NUMBER_400_F; - value[1].i32 = 1; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_AUTO_FILL, &item); - - auto nodeSwiperAutoFill = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_AUTO_FILL); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_AUTO_FILL_0 %{public}f", - nodeSwiperAutoFill->value[0].f32); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_AUTO_FILL_1 %{public}d", - nodeSwiperAutoFill->value[1].i32); -} - -void SwiperMaker::SetSwiperAttributeMaintainVisibleContentPosition(ArkUI_NodeHandle &swiper) -{ - ArkUI_NumberValue value[1]; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[0].i32 = 1; // default 0 - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_MAINTAIN_VISIBLE_CONTENT_POSITION, &item); - - auto MaintainVisibleContentPosition = - Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_MAINTAIN_VISIBLE_CONTENT_POSITION); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_SWIPER_MAINTAIN_VISIBLE_CONTENT_POSITION %{public}d", - MaintainVisibleContentPosition->value[0].i32); -} - -void SwiperMaker::SetSwiperEvent(ArkUI_NodeHandle &swiper) -{ - Manager::nodeAPI_->registerNodeEvent(swiper, NODE_SWIPER_EVENT_ON_CHANGE, ON_CHANGE, nullptr); - Manager::nodeAPI_->registerNodeEvent(swiper, NODE_SWIPER_EVENT_ON_ANIMATION_START, ON_ANIMATION_START, nullptr); - Manager::nodeAPI_->registerNodeEvent(swiper, NODE_SWIPER_EVENT_ON_ANIMATION_END, ON_ANIMATION_END, nullptr); - Manager::nodeAPI_->registerNodeEvent(swiper, NODE_SWIPER_EVENT_ON_GESTURE_SWIPE, ON_GESTURE_SWIPE, nullptr); - Manager::nodeAPI_->registerNodeEvent(swiper, NODE_SWIPER_EVENT_ON_CONTENT_DID_SCROLL, ON_CONTENT_DID_SCROLL, - nullptr); - Manager::nodeAPI_->registerNodeEvent(swiper, NODE_SWIPER_EVENT_ON_SELECTED, ON_SELECTED, nullptr); - Manager::nodeAPI_->registerNodeEvent(swiper, NODE_SWIPER_EVENT_ON_UNSELECTED, ON_UNSELECTED, nullptr); - Manager::nodeAPI_->registerNodeEvent(swiper, NODE_SWIPER_EVENT_ON_CONTENT_WILL_SCROLL, ON_CONTENT_WILL_SCROLL, - nullptr); -// Manager::nodeAPI_->registerNodeEvent(swiper, NODE_SWIPER_EVENT_ON_SCROLL_STATE_CHANGED, ON_SCROLL_STATE_CHANGED, -// nullptr); - Manager::nodeAPI_->registerNodeEventReceiver([](ArkUI_NodeEvent *event) { - auto eventId = OH_ArkUI_NodeEvent_GetTargetId(event); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "eventID is %{public}d", eventId); - if (eventId == ON_CHANGE) { - EventOnChange(event); - } else if (eventId == ON_ANIMATION_START) { - EventOnAnimationStart(event); - } else if (eventId == ON_ANIMATION_END) { - EventOnAnimationEnd(event); - } else if (eventId == ON_GESTURE_SWIPE) { - EventOnGestureSwipe(event); - } else if (eventId == ON_CONTENT_DID_SCROLL) { - EventOnContentDidScroll(event); - } else if (eventId == ON_SELECTED) { - EventOnSelected(event); - } else if (eventId == ON_UNSELECTED) { - EventOnUnselected(event); - } else if (eventId == ON_CONTENT_WILL_SCROLL) { - EventOnContentWillScroll(event); - } else if (eventId == ON_SCROLL_STATE_CHANGED) { - EventOnScrollStateChanged(event); - } - }); -} - -void SwiperMaker::EventOnChange(ArkUI_NodeEvent *event) -{ - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (componentEvent) { - auto index = componentEvent->data[0].i32; - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "index is %{public}d", index); - } -} - -void SwiperMaker::EventOnAnimationStart(ArkUI_NodeEvent *event) -{ - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (componentEvent) { - auto currIdx = componentEvent->data[0].i32; // index of the currently-displayed item - auto targetIdx = componentEvent->data[1].i32; // index of the item the animation is moving to - auto currOffset = componentEvent->data[2].f32; // current item's displacement from Swiper start - auto targetOffset = componentEvent->data[3].f32; // target item's displacement from Swiper start - auto velocity = componentEvent->data[4].f32; // velocity when finger lifts (px/s) - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "currIdx is %{public}d", currIdx); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "targetIdx is %{public}d", targetIdx); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "currOffset is %{public}f", currOffset); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "targetOffset is %{public}f", targetOffset); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "velocity is %{public}f", velocity); - } -} - -void SwiperMaker::EventOnAnimationEnd(ArkUI_NodeEvent *event) -{ - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (componentEvent) { - auto currentIndex = componentEvent->data[0].i32; // index of the currently-displayed item - auto currentOffset = componentEvent->data[1].f32; // current item's displacement from Swiper start - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "currentIndex is %{public}d", currentIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "currentOffset is %{public}f", currentOffset); - } -} - -void SwiperMaker::EventOnGestureSwipe(ArkUI_NodeEvent *event) -{ - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (componentEvent) { - auto currentIndex = componentEvent->data[0].i32; // index of the currently-displayed item - auto currentOffset = componentEvent->data[1].f32; // current item's displacement from Swiper start - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "currentIndex is %{public}d", currentIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "currentOffset is %{public}f", currentOffset); - } -} - -void SwiperMaker::EventOnContentDidScroll(ArkUI_NodeEvent *event) -{ - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (componentEvent) { - auto selectedIdx = componentEvent->data[0].i32; // Swiper selected index (matches onChange index) - auto pageIdx = componentEvent->data[1].i32; // index of a page visible in viewport - auto offsetRatio = componentEvent->data[2].f32; // page shift ratio vs. selected-page start (0 = aligned) - auto pageSize = componentEvent->data[3].f32; // page length along Swiper main axis - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "selectedIdx is %{public}d", selectedIdx); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "pageIdx is %{public}d", pageIdx); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "offsetRatio is %{public}f", offsetRatio); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "pageSize is %{public}f", pageSize); - } -} - -void SwiperMaker::EventOnSelected(ArkUI_NodeEvent *event) -{ - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (componentEvent) { - auto selectedIndex = componentEvent->data[0].i32; // index of the currently selected item - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "selectedIndex is %{public}d", selectedIndex); - } -} - -void SwiperMaker::EventOnUnselected(ArkUI_NodeEvent *event) -{ - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (componentEvent) { - auto unselectedIndex = componentEvent->data[0].i32; // index of the currently unselected item - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "unselectedIndex is %{public}d", unselectedIndex); - } -} - -void SwiperMaker::EventOnContentWillScroll(ArkUI_NodeEvent *event) -{ - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (componentEvent) { - auto currIdx = componentEvent->data[0].i32; // index of currently-displayed element - auto targetIdx = componentEvent->data[1].i32; // index of element being animated to - auto frameDx = - componentEvent->data[2].f32; // per-frame slide offset: + = backward (e.g. 1→0), − = forward (e.g. 0→1) - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "currIdx is %{public}d", currIdx); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "targetIdx is %{public}d", targetIdx); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "frameDx is %{public}f", frameDx); - } -} - -void SwiperMaker::EventOnScrollStateChanged(ArkUI_NodeEvent *event) -{ - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (componentEvent) { - auto scrollState = componentEvent->data[0].i32; // Current scroll status - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "scrollState is %{public}d", scrollState); - } -} - -void SwiperMaker::SetSwiperAttribute(ArkUI_NodeHandle &swiper) -{ - SetSwiperAttributeLoop(swiper); - SetSwiperAttributeAutoPlay(swiper); - SetSwiperAttributeShowIndicator(swiper); - SetSwiperAttributeInterval(swiper); - SetSwiperAttributeVertical(swiper); - SetSwiperAttributeDuration(swiper); - SetSwiperAttributeCurve(swiper); - SetSwiperAttributeItemSpace(swiper); - SetSwiperAttributeIndex(swiper); - SetSwiperAttributeDisplayCount(swiper); - SetSwiperAttributeDisableSwipe(swiper); - SetSwiperAttributeEdgeEffectMode(swiper); - SetSwiperAttributeNodeAdapter(swiper); - SetSwiperAttributeCachedCount(swiper); - SetSwiperAttributePrevMargin(swiper); - SetSwiperAttributeNextMargin(swiper); - SetSwiperAttributeNestedScroll(swiper); - SetSwiperAttributeSwipeToIndex(swiper); - SetSwiperAttributeIndicatorInteractive(swiper); - SetSwiperAttributePageFlipMode(swiper); - SetSwiperAttributeAutoFill(swiper); - SetSwiperAttributeMaintainVisibleContentPosition(swiper); - SetSwiperEvent(swiper); -} - -ArkUI_NodeHandle SwiperMaker::createSwiperPage() -{ - static ArkUI_NodeHandle swiper1 = Manager::nodeAPI_->createNode(ARKUI_NODE_SWIPER); - static ArkUI_NodeHandle swiper2 = Manager::nodeAPI_->createNode(ARKUI_NODE_SWIPER); - static ArkUI_NodeHandle swiper3 = Manager::nodeAPI_->createNode(ARKUI_NODE_SWIPER); - static ArkUI_NodeHandle swiper4 = Manager::nodeAPI_->createNode(ARKUI_NODE_SWIPER); - ArkUI_NodeHandle scroll = Manager::nodeAPI_->createNode(ARKUI_NODE_SCROLL); - BaseUtils::SetNodeBackGroundColor(scroll, ConstIde::BACKGROUND_COLOR); // 设置节点背景颜色为淡灰色 - ArkUI_NodeHandle column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - SwiperMaker::createSwiperNode(swiper1); - SwiperMaker::SetSwiperArrowStyle(swiper1); - SwiperMaker::GetSwiperArrowStyle(swiper1); - SwiperMaker::createSwiperNode(swiper2); - SwiperMaker::SetSwiperIndicatorTypeDot(swiper2); - SwiperMaker::GetSwiperIndicatorTypeDot(swiper2); - SwiperMaker::createSwiperNode(swiper3); - SwiperMaker::SetSwiperIndicatorTypeDigit(swiper3); - SwiperMaker::GetSwiperIndicatorTypeDigit(swiper3); - SwiperMaker::createSwiperNode(swiper4); - SwiperMaker::SetSwiperAttribute(swiper4); - Manager::nodeAPI_->addChild(column, swiper1); - Manager::nodeAPI_->addChild(column, swiper2); - Manager::nodeAPI_->addChild(column, swiper3); - Manager::nodeAPI_->addChild(column, swiper4); - Manager::nodeAPI_->addChild(scroll, column); - return scroll; -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/SwiperMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/SwiperMaker.h deleted file mode 100644 index c2dc806944c84967c0d3ce3a1d4d320ad84b6448..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/SwiperMaker.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef SWIPER_MAKER_H -#define SWIPER_MAKER_H - -#include "manager.h" -#include - - -class SwiperMaker { -public: - SwiperMaker(){}; - ~SwiperMaker(){}; - static void createSwiperNode(ArkUI_NodeHandle &swiper); - static void SetSwiperArrowStyle(ArkUI_NodeHandle &swiper); - static void GetSwiperArrowStyle(ArkUI_NodeHandle swiper); - static void SetSwiperIndicatorTypeDot(ArkUI_NodeHandle &swiper); - static void GetSwiperIndicatorTypeDot(ArkUI_NodeHandle swiper); - static void SetSwiperIndicatorTypeDigit(ArkUI_NodeHandle &swiper); - static void GetSwiperIndicatorTypeDigit(ArkUI_NodeHandle swiper); - static void SetSwiperAttributeLoop(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeAutoPlay(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeShowIndicator(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeInterval(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeVertical(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeDuration(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeCurve(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeItemSpace(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeIndex(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeDisplayCount(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeDisableSwipe(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeEdgeEffectMode(ArkUI_NodeHandle &swiper); - static ArkUI_NodeAdapterHandle creatNodeAdapter(); - static void SetSwiperAttributeNodeAdapter(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeCachedCount(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributePrevMargin(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeNextMargin(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeNestedScroll(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeSwipeToIndex(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeIndicatorInteractive(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributePageFlipMode(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeAutoFill(ArkUI_NodeHandle &swiper); - static void SetSwiperAttributeMaintainVisibleContentPosition(ArkUI_NodeHandle &swiper); - static void SetSwiperAttribute(ArkUI_NodeHandle &swiper); - static void EventOnChange(ArkUI_NodeEvent *event); - static void EventOnAnimationStart(ArkUI_NodeEvent *event); - static void EventOnAnimationEnd(ArkUI_NodeEvent *event); - static void EventOnGestureSwipe(ArkUI_NodeEvent *event); - static void EventOnContentDidScroll(ArkUI_NodeEvent *event); - static void EventOnSelected(ArkUI_NodeEvent *event); - static void EventOnUnselected(ArkUI_NodeEvent *event); - static void EventOnContentWillScroll(ArkUI_NodeEvent *event); - static void EventOnScrollStateChanged(ArkUI_NodeEvent *event); - - static void SetSwiperEvent(ArkUI_NodeHandle &swiper); - - static ArkUI_NodeHandle createSwiperPage(); - - struct UserCallback { - std::function callback; - UserCallback(){}; - }; - - typedef enum { - ON_CHANGE = 0, - ON_ANIMATION_START = 1, - ON_ANIMATION_END = 2, - ON_GESTURE_SWIPE = 3, - ON_CONTENT_DID_SCROLL = 4, - ON_SELECTED = 5, - ON_UNSELECTED = 6, - ON_CONTENT_WILL_SCROLL = 7, - ON_SCROLL_STATE_CHANGED = 8, - } SwiperEventId; -}; - -#endif // NATIVE_TYPE_SAMPLE_SWIPERMAKER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/TextMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/TextMaker.cpp deleted file mode 100644 index 39734a5e31ed79ce63f6eb013173972c5f20e813..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/TextMaker.cpp +++ /dev/null @@ -1,1206 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "TextMaker.h" -#include "baseUtils.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define LOG_TAG "manager" -#define LOG_INFO(...) OH_LOG_Print(LOG_APP, LOG_INFO, 0xD001400, LOG_TAG, __VA_ARGS__) - -#define VALUE_0 0 -#define VALUE_1 1 -#define VALUE_2 2 -#define VALUE_3 3 -#define VALUE_4 4 -#define VALUE_5 5 -#define VALUE_8 8 -#define VALUE_10 10 -#define VALUE_11 11 -#define VALUE_20 20 -#define VALUE_28 28 -#define VALUE_30 30 -#define VALUE_50 50 -#define VALUE_100 100 -#define VALUE_300 300 -#define VALUE_380 380 -#define VALUE_400 400 -#define EVENT_SPAN_LONG_PRESS 1 -#define EVENT_TEXT_INPUT_CHANGE 2 -#define EVENT_TEXT_INPUT_SUBMIT 3 -#define EVENT_TEXT_INPUT_CUT 4 -#define EVENT_TEXT_INPUT_PASTE 5 -#define EVENT_TEXT_INPUT_SELECTION_CHANGE 6 -#define EVENT_TEXT_INPUT_EDIT_CHANGE 7 -#define EVENT_TEXT_INPUT_CONTENT_SIZE_CHANGE 8 -#define EVENT_TEXT_INPUT_FILTER_ERROR 9 -#define EVENT_TEXT_INPUT_CONTENT_SCROLL 10 -#define EVENT_TEXT_INPUT_WILL_INSERT 11 -#define EVENT_TEXT_INPUT_DID_INSERT 12 -#define EVENT_TEXT_INPUT_WILL_DELETE 13 -#define EVENT_TEXT_INPUT_DID_DELETE 14 -#define EVENT_TEXT_INPUT_CHANGE_PREVIEW 15 -#define EVENT_TEXT_INPUT_WILL_CHANGE 16 -#define EVENT_TEXT_AREA_CHANGE 17 -#define EVENT_TEXT_AREA_PASTE 18 -#define EVENT_TEXT_AREA_SELECTION_CHANGE 19 -#define EVENT_TEXT_AREA_CONTENT_SCROLL 20 -#define EVENT_TEXT_AREA_EDIT_CHANGE 21 -#define EVENT_TEXT_AREA_SUBMIT 22 -#define EVENT_TEXT_AREA_CONTENT_SIZE_CHANGE 23 -#define EVENT_TEXT_AREA_DID_INSERT 24 -#define EVENT_TEXT_AREA_DID_DELETE 25 -#define EVENT_TEXT_AREA_CHANGE_PREVIEW 26 -#define EVENT_TEXT_AREA_FILTER_ERROR 27 -#define EVENT_TEXT_AREA_WILL_INSERT 28 -#define EVENT_TEXT_AREA_WILL_DELETE 29 -#define EVENT_TEXT_AREA_WILL_CHANGE 30 -#define EVENT_TEXT_DETECT_RESULT_UPDATE 31 - -// 处理Span事件 -static void HandleSpanEvent(int32_t eventId) -{ - if (eventId == EVENT_SPAN_LONG_PRESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "spanOnLongPress回调函数被执行"); - } -} - -// 处理TextInput事件(1) -static void HandleTextInputEvent1(int32_t eventId) -{ - switch (eventId) { - case EVENT_TEXT_INPUT_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnChange回调函数被执行"); - break; - case EVENT_TEXT_INPUT_SUBMIT: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnSubmit回调函数被执行"); - break; - case EVENT_TEXT_INPUT_CUT: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnCut回调函数被执行"); - break; - case EVENT_TEXT_INPUT_PASTE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnPaste回调函数被执行"); - break; - case EVENT_TEXT_INPUT_SELECTION_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnSelectionChange回调函数被执行"); - break; - case EVENT_TEXT_INPUT_EDIT_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnEditChange回调函数被执行"); - break; - case EVENT_TEXT_INPUT_CONTENT_SIZE_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnContentSizeChange回调函数被执行"); - break; - default: - break; - } -} - -// 处理TextInput事件(2) -static void HandleTextInputEvent2(int32_t eventId) -{ - switch (eventId) { - case EVENT_TEXT_INPUT_FILTER_ERROR: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnInputFiterError回调函数被执行"); - break; - case EVENT_TEXT_INPUT_CONTENT_SCROLL: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnontentScroll回调函数被执行"); - break; - case EVENT_TEXT_INPUT_WILL_INSERT: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnWillInsert回调函数被执行"); - break; - case EVENT_TEXT_INPUT_DID_INSERT: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnDidInsert回调函数被执行"); - break; - case EVENT_TEXT_INPUT_WILL_DELETE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnWillDelete回调函数被执行"); - break; - case EVENT_TEXT_INPUT_DID_DELETE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnDidDelete回调函数被执行"); - break; - case EVENT_TEXT_INPUT_CHANGE_PREVIEW: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnChangeWithPreviewText回调函数被执行"); - break; - case EVENT_TEXT_INPUT_WILL_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textInputOnWillChange回调函数被执行"); - break; - default: - break; - } -} - -// 处理TextArea事件(1) -static void HandleTextAreaEvent1(int32_t eventId) -{ - switch (eventId) { - case EVENT_TEXT_AREA_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnChange回调函数被执行"); - break; - case EVENT_TEXT_AREA_PASTE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnPaste回调函数被执行"); - break; - case EVENT_TEXT_AREA_SELECTION_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnTextSelectionChange回调函数被执行"); - break; - case EVENT_TEXT_AREA_CONTENT_SCROLL: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnContentScroll回调函数被执行"); - break; - case EVENT_TEXT_AREA_EDIT_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnEditChange回调函数被执行"); - break; - case EVENT_TEXT_AREA_SUBMIT: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnSubmit回调函数被执行"); - break; - case EVENT_TEXT_AREA_CONTENT_SIZE_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnContentSizeChange回调函数被执行"); - break; - default: - break; - } -} - -// 处理TextArea事件(2) -static void HandleTextAreaEvent2(int32_t eventId) -{ - switch (eventId) { - case EVENT_TEXT_AREA_DID_INSERT: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnDidInsert回调函数被执行"); - break; - case EVENT_TEXT_AREA_DID_DELETE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnDidDelete回调函数被执行"); - break; - case EVENT_TEXT_AREA_CHANGE_PREVIEW: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnChangeWithPreviewText回调函数被执行"); - break; - case EVENT_TEXT_AREA_FILTER_ERROR: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnInputFilterError回调函数被执行"); - break; - case EVENT_TEXT_AREA_WILL_INSERT: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnWillInsert回调函数被执行"); - break; - case EVENT_TEXT_AREA_WILL_DELETE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnWillDelete回调函数被执行"); - break; - case EVENT_TEXT_AREA_WILL_CHANGE: - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textAreaOnWillChange回调函数被执行"); - break; - default: - break; - } -} - -// 处理其他事件 -static void HandleOtherEvent(int32_t eventId) -{ - if (eventId == EVENT_TEXT_DETECT_RESULT_UPDATE) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textOnDetectResultUpdate回调函数被执行"); - } -} - -// 主事件处理函数 -static void OnEventReceive(ArkUI_NodeEvent *event) -{ - if (event == nullptr) { - return; - } - // 处理字符串异步事件 - ArkUI_StringAsyncEvent *asyncEvent = OH_ArkUI_NodeEvent_GetStringAsyncEvent(event); - if (asyncEvent != nullptr) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "text组件事件数据获取成功"); - } - // 处理文本变化事件 - ArkUI_TextChangeEvent *textChangeEvent = OH_ArkUI_NodeEvent_GetTextChangeEvent(event); - if (asyncEvent != nullptr) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "textChange组件事件数据获取成功"); - } - // 处理字符串值 - char *eventStr = nullptr; - int32_t strSize = VALUE_0; - int32_t ret = OH_ArkUI_NodeEvent_GetStringValue(event, VALUE_0, &eventStr, &strSize); - if (ret == ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "text组件事件数据获取成功"); - } - // 分发事件处理 - int32_t eventId = OH_ArkUI_NodeEvent_GetTargetId(event); - HandleSpanEvent(eventId); - HandleTextInputEvent1(eventId); - HandleTextInputEvent2(eventId); - HandleTextAreaEvent1(eventId); - HandleTextAreaEvent2(eventId); - HandleOtherEvent(eventId); -} - -void setText1(ArkUI_NodeHandle &text) -{ - ArkUI_NumberValue textWidth[] = {{.f32 = VALUE_380}}; - ArkUI_AttributeItem textWidthItem = {.value = textWidth, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = VALUE_100}}; - ArkUI_AttributeItem textHeightItem = {.value = textHeight, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(text, NODE_HEIGHT, &textHeightItem); - if (text != nullptr) { - // span仅作为text的子组件形式展示 - ArkUI_NodeHandle span = Manager::nodeAPI_->createNode(ARKUI_NODE_SPAN); - const char *spanContent = "This is a span"; - ArkUI_AttributeItem spanContentItem = {.string = spanContent}; - Manager::nodeAPI_->setAttribute(span, NODE_SPAN_CONTENT, &spanContentItem); - if (span != nullptr) { - // 设置Span背景样式 - ArkUI_NumberValue spanBackground[] = { - {.u32 = 0xFFFF0000}, // 背景颜色 - {.f32 = 5.0f}, // 左上角半径 - {.f32 = 5.0f}, // 右上角半径 - {.f32 = 5.0f}, // 左下角半径 - {.f32 = 5.0f} // 右下角半径 - }; - ArkUI_AttributeItem spanBackgroundItem = {.value = spanBackground, .size = VALUE_5}; - Manager::nodeAPI_->setAttribute(span, NODE_SPAN_TEXT_BACKGROUND_STYLE, &spanBackgroundItem); - - // 文本基线的偏移量属性 - ArkUI_NumberValue baselineOffsetVal = {.f32 = VALUE_10}; - ArkUI_AttributeItem baselineOffsetItem = {&baselineOffsetVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text, NODE_SPAN_BASELINE_OFFSET, &baselineOffsetItem); - // 长按span组件,触发回调 - Manager::nodeAPI_->registerNodeEvent(span, NODE_TEXT_SPAN_ON_LONG_PRESS, EVENT_SPAN_LONG_PRESS, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - } - Manager::nodeAPI_->addChild(text, span); - } -} - -static void setTextInput1Base(ArkUI_NodeHandle &textInput1) -{ - // 控制单行文本输入框编辑态属性 - ArkUI_NumberValue inputEditing = {.i32 = true}; - ArkUI_AttributeItem inputEditingItem = {&inputEditing, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_EDITING, &inputEditingItem); - // 单行文本设置文本选中并高亮的区域 - ArkUI_NumberValue inputTextSelection[] = {{.i32 = VALUE_0}, {.i32 = VALUE_10}}; - ArkUI_AttributeItem inputTextSelectionItem = {inputTextSelection, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_TEXT_SELECTION, &inputTextSelectionItem); - // 设置是否启用自动填充 - ArkUI_NumberValue enableAutoFill = {.i32 = false}; - ArkUI_AttributeItem enableAutoFillItem = {&enableAutoFill, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_ENABLE_AUTO_FILL, &enableAutoFillItem); - // 设置是否启用自动填充动效 - ArkUI_NumberValue enableFillAnimation = {.i32 = false}; - ArkUI_AttributeItem enableFillAnimationItem = {&enableFillAnimation, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_ENABLE_FILL_ANIMATION, &enableFillAnimationItem); - // 自动填充类型(密码保险箱支持) - ArkUI_NumberValue inputContentType = {.i32 = ARKUI_TEXTINPUT_CONTENT_TYPE_PASSWORD}; - ArkUI_AttributeItem inputContentTypeItem = {&inputContentType, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_CONTENT_TYPE, &inputContentTypeItem); - // 定义生成密码规则 - const char *passwordRulesVal = "这是密码规则"; - ArkUI_AttributeItem passwordRulesItem = {.string = passwordRulesVal}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_PASSWORD_RULES, &passwordRulesItem); - // 设置初始状态,是否全选文本 - ArkUI_NumberValue inputSelectAll = {.i32 = false}; - ArkUI_AttributeItem inputSelectAllItem = {&inputSelectAll, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_SELECT_ALL, &inputSelectAllItem); -} - -// 设置TextInput1的基础属性(提示文本、光标、字体、输入模式等) -static void SetTextInput1BaseAttrs(ArkUI_NodeHandle &textInput1) -{ - // 默认提示文本内容 - const char *inputPlaceHolederVal = "please info password"; - ArkUI_AttributeItem placeHolederItem = {.string = inputPlaceHolederVal}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_PLACEHOLDER, &placeHolederItem); - // 光标颜色属性 - ArkUI_NumberValue caretColor = {.u32 = 0xFFFF0000}; - ArkUI_AttributeItem caretColorItem = {&caretColor, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_CARET_COLOR, &caretColorItem); - // 光标风格属性,光标宽度 - ArkUI_NumberValue caretStyle = {.f32 = VALUE_2}; - ArkUI_AttributeItem caretStyleItem = {&caretStyle, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_CARET_STYLE, &caretStyleItem); - // 无输入时默认字体颜色属性 - ArkUI_NumberValue placeholderColor = {.u32 = 0xFFFF0000}; - ArkUI_AttributeItem placeholderColorItem = {&placeholderColor, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_PLACEHOLDER_COLOR, &placeholderColorItem); - // 无输入时默认字体配置(斜体,字体大小 20) - ArkUI_NumberValue placeholderFont[] = {{.f32 = VALUE_20}, {.i32 = ARKUI_FONT_STYLE_ITALIC}}; - ArkUI_AttributeItem placeholderFontItem = {placeholderFont, VALUE_2}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_PLACEHOLDER_FONT, &placeholderFontItem); - // 聚焦是否绑定输入法 - ArkUI_NumberValue enableKeyboard = {.i32 = false}; - ArkUI_AttributeItem enableKeyboardItem = {&enableKeyboard, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_ENABLE_KEYBOARD_ON_FOCUS, &enableKeyboardItem); - // 输入框类型属性(密码输入模式) - ArkUI_NumberValue inputTyple = {.i32 = ARKUI_TEXTINPUT_TYPE_PASSWORD}; - ArkUI_AttributeItem inputTypleItem = {&inputTyple, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_TYPE, &inputTypleItem); - // 密码输入模式是否显示末尾图标属性 - ArkUI_NumberValue showPasswordIcon = {.i32 = false}; - ArkUI_AttributeItem showPasswordIconItem = {&showPasswordIcon, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_SHOW_PASSWORD_ICON, &showPasswordIconItem); - // 输入框文本被选中时的背景色 - ArkUI_NumberValue selectedBackgroundColor = {.u32 = 0xFFFFFF00}; - ArkUI_AttributeItem selectedBackgroundColorItem = {&selectedBackgroundColor, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput1, NODE_TEXT_INPUT_SELECTED_BACKGROUND_COLOR, - &selectedBackgroundColorItem); - setTextInput1Base(textInput1); -} - -// 注册 TextInput1 的所有事件 -static void RegisterTextInput1Events(ArkUI_NodeHandle &textInput1) -{ - // TextInput 输入内容发生变化时触发 - Manager::nodeAPI_->registerNodeEvent(textInput1, NODE_TEXT_INPUT_ON_CHANGE, EVENT_TEXT_INPUT_CHANGE, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // TextInput 按下输入法回车键触发 - Manager::nodeAPI_->registerNodeEvent(textInput1, NODE_TEXT_INPUT_ON_SUBMIT, EVENT_TEXT_INPUT_SUBMIT, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 长按弹出剪贴板后点击剪切触发 - Manager::nodeAPI_->registerNodeEvent(textInput1, NODE_TEXT_INPUT_ON_CUT, EVENT_TEXT_INPUT_CUT, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 长按弹出剪贴板后点击粘贴触发 - Manager::nodeAPI_->registerNodeEvent(textInput1, NODE_TEXT_INPUT_ON_PASTE, EVENT_TEXT_INPUT_PASTE, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 文本选择变化触发 - Manager::nodeAPI_->registerNodeEvent(textInput1, NODE_TEXT_INPUT_ON_TEXT_SELECTION_CHANGE, - EVENT_TEXT_INPUT_SELECTION_CHANGE, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 输入状态变化触发 - Manager::nodeAPI_->registerNodeEvent(textInput1, NODE_TEXT_INPUT_ON_EDIT_CHANGE, EVENT_TEXT_INPUT_EDIT_CHANGE, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 文本内容滚动触发 - Manager::nodeAPI_->registerNodeEvent(textInput1, NODE_TEXT_INPUT_ON_CONTENT_SCROLL, EVENT_TEXT_INPUT_CONTENT_SCROLL, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); -} - -void setTextInput1(ArkUI_NodeHandle &textInput1) -{ - SetTextInput1BaseAttrs(textInput1); - RegisterTextInput1Events(textInput1); -} - -static void setTextInputVal(ArkUI_NodeHandle &textInput2) -{ - // 设置输入框风格,(内联只支持输入框类型设置为normal) - ArkUI_NumberValue textInputStyle = {.i32 = ARKUI_TEXTINPUT_STYLE_INLINE}; - ArkUI_AttributeItem textInputStyleItem = {&textInputStyle, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_STYLE, &textInputStyleItem); - - // 单行文本输入框的默认文本内容属性 - ArkUI_AttributeItem textInputText = {.string = "this is textinput 2"}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_TEXT, &textInputText); - - // 设置长按、双击输入框或者右键输入框时,是否不弹出文本选择菜单(true是隐藏,false是显示,默认值是false) - ArkUI_NumberValue selelctionMenuHidden = {.i32 = true}; - ArkUI_AttributeItem selelctionMenuHiddenItem = {&selelctionMenuHidden, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_SELECTION_MENU_HIDDEN, &selelctionMenuHiddenItem); - - // 回车键类型 - ArkUI_NumberValue enterKeyType = {.i32 = ARKUI_ENTER_KEY_TYPE_SEND}; - ArkUI_AttributeItem enterKeyTypeItem = {&enterKeyType, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_ENTER_KEY_TYPE, &enterKeyTypeItem); - - // 是否弹出键盘(默认true,false将不弹出键盘) - ArkUI_NumberValue showKeyboardOnFocus = {.i32 = true}; - ArkUI_AttributeItem showKeyboardOnFocusItem = {&showKeyboardOnFocus, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_SHOW_KEYBOARD_ON_FOCUS, &showKeyboardOnFocusItem); - - // 调整textInput组件之间的字符间距 - ArkUI_NumberValue inputLetterSpacing = {.f32 = VALUE_10}; - ArkUI_AttributeItem inputLetterSpacingItem = {&inputLetterSpacing, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_LETTER_SPACING, &inputLetterSpacingItem); - - // 是否开启输入预上屏 - ArkUI_NumberValue enablePreviewText = {.i32 = false}; - ArkUI_AttributeItem enablePreviewTextItem = {&enablePreviewText, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_ENABLE_PREVIEW_TEXT, &enablePreviewTextItem); - - // 设置文本将行间距平分至行的顶部与底部 - ArkUI_NumberValue inputHalfLeading = {.i32 = true}; - ArkUI_AttributeItem inputHalfLeadingItem = {&inputHalfLeading, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_HALF_LEADING, &inputHalfLeadingItem); - - // 设置输入框拉起的键盘样式 - ArkUI_NumberValue keyboardAppenrance = {.i32 = ARKUI_KEYBOARD_APPEARANCE_DARK_IMMERSIVE}; - ArkUI_AttributeItem keyboardAppenranceItem = {&keyboardAppenrance, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_KEYBOARD_APPEARANCE, &keyboardAppenranceItem); - - // 设置输入框文本的高度(设置为undefined时,文本的高度设置为5) - ArkUI_NumberValue inputLineHeight = {.i32 = VALUE_30}; - ArkUI_AttributeItem inputLineHeightItem = {&inputLineHeight, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_LINE_HEIGHT, &inputLineHeightItem); -} - -void setTextInput2(ArkUI_NodeHandle &textInput2) -{ - setTextInputVal(textInput2); - // 获取已编辑文本内容区域相对组件的位置和大小 - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", - "NODE_TEXT_INPUT_CARET_OFFSET:%{public}f、%{public}f、%{public}f、%{public}f", - Manager::nodeAPI_->getAttribute(textInput2, NODE_TEXT_INPUT_CONTENT_RECT)->value[VALUE_0].f32, - Manager::nodeAPI_->getAttribute(textInput2, NODE_TEXT_INPUT_CONTENT_RECT)->value[VALUE_1].f32, - Manager::nodeAPI_->getAttribute(textInput2, NODE_TEXT_INPUT_CONTENT_RECT)->value[VALUE_2].f32, - Manager::nodeAPI_->getAttribute(textInput2, NODE_TEXT_INPUT_CONTENT_RECT)->value[VALUE_3].f32); - - // 获取已编辑内容的行数 - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_TEXT_INPUT_CONTENT_LINE_COUNT:%{public}d、%{public}d", - Manager::nodeAPI_->getAttribute(textInput2, NODE_TEXT_INPUT_CONTENT_LINE_COUNT)->value[VALUE_0].i32, - Manager::nodeAPI_->getAttribute(textInput2, NODE_TEXT_INPUT_CONTENT_LINE_COUNT)->value[VALUE_1].i32); - - // TextInput输入内容发生变化时触发该事件 - Manager::nodeAPI_->registerNodeEvent(textInput2, NODE_TEXT_INPUT_ON_CONTENT_SIZE_CHANGE, - EVENT_TEXT_INPUT_CONTENT_SIZE_CHANGE, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - - // 定义在输入完成时,触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textInput2, NODE_TEXT_INPUT_ON_DID_INSERT, EVENT_TEXT_INPUT_DID_INSERT, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - - // 定义在删除完成时,触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textInput2, NODE_TEXT_INPUT_ON_DID_DELETE, EVENT_TEXT_INPUT_DID_DELETE, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - - // 定义TextInput组件在内容改变时(包含预上屏内容),触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textInput2, NODE_TEXT_INPUT_ON_CHANGE_WITH_PREVIEW_TEXT, - EVENT_TEXT_INPUT_CHANGE_PREVIEW, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - - // 定义在删除完成时,触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textInput2, NODE_TEXT_INPUT_ON_WILL_CHANGE, EVENT_TEXT_INPUT_WILL_CHANGE, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); -} - -void setTextInput3(ArkUI_NodeHandle &textInput3) -{ - // 输入框下划线 - ArkUI_NumberValue showUnderLine = {.i32 = true}; - ArkUI_AttributeItem showUnderLineItem = {&showUnderLine, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput3, NODE_TEXT_INPUT_SHOW_UNDERLINE, &showUnderLineItem); - - // 设置输入框最大文本数属性 - ArkUI_NumberValue maxLength = {.i32 = VALUE_10}; - ArkUI_AttributeItem maxLengthItem = {&maxLength, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput3, NODE_TEXT_INPUT_MAX_LENGTH, &maxLengthItem); - - // 单行文本右侧清除按钮样式 - ArkUI_NumberValue cancelButton[] = {{.i32 = ARKUI_CANCELBUTTON_STYLE_CONSTANT}}; - ArkUI_AttributeItem cancelButtonItem = {cancelButton, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput3, NODE_TEXT_INPUT_CANCEL_BUTTON, &cancelButtonItem); - - // 开启下划线时,配置下划线的颜色 - ArkUI_NumberValue underlineColor[] = { - {.u32 = 0xFFFF0000}, {.u32 = 0xFFFF1493}, {.u32 = 0xFFFFB7C5}, {.u32 = 0xFFFFE4E1}}; - ArkUI_AttributeItem underlineColorItem = {underlineColor, VALUE_4}; - Manager::nodeAPI_->setAttribute(textInput3, NODE_TEXT_INPUT_UNDERLINE_COLOR, &underlineColorItem); - - // 通过正则表达式设置输入,支持字符串匹配,例如粘贴 - ArkUI_AttributeItem filterItem = {.string = "a"}; - Manager::nodeAPI_->setAttribute(textInput3, NODE_TEXT_INPUT_INPUT_FILTER, &filterItem); - // 设置自定义键盘 - ArkUI_NumberValue inputCustomKeyBoard = {.i32 = false}; - ArkUI_AttributeItem inputCustomKeyBoardItem = {&inputCustomKeyBoard, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput3, NODE_TEXT_INPUT_CUSTOM_KEYBOARD, &inputCustomKeyBoardItem); - - // 断行规则:CJK任意断行(ARKUI_WORD_BREAK_NORMAL) - ArkUI_NumberValue wordBreakVal = {.i32 = ARKUI_WORD_BREAK_NORMAL}; - ArkUI_AttributeItem wordBreakItem = {&wordBreakVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput3, NODE_TEXT_WORD_BREAK, &wordBreakItem); - - // 设置输入框在submit状态下,触发回车键是否失焦 - ArkUI_NumberValue blurOrSubmit = {.i32 = false}; - ArkUI_AttributeItem blurOrSubmitItem = {&blurOrSubmit, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput3, NODE_TEXT_INPUT_BLUR_ON_SUBMIT, &blurOrSubmitItem); - - // 定义在将要输入时,触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textInput3, NODE_TEXT_INPUT_ON_WILL_INSERT, EVENT_TEXT_INPUT_WILL_INSERT, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - - // 定义在将要删除时,触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textInput3, NODE_TEXT_INPUT_ON_WILL_DELETE, EVENT_TEXT_INPUT_WILL_DELETE, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - - // 设置光标所在位置 - ArkUI_NumberValue textInputCaretOffset = {.i32 = VALUE_5}; - ArkUI_AttributeItem textInputCaretOffsetItem = {&textInputCaretOffset, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput3, NODE_TEXT_INPUT_CARET_OFFSET, &textInputCaretOffsetItem); - - // 获取已编辑内容的行数 - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_TEXT_AREA_CONTENT_LINE_COUNT:%{public}d", - Manager::nodeAPI_->getAttribute(textInput3, NODE_TEXT_INPUT_CONTENT_LINE_COUNT)->value[VALUE_0].i32); - - // 设置NODE_TEXT_INPUT_INPUT_FILTER,正则匹配失败时触发。触发该事件的条件:正则匹配失败时 - Manager::nodeAPI_->registerNodeEvent(textInput3, NODE_TEXT_INPUT_ON_INPUT_FILTER_ERROR, - EVENT_TEXT_INPUT_FILTER_ERROR, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); -} - -static void setTextArea1Val(ArkUI_NodeHandle &textArea1) -{ - // 多行文本输入框的默认提示文本内容属性 - const char *textAreaPlaceholder = "this is textArea1"; - ArkUI_AttributeItem textAreaPlaceholderItem = {.string = textAreaPlaceholder}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_PLACEHOLDER, &textAreaPlaceholderItem); - - // 输入框支持的最大文本数属性 - ArkUI_NumberValue textAreaMaxLength = {.i32 = VALUE_11}; - ArkUI_AttributeItem textAreaMaxLengthItem = {&textAreaMaxLength, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_MAX_LENGTH, &textAreaMaxLengthItem); - - // 无输入时默认提示文本的颜色属性 - ArkUI_NumberValue textAreaPlaceholederColor = {.u32 = 0xFFFFC0CB}; - ArkUI_AttributeItem textAreaPlaceholederColorItem = {&textAreaPlaceholederColor, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_PLACEHOLDER_COLOR, &textAreaPlaceholederColorItem); - - // 光标颜色属性 - ArkUI_NumberValue textAreaCaretColor = {.u32 = 0xFFFFE4E1}; - ArkUI_AttributeItem textAreaCaretColorItem = {&textAreaCaretColor, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_CARET_COLOR, &textAreaCaretColorItem); - - // 控制多行文本输入框编辑态属性 - ArkUI_NumberValue textAreaEditing = {.i32 = true}; - ArkUI_AttributeItem textAreaEditingItem = {&textAreaEditing, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_EDITING, &textAreaEditingItem); - - // 输入框的类型属性 - ArkUI_NumberValue textAreaType = {.i32 = ARKUI_TEXTAREA_TYPE_NUMBER}; - ArkUI_AttributeItem textAreaTypeItem = {&textAreaType, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_TYPE, &textAreaTypeItem); - - // 设置输入的字符数超过阈值时是否显示计数器,超出阈值高亮边框 - ArkUI_NumberValue textAreaShowCounter[] = {{.i32 = true}, {.f32 = VALUE_100}, {.i32 = true}}; - ArkUI_AttributeItem textAreaShowCounterItem = {textAreaShowCounter, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_SHOW_COUNTER, &textAreaShowCounterItem); - - // 设置长按、双击输入框或者右键输入框时,是否不弹出文本选择菜单 - ArkUI_NumberValue textAreaSelectionMenuHidden = {.i32 = true}; - ArkUI_AttributeItem textAreaSelectionMenuHiddenItem = {&textAreaSelectionMenuHidden, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_SELECTION_MENU_HIDDEN, &textAreaSelectionMenuHiddenItem); - - // 设置文本选中底板颜色 - ArkUI_NumberValue textAreaSelectedBackgroundColor = {.u32 = 0xFFFF0000}; - ArkUI_AttributeItem textAreaSelectedBackgroundColorItem = {&textAreaSelectedBackgroundColor, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_SELECTED_BACKGROUND_COLOR, - &textAreaSelectedBackgroundColorItem); - - // 回车键类型 - ArkUI_NumberValue enterKeyType = {.i32 = ARKUI_ENTER_KEY_TYPE_SEND}; - ArkUI_AttributeItem enterKeyTypeItem = {&enterKeyType, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_ENTER_KEY_TYPE, &enterKeyTypeItem); - - // 是否弹出键盘(默认true,false将不弹出键盘) - ArkUI_NumberValue showKeyboardOnFocus = {.i32 = true}; - ArkUI_AttributeItem showKeyboardOnFocusItem = {&showKeyboardOnFocus, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_SHOW_KEYBOARD_ON_FOCUS, &showKeyboardOnFocusItem); - - // 设置文本将行间距平分至行的顶部与底部 - ArkUI_NumberValue areaHalfLeading = {.i32 = true}; - ArkUI_AttributeItem areaHalfLeadingItem = {&areaHalfLeading, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_HALF_LEADING, &areaHalfLeadingItem); - - // 设置节点的最小行数 - ArkUI_NumberValue textAreaMinLines = {.i32 = VALUE_1}; - ArkUI_AttributeItem textAreaMinLinesItem = {&textAreaMinLines, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_MIN_LINES, &textAreaMinLinesItem); -} - -void setTextArea1(ArkUI_NodeHandle &textArea1) -{ - setTextArea1Val(textArea1); - // 设置输入框文本的高度 - ArkUI_NumberValue textAreaLineHeight = {.i32 = VALUE_30}; - ArkUI_AttributeItem textAreaLineHeightItem = {&textAreaLineHeight, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_LINE_HEIGHT, &textAreaLineHeightItem); - - // 组件在获焦状态下,调用该接口设置文本选择区域并高亮显示,且只有在selectionStart小于selectionEnd时,文字才会被选取、高亮显示。 - ArkUI_NumberValue textAreaSelection[] = {{.i32 = VALUE_2}, {.i32 = VALUE_8}}; - ArkUI_AttributeItem textAreaSelectionItem = {textAreaSelection, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_TEXT_SELECTION, &textAreaSelectionItem); - - // 设置是否启用自动填充 - ArkUI_NumberValue textAreaEnableAutoFill = {.i32 = false}; - ArkUI_AttributeItem textAreaEnableAutoFillItem = {&textAreaEnableAutoFill, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_ENABLE_AUTO_FILL, &textAreaEnableAutoFillItem); - - // NODE_TEXT_AREA_CONTENT_TYPE - ArkUI_NumberValue textAreaContentType = {.i32 = ARKUI_TEXTINPUT_CONTENT_TYPE_USER_NAME}; - ArkUI_AttributeItem textAreaContentTypeItem = {&textAreaContentType, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea1, NODE_TEXT_AREA_CONTENT_TYPE, &textAreaContentTypeItem); - - // 获取光标所在位置信息 - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_TEXT_AREA_CARET_OFFSET:%{public}d", - Manager::nodeAPI_->getAttribute(textArea1, NODE_TEXT_AREA_CARET_OFFSET)->value[VALUE_0].i32); - - // 获取已编辑文本内容区域相对组件的位置和大小 - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", - "NODE_TEXT_AREA_CARET_OFFSET:%{public}f、%{public}f、%{public}f、%{public}f", - Manager::nodeAPI_->getAttribute(textArea1, NODE_TEXT_AREA_CONTENT_RECT)->value[VALUE_0].f32, - Manager::nodeAPI_->getAttribute(textArea1, NODE_TEXT_AREA_CONTENT_RECT)->value[VALUE_1].f32, - Manager::nodeAPI_->getAttribute(textArea1, NODE_TEXT_AREA_CONTENT_RECT)->value[VALUE_2].f32, - Manager::nodeAPI_->getAttribute(textArea1, NODE_TEXT_AREA_CONTENT_RECT)->value[VALUE_3].f32); - - // 获取已编辑内容的行数 - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_TEXT_AREA_CONTENT_LINE_COUNT:%{public}d、%{public}d", - Manager::nodeAPI_->getAttribute(textArea1, NODE_TEXT_AREA_CONTENT_LINE_COUNT)->value[VALUE_0].i32, - Manager::nodeAPI_->getAttribute(textArea1, NODE_TEXT_AREA_CONTENT_LINE_COUNT)->value[VALUE_1].i32); - - // 输入内容发生变化时,触发该回调 - Manager::nodeAPI_->registerNodeEvent(textArea1, NODE_TEXT_AREA_ON_CHANGE, EVENT_TEXT_AREA_CHANGE, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); -} - -void setTextArea2(ArkUI_NodeHandle &textArea2) -{ - // 多行文本输入框的默认提示文本内容属性 - const char *textAreaText = "这里是默认文本内容"; - ArkUI_AttributeItem textAreaTextItem = {.string = textAreaText}; - Manager::nodeAPI_->setAttribute(textArea2, NODE_TEXT_AREA_PLACEHOLDER, &textAreaTextItem); - - // 设置输入框文本的行间距 - ArkUI_NumberValue textAreaLineSpacing = {.i32 = VALUE_10}; - ArkUI_AttributeItem textAreaLineSpacingItem = {&textAreaLineSpacing, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea2, NODE_TEXT_AREA_LINE_SPACING, &textAreaLineSpacingItem); - - // 设置TextArea组件是否开启输入预上屏 - ArkUI_NumberValue enablePrevireText = {.i32 = ARKUI_ENTER_KEY_TYPE_SEND}; - ArkUI_AttributeItem enablePrevireTextItem = {&enablePrevireText, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea2, NODE_TEXT_AREA_ENABLE_PREVIEW_TEXT, &enablePrevireTextItem); - - // 设置输入框拉起的键盘样式 - ArkUI_NumberValue keyboardAppenrance = {.i32 = ARKUI_KEYBOARD_APPEARANCE_DARK_IMMERSIVE}; - ArkUI_AttributeItem keyboardAppenranceItem = {&keyboardAppenrance, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea2, NODE_TEXT_AREA_KEYBOARD_APPEARANCE, &keyboardAppenranceItem); - - // 设置输入框文本的行间距 - ArkUI_NumberValue textAreaLetterSpacing = {.i32 = VALUE_10}; - ArkUI_AttributeItem textAreaLetterSpacingItem = {&textAreaLetterSpacing, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea2, NODE_TEXT_AREA_LETTER_SPACING, &textAreaLetterSpacingItem); - - // 设置输入框内联模式编辑态时文本可显示的最大行数 - ArkUI_NumberValue textAreaMaxLines = {.i32 = VALUE_8}; - ArkUI_AttributeItem textAreaMaxLinesItem = {&textAreaMaxLines, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea2, NODE_TEXT_AREA_MAX_LINES, &textAreaMaxLinesItem); - - // 设置输入框在submit状态下,触发回车键是否失焦 - ArkUI_NumberValue blurOrSubmit = {.i32 = false}; - ArkUI_AttributeItem blurOrSubmitItem = {&blurOrSubmit, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea2, NODE_TEXT_AREA_BLUR_ON_SUBMIT, &blurOrSubmitItem); - - // 通过正则表达式设置输入,支持字符串匹配,例如粘贴 - ArkUI_AttributeItem filterItem = {.string = "a"}; - Manager::nodeAPI_->setAttribute(textArea2, NODE_TEXT_AREA_INPUT_FILTER, &filterItem); - - // 设置TextArea通过点击以外的方式获焦时,是否绑定输入法 - ArkUI_NumberValue keyboardOnFocus = {.i32 = false}; - ArkUI_AttributeItem keyboardOnFocusItem = {&keyboardOnFocus, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea2, NODE_TEXT_AREA_ENABLE_KEYBOARD_ON_FOCUS, &keyboardOnFocusItem); - - // 设置NODE_TEXT_AREA_INPUT_FILTER,正则匹配失败时触发。触发该事件的条件:正则匹配失败时 - Manager::nodeAPI_->registerNodeEvent(textArea2, NODE_TEXT_AREA_ON_INPUT_FILTER_ERROR, EVENT_TEXT_AREA_FILTER_ERROR, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - - // 定义在将要输入时,触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textArea2, NODE_TEXT_AREA_ON_WILL_INSERT, EVENT_TEXT_AREA_WILL_INSERT, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - - // 定义在将要删除时,触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textArea2, NODE_TEXT_AREA_ON_WILL_DELETE, EVENT_TEXT_AREA_WILL_DELETE, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - - // 定义TextArea组件在内容将要改变时(包含预上屏内容),触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textArea2, NODE_TEXT_AREA_ON_WILL_CHANGE, EVENT_TEXT_AREA_WILL_CHANGE, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); -} - -static void onFontStyleChange(ArkUI_SystemFontStyleEvent *event, void *userData) -{ - float fontSizeScale = OH_ArkUI_SystemFontStyleEvent_GetFontSizeScale(event); - float fontWeightScale = OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale(event); - ArkUI_NodeHandle textNode = static_cast(userData); -} - -void setText2(ArkUI_NodeHandle &text2) -{ - const char *textContent = "this is text 2 this is text 2 this is text 2!!!! "; - ArkUI_AttributeItem contentItem = {.string = textContent}; - Manager::nodeAPI_->setAttribute(text2, NODE_TEXT_CONTENT, &contentItem); - // 设置文本样式 - ArkUI_NumberValue fontSize[] = {{.f32 = VALUE_28}}; - ArkUI_AttributeItem fontSizeItem = {.value = fontSize, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(text2, NODE_FONT_SIZE, &fontSizeItem); - ArkUI_NumberValue fontColor = {.u32 = 0xFFFF0000}; - ArkUI_AttributeItem fontColorItem = {.value = &fontColor, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(text2, NODE_FONT_COLOR, &fontColorItem); - - // 字体样式:斜体样式(ARKUI_FONT_STYLE_ITALIC) - ArkUI_NumberValue fontStyleVal = {.i32 = ARKUI_FONT_STYLE_ITALIC}; - ArkUI_AttributeItem fontStyleItem = {&fontStyleVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text2, NODE_FONT_STYLE, &fontStyleItem); - - // 文本字符间距 - ArkUI_NumberValue letterSpaceVal = {.f32 = VALUE_10}; - ArkUI_AttributeItem letterSpaceItem = {&letterSpaceVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text2, NODE_TEXT_LETTER_SPACING, &letterSpaceItem); - // 文本最大行数 - ArkUI_NumberValue maxLinesVal = {.i32 = VALUE_1}; - ArkUI_AttributeItem maxLinesItem = {&maxLinesVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text2, NODE_TEXT_LETTER_SPACING, &maxLinesItem); - - // 最小显示字号 - ArkUI_NumberValue minFontSizeVal = {.i32 = ARKUI_COPY_OPTIONS_NONE}; - ArkUI_AttributeItem minFontSizeItem = {&minFontSizeVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text2, NODE_TEXT_COPY_OPTION, &minFontSizeItem); - - // 文本溢出:跑马灯(ARKUI_TEXT_OVERFLOW_MARQUEE) - ArkUI_NumberValue overflowVal = {.i32 = ARKUI_TEXT_OVERFLOW_MARQUEE}; - ArkUI_AttributeItem overflowItem = {&overflowVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text2, NODE_TEXT_OVERFLOW, &overflowItem); - - int32_t ret = OH_ArkUI_RegisterSystemFontStyleChangeEvent(text2, text2, &onFontStyleChange); - if (ret == ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "字体变更回调"); - } -} - -void setText3(ArkUI_NodeHandle &text3) -{ - const char *textContent = - "this is text 3 this is text 3 this is text 3!!!!this is text 3 this is text 3 this is text 3!!!! "; - ArkUI_AttributeItem contentItem = {.string = textContent}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_CONTENT, &contentItem); - - // 自适应高度:MaxLines优先(ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MAX_LINES_FIRST) - ArkUI_NumberValue adaptPolicyVal = {.i32 = ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MAX_LINES_FIRST}; - ArkUI_AttributeItem adaptPolicyItem = {&adaptPolicyVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_HEIGHT_ADAPTIVE_POLICY, &adaptPolicyItem); - - // 水平对齐:首部对齐(ARKUI_TEXT_ALIGNMENT_START) - ArkUI_NumberValue hAlignVal = {.i32 = ARKUI_TEXT_ALIGNMENT_START}; - ArkUI_AttributeItem hAlignItem = {&hAlignVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_ALIGN, &hAlignItem); - - // 首行缩进 - ArkUI_NumberValue indentVal = {.f32 = VALUE_30}; - ArkUI_AttributeItem indentItem = {&indentVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_INDENT, &indentItem); - - // 省略位置:行首省略(ARKUI_ELLIPSIS_MODE_START) - ArkUI_NumberValue ellipsisVal = {.i32 = ARKUI_ELLIPSIS_MODE_START}; - ArkUI_AttributeItem ellipsisItem = {&ellipsisVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_ELLIPSIS_MODE, &ellipsisItem); - - // 复制粘贴:不支持复制(ARKUI_COPY_OPTIONS_NONE / ARKUI_TEXT_COPY_OPTIONS_NONE) - ArkUI_NumberValue copyOptVal = {.i32 = ARKUI_COPY_OPTIONS_NONE}; - ArkUI_AttributeItem copyOptItem = {©OptVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_COPY_OPTION, ©OptItem); - - // 断行规则:CJK任意断行(ARKUI_WORD_BREAK_NORMAL) - ArkUI_NumberValue wordBreakVal = {.i32 = ARKUI_WORD_BREAK_NORMAL}; - ArkUI_AttributeItem wordBreakItem = {&wordBreakVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_WORD_BREAK, &wordBreakItem); - - // 文本行间距 - ArkUI_NumberValue lineSpaceVal = {.f32 = VALUE_10}; - ArkUI_AttributeItem lineSpaceItem = {&lineSpaceVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_LINE_SPACING, &lineSpaceItem); - // 设置文本装饰 - ArkUI_NumberValue textDecoration[] = { - {.i32 = ARKUI_TEXT_DECORATION_TYPE_UNDERLINE}, {.u32 = 0xFFFF0000}, {.i32 = ARKUI_TEXT_DECORATION_STYLE_SOLID}}; - ArkUI_AttributeItem textDecorationItem = {.value = textDecoration, .size = VALUE_3}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_DECORATION, &textDecorationItem); - - // 设置text样式 - ArkUI_NumberValue textFont[] = { - {.f32 = VALUE_5}, {.i32 = ARKUI_FONT_WEIGHT_W600}, {.i32 = ARKUI_FONT_STYLE_NORMAL}}; - ArkUI_AttributeItem textFontItem = {textFont, VALUE_3}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_WORD_BREAK, &textFontItem); - // 文本大小写属性 - ArkUI_NumberValue textCase = {.i32 = ARKUI_TEXT_CASE_UPPER}; - ArkUI_AttributeItem textCaseItem = {&textCase, VALUE_1}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_CASE, &textCaseItem); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "Manager", "NODE_TEXT_LINE_COUNT :%{public}d", - Manager::nodeAPI_->getAttribute(text3, NODE_TEXT_LINE_COUNT)->value[VALUE_0].i32); - // 设置文本识别 - ArkUI_NumberValue enableDataDetector = {.i32 = true}; - ArkUI_AttributeItem enableDataDetectorItem = {.value = &enableDataDetector, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_ENABLE_DATA_DETECTOR, &enableDataDetectorItem); - ArkUI_NumberValue detectorConfig = {.i32 = ARKUI_TEXT_DATA_DETECTOR_TYPE_PHONE_NUMBER}; - ArkUI_AttributeItem detectorConfigItem = {.value = &detectorConfig, .size = VALUE_2}; - Manager::nodeAPI_->setAttribute(text3, NODE_TEXT_ENABLE_DATA_DETECTOR_CONFIG, &detectorConfigItem); - // 文本设置TextDataDetectorConfig且识别成功时,触发onDetectResultUpdate回调 - Manager::nodeAPI_->registerNodeEvent(text3, NODE_TEXT_ON_DETECT_RESULT_UPDATE, EVENT_TEXT_DETECT_RESULT_UPDATE, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); -} - -void setText4(ArkUI_NodeHandle &text4) -{ - const char *textContent = "这里是第四个文本"; - ArkUI_AttributeItem contentItem = {.string = textContent}; - Manager::nodeAPI_->setAttribute(text4, NODE_TEXT_CONTENT, &contentItem); - - // 设置文本行高 - ArkUI_NumberValue lineHeight = {.f32 = VALUE_50}; - ArkUI_AttributeItem lineHeightItem = {&lineHeight, VALUE_1}; - Manager::nodeAPI_->setAttribute(text4, NODE_TEXT_LINE_HEIGHT, &lineHeightItem); - - // 文本基线的偏移量属性 - ArkUI_NumberValue baselineOffset = {.f32 = VALUE_50}; - ArkUI_AttributeItem baselineOffsetItem = {&baselineOffset, VALUE_1}; - Manager::nodeAPI_->setAttribute(text4, NODE_TEXT_BASELINE_OFFSET, &baselineOffsetItem); - - // 文字阴影效果属性 - ArkUI_NumberValue textShadow[] = { - {.f32 = VALUE_5}, {.i32 = ARKUI_SHADOW_TYPE_BLUR}, {.u32 = 0xFFFF0000}, {.f32 = VALUE_5}, {.f32 = VALUE_5}}; - ArkUI_AttributeItem textShadowItem = {textShadow, VALUE_5}; - Manager::nodeAPI_->setAttribute(text4, NODE_TEXT_TEXT_SHADOW, &textShadowItem); - - // Text最大显示字号 - ArkUI_NumberValue maxFontSize = {.f32 = VALUE_10}; - ArkUI_AttributeItem maxFontSizeItem = {&maxFontSize, VALUE_1}; - Manager::nodeAPI_->setAttribute(text4, NODE_TEXT_MAX_FONT_SIZE, &maxFontSizeItem); - - // 设置NODE_FONT_FEATURE - ArkUI_AttributeItem fontFeatureItem = {.string = "ss01"}; - Manager::nodeAPI_->setAttribute(text4, NODE_FONT_FEATURE, &fontFeatureItem); - - // Text最大显示字号ARKUI_FONT_WEIGHT_W500 - ArkUI_NumberValue fontWeight = {.i32 = ARKUI_FONT_WEIGHT_W500}; - ArkUI_AttributeItem fontWeightItem = {&fontWeight, VALUE_1}; - Manager::nodeAPI_->setAttribute(text4, NODE_IMMUTABLE_FONT_WEIGHT, &fontWeightItem); - ArkUI_AttributeItem fontfamily = {.string = "字体"}; - Manager::nodeAPI_->setAttribute(text4, NODE_FONT_FAMILY, &fontfamily); -} - -void setText5(ArkUI_NodeHandle &text5) -{ - const char *textContent = "this is text 5"; - ArkUI_AttributeItem contentItem = {.string = textContent}; - Manager::nodeAPI_->setAttribute(text5, NODE_TEXT_CONTENT, &contentItem); - // 渐变 - ArkUI_NumberValue linearGradient[] = {{.f32 = ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM}, - {.i32 = ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM}, - {.i32 = VALUE_0}}; - ArkUI_AttributeItem linearGradientItem = {linearGradient, VALUE_3}; - Manager::nodeAPI_->setAttribute(text5, NODE_TEXT_LINEAR_GRADIENT, &linearGradientItem); - ArkUI_NumberValue radialGradient[] = {{.f32 = ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM}, - {.i32 = ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM}, - {.i32 = VALUE_0}}; - ArkUI_AttributeItem radialGradientItem = {radialGradient, VALUE_3}; - Manager::nodeAPI_->setAttribute(text5, NODE_TEXT_RADIAL_GRADIENT, &radialGradientItem); -} - -void setTextArea3(ArkUI_NodeHandle &textArea3) -{ - // 多行文本输入框的默认提示文本内容属性 - const char *textAreaText = "触发回调测试"; - ArkUI_AttributeItem textAreaTextItem = {.string = textAreaText}; - Manager::nodeAPI_->setAttribute(textArea3, NODE_TEXT_AREA_PLACEHOLDER, &textAreaTextItem); - // 长按输入框内部区域弹出剪贴板后,点击剪切板粘贴按钮,触发该回调 - Manager::nodeAPI_->registerNodeEvent(textArea3, NODE_TEXT_AREA_ON_PASTE, EVENT_TEXT_AREA_PASTE, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 文本选择的位置发生变化时,触发该回调 - Manager::nodeAPI_->registerNodeEvent(textArea3, NODE_TEXT_AREA_ON_TEXT_SELECTION_CHANGE, - EVENT_TEXT_AREA_SELECTION_CHANGE, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 文本内容滚动时,触发该回调。触发该事件的条件:文本内容滚动时 - Manager::nodeAPI_->registerNodeEvent(textArea3, NODE_TEXT_AREA_ON_CONTENT_SCROLL, EVENT_TEXT_AREA_CONTENT_SCROLL, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 输入状态变化时,触发该回调 - Manager::nodeAPI_->registerNodeEvent(textArea3, NODE_TEXT_AREA_ON_EDIT_CHANGE, EVENT_TEXT_AREA_EDIT_CHANGE, - nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // TextArea按下输入法回车键触发该事件 - Manager::nodeAPI_->registerNodeEvent(textArea3, NODE_TEXT_AREA_ON_SUBMIT, EVENT_TEXT_AREA_SUBMIT, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // TextArea输入内容发生变化时触发该事件 - Manager::nodeAPI_->registerNodeEvent(textArea3, NODE_TEXT_AREA_ON_CONTENT_SIZE_CHANGE, - EVENT_TEXT_AREA_CONTENT_SIZE_CHANGE, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 定义在输入完成时,触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textArea3, NODE_TEXT_AREA_ON_DID_INSERT, EVENT_TEXT_AREA_DID_INSERT, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 定义在删除完成时,触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textArea3, NODE_TEXT_AREA_ON_DID_DELETE, EVENT_TEXT_AREA_DID_DELETE, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 定义TextArea组件在内容改变时(包含预上屏内容),触发回调的枚举值 - Manager::nodeAPI_->registerNodeEvent(textArea3, NODE_TEXT_AREA_ON_CHANGE_WITH_PREVIEW_TEXT, - EVENT_TEXT_AREA_CHANGE_PREVIEW, nullptr); - Manager::nodeAPI_->registerNodeEventReceiver(&OnEventReceive); - // 设置支持滚动时节点的最大行数 - ArkUI_NumberValue maxLinesWithScroll = {.i32 = VALUE_10}; - ArkUI_AttributeItem maxLinesWithScrollItem = {&maxLinesWithScroll, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea3, NODE_TEXT_AREA_MAX_LINES_WITH_SCROLL, &maxLinesWithScrollItem); -} - -void setAccessibility(ArkUI_NodeHandle &accessibilityText) -{ - ArkUI_AccessibilityValue *accessibilityLabelVal = OH_ArkUI_AccessibilityValue_Create(); - OH_ArkUI_AccessibilityValue_SetText(accessibilityLabelVal, "这里设置了一段无障碍文本"); - const char *a11yItemVal = OH_ArkUI_AccessibilityValue_GetText(accessibilityLabelVal); - ArkUI_AttributeItem a11yItem = {.string = a11yItemVal}; - Manager::nodeAPI_->setAttribute(accessibilityText, NODE_TEXT_CONTENT, &a11yItem); -} - -void setCustom(ArkUI_NodeHandle &customSpan) -{ - Manager::nodeAPI_->registerNodeCustomEvent(customSpan, ARKUI_NODE_CUSTOM_EVENT_ON_MEASURE, VALUE_1, nullptr); - Manager::nodeAPI_->registerNodeCustomEvent(customSpan, ARKUI_NODE_CUSTOM_EVENT_ON_DRAW, VALUE_1, nullptr); - Manager::nodeAPI_->registerNodeCustomEventReceiver([](ArkUI_NodeCustomEvent *event) { - auto eventId = OH_ArkUI_NodeCustomEvent_GetEventTargetId(event); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "EventID:%{public}d", eventId); - if (eventId == VALUE_0) { - ArkUI_CustomSpanMeasureInfo *measureInfo = OH_ArkUI_CustomSpanMeasureInfo_Create(); - OH_ArkUI_NodeCustomEvent_GetCustomSpanMeasureInfo(event, measureInfo); - OH_ArkUI_CustomSpanMeasureInfo_Dispose(measureInfo); - ArkUI_CustomSpanMetrics *customSpanMetrics = OH_ArkUI_CustomSpanMetrics_Create(); - OH_ArkUI_CustomSpanMetrics_SetHeight(customSpanMetrics, 120.0f); - OH_ArkUI_CustomSpanMetrics_SetWidth(customSpanMetrics, 80.0f); - OH_ArkUI_NodeCustomEvent_SetCustomSpanMetrics(event, customSpanMetrics); - OH_ArkUI_CustomSpanMetrics_Dispose(customSpanMetrics); - } - if (eventId == VALUE_1) { - auto *layoutConstraint = OH_ArkUI_NodeCustomEvent_GetLayoutConstraintInMeasure(event); - auto *drawContext = OH_ArkUI_NodeCustomEvent_GetDrawContextInDraw(event); - auto *drawingHandle = reinterpret_cast(OH_ArkUI_DrawContext_GetCanvas(drawContext)); - auto size = OH_ArkUI_DrawContext_GetSize(drawContext); - ArkUI_CustomSpanDrawInfo *customSpanDrawInfo = OH_ArkUI_CustomSpanDrawInfo_Create(); - OH_ArkUI_NodeCustomEvent_GetCustomSpanDrawInfo(event, customSpanDrawInfo); - float optionsX = OH_ArkUI_CustomSpanDrawInfo_GetXOffset(customSpanDrawInfo); - float optionsLineTop = OH_ArkUI_CustomSpanDrawInfo_GetLineTop(customSpanDrawInfo); - float optionsLineBottom = OH_ArkUI_CustomSpanDrawInfo_GetLineBottom(customSpanDrawInfo); - float optionsBaseLine = OH_ArkUI_CustomSpanDrawInfo_GetBaseline(customSpanDrawInfo); - OH_ArkUI_CustomSpanDrawInfo_Dispose(customSpanDrawInfo); - } - }); -} - -void setText6(ArkUI_NodeHandle &text6) -{ - // ImageSpan - ArkUI_NodeHandle imageSpan = Manager::nodeAPI_->createNode(ARKUI_NODE_IMAGE_SPAN); - ArkUI_AttributeItem spanUrl = {.string = "/resources/base/media/background.png"}; - ArkUI_NumberValue widthVal[VALUE_1]{}; - widthVal[VALUE_0].f32 = 100.f; - ArkUI_AttributeItem width = {.value = widthVal, .size = VALUE_1}; - ArkUI_NumberValue heightVal[VALUE_1]{}; - heightVal[VALUE_0].f32 = 100.f; - ArkUI_AttributeItem height = {.value = heightVal, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(imageSpan, NODE_WIDTH, &width); - Manager::nodeAPI_->setAttribute(imageSpan, NODE_HEIGHT, &height); - Manager::nodeAPI_->setAttribute(imageSpan, NODE_IMAGE_SPAN_SRC, &spanUrl); - // 设置 NODE_IMAGE_SPAN_VERTICAL_ALIGNMENT - ArkUI_NumberValue verticalAlignment = {.i32 = ARKUI_IMAGE_SPAN_ALIGNMENT_BOTTOM}; - ArkUI_AttributeItem verticalAlignmentItem = {&verticalAlignment, VALUE_1}; - Manager::nodeAPI_->setAttribute(imageSpan, NODE_IMAGE_SPAN_VERTICAL_ALIGNMENT, &verticalAlignmentItem); - // imageSpan组件占位图地址属性 - ArkUI_AttributeItem spanAlt = {.string = "/resources/base/media/startIcon.png"}; - Manager::nodeAPI_->setAttribute(imageSpan, NODE_IMAGE_SPAN_ALT, &spanAlt); - // 设置imageSpan组件的基线偏移量属性 - ArkUI_NumberValue baselineOffset = {.f32 = VALUE_10}; - ArkUI_AttributeItem baselineOffsetItem = {&baselineOffset, VALUE_1}; - Manager::nodeAPI_->setAttribute(imageSpan, NODE_IMAGE_SPAN_BASELINE_OFFSET, &baselineOffsetItem); - Manager::nodeAPI_->addChild(text6, imageSpan); -} - -void setText7(ArkUI_NodeHandle &text7) -{ - ArkUI_NodeHandle text = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = VALUE_300}}; - ArkUI_AttributeItem textWidthItem = {.value = textWidth, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = VALUE_30}}; - ArkUI_AttributeItem textHeightItem = {.value = textHeight, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(text, NODE_HEIGHT, &textHeightItem); - ArkUI_NumberValue borderWidth[] = {{.f32 = VALUE_1}}; - ArkUI_AttributeItem borderWidthItem = {.value = borderWidth, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(text, NODE_BORDER_WIDTH, &borderWidthItem); - // OH_Drawing_开头的API是字体引擎提供的,typographyStyle表示段落样式。 - OH_Drawing_TypographyStyle *typographyStyle = OH_Drawing_CreateTypographyStyle(); - OH_Drawing_SetTypographyTextAlign(typographyStyle, OH_Drawing_TextAlign::TEXT_ALIGN_CENTER); - OH_Drawing_SetTypographyTextMaxLines(typographyStyle, VALUE_10); - // 创建 ArkUI_StyledString。 - ArkUI_StyledString *styledString = OH_ArkUI_StyledString_Create(typographyStyle, OH_Drawing_CreateFontCollection()); - // 创建文本样式,设置字体和颜色。 - OH_Drawing_TextStyle *textStyle = OH_Drawing_CreateTextStyle(); - OH_Drawing_SetTextStyleFontSize(textStyle, VALUE_28); - OH_Drawing_SetTextStyleColor(textStyle, OH_Drawing_ColorSetArgb(0xFF, 0x70, 0x70, 0x70)); - // 文本样式的设置顺序push -> add -> pop. - OH_ArkUI_StyledString_PushTextStyle(styledString, textStyle); - OH_ArkUI_StyledString_AddText(styledString, "Hello"); - OH_ArkUI_StyledString_PopTextStyle(styledString); - // 添加占位,此区域内不会绘制文字,可以在此位置挂载Image组件实现图文混排。 - OH_Drawing_PlaceholderSpan placeHolder{.width = VALUE_20, .height = VALUE_20}; - OH_ArkUI_StyledString_AddPlaceholder(styledString, &placeHolder); - // 设置不同样式的文字 - OH_Drawing_TextStyle *worldTextStyle = OH_Drawing_CreateTextStyle(); - OH_Drawing_SetTextStyleFontSize(worldTextStyle, VALUE_28); - OH_Drawing_SetTextStyleColor(worldTextStyle, OH_Drawing_ColorSetArgb(0xFF, 0x27, 0x87, 0xD9)); - OH_ArkUI_StyledString_PushTextStyle(styledString, worldTextStyle); - OH_ArkUI_StyledString_AddText(styledString, "World!"); - OH_ArkUI_StyledString_PopTextStyle(styledString); - // 依赖StyledString对象创建字体引擎的Typography,此时它已经包含了设置的文本及其样式。 - OH_Drawing_Typography *typography = OH_ArkUI_StyledString_CreateTypography(styledString); - // 字体引擎布局方法,需传入一个宽度,此宽度需与Text组件宽度匹配。 - // 布局宽度 = Text组件宽度 - (左padding + 右padding) - OH_Drawing_TypographyLayout(typography, VALUE_300); - ArkUI_AttributeItem styledStringItem = {.object = styledString}; - // 布局完成后,通过NODE_TEXT_CONTENT_WITH_STYLED_STRING设置给Text组件。 - Manager::nodeAPI_->setAttribute(text, NODE_TEXT_CONTENT_WITH_STYLED_STRING, &styledStringItem); - OH_ArkUI_StyledString_Destroy(styledString); - Manager::nodeAPI_->addChild(text7, text); -} - -static void MyTaskCallback(void *userData) -{ - if (!userData) { - return; - } - // 将在这里完成自定义数据的处理。。。 - //进入text页面会打印信息 - ArkUI_NodeHandle textNode = static_cast(userData); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "修改数据成功"); -} - -void RunTaskInUIContext(ArkUI_NodeHandle targetNode) -{ - if (!targetNode || !Manager::nodeAPI_) { - return; - } - ArkUI_ContextHandle uiCtx = OH_ArkUI_GetContextByNode(targetNode); - int32_t ret = OH_ArkUI_RunTaskInScope(uiCtx, targetNode, MyTaskCallback); -} - -static uint32_t MyInvertColor(uint32_t color) -{ - // color是0xARGB格式,比如0xFFFF0000(红)→ 反色0xFF00FFFF(青) - uint32_t alpha = (color & 0xFF000000); // 保留透明度 - uint32_t rgb = color & 0x00FFFFFF; // 提取RGB部分 - return alpha | (~rgb & 0x00FFFFFF); // RGB反色,保留透明度 -} - -void SetComponentForceDark(ArkUI_NodeHandle &text5) -{ - //进入text页面会打印信息 - ArkUI_ContextHandle uiCtx = OH_ArkUI_GetContextByNode(text5); - // 直接调用接口:上下文+开启反色+所有组件生效+自定义算法 - int32_t ret = OH_ArkUI_SetForceDarkConfig(uiCtx, // UI上下文 - true, // 开启反色 - ARKUI_NODE_UNDEFINED, // 所有组件生效 - MyInvertColor); - if (ret == ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "反色设置成功"); - } else { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "反色设置失败"); - } -} - -void measuredInfo(ArkUI_NodeHandle &component) -{ - // 设置组件宽高 - //进入text页面会打印信息 - int32_t setMeasured = Manager::nodeAPI_->setMeasuredSize(component, VALUE_100, VALUE_100); - if (setMeasured == ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "manager", "设置尺寸成功"); - } - // 创建约束尺寸 - ArkUI_LayoutConstraint *Constraint = OH_ArkUI_LayoutConstraint_Create(); - // 设置最大高度 - OH_ArkUI_LayoutConstraint_SetMaxHeight(Constraint, VALUE_100); - // 获取组件宽高 - ArkUI_IntSize getMeasured = Manager::nodeAPI_->getMeasuredSize(component); -} - -void setUIVal(ArkUI_NodeHandle &textContainer) -{ - ArkUI_NodeHandle text1 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle text2 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle text3 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle text4 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle text5 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle textInput1 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT_INPUT); - ArkUI_NodeHandle textInput2 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT_INPUT); - ArkUI_NodeHandle textInput3 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT_INPUT); - ArkUI_NodeHandle textArea1 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT_AREA); - ArkUI_NodeHandle textArea2 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT_AREA); - ArkUI_NodeHandle textArea3 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT_AREA); - ArkUI_NodeHandle accessibilityLabel = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle customSpan = Manager::nodeAPI_->createNode(ARKUI_NODE_CUSTOM_SPAN); - ArkUI_NodeHandle text6 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle text7 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - measuredInfo(text4); - setText1(text1); - setText2(text2); - setText3(text3); - setText4(text4); - setText5(text5); - setText6(text6); - setTextInput1(textInput1); - setTextInput2(textInput2); - setTextInput3(textInput3); - setTextArea1(textArea1); - setTextArea2(textArea2); - setTextArea3(textArea3); - setAccessibility(accessibilityLabel); - setText7(text7); - RunTaskInUIContext(text5); - SetComponentForceDark(text5); - Manager::nodeAPI_->addChild(textContainer, text1); - Manager::nodeAPI_->addChild(textContainer, text2); - Manager::nodeAPI_->addChild(textContainer, text3); - Manager::nodeAPI_->addChild(textContainer, text4); - Manager::nodeAPI_->addChild(textContainer, text5); - Manager::nodeAPI_->addChild(textContainer, textInput1); - Manager::nodeAPI_->addChild(textContainer, textInput2); - Manager::nodeAPI_->addChild(textContainer, textInput3); - Manager::nodeAPI_->addChild(textContainer, textArea1); - Manager::nodeAPI_->addChild(textContainer, textArea2); - Manager::nodeAPI_->addChild(textContainer, textArea3); - Manager::nodeAPI_->addChild(textContainer, accessibilityLabel); - Manager::nodeAPI_->addChild(textContainer, customSpan); - Manager::nodeAPI_->addChild(textContainer, text6); - Manager::nodeAPI_->addChild(textContainer, text7); -} - -ArkUI_NodeHandle TextMaker::createTextPage() -{ - ArkUI_NodeHandle scroll = Manager::nodeAPI_->createNode(ARKUI_NODE_SCROLL); - ArkUI_NodeHandle textContainer = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = VALUE_400}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(textContainer, NODE_WIDTH, &widthItem); - setUIVal(textContainer); - Manager::nodeAPI_->addChild(scroll, textContainer); - return scroll; -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/TextMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/TextMaker.h deleted file mode 100644 index c380cd668bbae146948c7eb8c251cc0e55d1594d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/TextMaker.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef TEXT_MAKER_H -#define TEXT_MAKER_H - -#include "manager.h" - -class TextMaker { -public: - TextMaker(){}; - ~TextMaker(){}; - static ArkUI_NodeHandle createTextPage(); -}; - -#endif // NATIVE_TYPE_SAMPLE_SWIPERMAKER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/WaterFlowMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/WaterFlowMaker.cpp deleted file mode 100644 index cbf38fa5af2275a5948b8d868c5f36858d33708a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/WaterFlowMaker.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include - -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ArkUINodeAdapter.h" -#include "WaterFlowMaker.h" -#include "WaterFlowSection.h" - -namespace { -constexpr char K_ITEM_TITLE_PREFIX[] = "FlowItem "; -constexpr float K_FONT_SIZE = 16.0f; - -constexpr float K_MAIN_A = 120.0f; -constexpr float K_MAIN_B = 160.0f; -constexpr float K_MAIN_C = 100.0f; - -constexpr float K_WATER_FLOW_W = 400.0f; -constexpr float K_WATER_FLOW_H = 600.0f; - -constexpr int K_INIT_RESERVE = 200; -constexpr int K_INIT_SEED = 100; - -constexpr int32_t K_CROSS_COUNT = 2; -constexpr float K_COLUMN_GAP = 10.0f; -constexpr float K_ROW_GAP = 10.0f; -constexpr int32_t K_MARGIN_TOP = 12, K_MARGIN_RIGHT = 12, K_MARGIN_BOTTOM = 12, K_MARGIN_LEFT = 12; - -constexpr float K_WIDTH_PERCENT_FULL = 1.0f; -constexpr bool K_SYNC_LOAD = true; -constexpr int32_t K_CACHED_ITEM_COUNT = 24; -constexpr float K_ITEM_MAIN_MIN = 80.0f; -constexpr float K_ITEM_MAIN_MAX = 220.0f; - -constexpr int32_t K_LAYOUT_DIRECTION_RTL = 1; -constexpr int32_t K_LAYOUT_MODE_WATER_FLOW = 1; - -constexpr char K_COLUMN_TEMPLATE[] = "1fr 1fr"; -constexpr char K_ROW_TEMPLATE[] = "auto"; - -constexpr int32_t K_SCROLL_TO_INDEX = 5; -constexpr int32_t K_SCROLL_ALIGN_CENTER = static_cast(ARKUI_SCROLL_ALIGNMENT_CENTER); - -constexpr int K_AUTO_THRESHOLD = 20; -constexpr int K_AUTO_BATCH = 100; -constexpr int K_AUTO_MAX_ITEMS = 100000; - -constexpr float K_MAIN_SEQ[] = {K_MAIN_A, K_MAIN_B, K_MAIN_C}; -constexpr size_t K_MAIN_SEQ_COUNT = sizeof(K_MAIN_SEQ) / sizeof(K_MAIN_SEQ[0]); -constexpr uint32_t K_PALETTE[] = {0xFF6A5ACD, 0xFF00FFFF, 0xFF00FF7F, 0xFFDA70D6, 0xFFFFC0CB}; -constexpr size_t K_PALETTE_COUNT = sizeof(K_PALETTE) / sizeof(K_PALETTE[0]); -} // namespace - -static std::shared_ptr gNode; -static std::shared_ptr gAdapter; -static std::shared_ptr gSection; -static std::vector gItems; - -struct AutoAppendConfig { - bool enabled = true; - int threshold = K_AUTO_THRESHOLD; - int batch = K_AUTO_BATCH; - int maxItems = K_AUTO_MAX_ITEMS; - bool appending = false; - int lastSizeTriggered = -1; -}; -static AutoAppendConfig g_auto; - -/** - * 根据索引获取主轴尺寸 - * @param idx 索引值 - * @return 主轴尺寸 - */ -static inline float MainSizeByIndex(int32_t idx) -{ - if (K_MAIN_SEQ_COUNT == 0U) { - return K_MAIN_C; - } - - const size_t i = static_cast(idx) % K_MAIN_SEQ_COUNT; - return K_MAIN_SEQ[i]; -} - -/** - * 根据索引获取颜色 - * @param index 索引值 - * @return 颜色值 - */ -static inline uint32_t ColorByIndex(int index) -{ - if (K_PALETTE_COUNT == 0U) { - return 0xFFFFFFFFU; - } - - const size_t i = static_cast(index) % K_PALETTE_COUNT; - return K_PALETTE[i]; -} - -static inline void BindText(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle flowItem, int32_t index) -{ - ArkUI_NodeHandle text = api->getFirstChild(flowItem); - if (!text) { - return; - } - - SetTextContent(api, text, gItems[static_cast(index)].c_str()); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_FONT_SIZE); -} - -/** - * 方法描述 - * @param total 参数描述 - * @return 返回值描述 - */ -static inline bool ReachedBoundary(int total) -{ - return (total >= g_auto.maxItems) || (total == g_auto.lastSizeTriggered); -} - -static inline bool ShouldAppend(int32_t index, int total) -{ - return g_auto.enabled && !g_auto.appending && !ReachedBoundary(total) && index >= (total - g_auto.threshold); -} - -static void AppendBatchInternal(int addCount) -{ - if (!gAdapter || !gSection || !gNode || addCount <= 0) { - return; - } - - const int32_t start = static_cast(gItems.size()); - gItems.reserve(gItems.size() + static_cast(addCount)); - - for (int i = 0; i < addCount; ++i) { - gItems.emplace_back(std::string(K_ITEM_TITLE_PREFIX) + std::to_string(start + i)); - } - - gAdapter->InsertRange(start, addCount); - - const int32_t newCount = static_cast(gItems.size()); - OH_ArkUI_WaterFlowSectionOption_SetItemCount(gSection->GetSectionOptions(), 0, newCount); - - gNode->SetSection(gSection); - g_auto.lastSizeTriggered = static_cast(gItems.size()); -} - -static void MaybeAppendOnTail(int32_t index) -{ - const int total = static_cast(gItems.size()); - if (!ShouldAppend(index, total)) { - return; - } - - g_auto.appending = true; - const int remain = g_auto.maxItems - total; - const int toAdd = remain > 0 ? std::min(g_auto.batch, remain) : 0; - AppendBatchInternal(toAdd); - g_auto.appending = false; -} - -static int32_t AdapterGetTotalCount() { return static_cast(gItems.size()); } - -static uint64_t AdapterGetStableId(int32_t i) -{ - const std::string &key = gItems[static_cast(i)]; - return static_cast(std::hash{}(key)); -} - -static ArkUI_NodeHandle AdapterOnCreate(ArkUI_NativeNodeAPI_1 *api, int32_t /*index*/) -{ - if (!api) { - return nullptr; - } - - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle item = api->createNode(ARKUI_NODE_FLOW_ITEM); - api->addChild(item, text); - return item; -} - -static void AdapterOnBind(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index) -{ - SetAttributeFloat32(api, item, NODE_HEIGHT, MainSizeByIndex(index)); - SetAttributeFloat32(api, item, NODE_WIDTH_PERCENT, K_WIDTH_PERCENT_FULL); - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, ColorByIndex(index)); - BindText(api, item, index); - MaybeAppendOnTail(index); -} - -static ArkUINodeAdapter::Callbacks MakeCallbacks() -{ - ArkUINodeAdapter::Callbacks cb{}; - cb.getTotalCount = &AdapterGetTotalCount; - cb.getStableId = &AdapterGetStableId; - cb.onCreate = &AdapterOnCreate; - cb.onBind = &AdapterOnBind; - cb.onRecycle = nullptr; - return cb; -} - -static ArkUI_NodeHandle CreateFooter() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (!api) { - return nullptr; - } - - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - SetTextContent(api, text, "到底啦…"); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, 14.0f); - - ArkUI_NodeHandle footer = api->createNode(ARKUI_NODE_FLOW_ITEM); - SetAttributeFloat32(api, footer, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, footer, NODE_HEIGHT, 48.0f); - SetAttributeUInt32(api, footer, NODE_BACKGROUND_COLOR, 0x11000000U); - api->addChild(footer, text); - return footer; -} - -static void SetupSection() -{ - ArkUI_Margin margin{K_MARGIN_TOP, K_MARGIN_RIGHT, K_MARGIN_BOTTOM, K_MARGIN_LEFT}; - - SingleSectionParams params{}; - params.itemCount = static_cast(gItems.size()); - params.crossCount = K_CROSS_COUNT; - params.colGap = K_COLUMN_GAP; - params.rowGap = K_ROW_GAP; - params.margin = margin; - params.getMainSizeByIndex = &MainSizeByIndex; - params.userData = nullptr; - params.getMainSizeByIndexWithUserData = nullptr; - - gNode->SetSingleSection(params); - gSection = gNode->GetWaterFlowSection(); -} - -static void SetupNodeAndAdapter() -{ - gNode = std::make_shared(); - gNode->SetHeight(K_WATER_FLOW_H); - gNode->SetWidth(K_WATER_FLOW_W); - gNode->SetScrollCommon(); - gNode->SetLayoutDirection(K_LAYOUT_DIRECTION_RTL); - gNode->SetColumnTemplate(K_COLUMN_TEMPLATE); - gNode->SetRowTemplate(K_ROW_TEMPLATE); - gNode->SetGaps(K_COLUMN_GAP, K_ROW_GAP); - gNode->SetCachedCount(K_CACHED_ITEM_COUNT); - gNode->SetItemConstraintSize(K_ITEM_MAIN_MIN, K_ITEM_MAIN_MAX); - gNode->SetLayoutMode(ARKUI_WATER_FLOW_LAYOUT_MODE_SLIDING_WINDOW); - gNode->SetSyncLoad(K_SYNC_LOAD); - - SetupSection(); - - if (ArkUI_NodeHandle footer = CreateFooter()) { - gNode->SetFooter(footer); - } - - gAdapter = std::make_shared(); - gAdapter->SetCallbacks(MakeCallbacks()); - gNode->SetLazyAdapter(gAdapter); - gAdapter->ReloadAllItems(); -} - -static void InitData() -{ - gItems.clear(); - gItems.reserve(static_cast(K_INIT_RESERVE)); - for (int i = 0; i < K_INIT_SEED; ++i) { - gItems.emplace_back(std::string(K_ITEM_TITLE_PREFIX) + std::to_string(i)); - } -} - -static ArkUI_NodeHandle BuildWaterFlow() -{ - InitData(); - SetupNodeAndAdapter(); - return gNode->GetWaterFlow(); -} - -ArkUI_NodeHandle WaterFlowMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (!api) { - return nullptr; - } - - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (!page) { - return nullptr; - } - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - ArkUI_NodeHandle waterflow = BuildWaterFlow(); - if (waterflow) { - SetAttributeFloat32(api, waterflow, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, waterflow, NODE_LAYOUT_WEIGHT, 1.0f); - - api->addChild(page, waterflow); - } - return page; -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/WaterFlowMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/WaterFlowMaker.h deleted file mode 100644 index c6cb2c7562c02c313567516062fe9978c45282a0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/WaterFlowMaker.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef WATERFLOW_MAKER_H -#define WATERFLOW_MAKER_H - -#include -#include -#include -#include -#include - -#include "ArkUINodeAdapter.h" -#include "WaterFlowSection.h" -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollableEvent.h" - -#ifndef LOG_TAG -#define LOG_TAG "WaterFlowMaker" -#endif - -// ===== 业务常量 ===== -constexpr unsigned int K_LOG_DOMAIN = 0xFF00; -constexpr float K_DEFAULT_SCROLL_BAR_WIDTH = 4.0f; -constexpr uint32_t K_DEFAULT_SCROLL_BAR_COLOR = 0x66000000U; -constexpr float K_DEFAULT_SCROLL_FRICTION = 0.12f; -constexpr float K_DEFAULT_FLING_SPEED_LIMIT = 2800.0f; -// 渐隐边缘尺寸 -constexpr int32_t K_DEFAULT_FADING_EDGE = 12; -// 单分组索引 -constexpr int32_t K_SINGLE_SECTION_INDEX = 0; - -// ---- 新增:单分组配置结构体 ---- -struct SingleSectionParams { - int32_t itemCount = 0; - int32_t crossCount = 1; - float colGap = 0.0f; - float rowGap = 0.0f; - ArkUI_Margin margin{}; // {top,right,bottom,left} - - // 必填:按 index 计算主轴尺寸的回调 - float (*getMainSizeByIndex)(int32_t) = nullptr; - - // 可选:带 userData 的回调 - void *userData = nullptr; - float (*getMainSizeByIndexWithUserData)(int32_t, void *) = nullptr; -}; - -class WaterFlowMaker { -public: - static ArkUI_NodeHandle CreateNativeNode(); - - WaterFlowMaker() - { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api_); - waterFlow_ = api_->createNode(ARKUI_NODE_WATER_FLOW); - api_->addNodeEventReceiver(waterFlow_, StaticEvent); - - scrollGuard_.Bind(api_, waterFlow_, this, SCROLL_EVT_ALL); - - OH_LOG_Print(LOG_APP, LOG_INFO, K_LOG_DOMAIN, LOG_TAG, "WaterFlowNode created"); - } - - ~WaterFlowMaker() - { - scrollGuard_.Release(); - - adapter_.reset(); - section_.reset(); - waterFlow_ = nullptr; - } - - // ---- Size ---- - void SetWidth(float width) { SetAttributeFloat32(api_, waterFlow_, NODE_WIDTH, width); } - - void SetHeight(float height) { SetAttributeFloat32(api_, waterFlow_, NODE_HEIGHT, height); } - - // ---- Adapter ---- - void SetLazyAdapter(const std::shared_ptr &adapter) - { - if (adapter == nullptr) { - return; - } - ArkUI_AttributeItem item{nullptr, 0, nullptr, adapter->GetAdapter()}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_NODE_ADAPTER, &item); - adapter_ = adapter; - } - - // ---- Section ---- - void SetSection(const std::shared_ptr §ion) - { - if (section == nullptr) { - return; - } - auto *opts = section->GetSectionOptions(); - if (opts == nullptr) { - return; - } - ArkUI_NumberValue start[] = {{.i32 = K_SINGLE_SECTION_INDEX}}; - ArkUI_AttributeItem item{start, 1, nullptr, opts}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_SECTION_OPTION, &item); - section_ = section; - } - - // ---- Layout / template / gap ---- - void SetLayoutDirection(int32_t direction) - { - ArkUI_NumberValue v[] = {{.i32 = direction}}; - ArkUI_AttributeItem item{v, 1}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_LAYOUT_DIRECTION, &item); - } - - void SetColumnTemplate(const char *tpl) - { - ArkUI_AttributeItem item{nullptr, 0, tpl, nullptr}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_COLUMN_TEMPLATE, &item); - } - - void SetRowTemplate(const char *tpl) - { - ArkUI_AttributeItem item{nullptr, 0, tpl, nullptr}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_ROW_TEMPLATE, &item); - } - - void SetGaps(float colGap, float rowGap) - { - SetAttributeFloat32(api_, waterFlow_, NODE_WATER_FLOW_COLUMN_GAP, colGap); - SetAttributeFloat32(api_, waterFlow_, NODE_WATER_FLOW_ROW_GAP, rowGap); - } - - // ---- Cache / scroll / mode ---- - void SetCachedCount(int32_t count) - { - SetAttributeInt32(api_, waterFlow_, NODE_WATER_FLOW_CACHED_COUNT, count); - } - - void SetFooter(ArkUI_NodeHandle footer) - { - ArkUI_AttributeItem item{nullptr, 0, nullptr, footer}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_FOOTER, &item); - } - - void ScrollToIndex(int32_t index, int32_t align) - { - ArkUI_NumberValue v[] = {{.i32 = index}, {.i32 = align}}; - ArkUI_AttributeItem item{v, 2}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_SCROLL_TO_INDEX, &item); - } - - void SetItemConstraintSize(float mainMin, float mainMax) - { - ArkUI_NumberValue v[] = {{.f32 = mainMin}, {.f32 = mainMax}}; - ArkUI_AttributeItem item{v, 2}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_ITEM_CONSTRAINT_SIZE, &item); - } - - void SetLayoutMode(ArkUI_WaterFlowLayoutMode mode) - { - SetAttributeInt32(api_, waterFlow_, NODE_WATER_FLOW_LAYOUT_MODE, static_cast(mode)); - } - - void SetSyncLoad(bool enabled) - { - SetAttributeInt32(api_, waterFlow_, NODE_WATER_FLOW_SYNC_LOAD, enabled ? 1 : 0); - } - - void SetScrollFriction(float f) { SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_FRICTION, f); } - - void SetFlingSpeedLimit(float limit) - { - SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_FLING_SPEED_LIMIT, limit); - } - - // ---- 通用滚动外观/行为预设 ---- - void SetScrollCommon() - { - // 滚动条外观 - SetAttributeInt32(api_, waterFlow_, NODE_SCROLL_BAR_DISPLAY_MODE, - static_cast(ARKUI_SCROLL_BAR_DISPLAY_MODE_AUTO)); - SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_BAR_WIDTH, K_DEFAULT_SCROLL_BAR_WIDTH); - SetAttributeUInt32(api_, waterFlow_, NODE_SCROLL_BAR_COLOR, K_DEFAULT_SCROLL_BAR_COLOR); - - // 交互与摩擦 - SetAttributeInt32(api_, waterFlow_, NODE_SCROLL_ENABLE_SCROLL_INTERACTION, 1); - SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_FRICTION, K_DEFAULT_SCROLL_FRICTION); - SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_FLING_SPEED_LIMIT, K_DEFAULT_FLING_SPEED_LIMIT); - - // 嵌套滚动策略 & 渐隐边缘 - SetAttributeInt32(api_, waterFlow_, NODE_SCROLL_NESTED_SCROLL, - static_cast(ARKUI_SCROLL_NESTED_MODE_SELF_FIRST)); - SetAttributeInt32(api_, waterFlow_, NODE_SCROLL_FADING_EDGE, K_DEFAULT_FADING_EDGE); - } - - ArkUI_NodeHandle GetWaterFlow() const { return waterFlow_; } - - std::shared_ptr GetWaterFlowSection() const { return section_; } - - void SetSingleSection(const SingleSectionParams &p) - { - if (!ValidateSingleSectionParams(p)) { - return; - } - - EnsureSectionSized(1); - - SectionOption opt = BuildSectionOption(p.itemCount, p.crossCount, p.colGap, p.rowGap, p.margin); - opt.onGetItemMainSizeByIndex = p.getMainSizeByIndex; - opt.userData = p.userData; - - ApplySectionOption(opt); - RegisterUserDataCallbackIfNeeded(p.userData, p.getMainSizeByIndexWithUserData); - SetSection(section_); - } - -private: - static void StaticEvent(ArkUI_NodeEvent *ev) { (void)ev; } - - static bool ValidateSingleSectionParams(const SingleSectionParams &p) - { - if (p.getMainSizeByIndex == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "getMainSizeByIndex is null"); - return false; - } - if (p.itemCount < 0 || p.crossCount <= 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, - "invalid counts: itemCount=%{public}d, crossCount=%{public}d", p.itemCount, p.crossCount); - return false; - } - return true; - } - - void EnsureSectionSized(int32_t sectionCount) - { - if (section_ == nullptr) { - section_ = std::make_shared(); - } - section_->Resize(sectionCount); - } - - SectionOption BuildSectionOption(int32_t itemCount, int32_t crossCount, float colGap, float rowGap, - ArkUI_Margin margin) const - { - SectionOption opt{}; - opt.itemsCount = itemCount; - opt.crossCount = crossCount; - opt.columnsGap = colGap; - opt.rowsGap = rowGap; - opt.margin = margin; - return opt; - } - - void ApplySectionOption(const SectionOption &opt) - { - section_->SetSection(section_->GetSectionOptions(), K_SINGLE_SECTION_INDEX, opt); - } - - void RegisterUserDataCallbackIfNeeded(void *userData, float (*cb)(int32_t, void *)) - { - if (userData != nullptr && cb != nullptr) { - OH_ArkUI_WaterFlowSectionOption_RegisterGetItemMainSizeCallbackByIndexWithUserData( - section_->GetSectionOptions(), K_SINGLE_SECTION_INDEX, userData, cb); - } - } - -private: - ArkUI_NativeNodeAPI_1 *api_ = nullptr; - ArkUI_NodeHandle waterFlow_ = nullptr; - std::shared_ptr section_ = nullptr; - std::shared_ptr adapter_; - - ScrollEventGuard scrollGuard_; -}; - -#endif // WATERFLOW_MAKER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/WaterFlowSection.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/WaterFlowSection.h deleted file mode 100644 index 7352f04e5663ea896c6bffaed0620ceda0d4cc35..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/WaterFlowSection.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef WATERFLOW_SECTION_H -#define WATERFLOW_SECTION_H - -#include - -struct SectionOption { - int32_t itemsCount = 0; - int32_t crossCount = 1; - float columnsGap = 0.0f; - float rowsGap = 0.0f; - ArkUI_Margin margin{0, 0, 0, 0}; // {top, right, bottom, left} - float (*onGetItemMainSizeByIndex)(int32_t) = nullptr; - void *userData = nullptr; -}; - -class WaterFlowSection { -public: - WaterFlowSection() : sectionOptions_(OH_ArkUI_WaterFlowSectionOption_Create()) {} - - ~WaterFlowSection() - { - OH_ArkUI_WaterFlowSectionOption_Dispose(sectionOptions_); - sectionOptions_ = nullptr; - } - - void Resize(int32_t size) { OH_ArkUI_WaterFlowSectionOption_SetSize(sectionOptions_, size); } - - int32_t Size() const { return OH_ArkUI_WaterFlowSectionOption_GetSize(sectionOptions_); } - - void SetSection(ArkUI_WaterFlowSectionOption *opts, int32_t index, const SectionOption &s) - { - if (opts == nullptr) { - return; - } - OH_ArkUI_WaterFlowSectionOption_SetItemCount(opts, index, s.itemsCount); - OH_ArkUI_WaterFlowSectionOption_SetCrossCount(opts, index, s.crossCount); - OH_ArkUI_WaterFlowSectionOption_SetColumnGap(opts, index, s.columnsGap); - OH_ArkUI_WaterFlowSectionOption_SetRowGap(opts, index, s.rowsGap); - OH_ArkUI_WaterFlowSectionOption_SetMargin(opts, index, s.margin.top, s.margin.right, s.margin.bottom, - s.margin.left); - if (s.onGetItemMainSizeByIndex != nullptr) { - OH_ArkUI_WaterFlowSectionOption_RegisterGetItemMainSizeCallbackByIndex(opts, index, - s.onGetItemMainSizeByIndex); - } - } - - SectionOption GetSection(ArkUI_WaterFlowSectionOption *opts, int32_t index) - { - SectionOption s{}; - if (opts == nullptr) { - return s; - } - - s.itemsCount = OH_ArkUI_WaterFlowSectionOption_GetItemCount(opts, index); - s.crossCount = OH_ArkUI_WaterFlowSectionOption_GetCrossCount(opts, index); - s.columnsGap = OH_ArkUI_WaterFlowSectionOption_GetColumnGap(opts, index); - s.rowsGap = OH_ArkUI_WaterFlowSectionOption_GetRowGap(opts, index); - s.margin = OH_ArkUI_WaterFlowSectionOption_GetMargin(opts, index); - - return s; - } - - ArkUI_WaterFlowSectionOption *GetSectionOptions() const { return sectionOptions_; } - -private: - ArkUI_WaterFlowSectionOption *sectionOptions_ = nullptr; -}; - -#endif // WATERFLOW_SECTION_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/XComponentMaker.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/XComponentMaker.cpp deleted file mode 100644 index 07cffe59ad19fcc1898a787bdd529cb37a25c3c8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/XComponentMaker.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "XComponentMaker.h" -#include "manager.h" -#include -#include -#include -#include -#include -#include -#include -#include "napi/native_api.h" -#include -#include -#include -#include - -#define ON_ERROR_CODE_DEMO_103501 103501 -#define ON_ERROR_CODE_DEMO_106104 106104 -#define COLUMN_MARGIN 10 -#define VALUEF f32 -#define VALUEU u32 -#define VALUEI i32 -#define XC_TWO 2 -#define XC_TEN 10 -#define XC_FORTY 40 -static void xOnEventReceive(ArkUI_NodeEvent *event) -{ - if (event == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "错误码: %d", ARKUI_ERROR_CODE_NODE_EVENT_PARAM_INVALID); - return; - } - int32_t eventId = OH_ArkUI_NodeEvent_GetTargetId(event); - ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - auto nodeHandler = OH_ArkUI_NodeEvent_GetNodeHandle(event); - switch (eventId) { - // XComponent状态异常 - case ON_ERROR_CODE_DEMO_103501: { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "错误码: %d", - ARKUI_ERROR_CODE_XCOMPONENT_STATE_INVALID); - return; - } - // 懒加载适配器未绑定到组件上 - case ON_ERROR_CODE_DEMO_106104: { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "错误码: %d", ARKUI_ERROR_CODE_ADAPTER_NOT_BOUND); - return; - } - default: - break; - } -} -ArkUI_NodeHandle XComponentMaker::CreateNodeHandle(const std::string &tag) -{ - ArkUI_NodeHandle xc; - ArkUI_NodeHandle XCHandle; - ArkUI_NodeHandle column = Manager::XnodeAPI->createNode(ARKUI_NODE_COLUMN); - XCHandle = Manager::XnodeAPI->createNode(ARKUI_NODE_XCOMPONENT); - ArkUI_NumberValue value_xc[] = {{.VALUEF = 200}}; - ArkUI_AttributeItem item_xc = {value_xc, 1}; - ArkUI_NumberValue valuexc[] = {480}; - ArkUI_NumberValue value1xc[] = {{.VALUEU = 15}, {.VALUEF = 15}}; - ArkUI_AttributeItem itemxc = {valuexc, 1, "changeSize"}; - ArkUI_AttributeItem item1xc = {value1xc, 2}; - Manager::XnodeAPI->setAttribute(column, NODE_WIDTH, &itemxc); - valuexc[0].VALUEF = COLUMN_MARGIN; - Manager::XnodeAPI->setAttribute(column, NODE_MARGIN, &itemxc); - xc = Manager::XnodeAPI->createNode(ARKUI_NODE_XCOMPONENT_TEXTURE); // 使用示例 - xc = Manager::XnodeAPI->createNode(ARKUI_NODE_XCOMPONENT); - valuexc[0].VALUEU = ARKUI_XCOMPONENT_TYPE_SURFACE; - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_TYPE, &itemxc); - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_ID, &itemxc); - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_SURFACE_SIZE, &item1xc); - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_SURFACE_RECT, &item1xc); - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_ENABLE_ANALYZER, &item1xc); - valuexc[0].VALUEI = ARKUI_XCOMPONENT_TYPE_TEXTURE; // 使用示例 - valuexc[0].VALUEI = ARKUI_XCOMPONENT_TYPE_SURFACE; - int32_t ret = Manager::XnodeAPI->setAttribute(XCHandle, NODE_XCOMPONENT_TYPE, &item_xc); - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "XComponent_Native", "CYC_ set NODE_XCOMPONENT_TYPE ret=%{public}d", ret); - OH_NativeXComponent *nativeXComponent = OH_NativeXComponent_GetNativeXComponent(XCHandle); - ArkUI_NumberValue value[] = {{.VALUEF = 1}}; - ArkUI_AttributeItem item = {value, 1}; - ArkUI_AttributeItem content = {.string = tag.c_str()}; - Manager::XnodeAPI->setAttribute(column, NODE_WIDTH_PERCENT, &item); - value[0].VALUEF = XC_FORTY; - Manager::XnodeAPI->setAttribute(column, NODE_HEIGHT, &item); - value[0].VALUEF = XC_TEN; - Manager::XnodeAPI->setAttribute(column, NODE_MARGIN, &item); - Manager::XnodeAPI->setAttribute(column, NODE_ID, &content); - ArkUI_NodeHandle text = Manager::XnodeAPI->createNode(ARKUI_NODE_TEXT); - content = {.string = "本实例仅展示接口的使用方法,不涉及具体图像的创建"}; - Manager::XnodeAPI->setAttribute(text, NODE_TEXT_CONTENT, &content); - Manager::XnodeAPI->registerNodeEvent(column, NODE_ON_CLICK, 1, nullptr); - Manager::XnodeAPI->addChild(column, text); - Manager::XnodeAPI->addChild(column, XCHandle); - Manager::XnodeAPI->addChild(column, xc); - xOnEventReceive(nullptr); //test - return column; -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/XComponentMaker.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/XComponentMaker.h deleted file mode 100644 index ae5b82132d639820debbc966ef3fe0b008448776..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/XComponentMaker.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_XCOMPONENTMAKER_H -#define NATIVE_TYPE_SAMPLE_XCOMPONENTMAKER_H - -#include "manager.h" - -class XComponentMaker { -public: - XComponentMaker(){}; - ~XComponentMaker(){}; - - static ArkUI_NodeHandle CreateNodeHandle(const std::string &tag); -}; - -#endif diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/baseUtils.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/baseUtils.cpp deleted file mode 100644 index ad12a5b4d5d7886ba8fe5847a0c5d9f464df53dd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/baseUtils.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "baseUtils.h" -#include "TextMaker.h" - -namespace ConstIde { - const uint32_t NUMBER_0 = 0; - const uint32_t NUMBER_1 = 1; - const uint32_t NUMBER_2 = 2; - const uint32_t MARGIN_NUMBER_30 = 30; -} - -void BaseUtils::SetNodeMargin(ArkUI_NodeHandle &node, float margin) -{ - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1}; - value[ConstIde::NUMBER_0].f32 = margin; - Manager::nodeAPI_->setAttribute(node, NODE_MARGIN, &item); -} - -void BaseUtils::SetNodeBackGroundColor(ArkUI_NodeHandle &node, uint32_t color) -{ - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1}; - value[ConstIde::NUMBER_0].u32 = color; - Manager::nodeAPI_->setAttribute(node, NODE_BACKGROUND_COLOR, &item); -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/baseUtils.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/baseUtils.h deleted file mode 100644 index c8be5afa4c7c96d341c4c8bc53294e9b5d1d643a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/baseUtils.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_BASEUTILS_H -#define NATIVE_TYPE_SAMPLE_BASEUTILS_H - -#include "manager.h" -#include - -class BaseUtils { -public: - BaseUtils() {} - ~BaseUtils() {} - static void SetNodeMargin(ArkUI_NodeHandle &node, float margin); - static void SetNodeBackGroundColor(ArkUI_NodeHandle &node, uint32_t color); -}; - -#endif // NATIVE_TYPE_SAMPLE_BASEUTILS_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/form_manager.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/form_manager.cpp deleted file mode 100644 index b29729f98c6ae7a4a4a3cf506c0a1bdbdf8b373f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/form_manager.cpp +++ /dev/null @@ -1,673 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "form_manager.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace NativeNode::Form { - -constexpr uint32_t MATRIX_ARRAY_SIZE = 16; -napi_ref g_callbackRef = nullptr; -napi_env g_env = nullptr; -uint32_t g_colors[] = {0xFFFEBB62, 0xffFFA0A4}; -float g_stops[] = {0, 1.0}; -static ArkUI_ColorStop linerGrand[] = {{g_colors, g_stops, 2}}; - -NodeManager& NodeManager::GetInstance() -{ - static NodeManager instance; - return instance; -} - -ArkUI_NativeNodeAPI_1* NodeManager::GetNodeApi() -{ - static ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - return nodeApi; -} - -struct AttributeScope { - ArkUI_NodeType nodeType; - ArkUI_NodeAttributeType begin; - ArkUI_NodeAttributeType end; -}; - -AttributeScope g_attributeArray[] = { - {ARKUI_NODE_TOGGLE, NODE_TOGGLE_SELECTED_COLOR, NODE_TOGGLE_UNSELECTED_COLOR}, - {ARKUI_NODE_BUTTON, NODE_BUTTON_LABEL, NODE_BUTTON_MAX_FONT_SCALE}, - {ARKUI_NODE_CHECKBOX, NODE_CHECKBOX_SELECT, NODE_CHECKBOX_GROUP}, - {ARKUI_NODE_SLIDER, NODE_SLIDER_BLOCK_COLOR, NODE_SLIDER_SELECTED_LINEAR_GRADIENT_COLOR}, - {ARKUI_NODE_RADIO, NODE_RADIO_CHECKED, NODE_RADIO_GROUP}, - {ARKUI_NODE_CHECKBOX_GROUP, NODE_CHECKBOX_GROUP_NAME, NODE_CHECKBOX_GROUP_SHAPE}, -}; - -static ArkUI_NumberValue togglePickerValue[] = {{.u32 = 0XFFFF0000}}; - -static ArkUI_NumberValue buttonPickerValue[] = {{.f32 = 10.0f}}; -static ArkUI_NumberValue buttonPickerValue1[] = {{.i32 = ARKUI_BUTTON_TYPE_NORMAL}}; -static ArkUI_NumberValue buttonPickerValue2[] = {{.f32 = 1.0f}}; - -static ArkUI_NumberValue checkboxPickerValue[] = {{.i32 = true}}; -static ArkUI_NumberValue checkboxPickerValue1[] = {{.u32 = 0xFFFF0000}}; -static ArkUI_NumberValue checkboxPickerValue2[] = {{.i32 = ArkUI_CHECKBOX_SHAPE_CIRCLE}}; - -static ArkUI_NumberValue sliderPickerValue[] = {{.u32 = 0xFFFF0000}}; -static ArkUI_NumberValue sliderPickerValue1[] = {{.i32 = 1}}; -static ArkUI_NumberValue sliderPickerValue2[] = { - {.i32 = ARKUI_SLIDER_BLOCK_STYLE_IMAGE}, - {.i32 = ARKUI_CLIP_TYPE_PATH}, - {.f32 = 20}, - {.f32 = 20}, - {.f32 = 20} -}; -static ArkUI_NumberValue sliderPickerValue3[] = {{.f32 = 0}}; -static ArkUI_NumberValue sliderPickerValue4[] = {{.f32 = 100}}; -static ArkUI_NumberValue sliderPickerValue5[] = {{.i32 = ARKUI_SLIDER_STYLE_OUT_SET}}; -static ArkUI_NumberValue sliderPickerValue6[] = {{.i32 = true}}; -static ArkUI_NumberValue sliderPickerValue7[] = {{.u32 = 0xFFFFFF00}}; -static ArkUI_NumberValue sliderPickerValue8[] = {{.i32 = ARKUI_SLIDER_DIRECTION_VERTICAL}}; -static ArkUI_NumberValue sliderPickerValue9[] = {{.f32 = 10.0}}; - -static ArkUI_NumberValue radioPickerValue[] = {{.i32 = true}}; -static ArkUI_NumberValue radioPickerValue1[] = {{.u32 = 0xFFFF0000}, {.u32 = 0xFFFF0000}, {.u32 = 0xFFFF0000}}; - -static ArkUI_NumberValue checkbocGroupPickerValue[] = {{.i32 = 2}}; -static ArkUI_NumberValue checkbocGroupPickerValue1[] = {{.i32 = 1}}; -static ArkUI_NumberValue checkbocGroupPickerValue2[] = {{.u32 = 0xFFFF0000}, {.u32 = 0xFFFF0000}, {.u32 = 0xFFFF0000}}; - -static ArkUI_AlignmentRuleOption* CreatrObjects() -{ - ArkUI_NativeNodeAPI_1* nodeAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - auto text = nodeAPI->createNode(ARKUI_NODE_TEXT); - ArkUI_AttributeItem textItemId = { .string = "text" }; - nodeAPI->setAttribute(text, NODE_ID, &textItemId); - auto alignmentRule = OH_ArkUI_AlignmentRuleOption_Create(); - OH_ArkUI_AlignmentRuleOption_SetEnd(alignmentRule, "text", ARKUI_HORIZONTAL_ALIGNMENT_END); - OH_ArkUI_AlignmentRuleOption_SetCenterHorizontal(alignmentRule, "text", ARKUI_HORIZONTAL_ALIGNMENT_END); - return alignmentRule; -} - -static std::map attributeValueMap = { - // ARKUI_NODE_TOGGLE - {NODE_TOGGLE_SELECTED_COLOR, {togglePickerValue, 1, nullptr, nullptr}}, - {NODE_TOGGLE_SWITCH_POINT_COLOR, {togglePickerValue, 1, nullptr, nullptr}}, - {NODE_TOGGLE_VALUE, {togglePickerValue, 1, nullptr, nullptr}}, - {NODE_TOGGLE_UNSELECTED_COLOR, {togglePickerValue, 1, nullptr, nullptr}}, - - // ARKUI_NODE_BUTTON - {NODE_BUTTON_LABEL, {buttonPickerValue, 1, "BUTTON", nullptr}}, - {NODE_BUTTON_TYPE, {buttonPickerValue1, 1, "BUTTON", nullptr}}, - {NODE_BUTTON_MIN_FONT_SCALE, {buttonPickerValue2, 1, "BUTTON", nullptr}}, - {NODE_BUTTON_MAX_FONT_SCALE, {buttonPickerValue, 1, "BUTTON", nullptr}}, - - // ARKUI_NODE_CHECKBOX - {NODE_CHECKBOX_SELECT, {checkboxPickerValue, 1, "CHECKBOX", nullptr}}, - {NODE_CHECKBOX_SELECT_COLOR, {checkboxPickerValue1, 1, "CHECKBOX", nullptr}}, - {NODE_CHECKBOX_UNSELECT_COLOR, {checkboxPickerValue1, 1, "CHECKBOX", nullptr}}, - {NODE_CHECKBOX_MARK, {checkboxPickerValue1, 1, "CHECKBOX", nullptr}}, - {NODE_CHECKBOX_SHAPE, {checkboxPickerValue2, 1, "CHECKBOX", nullptr}}, - {NODE_CHECKBOX_NAME, {checkboxPickerValue, 1, "CHECKBOX", nullptr}}, - {NODE_CHECKBOX_GROUP, {checkboxPickerValue, 1, "CHECKBOX", nullptr}}, - - // ARKUI_NODE_SLIDER - {NODE_SLIDER_BLOCK_COLOR, {sliderPickerValue, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_TRACK_COLOR, {sliderPickerValue, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_SELECTED_COLOR, {sliderPickerValue7, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_SHOW_STEPS, {sliderPickerValue6, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_BLOCK_LINEAR_GRADIENT_COLOR, {nullptr, 0, nullptr, linerGrand} }, - {NODE_SLIDER_TRACK_LINEAR_GRADIENT_COLOR, {nullptr, 0, nullptr, linerGrand} }, - {NODE_SLIDER_SELECTED_LINEAR_GRADIENT_COLOR, {nullptr, 0, nullptr, linerGrand} }, - {NODE_SLIDER_BLOCK_STYLE, {sliderPickerValue2, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_VALUE, {sliderPickerValue9, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_MIN_VALUE, {sliderPickerValue3, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_MAX_VALUE, {sliderPickerValue4, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_DIRECTION, {sliderPickerValue8, 1, nullptr, nullptr}}, - {NODE_SLIDER_STEP, {sliderPickerValue9, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_STYLE, {sliderPickerValue5, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_REVERSE, {sliderPickerValue6, 1, nullptr, nullptr}}, - {NODE_SLIDER_TRACK_THICKNESS, {sliderPickerValue4, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_ENABLE_HAPTIC_FEEDBACK, {sliderPickerValue1, 1, "SLIDER", nullptr}}, - {NODE_SLIDER_PREFIX, {sliderPickerValue, 1, "SLIDER", CreatrObjects()}}, - {NODE_SLIDER_SUFFIX, {sliderPickerValue, 1, "SLIDER", CreatrObjects()}}, - - // ARKUI_NODE_RADIO - {NODE_RADIO_CHECKED, {radioPickerValue, 1, "SLIDER", nullptr}}, - {NODE_RADIO_STYLE, {radioPickerValue1, 1, "SLIDER", nullptr}}, - {NODE_RADIO_VALUE, {radioPickerValue, 1, "SLIDER", nullptr}}, - {NODE_RADIO_GROUP, {radioPickerValue, 1, "SLIDER", nullptr}}, - - // ARKUI_NODE_CHECKBOX_GROUP - {NODE_CHECKBOX_GROUP_NAME, {checkbocGroupPickerValue, 1, "SLIDER", nullptr}}, - {NODE_CHECKBOX_GROUP_SELECT_ALL, {checkbocGroupPickerValue1, 1, "SLIDER", nullptr}}, - {NODE_CHECKBOX_GROUP_SELECTED_COLOR, {checkbocGroupPickerValue2, 1, "SLIDER", nullptr}}, - {NODE_CHECKBOX_GROUP_UNSELECTED_COLOR, {checkbocGroupPickerValue2, 1, "SLIDER", nullptr}}, - {NODE_CHECKBOX_GROUP_MARK, {checkbocGroupPickerValue, 1, "SLIDER", nullptr}}, - {NODE_CHECKBOX_GROUP_SHAPE, {checkbocGroupPickerValue1, 1, "SLIDER", nullptr}}, -}; - -int32_t NodeManager::AddNativeNode(ArkUI_NodeHandle newNode, int32_t nodeType) -{ - if (newNode == nullptr) { - return -1; - } - - std::lock_guard lock(mutex_); - int32_t id = nodeId_++; - nativeNodeMap_[id] = { newNode, nodeType }; - return id; -} - -NodeRecord NodeManager::GetNativeNode(int32_t id) -{ - std::lock_guard lock(mutex_); - auto it = nativeNodeMap_.find(id); - if (it != nativeNodeMap_.end()) { - return it->second; - } - return { nullptr, -1 }; -} - -void NodeManager::RemoveNativeNode(int32_t id) -{ - std::lock_guard lock(mutex_); - auto it = nativeNodeMap_.find(id); - if (it != nativeNodeMap_.end()) { - GetNodeApi()->disposeNode(it->second.nodeHandle); - nativeNodeMap_.erase(it); - } -} - -ArkUI_NodeHandle NodeManager::GetMainPageSroll() -{ - if (mainPageScroll_ == nullptr) { - ArkUI_NativeNodeAPI_1* nodeApi = GetNodeApi(); - mainPageScroll_ = nodeApi->createNode(ARKUI_NODE_SCROLL); - } - return mainPageScroll_; -} - -int32_t NodeManager::CreateNativeNode(int32_t nodeType) -{ - ArkUI_NativeNodeAPI_1* nodeApi = GetNodeApi(); - if (nodeApi == nullptr) { - return -1; - } - bool isValid = false; - for (int i = 0; i < sizeof(g_attributeArray) / sizeof(AttributeScope); i++) { - if (g_attributeArray[i].nodeType == nodeType) { - isValid = true; - break; - } - } - if (!isValid) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", "-----CreateNativeNode, isValid is false"); - return -1; - } - - ArkUI_NodeHandle newNode = nodeApi->createNode((ArkUI_NodeType)nodeType); - int32_t newNodeId = AddNativeNode(newNode, nodeType); - BindEventByType(newNode, nodeType, BIND_EVENT); - nodeApi->addChild(mainPageScroll_, newNode); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "NodeManager", "-----CreateNativeNode, nodeType:%{public}d, nodeId:%{public}d", nodeType, newNodeId); - return newNodeId; -} - -void NodeManager::RemoveOldNode(int32_t nodeId) -{ - ArkUI_NodeHandle oldNode = GetNativeNode(nodeId).nodeHandle; - int32_t nodeType = GetNativeNode(nodeId).nodeType; - GetNodeApi()->removeChild(mainPageScroll_, oldNode); - BindEventByType(oldNode, nodeType, UNBIND_EVENT); - RemoveNativeNode(nodeId); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NodeManager", "-----RemoveOldNode, nodeId:%{public}d", nodeId); -} - -bool NodeManager::IsValidAttributeType(int32_t nodeType, int32_t attributeType) -{ - bool isValid = false; - for (int i = 0; i < sizeof(g_attributeArray) / sizeof(AttributeScope); i++) { - if (g_attributeArray[i].nodeType == nodeType) { - if (g_attributeArray[i].begin <= attributeType && attributeType <= g_attributeArray[i].end) { - isValid = true; - } - break; - } - } - if (!isValid) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", "--IsValidAttributeType, isValid is false"); - } - return isValid; -} - -int32_t NodeManager::SetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType) -{ - int32_t ret = 0; - if (!IsValidAttributeType(nodeType, attributeType)) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - ArkUI_NodeHandle node = GetNativeNode(nodeId).nodeHandle; - if (nodeApi == nullptr || node == nullptr) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - - ArkUI_AttributeItem attributeItem = {}; - if (attributeValueMap.count(attributeType)) { - attributeItem = attributeValueMap[attributeType]; - } - ret = nodeApi->setAttribute(node, (ArkUI_NodeAttributeType)attributeType, &attributeItem); - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "NativeNode", "-----SetNativeNodeAttribute, type:%{public}d, ret:%{public}d", - attributeType, ret); - return ret; -} - -int32_t NodeManager::SetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType, int32_t value) -{ - int32_t ret = 0; - if (!IsValidAttributeType(nodeType, attributeType)) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - ArkUI_NodeHandle node = GetNativeNode(nodeId).nodeHandle; - if (nodeApi == nullptr || node == nullptr) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - - ArkUI_NumberValue itemValue[] = { { .i32 = value } }; - ArkUI_AttributeItem attributeItem = { itemValue, sizeof(itemValue) / sizeof(ArkUI_NumberValue) }; - ret = nodeApi->setAttribute(node, (ArkUI_NodeAttributeType)attributeType, &attributeItem); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "NodeManager", "-----SetNativeNodeAttribute, type:%{public}d, ret:%{public}d, item_value:%{public}d", - attributeType, ret, attributeItem.value[0].i32); - return ret; -} - -int32_t NodeManager::ResetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType) -{ - int32_t ret = -1; - if (!IsValidAttributeType(nodeType, attributeType)) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - ArkUI_NodeHandle node = GetNativeNode(nodeId).nodeHandle; - if (nodeApi == nullptr || node == nullptr) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // call reset interface with attribute type - ret = nodeApi->resetAttribute(node, (ArkUI_NodeAttributeType)attributeType); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", - "ResetNativeNodeAttribute, type:%{public}d, ret:%{public}d", attributeType, ret); - return ret; -} - -const ArkUI_AttributeItem* NodeManager::GetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType) -{ - if (!IsValidAttributeType(nodeType, attributeType)) { - return nullptr; - } - ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - ArkUI_NodeHandle node = GetNativeNode(nodeId).nodeHandle; - if (nodeApi == nullptr || node == nullptr) { - return nullptr; - } - // call get attribute interface with attribute type - const ArkUI_AttributeItem* attributeItem = nodeApi->getAttribute(node, (ArkUI_NodeAttributeType)attributeType); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", - "----- GetAttribute, type:%{public}d, size:%{public}d, value:%{public}d, str:%{public}s", attributeType, - attributeItem->size, attributeItem->value[0].i32, attributeItem->string); - return attributeItem; -} - -static std::string GetNodeTypeName(int32_t eventTypeId) -{ - if (eventTypeId >= NODE_EVENT_ON_APPEAR && eventTypeId <= NODE_ON_ACCESSIBILITY_ACTIONS) { - return "ARKUI_NODE_BUTTON"; - } - - switch (eventTypeId) { - case NODE_TOGGLE_ON_CHANGE: - return "ARKUI_NODE_TOGGLE"; - case NODE_CHECKBOX_EVENT_ON_CHANGE: - return "ARKUI_NODE_CHECKBOX"; - case NODE_SLIDER_EVENT_ON_CHANGE: - return "ARKUI_NODE_SLIDER"; - case NODE_RADIO_EVENT_ON_CHANGE: - return "ARKUI_NODE_RADIO"; - case NODE_CHECKBOX_GROUP_EVENT_ON_CHANGE: - return "ARKUI_NODE_CHECKBOX_GROUP"; - default: - return ""; - } -} - -void NodeManager::BindEventByType(ArkUI_NodeHandle newNode, int32_t nodeType, EventOperation operation) -{ - switch (nodeType) { - case ARKUI_NODE_TOGGLE: - BindEventFunc(newNode, NODE_TOGGLE_ON_CHANGE, NODE_TOGGLE_ON_CHANGE, operation); - break; - case ARKUI_NODE_BUTTON: - BindEventFunc(newNode, NODE_EVENT_ON_APPEAR, NODE_ON_ACCESSIBILITY_ACTIONS, operation); - break; - case ARKUI_NODE_CHECKBOX: - BindEventFunc(newNode, NODE_CHECKBOX_EVENT_ON_CHANGE, NODE_CHECKBOX_EVENT_ON_CHANGE, operation); - break; - case ARKUI_NODE_SLIDER: - BindEventFunc(newNode, NODE_SLIDER_EVENT_ON_CHANGE, NODE_SLIDER_EVENT_ON_CHANGE, operation); - break; - case ARKUI_NODE_RADIO: - BindEventFunc(newNode, NODE_RADIO_EVENT_ON_CHANGE, NODE_RADIO_EVENT_ON_CHANGE, operation); - break; - case ARKUI_NODE_CHECKBOX_GROUP: - BindEventFunc(newNode, NODE_CHECKBOX_GROUP_EVENT_ON_CHANGE, NODE_CHECKBOX_GROUP_EVENT_ON_CHANGE, - operation); - break; - default: - break; - } -} - -static void OnEventReceive(ArkUI_NodeEvent* event) -{ - int32_t eventTypeId = OH_ArkUI_NodeEvent_GetTargetId(event); - OH_LOG_Print(LOG_APP, LOG_INFO, - LOG_PRINT_DOMAIN, "NodeManager", "-----OnEventReceive, eventTypeId:%{public}d", eventTypeId); - - if (g_callbackRef != nullptr && g_env != nullptr) { - std::string result = GetNodeTypeName(eventTypeId); - napi_value undefined = nullptr; - napi_get_undefined(g_env, &undefined); - napi_value callback = nullptr; - napi_get_reference_value(g_env, g_callbackRef, &callback); - napi_value argv[1]; - napi_create_string_utf8(g_env, result.c_str(), result.length(), &argv[0]); - napi_call_function(g_env, undefined, callback, 1, argv, nullptr); - } -} - -void NodeManager::BindEventFunc(ArkUI_NodeHandle newNode, int32_t begin, int32_t end, EventOperation operation) -{ - ArkUI_NativeNodeAPI_1* nodeApi = GetNodeApi(); - if (nodeApi == nullptr) { - return; - } - if (operation == BIND_EVENT) { - // 注册事件 - nodeApi->registerNodeEventReceiver(&OnEventReceive); - int32_t ret = -1; - for (int32_t index = begin; index <= end; index++) { - ret = nodeApi->registerNodeEvent(newNode, (ArkUI_NodeEventType)index, index, nullptr); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "NodeManager", "-----BIND_EVENT fail, errorcode:%{public}d", ret); - break; - } - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NodeManager", "-----BIND_EVENT success"); - } else { - for (int32_t index = begin; index <= end; index++) { - nodeApi->unregisterNodeEvent(newNode, (ArkUI_NodeEventType)index); - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NodeManager", "-----UNBIND_EVENT finish"); - } -} - -static bool IsSliderLinerColor(int32_t nodeType, int32_t attributeType) -{ - if (nodeType == ARKUI_NODE_SLIDER && - (attributeType == NODE_SLIDER_BLOCK_LINEAR_GRADIENT_COLOR || - attributeType == NODE_SLIDER_TRACK_LINEAR_GRADIENT_COLOR || - attributeType == NODE_SLIDER_SELECTED_LINEAR_GRADIENT_COLOR)) { - return true; - } else { - return false; - } -} - -static bool GetSliderLinerColor(ArkUI_AttributeItem* item, std::stringstream &ss) -{ - bool hasValue = false; - auto colorStop = static_cast(item->object); - if (colorStop) { - for (int i = 0; i < colorStop->size; ++i) { - ss << " color: " << std::hex << colorStop->colors[i] << " stop: " << colorStop->stops[i]; - hasValue = true; - } - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NodeManager", "-----GetSliderLinerColor finish"); - return hasValue; -} - -static bool GetArrayValue(int32_t nodeType, int32_t attributeType, const ArkUI_AttributeItem* item, - std::stringstream &ss) -{ - bool hasValue = false; - if (IsSliderLinerColor(nodeType, attributeType)) { - hasValue = GetSliderLinerColor((ArkUI_AttributeItem*)item, ss); - } else { - for (size_t i = 0; i < ((ArkUI_AttributeItem*)item)->size; i++) { - if (hasValue) { - ss << "/"; - } - ss << static_cast(item->value[i].i32); - hasValue = true; - } - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NodeManager", "-----GetArrayValue finish"); - return hasValue; -} - -napi_value TransTool::CreateFormPage(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TransTool", "CreateFormPage BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TransTool", "CreateFormPage env or info is null"); - return nullptr; - } - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TransTool", "CreateFormPage napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TransTool", "OH_ArkUI_GetBasicNodeAPI after"); - ArkUI_NativeNodeAPI_1* nodeApi = NodeManager::GetNodeApi(); - if (nodeApi != nullptr) { - if (nodeApi->createNode != nullptr && nodeApi->addChild != nullptr) { - ArkUI_NodeHandle pageNode = NodeManager::GetInstance().GetMainPageSroll(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, pageNode); - } - } - return nullptr; -} - -napi_value TransTool::CreateFormNode(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t nodeType; - napi_get_value_int32(env, args[0], &nodeType); - OH_LOG_Print(LOG_APP, LOG_INFO, 0, "TransTool", "-----CreateFormNode, input nodeType:%{public}d", nodeType); - if (nodeType < 0) { - napi_value result; - napi_create_int32(env, -1, &result); - return result; - } - - if (g_callbackRef != nullptr) { - napi_delete_reference(g_env, g_callbackRef); - g_callbackRef = nullptr; - g_env = nullptr; - } - napi_create_reference(env, args[1], 1, &g_callbackRef); - g_env = env; - - int32_t newNodeId = NodeManager::GetInstance().CreateNativeNode(nodeType); - OH_LOG_Print(LOG_APP, LOG_INFO, 0, "TransTool", "-----CreateFormNode, newNodeId:%{public}d", newNodeId); - if (newNodeId != -1) { - napi_value result; - napi_create_int32(env, newNodeId, &result); - return result; - } - return nullptr; -} - -napi_value TransTool::RemoveFormNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t nodeId; - napi_get_value_int32(env, args[0], &nodeId); - if (nodeId < 0) { - return nullptr; - } - - if (g_callbackRef != nullptr) { - napi_delete_reference(g_env, g_callbackRef); - g_callbackRef = nullptr; - g_env = nullptr; - } - - NodeManager::GetInstance().RemoveOldNode(nodeId); - return nullptr; -} - -napi_value TransTool::SetFormAttribute(napi_env env, napi_callback_info info) -{ - size_t argc = 4; // 4 means four arguments are expected - napi_value args[4] = {nullptr}; // 4 means four arguments size - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - int32_t nodeId; - napi_get_value_int32(env, args[0], &nodeId); - int32_t nodeType; - napi_get_value_int32(env, args[1], &nodeType); - int32_t attributeType; - const int index2 = 2; - napi_get_value_int32(env, args[index2], &attributeType); - napi_valuetype valueType; - const int index3 = 3; - napi_typeof(env, args[index3], &valueType); - - int32_t ret = -1; - if (valueType != napi_string) { - napi_value result; - napi_create_int32(env, ret, &result); - return result; - } - - size_t valueLen; - napi_get_value_string_utf8(env, args[index3], nullptr, 0, &valueLen); - - std::string value(valueLen + 1, '\0'); - napi_get_value_string_utf8(env, args[index3], &value[0], valueLen + 1, nullptr); - - try { - int32_t intValue = std::stoi(value); - if (intValue < 0) { - ret = NodeManager::GetInstance().SetNativeNodeAttribute(nodeId, nodeType, attributeType); - } else { - ret = NodeManager::GetInstance().SetNativeNodeAttribute(nodeId, nodeType, attributeType, intValue); - } - } catch (const std::exception&) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", "-----SetNativeNodeAttribute exception"); - } - - napi_value result; - napi_create_int32(env, ret, &result); - return result; -} - -napi_value TransTool::ResetFormAttribute(napi_env env, napi_callback_info info) -{ - size_t argc = 3; // 3 means 3 arguments are expected - napi_value args[3] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t nodeId; - napi_get_value_int32(env, args[0], &nodeId); - int32_t nodeType; - napi_get_value_int32(env, args[1], &nodeType); - int32_t attributeType; - napi_get_value_int32(env, args[2], &attributeType); // 2 means the third argument - - int32_t ret = NodeManager::GetInstance().ResetNativeNodeAttribute(nodeId, - nodeType, attributeType); - napi_value result; - napi_create_int32(env, ret, &result); - return result; -} - -napi_value TransTool::GetFormAttribute(napi_env env, napi_callback_info info) -{ - size_t argc = 3; // 3 means three arguments are expected - napi_value args[3] = {nullptr}; // 3 means three arguments are expected - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - int32_t nodeId = -1; - napi_get_value_int32(env, args[0], &nodeId); - int32_t nodeType = -1; - napi_get_value_int32(env, args[1], &nodeType); - int32_t attributeType = -1; - napi_get_value_int32(env, args[2], &attributeType); // 2 means the third argument - napi_value result; - if (nodeType < 0 || attributeType < 0) { - napi_create_int32(env, -1, &result); - return result; - } - const ArkUI_AttributeItem* item = NodeManager::GetInstance().GetNativeNodeAttribute(nodeId, - nodeType, attributeType); - if (item == nullptr) { - napi_create_int32(env, -1, &result); - return result; - } - std::stringstream ss; - bool hasValue = false; - if (item->size > 0) { - hasValue = GetArrayValue(nodeType, attributeType, item, ss); - } - if (item->string != nullptr) { - if (hasValue) { - ss << "/"; - } - ss << item->string; - hasValue = true; - } - if (!hasValue) { - ss << "-1"; - } - std::string resultStr = ss.str(); - napi_create_string_utf8(env, resultStr.c_str(), resultStr.length(), &result); - return result; -} -} // namespace NativeNode::Manager \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/form_manager.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/form_manager.h deleted file mode 100644 index 9103e22c1536777dfb8bf18de784fda1ad41fffd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/form_manager.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef CAPI_FORM_MANAGER_H -#define CAPI_FORM_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include - -namespace NativeNode::Form { -using EventCallback = std::function; - -// 指定对事件进行绑定还是解绑 -enum EventOperation { - BIND_EVENT, - UNBIND_EVENT, -}; - -struct NodeRecord { - ArkUI_NodeHandle nodeHandle; - int32_t nodeType; -}; - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -class NodeManager { -public: - ~NodeManager() = default; - static NodeManager& GetInstance(); - static ArkUI_NativeNodeAPI_1* GetNodeApi(); - - ArkUI_NodeHandle GetMainPageSroll(); - int32_t CreateNativeNode(int32_t nodeType); - void RemoveOldNode(int32_t nodeId); - int32_t SetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType); - int32_t SetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType, int32_t value); - int32_t ResetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType); - const ArkUI_AttributeItem* GetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType); - -private: - NodeManager() = default; - int32_t AddNativeNode(ArkUI_NodeHandle newNode, int32_t nodeType); - NodeRecord GetNativeNode(int32_t id); - void RemoveNativeNode(int32_t id); - bool IsValidAttributeType(int32_t nodeType, int32_t attributeType); - void BindEventByType(ArkUI_NodeHandle newNode, int32_t nodeType, EventOperation operation); - void BindEventFunc(ArkUI_NodeHandle newNode, int32_t begin, int32_t end, EventOperation operation); - - std::unordered_map callbackMap_; - std::map nativeNodeMap_; - std::mutex mutex_; - int32_t nodeId_ = 1; - - ArkUI_NodeHandle mainPageScroll_ = nullptr; -}; - -class TransTool { -public: - static napi_value CreateFormPage(napi_env env, napi_callback_info info); - static napi_value CreateFormNode(napi_env env, napi_callback_info info); - static napi_value RemoveFormNode(napi_env env, napi_callback_info info); - static napi_value SetFormAttribute(napi_env env, napi_callback_info info); - static napi_value ResetFormAttribute(napi_env env, napi_callback_info info); - static napi_value GetFormAttribute(napi_env env, napi_callback_info info); -}; -} -#endif //CAPI_FORM_MANAGER_H - diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/imagespan_manager.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/imagespan_manager.cpp deleted file mode 100644 index 43337111b805ccb3f4b7a138ae09d7464de1dc77..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/imagespan_manager.cpp +++ /dev/null @@ -1,837 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "imagespan_manager.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace NativeNode::ImageSpan { - -constexpr uint32_t MATRIX_ARRAY_SIZE = 16; -NodeManager& NodeManager::GetInstance() -{ - static NodeManager instance; - return instance; -} - -ArkUI_NativeNodeAPI_1* NodeManager::GetNodeApi() -{ - static ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - return nodeApi; -} - -struct AttributeScope { - ArkUI_NodeType nodeType; - ArkUI_NodeAttributeType begin; - ArkUI_NodeAttributeType end; -}; - -AttributeScope g_attributeArray[] = { - {ARKUI_NODE_IMAGE_SPAN, NODE_IMAGE_SPAN_SRC, NODE_IMAGE_SPAN_BASELINE_OFFSET}, - {ARKUI_NODE_IMAGE, NODE_BACKGROUND_IMAGE, NODE_IMAGE_ORIENTATION}, - {ARKUI_NODE_LOADING_PROGRESS, NODE_LOADING_PROGRESS_COLOR, NODE_LOADING_PROGRESS_ENABLE_LOADING}, - {ARKUI_NODE_PROGRESS, NODE_PROGRESS_VALUE, NODE_PROGRESS_LINEAR_STYLE}, - {ARKUI_NODE_DATE_PICKER, NODE_DATE_PICKER_LUNAR, NODE_DATE_PICKER_CAN_LOOP}, - {ARKUI_NODE_TIME_PICKER, NODE_TIME_PICKER_SELECTED, NODE_TIME_PICKER_ENABLE_CASCADE}, - {ARKUI_NODE_TEXT_PICKER, NODE_TEXT_PICKER_OPTION_RANGE, NODE_TEXT_PICKER_SELECTED_BACKGROUND_STYLE}, - {ARKUI_NODE_CALENDAR_PICKER, NODE_CALENDAR_PICKER_HINT_RADIUS, NODE_CALENDAR_PICKER_MARK_TODAY}, - {ARKUI_NODE_IMAGE_ANIMATOR, NODE_IMAGE_ANIMATOR_IMAGES, NODE_IMAGE_ANIMATOR_ITERATION}, -}; - -static ArkUI_NumberValue hdrBrightness[] = { { .f32 = 1.0 } }; -static ArkUI_NumberValue orientation[] = { { .i32 = ARKUI_ORIENTATION_RIGHT } }; -static ArkUI_NumberValue copyOption[] = { { .i32 = ARKUI_COPY_OPTIONS_IN_APP } }; -static ArkUI_NumberValue imageMatrix[MATRIX_ARRAY_SIZE] = { { .f32 = 5.0f }, { .f32 = 0.0f }, { .f32 = 0.0f }, - { .f32 = 0.0f }, { .f32 = 0.0f }, { .f32 = 1.0f }, { .f32 = 0.0f }, { .f32 = 0.0f }, { .f32 = 0.0f }, - { .f32 = 0.0f }, { .f32 = 1.0f }, { .f32 = 0.0f }, { .f32 = 0.0f }, { .f32 = 50.0f }, - { .f32 = 0.0f }, { .f32 = 1.0f } }; -static ArkUI_NumberValue dynamicRangeMode[] = { { .i32 = 1 } }; -static ArkUI_NumberValue enableAnalyzer[] = { { .i32 = 1 } }; -static ArkUI_NumberValue matchDirection[] = { { .i32 = 1 } }; -static ArkUI_NumberValue sourceSize[] = { { .i32 = 80 }, { .i32 = 90 } }; // 80, 90 means image width height -static ArkUI_NumberValue commonValue1[] = {{.i32 = 1}}; -static ArkUI_NumberValue commonValue2[] = {{.f32 = 10.0f}}; -static ArkUI_NumberValue textPickerValue1[] = {{.i32 = ARKUI_TEXTPICKER_RANGETYPE_SINGLE}}; -static ArkUI_NumberValue textPickerValue2[] = {{.i32 = 0}}; -static ArkUI_NumberValue textPickerValue3[] = {{.f32 = 1.0f}}; -static ArkUI_NumberValue calendarPickerValue1[] = { { .f32 = 10.0f } }; -static ArkUI_NumberValue calendarPickerValue2[] = { { .u32 = 2025 }, { .u32 = 1 }, { .u32 = 1 } }; -static ArkUI_NumberValue calendarPickerValue3[] = { { .i32 = ARKUI_CALENDAR_ALIGNMENT_START }, { .f32 = 10.0f }, - { .f32 = 10.0f } }; -static ArkUI_NumberValue calendarPickerValue4[] = { { .u32 = 0xFFFF0000 }, { .f32 = 10.0f }, - { .i32 = ARKUI_FONT_WEIGHT_NORMAL } }; -static ArkUI_NumberValue calendarPickerValue5[] = {{.u32 = 0xFF1122FF}}; - -static ArkUI_NumberValue imageAnimatorValue2[] = {{.i32 = 500}}; -static ArkUI_NumberValue imageAnimatorValue3[] = {{.i32 = 5}}; - -// ARKUI_NODE_IMAGE_SPAN -static ArkUI_NumberValue imageSpanValue2[] = {{.i32 = ARKUI_IMAGE_SPAN_ALIGNMENT_BASELINE}}; -// ARKUI_NODE_IMAGE -const char START_ICON_PATH[] = "resource://base/media/startIcon.png"; -const char BACKGROUND_PATH[] = "resource://base/media/background.png"; -static ArkUI_NumberValue imageValue2[] = {{.f32 = 100.0f}, {.f32 = 100.0f}}; -static ArkUI_NumberValue imageValue3[] = {{.f32 = 100.0f}}; -static ArkUI_NumberValue imageValue4[] = {{.f32 = 0.0f}, {.f32 = 0.0f}}; -static ArkUI_NumberValue imageValue5[] = {{.f32 = 5.0f}, {.f32 = 5.0f}, {.f32 = 5.0f}, {.f32 = 5.0f}}; -static ArkUI_NumberValue imageValue6[] = {{.i32 = ARKUI_OBJECT_FIT_CONTAIN}}; -static ArkUI_NumberValue imageValue7[] = {{.i32 = ARKUI_IMAGE_INTERPOLATION_NONE}}; -static ArkUI_NumberValue imageValue8[20] = {{.f32 = 0.0f}}; -static ArkUI_NumberValue imageValue9[] = {{.i32 = ARKUI_IMAGE_RENDER_MODE_ORIGINAL}}; -static ArkUI_NumberValue imageValue10[] = {{.u32 = 0X0000FFFF}}; - -// ARKUI_NODE_LOADING_PROGRESS -static ArkUI_NumberValue loadProcessValue1[] = {{.u32 = 0XFFFF0000}}; -static ArkUI_NumberValue processValue1[] = {{.i32 = ARKUI_PROGRESS_TYPE_LINEAR}}; -// ARKUI_NODE_IMAGE_ANIMATOR -static ArkUI_NumberValue imageAnimatorValue1[] = {{.f32 = 200.0f}}; - -static std::map attributeValueMap = { - // ARKUI_NODE_IMAGE_SPAN - {NODE_IMAGE_SPAN_SRC, {commonValue1, 1, START_ICON_PATH, nullptr}}, - {NODE_IMAGE_SPAN_VERTICAL_ALIGNMENT, {imageSpanValue2, 1, nullptr, nullptr}}, - {NODE_IMAGE_SPAN_ALT, {commonValue1, 1, BACKGROUND_PATH, nullptr}}, - {NODE_IMAGE_SPAN_BASELINE_OFFSET, {commonValue1, 1, nullptr, nullptr}}, - // ARKUI_NODE_IMAGE - {NODE_BACKGROUND_IMAGE, {commonValue1, 1, BACKGROUND_PATH, nullptr}}, - {NODE_BACKGROUND_IMAGE_SIZE, {imageValue2, 2, nullptr, nullptr}}, - {NODE_BACKGROUND_IMAGE_SIZE_WITH_STYLE, {imageValue3, 1, nullptr, nullptr}}, - {NODE_BACKGROUND_IMAGE_POSITION, {imageValue4, 2, nullptr, nullptr}}, - {NODE_BACKGROUND_IMAGE_RESIZABLE_WITH_SLICE, {imageValue5, 4, nullptr, nullptr}}, - {NODE_IMAGE_SRC, {commonValue1, 1, START_ICON_PATH, nullptr}}, - {NODE_IMAGE_OBJECT_FIT, {imageValue6, 1, nullptr, nullptr}}, - {NODE_IMAGE_INTERPOLATION, {imageValue7, 1, nullptr, nullptr}}, - {NODE_IMAGE_OBJECT_REPEAT, {commonValue1, 1, nullptr, nullptr}}, - {NODE_IMAGE_COLOR_FILTER, {imageValue8, 20, nullptr, nullptr}}, - {NODE_IMAGE_AUTO_RESIZE, {commonValue1, 1, nullptr, nullptr}}, - {NODE_IMAGE_ALT, {commonValue1, 1, START_ICON_PATH, nullptr}}, - {NODE_IMAGE_DRAGGABLE, {commonValue1, 1, nullptr, nullptr}}, - {NODE_IMAGE_RENDER_MODE, {imageValue9, 1, nullptr, nullptr}}, - {NODE_IMAGE_FIT_ORIGINAL_SIZE, {commonValue1, 1, nullptr, nullptr}}, - {NODE_IMAGE_FILL_COLOR, {imageValue10, 1, nullptr, nullptr}}, - {NODE_IMAGE_RESIZABLE, {imageValue5, 4, nullptr, nullptr}}, - {NODE_IMAGE_SYNC_LOAD, {commonValue1, 1, nullptr, nullptr}}, - {NODE_IMAGE_HDR_BRIGHTNESS, {hdrBrightness, 1, nullptr, nullptr}}, - {NODE_IMAGE_ORIENTATION, {orientation, 1, nullptr, nullptr}}, - {NODE_IMAGE_IMAGE_MATRIX, {imageMatrix, MATRIX_ARRAY_SIZE, nullptr, nullptr}}, - {NODE_IMAGE_COPY_OPTION, {copyOption, 1, nullptr, nullptr}}, - {NODE_IMAGE_DYNAMIC_RANGE_MODE, {dynamicRangeMode, 1, nullptr, nullptr}}, - {NODE_IMAGE_ENABLE_ANALYZER, {enableAnalyzer, 1, nullptr, nullptr}}, - {NODE_IMAGE_MATCH_TEXT_DIRECTION, {matchDirection, 1, nullptr, nullptr}}, - {NODE_IMAGE_SOURCE_SIZE, {sourceSize, 2, nullptr, nullptr}}, - // ARKUI_NODE_LOADING_PROGRESS - {NODE_LOADING_PROGRESS_COLOR, {loadProcessValue1, 1, nullptr, nullptr}}, - {NODE_LOADING_PROGRESS_ENABLE_LOADING, {commonValue1, 1, nullptr, nullptr}}, - // ARKUI_NODE_PROGRESS - {NODE_PROGRESS_VALUE, {commonValue1, 1, nullptr, nullptr}}, - {NODE_PROGRESS_TOTAL, {commonValue1, 1, nullptr, nullptr}}, - {NODE_PROGRESS_COLOR, {loadProcessValue1, 1, nullptr, nullptr}}, - {NODE_PROGRESS_TYPE, {processValue1, 1, nullptr, nullptr}}, - {NODE_PROGRESS_LINEAR_STYLE, {commonValue1, 1, nullptr, nullptr}}, - // ARKUI_NODE_DATE_PICKER - {NODE_DATE_PICKER_LUNAR, {commonValue1, 1, "2025-1-1", nullptr}}, - {NODE_DATE_PICKER_START, {commonValue1, 1, "2025-1-1", nullptr}}, - {NODE_DATE_PICKER_END, {commonValue1, 1, "2025-1-1", nullptr}}, - {NODE_DATE_PICKER_SELECTED, {commonValue1, 1, "2025-1-1", nullptr}}, - {NODE_DATE_PICKER_DISAPPEAR_TEXT_STYLE, {commonValue1, 1, "#ff182431;14;normal;Arial;normal", nullptr}}, - {NODE_DATE_PICKER_TEXT_STYLE, {commonValue1, 1, "#ff182431;14;normal;Arial;normal", nullptr}}, - {NODE_DATE_PICKER_SELECTED_TEXT_STYLE, {commonValue1, 1, "#ff182431;14;normal;Arial;normal", nullptr}}, - {NODE_DATE_PICKER_MODE, {commonValue1, 1, nullptr, nullptr}}, - {NODE_DATE_PICKER_ENABLE_HAPTIC_FEEDBACK, {commonValue1, 1, nullptr, nullptr}}, - {NODE_DATE_PICKER_CAN_LOOP, {commonValue1, 1, nullptr, nullptr}}, - // ARKUI_NODE_TIME_PICKER - {NODE_TIME_PICKER_SELECTED, {commonValue1, 1, "11-59", nullptr}}, - {NODE_TIME_PICKER_USE_MILITARY_TIME, {commonValue1, 1, "11-59", nullptr}}, - {NODE_TIME_PICKER_DISAPPEAR_TEXT_STYLE, {commonValue1, 1, "#ff182431;14;normal;Arial;normal", nullptr}}, - {NODE_TIME_PICKER_TEXT_STYLE, {commonValue1, 1, "#ff182431;14;normal;Arial;normal", nullptr}}, - {NODE_TIME_PICKER_SELECTED_TEXT_STYLE, {commonValue1, 1, "#ff182431;14;normal;Arial;normal", nullptr}}, - {NODE_TIME_PICKER_START, {commonValue1, 1, "00:00:00", nullptr}}, - {NODE_TIME_PICKER_END, {commonValue1, 1, "23:59:59", nullptr}}, - {NODE_TIME_PICKER_ENABLE_CASCADE, {commonValue1, 1, nullptr, nullptr}}, - // ARKUI_NODE_TEXT_PICKER - {NODE_TEXT_PICKER_OPTION_RANGE, {textPickerValue1, 1, "1;2;3", nullptr}}, - {NODE_TEXT_PICKER_OPTION_SELECTED, {textPickerValue2, 1, nullptr, nullptr}}, - {NODE_TEXT_PICKER_OPTION_VALUE, {textPickerValue1, 1, "1;2;3", nullptr}}, - {NODE_TEXT_PICKER_DISAPPEAR_TEXT_STYLE, {textPickerValue1, 1, - "#ff182431;14;normal;Arial;normal", nullptr}}, - {NODE_TEXT_PICKER_TEXT_STYLE, {textPickerValue1, 1, "#ff182431;14;normal;Arial;normal", nullptr}}, - {NODE_TEXT_PICKER_SELECTED_TEXT_STYLE, {textPickerValue1, 1, - "#ff182431;14;normal;Arial;normal", nullptr}}, - {NODE_TEXT_PICKER_SELECTED_INDEX, {textPickerValue2, 1, nullptr, nullptr}}, - {NODE_TEXT_PICKER_CAN_LOOP, {commonValue1, 1, nullptr, nullptr}}, - {NODE_TEXT_PICKER_DEFAULT_PICKER_ITEM_HEIGHT, {textPickerValue3, 1, nullptr, nullptr}}, - {NODE_TEXT_PICKER_ENABLE_HAPTIC_FEEDBACK, {textPickerValue2, 1, nullptr, nullptr}}, - {NODE_TEXT_PICKER_SELECTED_BACKGROUND_STYLE, {calendarPickerValue5, 1, nullptr, nullptr}}, - // ARKUI_NODE_CALENDAR_PICKER - {NODE_CALENDAR_PICKER_HINT_RADIUS, {calendarPickerValue1, 1, nullptr, nullptr}}, - {NODE_CALENDAR_PICKER_SELECTED_DATE, {calendarPickerValue2, 3, nullptr, nullptr}}, - {NODE_CALENDAR_PICKER_EDGE_ALIGNMENT, {calendarPickerValue3, 3, nullptr, nullptr}}, - {NODE_CALENDAR_PICKER_TEXT_STYLE, {calendarPickerValue4, 3, nullptr, nullptr}}, - {NODE_CALENDAR_PICKER_START, {commonValue1, 1, "2025-1-1", nullptr}}, - {NODE_CALENDAR_PICKER_END, {commonValue1, 1, "2025-1-1", nullptr}}, - {NODE_CALENDAR_PICKER_DISABLED_DATE_RANGE, {commonValue1, 1, "2025-01-01,2025-01-02", nullptr}}, - {NODE_CALENDAR_PICKER_MARK_TODAY, {commonValue1, 1, nullptr, nullptr}}, - // ARKUI_NODE_IMAGE_ANIMATOR - {NODE_IMAGE_ANIMATOR_IMAGES, {commonValue1, 1, nullptr, nullptr}}, - {NODE_IMAGE_ANIMATOR_STATE, {commonValue1, 1, nullptr, nullptr}}, - {NODE_IMAGE_ANIMATOR_DURATION, {imageAnimatorValue2, 1, nullptr, nullptr}}, - {NODE_IMAGE_ANIMATOR_REVERSE, {commonValue1, 1, nullptr, nullptr}}, - {NODE_IMAGE_ANIMATOR_FIXED_SIZE, {imageAnimatorValue3, 1, nullptr, nullptr}}, - {NODE_IMAGE_ANIMATOR_FILL_MODE, {commonValue1, 1, nullptr, nullptr}}, - {NODE_IMAGE_ANIMATOR_ITERATION, {commonValue1, 1, nullptr, nullptr}}, -}; - -static ArkUI_ImageAnimatorFrameInfo* imageAnimatorFrame = nullptr; -static ArkUI_ImageAnimatorFrameInfo* GetImageAnimator() -{ - if (imageAnimatorFrame == nullptr) { - imageAnimatorFrame = OH_ArkUI_ImageAnimatorFrameInfo_CreateFromString("resource://base/media/startIcon.png"); - if (imageAnimatorFrame != nullptr) { - OH_ArkUI_ImageAnimatorFrameInfo_SetWidth(imageAnimatorFrame, imageAnimatorValue1[0].f32); - OH_ArkUI_ImageAnimatorFrameInfo_SetHeight(imageAnimatorFrame, imageAnimatorValue1[0].f32); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", "-----GetImageAnimator, frame is null"); - } - } - return imageAnimatorFrame; -} - -static void DisposeImageAnimator() -{ - OH_ArkUI_ImageAnimatorFrameInfo_Dispose(imageAnimatorFrame); - imageAnimatorFrame = nullptr; -} - -int32_t NodeManager::AddNativeNode(ArkUI_NodeHandle newNode, int32_t nodeType) -{ - if (newNode == nullptr) { - return -1; - } - - std::lock_guard lock(mutex_); - int32_t id = nodeId_++; - nativeNodeMap_[id] = { newNode, nodeType }; - return id; -} - -NodeRecord NodeManager::GetNativeNode(int32_t id) -{ - std::lock_guard lock(mutex_); - auto it = nativeNodeMap_.find(id); - if (it != nativeNodeMap_.end()) { - return it->second; - } - return { nullptr, -1 }; -} - -void NodeManager::RemoveNativeNode(int32_t id) -{ - std::lock_guard lock(mutex_); - auto it = nativeNodeMap_.find(id); - if (it != nativeNodeMap_.end()) { - GetNodeApi()->disposeNode(it->second.nodeHandle); - nativeNodeMap_.erase(it); - } -} - -ArkUI_NodeHandle NodeManager::GetMainPageSroll() -{ - if (mainPageScroll_ == nullptr) { - ArkUI_NativeNodeAPI_1* nodeApi = GetNodeApi(); - mainPageScroll_ = nodeApi->createNode(ARKUI_NODE_SCROLL); - } - return mainPageScroll_; -} - -int32_t NodeManager::CreateNativeNode(int32_t nodeType) -{ - ArkUI_NativeNodeAPI_1* nodeApi = GetNodeApi(); - if (nodeApi == nullptr) { - return -1; - } - bool isValid = false; - for (int i = 0; i < sizeof(g_attributeArray) / sizeof(AttributeScope); i++) { - if (g_attributeArray[i].nodeType == nodeType) { - isValid = true; - break; - } - } - if (!isValid) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", "-----CreateNativeNode, isValid is false"); - return -1; - } - - ArkUI_NodeHandle newNode = nodeApi->createNode((ArkUI_NodeType)nodeType); - if (nodeType == ARKUI_NODE_IMAGE || nodeType == ARKUI_NODE_IMAGE_SPAN) { - ArkUI_AttributeItem srcItem = {}; - srcItem.string = "resource://base/media/startIcon2.png"; - nodeApi->setAttribute(newNode, NODE_IMAGE_SRC, &srcItem); - ArkUI_NumberValue valueWidth[] = { { .f32 = 200 } }; - ArkUI_AttributeItem itemWidth = { valueWidth, sizeof(valueWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(newNode, NODE_WIDTH, &itemWidth); - ArkUI_NumberValue valueHeight[] = { { .f32 = 200 } }; - ArkUI_AttributeItem itemHeight = { valueHeight, sizeof(valueHeight) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(newNode, NODE_HEIGHT, &itemHeight); - ArkUI_NumberValue hdrBrightness[] = {{.f32 = 0.1}}; // 0.1 means hdr brightness value - ArkUI_AttributeItem valueItem = {hdrBrightness, sizeof(hdrBrightness) / sizeof(ArkUI_NumberValue)}; - nodeApi->setAttribute(newNode, NODE_IMAGE_HDR_BRIGHTNESS, &valueItem); - ArkUI_NumberValue dynamicMode[] = {{.i32 = 2}}; // 2 means dynamic range mode - ArkUI_AttributeItem valueItemRangeMode = {dynamicMode, sizeof(dynamicMode) / sizeof(ArkUI_NumberValue)}; - nodeApi->setAttribute(newNode, NODE_IMAGE_DYNAMIC_RANGE_MODE, &valueItemRangeMode); - } - - int32_t newNodeId = AddNativeNode(newNode, nodeType); - BindEventByType(newNode, nodeType, BIND_EVENT); - nodeApi->addChild(mainPageScroll_, newNode); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "NodeManager", "-----CreateNativeNode, nodeType:%{public}d, nodeId:%{public}d", nodeType, newNodeId); - return newNodeId; -} - -void NodeManager::RemoveOldNode(int32_t nodeId) -{ - ArkUI_NodeHandle oldNode = GetNativeNode(nodeId).nodeHandle; - int32_t nodeType = GetNativeNode(nodeId).nodeType; - GetNodeApi()->removeChild(mainPageScroll_, oldNode); - BindEventByType(oldNode, nodeType, UNBIND_EVENT); - if (nodeId == ARKUI_NODE_IMAGE_ANIMATOR) { - DisposeImageAnimator(); - } - RemoveNativeNode(nodeId); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NodeManager", "-----RemoveOldNode, nodeId:%{public}d", nodeId); -} - -bool NodeManager::IsValidAttributeType(int32_t nodeType, int32_t attributeType) -{ - bool isValid = false; - for (int i = 0; i < sizeof(g_attributeArray) / sizeof(AttributeScope); i++) { - if (g_attributeArray[i].nodeType == nodeType) { - if (g_attributeArray[i].begin <= attributeType && attributeType <= g_attributeArray[i].end) { - isValid = true; - } - break; - } - } - if (!isValid) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", "--IsValidAttributeType, isValid is false"); - } - return isValid; -} - -int32_t NodeManager::SetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType) -{ - int32_t ret = 0; - if (!IsValidAttributeType(nodeType, attributeType)) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - ArkUI_NodeHandle node = GetNativeNode(nodeId).nodeHandle; - if (nodeApi == nullptr || node == nullptr) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - - ArkUI_AttributeItem attributeItem = {}; - if (attributeValueMap.count(attributeType)) { - attributeItem = attributeValueMap[attributeType]; - if (attributeType == NODE_IMAGE_ANIMATOR_IMAGES) { - if (GetImageAnimator() == nullptr) { - return -1; - } - ArkUI_ImageAnimatorFrameInfo* frame = GetImageAnimator(); - attributeItem.object = (void*)(&frame); - } - } - if (attributeType == NODE_IMAGE_IMAGE_MATRIX) { - int32_t objectFitValue = ArkUI_ObjectFit::ARKUI_OBJECT_FIT_NONE_MATRIX; - ArkUI_NumberValue valueObject[] = { { .i32 = objectFitValue } }; - ArkUI_AttributeItem valueItem = { valueObject, sizeof(valueObject) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_IMAGE_OBJECT_FIT, &valueItem); - } - ret = nodeApi->setAttribute(node, (ArkUI_NodeAttributeType)attributeType, &attributeItem); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "NodeManager", "-----SetNativeNodeAttribute, type:%{public}d, ret:%{public}d", attributeType, ret); - return ret; -} - -int32_t NodeManager::SetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType, int32_t value) -{ - int32_t ret = -1; - if (!IsValidAttributeType(nodeType, attributeType)) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - ArkUI_NodeHandle node = GetNativeNode(nodeId).nodeHandle; - if (nodeApi == nullptr || node == nullptr) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - - ArkUI_NumberValue itemValue[] = { { .i32 = value } }; - ArkUI_AttributeItem attributeItem = { itemValue, sizeof(itemValue) / sizeof(ArkUI_NumberValue) }; - // set NODE_IMAGE_COPY_OPTION, attribute value is ARKUI_COPY_OPTIONS_LOCAL_DEVICE - if (attributeType == NODE_IMAGE_COPY_OPTION) { - int32_t copyValue = ArkUI_CopyOptions::ARKUI_COPY_OPTIONS_LOCAL_DEVICE; - ArkUI_NumberValue value[] = { { .i32 = copyValue } }; - ArkUI_AttributeItem valueCopyItem = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_IMAGE_COPY_OPTION, &valueCopyItem); - } - // set other attribute type - ret = nodeApi->setAttribute(node, (ArkUI_NodeAttributeType)attributeType, &attributeItem); - if (ret != 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "NativeNode", "NODE_IMAGE SetAttribute failed"); - return -1; - } - return ret; -} - -// When the user inputs multiple values, attribute setting -int32_t NodeManager::SetNativeNodeAttribute( - int32_t nodeId, int32_t nodeType, int32_t attributeType, const std::vector& value) -{ - int32_t ret = -1; - if (!IsValidAttributeType(nodeType, attributeType)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "NativeNode", "NODE_IMAGE IsValidAttributeType"); - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - ArkUI_NodeHandle node = GetNativeNode(nodeId).nodeHandle; - if (nodeApi == nullptr || node == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0, "NativeNode", "NODE_IMAGE nodeApi or node is nullptr"); - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // The following attributes do not support input with more than 2 parameters - if (value.size() <= 0 || (value.size() >= 2 && (attributeType == NODE_IMAGE_COPY_OPTION || - attributeType == NODE_IMAGE_ENABLE_ANALYZER || attributeType == NODE_IMAGE_ORIENTATION))) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // The following NODE_IMAGE_SOURCE_SIZE attributes do not support input with more than 3 parameters - if (value.size() >= 3 && attributeType == NODE_IMAGE_SOURCE_SIZE) { // 3 means three elements - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - - // set attribute type is NODE_IMAGE_IMAGE_MATRIX, must set NODE_IMAGE_OBJECT_FIT to ARKUI_OBJECT_FIT_NONE_MATRIX - if (attributeType == NODE_IMAGE_IMAGE_MATRIX) { - if (value.size() < MATRIX_ARRAY_SIZE) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - int32_t objectFitValue = ArkUI_ObjectFit::ARKUI_OBJECT_FIT_NONE_MATRIX; - ArkUI_NumberValue valueObject[] = { { .i32 = objectFitValue } }; - ArkUI_AttributeItem valueItem = { valueObject, sizeof(valueObject) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_IMAGE_OBJECT_FIT, &valueItem); - ArkUI_NumberValue valueMatrix[100] = {}; - for (int i = 0; i < value.size(); ++i) { - valueMatrix[i].f32 = value[i]; - } - ArkUI_AttributeItem valueItemMatrix = { valueMatrix, sizeof(valueMatrix) / sizeof(ArkUI_NumberValue) }; - ret = nodeApi->setAttribute(node, NODE_IMAGE_IMAGE_MATRIX, &valueItemMatrix); - } - // set attribute type is NODE_IMAGE_SOURCE_SIZE - if (attributeType == NODE_IMAGE_SOURCE_SIZE) { - ArkUI_NumberValue valueSourceSize[] = { { .i32 = static_cast(value[0]) }, - { .i32 = static_cast(value[1]) } }; - ArkUI_AttributeItem valueItemSourceSize = { valueSourceSize, - sizeof(valueSourceSize) / sizeof(ArkUI_NumberValue) }; - ret = nodeApi->setAttribute(node, (ArkUI_NodeAttributeType)attributeType, &valueItemSourceSize); - } - // set attribute type is NODE_IMAGE_HDR_BRIGHTNESS - if (attributeType == NODE_IMAGE_HDR_BRIGHTNESS) { - ArkUI_NumberValue valueHdrBrightness[] = { {.f32 = value[0]} }; - ArkUI_AttributeItem valueItemHdr = { valueHdrBrightness, - sizeof(valueHdrBrightness) / sizeof(ArkUI_NumberValue) }; - ret = nodeApi->setAttribute(node, (ArkUI_NodeAttributeType)attributeType, &valueItemHdr); - } - return ret; -} - -int32_t NodeManager::ResetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType) -{ - int32_t ret = -1; - if (!IsValidAttributeType(nodeType, attributeType)) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - ArkUI_NodeHandle node = GetNativeNode(nodeId).nodeHandle; - if (nodeApi == nullptr || node == nullptr) { - return ARKUI_ERROR_CODE_PARAM_INVALID; - } - // call reset interface with attribute type - ret = nodeApi->resetAttribute(node, (ArkUI_NodeAttributeType)attributeType); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", - "NODE_IMAGE ResetNativeNodeAttribute, type:%{public}d, ret:%{public}d", attributeType, ret); - return ret; -} - -const ArkUI_AttributeItem* NodeManager::GetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType) -{ - if (!IsValidAttributeType(nodeType, attributeType)) { - return nullptr; - } - ArkUI_NativeNodeAPI_1* nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - ArkUI_NodeHandle node = GetNativeNode(nodeId).nodeHandle; - if (nodeApi == nullptr || node == nullptr) { - return nullptr; - } - // call get attribute interface with attribute type - const ArkUI_AttributeItem* attributeItem = nodeApi->getAttribute(node, (ArkUI_NodeAttributeType)attributeType); - if (attributeItem == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", - "----- GetNativeNodeAttribute is failed , type:%{public}d", attributeType); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "NodeManager", - "----- GetAttribute, type:%{public}d, size:%{public}d, value:%{public}d, str:%{public}s", attributeType, - attributeItem->size, attributeItem->value[0].i32, attributeItem->string); - return attributeItem; -} - -void NodeManager::BindEventByType(ArkUI_NodeHandle newNode, int32_t nodeType, EventOperation operation) -{ - switch (nodeType) { - case ARKUI_NODE_IMAGE: - BindEventFunc(newNode, NODE_IMAGE_ON_COMPLETE, NODE_IMAGE_ON_DOWNLOAD_PROGRESS, operation); - break; - case ARKUI_NODE_DATE_PICKER: - BindEventFunc( - newNode, NODE_DATE_PICKER_EVENT_ON_DATE_CHANGE, NODE_DATE_PICKER_EVENT_ON_DATE_CHANGE, operation); - break; - case ARKUI_NODE_TIME_PICKER: - BindEventFunc(newNode, NODE_TIME_PICKER_EVENT_ON_CHANGE, NODE_TIME_PICKER_EVENT_ON_CHANGE, operation); - break; - case ARKUI_NODE_TEXT_PICKER: - BindEventFunc(newNode, NODE_TEXT_PICKER_EVENT_ON_CHANGE, NODE_TEXT_PICKER_EVENT_ON_SCROLL_STOP, operation); - break; - case ARKUI_NODE_CALENDAR_PICKER: - BindEventFunc( - newNode, NODE_CALENDAR_PICKER_EVENT_ON_CHANGE, NODE_CALENDAR_PICKER_EVENT_ON_CHANGE, operation); - break; - case ARKUI_NODE_IMAGE_ANIMATOR: - BindEventFunc(newNode, NODE_IMAGE_ANIMATOR_EVENT_ON_START, NODE_IMAGE_ANIMATOR_EVENT_ON_FINISH, operation); - break; - default: - break; - } -} - -static void OnEventReceive(ArkUI_NodeEvent* event) -{ - int32_t eventTypeId = OH_ArkUI_NodeEvent_GetTargetId(event); - OH_LOG_Print(LOG_APP, LOG_INFO, - LOG_PRINT_DOMAIN, "NodeManager", "-----OnEventReceive, eventTypeId:%{public}d", eventTypeId); -} - -void NodeManager::BindEventFunc(ArkUI_NodeHandle newNode, int32_t begin, int32_t end, EventOperation operation) -{ - ArkUI_NativeNodeAPI_1* nodeApi = GetNodeApi(); - if (nodeApi == nullptr) { - return; - } - if (operation == BIND_EVENT) { - // 注册事件 - nodeApi->registerNodeEventReceiver(&OnEventReceive); - int32_t ret = -1; - for (int32_t index = begin; index <= end; index++) { - ret = nodeApi->registerNodeEvent(newNode, (ArkUI_NodeEventType)index, index, nullptr); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "NodeManager", "-----BIND_EVENT fail, errorcode:%{public}d", ret); - break; - } - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NodeManager", "-----BIND_EVENT success"); - } else { - for (int32_t index = begin; index <= end; index++) { - nodeApi->unregisterNodeEvent(newNode, (ArkUI_NodeEventType)index); - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NodeManager", "-----UNBIND_EVENT finish"); - } -} - -napi_value TransTool::CreateImageSpanPage(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TransTool", "CreateImageSpanPage BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TransTool", "CreateImageSpanPage env or info is null"); - return nullptr; - } - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TransTool", "CreateImageSpanPage napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TransTool", "OH_ArkUI_GetBasicNodeAPI after"); - ArkUI_NativeNodeAPI_1* nodeApi = NodeManager::GetNodeApi(); - if (nodeApi != nullptr) { - if (nodeApi->createNode != nullptr && nodeApi->addChild != nullptr) { - ArkUI_NodeHandle pageNode = NodeManager::GetInstance().GetMainPageSroll(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, pageNode); - } - } - return nullptr; -} - -napi_value TransTool::CreateImageSpanNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t nodeType; - napi_get_value_int32(env, args[0], &nodeType); - OH_LOG_Print(LOG_APP, LOG_INFO, 0, "TransTool", "-----CreateImageSpanNode, input nodeType:%{public}d", nodeType); - if (nodeType < 0) { - napi_value result; - napi_create_int32(env, -1, &result); - return result; - } - - int32_t newNodeId = NodeManager::GetInstance().CreateNativeNode(nodeType); - OH_LOG_Print(LOG_APP, LOG_INFO, 0, "TransTool", "-----CreateImageSpanNode, newNodeId:%{public}d", newNodeId); - if (newNodeId != -1) { - napi_value result; - napi_create_int32(env, newNodeId, &result); - return result; - } - return nullptr; -} - -napi_value TransTool::RemoveImageSpanNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t nodeId; - napi_get_value_int32(env, args[0], &nodeId); - if (nodeId < 0) { - return nullptr; - } - - NodeManager::GetInstance().RemoveOldNode(nodeId); - return nullptr; -} - -static std::vector ParseFloatValues(const std::string& value) -{ - std::vector floatValues; - std::stringstream ss(value); - std::string item; - while (std::getline(ss, item, '/')) { - if (!item.empty()) { - try { - float floatValue = std::stof(item); - floatValues.push_back(floatValue); - } catch (const std::exception&) { - continue; - } - } - } - return floatValues; -} - -static int32_t HandleStringAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType, const std::string& value) -{ - std::vector floatValues; - size_t slashCount = std::count(value.begin(), value.end(), '/'); - if (slashCount > 0) { - floatValues = ParseFloatValues(value); - if (!floatValues.empty()) { - return NodeManager::GetInstance().SetNativeNodeAttribute( - nodeId, nodeType, attributeType, floatValues); - } - } - if (value.find('.') != std::string::npos) { - try { - float floatValue = std::stof(value); - floatValues.push_back(floatValue); - return NodeManager::GetInstance().SetNativeNodeAttribute( - nodeId, nodeType, attributeType, floatValues); - } catch (const std::exception&) { - return -1; - } - } - - try { - // case-insensitive contains check for "none", if it's found, call default value - std::string lowerValue = value; - std::transform(lowerValue.begin(), lowerValue.end(), lowerValue.begin(), - [](unsigned char c) { return static_cast(std::tolower(c)); }); - if (lowerValue.find("none") != std::string::npos) { - return NodeManager::GetInstance().SetNativeNodeAttribute( - nodeId, nodeType, attributeType); - } - int32_t intValue = std::stoi(value); - if (intValue < 0) { - return NodeManager::GetInstance().SetNativeNodeAttribute( - nodeId, nodeType, attributeType); - } - return NodeManager::GetInstance().SetNativeNodeAttribute( - nodeId, nodeType, attributeType, intValue); - } catch (const std::exception&) { - return -1; - } -} - -napi_value TransTool::SetImageSpanAttribute(napi_env env, napi_callback_info info) -{ - size_t argc = 4; // 4 means four arguments are expected - napi_value args[4] = {nullptr}; // 4 means four arguments size - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - int32_t nodeId; - napi_get_value_int32(env, args[0], &nodeId); - int32_t nodeType; - napi_get_value_int32(env, args[1], &nodeType); - int32_t attributeType; - napi_get_value_int32(env, args[2], &attributeType); // 2 means the third argument - - napi_valuetype valueType; - napi_typeof(env, args[3], &valueType); // 3 means the fourth argument - int32_t ret = -1; - if (valueType != napi_string) { - napi_value result; - napi_create_int32(env, ret, &result); - return result; - } - - size_t valueLen; - napi_get_value_string_utf8(env, args[3], nullptr, 0, &valueLen); // 3 means the fourth argument - - std::string value(valueLen + 1, '\0'); - napi_get_value_string_utf8(env, args[3], &value[0], valueLen + 1, nullptr); // 3 means the fourth argument - - ret = HandleStringAttribute(nodeId, nodeType, attributeType, value); - - napi_value result; - napi_create_int32(env, ret, &result); - return result; -} - -napi_value TransTool::ResetImageSpanAttribute(napi_env env, napi_callback_info info) -{ - size_t argc = 3; // 3 means 3 arguments are expected - napi_value args[3] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - int32_t nodeId; - napi_get_value_int32(env, args[0], &nodeId); - int32_t nodeType; - napi_get_value_int32(env, args[1], &nodeType); - int32_t attributeType; - napi_get_value_int32(env, args[2], &attributeType); // 2 means the third argument - - int32_t ret = NodeManager::GetInstance().ResetNativeNodeAttribute(nodeId, - nodeType, attributeType); - napi_value result; - napi_create_int32(env, ret, &result); - return result; -} - -napi_value CreateNapiResult(napi_env env, int32_t value) -{ - napi_value result; - napi_create_int32(env, value, &result); - return result; -} - -napi_value CreateNapiString(napi_env env, const std::string& str) -{ - napi_value result; - napi_create_string_utf8(env, str.c_str(), str.length(), &result); - return result; -} - -static bool ParseGetArgs(napi_env env, napi_callback_info info, - int32_t& nodeId, int32_t& nodeType, int32_t& attributeType) -{ - size_t argc = 3; // 3 means three arguments are expected - napi_value args[3] = { nullptr, nullptr, nullptr }; // 3 means three arguments are expected - napi_status status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (status != napi_ok || argc < 3) { // 3 means three arguments are expected - return false; - } - if (napi_get_value_int32(env, args[0], &nodeId) != napi_ok || - napi_get_value_int32(env, args[1], &nodeType) != napi_ok || - napi_get_value_int32(env, args[2], &attributeType) != napi_ok) { // 2 means the third argument - return false; - } - return nodeType >= 0 && attributeType >= 0; -} - -static std::string AttributeItemToString(const ArkUI_AttributeItem* item, int32_t attributeType) -{ - if (item == nullptr) { - return "-1"; - } - const bool isFloatAttribute = (attributeType == NODE_IMAGE_HDR_BRIGHTNESS || - attributeType == NODE_IMAGE_IMAGE_MATRIX); - std::stringstream ss; - bool hasValue = false; - if (item->size > 0 && item->value != nullptr) { - for (size_t i = 0; i < item->size; i++) { - if (hasValue) { - ss << "/"; - } - if (isFloatAttribute) { - ss << std::fixed << std::setprecision(2) << item->value[i].f32; // 2 means two decimal places - } else { - ss << item->value[i].i32; - } - hasValue = true; - } - } - if (item->string != nullptr && item->string[0] != '\0') { - if (hasValue) { - ss << "/"; - } - ss << item->string; - hasValue = true; - } - if (!hasValue) { - ss << "-1"; - } - return ss.str(); -} - -napi_value TransTool::GetImageSpanAttribute(napi_env env, napi_callback_info info) -{ - int32_t nodeId = -1; - int32_t nodeType = -1; - int32_t attributeType = -1; - if (!ParseGetArgs(env, info, nodeId, nodeType, attributeType)) { - return CreateNapiResult(env, -1); - } - const ArkUI_AttributeItem* item = NodeManager::GetInstance().GetNativeNodeAttribute( - nodeId, nodeType, attributeType); - if (item == nullptr) { - return CreateNapiResult(env, -1); - } - return CreateNapiString(env, AttributeItemToString(item, attributeType)); -} -} // namespace NativeNode::Manager \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/imagespan_manager.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/imagespan_manager.h deleted file mode 100644 index e00ad7bce3cd28df5bf40cef45d80bb17bb6e3c0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/imagespan_manager.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef CAPI_IMAGESPAN_MANAGER_H -#define CAPI_IMAGESPAN_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace NativeNode::ImageSpan { -using EventCallback = std::function; - -// 指定对事件进行绑定还是解绑 -enum EventOperation { - BIND_EVENT, - UNBIND_EVENT, -}; - -struct NodeRecord { - ArkUI_NodeHandle nodeHandle; - int32_t nodeType; -}; - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -class NodeManager { -public: - ~NodeManager() = default; - static NodeManager& GetInstance(); - static ArkUI_NativeNodeAPI_1* GetNodeApi(); - - ArkUI_NodeHandle GetMainPageSroll(); - int32_t CreateNativeNode(int32_t nodeType); - void RemoveOldNode(int32_t nodeId); - int32_t SetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType); - int32_t SetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType, int32_t value); - int32_t SetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, - int32_t attributeType, const std::vector& values); - int32_t ResetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType); - const ArkUI_AttributeItem* GetNativeNodeAttribute(int32_t nodeId, int32_t nodeType, int32_t attributeType); - -private: - NodeManager() = default; - int32_t AddNativeNode(ArkUI_NodeHandle newNode, int32_t nodeType); - NodeRecord GetNativeNode(int32_t id); - void RemoveNativeNode(int32_t id); - bool IsValidAttributeType(int32_t nodeType, int32_t attributeType); - void BindEventByType(ArkUI_NodeHandle newNode, int32_t nodeType, EventOperation operation); - void BindEventFunc(ArkUI_NodeHandle newNode, int32_t begin, int32_t end, EventOperation operation); - - std::unordered_map callbackMap_; - std::map nativeNodeMap_; - std::mutex mutex_; - int32_t nodeId_ = 1; - - ArkUI_NodeHandle mainPageScroll_ = nullptr; -}; - -class TransTool { -public: - static napi_value CreateImageSpanPage(napi_env env, napi_callback_info info); - static napi_value CreateImageSpanNode(napi_env env, napi_callback_info info); - static napi_value RemoveImageSpanNode(napi_env env, napi_callback_info info); - static napi_value SetImageSpanAttribute(napi_env env, napi_callback_info info); - static napi_value ResetImageSpanAttribute(napi_env env, napi_callback_info info); - static napi_value GetImageSpanAttribute(napi_env env, napi_callback_info info); -}; -} -#endif //CAPI_MANAGER_H - diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/manager.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/manager.cpp deleted file mode 100644 index 29ab7ac94a3ab696a046b05d366a21b0d67b0242..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "manager.h" -#include "GridMaker.h" -#include "TextMaker.h" -#include "SwiperMaker.h" -#include "AccessibilityMaker.h" -#include "EmbeddedComponentMaker.h" -#include "WaterFlowMaker.h" -#include "ScrollMaker.h" -#include "RefreshMaker.h" -#include "ListMaker.h" -#include "PublicEvent.h" -#include "baseUtils.h" -#include "napi/native_api.h" -#include "XComponentMaker.h" -#include -#include -#include -#include -#include -#include -#include - -namespace ConstIde { -const uint32_t NUMBER_0 = 0; -const uint32_t NUMBER_1 = 1; -const uint32_t NUMBER_2 = 2; -const uint32_t MARGIN_NUMBER_30 = 30; -constexpr const char *K_LOG_DOMAIN = "Manager"; -} // namespace ConstIde - -Manager Manager::manager_; -ArkUI_NativeNodeAPI_1 *Manager::nodeAPI_ = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - -template -static napi_value CreateNativeNode(napi_env env, napi_callback_info info, const char *who, MakeNodeFn makeNodeFn) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, ConstIde::K_LOG_DOMAIN, "%{public}s BEGIN", who); - - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, ConstIde::K_LOG_DOMAIN, "%{public}s env or info is null", - who); - return nullptr; - } - - size_t argc = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - napi_status st = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (st != napi_ok || argc < ConstIde::NUMBER_1) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, ConstIde::K_LOG_DOMAIN, "%{public}s napi_get_cb_info failed", - who); - return nullptr; - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - if (nodeContentHandle == nullptr) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, ConstIde::K_LOG_DOMAIN, - "%{public}s nodeContentHandle is null", who); - return nullptr; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, ConstIde::K_LOG_DOMAIN, "%{public}s after GetNodeContent", who); - - if (Manager::nodeAPI_ == nullptr) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, ConstIde::K_LOG_DOMAIN, "%{public}s nodeAPI_ is null", who); - return nullptr; - } - - // 构建具体节点 & 挂载 - ArkUI_NodeHandle page = makeNodeFn(); - if (page == nullptr) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, ConstIde::K_LOG_DOMAIN, "%{public}s makeNodeFn return null", - who); - return nullptr; - } - - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, page); - return nullptr; -} - -napi_value Manager::CreateSwiperNativeNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode(env, info, "CreateNativeSwiperNode", - []() -> ArkUI_NodeHandle { return SwiperMaker::createSwiperPage(); }); -} - -napi_value Manager::CreateNativeTextNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode(env, info, "CreateNativeTextNode", - []() -> ArkUI_NodeHandle { return TextMaker::createTextPage(); }); -} - -napi_value Manager::CreateNativeAccessibilityNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode(env, info, "CreateNativeAccessibilityNode", - []() -> ArkUI_NodeHandle { return AccessibilityMaker::CreateNativeNode(); }); -} - -napi_value Manager::CreateNativeEmbeddedComponentNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode(env, info, "CreateNativeEmbeddedComponentNode", - []() -> ArkUI_NodeHandle { return EmbeddedComponentMaker::CreateNativeNode(); }); -} - -napi_value Manager::CreateWaterFlowNativeNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode(env, info, "CreateWaterFlowNativeNode", - []() -> ArkUI_NodeHandle { return WaterFlowMaker::CreateNativeNode(); }); -} - -napi_value Manager::CreateGridNativeNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode(env, info, "CreateGridNativeNode", - []() -> ArkUI_NodeHandle { return GridMaker::CreateNativeNode(); }); -} - -napi_value Manager::CreateScrollNativeNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode(env, info, "CreateScrollNativeNode", - []() -> ArkUI_NodeHandle { return ScrollMaker::CreateNativeNode(); }); -} - -napi_value Manager::CreateRefreshNativeNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode(env, info, "CreateRefreshNativeNode", - []() -> ArkUI_NodeHandle { return RefreshMaker::CreateNativeNode(); }); -} - -napi_value Manager::CreateListNativeNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode(env, info, "CreateListNativeNode", - []() -> ArkUI_NodeHandle { return ListMaker::CreateNativeNode(); }); -} - -napi_value Manager::CreatePublicNativeNode(napi_env env, napi_callback_info info) -{ - return CreateNativeNode( - env, info, "CreatePublicNativeNode", - []() -> ArkUI_NodeHandle { return PublicMaker::CreateNativeNode(); }); -} - -ArkUI_NativeNodeAPI_1 *Manager::XnodeAPI = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - -napi_value Manager::createNativeXComponentNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argc = 2; - napi_value args[2] = {nullptr, nullptr}; - if (napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - if (argc != 1 + 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - ArkUI_NodeContentHandle nodeContentHandle_ = nullptr; - int32_t ret = OH_ArkUI_NodeContent_SetUserData(nodeContentHandle_, - new int32_t(123)); - void *userDataNull = - OH_ArkUI_NodeContent_GetUserData(nodeContentHandle_); // 非法获取,返回空指针 - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &nodeContentHandle_); - - if (XnodeAPI == nullptr) { - return nullptr; - } - if (XnodeAPI->createNode == nullptr || XnodeAPI->addChild == nullptr) { - return nullptr; - } - auto nodeContentEvent = [](ArkUI_NodeContentEvent *event) { - ArkUI_NodeContentHandle handle = OH_ArkUI_NodeContentEvent_GetNodeContentHandle(event); - std::string *userData = reinterpret_cast(OH_ArkUI_NodeContent_GetUserData(handle)); - if (OH_ArkUI_NodeContentEvent_GetEventType(event) == NODE_CONTENT_EVENT_ON_ATTACH_TO_WINDOW) { - ArkUI_NodeHandle testNode; - if (userData) { - testNode = XComponentMaker::CreateNodeHandle(*userData); - } else { - testNode = XComponentMaker::CreateNodeHandle("noUserData"); - } - OH_ArkUI_NodeContent_InsertNode(handle, testNode, 0); // 接口使用示例 - OH_ArkUI_NodeContent_RemoveNode(handle, testNode); - OH_ArkUI_NodeContent_AddNode(handle, testNode); - } else { - if (userData) { - delete userData; - userData = nullptr; - } - } - }; - OH_ArkUI_NodeContent_RegisterCallback(nodeContentHandle_, nodeContentEvent); - - return nullptr; -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/manager.h b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/manager.h deleted file mode 100644 index cabcf1cf227f23b4d09cd372d27d06d875e965ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_NODE_NAPI_SAMPLE_MANAGER_H -#define NATIVE_NODE_NAPI_SAMPLE_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; -class Manager { -public: - static ArkUI_NativeNodeAPI_1 *nodeAPI_; - static ArkUI_NativeNodeAPI_1 *XnodeAPI; - ~Manager(){}; - - static napi_value CreateNativeTextNode(napi_env env, napi_callback_info info); - static napi_value CreateSwiperNativeNode(napi_env env, napi_callback_info info); - static napi_value CreateNativeAccessibilityNode(napi_env env, napi_callback_info info); - static napi_value CreateNativeEmbeddedComponentNode(napi_env env, napi_callback_info info); - static napi_value CreateWaterFlowNativeNode(napi_env env, napi_callback_info info); - static napi_value CreateGridNativeNode(napi_env env, napi_callback_info info); - static napi_value CreateScrollNativeNode(napi_env env, napi_callback_info info); - static napi_value CreateRefreshNativeNode(napi_env env, napi_callback_info info); - static napi_value CreateListNativeNode(napi_env env, napi_callback_info info); - static napi_value createNativeXComponentNode(napi_env env, napi_callback_info info); - static napi_value CreatePublicNativeNode(napi_env env, napi_callback_info info); - -private: - static Manager manager_; -}; - -#endif // NATIVE_NODE_NAPI_SAMPLE_MANAGER_H diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 513207842785ca1066cc610bbbd25e188d9d493a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "imagespan_manager.h" -#include "manager.h" -#include "form_manager.h" -#include - -napi_property_descriptor desc[] = { - {"createNativeTextNode", nullptr, Manager::CreateNativeTextNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createSwiperNativeNode", nullptr, Manager::CreateSwiperNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createWaterFlowNativeNode", nullptr, Manager::CreateWaterFlowNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createGridNativeNode", nullptr, Manager::CreateGridNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createScrollNativeNode", nullptr, Manager::CreateScrollNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createRefreshNativeNode", nullptr, Manager::CreateRefreshNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createListNativeNode", nullptr, Manager::CreateListNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"CreatePublicNativeNode", nullptr, Manager::CreatePublicNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createNativeNodexc", nullptr, Manager::createNativeXComponentNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createFormPage", nullptr, NativeNode::Form::TransTool::CreateFormPage, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createFormNode", nullptr, NativeNode::Form::TransTool::CreateFormNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"setFormAttribute", nullptr, NativeNode::Form::TransTool::SetFormAttribute, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"getFormAttribute", nullptr, NativeNode::Form::TransTool::GetFormAttribute, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"resetFormAttribute", nullptr, NativeNode::Form::TransTool::ResetFormAttribute, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"removeFormNode", nullptr, NativeNode::Form::TransTool::RemoveFormNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - // 参考新增其他createNative方法和Maker类 - {"createImageSpanPage", nullptr, NativeNode::ImageSpan::TransTool::CreateImageSpanPage, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"createImageSpanNode", nullptr, NativeNode::ImageSpan::TransTool::CreateImageSpanNode, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"removeImageSpanNode", nullptr, NativeNode::ImageSpan::TransTool::RemoveImageSpanNode, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"setImageSpanAttribute", nullptr, NativeNode::ImageSpan::TransTool::SetImageSpanAttribute, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"resetImageSpanAttribute", nullptr, NativeNode::ImageSpan::TransTool::ResetImageSpanAttribute, nullptr, - nullptr, nullptr, napi_default, nullptr}, - {"getImageSpanAttribute", nullptr, NativeNode::ImageSpan::TransTool::GetImageSpanAttribute, nullptr, nullptr, - nullptr, napi_default, nullptr}, -}; - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 6e739663251eb77e1c32656ba988b960bd8ee4b5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const createNativeTextNode: (content: Object) =>void; -export const createSwiperNativeNode: (content: Object) =>void; -export const createNativeAccessibilityNode: (content: Object) => void; -export const createNativeEmbeddedComponentNode: (content: Object) => void; -export const createWaterFlowNativeNode: (content: Object) => void; -export const createGridNativeNode: (content: Object) => void; -export const createScrollNativeNode: (content: Object) => void; -export const createRefreshNativeNode: (content: Object) => void; -export const createListNativeNode: (content: Object) => void; -export const createNativeNodexc: (content: Object, tag: string) => void; -export const CreatePublicNativeNode: (content: Object) =>void; -export const createFormPage: (content: Object) => void; -export const createFormNode: (content: Object, callback: Object) => number; -export const setFormAttribute: (nodeId: number, nodeType: number, attributeType: number, attributeValue: string) => number; -export const getFormAttribute: (nodeId: number, nodeType: number, attributeType: number) => string; -export const resetFormAttribute: (nodeId: number, nodeType: number, attributeType: number) => number; -export const removeFormNode: (nodeId: number) => void; -export const createImageSpanPage: (content: Object) =>void; -export const createImageSpanNode: (nodeType: number) => number; -export const removeImageSpanNode: (nodeId: number) => void; -export const setImageSpanAttribute: (nodeId: number, nodeType: number, attributeType: number, attributeValue: string) => number; -export const getImageSpanAttribute: (nodeId: number, nodeType: number, attributeType: number) => string; -export const resetImageSpanAttribute: (nodeId: number, nodeType: number, attributeType: number) => number; diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index b81656fe96ca09694282eed65e33f57ddc1d2a05..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6678a198c2f39c9309ca7c3e5a9f36999ce001f7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2025 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 { BusinessError } from '@kit.BasicServicesKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; -const BACKGROUND_COLOR = '#2AA1A6B1' -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - let windowClass: window.Window | undefined = undefined; - windowStage.getMainWindow((err: BusinessError, data) => { - const errCode: number = err.code; - if (errCode) { - console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`); - return; - } - windowClass = data; - let systemBarProperties: window.SystemBarProperties = { - statusBarColor: BACKGROUND_COLOR, - navigationBarColor: BACKGROUND_COLOR, - //以下两个属性从API Version8开始支持 - }; - try { - let promise = windowClass.setWindowSystemBarProperties(systemBarProperties); - promise.then(() => { - console.info('Succeeded in setting the system bar properties.'); - }).catch((err: BusinessError) => { - console.error(`Failed to set the system bar properties. Cause code: ${err.code}, message: ${err.message}`); - }); - } catch (exception) { - console.error(`Failed to set the system bar properties. Cause code: ${exception.code}, message: ${exception.message}`); - } - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b37e4b57cd7849ab462574297ff70345c2132ab2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/extensionAbility/SampleEmbeddedAbility.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/extensionAbility/SampleEmbeddedAbility.ets deleted file mode 100644 index e1f327c40a2d8d67f76ef0d9d3ccd6e7bbf1c247..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/extensionAbility/SampleEmbeddedAbility.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 { EmbeddedUIExtensionAbility, UIExtensionContentSession, Want } from '@kit.AbilityKit' - -export default class SampleEmbeddedAbility extends EmbeddedUIExtensionAbility { - onForeground() { - this.context.terminateSelf() - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index b821442f2cdc3057758b2dafef751f1323f648db..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2025 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 { router } from '@kit.ArkUI'; - -interface ListCategories { - title: string, - url: string, - id: string -} - -@Entry -@Component -struct MenuIndex { - private items: ListCategories[] = - [ - { title: 'Text', url: 'pages/page_text', id: '' }, - { title: 'Swiper', url: 'pages/page_swiper', id: '' }, - { title: 'accessibility', url: 'pages/page_accessibility', id: '' }, - { title: 'embedded component', url: 'pages/page_embedded_component', id: '' }, - { title: 'WaterFlow', url: 'pages/page_waterflow', id: '' }, - { title: 'Grid', url: 'pages/page_grid', id: '' }, - { title: 'Public', url: 'pages/page_public_event', id: 'Public' }, - { title: 'Scroll', url: 'pages/page_scroll', id: '' }, - { title: 'Refresh', url: 'pages/page_refresh', id: '' }, - { title: 'List', url: 'pages/page_list', id: '' }, - { title: 'XComponent', url: 'pages/page_xcomponent', id: '' }, - { title: 'Form表单类', url: 'pages/page_form', id: '' }, - { title: '信息选择图片类', url: 'pages/page_imagespan', id: '' }, - ]; - - build() { - Scroll(new Scroller()) { - Column() { - Text('native_node_sample') - .fontWeight(FontWeight.Bold) - .fontSize('20vp') - .textAlign(TextAlign.Center) - .height('5%') - .margin($r('sys.float.titlebar_title_margin_right')) - List() { - ForEach(this.items, (item: ListCategories) => { - ListItem() { - Row() { - Text(item.title) - .fontSize($r('sys.float.text_button_font_size')) - .fontColor(Color.Black) - .textAlign(TextAlign.Start) - .height('100%') - .width('50%') - .padding($r('sys.float.padding_level10')) - Text('>') - .id(item.id) - .fontSize('25vp') - .fontColor(Color.Black) - .textAlign(TextAlign.End) - .fontColor(Color.Gray) - .height('100%') - .width('50%') - .padding($r('sys.float.padding_level10')) - } - .width('100%') - .height('10%') - .borderRadius($r('sys.float.select_border_radius_default')) - .backgroundColor(Color.White) - .onClick(() => { - router.pushUrl({ url: item.url }) - }) - }.margin($r('sys.float.menu_item_content_align')) - }) - }.width('95%').height('90%').alignListItem(ListItemAlign.Center) - }.width('100%') - }.height('100%').backgroundColor($r('app.color.background_color')) - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_accessibility.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_accessibility.ets deleted file mode 100644 index 9368bede5d6e3160cbddc45f7bd9235d4d4efeac..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_accessibility.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createNativeAccessibilityNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_embedded_component.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_embedded_component.ets deleted file mode 100644 index 040bd81c11fdffac89c05193b2125d60d09e20aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_embedded_component.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createNativeEmbeddedComponentNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_form.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_form.ets deleted file mode 100644 index 3feff4874222516a9fba959516c5e2c69801a655..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_form.ets +++ /dev/null @@ -1,465 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -function getNodeType(type: string): number { - let ret = -1; - switch(type) { - case 'TOGGLE': - ret = 5; - break; - case 'BUTTON': - ret = 9; - break; - case 'CHECKBOX': - ret = 11; - break; - case 'SLIDER': - ret = 17; - break; - case 'RADIO': - ret = 18; - break; - case 'CHECKBOX_GROUP': - ret = 21; - break; - default: - break; - } - return ret; -} - -const SUCC_TAG = 'success'; -const FAIL_TAG = 'failed'; - -@Extend(Text) -function style(textAlign: TextAlign) { - .textAlign(textAlign) - .fontSize(12) - .border({ width: 1 }) - .padding(10) - .width('100%') -} - -@Entry -@Component -struct Index { - @State status: number = Visibility.Visible; - @State nodeId: number = -1; - @State nodeStatus: string = ''; - @State curNodeType: string = ''; - @State attributeType: string = ''; - @State attributeTypeId: number = -1; - @State attributeValue: string = '-1'; - @State resultValue: string = '-1'; - @State curAttrStatus: number = 0; - @State result: string = '...'; - private nodeContent = new NodeContent(); - - nativeCallback = (data: string) => { - this.result = data; - } - - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createFormPage(this.nodeContent); - } - - @Builder - SubMenuNodeType() { - Menu() { - MenuItem({ content: 'TOGGLE' }).width('50%').onChange(() => { this.curNodeType = 'TOGGLE'; }) - MenuItem({ content: 'BUTTON' }).width('50%').onChange(() => { this.curNodeType = 'BUTTON'; }) - MenuItem({ content: 'CHECKBOX' }).width('50%').onChange(() => { this.curNodeType = 'CHECKBOX'; }) - MenuItem({ content: 'SLIDER' }).width('50%').onChange(() => { this.curNodeType = 'SLIDER'; }) - MenuItem({ content: 'RADIO' }).width('50%').onChange(() => { this.curNodeType = 'RADIO'; }) - MenuItem({ content: 'CHECKBOX_GROUP' }).width('50%').onChange(() => { this.curNodeType = 'CHECKBOX_GROUP'; }) - } - } - - @Builder - SubMenuAttributeType() { - Menu() { - MenuItem({ content: 'TOGGLE', builder: (): void => this.SubMenu_TOGGLE() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'BUTTON', builder: (): void => this.SubMenu_BUTTON() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'CHECKBOX', builder: (): void => this.SubMenu_CHECKBOX() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'SLIDER', builder: (): void => this.SubMenu_SLIDER() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'RADIO', builder: (): void => this.SubMenu_RADIO() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'CHECKBOX_GROUP', builder: (): void => this.SubMenu_CHECKBOX_GROUP() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - }.visibility(this.status) - } - - @Builder - SubMenu_TOGGLE() { - Menu() { - MenuItem({ content: 'SELECTED_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'SELECTED_COLOR'; - this.attributeTypeId = 5000; - }) - MenuItem({ content: 'SWITCH_POINT_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'SWITCH_POINT_COLOR'; - this.attributeTypeId = 5001; - }) - MenuItem({ content: 'VALUE' }).width('50%').onChange(() => { - this.attributeType = 'VALUE'; - this.attributeTypeId = 5002; - }) - MenuItem({ content: 'UNSELECTED_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'UNSELECTED_COLOR'; - this.attributeTypeId = 5003; - }) - } - } - - @Builder - SubMenu_BUTTON() { - Menu() { - MenuItem({ content: 'LABEL' }).width('50%').onChange(() => { - this.attributeType = 'LABEL'; - this.attributeTypeId = 9000; - }) - MenuItem({ content: 'TYPE' }).width('50%').onChange(() => { - this.attributeType = 'TYPE'; - this.attributeTypeId = 9001; - }) - MenuItem({ content: 'MIN_FONT_SCALE' }).width('50%').onChange(() => { - this.attributeType = 'MIN_FONT_SCALE'; - this.attributeTypeId = 9002; - }) - MenuItem({ content: 'MAX_FONT_SCALE' }).width('50%').onChange(() => { - this.attributeType = 'MAX_FONT_SCALE'; - this.attributeTypeId = 9003; - }) - } - } - - @Builder - SubMenu_CHECKBOX() { - Menu() { - MenuItem({ content: 'SELECT' }).width('50%').onChange(() => { - this.attributeType = 'SELECT'; - this.attributeTypeId = 11000; - }) - MenuItem({ content: 'SELECT_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'SELECT_COLOR'; - this.attributeTypeId = 11001; - }) - MenuItem({ content: 'UNSELECT_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'UNSELECT_COLOR'; - this.attributeTypeId = 11002; - }) - MenuItem({ content: 'MARK' }).width('50%').onChange(() => { - this.attributeType = 'MARK'; - this.attributeTypeId = 11003; - }) - MenuItem({ content: 'SHAPE' }).width('50%').onChange(() => { - this.attributeType = 'SHAPE'; - this.attributeTypeId = 11004; - }) - MenuItem({ content: 'NAME' }).width('50%').onChange(() => { - this.attributeType = 'NAME'; - this.attributeTypeId = 11005; - }) - MenuItem({ content: 'GROUP' }).width('50%').onChange(() => { - this.attributeType = 'GROUP'; - this.attributeTypeId = 11006; - }) - } - } - - @Builder - SubMenu_SLIDER() { - Menu() { - MenuItem({ content: 'BLOCK_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'BLOCK_COLOR'; - this.attributeTypeId = 17000; - }) - MenuItem({ content: 'TRACK_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'TRACK_COLOR'; - this.attributeTypeId = 17001; - }) - MenuItem({ content: 'SELECTED_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'SELECTED_COLOR'; - this.attributeTypeId = 17002; - }) - MenuItem({ content: 'SHOW_STEPS' }).width('50%').onChange(() => { - this.attributeType = 'SHOW_STEPS'; - this.attributeTypeId = 17003; - }) - MenuItem({ content: 'BLOCK_STYLE' }).width('50%').onChange(() => { - this.attributeType = 'BLOCK_STYLE'; - this.attributeTypeId = 17004; - }) - MenuItem({ content: 'VALUE' }).width('50%').onChange(() => { - this.attributeType = 'VALUE'; - this.attributeTypeId = 17005; - }) - MenuItem({ content: 'MIN_VALUE' }).width('50%').onChange(() => { - this.attributeType = 'MIN_VALUE'; - this.attributeTypeId = 17006; - }) - MenuItem({ content: 'MAX_VALUE' }).width('50%').onChange(() => { - this.attributeType = 'MAX_VALUE'; - this.attributeTypeId = 17007; - }) - MenuItem({ content: 'STEP' }).width('50%').onChange(() => { - this.attributeType = 'STEP'; - this.attributeTypeId = 17008; - }) - MenuItem({ content: 'DIRECTION' }).width('50%').onChange(() => { - this.attributeType = 'DIRECTION'; - this.attributeTypeId = 17009; - }) - MenuItem({ content: 'REVERSE' }).width('50%').onChange(() => { - this.attributeType = 'REVERSE'; - this.attributeTypeId = 17010; - }) - MenuItem({ content: 'STYLE' }).width('50%').onChange(() => { - this.attributeType = 'STYLE'; - this.attributeTypeId = 17011; - }) - MenuItem({ content: 'TRACK_THICKNESS' }).width('50%').onChange(() => { - this.attributeType = 'TRACK_THICKNESS'; - this.attributeTypeId = 17012; - }) - MenuItem({ content: 'ENABLE_HAPTIC_FEEDBACK' }).width('50%').onChange(() => { - this.attributeType = 'ENABLE_HAPTIC_FEEDBACK'; - this.attributeTypeId = 17013; - }) - MenuItem({ content: 'PREFIX' }).width('50%').onChange(() => { - this.attributeType = 'PREFIX'; - this.attributeTypeId = 17014; - }) - MenuItem({ content: 'SUFFIX' }).width('50%').onChange(() => { - this.attributeType = 'SUFFIX'; - this.attributeTypeId = 17015; - }) - MenuItem({ content: 'BLOCK_LINEAR_GRADIENT_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'BLOCK_LINEAR_GRADIENT_COLOR'; - this.attributeTypeId = 17016; - }) - MenuItem({ content: 'TRACK_LINEAR_GRADIENT_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'TRACK_LINEAR_GRADIENT_COLOR'; - this.attributeTypeId = 17017; - }) - MenuItem({ content: 'SELECTED_LINEAR_GRADIENT_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'SELECTED_LINEAR_GRADIENT_COLOR'; - this.attributeTypeId = 17018; - }) - } - } - - @Builder - SubMenu_RADIO() { - Menu() { - MenuItem({ content: 'CHECKED' }).width('50%').onChange(() => { - this.attributeType = 'CHECKED'; - this.attributeTypeId = 18000; - }) - MenuItem({ content: 'STYLE' }).width('50%').onChange(() => { - this.attributeType = 'STYLE'; - this.attributeTypeId = 18001; - }) - MenuItem({ content: 'VALUE' }).width('50%').onChange(() => { - this.attributeType = 'VALUE'; - this.attributeTypeId = 18002; - }) - MenuItem({ content: 'GROUP' }).width('50%').onChange(() => { - this.attributeType = 'GROUP'; - this.attributeTypeId = 18003; - }) - } - } - - @Builder - SubMenu_CHECKBOX_GROUP() { - Menu() { - MenuItem({ content: 'NAME' }).width('50%').onChange(() => { - this.attributeType = 'NAME'; - this.attributeTypeId = 21000; - }) - MenuItem({ content: 'SELECT_ALL' }).width('50%').onChange(() => { - this.attributeType = 'SELECT_ALL'; - this.attributeTypeId = 21001; - }) - MenuItem({ content: 'SELECTED_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'SELECTED_COLOR'; - this.attributeTypeId = 21002; - }) - MenuItem({ content: 'UNSELECTED_COLOR' }).width('50%').onChange(() => { - this.attributeType = 'UNSELECTED_COLOR'; - this.attributeTypeId = 21003; - }) - MenuItem({ content: 'MARK' }).width('50%').onChange(() => { - this.attributeType = 'MARK'; - this.attributeTypeId = 21004; - }) - MenuItem({ content: 'SHAPE' }).width('50%').onChange(() => { - this.attributeType = 'SHAPE'; - this.attributeTypeId = 21005; - }) - } - } - - build() { - Column() { - Button($r('app.string.return_node')) - .height('5%') - .width('15%') - .fontSize(15) - .fontColor(Color.Black) - .position({ x: '2%', y: '4%' }) - .backgroundColor(Color.White) - .borderColor(Color.Black) - .borderWidth(3) - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - Text($r('app.string.native_node_example')) - .fontSize(20) - .margin(10) - .fontWeight(FontWeight.Bold) - .height('10%') - Row() { - Button($r('app.string.select_node_type')) - .width('30%') - .margin(10) - .bindMenu(this.SubMenuNodeType) - Button($r('app.string.create')) - .width('25%') - .margin(10) - .onClick(() => { - Napi.removeFormNode(this.nodeId); - this.nodeId = -1; - - this.nodeId = Napi.createFormNode(getNodeType(this.curNodeType), this.nativeCallback); - this.nodeStatus = (this.nodeId == -1) ? FAIL_TAG : SUCC_TAG; - }) - Button($r('app.string.remove')) - .width('25%') - .margin(10) - .onClick(() => { - Napi.removeFormNode(this.nodeId); - this.nodeId = -1; - this.nodeStatus = FAIL_TAG; - }) - } - - Row() { - Text($r('app.string.current_type', `${this.curNodeType}`)) - .style(TextAlign.Start) - .fontSize(10) - .margin(5) - .width('48%') - Text($r('app.string.current_status', `${this.nodeStatus}`)) - .style(TextAlign.Start) - .fontSize(11) - .margin(5) - .width('48%') - } - - Row() { - Button($r('app.string.select_node_attribute')) - .bindMenu(this.SubMenuAttributeType) - .fontSize(10) - .onClick(() => { - this.status = Visibility.Visible - }) - Button($r('app.string.set_attribute_value')) - .alignSelf(ItemAlign.End) - .fontSize(10) - .onClick( - () => { - this.curAttrStatus = -1; - this.curAttrStatus = Napi.setFormAttribute(this.nodeId, getNodeType(this.curNodeType), - this.attributeTypeId, this.attributeValue); - } - ) - Button($r('app.string.get_attribute_value')) - .alignSelf(ItemAlign.End) - .fontSize(10) - .onClick( - () => { - this.resultValue = Napi.getFormAttribute(this.nodeId, getNodeType(this.curNodeType), - this.attributeTypeId); - } - ) - Button($r('app.string.reset_attribute_value')) - .fontSize(11) - .alignSelf(ItemAlign.End) - .onClick(() => { - this.curAttrStatus = -1; - this.curAttrStatus = Napi.resetFormAttribute(this.nodeId, getNodeType(this.curNodeType), - this.attributeTypeId); - }) - } - Row() { - Text($r('app.string.current_attribute_type', `${this.attributeType}`)) - .style(TextAlign.Start) - .fontSize(11) - .margin(5) - .width('95%') - } - Row() { - Text($r('app.string.response', `${this.resultValue}`)) - .style(TextAlign.Start) - .fontSize(11) - .margin(5) - .width('95%') - } - Row() { - Text(`event: ${this.result}`) - .style(TextAlign.Start) - .width('95%') - .fontSize(15) - .margin(5) - } - - Row() { - Text($r('app.string.attribute_value')) - .alignSelf(ItemAlign.Center) - .fontSize(15) - .height(20) - TextInput({ placeholder: $r('app.string.please_input_attribute_value'), text: this.attributeValue }) - .width('85%') - .height(35) - .borderRadius(0) - .onChange((value: string) => { - this.attributeValue = value; - }) - - } - .margin(10) - - Column() { - ContentSlot(this.nodeContent) - } - .alignItems(HorizontalAlign.Center) - .justifyContent(FlexAlign.Center) - .width('95%') - .height('42%') - .margin({ left: 0 }) - .border({ width: 1 }) - .position({x:'3%',y:'58%'}) - } - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_grid.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_grid.ets deleted file mode 100644 index 91c26abb9ae1b8ac294be7b10afca240220e8cb4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_grid.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createGridNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_imagespan.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_imagespan.ets deleted file mode 100644 index 8453ee8c113e198b55e3cbc678ccd14af73890b1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_imagespan.ets +++ /dev/null @@ -1,651 +0,0 @@ -/* - * Copyright (c) 2025 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 napiAgent from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -function getNodeType(type: string) : number { - let ret = -1; - switch (type) { - case 'IMAGE_SPAN': - ret = 3; - break; - case 'IMAGE': - ret = 4; - break; - case 'LOADING_PROGRESS': - ret = 6; - break; - case 'PROGRESS': - ret = 10; - break; - case 'DATE_PICKER': - ret = 13; - break; - case 'TIME_PICKER': - ret = 14; - break; - case 'TEXT_PICKER': - ret = 15; - break; - case 'CALENDAR_PICKER': - ret = 16; - break; - case 'IMAGE_ANIMATOR': - ret = 19; - break; - default: - break; - } - return ret; -} - -const SUCC_TAG = '创建成功'; -const FAIL_TAG = '创建失败'; - -@Extend(Text) -function style(textAlign: TextAlign) { - .textAlign(textAlign) - .fontSize(12) - .border({ width: 1 }) - .padding(10) - .width('100%') -} - -@Entry -@Component -struct Index { - @State status: number = Visibility.Visible; - @State nodeId: number = -1; - @State nodeStatus: string = FAIL_TAG; - @State curNodeType: string = '未设置'; - @State attributeType: string = '未设置'; - @State attributeTypeId: number = -1; - @State attributeValue: string = 'none'; - @State resultValue: string = '-1'; - @State curAttrStatus: number = -1; - private nodeContent = new NodeContent(); - - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - napiAgent.createImageSpanPage(this.nodeContent); - } - - @Builder - SubMenuNodeType() { - Menu() { - MenuItem({ content: 'IMAGE_SPAN' }).width('50%').onChange(()=> { this.curNodeType = 'IMAGE_SPAN'}) - MenuItem({ content: 'IMAGE'}).width('50%').onChange(()=> { this.curNodeType = 'IMAGE' }) - MenuItem({ content: 'LOADING_PROGRESS'}).width('50%').onChange(()=> { this.curNodeType = 'LOADING_PROGRESS' }) - MenuItem({ content: 'PROGRESS'}).width('50%').onChange(()=> { this.curNodeType = 'PROGRESS' }) - MenuItem({ content: 'DATE_PICKER'}).width('50%').onChange(()=> { this.curNodeType = 'DATE_PICKER' }) - MenuItem({ content: 'TIME_PICKER' }).width('50%').onChange(()=> { this.curNodeType = 'TIME_PICKER'}) - MenuItem({ content: 'TEXT_PICKER'}).width('50%').onChange(()=> { this.curNodeType = 'TEXT_PICKER' }) - MenuItem({ content: 'CALENDAR_PICKER'}).width('50%').onChange(()=> { this.curNodeType = 'CALENDAR_PICKER' }) - MenuItem({ content: 'IMAGE_ANIMATOR'}).width('50%').onChange(()=> { this.curNodeType = 'IMAGE_ANIMATOR' }) - } - } - - @Builder - SubMenuAttributeType() { - Menu() { - MenuItem({ content: 'IMAGE_SPAN', builder: ():void=>this.SubMenu_IMAGE_SPAN() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'IMAGE', builder: ():void=>this.SubMenu_IMAGE() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'LOADING_PROGRESS', builder: ():void=>this.SubMenu_LOADING_PROGRESS() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'PROGRESS', builder: ():void=>this.SubMenu_PROGRESS() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'DATE_PICKER', builder: ():void=>this.SubMenu_DATE_PICKER() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'TIME_PICKER', builder: ():void=>this.SubMenu_TIME_PICKER() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'TEXT_PICKER', builder: ():void=>this.SubMenu_TEXT_PICKER() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'CALENDAR_PICKER', builder: ():void=>this.SubMenu_CALENDAR_PICKER() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - MenuItem({ content: 'IMAGE_ANIMATOR', builder: ():void=>this.SubMenu_IMAGE_ANIMATOR() }).width('50%') - .onChange(()=> { this.status = Visibility.None }) - }.visibility(this.status) - } - - @Builder - SubMenu_IMAGE_SPAN() { - Menu() { - MenuItem({ content: 'SRC' }).width('50%').onChange(()=> { - this.attributeType = 'SRC' - this.attributeTypeId = 3000 - }) - MenuItem({ content: 'VERTICAL_ALIGNMENT' }).width('50%').onChange(()=> { - this.attributeType = 'VERTICAL_ALIGNMENT' - this.attributeTypeId = 3001 - }) - MenuItem({ content: 'ALT' }).width('50%').onChange(()=> { - this.attributeType = 'ALT' - this.attributeTypeId = 3002 - }) - MenuItem({ content: 'BASELINE_OFFSET' }).width('50%').onChange(()=> { - this.attributeType = 'BASELINE_OFFSET' - this.attributeTypeId = 3003 - }) - } - } - // add image attributeType - @Builder - SubMenu_IMAGE() { - Menu() { - MenuItem({ content: 'BACKGROUND_IMAGE' }).width('50%').onChange(()=> { - this.attributeType = 'BACKGROUND_IMAGE' - this.attributeTypeId = 3 - }) - MenuItem({ content: 'BACKGROUND_IMAGE_SIZE' }).width('50%').onChange(()=> { - this.attributeType = 'BACKGROUND_IMAGE_SIZE' - this.attributeTypeId = 30 - }) - MenuItem({ content: 'BACKGROUND_IMAGE_SIZE_WITH_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'BACKGROUND_IMAGE_SIZE_WITH_STYLE' - this.attributeTypeId = 31 - }) - MenuItem({ content: 'BACKGROUND_IMAGE_POSITION' }).width('50%').onChange(()=> { - this.attributeType = 'BACKGROUND_IMAGE_POSITION' - this.attributeTypeId = 56 - }) - MenuItem({ content: 'BACKGROUND_IMAGE_RESIZABLE_WITH_SLICE' }).width('50%').onChange(()=> { - this.attributeType = 'BACKGROUND_IMAGE_RESIZABLE_WITH_SLICE' - this.attributeTypeId = 100 - }) - MenuItem({ content: 'SRC' }).width('50%').onChange(()=> { - this.attributeType = 'SRC' - this.attributeTypeId = 4000 - }) - MenuItem({ content: 'OBJECT_FIT' }).width('50%').onChange(()=> { - this.attributeType = 'OBJECT_FIT' - this.attributeTypeId = 4001 - }) - MenuItem({ content: 'INTERPOLATION' }).width('50%').onChange(()=> { - this.attributeType = 'INTERPOLATION' - this.attributeTypeId = 4002 - }) - MenuItem({ content: 'OBJECT_REPEAT' }).width('50%').onChange(()=> { - this.attributeType = 'OBJECT_REPEAT' - this.attributeTypeId = 4003 - }) - MenuItem({ content: 'COLOR_FILTER' }).width('50%').onChange(()=> { - this.attributeType = 'COLOR_FILTER' - this.attributeTypeId = 4004 - }) - MenuItem({ content: 'AUTO_RESIZE' }).width('50%').onChange(()=> { - this.attributeType = 'AUTO_RESIZE' - this.attributeTypeId = 4005 - }) - MenuItem({ content: 'ALT' }).width('50%').onChange(()=> { - this.attributeType = 'ALT' - this.attributeTypeId = 4006 - }) - MenuItem({ content: 'DRAGGABLE' }).width('50%').onChange(()=> { - this.attributeType = 'DRAGGABLE' - this.attributeTypeId = 4007 - }) - MenuItem({ content: 'RENDER_MODE' }).width('50%').onChange(()=> { - this.attributeType = 'RENDER_MODE' - this.attributeTypeId = 4008 - }) - MenuItem({ content: 'FIT_ORIGINAL_SIZE' }).width('50%').onChange(()=> { - this.attributeType = 'FIT_ORIGINAL_SIZE' - this.attributeTypeId = 4009 - }) - MenuItem({ content: 'FILL_COLOR' }).width('50%').onChange(()=> { - this.attributeType = 'FILL_COLOR' - this.attributeTypeId = 4010 - }) - MenuItem({ content: 'RESIZABLE' }).width('50%').onChange(()=> { - this.attributeType = 'RESIZABLE' - this.attributeTypeId = 4011 - }) - MenuItem({ content: 'SYNC_LOAD' }).width('50%').onChange(()=> { - this.attributeType = 'SYNC_LOAD' - this.attributeTypeId = 4012 - }) - MenuItem({ content: 'SOURCE_SIZE' }).width('50%').onChange(()=> { - this.attributeType = 'SOURCE_SIZE' - this.attributeTypeId = 4013 - }) - MenuItem({ content: 'IMAGE_MATRIX' }).width('50%').onChange(()=> { - this.attributeType = 'IMAGE_MATRIX' - this.attributeTypeId = 4014 - }) - MenuItem({ content: 'MATCH_TEXT_DIRECTION' }).width('50%').onChange(()=> { - this.attributeType = 'MATCH_TEXT_DIRECTION' - this.attributeTypeId = 4015 - }) - MenuItem({ content: 'COPY_OPTION' }).width('50%').onChange(()=> { - this.attributeType = 'COPY_OPTION' - this.attributeTypeId = 4016 - }) - MenuItem({ content: 'ENABLE_ANALYZER' }).width('50%').onChange(()=> { - this.attributeType = 'ENABLE_ANALYZER' - this.attributeTypeId = 4017 - }) - MenuItem({ content: 'DYNAMIC_RANGE_MODE' }).width('50%').onChange(()=> { - this.attributeType = 'DYNAMIC_RANGE_MODE' - this.attributeTypeId = 4018 - }) - MenuItem({ content: 'HDR_BRIGHTNESS' }).width('50%').onChange(()=> { - this.attributeType = 'HDR_BRIGHTNESS' - this.attributeTypeId = 4019 - }) - MenuItem({ content: 'ORIENTATION' }).width('50%').onChange(()=> { - this.attributeType = 'ORIENTATION' - this.attributeTypeId = 4020 - }) - } - } - - @Builder - SubMenu_LOADING_PROGRESS() { - Menu() { - MenuItem({ content: 'COLOR' }).width('50%').onChange(()=> { - this.attributeType = 'COLOR' - this.attributeTypeId = 6000 - }) - MenuItem({ content: 'ENABLE_LOADING' }).width('50%').onChange(()=> { - this.attributeType = 'ENABLE_LOADING' - this.attributeTypeId = 6001 - }) - } - } - - @Builder - SubMenu_PROGRESS() { - Menu() { - MenuItem({ content: 'VALUE' }).width('50%').onChange(()=> { - this.attributeType = 'VALUE' - this.attributeTypeId = 10000 - }) - MenuItem({ content: 'TOTAL' }).width('50%').onChange(()=> { - this.attributeType = 'TOTAL' - this.attributeTypeId = 10001 - }) - MenuItem({ content: 'COLOR' }).width('50%').onChange(()=> { - this.attributeType = 'COLOR' - this.attributeTypeId = 10002 - }) - MenuItem({ content: 'TYPE' }).width('50%').onChange(()=> { - this.attributeType = 'TYPE' - this.attributeTypeId = 10003 - }) - MenuItem({ content: 'LINEAR_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'LINEAR_STYLE' - this.attributeTypeId = 10004 - }) - } - } - - @Builder - SubMenu_DATE_PICKER() { - Menu() { - MenuItem({ content: 'LUNAR' }).width('50%').onChange(()=> { - this.attributeType = 'LUNAR' - this.attributeTypeId = 13000 - }) - MenuItem({ content: 'START' }).width('50%').onChange(()=> { - this.attributeType = 'START' - this.attributeTypeId = 13001 - }) - MenuItem({ content: 'END' }).width('50%').onChange(()=> { - this.attributeType = 'END' - this.attributeTypeId = 13002 - }) - MenuItem({ content: 'SELECTED' }).width('50%').onChange(()=> { - this.attributeType = 'SELECTED' - this.attributeTypeId = 13003 - }) - MenuItem({ content: 'DISAPPEAR_TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'DISAPPEAR_TEXT_STYLE' - this.attributeTypeId = 13004 - }) - MenuItem({ content: 'TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'TEXT_STYLE' - this.attributeTypeId = 13005 - }) - MenuItem({ content: 'SELECTED_TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'SELECTED_TEXT_STYLE' - this.attributeTypeId = 13006 - }) - MenuItem({ content: 'MODE' }).width('50%').onChange(()=> { - this.attributeType = 'MODE' - this.attributeTypeId = 13007 - }) - MenuItem({ content: 'ENABLE_HAPTIC_FEEDBACK' }).width('50%').onChange(()=> { - this.attributeType = 'ENABLE_HAPTIC_FEEDBACK' - this.attributeTypeId = 13008 - }) - MenuItem({ content: 'CAN_LOOP' }).width('50%').onChange(()=> { - this.attributeType = 'CAN_LOOP' - this.attributeTypeId = 13009 - }) - } - } - - @Builder - SubMenu_TIME_PICKER() { - Menu() { - MenuItem({ content: 'SELECTED' }).width('50%').onChange(()=> { - this.attributeType = 'SELECTED' - this.attributeTypeId = 14000 - }) - MenuItem({ content: 'USE_MILITARY_TIME' }).width('50%').onChange(()=> { - this.attributeType = 'USE_MILITARY_TIME' - this.attributeTypeId = 14001 - }) - MenuItem({ content: 'DISAPPEAR_TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'DISAPPEAR_TEXT_STYLE' - this.attributeTypeId = 14002 - }) - MenuItem({ content: 'TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'TEXT_STYLE' - this.attributeTypeId = 14003 - }) - MenuItem({ content: 'SELECTED_TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'SELECTED_TEXT_STYLE' - this.attributeTypeId = 14004 - }) - MenuItem({ content: 'START' }).width('50%').onChange(()=> { - this.attributeType = 'START' - this.attributeTypeId = 14005 - }) - MenuItem({ content: 'END' }).width('50%').onChange(()=> { - this.attributeType = 'END' - this.attributeTypeId = 14006 - }) - MenuItem({ content: 'ENABLE_CASCADE' }).width('50%').onChange(()=> { - this.attributeType = 'ENABLE_CASCADE' - this.attributeTypeId = 14007 - }) - } - } - - @Builder - SubMenu_TEXT_PICKER() { - Menu() { - MenuItem({ content: 'OPTION_RANGE' }).width('50%').onChange(()=> { - this.attributeType = 'OPTION_RANGE' - this.attributeTypeId = 15000 - }) - MenuItem({ content: 'OPTION_SELECTED' }).width('50%').onChange(()=> { - this.attributeType = 'OPTION_SELECTED' - this.attributeTypeId = 15001 - }) - MenuItem({ content: 'OPTION_VALUE' }).width('50%').onChange(()=> { - this.attributeType = 'OPTION_VALUE' - this.attributeTypeId = 15002 - }) - MenuItem({ content: 'DISAPPEAR_TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'DISAPPEAR_TEXT_STYLE' - this.attributeTypeId = 15003 - }) - MenuItem({ content: 'TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'TEXT_STYLE' - this.attributeTypeId = 15004 - }) - MenuItem({ content: 'SELECTED_TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'SELECTED_TEXT_STYLE' - this.attributeTypeId = 15005 - }) - MenuItem({ content: 'SELECTED_INDEX' }).width('50%').onChange(()=> { - this.attributeType = 'SELECTED_INDEX' - this.attributeTypeId = 15006 - }) - MenuItem({ content: 'CAN_LOOP' }).width('50%').onChange(()=> { - this.attributeType = 'CAN_LOOP' - this.attributeTypeId = 15007 - }) - MenuItem({ content: 'DEFAULT_PICKER_ITEM_HEIGHT' }).width('50%').onChange(()=> { - this.attributeType = 'DEFAULT_PICKER_ITEM_HEIGHT' - this.attributeTypeId = 15008 - }) - MenuItem({ content: 'COLUMN_WIDTHS' }).width('50%').onChange(()=> { - this.attributeType = 'COLUMN_WIDTHS' - this.attributeTypeId = 15009 - }) - MenuItem({ content: 'ENABLE_HAPTIC_FEEDBACK' }).width('50%').onChange(()=> { - this.attributeType = 'ENABLE_HAPTIC_FEEDBACK' - this.attributeTypeId = 15010 - }) - MenuItem({ content: 'SELECTED_BACKGROUND_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'SELECTED_BACKGROUND_STYLE' - this.attributeTypeId = 15011 - }) - } - } - - @Builder - SubMenu_CALENDAR_PICKER() { - Menu() { - MenuItem({ content: 'HINT_RADIUS' }).width('50%').onChange(()=> { - this.attributeType = 'HINT_RADIUS' - this.attributeTypeId = 16000 - }) - MenuItem({ content: 'SELECTED_DATE' }).width('50%').onChange(()=> { - this.attributeType = 'SELECTED_DATE' - this.attributeTypeId = 16001 - }) - MenuItem({ content: 'EDGE_ALIGNMENT' }).width('50%').onChange(()=> { - this.attributeType = 'EDGE_ALIGNMENT' - this.attributeTypeId = 16002 - }) - MenuItem({ content: 'TEXT_STYLE' }).width('50%').onChange(()=> { - this.attributeType = 'TEXT_STYLE' - this.attributeTypeId = 16003 - }) - MenuItem({ content: 'START' }).width('50%').onChange(()=> { - this.attributeType = 'START' - this.attributeTypeId = 16004 - }) - MenuItem({ content: 'END' }).width('50%').onChange(()=> { - this.attributeType = 'END' - this.attributeTypeId = 16005 - }) - MenuItem({ content: 'DISABLED_DATE_RANGE' }).width('50%').onChange(()=> { - this.attributeType = 'DISABLED_DATE_RANGE' - this.attributeTypeId = 16006 - }) - MenuItem({ content: 'MARK_TODAY' }).width('50%').onChange(()=> { - this.attributeType = 'MARK_TODAY' - this.attributeTypeId = 16007 - }) - } - } - - @Builder - SubMenu_IMAGE_ANIMATOR() { - Menu() { - MenuItem({ content: 'IMAGES' }).width('50%').onChange(()=> { - this.attributeType = 'IMAGES' - this.attributeTypeId = 19000 - }) - MenuItem({ content: 'STATE' }).width('50%').onChange(()=> { - this.attributeType = 'STATE' - this.attributeTypeId = 19001 - }) - MenuItem({ content: 'DURATION' }).width('50%').onChange(()=> { - this.attributeType = 'DURATION' - this.attributeTypeId = 19002 - }) - MenuItem({ content: 'REVERSE' }).width('50%').onChange(()=> { - this.attributeType = 'REVERSE' - this.attributeTypeId = 19003 - }) - MenuItem({ content: 'FIXED_SIZE' }).width('50%').onChange(()=> { - this.attributeType = 'FIXED_SIZE' - this.attributeTypeId = 19004 - }) - MenuItem({ content: 'FILL_MODE' }).width('50%').onChange(()=> { - this.attributeType = 'FILL_MODE' - this.attributeTypeId = 19005 - }) - MenuItem({ content: 'ITERATION' }).width('50%').onChange(()=> { - this.attributeType = 'ITERATION' - this.attributeTypeId = 19006 - }) - } - } - - - build() { - Column() { - Button($r('app.string.return_node')) - .height('5%') - .width('15%') - .fontSize(15) - .fontColor(Color.Black) - .position({ x: '2%', y: '4%' }) - .backgroundColor(Color.White) - .borderColor(Color.Black) - .borderWidth(3) - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - Text($r('app.string.native_node_example')) - .fontSize(20) - .margin(10) - .fontWeight(FontWeight.Bold) - .height('10%') - - Row() { - Button($r('app.string.select_node_type')) - .width('30%') - .margin(10) - .bindMenu(this.SubMenuNodeType) - Button($r('app.string.create')) - .width('25%') - .margin(10) - .onClick(() => { - // 先将之前创建的节点清理 - napiAgent.removeImageSpanNode(this.nodeId); - this.nodeId = -1; - // 创建新节点 - this.nodeId = napiAgent.createImageSpanNode(getNodeType(this.curNodeType)) - this.nodeStatus = (this.nodeId == -1) ? FAIL_TAG : SUCC_TAG; - }) - Button($r('app.string.remove')) - .width('25%') - .margin(10) - .onClick(() => { - napiAgent.removeImageSpanNode(this.nodeId); - this.nodeId = -1; - this.nodeStatus = FAIL_TAG; - }) - } - - Row() { - Text($r('app.string.current_type', `${this.curNodeType}`)) - .style(TextAlign.Start) - .width('46%') - .fontSize(10) - .margin(5) - Text($r('app.string.current_status', `${this.nodeStatus}`)) - .style(TextAlign.Start) - .width('46%') - .fontSize(11) - .margin(5) - } - - Row() { - Button($r('app.string.select_node_attribute')) - .bindMenu(this.SubMenuAttributeType) - .fontSize(10) - .onClick(() => { - this.status = Visibility.Visible - }) - Button($r('app.string.set_attribute_value')) - .alignSelf(ItemAlign.End) - .fontSize(10) - .onClick( - () => { - this.curAttrStatus = -1; - this.curAttrStatus = napiAgent.setImageSpanAttribute(this.nodeId, getNodeType(this.curNodeType), - this.attributeTypeId, this.attributeValue); - console.log('-----setNativeNodeAttribute,attributeTypeId:' + this.attributeTypeId + - ' ,curAttrStatus:' + this.curAttrStatus); - } - ) - Button($r('app.string.get_attribute_value')) - .alignSelf(ItemAlign.End) - .fontSize(10) - .onClick( - () => { - this.resultValue = napiAgent.getImageSpanAttribute(this.nodeId, getNodeType(this.curNodeType), - this.attributeTypeId); - console.log('-----getNativeNodeAttribute,attributeTypeId:' + this.attributeTypeId + - ' ,attributeValue:' + this.resultValue); - } - ) - Button($r('app.string.reset_attribute_value')) - .fontSize(10) - .alignSelf(ItemAlign.End) - .onClick(() => { - // 重置新节点 - this.curAttrStatus = napiAgent.resetImageSpanAttribute(this.nodeId, getNodeType(this.curNodeType), - this.attributeTypeId) - }) - } - - Row() { - Text($r('app.string.current_attribute_type', `${this.attributeType}`)) - .style(TextAlign.Start) - .fontSize(11) - .margin(5) - .width('93%') - } - - Row() { - Text($r('app.string.response', `${this.resultValue}`)) - .style(TextAlign.Start) - .fontSize(11) - .margin(5) - .width('93%') - } - - Row() { - Text($r('app.string.attribute_value')) - .alignSelf(ItemAlign.Center) - .fontSize(15) - .height(20) - TextInput({ placeholder: $r('app.string.please_input_attribute_value'), text: this.attributeValue }) - .width('85%') - .height(35) - .borderRadius(0) - .onChange((value: string) => { - this.attributeValue = value; - }) - } - .margin(10) - - - // 组件显示在界面下半部分 - Column() { - ContentSlot(this.nodeContent) - } - .alignItems(HorizontalAlign.Center) - .justifyContent(FlexAlign.Center) - .width('92%') - .height('45%') - .margin({ left: 0 }) - .border({ width: 1 }) - .position({ x: '2%', y: '53%' }) - } - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_list.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_list.ets deleted file mode 100644 index 52a9dc01c451fae835a75bafb8b092635071db18..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_list.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createListNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_public_event.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_public_event.ets deleted file mode 100644 index 4613bbd853a38faa3e278b949ddf4c4f39e2bee4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_public_event.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct PublicComponent { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.CreatePublicNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_refresh.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_refresh.ets deleted file mode 100644 index 73f028421fae3cd3b811dfb8e49884da9ae12ed6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_refresh.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createRefreshNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_scroll.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_scroll.ets deleted file mode 100644 index fe8e5a35cabbab5092aeabafd8e71e945117b8b5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_scroll.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createScrollNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_swiper.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_swiper.ets deleted file mode 100644 index 16941e60aab559b9fc82d30bc620ed18056fb112..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_swiper.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createSwiperNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_text.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_text.ets deleted file mode 100644 index f56f9e8c740a488cefdb25ee8b457c1cf12386a7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_text.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createNativeTextNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_waterflow.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_waterflow.ets deleted file mode 100644 index 8cc63eea5f9e166d4ff9b9e1f593db458306aeb2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_waterflow.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createWaterFlowNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_xcomponent.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_xcomponent.ets deleted file mode 100644 index c200e5a4c3681e88273d46b3bf184619d40ceb72..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/ets/pages/page_xcomponent.ets +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so'; -import { NodeContent } from '@ohos.arkui.node'; - -class Params { - public insert: boolean = false - public nodeContent: NodeContent; - - constructor(insert: boolean, nodeContent: NodeContent) { - this.insert = insert; - this.nodeContent = nodeContent; - } -} - -class MyNodeContent extends NodeContent { - onAttachToWindow(): void { - // TODO - } - - onDetachFromWindow(): void { - // TODO - } - - constructor() { - super() - } -} - -@Builder -function buildNodeContent(params: Params) { - ContentSlot(params.insert ? params.nodeContent : undefined) -} - -@Entry -@Component -struct Parent { - @State insert: boolean = true - public nodeContent = new MyNodeContent() - public nodeContent2 = new MyNodeContent() - @State xcWidth: number = 200 - aboutToAppear(): void { - nativeNode.createNativeNodexc(this.nodeContent, 'nodeContent1234'); - } - - build() { - - Row() { - Column() { - buildNodeContent(new Params(this.insert, this.nodeContent)) - } - .width(this.xcWidth) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/module.json5 b/ArkUIKit/NativeNodeBaseSample/entry/src/main/module.json5 deleted file mode 100644 index c5be971e98a651c460b6e756939f1f5a6572f0c3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/module.json5 +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2025 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" - } - ] - }, - { - "name": "SampleEmbeddedAbility", - "srcEntry": "./ets/extensionAbility/SampleEmbeddedAbility.ets", - "type": "embeddedUI" - } - ] - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/element/color.json b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index e14ec8929bece8fe009d91f1145ec962c16661ab..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "background_color", - "value": "#2AA1A6B1" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/element/float.json b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/element/string.json b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 6f94bec7d8a91fab058e64458d6aa3f069774d63..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "native_node_sample" - }, - { - "name": "create_success", - "value": "创建成功" - }, - { - "name": "create_failed", - "value": "创建失败" - }, - { - "name": "not_set", - "value": "未设置" - }, - { - "name": "native_node_example", - "value": "native_node功能示例" - }, - { - "name": "select_node_type", - "value": "选择节点类型" - }, - { - "name": "current_type", - "value": "当前类型: %s" - }, - { - "name": "current_status", - "value": "当前状态: %s" - }, - { - "name": "create", - "value": "创建" - }, - { - "name": "remove", - "value": "清理" - }, - { - "name": "select_node_attribute", - "value": "选择节点属性" - }, - { - "name": "current_attribute_type", - "value": "当前属性类型: %s" - }, - { - "name": "response", - "value": "返回值: %s" - }, - { - "name": "return_error_num", - "value": "返回错误码: %s" - }, - { - "name": "attribute_value", - "value": "属性值" - }, - { - "name": "please_input_attribute_value", - "value": "请输入属性值" - }, - { - "name": "set_attribute_value", - "value": "设置属性值" - }, - { - "name": "get_attribute_value", - "value": "获取属性值" - }, - { - "name": "reset_attribute_value", - "value": "重置属性值" - }, - { - "name": "return_node", - "value": "<-" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/background.png b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/startIcon2.png b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/startIcon2.png deleted file mode 100755 index d8d9d2c68bf090ba22e756bdfc3e6aada18151e1..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/media/startIcon2.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index f465f6cd4140f009d7846aef118fc7ff5e3e6ca9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/page_text", - "pages/page_swiper", - "pages/page_accessibility", - "pages/page_embedded_component", - "pages/page_waterflow", - "pages/page_grid", - "pages/page_scroll", - "pages/page_refresh", - "pages/page_xcomponent", - "pages/page_list", - "pages/page_form", - "pages/page_public_event", - "pages/page_imagespan" - ] -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/dark/element/color.json b/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index bd7fc7c773d766afaad54f86caede9361e448455..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - }, - { - "name": "background_color", - "value": "#2AA1A6B1" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 3c81579a25ae2430d5c8050c62a1fc14a7b0cf62..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index f1d6ec3d9a449b07054ba43d6335265fcf51b019..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import PublicTest from './Public.test'; - -export default function testsuite() { - abilityTest(); - PublicTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/ets/test/Public.test.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/ets/test/Public.test.ets deleted file mode 100644 index 4c4f44e474b63d6e6714fdd012415c034f27c8ec..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/ets/test/Public.test.ets +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; -import { abilityDelegatorRegistry, BY, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -export default function PublicTest() { - describe('PublicTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - beforeEach(async () => { - let driver = Driver.create(); - await driver.delayMs(1000); - }) - - afterEach(() => { - hilog.info(0x0000, 'PublicTest', 'Public event test case completed'); - }) - - afterAll(() => { - hilog.info(0x0000, 'PublicTest', 'All publicTest event tests completed'); - }) - - /** - * @tc.number PublicTest_001 - * @tc.name testPublicBackground - * @tc.desc 测试背景色属性设置 - 打开Public界面,查看设置的Row组件背景色属性 - */ - it('testPublicBackground', 0, async (done: Function) => { - hilog.info(0x0000, 'PublicTest', 'testPublicBackground begin'); - let driver = Driver.create(); - await driver.delayMs(1000); - - try { - // 点击Public进入通用属性界面 - const button1 = await driver.findComponent(ON.id('Public')); - await button1.click(); - await driver.delayMs(1000); - - // 验证backgroundColumn设置的背景色 - let strJson = getInspectorByKey('backgroundColumn'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'PublicTest', 'backgroundColumn backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FF009A61'); - } catch (error) { - hilog.error(0x0000, 'PublicTest', 'testPublicBackground failed: %{public}s', error.message); - } - - hilog.info(0x0000, 'PublicTest', 'testPublicBackground end'); - done(); - }) - - /** - * @tc.number PublicTest_002 - * @tc.name testPublicEnabled - * @tc.desc 测试Enabled属性设置 - 打开Public界面,查看设置的Button组件Enabled属性 - */ - it('testPublicEnabled', 0, async (done: Function) => { - hilog.info(0x0000, 'PublicTest', 'testPublicEnabled begin'); - let driver = Driver.create(); - await driver.delayMs(1000); - - try { - // 点击Public进入通用属性界面 - const button1 = await driver.findComponent(ON.id('Public')); - await button1.click(); - await driver.delayMs(1000); - - // 验证enabledButton设置的Enabled属性 - let strJson = getInspectorByKey('enabledButton'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'PublicTest', 'enabledButton enabled: %{public}s', obj.$attrs.enabled); - expect(obj.$attrs.enabled).assertEqual(false); - - // 验证backgroundColumn设置的背景色 - let strJson1 = getInspectorByKey('notEnabledButton'); - let obj1: ESObject = JSON.parse(strJson1); - hilog.info(0x0000, 'PublicTest', 'notEnabledButton enabled: %{public}s', obj1.$attrs.enabled); - expect(obj1.$attrs.enabled).assertEqual(true); - - } catch (error) { - hilog.error(0x0000, 'PublicTest', 'testPublicEnabled failed: %{public}s', error.message); - } - - hilog.info(0x0000, 'PublicTest', 'testPublicEnabled end'); - done(); - }) - - /** - * @tc.number PublicTest_003 - * @tc.name testPublicZIndex - * @tc.desc 测试zIndex属性设置 - 打开Public界面,查看设置的Button组件zIndex属性 - */ - it('testPublicZIndex', 0, async (done: Function) => { - hilog.info(0x0000, 'PublicTest', 'testPublicZIndex begin'); - let driver = Driver.create(); - await driver.delayMs(1000); - - try { - // 点击Public进入通用属性界面 - const button1 = await driver.findComponent(ON.id('Public')); - await button1.click(); - await driver.delayMs(1000); - - // 滑动到测试区域 - const scroll = await driver.findComponent(ON.id('testScroll')); - await scroll.scrollSearch(ON.id('zIndexText3')); - await driver.delayMs(500); - - // 验证enabledButton获得设置的enabled的值 - let strJson = getInspectorByKey('zIndexText3'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'PublicTest', 'zIndexText3 zIndex: %{public}s', obj.$attrs.zIndex); - expect(obj.$attrs.zIndex).assertEqual(0); - - let strJson1 = getInspectorByKey('zIndexText2'); - let obj1: ESObject = JSON.parse(strJson1); - hilog.info(0x0000, 'PublicTest', 'zIndexText2 zIndex: %{public}s', obj1.$attrs.zIndex); - expect(obj1.$attrs.zIndex).assertEqual(1); - - let strJson2 = getInspectorByKey('zIndexText1'); - let obj2: ESObject = JSON.parse(strJson2); - hilog.info(0x0000, 'PublicTest', 'zIndexText1 zIndex: %{public}s', obj2.$attrs.zIndex); - expect(obj2.$attrs.zIndex).assertEqual(2); - - } catch (error) { - hilog.error(0x0000, 'PublicTest', 'testPublicZIndex failed: %{public}s', error.message); - } - - hilog.info(0x0000, 'PublicTest', 'testPublicZIndex end'); - done(); - }) - - /** - * @tc.number PublicTest_004 - * @tc.name testPublicVisibility - * @tc.desc 测试visibility属性设置 - 打开Public界面,查看设置的Row组件visibility属性 - */ - it('testPublicVisibility', 0, async (done: Function) => { - hilog.info(0x0000, 'PublicTest', 'testPublicVisibility begin'); - let driver = Driver.create(); - await driver.delayMs(1000); - - try { - // 点击Public进入通用属性界面 - const button1 = await driver.findComponent(ON.id('Public')); - await button1.click(); - await driver.delayMs(1000); - - // 验证visibilityRow获得设置的visibility的值 - let strJson2 = getInspectorByKey('visibilityRow3'); - let obj2: ESObject = JSON.parse(strJson2); - hilog.info(0x0000, 'PublicTest', ' visibilityRow3: %{public}s', obj2.$attrs.visibility); - expect(obj2.$attrs.visibility).assertEqual('Visibility.Visible'); - - } catch (error) { - hilog.error(0x0000, 'PublicTest', 'testPublicVisibility failed: %{public}s', error.message); - } - hilog.info(0x0000, 'PublicTest', 'testPublicVisibility end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/module.json5 b/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 321c0b4e60f2f4e74219cfac290052130539b178..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/test/List.test.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/test/List.test.ets deleted file mode 100644 index 74ba3a099410b447742c4a6ecac5c511bb63e5e7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NativeNodeBaseSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index b367c75db8ae9ad0864a7c14f9bf2ce8c2b5e021..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/hvigor/hvigor-config.json5 b/ArkUIKit/NativeNodeBaseSample/hvigor/hvigor-config.json5 deleted file mode 100644 index c46181e346e0b1a9f966305a9164616bd2db470e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "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/ArkUIKit/NativeNodeBaseSample/hvigorfile.ts b/ArkUIKit/NativeNodeBaseSample/hvigorfile.ts deleted file mode 100644 index de06c780c9687a49f0161e161816f18af7354ff0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/oh-package.json5 b/ArkUIKit/NativeNodeBaseSample/oh-package.json5 deleted file mode 100644 index 346d7e239ade076f95cbba216cbc69f1bec6207c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/NativeNodeBaseSample/ohosTest.md b/ArkUIKit/NativeNodeBaseSample/ohosTest.md deleted file mode 100644 index 82d22ef246408d565ff8f6ef18994131fd34c8a8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/ohosTest.md +++ /dev/null @@ -1,50 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期显示 | 是否自动 | 测试结果 | -| ------------------------------ | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | -------- | -| 启动应用 | 设备正常运行 | 1.开启开发板
2.编译hap包并将hap包及环境烧录进开发板,运行测试用例
| 成功拉起应用。 | 否 | 验证通过 | -| 文本组件及输入框功能展示 | 应用位于首页 | 1.text仅观察以及读取log 2.textinput、textarea均需要点击,输入,回车,撤销,粘贴等操作以及查看log信息 | 1. 页面展示多个文本、输入框及文本域组件2. 各组件样式符合代码配置,输入框可正常输入 | 否 | 验证通过 | -| Swiper设置自定义箭头功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第一个Swiper左右两侧各有一个圆形的淡灰色的箭头,Swiper内容为“0” | 否 | 验证通过 | -| Swiper设置自定义导航点功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第二个Swiper左上角有一个被选中为红色未被选中为灰色的导航栏,Swiper内容为“0” | 否 | 验证通过 | -| Swiper设置自定义数字导航栏功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第三个Swiper左上角显示数字导航栏,左侧数字为1/14,其中数字1为红色,14为灰色,Swiper内容为“0” | 否 | 验证通过 | -| Swiper设置常用属性以及事件功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第四个Swiper左上角显示数字导航栏,每隔3秒自动滚动并触发滚动事件
2.获取到以A0ff00/Manager为tag的相关日志 | 否 | 验证通过 | -| 验证XComponent创建成功 | 应用位于首页 | 1.点击首页XComponent按钮 | 1.包含两个XComponent显示框 | 否 | 验证通过 | -| 通用属性给组件设置背景色功能 | 应用位于首页 | 1.点击首页Public按钮 | 1.设置了背景色的组件
2.获取到设置的背景色参数 | 是 | 验证通过 | -| 通用属性给组件设置enabled功能 | 应用位于首页 | 1.点击首页Public按钮 | 1.第二个Column组件中两个Button,其中一个设置了enabled为true,另一个设置为false
2.获取到设置的enabled属性参数 | 是 | 验证通过 | -| 通用属性给组件设置zIndex功能 | 应用位于首页 | 1.点击首页Public按钮 | 1.第三个Column组件中三个Text,分别设置了不同的zIndex属性的值
2.获取到设置的zIndex的值 | 是 | 验证通过 | -| 验证Toggle创建成功 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Toggle
3.点击创建按钮
| 1.显示一个Toggle组件 | 否 | 验证通过 | -| Toggle设置自定义背景色功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Toggle
3.点击创建按钮
4.选择节点属性中的背景样式
5.点击设置属性值按钮
6.点击Toggle组件 | 1.组件背景色显示为红色 | 否 | 验证通过 | -| Toggle设置滑块背景色功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Toggle
3.点击创建按钮
4.选择节点属性中的选中样式
5.点击设置属性值按钮 | 1.组件滑块背景色显示为红色 | 否 | 验证通过 | -| Toggle设置开关状态功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Toggle
3.点击创建按钮
4.选择节点属性中的值设置
5.输入框设置值为1
6.点击设置属性值按钮 | 1.组件显示为选中状态 | 否 | 验证通过 | -| 验证Button创建成功 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Button
3.点击创建按钮
4.选择节点属性中的文本设置
5.点击设置属性值按钮 | 1.显示一个Button组件 | 否 | 验证通过 | -| Button设置自定义文本功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Button
3.点击创建按钮
4.选择节点属性中的文本设置
5.点击设置属性值按钮 | 1.组件文本显示为“Button” | 否 | 验证通过 | -| Button设置自定义组件样式功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Button
3.点击创建按钮
4.选择节点属性中的文本设置
5.点击设置属性值按钮
6.选择节点属性中的类型设置
7.输入框设置值为1
8.点击设置属性值按钮 | 1.组件样式显示为圆形 | 否 | 验证通过 | -| 验证CheckBox创建成功 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为CheckBox
3.点击创建按钮
| 1.显示一个CheckBox组件 | 否 | 验证通过 | -| CheckBox设置选中状态功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为CheckBox
3.点击创建按钮
4.选择节点属性中的选中设置
5.输入框设置值为1
6.点击设置属性值按钮 | 1.组件显示为选中状态 | 否 | 验证通过 | -| CheckBox设置自定义背景色功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为CheckBox
3.点击创建按钮
4.选择节点属性中的选中背景样式
5.点击设置属性值按钮
6.点击Togger组件 | 1.组件背景色显示为白色 | 否 | 验证通过 | -| CheckBox设置边框背景色功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为CheckBox
3.点击创建按钮
4.选择节点属性中的边框背景样式
5.点击设置属性值按钮 | 1.组件边框背景色显示为白色 | 否 | 验证通过 | -| CheckBox设置组件样式功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为CheckBox
3.点击创建按钮
4.选择节点属性中的shape样式
5.点击设置属性值按钮 | 1.组件样式显示为圆形 | 否 | 验证通过 | -| 验证Slider创建成功 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Slider
3.点击创建按钮
| 1.显示一个Slider组件 | 否 | 验证通过 | -| Slider设置滑块背景色功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Slider
3.点击创建按钮
4.选择节点属性中的block背景色样式
5.点击设置属性值按钮 | 1.组件滑块显示为红色 | 否 | 验证通过 | -| Slider设置滑轨背景色功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Slider
3.点击创建按钮
4.选择节点属性中的track背景色样式
5.点击设置属性值按钮 | 1.组件滑轨显示为红色 | 否 | 验证通过 | -| Slider设置滑轨已滑动背景色功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Slider
3.点击创建按钮
4.选择节点属性中的select背景色样式
5.点击设置属性值按钮 | 1.组件滑轨显示为黄色 | 否 | 验证通过 | -| Slider设置显示刻度值功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Slider
3.点击创建按钮
4.选择节点属性中的step样式
5.输入框设置值为1
6.点击设置属性值按钮 | 1.组件刻度值为显示状态 | 否 | 验证通过 | -| Slider设置滑动布局功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Slider
3.点击创建按钮
4.选择节点属性中的direction样式
5.输入框设置值为2
6.点击设置属性值按钮 | 1.组件布局为上下滑动布局 | 否 | 验证通过 | -| Slider设置值方向是否取反功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Slider
3.点击创建按钮
4.选择节点属性中的reverse样式
5.输入框设置值为1
6.点击设置属性值按钮 | 1.组件显示值方向取反 | 否 | 验证通过 | -| Slider设置滑块与滑轨相对布局功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Slider
3.点击创建按钮
4.选择节点属性中的style样式
5.输入框设置值为1
6.点击设置属性值按钮 | 1.组件滑块显示在滑轨内部 | 否 | 验证通过 | -| Slider设置滑轨样式功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Slider
3.点击创建按钮
4.选择节点属性中的track thickness样式
5.输入框设置值为20
6.点击设置属性值按钮 | 1.组件滑轨粗细显示为20 | 否 | 验证通过 | -| 验证Radio创建成功 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Radio
3.点击创建按钮
| 1.显示一个Radio组件 | 否 | 验证通过 | -| Radio设置选中状态功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Radio
3.点击创建按钮
4.选择节点属性中的checked样式
5.输入框设置值为1
6.点击设置属性值按钮 | 1.组件显示为选中状态 | 否 | 验证通过 | -| Radio设置组件背景色功能 | 应用位于首页 | 1.点击首页Form表单类按钮
2.选择节点类型为Radio
3.点击创建按钮
4.选择节点属性中的style样式
5.点击设置属性值按钮 | 1.组件背景色显示为红色 | 否 | 验证通过 | -| ImageSpan设置属性功能 | 应用位于首页 | 1.点击首页信息选择图片类按钮
2.点击"选择节点类型"按钮选择"IMAGE_SPAN"组件,点击下方"创建"按钮进行节点创建
3.点击右边"选择节点属性"选择类型"IMAGE_SPAN"
4.再选择要设置的属性类型,点击"设置属性值"按钮进行属性设置
5.点击"获取属性值"按钮获取属性值 | 1.属性"SRC"设置后组件能正常显示
2.其他属性设置后属性值能正常获取 | 否 | 验证通过 | -| Image设置属性功能 | 应用位于首页 | 1.点击首页信息选择图片类按钮
2.点击"选择节点类型"按钮选择"IMAGE"组件,点击下方"创建"按钮进行节点创建
3.点击右边"选择节点属性"选择类型"IMAGE"
4.再选择要设置的属性类型,点击"设置属性值"按钮进行属性设置
5.点击"获取属性值"按钮获取属性值 | 1.属性"SRC"、"BACKGROUND_IMAGE"设置后组件能正常显示
2.其他属性设置后属性值能正常获取 | 否 | 验证通过 | -| LoadingProgress设置属性功能 | 应用位于首页 | 1.点击首页信息选择图片类按钮
2.点击"选择节点类型"按钮选择"LOADING_PROGRESS"组件,点击下方"创建"按钮进行节点创建
3.点击右边"选择节点属性"选择类型"LOADING_PROGRESS"
4.再选择要设置的属性类型,点击"设置属性值"按钮进行属性设置
5.点击"获取属性值"按钮获取属性值 | 1.属性"COLOR"设置后组件颜色有变化
2.其他属性设置后属性值能正常获取 | 否 | 验证通过 | -| Progress设置属性功能 | 应用位于首页 | 1.点击首页信息选择图片类按钮
2.点击"选择节点类型"按钮选择"PROGRESS"组件,点击下方"创建"按钮进行节点创建
3.点击右边"选择节点属性"选择类型"PROGRESS"
4.再选择要设置的属性类型,点击"设置属性值"按钮进行属性设置
5.点击"获取属性值"按钮获取属性值 | 1.组件正常显示
2.其他属性设置后属性值能正常获取 | 否 | 验证通过 | -| DatePicker设置属性功能 | 应用位于首页 | 1.点击首页信息选择图片类按钮
2.点击"选择节点类型"按钮选择"DATE_PICKER"组件,点击下方"创建"按钮进行节点创建
3.点击右边"选择节点属性"选择类型"DATE_PICKER"
4.再选择要设置的属性类型,点击"设置属性值"按钮进行属性设置
5.点击"获取属性值"按钮获取属性值 | 1.属性"TEXT_STYLE"、"MODE"设置后显示有变化
2.其他属性设置后属性值能正常获取 | 否 | 验证通过 | -| TimePicker设置属性功能 | 应用位于首页 | 1.点击首页信息选择图片类按钮
2.点击"选择节点类型"按钮选择"TIME_PICKER"组件,点击下方"创建"按钮进行节点创建
3.点击右边"选择节点属性"选择类型"TIME_PICKER"
4.再选择要设置的属性类型,点击"设置属性值"按钮进行属性设置
5.点击"获取属性值"按钮获取属性值 | 1.属性"TEXT_STYLE"设置后显示有变化
2.其他属性设置后属性值能正常获取 | 否 | 验证通过 | -| TextPicker设置属性功能 | 应用位于首页 | 1.点击首页信息选择图片类按钮
2.点击"选择节点类型"按钮选择"TEXT_PICKER"组件,点击下方"创建"按钮进行节点创建
3.点击右边"选择节点属性"选择类型"TEXT_PICKER"
4.再选择要设置的属性类型,点击"设置属性值"按钮进行属性设置
5.点击"获取属性值"按钮获取属性值 | 1.属性"OPTION_RANGE"设置后组件能正常显示
2.其他属性设置后属性值能正常获取 | 否 | 验证通过 | -| CalenderPicker设置属性功能 | 应用位于首页 | 1.点击首页信息选择图片类按钮
2.点击"选择节点类型"按钮选择"CALENDAR_PICKER"组件,点击下方"创建"按钮进行节点创建
3.点击右边"选择节点属性"选择类型"CALENDAR_PICKER"
4.再选择要设置的属性类型,点击"设置属性值"按钮进行属性设置
5.点击"获取属性值"按钮获取属性值 | 1.属性"TEXT_STYLE"、"SELECTED_DATE"设置后显示有变化
2.其他属性设置后属性值能正常获取 | 否 | 验证通过 | -| ImageAnimator设置属性功能 | 应用位于首页 | 1.点击首页信息选择图片类按钮
2.点击"选择节点类型"按钮选择"IMAGE_ANIMATOR"组件,点击下方"创建"按钮进行节点创建
3.点击右边"选择节点属性"选择类型"IMAGE_ANIMATOR"
4.再选择要设置的属性类型,点击"设置属性值"按钮进行属性设置
5.点击"获取属性值"按钮获取属性值 | 1.属性"SRC"设置后组件能正常显示
2.其他属性设置后属性值能正常获取 | 否 | 验证通过 | -| <- 按钮 | 应用位于首页 | 1.点击首页Form表单类按钮
2.点击<-按钮 | 返回上一层 | 否 | 验证通过 | \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/form.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/form.jpeg deleted file mode 100644 index 3381fc994fd2c2e43c49ea923a35de59e4740165..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/form.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/grid.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/grid.jpeg deleted file mode 100644 index d5562b6fd02e0953f2093293b0c770404cfc5527..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/grid.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/image_span.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/image_span.jpeg deleted file mode 100644 index 03b2e0e10a28aaf68de4c86325f6791571778193..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/image_span.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/index.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/index.jpeg deleted file mode 100644 index 8b6ab4272d0500d1575740e15dbec15ddc6665a1..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/index.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/list.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/list.jpeg deleted file mode 100644 index 7b7b4b1ed63dfb2250ab1ffeb2f0609da40b2c82..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/list.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/native-node-public.jpg b/ArkUIKit/NativeNodeBaseSample/screenshot/native-node-public.jpg deleted file mode 100644 index 26f694972b0f5e8eea79576993c6e8155e4852d4..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/native-node-public.jpg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/page_swiper.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/page_swiper.jpeg deleted file mode 100644 index 714a9b9b5aa1fc5dc638805d0ba595236aec0429..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/page_swiper.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/refresh.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/refresh.jpeg deleted file mode 100644 index 4fe0dbe100f6b7b76bb05d7a6c25db3da8a2d912..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/refresh.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/scroll.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/scroll.jpeg deleted file mode 100644 index 8858d01b732dddac05656af1604f5e48159b8344..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/scroll.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/swiper.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/swiper.jpeg deleted file mode 100644 index cacae7c84e538588e063dec92dc3c6292498591b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/swiper.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/text.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/text.jpeg deleted file mode 100644 index ed2680839f5cb9e5cc3a9b2a286b98219a3ae16c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/text.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/waterflow.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/waterflow.jpeg deleted file mode 100644 index e9d2573e3aa0cb366fdc772929134ca3d67ca13e..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/waterflow.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/xcomponent.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/xcomponent.jpeg deleted file mode 100644 index d978765443247c3f1ef874786cf24fb8354054ec..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/xcomponent.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeNapiSample/.gitignore b/ArkUIKit/NativeNodeNapiSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NativeNodeNapiSample/AppScope/app.json5 b/ArkUIKit/NativeNodeNapiSample/AppScope/app.json5 deleted file mode 100644 index bdf31a37e01ac463ba1438372cb142f729a5915b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.native_node_napi", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/element/string.json b/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 9e206b8fdfe2a67f400fc8016966544b37f1dde0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "native_node_napi" - } - ] -} diff --git a/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/media/background.png b/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/media/foreground.png b/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/media/layered_image.json b/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/README.md b/ArkUIKit/NativeNodeNapiSample/README.md deleted file mode 100644 index cbac77b7bac42ce90fc9747c798622c4503ab9f4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# Native_node_napi - -## 介绍 - -本示例基于[native_node.h](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/reference/apis-arkui/capi-native-node-h.md)、[native_node_napi.h](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/reference/apis-arkui/capi-native-node-napi-h.md)展示了如何通过调用CAPI提供的相关方法来获取、设置navigation组件等组件的相关属性和信息,以及将ArkTS侧创建的DrawableDescriptor对象映射到native侧的ArkUI_DrawableDescriptor。 - -## 效果预览 - -| 首页 | navigation页面 | -| ---- | -------------------------------------------------------- | -| | | -| | | - -## 使用说明 - -1. 安装编译生成的hap包,并打开应用; -2. 进入首页,可选择不同模块页面。 -3. 点击navigation选择框进入navigation组件相关的CAPI接口展示界面,通过点击不同的按钮来触发不同的事件,具体结果在log中查看; -4. 点击Mapping DrawableDescriptor选择项进入DrawableDescriptor映射页面,通过点击按钮方式1:GetDrawableDescriptorFromNapiValue,来触发DrawableDescriptor的映射接口,若接口成功调用可以在DevEco Studio开发环境中的日志界面看到如下相关日志信息: -``` -"success to get drawable descriptor" -``` - - -## 工程目录 - -``` -native_type_sample -entry/src/main/ets/ -└── pages - ├── Index.ets (获取导航页面) - └── page_navigation.ets (获取导航页面) - └── GetDrawableDescriptor.ets (映射DrawableDescriptor页面) -entry/src/main/ -├── cpp -│ ├── types -│ │ └── libentry -│ │ └── Index.d.ts (函数对应的js映射) -│ ├── CMakeLists.txt (CMake脚本) -| ├── manager.cpp -| ├── manager.h -│ ├── napi_init.cpp -| ├── ....... -| ├── NavigationContext.cpp -│ └── NavigationContext.h -└── resources - ├── base - │ ├── element - │ │ ├── color.json - │ │ ├── float.json - │ │ └── string.json - │ └── media -``` - -## 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束和限制 - -1. 本示例支持标准系统上运行,支持设备:RK3568; - -2. 本示例支持API20版本SDK,版本号:6.0.0.36; - -3. 本示例已支持使DevEco Studio 5.1.1 Release (构建版本:5.1.1.840,构建 2025年9月20日)编译运行 - -## 下载 - -如需单独下载本工程,执行如下命令: - -```bash -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/NativeNodeNapi/native_node_napi > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/build-profile.json5 b/ArkUIKit/NativeNodeNapiSample/build-profile.json5 deleted file mode 100644 index 449798e4fe2b39cd6f7876865e9506d2cdc2ea7f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/code-linter.json5 b/ArkUIKit/NativeNodeNapiSample/code-linter.json5 deleted file mode 100644 index 4c531be90a6c875995767bd87f2de3cbd6b55160..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/.gitignore b/ArkUIKit/NativeNodeNapiSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/build-profile.json5 b/ArkUIKit/NativeNodeNapiSample/entry/build-profile.json5 deleted file mode 100644 index 9016ca8c62da83754a0b09bfc58f360872d6ab80..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a", - "x86_64" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/hvigorfile.ts b/ArkUIKit/NativeNodeNapiSample/entry/hvigorfile.ts deleted file mode 100644 index 10f881f112b08550ed5c8a3ceb7d0148be2a0b6e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/obfuscation-rules.txt b/ArkUIKit/NativeNodeNapiSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NativeNodeNapiSample/entry/oh-package.json5 b/ArkUIKit/NativeNodeNapiSample/entry/oh-package.json5 deleted file mode 100644 index 9f254ab4d0e3a4de30318e04483b785b552ce977..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIAnimationNode.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIAnimationNode.h deleted file mode 100644 index 205b10e3e193b4f7f8f981d03d33bc9db3e53465..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIAnimationNode.h +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIDOBASENODE_H -#define MYAPPLICATION_ARKUIDOBASENODE_H -#include "ArkUIColumnNode.h" -#include "ArkUITextNode.h" -#include "ArkUINumber.h" -#include - -namespace NativeModule { -std::shared_ptr g_keyframe_text = nullptr; -std::shared_ptr g_keyframe_column1 = nullptr; -std::shared_ptr g_keyframe_column2 = nullptr; -std::shared_ptr CreateAnimationFrameNode1() -{ - auto column = std::make_shared(); - auto textNodeTransition = std::make_shared(); - textNodeTransition->SetTextContent("NODE_TRANSITION"); - textNodeTransition->SetWidth(MIDDLE_LENGTH); - textNodeTransition->SetHeight(SMALL_LENGTH); - ArkUI_RotationOptions rotation; - rotation.x = NUMBER_0; - rotation.y = NUMBER_0; - rotation.z = NUMBER_1; - rotation.angle = NUMBER_180; - rotation.perspective = NUMBER_0; - ArkUI_TransitionEffect* options = OH_ArkUI_CreateRotationTransitionEffect(&rotation); - static ArkUI_AnimateOption *option = OH_ArkUI_AnimateOption_Create(); - OH_ArkUI_AnimateOption_SetCurve(option, ARKUI_CURVE_EASE); - OH_ArkUI_AnimateOption_SetDuration(option, DURATION_TIME); - OH_ArkUI_TransitionEffect_SetAnimation(options, option); - auto columnTransition = std::make_shared(); - columnTransition->SetWidth(MIDDLE_LENGTH); - columnTransition->SetHeight(MIDDLE_LENGTH); - columnTransition->SetBackgroundColor(COLOR_RED); - columnTransition->SetTransition(options); - column->AddChild(textNodeTransition); - column->AddChild(columnTransition); - - auto textNodeTransformCenter = std::make_shared(); - textNodeTransformCenter->SetTextContent("transformCenter"); - textNodeTransformCenter->SetWidth(MIDDLE_LENGTH); - textNodeTransformCenter->SetHeight(SMALL_LENGTH); - auto columnTransformCenter = std::make_shared(); - columnTransformCenter->SetWidth(MIDDLE_LENGTH); - columnTransformCenter->SetHeight(MIDDLE_LENGTH); - columnTransformCenter->SetBackgroundColor(COLOR_PINK); - columnTransformCenter->SetRotateTransition(); - columnTransformCenter->SetTransformCenter(NUMBER_20); - column->AddChild(textNodeTransformCenter); - column->AddChild(columnTransformCenter); - - return column; -} - -std::shared_ptr CreateAnimationFrameNode2() -{ - auto column = std::make_shared(); - auto textNodeOpacityTransition = std::make_shared(); - textNodeOpacityTransition->SetTextContent("OpacityTransition"); - textNodeOpacityTransition->SetWidth(MIDDLE_LENGTH); - textNodeOpacityTransition->SetHeight(SMALL_LENGTH); - auto columnOpacityTransition = std::make_shared(); - columnOpacityTransition->SetWidth(MIDDLE_LENGTH); - columnOpacityTransition->SetHeight(MIDDLE_LENGTH); - columnOpacityTransition->SetBackgroundColor(COLOR_RED); - columnOpacityTransition->SetOpacityTransition(); - column->AddChild(textNodeOpacityTransition); - column->AddChild(columnOpacityTransition); - - auto textNodeRotateTransition = std::make_shared(); - textNodeRotateTransition->SetTextContent("RotateTransition"); - textNodeRotateTransition->SetWidth(MIDDLE_LENGTH); - textNodeRotateTransition->SetHeight(SMALL_LENGTH); - auto columnRotateTransition = std::make_shared(); - columnRotateTransition->SetWidth(MIDDLE_LENGTH); - columnRotateTransition->SetHeight(MIDDLE_LENGTH); - columnRotateTransition->SetBackgroundColor(COLOR_PINK); - columnRotateTransition->SetRotateTransition(); - column->AddChild(textNodeRotateTransition); - column->AddChild(columnRotateTransition); - - auto textNodeScaleTransition = std::make_shared(); - textNodeScaleTransition->SetTextContent("ScaleTransition"); - textNodeScaleTransition->SetWidth(MIDDLE_LENGTH); - textNodeScaleTransition->SetHeight(SMALL_LENGTH); - auto columnScaleTransition = std::make_shared(); - columnScaleTransition->SetWidth(MIDDLE_LENGTH); - columnScaleTransition->SetHeight(MIDDLE_LENGTH); - columnScaleTransition->SetBackgroundColor(COLOR_PINK); - columnScaleTransition->SetScaleTransition(); - column->AddChild(textNodeScaleTransition); - column->AddChild(columnScaleTransition); - - return column; -} - -std::shared_ptr CreateAnimationFrameNode3() -{ - auto column = std::make_shared(); - auto textNodeTranslateTransition = std::make_shared(); - textNodeTranslateTransition->SetTextContent("TranslateTransition"); - textNodeTranslateTransition->SetWidth(MIDDLE_LENGTH); - textNodeTranslateTransition->SetHeight(SMALL_LENGTH); - auto columnTranslateTransition = std::make_shared(); - columnTranslateTransition->SetWidth(MIDDLE_LENGTH); - columnTranslateTransition->SetHeight(MIDDLE_LENGTH); - columnTranslateTransition->SetBackgroundColor(COLOR_RED); - columnTranslateTransition->SetTranslateTransition(); - column->AddChild(textNodeTranslateTransition); - column->AddChild(columnTranslateTransition); - - auto textNodeMoveTransition = std::make_shared(); - textNodeMoveTransition->SetTextContent("MoveTransition"); - textNodeMoveTransition->SetWidth(MIDDLE_LENGTH); - textNodeMoveTransition->SetHeight(SMALL_LENGTH); - auto columnMoveTransition = std::make_shared(); - columnMoveTransition->SetWidth(MIDDLE_LENGTH); - columnMoveTransition->SetHeight(MIDDLE_LENGTH); - columnMoveTransition->SetBackgroundColor(COLOR_PINK); - columnMoveTransition->SetMoveTransition(); - column->AddChild(textNodeMoveTransition); - column->AddChild(columnMoveTransition); - - return column; -} - -std::shared_ptr CreateAnimationFrameNode4() -{ - auto column = std::make_shared(); - auto textNode = std::make_shared(); - textNode->SetTextContent("NODE_RENDER_FIT"); - textNode->SetWidth(MIDDLE_LENGTH); - textNode->SetHeight(SMALL_LENGTH); - - auto text = std::make_shared(); - text->SetWidth(MIDDLE_LENGTH); - text->SetHeight(SMALL_LENGTH); - text->SetBackgroundColor(COLOR_PINK); - text->SetTextContent("NODE_RENDER_FIT"); - text->SetRenderFit(ARKUI_RENDER_FIT_BOTTOM); - - g_keyframe_text = text; - text->RegisterNodeEvent(text->GetHandle(), NODE_ON_CLICK, NUMBER_1, nullptr); - auto onTouch1 = [](ArkUI_NodeEvent *event) { - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUMBER_1) { - static ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_keyframe_text->GetHandle()); - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - static ArkUI_AnimateOption *option = OH_ArkUI_AnimateOption_Create(); - OH_ArkUI_AnimateOption_SetCurve(option, ARKUI_CURVE_EASE); - ArkUI_AnimateCompleteCallback *completeCallback = new ArkUI_AnimateCompleteCallback; - completeCallback->type = ARKUI_FINISH_CALLBACK_REMOVED; - completeCallback->callback = [](void *userData) { - }; - ArkUI_ContextCallback *update = new ArkUI_ContextCallback; - update->callback = [](void *user) { - g_keyframe_text->SetWidth(LARGE_LENGTH); - g_keyframe_text->SetHeight(MIDDLE_LENGTH); - g_keyframe_text->SetBackgroundColor(COLOR_RED); - }; - animateApi->animateTo(context, option, update, completeCallback); - } - }; - text->RegisterNodeEventReceiver(onTouch1); - column->AddChild(textNode); - column->AddChild(text); - - return column; -} - -std::shared_ptr CreateAnimationFrameNode5() -{ - auto column = std::make_shared(); - auto textNodeTitle1 = std::make_shared(); - textNodeTitle1->SetTextContent("GeometryTransition"); - textNodeTitle1->SetWidth(MIDDLE_LENGTH); - textNodeTitle1->SetHeight(SMALL_LENGTH); - const char* str = "animation"; - auto column1 = std::make_shared(); - column1->SetWidth(MIDDLE_LENGTH); - column1->SetHeight(MIDDLE_LENGTH); - column1->SetBackgroundColor(COLOR_PINK); - column1->SetOpacityTransition(); - column1->SetGeometryTransition(NUMBER_0, str); - - auto column2 = std::make_shared(); - column2->SetWidth(LARGE_LENGTH); - column2->SetHeight(LARGE_LENGTH); - column2->SetBackgroundColor(COLOR_RED); - column2->SetVisibility(ARKUI_VISIBILITY_NONE); - column2->SetGeometryTransition(NUMBER_1, str); - column2->SetOpacityTransition(); - - g_keyframe_column1 = column1; - g_keyframe_column2 = column2; - column1->RegisterNodeEvent(column1->GetHandle(), NODE_ON_CLICK, NUMBER_1, nullptr); - auto onTouch1 = [](ArkUI_NodeEvent *event) { - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUMBER_1) { - static ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_keyframe_column1->GetHandle()); - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - static ArkUI_AnimateOption *option = OH_ArkUI_AnimateOption_Create(); - OH_ArkUI_AnimateOption_SetDuration(option, NUMBER_1000); - ArkUI_AnimateCompleteCallback *completeCallback = new ArkUI_AnimateCompleteCallback; - completeCallback->type = ARKUI_FINISH_CALLBACK_REMOVED; - completeCallback->callback = [](void *userData) { - }; - ArkUI_ContextCallback *update = new ArkUI_ContextCallback; - update->callback = [](void *user) { - g_keyframe_column2->SetVisibility(ARKUI_VISIBILITY_VISIBLE); - g_keyframe_column1->SetVisibility(ARKUI_VISIBILITY_NONE); - }; - animateApi->animateTo(context, option, update, completeCallback); - } - }; - column1->RegisterNodeEventReceiver(onTouch1); - column->AddChild(textNodeTitle1); - column->AddChild(column1); - column->AddChild(column2); - - return column; -} -} // namespace NativeModule - -#endif \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIBaseNode.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIBaseNode.h deleted file mode 100644 index 9931c7d7296b187bbaa88ffabf6f1e5e416b2f66..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIBaseNode.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIBASENODE_H -#define MYAPPLICATION_ARKUIBASENODE_H - -#include -#include -#include - -#include "manager.h" -#include "NativeModule.h" - -namespace NativeModule { - -class ArkUIBaseNode { -public: - explicit ArkUIBaseNode(ArkUI_NodeHandle handle) - : handle_(handle), nativeModule_(NativeModuleInstance::GetInstance()->GetNativeNodeAPI()) {} - - virtual ~ArkUIBaseNode() - { - if (!children_.empty()) { - for (const auto& child : children_) { - nativeModule_->removeChild(handle_, child->GetHandle()); - } - children_.clear(); - } - nativeModule_->disposeNode(handle_); - } - void AddChild(const std::shared_ptr &child) - { - children_.emplace_back(child); - OnAddChild(child); - } - void RemoveChild(const std::shared_ptr &child) - { - children_.remove(child); - OnRemoveChild(child); - } - void InsertChild(const std::shared_ptr &child, int32_t index) - { - if (index >= children_.size()) { - AddChild(child); - } else { - auto iter = children_.begin(); - std::advance(iter, index); - children_.insert(iter, child); - OnInsertChild(child, index); - } - } - ArkUI_NodeHandle GetHandle() const { return handle_; } - ArkUI_NativeNodeAPI_1* GetNativeModule() const - { - return nativeModule_; - } - -protected: - virtual void OnAddChild(const std::shared_ptr &child) {} - virtual void OnRemoveChild(const std::shared_ptr &child) {} - virtual void OnInsertChild(const std::shared_ptr &child, int32_t index) {} - - ArkUI_NodeHandle handle_; - ArkUI_NativeNodeAPI_1 *nativeModule_ = nullptr; - -private: - std::list> children_; -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUIBASENODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIColumnNode.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIColumnNode.h deleted file mode 100644 index b51935def52c4e1a5656c2ff53787dae02a8d0d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIColumnNode.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUICOLUMNNODE_H -#define MYAPPLICATION_ARKUICOLUMNNODE_H - -#include "ArkUINode.h" -#include - -namespace NativeModule { -class ArkUIColumnNode : public ArkUINode { -public: - ArkUIColumnNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_COLUMN)) {} - - void SetTranslate(float x, float y, float z) - { - ArkUI_NumberValue nums[NUMBER_3] = {x, y, z}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_3}; - nativeModule_->setAttribute(handle_, NODE_TRANSLATE, &item); - } - void SetScale(float x, float y) - { - ArkUI_NumberValue nums[NUMBER_2] = {x, y}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_2}; - nativeModule_->setAttribute(handle_, NODE_SCALE, &item); - } - void SetRotate(float x, float y, float z, float angle, float center) - { - ArkUI_NumberValue nums[NUMBER_5] = {x, y, z, angle, center}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_5}; - nativeModule_->setAttribute(handle_, NODE_ROTATE, &item); - } - void SetBrightness(float light) - { - ArkUI_NumberValue nums[NUMBER_1] = {light}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_BRIGHTNESS, &item); - } - void SetSaturate(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_SATURATION, &item); - } - int32_t SetLinearGradient(float angle, int32_t direction, int32_t repeat) - { - ArkUI_NumberValue nums[NUMBER_3]; - nums[NUMBER_0].f32 = angle; - nums[NUMBER_1].i32 = direction; - nums[NUMBER_2].i32 = repeat; - ArkUI_ColorStop colorStop; - const uint32_t colors[] = {COLOR_1, COLOR_2, COLOR_3}; - float stops[] = {NUMBER_00, NUMBER_05, NUMBER_1F}; - int size = NUMBER_3; - colorStop.colors = colors; - colorStop.stops = stops; - colorStop.size = size; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_3, .object = &colorStop}; - auto err = nativeModule_->setAttribute(handle_, NODE_LINEAR_GRADIENT, &item); - return err; - } - void SetOpacity(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_OPACITY, &item); - } - void SetBorderRadius(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_BORDER_RADIUS, &item); - } - int32_t SetClip(int32_t number) - { - ArkUI_NumberValue nums[NUMBER_1]; - nums[NUMBER_0].i32 = number; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_CLIP, &item); - return err; - } - int32_t SetCircleShape(int32_t number, float width, float height) - { - ArkUI_NumberValue nums[NUMBER_3]; - nums[NUMBER_0].i32 = number; - nums[NUMBER_1].f32 = width; - nums[NUMBER_2].f32 = height; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_3}; - auto err = nativeModule_->setAttribute(handle_, NODE_CLIP_SHAPE, &item); - return err; - } - int32_t SetTransform() - { - ArkUI_NumberValue value2[NUMBER_16]; - for (int i = NUMBER_0; i < NUMBER_16; i++) { - value2[i].f32 = NUMBER_0; - } - value2[NUMBER_0].f32 = NUMBER_1; - value2[NUMBER_1].f32 = NUMBER_1; - ArkUI_AttributeItem item = { .value = value2, .size = NUMBER_3 }; - auto err = nativeModule_->setAttribute(handle_, NODE_TRANSFORM, &item); - return err; - } - int32_t SetShadow(int32_t number) - { - ArkUI_NumberValue nums[NUMBER_0]; - nums[NUMBER_0].i32 = number; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_SHADOW, &item); - return err; - } - int32_t SetBackgroundBlurStyle(int32_t number) - { - ArkUI_NumberValue blurStyle[NUMBER_6]; - blurStyle[NUMBER_0].i32 = number; - blurStyle[NUMBER_2].i32 = ARKUI_ADAPTIVE_COLOR_AVERAGE; - ArkUI_AttributeItem item = { .value = blurStyle, .size = NUMBER_2}; - auto err = nativeModule_->setAttribute(handle_, NODE_BACKGROUND_BLUR_STYLE, &item); - return err; - } - int32_t SetTransformCenter(float number) - { - ArkUI_NumberValue centerPointArray[] = {number}; - ArkUI_AttributeItem item = { .value = centerPointArray, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_TRANSFORM_CENTER, &item); - return err; - } - int32_t SetSweepGradient() - { - ArkUI_NumberValue nums[NUMBER_6]; - nums[NUMBER_0].f32 = SMALL_LENGTH; - nums[NUMBER_1].f32 = SMALL_LENGTH; - nums[NUMBER_2].f32 = NUMBER_0; - nums[NUMBER_3].f32 = NUMBER_359; - nums[NUMBER_4].f32 = NUMBER_45; - nums[NUMBER_5].f32 = NUMBER_1; - ArkUI_ColorStop colorStop; - const uint32_t colors[] = {COLOR_1, COLOR_2, COLOR_3}; - float stops[] = {NUMBER_00, NUMBER_05, NUMBER_1F}; - int size = NUMBER_3; - colorStop.colors = colors; - colorStop.stops = stops; - colorStop.size = size; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_6, .object = &colorStop }; - auto err = nativeModule_->setAttribute(handle_, NODE_SWEEP_GRADIENT, &item); - return err; - } - int32_t SetRadialGradient() - { - ArkUI_NumberValue nums[NUMBER_4]; - nums[NUMBER_0].f32 = SMALL_LENGTH; - nums[NUMBER_1].f32 = SMALL_LENGTH; - nums[NUMBER_2].f32 = NUMBER_60; - nums[NUMBER_3].f32 = NUMBER_1; - ArkUI_ColorStop colorStop; - const uint32_t colors[] = {COLOR_1, COLOR_2, COLOR_3}; - float stops[] = {NUMBER_00, NUMBER_05, NUMBER_1F}; - int size = NUMBER_3; - colorStop.colors = colors; - colorStop.stops = stops; - colorStop.size = size; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_4, .object = &colorStop }; - auto err = nativeModule_->setAttribute(handle_, NODE_RADIAL_GRADIENT, &item); - return err; - } - int32_t SetMask() - { - ArkUI_NumberValue nums[NUMBER_4]; - nums[NUMBER_0].i32 = ARKUI_MASK_TYPE_PROGRESS; - nums[NUMBER_1].f32 = NUMBER_10; - nums[NUMBER_2].f32 = NUMBER_100; - nums[NUMBER_3].u32 = COLOR_WHITE; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_4 }; - auto err = nativeModule_->setAttribute(handle_, NODE_MASK, &item); - return err; - } - int32_t SetGrayScale(float number) - { - ArkUI_NumberValue nums[] = { number }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_GRAY_SCALE, &item); - return err; - } - int32_t SetInvert(float number) - { - ArkUI_NumberValue nums[] = { number }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_INVERT, &item); - return err; - } - int32_t SetSepia(float number) - { - ArkUI_NumberValue nums[] = { number }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_SEPIA, &item); - return err; - } - int32_t SetContrast(float number) - { - ArkUI_NumberValue nums[] = { number }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_CONTRAST, &item); - return err; - } - int32_t SetColumnJustifyContent(int32_t number) - { - ArkUI_NumberValue nums[] = { { .i32 = number } }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_COLUMN_JUSTIFY_CONTENT, &item); - return err; - } - ~ArkUIColumnNode() override {} -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUILISTNODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUINode.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUINode.h deleted file mode 100644 index 7ee5b530c0fe34a89389bf287793435568397196..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUINode.h +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUINODE_H -#define MYAPPLICATION_ARKUINODE_H - -#include "ArkUIBaseNode.h" -#include "NativeModule.h" -#include -#include -#include -#include -#include "ArkUINumber.h" - -namespace NativeModule { -class ArkUINode : public ArkUIBaseNode { -public: - explicit ArkUINode(ArkUI_NodeHandle handle) : ArkUIBaseNode(handle) {} - - ~ArkUINode() override {} - - void SetWidth(float width) - { - ArkUI_NumberValue value[] = {{.f32 = width}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_WIDTH, &item); - } - void SetPercentWidth(float percent) - { - ArkUI_NumberValue value[] = {{.f32 = percent}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_WIDTH_PERCENT, &item); - } - void SetHeight(float height) - { - ArkUI_NumberValue value[] = {{.f32 = height}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_HEIGHT, &item); - } - void SetPercentHeight(float percent) - { - ArkUI_NumberValue value[] = {{.f32 = percent}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_HEIGHT_PERCENT, &item); - } - void SetBackgroundColor(uint32_t color) - { - ArkUI_NumberValue value[] = {{.u32 = color}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_BACKGROUND_COLOR, &item); - } - int32_t SetZIndex(int32_t number) - { - ArkUI_NumberValue value[] = {{.i32 = number}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_Z_INDEX, &item); - return err; - } - int32_t SetForegroundColor(uint32_t color) - { - ArkUI_NumberValue nums[NUMBER_1]; - nums[NUMBER_0].u32 = color; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_FOREGROUND_COLOR, &item); - return err; - } - int32_t SetMarkAnchor(float x, float y) - { - ArkUI_NumberValue nums[NUMBER_2] = {x, y}; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_2}; - auto err = nativeModule_->setAttribute(handle_, NODE_MARK_ANCHOR, &item); - return err; - } - int32_t SetVisibility(int32_t visibility) - { - ArkUI_NumberValue nums[NUMBER_1]; - nums[NUMBER_0].i32 = visibility; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_VISIBILITY, &item); - return err; - } - void RegisterNodeEvent(ArkUI_NodeHandle node, - ArkUI_NodeEventType eventType, int32_t targetId, void* userData) - { - nativeModule_->registerNodeEvent(node, eventType, targetId, userData); - } - void RegisterNodeEventReceiver(void (*eventReceiver)(ArkUI_NodeEvent* event)) - { - nativeModule_->registerNodeEventReceiver(eventReceiver); - } - int32_t SetOpacityTransition() - { - ArkUI_NumberValue opacityTransition[] = { - NUMBER_02, - { .i32 = NUMBER_3000 }, - { .i32 = static_cast(ARKUI_CURVE_EASE_IN_OUT) } - }; - ArkUI_AttributeItem item = { .value = opacityTransition, .size = NUMBER_3}; - auto err = nativeModule_->setAttribute(handle_, NODE_OPACITY_TRANSITION, &item); - return err; - } - int32_t SetRotateTransition() - { - ArkUI_NumberValue rotateTransition[] = { - NUMBER_00, - NUMBER_00, - NUMBER_1F, - NUMBER_180, - NUMBER_0, - { .i32 = NUMBER_3000 }, - { .i32 = static_cast(ARKUI_CURVE_SHARP) } - }; - ArkUI_AttributeItem item = { .value = rotateTransition, .size = NUMBER_7}; - auto err = nativeModule_->setAttribute(handle_, NODE_ROTATE_TRANSITION, &item); - return err; - } - int32_t SetScaleTransition() - { - ArkUI_NumberValue scaleTransition[] = { - NUMBER_00, - NUMBER_00, - NUMBER_00, - { .i32 = NUMBER_3000 }, - { .i32 = static_cast(ARKUI_CURVE_SHARP) } - }; - ArkUI_AttributeItem item = { .value = scaleTransition, .size = NUMBER_5}; - auto err = nativeModule_->setAttribute(handle_, NODE_SCALE_TRANSITION, &item); - return err; - } - int32_t SetTranslateTransition() - { - ArkUI_NumberValue translateTransition[] = { - NUMBER_100F, - NUMBER_100F, - NUMBER_00, - { .i32 = NUMBER_3000 }, - { .i32 = static_cast(ARKUI_CURVE_SHARP) } - }; - ArkUI_AttributeItem item = { .value = translateTransition, .size = NUMBER_5}; - auto err = nativeModule_->setAttribute(handle_, NODE_TRANSLATE_TRANSITION, &item); - return err; - } - int32_t SetMoveTransition() - { - ArkUI_NumberValue translateTransition[] = { - {.i32 = ARKUI_TRANSITION_EDGE_START }, - {.i32 = NUMBER_3000 }, - {.i32 = static_cast(ARKUI_CURVE_SHARP) } - }; - ArkUI_AttributeItem item = { .value = translateTransition, .size = NUMBER_3}; - auto err = nativeModule_->setAttribute(handle_, NODE_MOVE_TRANSITION, &item); - return err; - } - int32_t SetForegroundBlurStyle(int32_t number) - { - ArkUI_NumberValue nums[] = { { .i32 = number} }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_FOREGROUND_BLUR_STYLE, &item); - return err; - } - int32_t SetColorBlend(uint32_t color) - { - ArkUI_NumberValue nums[] = { { .u32 = color} }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_COLOR_BLEND, &item); - return err; - } - int32_t SetTransition(ArkUI_TransitionEffect* effect) - { - ArkUI_AttributeItem item = { .object = effect}; - auto err = nativeModule_->setAttribute(handle_, NODE_TRANSITION, &item); - return err; - } - int32_t SetBackdropBlur(float round) - { - ArkUI_NumberValue nums[] = { round, NUMBER_100, NUMBER_100 }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_3}; - auto err = nativeModule_->setAttribute(handle_, NODE_BACKDROP_BLUR, &item); - return err; - } - void SetTranslateWithPercent(float x, float y, float z) - { - ArkUI_NumberValue nums[NUMBER_3] = {x, y, z}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_3}; - nativeModule_->setAttribute(handle_, NODE_TRANSLATE_WITH_PERCENT, &item); - } - void SetRotateAngle(float x, float y, float z, float see) - { - ArkUI_NumberValue nums[NUMBER_4] = {x, y, z, see}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_4}; - nativeModule_->setAttribute(handle_, NODE_ROTATE_ANGLE, &item); - } - int32_t SetGeometryTransition(int32_t share, const char* str) - { - ArkUI_NumberValue nums[NUMBER_1] = { {.i32 = share} }; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1, .string = str}; - auto err = nativeModule_->setAttribute(handle_, NODE_GEOMETRY_TRANSITION, &item); - return err; - } - int32_t SetCustomShadow() - { - ArkUI_NumberValue nums[NUMBER_7] = { - NUMBER_20, - {.i32 = NUMBER_0 }, - SMALL_LENGTH, - SMALL_LENGTH, - { .i32 = ARKUI_SHADOW_TYPE_COLOR }, - { .u32 = COLOR_RED }, - { .u32 = NUMBER_0 } - }; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_7}; - auto err = nativeModule_->setAttribute(handle_, NODE_CUSTOM_SHADOW, &item); - return err; - } - int32_t SetBlur(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_BLUR, &item); - return err; - } - int32_t SetBackGroundImage(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_BLUR, &item); - return err; - } - int32_t SetRenderFit(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_RENDER_FIT, &item); - return err; - } - int32_t SetRenderGroup(int32_t number) - { - ArkUI_NumberValue nums[NUMBER_1] = { { .i32 = number } }; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_RENDER_GROUP, &item); - return err; - } -protected: - void OnAddChild(const std::shared_ptr &child) override - { - nativeModule_->addChild(handle_, child->GetHandle()); - } - void OnRemoveChild(const std::shared_ptr &child) override - { - nativeModule_->removeChild(handle_, child->GetHandle()); - } - void OnInsertChild(const std::shared_ptr &child, int32_t index) override - { - nativeModule_->insertChildAt(handle_, child->GetHandle(), index); - } -}; -} // namespace NativeModule -#endif // MYAPPLICATION_ARKUINODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUINumber.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUINumber.h deleted file mode 100644 index 258e01c6b1242106051a2db1ac0976e5d002d4f5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUINumber.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef ARKUINUMBER_H -#define ARKUINUMBER_H -namespace NativeModule { -constexpr uint32_t COLOR_1 = 0x33FF0000; -constexpr uint32_t COLOR_2 = 0x3300FF00; -constexpr uint32_t COLOR_3 = 0x330000FF; -constexpr uint32_t COLOR_BLACK = 0xFF000000; -constexpr uint32_t COLOR_PINK = 0x33FF0000; -constexpr uint32_t COLOR_RED = 0xFFFF0000; -constexpr uint32_t COLOR_WHITE = 0xFFFFFFFF; -constexpr int32_t DURATION_TIME = 2000; -constexpr int32_t LARGE_LENGTH = 300; -constexpr int32_t MIDDLE_LENGTH = 200; -constexpr int32_t NUMBER_0 = 0; -constexpr float NUMBER_00 = 0.0; -constexpr float NUMBER_01 = 0.1; -constexpr float NUMBER_02 = 0.2; -constexpr float NUMBER_03 = 0.3; -constexpr float NUMBER_04 = 0.4; -constexpr float NUMBER_05 = 0.5; -constexpr float NUMBER_06 = 0.6; -constexpr int32_t NUMBER_1 = 1; -constexpr float NUMBER_1F = 1.0; -constexpr int32_t NUMBER_2 = 2; -constexpr int32_t NUMBER_3 = 3; -constexpr int32_t NUMBER_4 = 4; -constexpr int32_t NUMBER_5 = 5; -constexpr int32_t NUMBER_6 = 6; -constexpr int32_t NUMBER_7 = 7; -constexpr int32_t NUMBER_10 = 10; -constexpr int32_t NUMBER_16 = 16; -constexpr int32_t NUMBER_20 = 20; -constexpr int32_t NUMBER_25 = 25; -constexpr int32_t NUMBER_30 = 30; -constexpr int32_t NUMBER_45 = 45; -constexpr int32_t NUMBER_60 = 60; -constexpr int32_t NUMBER_90 = 90; -constexpr int32_t NUMBER_100 = 100; -constexpr float NUMBER_100F = 100.0; -constexpr int32_t NUMBER_150 = 150; -constexpr int32_t NUMBER_180 = 180; -constexpr int32_t NUMBER_1000 = 1000; -constexpr int32_t NUMBER_3000 = 3000; -constexpr int32_t NUMBER_359 = 359; -constexpr int32_t SMALL_LENGTH = 50; -} -#endif \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUITextNode.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUITextNode.h deleted file mode 100644 index 0426e46b14131d0f6adb02ff956d13733441b45f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUITextNode.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// ArkUITextNode.h -#ifndef MYAPPLICATION_ARKUITEXTNODE_H -#define MYAPPLICATION_ARKUITEXTNODE_H - -#include "ArkUINode.h" - -#include - -namespace NativeModule { -class ArkUITextNode : public ArkUINode { -public: - ArkUITextNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_TEXT)) {} - void SetFontSize(float fontSize) - { - ArkUI_NumberValue value[] = {{.f32 = fontSize}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_FONT_SIZE, &item); - } - void SetFontColor(uint32_t color) - { - ArkUI_NumberValue value[] = {{.u32 = color}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_FONT_COLOR, &item); - } - void SetTextContent(const std::string &content) - { - ArkUI_AttributeItem item = {nullptr, 0, content.c_str()}; - nativeModule_->setAttribute(handle_, NODE_TEXT_CONTENT, &item); - } - void SetTextAlign(ArkUI_TextAlignment align) - { - ArkUI_NumberValue value[] = {{.i32 = align}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_TEXT_ALIGN, &item); - } -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUITEXTNODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIVisualEffectsNode.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIVisualEffectsNode.h deleted file mode 100644 index 9f778ca5a6a5990aa63f7c85b244e28b096923b1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/ArkUIVisualEffectsNode.h +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIVISUALEFFECTSNODE_H -#define MYAPPLICATION_ARKUIVISUALEFFECTSNODE_H -#include "ArkUIColumnNode.h" -#include "ArkUITextNode.h" -#include - -namespace NativeModule { -std::shared_ptr CreateVisualEffectsFrameNode1() -{ - auto column = std::make_shared(); - auto textNodeTran = std::make_shared(); - textNodeTran->SetTextContent("translate"); - textNodeTran->SetWidth(MIDDLE_LENGTH); - textNodeTran->SetHeight(SMALL_LENGTH); - auto columnTran = std::make_shared(); - columnTran->SetWidth(SMALL_LENGTH); - columnTran->SetHeight(SMALL_LENGTH); - columnTran->SetBackgroundColor(COLOR_PINK); - columnTran->SetTranslate(SMALL_LENGTH, NUMBER_0, NUMBER_0); - - auto textNodeScale = std::make_shared(); - textNodeScale->SetTextContent("scale"); - textNodeScale->SetWidth(MIDDLE_LENGTH); - textNodeScale->SetHeight(SMALL_LENGTH); - auto columnScale = std::make_shared(); - columnScale->SetWidth(SMALL_LENGTH); - columnScale->SetHeight(SMALL_LENGTH); - columnScale->SetBackgroundColor(COLOR_PINK); - columnScale->SetScale(NUMBER_2, NUMBER_05); - - auto textNodeRotate = std::make_shared(); - textNodeRotate->SetTextContent("rotate"); - textNodeRotate->SetWidth(SMALL_LENGTH); - textNodeRotate->SetHeight(SMALL_LENGTH); - auto columnRotate = std::make_shared(); - columnRotate->SetWidth(SMALL_LENGTH); - columnRotate->SetHeight(SMALL_LENGTH); - columnRotate->SetBackgroundColor(COLOR_PINK); - columnRotate->SetRotate(NUMBER_0, NUMBER_0, NUMBER_1, LARGE_LENGTH, NUMBER_0); - - column->AddChild(textNodeTran); - column->AddChild(columnTran); - column->AddChild(textNodeScale); - column->AddChild(columnScale); - column->AddChild(textNodeRotate); - column->AddChild(columnRotate); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode2() -{ - auto column = std::make_shared(); - auto textNodeBrightness = std::make_shared(); - textNodeBrightness->SetTextContent("Brightness"); - textNodeBrightness->SetWidth(MIDDLE_LENGTH); - textNodeBrightness->SetHeight(SMALL_LENGTH); - auto columnBrightness = std::make_shared(); - columnBrightness->SetWidth(NUMBER_100); - columnBrightness->SetHeight(NUMBER_100); - columnBrightness->SetBackgroundColor(COLOR_PINK); - columnBrightness->SetBrightness(NUMBER_05); - column->AddChild(textNodeBrightness); - column->AddChild(columnBrightness); - - auto textNodeSaturate = std::make_shared(); - textNodeSaturate->SetTextContent("saturate"); - textNodeSaturate->SetWidth(MIDDLE_LENGTH); - textNodeSaturate->SetHeight(SMALL_LENGTH); - auto columnSaturate = std::make_shared(); - columnSaturate->SetWidth(NUMBER_100); - columnSaturate->SetHeight(NUMBER_100); - columnSaturate->SetBackgroundColor(COLOR_PINK); - columnSaturate->SetSaturate(NUMBER_30); - column->AddChild(textNodeSaturate); - column->AddChild(columnSaturate); - - auto textNodeBlur = std::make_shared(); - textNodeBlur->SetTextContent("blur"); - textNodeBlur->SetWidth(MIDDLE_LENGTH); - textNodeBlur->SetHeight(SMALL_LENGTH); - - auto text = std::make_shared(); - text->SetTextContent("NODE_BLUR"); - text->SetWidth(MIDDLE_LENGTH); - text->SetHeight(NUMBER_100); - text->SetBackgroundColor(COLOR_PINK); - text->SetBlur(NUMBER_10); - column->AddChild(textNodeBlur); - column->AddChild(text); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode3() -{ - auto column = std::make_shared(); - auto textNodeLinearGradient = std::make_shared(); - textNodeLinearGradient->SetTextContent("linearGradient"); - textNodeLinearGradient->SetWidth(MIDDLE_LENGTH); - textNodeLinearGradient->SetHeight(SMALL_LENGTH); - auto columnLinearGradient = std::make_shared(); - columnLinearGradient->SetWidth(NUMBER_100); - columnLinearGradient->SetHeight(NUMBER_100); - columnLinearGradient->SetLinearGradient(NUMBER_90, ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, NUMBER_0); - column->AddChild(textNodeLinearGradient); - column->AddChild(columnLinearGradient); - - auto textNodeOpacity = std::make_shared(); - textNodeOpacity->SetTextContent("opacity"); - textNodeOpacity->SetWidth(MIDDLE_LENGTH); - textNodeOpacity->SetHeight(SMALL_LENGTH); - auto columnOpacity = std::make_shared(); - columnOpacity->SetWidth(NUMBER_100); - columnOpacity->SetHeight(NUMBER_100); - columnOpacity->SetBackgroundColor(COLOR_PINK); - columnOpacity->SetOpacity(NUMBER_03); - column->AddChild(textNodeOpacity); - column->AddChild(columnOpacity); - - auto textNodeClip = std::make_shared(); - textNodeClip->SetTextContent("clip"); - textNodeClip->SetWidth(MIDDLE_LENGTH); - textNodeClip->SetHeight(SMALL_LENGTH); - auto columnInside = std::make_shared(); - columnInside->SetWidth(NUMBER_100); - columnInside->SetHeight(NUMBER_100); - columnInside->SetBackgroundColor(COLOR_PINK); - columnInside->SetBorderRadius(NUMBER_20); - auto columnClip = std::make_shared(); - columnClip->SetBorderRadius(NUMBER_20); - columnClip->SetClip(NUMBER_1); - columnClip->AddChild(columnInside); - column->AddChild(textNodeClip); - column->AddChild(columnClip); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode4() -{ - auto column = std::make_shared(); - auto textNodeCircleShape = std::make_shared(); - textNodeCircleShape->SetTextContent("CircleShape"); - textNodeCircleShape->SetWidth(MIDDLE_LENGTH); - textNodeCircleShape->SetHeight(SMALL_LENGTH); - auto columnCircleShape = std::make_shared(); - columnCircleShape->SetWidth(MIDDLE_LENGTH); - columnCircleShape->SetHeight(MIDDLE_LENGTH); - columnCircleShape->SetBackgroundColor(COLOR_PINK); - columnCircleShape->SetCircleShape(ARKUI_CLIP_TYPE_CIRCLE, MIDDLE_LENGTH, MIDDLE_LENGTH); - column->AddChild(textNodeCircleShape); - column->AddChild(columnCircleShape); - - auto textNodeTransform = std::make_shared(); - textNodeTransform->SetTextContent("Transform"); - textNodeTransform->SetWidth(MIDDLE_LENGTH); - textNodeTransform->SetHeight(SMALL_LENGTH); - auto columnTransform = std::make_shared(); - columnTransform->SetWidth(MIDDLE_LENGTH); - columnTransform->SetHeight(MIDDLE_LENGTH); - columnTransform->SetBackgroundColor(COLOR_PINK); - columnTransform->SetTransform(); - column->AddChild(textNodeTransform); - column->AddChild(columnTransform); - - auto textNodeShadow = std::make_shared(); - textNodeShadow->SetTextContent("Shadow"); - textNodeShadow->SetWidth(MIDDLE_LENGTH); - textNodeShadow->SetHeight(SMALL_LENGTH); - auto columnShadow = std::make_shared(); - columnShadow->SetWidth(MIDDLE_LENGTH); - columnShadow->SetHeight(MIDDLE_LENGTH); - columnShadow->SetBackgroundColor(COLOR_PINK); - columnShadow->SetShadow(ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG); - column->AddChild(textNodeShadow); - column->AddChild(columnShadow); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode5() -{ - auto column = std::make_shared(); - auto textNodeSweepGradient = std::make_shared(); - textNodeSweepGradient->SetTextContent("sweepGradient"); - textNodeSweepGradient->SetWidth(MIDDLE_LENGTH); - textNodeSweepGradient->SetHeight(SMALL_LENGTH); - auto columnSweepGradient = std::make_shared(); - columnSweepGradient->SetWidth(MIDDLE_LENGTH); - columnSweepGradient->SetHeight(MIDDLE_LENGTH); - columnSweepGradient->SetBackgroundColor(COLOR_PINK); - columnSweepGradient->SetSweepGradient(); - column->AddChild(textNodeSweepGradient); - column->AddChild(columnSweepGradient); - - auto textNodeRadialGradient = std::make_shared(); - textNodeRadialGradient->SetTextContent("radialGradient"); - textNodeRadialGradient->SetWidth(MIDDLE_LENGTH); - textNodeRadialGradient->SetHeight(SMALL_LENGTH); - auto columnRadialGradient = std::make_shared(); - columnRadialGradient->SetWidth(MIDDLE_LENGTH); - columnRadialGradient->SetHeight(MIDDLE_LENGTH); - columnSweepGradient->SetBackgroundColor(COLOR_PINK); - columnRadialGradient->SetRadialGradient(); - column->AddChild(textNodeRadialGradient); - column->AddChild(columnRadialGradient); - - auto textNodeMask = std::make_shared(); - textNodeMask->SetTextContent("mask"); - textNodeMask->SetWidth(MIDDLE_LENGTH); - textNodeMask->SetHeight(SMALL_LENGTH); - auto columnMask = std::make_shared(); - columnMask->SetWidth(MIDDLE_LENGTH); - columnMask->SetHeight(MIDDLE_LENGTH); - columnMask->SetBackgroundColor(COLOR_PINK); - columnMask->SetMask(); - column->AddChild(textNodeMask); - column->AddChild(columnMask); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode6() -{ - auto column = std::make_shared(); - auto textNodeGrayScale = std::make_shared(); - textNodeGrayScale->SetTextContent("GrayScale"); - textNodeGrayScale->SetWidth(MIDDLE_LENGTH); - textNodeGrayScale->SetHeight(SMALL_LENGTH); - auto columnGrayScale = std::make_shared(); - columnGrayScale->SetWidth(MIDDLE_LENGTH); - columnGrayScale->SetHeight(MIDDLE_LENGTH); - columnGrayScale->SetBackgroundColor(COLOR_PINK); - columnGrayScale->SetGrayScale(NUMBER_05); - column->AddChild(textNodeGrayScale); - column->AddChild(columnGrayScale); - - auto textNodeInvert = std::make_shared(); - textNodeInvert->SetTextContent("Invert"); - textNodeInvert->SetWidth(MIDDLE_LENGTH); - textNodeInvert->SetHeight(SMALL_LENGTH); - auto columnInvert = std::make_shared(); - columnInvert->SetWidth(MIDDLE_LENGTH); - columnInvert->SetHeight(MIDDLE_LENGTH); - columnInvert->SetBackgroundColor(COLOR_PINK); - columnInvert->SetInvert(NUMBER_05); - column->AddChild(textNodeInvert); - column->AddChild(columnInvert); - - auto textNodeSepia = std::make_shared(); - textNodeSepia->SetTextContent("Sepia"); - textNodeSepia->SetWidth(MIDDLE_LENGTH); - textNodeSepia->SetHeight(SMALL_LENGTH); - auto columnSepia = std::make_shared(); - columnSepia->SetWidth(MIDDLE_LENGTH); - columnSepia->SetHeight(MIDDLE_LENGTH); - columnSepia->SetBackgroundColor(COLOR_PINK); - columnSepia->SetSepia(NUMBER_05); - column->AddChild(textNodeSepia); - column->AddChild(columnSepia); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode7() -{ - auto column = std::make_shared(); - auto textNodeContrast = std::make_shared(); - textNodeContrast->SetTextContent("Contrast"); - textNodeContrast->SetWidth(MIDDLE_LENGTH); - textNodeContrast->SetHeight(SMALL_LENGTH); - auto columnContrast = std::make_shared(); - columnContrast->SetWidth(MIDDLE_LENGTH); - columnContrast->SetHeight(MIDDLE_LENGTH); - columnContrast->SetBackgroundColor(COLOR_PINK); - columnContrast->SetContrast(NUMBER_01); - column->AddChild(textNodeContrast); - column->AddChild(columnContrast); - - auto columBlank = std::make_shared(); - columBlank->SetHeight(NUMBER_20); - column->AddChild(columBlank); - - auto textNodeForegroundColor = std::make_shared(); - textNodeForegroundColor->SetTextContent("ForegroundColor"); - textNodeForegroundColor->SetWidth(MIDDLE_LENGTH); - textNodeForegroundColor->SetHeight(SMALL_LENGTH); - textNodeForegroundColor->SetBackgroundColor(COLOR_PINK); - textNodeForegroundColor->SetForegroundColor(COLOR_RED); - column->AddChild(textNodeForegroundColor); - - auto textNodeMarkAnchor = std::make_shared(); - textNodeMarkAnchor->SetTextContent("MarkAnchor"); - textNodeMarkAnchor->SetWidth(MIDDLE_LENGTH); - textNodeMarkAnchor->SetHeight(SMALL_LENGTH); - auto columnMarkAnchor = std::make_shared(); - columnMarkAnchor->SetWidth(MIDDLE_LENGTH); - columnMarkAnchor->SetHeight(MIDDLE_LENGTH); - columnMarkAnchor->SetBackgroundColor(COLOR_PINK); - auto textNode = std::make_shared(); - textNode->SetTextContent("text"); - textNode->SetHeight(NUMBER_25); - textNode->SetHeight(NUMBER_25); - textNode->SetMarkAnchor(NUMBER_25, NUMBER_25); - column->AddChild(textNodeMarkAnchor); - column->AddChild(columnMarkAnchor); - column->AddChild(textNode); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode8() -{ - auto column = std::make_shared(); - auto textNodeTranslateWithPercent = std::make_shared(); - textNodeTranslateWithPercent->SetTextContent("TranslateWithPercent"); - textNodeTranslateWithPercent->SetWidth(MIDDLE_LENGTH); - textNodeTranslateWithPercent->SetHeight(SMALL_LENGTH); - auto columnTranslateWithPercent = std::make_shared(); - columnTranslateWithPercent->SetWidth(MIDDLE_LENGTH); - columnTranslateWithPercent->SetHeight(MIDDLE_LENGTH); - columnTranslateWithPercent->SetBackgroundColor(COLOR_PINK); - columnTranslateWithPercent->SetTranslateWithPercent(NUMBER_04, NUMBER_02, NUMBER_0); - column->AddChild(textNodeTranslateWithPercent); - column->AddChild(columnTranslateWithPercent); - - auto textNodeRotateAngle = std::make_shared(); - textNodeRotateAngle->SetTextContent("RotateAngle"); - textNodeRotateAngle->SetWidth(MIDDLE_LENGTH); - textNodeRotateAngle->SetHeight(SMALL_LENGTH); - auto columnRotateAngle = std::make_shared(); - columnRotateAngle->SetWidth(MIDDLE_LENGTH); - columnRotateAngle->SetHeight(MIDDLE_LENGTH); - columnRotateAngle->SetBackgroundColor(COLOR_PINK); - columnRotateAngle->SetRotateAngle(NUMBER_45, NUMBER_45, NUMBER_0, NUMBER_0); - column->AddChild(textNodeRotateAngle); - column->AddChild(columnRotateAngle); - - auto textNodeCustomShadow = std::make_shared(); - textNodeCustomShadow->SetTextContent("CustomShadow"); - textNodeCustomShadow->SetWidth(MIDDLE_LENGTH); - textNodeCustomShadow->SetHeight(SMALL_LENGTH); - auto columnCustomShadow = std::make_shared(); - columnCustomShadow->SetWidth(MIDDLE_LENGTH); - columnCustomShadow->SetHeight(MIDDLE_LENGTH); - columnCustomShadow->SetBackgroundColor(COLOR_PINK); - columnCustomShadow->SetCustomShadow(); - column->AddChild(textNodeCustomShadow); - column->AddChild(columnCustomShadow); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode9() -{ - auto column = std::make_shared(); - auto textNodeBlurStyle = std::make_shared(); - textNodeBlurStyle->SetTextContent("BackgroundBlurStyle"); - textNodeBlurStyle->SetWidth(MIDDLE_LENGTH); - textNodeBlurStyle->SetHeight(SMALL_LENGTH); - auto columnBlurStyle = std::make_shared(); - columnBlurStyle->SetWidth(MIDDLE_LENGTH); - columnBlurStyle->SetHeight(MIDDLE_LENGTH); - columnBlurStyle->SetBackgroundColor(COLOR_PINK); - columnBlurStyle->SetBackgroundBlurStyle(ARKUI_BLUR_STYLE_THICK); - column->AddChild(textNodeBlurStyle); - column->AddChild(columnBlurStyle); - - auto textNodeForegroundBlurStyle = std::make_shared(); - textNodeForegroundBlurStyle->SetTextContent("ForegroundBlurStyle"); - textNodeForegroundBlurStyle->SetWidth(MIDDLE_LENGTH); - textNodeForegroundBlurStyle->SetHeight(SMALL_LENGTH); - auto columnTextNode = std::make_shared(); - columnTextNode->SetTextContent("厚材质模糊"); - columnTextNode->SetWidth(MIDDLE_LENGTH); - columnTextNode->SetHeight(SMALL_LENGTH); - columnTextNode->SetBackgroundColor(COLOR_PINK); - columnTextNode->SetForegroundBlurStyle(ARKUI_BLUR_STYLE_THICK); - column->AddChild(textNodeForegroundBlurStyle); - column->AddChild(columnTextNode); - - auto textNodeTranslateWithPercent = std::make_shared(); - textNodeTranslateWithPercent->SetTextContent("TranslateWithPercent"); - textNodeTranslateWithPercent->SetWidth(MIDDLE_LENGTH); - textNodeTranslateWithPercent->SetHeight(SMALL_LENGTH); - auto columnTranslateWithPercent = std::make_shared(); - columnTranslateWithPercent->SetWidth(MIDDLE_LENGTH); - columnTranslateWithPercent->SetHeight(MIDDLE_LENGTH); - columnTranslateWithPercent->SetBackgroundColor(COLOR_PINK); - columnTranslateWithPercent->SetColorBlend(COLOR_RED); - column->AddChild(textNodeTranslateWithPercent); - column->AddChild(columnTranslateWithPercent); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode10() -{ - auto column = std::make_shared(); - auto textNodeBackdropBlur = std::make_shared(); - textNodeBackdropBlur->SetTextContent("BackdropBlur"); - textNodeBackdropBlur->SetWidth(MIDDLE_LENGTH); - textNodeBackdropBlur->SetHeight(SMALL_LENGTH); - textNodeBackdropBlur->SetBackgroundColor(COLOR_PINK); - auto textNode = std::make_shared(); - textNode->SetTextContent("backdropBlur"); - textNode->SetWidth(MIDDLE_LENGTH); - textNode->SetHeight(MIDDLE_LENGTH); - textNode->SetBackgroundColor(COLOR_PINK); - textNode->SetBackdropBlur(NUMBER_20); - column->AddChild(textNodeBackdropBlur); - column->AddChild(textNode); - - auto textNodeRenderGroup = std::make_shared(); - textNodeRenderGroup->SetTextContent("RenderGroup"); - textNodeRenderGroup->SetWidth(MIDDLE_LENGTH); - textNodeRenderGroup->SetHeight(SMALL_LENGTH); - auto column1 = std::make_shared(); - column1->SetWidth(MIDDLE_LENGTH); - column1->SetHeight(MIDDLE_LENGTH); - column1->SetBackgroundColor(COLOR_BLACK); - column1->SetOpacity(NUMBER_1); - column1->SetColumnJustifyContent(ARKUI_FLEX_ALIGNMENT_CENTER); - - auto column2 = std::make_shared(); - column2->SetWidth(NUMBER_150); - column2->SetHeight(NUMBER_150); - column2->SetBackgroundColor(COLOR_WHITE); - column2->SetColumnJustifyContent(ARKUI_FLEX_ALIGNMENT_CENTER); - column2->SetOpacity(NUMBER_06); - column2->SetRenderGroup(NUMBER_1); - - auto column3 = std::make_shared(); - column3->SetWidth(NUMBER_100); - column3->SetHeight(NUMBER_100); - column3->SetBackgroundColor(COLOR_BLACK); - column3->SetOpacity(NUMBER_1); - column3->SetColumnJustifyContent(ARKUI_FLEX_ALIGNMENT_CENTER); - - column->AddChild(textNodeRenderGroup); - column->AddChild(column1); - column1->AddChild(column2); - column2->AddChild(column3); - column->AddChild(column1); - - return column; -} - - -} // namespace NativeModule - -#endif \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index e9de699859522fcece4034943ca1ac513f8ddb87..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(native_node_napi) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp manager.cpp NavigationContext.cpp) - -find_library(hilog-lib hilog_ndk.z) - -find_library(libace-lib ace_ndk.z) - -find_library(libnapi-lib ace_napi.z) - -target_link_libraries(entry PUBLIC ${hilog-lib} ${libace-lib} ${libnapi-lib}) \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/NativeModule.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/NativeModule.h deleted file mode 100644 index a46cd0b117e1efe682eacd358878e16c555360b9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/NativeModule.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_NATIVEMODULE_H -#define MYAPPLICATION_NATIVEMODULE_H - -#include -#include -#include -#include - -namespace NativeModule { - -class NativeModuleInstance { -public: - static NativeModuleInstance *GetInstance() - { - static NativeModuleInstance instance; - return &instance; - } - - NativeModuleInstance() - { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, arkUINativeNodeApi_); - } - ArkUI_NativeNodeAPI_1 *GetNativeNodeAPI() { return arkUINativeNodeApi_; } - -private: - ArkUI_NativeNodeAPI_1 *arkUINativeNodeApi_ = nullptr; -}; -} // namespace NativeModule -#endif // MYAPPLICATION_NATIVEMODULE_H \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/NavigationContext.cpp b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/NavigationContext.cpp deleted file mode 100644 index 8701af226fbe96a75607c4d199655c4692001d60..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/NavigationContext.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include "NavigationContext.h" - -constexpr int32_t BUFFER_LEN = 50; -constexpr int32_t SMALL_BUFFER_LEN = 1; -constexpr int32_t INIT_VAL = -10; - -void NavigationContext::NavigationInfoTest1(ArkUI_NodeHandle node) -{ - char buffer[BUFFER_LEN]; - int32_t resLen = INIT_VAL; - int32_t ret = INIT_VAL; - // case 1 - ret = OH_ArkUI_GetNavigationId(node, buffer, BUFFER_LEN, &resLen); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "NavigationId %{public}s , ret: %{public}d, writeLen: %{public}d", buffer, ret, resLen); - std::fill(std::begin(buffer), std::end(buffer), '\0'); - resLen = INIT_VAL; - ret = INIT_VAL; - // case 2 - ret = OH_ArkUI_GetNavDestinationName(node, buffer, BUFFER_LEN, &resLen); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "NavDestinationName %{public}s , ret: %{public}d, writeLen: %{public}d", buffer, ret, resLen); - std::fill(std::begin(buffer), std::end(buffer), '\0'); - resLen = INIT_VAL; - ret = INIT_VAL; - // case 3 - int32_t stackLen = -100; - ret = OH_ArkUI_GetNavStackLength(node, &stackLen); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "OH_ArkUI_GetNavStackLength ret: %{public}d, stackLen: %{public}d", ret, stackLen); - std::fill(std::begin(buffer), std::end(buffer), '\0'); - resLen = INIT_VAL; - ret = INIT_VAL; - // case 4 - ret = OH_ArkUI_GetNavDestinationNameByIndex(node, 0, buffer, BUFFER_LEN, &resLen); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "OH_ArkUI_GetNavDestinationNameByIndex %{public}s , ret: %{public}d, writeLen: %{public}d", buffer, - ret, resLen); - std::fill(std::begin(buffer), std::end(buffer), '\0'); - resLen = INIT_VAL; - ret = INIT_VAL; -} - -void NavigationContext::NavigationInfoTest2(ArkUI_NodeHandle node) -{ - char buffer[BUFFER_LEN]; - int32_t resLen = INIT_VAL; - int32_t ret = INIT_VAL; - // case 5 - ret = OH_ArkUI_GetNavDestinationId(node, buffer, BUFFER_LEN, &resLen); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "NavDestinationId %{public}s , ret: %{public}d, writeLen: %{public}d", buffer, ret, resLen); - std::fill(std::begin(buffer), std::end(buffer), '\0'); - resLen = INIT_VAL; - ret = INIT_VAL; - // case 6 - ArkUI_NavDestinationState navDesState; - ret = OH_ArkUI_GetNavDestinationState(node, &navDesState); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "OH_ArkUI_GetNavDestinationState ret: %{public}d, state: %{public}d", ret, navDesState); - ret = INIT_VAL; - // case 7 - int32_t index; - ret = OH_ArkUI_GetNavDestinationIndex(node, &index); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "OH_ArkUI_GetNavDestinationIndex index: %{public}d ret: %{public}d", index, ret); - // case 8 - napi_value param = nullptr; - param = OH_ArkUI_GetNavDestinationParam(node); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", "OH_ArkUI_GetNavDestinationParam isEmpty: %{public}d", - (param == nullptr)); -} - -void NavigationContext::RouterPageInfoTest(ArkUI_NodeHandle node) -{ - char buffer[BUFFER_LEN]; - int32_t resLen = INIT_VAL; - int32_t ret = INIT_VAL; - // case 1 - int32_t index; - ret = OH_ArkUI_GetRouterPageIndex(node, &index); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "OH_ArkUI_GetRouterPageIndex index: %{public}d ret: %{public}d", index, ret); - // case 2 - ret = OH_ArkUI_GetRouterPageName(node, buffer, BUFFER_LEN, &resLen); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "RouterPageName %{public}s, ret: %{public}d, writeLen: %{public}d", buffer, ret, resLen); - std::fill(std::begin(buffer), std::end(buffer), '\0'); - resLen = INIT_VAL; - ret = INIT_VAL; - // case 3 - ret = OH_ArkUI_GetRouterPagePath(node, buffer, BUFFER_LEN, &resLen); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "RouterPagePath %{public}s, ret: %{public}d, writeLen: %{public}d", buffer, ret, resLen); - std::fill(std::begin(buffer), std::end(buffer), '\0'); - resLen = INIT_VAL; - ret = INIT_VAL; - // case 4 - ArkUI_RouterPageState pageState; - ret = OH_ArkUI_GetRouterPageState(node, &pageState); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "OH_ArkUI_GetNavDestinationState ret: %{public}d, state: %{public}d", ret, pageState); - ret = INIT_VAL; - // case 5 - ret = OH_ArkUI_GetRouterPageId(node, buffer, BUFFER_LEN, &resLen); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "case", - "GetRouterPageId %{public}s, ret: %{public}d, writeLen: %{public}d", buffer, ret, resLen); - std::fill(std::begin(buffer), std::end(buffer), '\0'); - resLen = INIT_VAL; - ret = INIT_VAL; -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/NavigationContext.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/NavigationContext.h deleted file mode 100644 index a601bc750ab8650ea49dcf1af26ca7d360255ccc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/NavigationContext.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_NODE_NAPI_NAVIGATIONCONTEXT_H -#define NATIVE_NODE_NAPI_NAVIGATIONCONTEXT_H - -#include "manager.h" - -class NavigationContext { -public: - NavigationContext() {} - ~NavigationContext() {} - static void NavigationInfoTest1(ArkUI_NodeHandle node); - static void NavigationInfoTest2(ArkUI_NodeHandle node); - static void RouterPageInfoTest(ArkUI_NodeHandle node); -}; - -#endif //NATIVE_NODE_NAPI_NAVIGATIONCONTEXT_H diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/manager.cpp b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/manager.cpp deleted file mode 100644 index 73c495e79f4a68dda296517ed95c47df5b90de64..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "manager.h" -#include "ArkUIAnimationNode.h" -#include "ArkUIVisualEffectsNode.h" -#include "NavigationContext.h" -#include "napi/native_api.h" -#include -#include -#include -#include -#include -#include -#include -#include - -Manager Manager::manager_; -ArkUI_NativeNodeAPI_1 *Manager::nodeAPI_ = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - -napi_value Manager::CreateNativeNaviNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - auto columnNode = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, columnNode); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", - "******************NavigationInfoTest******************"); - NavigationContext::NavigationInfoTest1(columnNode); - NavigationContext::NavigationInfoTest2(columnNode); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", - "******************RouterPageInfoTest******************"); - NavigationContext::RouterPageInfoTest(columnNode); - } - } - return nullptr; -} - -napi_value Manager::ProcessDrawable(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - // 获取JS层传入的参数 - napi_status status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (status != napi_ok || argc < 1) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "获取参数失败"); - return nullptr; - } - napi_value resourceValue = args[0]; // 这是ArkTS侧传入的Resource对象 - // 核心接口:将napi_value转换为DrawableDescriptor - ArkUI_DrawableDescriptor* drawable = nullptr; - int32_t res = OH_ArkUI_GetDrawableDescriptorFromNapiValue(env, resourceValue, &drawable); - // 处理转换结果 - if (res != ArkUI_ErrorCode::ARKUI_ERROR_CODE_NO_ERROR) { - // 转换失败:根据错误码处理(参数无效等) - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Failed to get drawable descriptor"); - napi_throw_error(env, nullptr, "Failed to get drawable descriptor"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "success to get drawable descriptor"); - // 返回处理结果给JS层 - napi_value result; - napi_create_int32(env, res, &result); - return result; -} - -napi_value Manager::ProcessDrawable2(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - // 获取JS层传入的参数 - napi_status status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (status != napi_ok || argc < 1) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "获取参数失败"); - return nullptr; - } - napi_value resourceValue = args[0]; // 这是ArkTS侧传入的Resource对象 - // 核心接口:将napi_value转换为DrawableDescriptor - ArkUI_DrawableDescriptor* drawable = nullptr; - int32_t res = OH_ArkUI_GetDrawableDescriptorFromResourceNapiValue (env, resourceValue, &drawable); - // 3. 处理转换结果 - if (res != ArkUI_ErrorCode::ARKUI_ERROR_CODE_NO_ERROR) { - // 转换失败:根据错误码处理(参数无效等) - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Failed to get drawable descriptor"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "success to get drawable descriptor"); - // 返回处理结果给JS层 - napi_value result; - napi_create_int32(env, res, &result); - return result; -} - -napi_value createNativeRootAnimation1(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateAnimationFrameNode1(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootAnimation2(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateAnimationFrameNode2(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootAnimation3(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateAnimationFrameNode3(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootAnimation4(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateAnimationFrameNode4(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootAnimation5(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateAnimationFrameNode5(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects1(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode1(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects2(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode2(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects3(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode3(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects4(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode4(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects5(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode5(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects6(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode6(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects7(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode7(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects8(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode8(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects9(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode9(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects10(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode10(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value DestroyNativeRoot(napi_env env, napi_callback_info info) -{ - Manager::GetInstance()->DisposeRootNode(); - return nullptr; -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/manager.h b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/manager.h deleted file mode 100644 index 6ba3f61eaf755448317e834443c34b04dcfec737..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_NODE_NAPI_SAMPLE_MANAGER_H -#define NATIVE_NODE_NAPI_SAMPLE_MANAGER_H - -#include "ArkUIBaseNode.h" -#include -#include -#include -#include -#include -#include -#include -#include - -napi_value createNativeRootAnimation1(napi_env env, napi_callback_info info); -napi_value createNativeRootAnimation2(napi_env env, napi_callback_info info); -napi_value createNativeRootAnimation3(napi_env env, napi_callback_info info); -napi_value createNativeRootAnimation4(napi_env env, napi_callback_info info); -napi_value createNativeRootAnimation5(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects1(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects2(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects3(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects4(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects5(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects6(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects7(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects8(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects9(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects10(napi_env env, napi_callback_info info); -napi_value DestroyNativeRoot(napi_env env, napi_callback_info info); - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; -const int32_t CNT_NUMBER = 1; -class Manager { -public: - static ArkUI_NativeNodeAPI_1 *nodeAPI_; - ~Manager(){}; - - static Manager *GetInstance() - { - static Manager nativeEntry; - return &nativeEntry; - } - - void SetContentHandle(ArkUI_NodeContentHandle handle) - { - handle_ = handle; - } - - void SetRootNode(const std::shared_ptr &baseNode) - { - cnt++; - root_ = baseNode; - OH_ArkUI_NodeContent_AddNode(handle_, root_->GetHandle()); - } - void DisposeRootNode() - { - if (cnt != CNT_NUMBER) { - cnt--; - return; - } - OH_ArkUI_NodeContent_RemoveNode(handle_, root_->GetHandle()); - root_.reset(); - } - - static napi_value CreateNativeNaviNode(napi_env env, napi_callback_info info); - static napi_value ProcessDrawable(napi_env env, napi_callback_info info); - static napi_value ProcessDrawable2(napi_env env, napi_callback_info info); -private: - int32_t cnt = 0; - static Manager manager_; - std::shared_ptr root_; - ArkUI_NodeContentHandle handle_; -}; - -#endif // NATIVE_NODE_NAPI_SAMPLE_MANAGER_H diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 3e268376bd5b05fcbf4c983ae96ef92c3ace0ee7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include "manager.h" - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"createNativeNaviNode", nullptr, Manager::CreateNativeNaviNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createNativeRootAnimation1", nullptr, createNativeRootAnimation1, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootAnimation2", nullptr, createNativeRootAnimation2, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootAnimation3", nullptr, createNativeRootAnimation3, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootAnimation4", nullptr, createNativeRootAnimation4, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootAnimation5", nullptr, createNativeRootAnimation5, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects1", nullptr, createNativeRootVisualEffects1, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects2", nullptr, createNativeRootVisualEffects2, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects3", nullptr, createNativeRootVisualEffects3, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects4", nullptr, createNativeRootVisualEffects4, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects5", nullptr, createNativeRootVisualEffects5, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects6", nullptr, createNativeRootVisualEffects6, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects7", nullptr, createNativeRootVisualEffects7, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects8", nullptr, createNativeRootVisualEffects8, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects9", nullptr, createNativeRootVisualEffects9, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects10", nullptr, createNativeRootVisualEffects10, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"destroyNativeRoot", nullptr, DestroyNativeRoot, nullptr, nullptr, nullptr, napi_default, nullptr}, - { "processDrawable", nullptr, Manager::ProcessDrawable, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "processDrawable2", nullptr, Manager::ProcessDrawable2, nullptr, nullptr, nullptr, napi_default, nullptr }, - }; - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index e6ac5da6f61274d306880b25f421e5d68694c302..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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 { DrawableDescriptor } from "@kit.ArkUI"; - -export const createNativeNaviNode: (content: Object) =>void; -export const createNativeRootAnimation1: (content: Object) => void; -export const createNativeRootAnimation2: (content: Object) => void; -export const createNativeRootAnimation3: (content: Object) => void; -export const createNativeRootAnimation4: (content: Object) => void; -export const createNativeRootAnimation5: (content: Object) => void; -export const createNativeRootVisualEffects1: (content: Object) => void; -export const createNativeRootVisualEffects2: (content: Object) => void; -export const createNativeRootVisualEffects3: (content: Object) => void; -export const createNativeRootVisualEffects4: (content: Object) => void; -export const createNativeRootVisualEffects5: (content: Object) => void; -export const createNativeRootVisualEffects6: (content: Object) => void; -export const createNativeRootVisualEffects7: (content: Object) => void; -export const createNativeRootVisualEffects8: (content: Object) => void; -export const createNativeRootVisualEffects9: (content: Object) => void; -export const createNativeRootVisualEffects10: (content: Object) => void; -export const destroyNativeRoot: () => void; -export const processDrawable: (a: DrawableDescriptor) => number; -export const processDrawable2: (a: DrawableDescriptor) => number; \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index b81656fe96ca09694282eed65e33f57ddc1d2a05..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 79e55422a4c269db8c49fcd84222a9ccafe8f177..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2025 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 { BusinessError } from '@kit.BasicServicesKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - let windowClass: window.Window | undefined = undefined; - windowStage.getMainWindow((err: BusinessError, data) => { - const errCode: number = err.code; - if (errCode) { - console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`); - return; - } - windowClass = data; - let systemBarProperties: window.SystemBarProperties = { - statusBarColor: '#2aa1a6b1', - navigationBarColor: '#2aa1a6b1', - //以下两个属性从API Version8开始支持 - }; - try { - let promise = windowClass.setWindowSystemBarProperties(systemBarProperties); - promise.then(() => { - console.info('Succeeded in setting the system bar properties.'); - }).catch((err: BusinessError) => { - console.error(`Failed to set the system bar properties. Cause code: ${err.code}, message: ${err.message}`); - }); - } catch (exception) { - console.error(`Failed to set the system bar properties. Cause code: ${exception.code}, message: ${exception.message}`); - } - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 8e4de99282050bad799ac892eb85ac5449364a51..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,16 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index ea93d9ee73aa62ca797c3133e587d5e9457c811a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2025 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 { router } from '@kit.ArkUI'; - -interface ListCategories { - title: string, - url: string -} - -@Entry -@Component -struct MenuIndex { - private items: ListCategories[] = - [ - { title: 'Navigation', url: 'pages/page_navigation' }, - { title: 'add your router', url: 'pages/page_navigation' }, - { title: 'Mapping DrawableDescriptor', url: 'pages/page_getDrawableDescriptor' }, - { title: 'Animation', url: 'pages/page_animation' }, - { title: 'Visual Effects', url: 'pages/page_visual_effects' }, - ]; - - build() { - Scroll(new Scroller()) { - Column() { - Text('native_node_napi_sample') - .fontWeight(FontWeight.Bold) - .fontSize(20) - .textAlign(TextAlign.Center) - .height('5%') - .margin($r('sys.float.titlebar_title_margin_right')) - List() { - ForEach(this.items, (item: ListCategories) => { - ListItem() { - Row() { - Text(item.title) - .fontSize($r('sys.float.text_button_font_size')) - .fontColor(Color.Black) - .textAlign(TextAlign.Start) - .height('100%') - .width('70%') - .padding($r('sys.float.padding_level10')) - Text('>') - .fontSize('25vp') - .fontColor(Color.Black) - .textAlign(TextAlign.End) - .fontColor(Color.Gray) - .height('100%') - .width('30%') - .padding($r('sys.float.padding_level10')) - } - .width('100%') - .height('10%') - .borderRadius($r('sys.float.select_border_radius_default')) - .backgroundColor(Color.White) - .onClick(() => { - router.pushUrl({ url: item.url }) - }) - } - .margin($r('sys.float.menu_item_content_align')) - }) - }.width('95%').height('90%').alignListItem(ListItemAlign.Center) - }.width('100%') - }.height('100%').backgroundColor('#2aa1a6b1') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex1.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex1.ets deleted file mode 100644 index 718551ca481f01c5be53a48b5e7a2c349c5ebdbc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex1.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation1(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex2.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex2.ets deleted file mode 100644 index e0da3b35858f77852687d8ff031b20ff33a7a8a7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex2.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation2(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex3.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex3.ets deleted file mode 100644 index 4acc67fe2e3454e4624c570d84054f37de5ae9c4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex3.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation3(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex4.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex4.ets deleted file mode 100644 index c73973af743e1a640a235e152a300d5665f0e6d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex4.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation4(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex5.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex5.ets deleted file mode 100644 index 767658ca272f81e84b4d9d0e7be9cf6f9cbff728..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/animation/animationIndex5.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation5(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_animation.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_animation.ets deleted file mode 100644 index 1c80e060eeda18d56905ec707b51fe65285ec8cc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_animation.ets +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -interface ListCategories { - title:string, - url:string -} - -@Entry -@Component -struct AnimationIndex { - @State message: string = 'CApi'; - @State isShow: boolean = false; - private items : ListCategories[] = [ - {title:'NODE_TRANSFORM_CENTER, NODE_TRANSITION',url:'pages/animation/animationIndex1'}, - {title:'NODE_OPACITY_TRANSITION,NODE_ROTATE_TRANSITION,NODE_SCALE_TRANSITION',url:'pages/animation/animationIndex2'}, - {title:'NODE_TRANSLATE_TRANSITION,NODE_MOVE_TRANSITION,',url:'pages/animation/animationIndex3'}, - {title:'NODE_RENDER_FIT',url:'pages/animation/animationIndex4'}, - {title:'NODE_GEOMETRY_TRANSITION',url:'pages/animation/animationIndex5'}, - ]; - - @Builder cApiMenu() { - Grid() { - ForEach(this.items, (item: ListCategories) => { - GridItem() { - Button(item.title) - .key(item.title) - .width('100%') - .height('100%') - .fontSize(10) - .padding(1) - .onClick(() => { - this.getUIContext().getRouter().pushUrl({ url: item.url }); - }) - } - }) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr') - .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr') - .columnsGap(8) - .rowsGap(8) - .width('100%') - } - - build() { - Scroll(new Scroller()) { - Column() { - Stack() { - Row() { - Text(this.message) - .fontSize(22) - .fontColor(0xFFFFFF) - .fontWeight(FontWeight.Bold) - .textAlign(TextAlign.Center) - .width('100%') - .height(50) - .backgroundColor('#FF08528A') - }.width('100%') - Button('menu') - .key('menu') - .onClick(() => { - this.isShow = true; - }) - .fontSize(10) - .position({top: 5, right: 5}) - .backgroundColor(Color.Transparent) - .fontColor(Color.Transparent) - .bindSheet($$this.isShow, this.cApiMenu(), { - showClose: false, - preferType: SheetType.BOTTOM - }) - } - - List({ space: '20vp' }) { - ForEach(this.items, (item: ListCategories) => { - ListItem() { - Button(item.title) - .fontSize(15) - .labelStyle({ maxLines: 10 }) - .onClick(() => { - this.getUIContext().getRouter().pushUrl({ url: item.url }); - }) - } - }) - }.alignListItem(ListItemAlign.Center).margin({ top: '10vp' }).width('90%').height('90%') - }.width('100%').height('100%').backgroundColor('#FFDDE7F6') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_getDrawableDescriptor.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_getDrawableDescriptor.ets deleted file mode 100644 index 9465c5404f23ba4fccbee8d32427dfed6698250f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_getDrawableDescriptor.ets +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { DrawableDescriptor } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - @State sr1:Resource = $r('app.string.GetDrawableDescriptor_result0'); - @State sr2:Resource = $r('app.string.GetDrawableDescriptor_result0'); - build() { - Row() { - Column() { - Button($r('app.string.GetDrawableDescriptor_return')).onClick(() => { - this.getUIContext().getRouter().back() - }) - - Text($r('app.string.GetDrawableDescriptor_label')) - .fontSize(20) - .margin(20) - - Text($r('app.string.GetDrawableDescriptor_label2')) - .fontSize(20) - .margin(20) - - Button($r('app.string.GetDrawableDescriptor_button1')) - .onClick(() => { - let resManager = this.getUIContext().getHostContext()?.resourceManager - let imageRes: DrawableDescriptor = (resManager?.getDrawableDescriptor($r('app.media.foreground').id, 120)) as DrawableDescriptor; - - let res1 = Napi.processDrawable(imageRes); - if (res1 === 0) { - this.sr1 = $r('app.string.GetDrawableDescriptor_result1'); - } else { - this.sr1 = $r('app.string.GetDrawableDescriptor_result2'); - } - }) - .margin({top:40,bottom:20}) - - Text(this.sr1) - .fontSize(16) - .margin(20) - - Button($r('app.string.GetDrawableDescriptor_button2')) - .onClick(() => { - let resManager = this.getUIContext().getHostContext()?.resourceManager - let imageRes: DrawableDescriptor = (resManager?.getDrawableDescriptor($r('app.media.foreground').id)) as DrawableDescriptor; - let res2 = Napi.processDrawable2(imageRes); - if (res2 === 0) { - this.sr2 = $r('app.string.GetDrawableDescriptor_result3'); - } else { - this.sr2 = $r('app.string.GetDrawableDescriptor_result4'); - } - }) - Text(this.sr2) - .fontSize(16) - .margin(20) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_navigation.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_navigation.ets deleted file mode 100644 index 6fb1b5fb47f0ce5c4a907b22d099f48d0203fd5d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_navigation.ets +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - @Provide('pageStack') pageStack: NavPathStack = new NavPathStack(); - - @Builder - PagesMap(name: string) { - if (name === 'PageOne') { - PageOne(); - } else if (name === 'PageTwo') { - PageTwo(); - } - } - - build() { - Navigation(this.pageStack) { - Column() { - Button('pushPath').onClick(() => { - this.pageStack.pushPath({ name: 'PageOne' }); - }).margin('sys.float.menu_item_content_align') - Button('pushPath with param').onClick(() => { - this.pageStack.pushPath({ name: 'PageOne', param: 'param' }); - }).margin('sys.float.menu_item_content_align') - Button('pushPath Two').onClick(() => { - this.pageStack.pushPath({ name: 'PageTwo', param: 'param' }); - }).margin('sys.float.menu_item_content_align') - Button('pop').onClick(() => { - this.pageStack.pop(); - }).margin('sys.float.menu_item_content_align') - } - } - .title('NavIndex') - .id('This is Navigation ID') - .mode(NavigationMode.Split) - .navDestination(this.PagesMap) - .navBarWidth('50%') - .backgroundColor('#2aa1a6b1') - } -} - -@Component -export struct PageOne { - @Consume('pageStack') pageStack: NavPathStack; - private nodeContent = new NodeContent(); - - build() { - NavDestination(){ - Column(){ - Text('This is PageOne') - .fontSize(20) - ContentSlot(this.nodeContent) - }.width('100%').height('100%') - }.title('NavDestination') - .onWillShow(()=>{ - Napi.createNativeNaviNode(this.nodeContent); - }) - .id('This is NavDestination ID1') - .backgroundColor('#2aa1a6b1') - } -} - -@Component -export struct PageTwo { - @Consume('pageStack') pageStack: NavPathStack; - private nodeContent = new NodeContent(); - - build() { - NavDestination(){ - Column(){ - Text('This is PageTwo') - .fontSize(20) - ContentSlot(this.nodeContent) - }.width('100%').height('100%') - }.title('NavDestination') - .onWillShow(()=>{ - Napi.createNativeNaviNode(this.nodeContent); - }) - .id('This is NavDestination ID2') - .backgroundColor('#2aa1a6b1') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_visual_effects.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_visual_effects.ets deleted file mode 100644 index f0dc131d5b45253c8bce3ae8c1e949e8dd4bee15..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/page_visual_effects.ets +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -interface ListCategoriesTwo { - title:string, - url:string -} - -@Entry -@Component -struct VisualEffectsIndex { - @State message: string = 'CApi'; - @State isShow: boolean = false; - private items : ListCategoriesTwo[] = [ - {title:'NODE_TRANSLATE,NODE_SCALE,NODE_ROTATE',url:'pages/visualEffects/visualEffectsIndex1'}, - {title:'NODE_BRIGHTNESS,NODE_SATURATION,NODE_BLUR',url:'pages/visualEffects/visualEffectsIndex2'}, - {title:'NODE_LINEAR_GRADIENT,NODE_OPACITY,NODE_CLIP',url:'pages/visualEffects/visualEffectsIndex3'}, - {title:'NODE_CLIP_SHAPE,NODE_TRANSFORM,NODE_SHADOW',url:'pages/visualEffects/visualEffectsIndex4'}, - {title:'NODE_SWEEP_GRADIENT,NODE_RADIAL_GRADIENT,NODE_MASK',url:'pages/visualEffects/visualEffectsIndex5'}, - {title:'NODE_GRAY_SCALE,NODE_INVERT,NODE_SEPIA',url:'pages/visualEffects/visualEffectsIndex6'}, - {title:'NODE_CONTRAST,NODE_FOREGROUND_COLOR,NODE_MARK_ANCHOR',url:'pages/visualEffects/visualEffectsIndex7'}, - {title:'NODE_TRANSLATE_WITH_PERCENT,NODE_ROTATE_ANGLE,NODE_CUSTOM_SHADOW', - url:'pages/visualEffects/visualEffectsIndex8'}, - {title:'NODE_BACKGROUND_BLUR_STYLE,NODE_FOREGROUND_BLUR_STYLE,NODE_COLOR_BLEND', - url:'pages/visualEffects/visualEffectsIndex9'}, - {title:'NODE_BACKDROP_BLUR,NODE_RENDER_GROUP',url:'pages/visualEffects/visualEffectsIndex10'}, - ]; - - @Builder cApiMenu() { - Grid() { - ForEach(this.items, (item: ListCategoriesTwo) => { - GridItem() { - Button(item.title) - .key(item.title) - .width('100%') - .height('100%') - .fontSize(10) - .padding(1) - .onClick(() => { - this.getUIContext().getRouter().pushUrl({ url: item.url }); - }) - } - }) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr') - .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr') - .columnsGap(8) - .rowsGap(8) - .width('100%') - } - - build() { - Scroll(new Scroller()) { - Column() { - Stack() { - Row() { - Text(this.message) - .fontSize(22) - .fontColor(0xFFFFFF) - .fontWeight(FontWeight.Bold) - .textAlign(TextAlign.Center) - .width('100%') - .height(50) - .backgroundColor('#FF08528A') - }.width('100%') - Button('menu') - .key('menu') - .onClick(() => { - this.isShow = true; - }) - .fontSize(10) - .position({top: 5, right: 5}) - .backgroundColor(Color.Transparent) - .fontColor(Color.Transparent) - .bindSheet($$this.isShow, this.cApiMenu(), { - showClose: false, - preferType: SheetType.BOTTOM - }) - } - - List({ space: '20vp' }) { - ForEach(this.items, (item: ListCategoriesTwo) => { - ListItem() { - Button(item.title) - .fontSize(15) - .labelStyle({ maxLines: 10 }) - .onClick(() => { - this.getUIContext().getRouter().pushUrl({ url: item.url }); - }) - } - }) - }.alignListItem(ListItemAlign.Center).margin({ top: '10vp' }).width('90%').height('90%') - }.width('100%').height('100%').backgroundColor('#FFDDE7F6') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex1.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex1.ets deleted file mode 100644 index 94fc947ff9f496f1792947e56aa91951a2e6d7b2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex1.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects1(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex10.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex10.ets deleted file mode 100644 index 851093f08ee46f50cb67548a958a7f791dc2fd71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex10.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects10(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex2.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex2.ets deleted file mode 100644 index d8f357ffdd2900058a1a2627550a316f55d200b0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex2.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects2(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex3.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex3.ets deleted file mode 100644 index bc29d96ff9fd107baa0fe45048a6ef48fc3fc1c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex3.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects3(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex4.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex4.ets deleted file mode 100644 index 4b6b68f610d5d64822657a2b9f113af49b2efb26..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex4.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects4(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex5.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex5.ets deleted file mode 100644 index ba1387c199db2aa664aadb3ab1be70c3971f20eb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex5.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects5(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex6.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex6.ets deleted file mode 100644 index e84d7ef53eacf56733ef054c3842872d2fa662f0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex6.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects6(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex7.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex7.ets deleted file mode 100644 index aa7002c7acb106f509161784ea1a9bbd3e3c93d6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex7.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects7(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex8.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex8.ets deleted file mode 100644 index f709a9739fc419a5badb8d2db24ec3bf9c9b181c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex8.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects8(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex9.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex9.ets deleted file mode 100644 index 78da5607f9c18e44803a448d867123d43609fb61..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex9.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects9(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/module.json5 b/ArkUIKit/NativeNodeNapiSample/entry/src/main/module.json5 deleted file mode 100644 index 6ab131223385e5f7e4f94f0e284489aff17ad82d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/element/color.json b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/element/float.json b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/element/string.json b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 03cc0fcefa6443a1b7861fc6802d99cc8d0f96c1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "GetDrawableDescriptor_label", - "value": "映射 Drawable 示例" - }, - { - "name": "GetDrawableDescriptor_label2", - "value": "ArkTS侧创建的DrawableDescriptor映射到Native侧" - }, - { - "name": "GetDrawableDescriptor_button1", - "value": "方式1:GetDrawableDescriptorFromNapiValue" - }, - { - "name": "GetDrawableDescriptor_result1", - "value": "测试结果: 方式1映射DrawableDescriptor成功" - }, - { - "name": "GetDrawableDescriptor_result2", - "value": "测试结果: 方式1映射DrawableDescriptor失败" - }, - { - "name": "GetDrawableDescriptor_button2", - "value": "方式2:GetDrawableDescriptorFromResourceNapiValue" - }, - { - "name": "GetDrawableDescriptor_result3", - "value": "测试结果: 方式2映射DrawableDescriptor成功" - }, - { - "name": "GetDrawableDescriptor_result4", - "value": "测试结果: 方式2映射DrawableDescriptor失败" - }, - { - "name": "GetDrawableDescriptor_result0", - "value": "测试结果: " - }, - { - "name": "GetDrawableDescriptor_return", - "value": " 返回上页 " - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/background.png b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index e79ae471f8fa5cc6def34637562c9ac3dfbdf7ed..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/page_navigation", - "pages/page_getDrawableDescriptor", - "pages/page_animation", - "pages/animation/animationIndex1", - "pages/animation/animationIndex2", - "pages/animation/animationIndex3", - "pages/animation/animationIndex4", - "pages/animation/animationIndex5", - "pages/page_visual_effects", - "pages/visualEffects/visualEffectsIndex1", - "pages/visualEffects/visualEffectsIndex2", - "pages/visualEffects/visualEffectsIndex3", - "pages/visualEffects/visualEffectsIndex4", - "pages/visualEffects/visualEffectsIndex5", - "pages/visualEffects/visualEffectsIndex6", - "pages/visualEffects/visualEffectsIndex7", - "pages/visualEffects/visualEffectsIndex8", - "pages/visualEffects/visualEffectsIndex9", - "pages/visualEffects/visualEffectsIndex10" - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/dark/element/color.json b/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f67579d6e31b5f5aeea463e216b9b141048..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/ohosTest/module.json5 b/ArkUIKit/NativeNodeNapiSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 69026872775eebd0844900b225c411959ae5608b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/test/List.test.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NativeNodeNapiSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/hvigor/hvigor-config.json5 b/ArkUIKit/NativeNodeNapiSample/hvigor/hvigor-config.json5 deleted file mode 100644 index c46181e346e0b1a9f966305a9164616bd2db470e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "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/ArkUIKit/NativeNodeNapiSample/hvigorfile.ts b/ArkUIKit/NativeNodeNapiSample/hvigorfile.ts deleted file mode 100644 index de06c780c9687a49f0161e161816f18af7354ff0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/oh-package.json5 b/ArkUIKit/NativeNodeNapiSample/oh-package.json5 deleted file mode 100644 index c1f77ef1fa70a9ffe74e46cdf21b6e0bda81aed5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/NativeNodeNapiSample/ohosTest.md b/ArkUIKit/NativeNodeNapiSample/ohosTest.md deleted file mode 100644 index 6e353806896bb2b8831dcee1abf080d53ab613ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期显示 | 是否自动 | 测试结果 | -| ---------------------------------------- | ------------ | ------------------------------------------------------------ | --------------------------------------- | -------- | -------- | -| 启动应用 | 设备正常运行 | 1.开启开发板
2.编译hap包并将hap包及环境烧录进开发板,运行测试用例
| 成功拉起应用。 | 否 | 验证通过 | -| swiper正确获取navigation和router相关信息 | 应用位于首页 | 1.点击首页navigation按钮
2.点击pushPath按钮 | 1.获取到以A0ff00/Manager为tag的相关日志 | 否 | 验证通过 | -| 测试ArkTS侧创建的DrawableDescriptor对象映射到Native侧接口1 | 应用位于首页 | 1.点击首页Mapping DrawableDescriptor按钮
2.点击方式1:GetDrawableDescriptorFromNapiValue按钮 | 1.界面显示 测试结果: 方式1映射DrawableDescriptor成功 | 否 | 验证通过 | -| 测试ArkTS侧创建的DrawableDescriptor对象映射到Native侧接口2 | 应用位于首页 | 1.点击首页Mapping DrawableDescriptor按钮
2.点击方式2:GetDrawableDescriptorFromResourceNapiValue按钮 | 1.界面显示 测试结果: 方式2映射DrawableDescriptor成功 | 否 | 验证通过 | \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/screenshots/mappingDescriptor.jpeg b/ArkUIKit/NativeNodeNapiSample/screenshots/mappingDescriptor.jpeg deleted file mode 100644 index 99fa8aa23aeb90336e549952611a9cc7af3727ab..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeNapiSample/screenshots/mappingDescriptor.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeNodeNapiSample/screenshots/page_navigation.jpeg b/ArkUIKit/NativeNodeNapiSample/screenshots/page_navigation.jpeg deleted file mode 100644 index 22893826aafd4fa19003a49dba5a6b6f4c6f33f8..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeNapiSample/screenshots/page_navigation.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/.gitignore b/ArkUIKit/NativeTypeSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NativeTypeSample/AppScope/app.json5 b/ArkUIKit/NativeTypeSample/AppScope/app.json5 deleted file mode 100644 index 6bfccda26f1df2cdf0e8b961fefaf6afafe0f425..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.native_type_sample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NativeTypeSample/AppScope/resources/base/element/string.json b/ArkUIKit/NativeTypeSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 63f6db99cd72d23257e11b8def239e69b3733ab7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "native_type_sample" - } - ] -} diff --git a/ArkUIKit/NativeTypeSample/AppScope/resources/base/media/background.png b/ArkUIKit/NativeTypeSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/AppScope/resources/base/media/foreground.png b/ArkUIKit/NativeTypeSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/AppScope/resources/base/media/layered_image.json b/ArkUIKit/NativeTypeSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/README.md b/ArkUIKit/NativeTypeSample/README.md deleted file mode 100644 index a7161a36b3b4cd8614c2392e0e0d2757a85f7762..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/README.md +++ /dev/null @@ -1,184 +0,0 @@ -# Native_node_Sample - -## 介绍 - -本示例展示了如何创建文本、输入框、文本域、视效、动效、进度条、日期选择器、日历选择器、文本选择器、图片、滑动容器等组件,配置其样式、属性与事件设置等功能,构建文本页面。 - -## 效果预览 - -| 首页 | Text页面 | Swiper页面 |Public页面 | -| ---- | ----------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| | | | | - - -## 使用说明 - -1. 安装编译生成的hap包,并打开应用; -2. 首页面会出现对应text选择框,点击选择框进入text界面; -3. 点击Public选择框进入通用属性的CAPI接口展示界面。 -4. 点击Progress选择框进入Progress组件的CAPI接口展示界面; - -| Progress页面 | -|-----------------------------------------------------------| -| | -5. 点击DatePicker选择框进入DatePicker组件的CAPI接口展示界面; - -| DatePicker页面 | -|-----------------------------------------------------------| -| | -6. 点击TextPicker选择框进入TextPicker组件的CAPI接口展示界面; - -| TextPicker页面 | -|-----------------------------------------------------------| -| | -7. 点击CalendarPicker选择框进入CalendarPicker组件的CAPI接口展示界面; - -| CalendarPicker页面 | -|-----------------------------------------------------------| -| | -8. 点击Image选择框进入Image组件的CAPI接口展示界面; - -| Image页面 | -|--------------------------------------------------------| -| | -9. 点击ImageAnimator选择框进入ImageAnimator组件的CAPI接口展示界面; - -| ImageAnimator页面 | -|--------------------------------------------------------| -| | -10. 点击Button选择框进入Button组件的CAPI接口展示界面; - -| Button页面 | -|-----------------------------------------------------------| -| | -11. 点击Slider选择框进入Slider组件的CAPI接口展示界面; - -| Slider页面 | -|-----------------------------------------------------------| -| | -12. 点击CheckboxShape选择框进入checkbox组件的CAPI接口展示界面; - -| CheckboxShape页面 | -|-----------------------------------------------------------| -| | -13. 点击HoverModeAreaType选择框进入HoverModeArea组件的CAPI接口展示界面; - -## 工程目录 - -``` -native_type_sample -entry/src/main/ets/ -└── pages - ├── Index.ets (获取导航页面) - ├── page_animation.ets (动效界面) - ├── page_button.ets (按钮界面) - ├── page_visual_effects.ets (视效界面) - ├── page_slider.ets (滑块界面) - ├── page_checkbox_shape.ets (复选框形状界面) - ├── page_hovermode_areatype.ets (悬停模式区域类型界面) - ├── page_text.ets (文本界面) - ├── page_swiper.ets (滑动容器页面) - ├── page_accessibility.ets (无障碍界面) - ├── page_public_event.ets (通用属性页面) - ├──page_xcomponent.ets (XComponent界面) - ├── page_progress.ets (进度条页面) - ├── page_calendar_picker.ets (日历选择器页面) - ├── page_date_picker.ets (日期选择器页面) - ├── page_image.ets (图片页面) - ├── page_image_animator.ets (图片帧页面) - ├── page_text_picker.ets (文本选择器页面) - └── page_embedded_component.ets (嵌入式组件界面) -entry/src/main/ -├── cpp -│ ├── types -│ │ └── libentry -│ │ └── Index.d.ts (函数对应的js映射) -│ ├── ArkUIAnimationNode.h -│ ├── ArkUIBaseNode.h -│ ├── ArkUIButtonNode.h -│ ├── ArkUIColumnNode.h -│ ├── ArkUINode.h -│ ├── ArkUINumber.h -│ ├── ArkUITextNode.h -│ ├── ArkUIVisualEffectsNode.h -│ ├── NativeModule.h -│ ├── CMakeLists.txt (CMake脚本) -| ├── manager.cpp -| ├── manager.h -│ ├── napi_init.cpp -| ├── ....... -| ├── baseUtils.cpp -| ├── baseUtils.h -| ├── PublicEvent.cpp -| ├── PublicEvent.h -| ├── ButtonMaker.cpp -| ├── ButtonMaker.h -| ├── SwiperMaker.cpp -| ├── SwiperMaker.h -| ├── SliderMaker.cpp -| ├── SliderMaker.h -| ├── TextMaker.cpp -│ ├── TextMaker.h -| ├── AccessibilityMaker.cpp -│ ├── AccessibilityMaker.h -| ├── XComponentMaker.cpp -│ ├── XComponentMaker.h -| ├── NodeManager.cpp -│ ├── NodeManager.h -| ├── EmbeddedComponentMaker.cpp -│ ├── EmbeddedComponentMaker.h -| ├── CheckboxShapeMaker.cpp -│ ├── CheckboxShapeMaker.h -| ├── HoverModeAreaTypeMaker.cpp -│ └── HoverModeAreaTypeMaker.h -└── resources - ├── base - │ ├── element - │ │ ├── color.json - │ │ ├── float.json - │ │ └── string.json - │ └── media -``` - -## 组件描述 - -1. [Progress组件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-node-h.md#arkui_nodetype) - 为进度条组件,用于显示内容加载或操作处理等进度。 -2. [Datepicker组件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-node-h.md#arkui_nodetype) - 为滑动选择日期的组件。 -3. [TextPicker组件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-node-h.md#arkui_nodetype) - 为滑动选择文本、图片或图文混排内容的组件。 -4. [CalendarPicker组件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-node-h.md#arkui_nodetype) - 为日历选择器组件,提供下拉日历弹窗,可以让用户选择日期。 -5. [Image组件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-node-h.md#arkui_nodetype) - 为图片组件,常用于在应用中显示图片。 -6. [ImageAnimator组件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-node-h.md#arkui_nodetype) - 该组件提供帧动画组件来实现逐帧播放图片的能力,可以配置需要播放的图片列表,每张图片可以配置时长。 - -## 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束和限制 - -1. 本示例支持标准系统上运行,支持设备:RK3568; - -2. 本示例支持API20版本SDK,版本号:6.0.0.36; - -3. 本示例已支持使DevEco Studio 5.1.1 Release (构建版本:5.1.1.840,构建 2025年9月20日)编译运行 - -## 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/NativeType/native_node_sample > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/ArkUIKit/NativeTypeSample/build-profile.json5 b/ArkUIKit/NativeTypeSample/build-profile.json5 deleted file mode 100644 index 11e19dc1ca66d83c53c3d66d57197bb03f63b418..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/code-linter.json5 b/ArkUIKit/NativeTypeSample/code-linter.json5 deleted file mode 100644 index 4c531be90a6c875995767bd87f2de3cbd6b55160..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/.gitignore b/ArkUIKit/NativeTypeSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/build-profile.json5 b/ArkUIKit/NativeTypeSample/entry/build-profile.json5 deleted file mode 100644 index cde7025c2f1abfabf3018c66ae28c544ed107210..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a", "x86_64" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/hvigorfile.ts b/ArkUIKit/NativeTypeSample/entry/hvigorfile.ts deleted file mode 100644 index 10f881f112b08550ed5c8a3ceb7d0148be2a0b6e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/obfuscation-rules.txt b/ArkUIKit/NativeTypeSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NativeTypeSample/entry/oh-package.json5 b/ArkUIKit/NativeTypeSample/entry/oh-package.json5 deleted file mode 100644 index 9f254ab4d0e3a4de30318e04483b785b552ce977..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/AccessibilityMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/AccessibilityMaker.cpp deleted file mode 100644 index 82317fee19cf6bd9ee79c5f6a3f8a8e4e0d4a1f0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/AccessibilityMaker.cpp +++ /dev/null @@ -1,680 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include -#include -#include "AccessibilityMaker.h" - -constexpr int32_t ACCESSIBILITY_VALUE_MIN = 0; -constexpr int32_t ACCESSIBILITY_VALUE_MAX = 100; -constexpr int32_t ACCESSIBILITY_VALUE_CURRENT = 50; -constexpr int32_t ACCESSIBILITY_RANGE_MIN = 0; -constexpr int32_t ACCESSIBILITY_RANGE_MAX = 10; -constexpr int32_t ACCESSIBILITY_RANGE_CURRENT = 5; -constexpr int EVENT_ID = 11111; -constexpr float COL_WIDTH_PX = 300.0f; -constexpr float TEXT_WIDTH_PX = 300.0f; -constexpr float TEXT_HEIGHT_PX = 100.0f; -constexpr float BORDER_WIDTH_PX = 1.0f; -constexpr float BUTTON_WIDTH_PX = 200.0f; -constexpr float BUTTON_HEIGHT_PX = 50.0f; -constexpr float BUTTON_MARGIN_PX = 5.0f; -constexpr const char* SAMPLE_TEXT = "Hello Accessibility Sample"; -constexpr const char* ACCESSIBILITY_VALUE_TEXT = "Value"; -static ArkUI_AccessibilityState* accessibilityState_; -static ArkUI_AccessibilityValue* accessibilityValue_; - -void AccessibilityMaker::CreateAccessibilitySelectedSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "1. 通过 OH_ArkUI_AccessibilityState_SetSelected 设置无障碍状态:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, "Hello Accessibility Sample(non-selected)"); - ArkUI_NodeHandle text3 = BuildTextNode(nodeApi, "Hello Accessibility Sample(selected)"); - CreateAccessibilityState(); - SetAccessibilityDisabled(false); - bool disabled = IsAccessibilityDisabled(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "IsAccessibilityDisabled: disabled=%{public}d", - disabled); - SetAccessibilitySelected(true); - bool selected = IsAccessibilitySelected(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "IsAccessibilitySelected: selected=%{public}d", - selected); - ArkUI_AttributeItem accessibilityItem = { .object = accessibilityState_ }; - nodeApi->setAttribute(text3, NODE_ACCESSIBILITY_STATE, &accessibilityItem); - SetAccessibilitySelected(false); - accessibilityItem = { .object = accessibilityState_ }; - nodeApi->setAttribute(text2, NODE_ACCESSIBILITY_STATE, &accessibilityItem); - nodeApi->addChild(column, text2); - nodeApi->addChild(column, text3); - nodeApi->addChild(parent, column); -} - -void AccessibilityMaker::CreateAccessibilityCheckedSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "2. 通过 OH_ArkUI_AccessibilityState_SetCheckedState 设置无障碍状态:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - ArkUI_NodeHandle checkbox = nodeApi->createNode(ARKUI_NODE_CHECKBOX); - ArkUI_NodeHandle checkbox2 = nodeApi->createNode(ARKUI_NODE_CHECKBOX); - CreateAccessibilityState(); - SetAccessibilityDisabled(false); - bool disabled = IsAccessibilityDisabled(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "IsAccessibilityDisabled: disabled=%{public}d", - disabled); - SetAccessibilityCheckedState(ARKUI_ACCESSIBILITY_UNCHECKED); - int32_t checkedState = GetAccessibilityCheckedState(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityCheckedState: state=%{public}d", - checkedState); - ArkUI_AttributeItem accessibilityItem = { .object = accessibilityState_ }; - nodeApi->setAttribute(parent, NODE_ACCESSIBILITY_STATE, &accessibilityItem); - SetAccessibilityCheckedState(ARKUI_ACCESSIBILITY_CHECKED); - accessibilityItem = { .object = accessibilityState_ }; - nodeApi->setAttribute(checkbox2, NODE_ACCESSIBILITY_STATE, &accessibilityItem); - nodeApi->addChild(column, checkbox); - nodeApi->addChild(column, checkbox2); - nodeApi->addChild(parent, column); -} - -void AccessibilityMaker::CreateAccessibilityValueSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "3. 通过 NODE_ACCESSIBILITY_VALUE 设置无障碍信息属性:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - CreateAccessibilityValue(); - SetAccessibilityValueMin(ACCESSIBILITY_VALUE_MIN); - int32_t valueMin = GetAccessibilityValueMin(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityValueMin: min=%{public}d", valueMin); - SetAccessibilityValueMax(ACCESSIBILITY_VALUE_MAX); - int32_t valueMax = GetAccessibilityValueMax(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityValueMax: max=%{public}d", valueMax); - SetAccessibilityValueCurrent(ACCESSIBILITY_VALUE_CURRENT); - int32_t valueCurrent = GetAccessibilityValueCurrent(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityValueCurrent: current=%{public}d", - valueCurrent); - SetAccessibilityValueText(ACCESSIBILITY_VALUE_TEXT); - const char* valueText = GetAccessibilityValueText(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityValueText: text=%{public}s", - valueText); - SetAccessibilityRangeMin(ACCESSIBILITY_RANGE_MIN); - int32_t rangeMin = GetAccessibilityRangeMin(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityRangeMin: min=%{public}d", rangeMin); - SetAccessibilityRangeMax(ACCESSIBILITY_RANGE_MAX); - int32_t rangeMax = GetAccessibilityValueMax(); - rangeMax = GetAccessibilityRangeMax(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityRangeMax: max=%{public}d", rangeMax); - SetAccessibilityRangeCurrent(ACCESSIBILITY_RANGE_CURRENT); - int32_t rangeCurrent = GetAccessibilityRangeCurrent(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityRangeCurrent: current=%{public}d", - rangeCurrent); - ArkUI_AttributeItem accessibilityValueItem = { .object = accessibilityValue_ }; - nodeApi->setAttribute(text2, NODE_ACCESSIBILITY_VALUE, &accessibilityValueItem); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityNodeIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, "4. 通过 NODE_ID 获取无障碍节点ID:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - SetNodeId(nodeApi, text2, "test node id"); - const char* nodeId = GetNodeId(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetNodeId: id=%{public}s", nodeId); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityGroupSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "5. 通过 NODE_ACCESSIBILITY_GROUP 设置无障碍分组:"); - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, "column子节点1"); - ArkUI_NodeHandle text3 = BuildTextNode(nodeApi, "column子节点2"); - SetAccessibilityGroup(nodeApi, column, true); - bool isGroup = GetAccessibilityGroup(nodeApi, column); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityGroup: isGroup=%{public}d", isGroup); - nodeApi->addChild(column, text2); - nodeApi->addChild(column, text3); - nodeApi->addChild(parent, text1); - nodeApi->addChild(parent, column); -} - -void AccessibilityMaker::CreateAccessibilityModeSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "6. 通过 NODE_ACCESSIBILITY_MODE 设置无障碍辅助服务模式(ACCESSIBILITY_MODE):"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, "Hello Accessibility Sample(DISABLED, 不可被无障碍辅助服务所识别)"); - SetAccessibilityMode(nodeApi, text2, ARKUI_ACCESSIBILITY_MODE_DISABLED); - ArkUI_AccessibilityMode mode = GetAccessibilityMode(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityMode: mode=%{public}d", mode); - nodeApi->addChild(parent, text2); -} - - -void AccessibilityMaker::CreateAccessibilityTextSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "7. 通过 NODE_ACCESSIBILITY_TEXT 设置无障碍文本:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - SetAccessibilityText(nodeApi, text2, "This is a text"); - const char* accessibilityText = GetAccessibilityText(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityText: text=%{public}s", - accessibilityText); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityDescriptionSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "8. 通过 NODE_ACCESSIBILITY_DESCRIPTION 设置无障碍描述:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - SetAccessibilityDescription(nodeApi, text2, "This is accessibility description"); - const char* description = GetAccessibilityDescription(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityDescription: description=%{public}s", - description); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "9. 通过 NODE_ACCESSIBILITY_ID 获取无障碍ID:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - int accessibilityId = GetAccessibilityId(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityId: id=%{public}d", accessibilityId); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateAccessibilityActionsSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, "10. 设置无障碍支持操作事件:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle button = nodeApi->createNode(ARKUI_NODE_BUTTON); - ArkUI_NumberValue button_widthValue[] = {BUTTON_WIDTH_PX}; - ArkUI_AttributeItem button_widthItem = {button_widthValue, 1}; - ArkUI_NumberValue button_heightValue1[] = {BUTTON_HEIGHT_PX}; - ArkUI_AttributeItem button_heightItem = {button_heightValue1, 1}; - ArkUI_NumberValue marginValue[] = {BUTTON_MARGIN_PX}; - ArkUI_AttributeItem marginItem = {marginValue, 1}; - nodeApi->setAttribute(button, NODE_WIDTH, &button_widthItem); - nodeApi->setAttribute(button, NODE_HEIGHT, &button_heightItem); - nodeApi->setAttribute(button, NODE_MARGIN, &marginItem); - SetAccessibilityActions(nodeApi, button); - nodeApi->registerNodeEvent(button, NODE_ON_CLICK, 0, nullptr); - nodeApi->registerNodeEvent(button, NODE_ON_ACCESSIBILITY_ACTIONS, EVENT_ID, nullptr); - nodeApi->registerNodeEventReceiver([](ArkUI_NodeEvent *event) { - auto eventId = OH_ArkUI_NodeEvent_GetTargetId(event); - if (eventId == EVENT_ID) { - auto componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - auto actionType = componentEvent->data[0].u32; - switch (actionType) { - case ARKUI_ACCESSIBILITY_ACTION_CLICK: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ARKUI_ACCESSIBILITY_ACTION_CLICK"); - break; - default: - break; - } - } - }); - nodeApi->addChild(parent, button); -} - -void AccessibilityMaker::CreateAccessibilityRoleSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "11. 通过 NODE_ACCESSIBILITY_ROLE 设置无障碍组件类型:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - SetAccessibilityRole(nodeApi, text2, ARKUI_NODE_TEXT); - uint32_t role = GetAccessibilityRole(nodeApi, text2); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetAccessibilityRole: role=%{public}u", role); - nodeApi->addChild(parent, text2); -} - -void AccessibilityMaker::CreateUniqueIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent) -{ - ArkUI_NodeHandle text1 = BuildTextNodeWithoutAccessibilityFocus(nodeApi, - "12. 通过 NODE_UNIQUE_ID 获取唯一ID:"); - nodeApi->addChild(parent, text1); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, SAMPLE_TEXT); - GetUniqueId(nodeApi, text2); - nodeApi->addChild(parent, text2); -} - -ArkUI_NodeHandle AccessibilityMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return nullptr; - } - // 创建一个Column容器组件 - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - // 创建Text组件 - ArkUI_NodeHandle text = BuildTextNode(nodeApi, SAMPLE_TEXT); - - auto scrollNode = nodeApi->createNode(ARKUI_NODE_SCROLL); - nodeApi->addChild(scrollNode, column); - - CreateAccessibilitySelectedSection(nodeApi, column); - CreateAccessibilityCheckedSection(nodeApi, column); - CreateAccessibilityValueSection(nodeApi, column); - CreateAccessibilityNodeIdSection(nodeApi, column); - CreateAccessibilityGroupSection(nodeApi, column); - CreateAccessibilityModeSection(nodeApi, column); - CreateAccessibilityTextSection(nodeApi, column); - CreateAccessibilityDescriptionSection(nodeApi, column); - CreateAccessibilityIdSection(nodeApi, column); - CreateAccessibilityActionsSection(nodeApi, column); - CreateAccessibilityRoleSection(nodeApi, column); - CreateUniqueIdSection(nodeApi, column); - - // Column作为XComponent子组件 - return scrollNode; -} - -ArkUI_NodeHandle AccessibilityMaker::BuildTextNodeWithoutAccessibilityFocus(ArkUI_NativeNodeAPI_1* nodeApi, - const char* content) -{ - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = TEXT_WIDTH_PX}}; - ArkUI_AttributeItem textWidthItem = { textWidth, sizeof(textWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = TEXT_HEIGHT_PX}}; - ArkUI_AttributeItem textHeightItem = { textHeight, sizeof(textHeight) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - ArkUI_AttributeItem valueItem = {.string = content}; - nodeApi->setAttribute(text, NODE_TEXT_CONTENT, &valueItem); - SetAccessibilityMode(nodeApi, text, ARKUI_ACCESSIBILITY_MODE_DISABLED); - return text; -} -ArkUI_NodeHandle AccessibilityMaker::BuildTextNode(ArkUI_NativeNodeAPI_1* nodeApi, const char* content) -{ - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = TEXT_WIDTH_PX}}; - ArkUI_AttributeItem textWidthItem = { textWidth, sizeof(textWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = TEXT_HEIGHT_PX}}; - ArkUI_AttributeItem textHeightItem = { textHeight, sizeof(textHeight) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - ArkUI_AttributeItem valueItem = {.string = content}; - nodeApi->setAttribute(text, NODE_TEXT_CONTENT, &valueItem); - return text; -} - -ArkUI_NodeHandle AccessibilityMaker::BuildColumnNode(ArkUI_NativeNodeAPI_1* nodeApi) -{ - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = COL_WIDTH_PX}}; - ArkUI_AttributeItem widthItem = { colWidth, sizeof(colWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - return column; -} - -AccessibilityMaker::~AccessibilityMaker() -{ - DisposeAccessibilityState(); - DisposeAccessibilityValue(); -} - -void AccessibilityMaker::CreateAccessibilityState() -{ - if (!accessibilityState_) { - accessibilityState_ = OH_ArkUI_AccessibilityState_Create(); - } -} - -void AccessibilityMaker::SetAccessibilityDisabled(bool isDisabled) -{ - if (accessibilityState_) { - OH_ArkUI_AccessibilityState_SetDisabled(accessibilityState_, isDisabled); - } -} - -bool AccessibilityMaker::IsAccessibilityDisabled() -{ - if (accessibilityState_) { - return OH_ArkUI_AccessibilityState_IsDisabled(accessibilityState_); - } - return false; -} - -void AccessibilityMaker::SetAccessibilitySelected(bool isSelected) -{ - if (accessibilityState_) { - OH_ArkUI_AccessibilityState_SetSelected(accessibilityState_, isSelected); - } -} - -bool AccessibilityMaker::IsAccessibilitySelected() -{ - if (accessibilityState_) { - return OH_ArkUI_AccessibilityState_IsSelected(accessibilityState_); - } - return false; -} - -void AccessibilityMaker::SetAccessibilityCheckedState(int32_t checkedState) -{ - if (accessibilityState_) { - OH_ArkUI_AccessibilityState_SetCheckedState(accessibilityState_, checkedState); - } -} - -int32_t AccessibilityMaker::GetAccessibilityCheckedState() -{ - if (accessibilityState_) { - return OH_ArkUI_AccessibilityState_GetCheckedState(accessibilityState_); - } - return 0; -} - -void AccessibilityMaker::DisposeAccessibilityState() -{ - if (accessibilityState_) { - OH_ArkUI_AccessibilityState_Dispose(accessibilityState_); - accessibilityState_ = nullptr; - } -} - -void AccessibilityMaker::CreateAccessibilityValue() -{ - if (!accessibilityValue_) { - accessibilityValue_ = OH_ArkUI_AccessibilityValue_Create(); - } -} - -void AccessibilityMaker::DisposeAccessibilityValue() -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_Dispose(accessibilityValue_); - accessibilityValue_ = nullptr; - } -} - -void AccessibilityMaker::SetAccessibilityValueMin(int32_t min) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetMin(accessibilityValue_, min); - } -} - -int32_t AccessibilityMaker::GetAccessibilityValueMin() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetMin(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityValueMax(int32_t max) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetMax(accessibilityValue_, max); - } -} - -int32_t AccessibilityMaker::GetAccessibilityValueMax() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetMax(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityValueCurrent(int32_t current) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetCurrent(accessibilityValue_, current); - } -} - -int32_t AccessibilityMaker::GetAccessibilityValueCurrent() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetCurrent(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityValueText(const char* text) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetText(accessibilityValue_, text); - } -} - -const char* AccessibilityMaker::GetAccessibilityValueText() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetText(accessibilityValue_); - } - return nullptr; -} - -void AccessibilityMaker::SetAccessibilityRangeMin(int32_t rangeMin) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetRangeMin(accessibilityValue_, rangeMin); - } -} - -int32_t AccessibilityMaker::GetAccessibilityRangeMin() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetRangeMin(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityRangeMax(int32_t rangeMax) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetRangeMax(accessibilityValue_, rangeMax); - } -} - -int32_t AccessibilityMaker::GetAccessibilityRangeMax() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetRangeMax(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetAccessibilityRangeCurrent(int32_t rangeCurrent) -{ - if (accessibilityValue_) { - OH_ArkUI_AccessibilityValue_SetRangeCurrent(accessibilityValue_, rangeCurrent); - } -} - -int32_t AccessibilityMaker::GetAccessibilityRangeCurrent() -{ - if (accessibilityValue_) { - return OH_ArkUI_AccessibilityValue_GetRangeCurrent(accessibilityValue_); - } - return 0; -} - -void AccessibilityMaker::SetNodeId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const char* id) -{ - if (nodeApi && node) { - ArkUI_AttributeItem idItem = {.string = id}; - nodeApi->setAttribute(node, NODE_ID, &idItem); - } -} - -const char* AccessibilityMaker::GetNodeId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attributeItem = nodeApi->getAttribute(node, NODE_ID); - if (attributeItem) { - return attributeItem->string; - } - } - return nullptr; -} - -void AccessibilityMaker::SetAccessibilityGroup(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, bool isGroup) -{ - if (nodeApi && node) { - ArkUI_NumberValue value[] = {{.i32 = isGroup}}; - ArkUI_AttributeItem item = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_GROUP, &item); - } -} - -bool AccessibilityMaker::GetAccessibilityGroup(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attributeItem = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_GROUP); - if (attributeItem) { - return attributeItem->value[0].i32; - } - } - return false; -} - -void AccessibilityMaker::SetAccessibilityMode(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - ArkUI_AccessibilityMode mode) -{ - if (nodeApi && node) { - ArkUI_NumberValue value[] = {{.i32 = mode}}; - ArkUI_AttributeItem item = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_MODE, &item); - } -} - -ArkUI_AccessibilityMode AccessibilityMaker::GetAccessibilityMode(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_MODE); - if (attr && attr->size > 0) { - return static_cast(attr->value[0].i32); - } - } - return ARKUI_ACCESSIBILITY_MODE_AUTO; -} - -void AccessibilityMaker::SetAccessibilityDescription(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - const char* description) -{ - if (nodeApi && node) { - ArkUI_AttributeItem item = {.string = description}; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_DESCRIPTION, &item); - } -} - -const char* AccessibilityMaker::GetAccessibilityDescription(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_DESCRIPTION); - if (attr) { - return attr->string; - } - } - return nullptr; -} - -int AccessibilityMaker::GetAccessibilityId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_ID); - if (attr && attr->size > 0) { - return attr->value[0].i32; - } - } - return -1; -} - -void AccessibilityMaker::SetAccessibilityText(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const char* text) -{ - if (nodeApi && node) { - ArkUI_AttributeItem item = {.string = text}; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_TEXT, &item); - } -} - -const char* AccessibilityMaker::GetAccessibilityText(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_TEXT); - if (attr) { - return attr->string; - } - } - return nullptr; -} - -void AccessibilityMaker::SetAccessibilityActions(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - ArkUI_NumberValue value[] = {{ .u32 = ARKUI_ACCESSIBILITY_ACTION_CLICK}}; - ArkUI_AttributeItem item = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_ACTIONS, &item); - } -} - -uint32_t AccessibilityMaker::GetAccessibilityActions(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_ACTIONS); - if (attr && attr->size > 0) { - return attr->value[0].u32; - } - } - return 0U; -} - -void AccessibilityMaker::SetAccessibilityRole(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - const uint32_t role) -{ - if (nodeApi && node) { - ArkUI_NumberValue value[] = {{ .u32 = role}}; - ArkUI_AttributeItem item = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(node, NODE_ACCESSIBILITY_ROLE, &item); - } -} - -uint32_t AccessibilityMaker::GetAccessibilityRole(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem* attr = nodeApi->getAttribute(node, NODE_ACCESSIBILITY_ROLE); - if (attr && attr->size > 0) { - return attr->value[0].u32; - } - } - return 0U; -} - -void AccessibilityMaker::GetUniqueId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - const ArkUI_AttributeItem *attributeItem = nodeApi->getAttribute(node, NODE_UNIQUE_ID); - // 组件id作为targetid来区分不同组件的事件。 - auto id = attributeItem->value[0].i32; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "GetUniqueId: id=%{public}d", id); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/AccessibilityMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/AccessibilityMaker.h deleted file mode 100644 index df986ca15e1aa76b5854e4f9ed89bb46ad08792f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/AccessibilityMaker.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_ACCESSIBILITYMAKER_H -#define NATIVE_TYPE_SAMPLE_ACCESSIBILITYMAKER_H - -#include -#include -#include -#include -#include "manager.h" - -class AccessibilityMaker { -public: - AccessibilityMaker(){}; - ~AccessibilityMaker(); - - static ArkUI_NodeHandle CreateNativeNode(); - static ArkUI_NodeHandle BuildTextNode(ArkUI_NativeNodeAPI_1* nodeApi, const char* content); - static ArkUI_NodeHandle BuildTextNodeWithoutAccessibilityFocus(ArkUI_NativeNodeAPI_1* nodeApi, const char* content); - - static void CreateAccessibilityState(); - static void SetAccessibilityDisabled(bool isDisabled); - static bool IsAccessibilityDisabled(); - static void SetAccessibilitySelected(bool isSelected); - static bool IsAccessibilitySelected(); - static void SetAccessibilityCheckedState(int32_t checkedState); - static int32_t GetAccessibilityCheckedState(); - static void DisposeAccessibilityState(); - static ArkUI_NodeHandle BuildColumnNode(ArkUI_NativeNodeAPI_1* nodeApi); - static void CreateAccessibilityValue(); - static void DisposeAccessibilityValue(); - static void SetAccessibilityValueMin(int32_t min); - static int32_t GetAccessibilityValueMin(); - static void SetAccessibilityValueMax(int32_t max); - static int32_t GetAccessibilityValueMax(); - static void SetAccessibilityValueCurrent(int32_t current); - static int32_t GetAccessibilityValueCurrent(); - static void SetAccessibilityValueText(const char* text); - static const char* GetAccessibilityValueText(); - static void SetAccessibilityRangeMin(int32_t rangeMin); - static int32_t GetAccessibilityRangeMin(); - static void SetAccessibilityRangeMax(int32_t rangeMax); - static int32_t GetAccessibilityRangeMax(); - static void SetAccessibilityRangeCurrent(int32_t rangeCurrent); - static int32_t GetAccessibilityRangeCurrent(); - static void SetNodeId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const char* id); - static const char* GetNodeId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityGroup(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, bool isGroup); - static bool GetAccessibilityGroup(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityMode(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - ArkUI_AccessibilityMode mode); - static ArkUI_AccessibilityMode GetAccessibilityMode(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityText(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const char* text); - static const char* GetAccessibilityText(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityDescription(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, - const char* description); - static const char* GetAccessibilityDescription(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static int GetAccessibilityId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityActions(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static uint32_t GetAccessibilityActions(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void SetAccessibilityRole(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node, const uint32_t role); - static uint32_t GetAccessibilityRole(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void GetUniqueId(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void CreateAccessibilityCheckedSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilitySelectedSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityValueSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityNodeIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityGroupSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityModeSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityTextSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityDescriptionSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityActionsSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateAccessibilityRoleSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void CreateUniqueIdSection(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle parent); - static void OnErrorCallback(int32_t code, const char* name, const char* message); - static void OnTerminatedCallback(int32_t code, AbilityBase_Want* want); -}; - -#endif // NATIVE_TYPE_SAMPLE_ACCESSIBILITYMAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIAnimationNode.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIAnimationNode.h deleted file mode 100644 index 95003e7465f972ae17d652e1959b8d125d492cc3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIAnimationNode.h +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIDOBASENODE_H -#define MYAPPLICATION_ARKUIDOBASENODE_H -#include "ArkUIColumnNode.h" -#include "ArkUITextNode.h" -#include "ArkUINumber.h" -#include "ArkUIButtonNode.h" -#include - -namespace NativeModule { -constexpr int32_t NUM_100 = 100; -constexpr int32_t NUM_120 = 120; -constexpr int32_t NUM_150 = 150; -constexpr int32_t NUM_200 = 200; -constexpr int32_t NUM_250 = 250; -constexpr int32_t NUM_300 = 300; -constexpr int32_t NUM_400 = 400; -constexpr int32_t NUM_500 = 500; -constexpr int32_t NUM_1000 = 1000; -constexpr int32_t NUM_1500 = 1500; -constexpr int32_t NUM_2000 = 2000; -constexpr int32_t NUM_0 = 0; -constexpr int32_t NUM_1 = 1; -constexpr int32_t NUM_2 = 2; -constexpr int32_t NUM_3 = 3; -constexpr int32_t NUM_4 = 4; -constexpr int32_t NUM_5 = 5; -constexpr int32_t NUM_6 = 6; -constexpr int32_t NUM_7 = 7; -constexpr int32_t NUM_8 = 8; -constexpr int32_t NUM_9 = 9; -constexpr int32_t NUM_10 = 10; -constexpr int32_t NUM_20 = 20; -constexpr int32_t NUM_30 = 30; -constexpr int32_t NUM_40 = 40; -constexpr int32_t NUM_50 = 50; -constexpr int32_t NUM_60 = 60; -constexpr int32_t NUM_80 = 80; -std::shared_ptr g_keyframe_button = nullptr; -std::shared_ptr g_keyframe_text = nullptr; -std::shared_ptr g_animateto_button = nullptr; -std::shared_ptr g_animateto_text = nullptr; -std::shared_ptr g_transition_button = nullptr; -std::shared_ptr g_animator_button = nullptr; -std::shared_ptr g_animator_text = nullptr; -ArkUI_AnimatorHandle animatorHandle = nullptr; -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -struct KeyFrameAnimateToData { - ArkUI_KeyframeAnimateOption* option; - ArkUI_CurveHandle curve; -}; - -struct AnimateData { - ArkUI_AnimateOption* option; - ArkUI_CurveHandle curve; -}; - -struct TransitionData { - ArkUI_AnimateOption* option; - ArkUI_TransitionEffect* effect; -}; -std::shared_ptr CreateAnimationFrameNode1() -{ - auto column = std::make_shared(); - auto textNodeMoveTransition = std::make_shared(); - textNodeMoveTransition->SetTextContent("ArkUI_TransitionEdge"); - textNodeMoveTransition->SetWidth(MIDDLE_LENGTH); - textNodeMoveTransition->SetHeight(SMALL_LENGTH); - auto columnMoveTransition = std::make_shared(); - columnMoveTransition->SetWidth(MIDDLE_LENGTH); - columnMoveTransition->SetHeight(MIDDLE_LENGTH); - columnMoveTransition->SetBackgroundColor(COLOR_PINK); - columnMoveTransition->SetMoveTransition(); - column->AddChild(textNodeMoveTransition); - column->AddChild(columnMoveTransition); - - return column; -} - -std::shared_ptr CreateAnimationFrameNode2() -{ - auto column = std::make_shared(); - auto textNode = std::make_shared(); - textNode->SetTextContent("ArkUI_RenderFit"); - textNode->SetWidth(MIDDLE_LENGTH); - textNode->SetHeight(SMALL_LENGTH); - - auto text = std::make_shared(); - text->SetWidth(MIDDLE_LENGTH); - text->SetHeight(SMALL_LENGTH); - text->SetBackgroundColor(COLOR_PINK); - text->SetTextContent("NODE_RENDER_FIT"); - text->SetRenderFit(ARKUI_RENDER_FIT_BOTTOM); - - g_keyframe_text = text; - text->RegisterNodeEvent(text->GetHandle(), NODE_ON_CLICK, NUMBER_1, nullptr); - auto onTouch1 = [](ArkUI_NodeEvent *event) { - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUMBER_1) { - static ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_keyframe_text->GetHandle()); - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - static ArkUI_AnimateOption *option = OH_ArkUI_AnimateOption_Create(); - OH_ArkUI_AnimateOption_SetCurve(option, ARKUI_CURVE_EASE); - ArkUI_AnimateCompleteCallback *completeCallback = new ArkUI_AnimateCompleteCallback; - completeCallback->type = ARKUI_FINISH_CALLBACK_REMOVED; - completeCallback->callback = [](void *userData) { - }; - ArkUI_ContextCallback *update = new ArkUI_ContextCallback; - update->callback = [](void *user) { - g_keyframe_text->SetWidth(LARGE_LENGTH); - g_keyframe_text->SetHeight(MIDDLE_LENGTH); - g_keyframe_text->SetBackgroundColor(COLOR_RED); - }; - animateApi->animateTo(context, option, update, completeCallback); - } - }; - text->RegisterNodeEventReceiver(onTouch1); - column->AddChild(textNode); - column->AddChild(text); - - return column; -} - -std::shared_ptr CreateAnimeteto() -{ - auto column = std::make_shared(); - column->SetWidth(NUM_300); - column->SetHeight(NUM_250); - // 创建文本节点,内容区介绍“这是animateto动画” - auto textNode = std::make_shared(); - textNode->SetTextContent("这是animateto动画"); - textNode->SetWidth(NUM_150); - textNode->SetHeight(NUM_50); - // 创建button,后续创建的动画作用在button组件上 - auto button = std::make_shared(); - // 设置button初始宽高及颜色 - button->SetWidth(NUM_100); - button->SetHeight(NUM_100); - button->SetBackgroundColor(0xFFA280FF); - // 存储button全局变量,在onTouch注册时需要使用 - g_animateto_button = button; - // 注册点击事件到button上 - button->RegisterNodeEvent(button->GetHandle(), NODE_ON_CLICK, NUM_2, nullptr); - g_animateto_text = std::make_shared(); - g_animateto_text->AnimatetoToString(); - auto onTouch = [](ArkUI_NodeEvent *event) { - // 获取context对象 - static ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_animateto_button->GetHandle()); - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_2) { - // 获取ArkUI_NativeAnimateAPI接口 - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - - // 设置动画参数 - ArkUI_AnimateOption *option = OH_ArkUI_AnimateOption_Create(); - OH_ArkUI_AnimateOption_SetDuration(option, NUM_2000); - OH_ArkUI_AnimateOption_SetTempo(option, 1.1); - OH_ArkUI_AnimateOption_SetCurve(option, ARKUI_CURVE_EASE); - ArkUI_CurveHandle cubicBezierCurve = OH_ArkUI_Curve_CreateCubicBezierCurve(0.5f, 4.0f, 1.2f, 0.0f); - // 设置动画的动画曲线,优先于OH_ArkUI_AnimateOption_SetCurve生效 - OH_ArkUI_AnimateOption_SetICurve(option, cubicBezierCurve); - OH_ArkUI_AnimateOption_SetDelay(option, NUM_20); - OH_ArkUI_AnimateOption_SetIterations(option, NUM_1); - OH_ArkUI_AnimateOption_SetPlayMode(option, ARKUI_ANIMATION_PLAY_MODE_REVERSE); - ArkUI_ExpectedFrameRateRange *range = new ArkUI_ExpectedFrameRateRange; - range->min = NUM_10; - range->max = NUM_120; - range->expected = NUM_60; - OH_ArkUI_AnimateOption_SetExpectedFrameRateRange(option, range); - - // 设置完成的回调 - ArkUI_AnimateCompleteCallback *completeCallback = new ArkUI_AnimateCompleteCallback; - completeCallback->type = ARKUI_FINISH_CALLBACK_REMOVED; - AnimateData* data = new AnimateData(); - data->option = option; - data->curve = cubicBezierCurve; - completeCallback->userData = reinterpret_cast(data); - completeCallback->callback = [](void *userData) { - AnimateData* data = reinterpret_cast(userData); - if (data) { - ArkUI_AnimateOption* option = data->option; - ArkUI_CurveHandle curve = data->curve; - if (option) { - OH_ArkUI_AnimateOption_Dispose(option); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_AnimateOption_Dispose success!"); - } - if (curve) { - OH_ArkUI_Curve_DisposeCurve(curve); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_Curve_DisposeCurve success!"); - } - delete data; // 释放结构体 - } - }; - - // 设置闭包函数 - static bool isback = true; - ArkUI_ContextCallback *update = new ArkUI_ContextCallback; - update->callback = [](void *user) { - // 对应的属性变化 width height - if (isback) { - g_animateto_button->SetWidth(NUM_200); - g_animateto_button->SetHeight(NUM_80); - g_animateto_button->SetBackgroundColor(0xFFA280FF); - } else { - g_animateto_button->SetWidth(NUM_100); - g_animateto_button->SetHeight(NUM_40); - g_animateto_button->SetBackgroundColor(0xFFFF2E77); - } - isback = !isback; - }; - // 执行对应的动画 - animateApi->animateTo(context, option, update, completeCallback); - - auto duration = OH_ArkUI_AnimateOption_GetDuration(option); - auto tempo = OH_ArkUI_AnimateOption_GetTempo(option); - auto curve = OH_ArkUI_AnimateOption_GetCurve(option); - auto delay = OH_ArkUI_AnimateOption_GetDelay(option); - auto iteration = OH_ArkUI_AnimateOption_GetIterations(option); - auto playmode = OH_ArkUI_AnimateOption_GetPlayMode(option); - auto expectedFrameRateRange = OH_ArkUI_AnimateOption_GetExpectedFrameRateRange(option); - auto iCurve = OH_ArkUI_AnimateOption_GetICurve(option); // 获取动画的动画曲线 - g_animateto_text->AnimatetoToString(duration, tempo, curve, delay, iteration, playmode, - *expectedFrameRateRange); - } - }; - button->RegisterNodeEventReceiver(onTouch); - column->AddChild(g_animateto_text); - column->AddChild(textNode); - column->AddChild(button); - return column; -} - -std::shared_ptr CreateAnimator() -{ - auto column = std::make_shared(); - column->SetWidth(NUM_300); - column->SetHeight(NUM_250); - // 创建文本节点,内容区介绍“这是animator动画” - auto textNode = std::make_shared(); - textNode->SetTextContent("这是animator动画"); - textNode->SetWidth(NUM_120); - textNode->SetHeight(NUM_50); - // 创建createButton,用于初始化animator参数 - auto createButton = std::make_shared(); - // 创建button,后续创建的animator动画作用在button组件上 - auto button = std::make_shared(); - // 设置button初始宽高 - button->SetWidth(NUM_100); - button->SetHeight(NUM_100); - // 存储button全局变量,在onTouch注册时需要使用 - g_animator_button = button; - // 注册点击事件到button上 - createButton->RegisterNodeEvent(createButton->GetHandle(), NODE_ON_CLICK, NUM_3, nullptr); - g_animator_text = std::make_shared(); - g_animator_text->AnimatorToString(); - auto onTouch = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_3) { - // 获取context对象 - static ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_animator_button->GetHandle()); - - // 获取ArkUI_NativeAnimateAPI接口 - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - - // 以下代码为创建Animator动画的关键流程,包括设置Animator动画参数、开启Animator动画 - // 设置ArkUI_AnimatorOption参数,通过提供的C方法设置对应的参数 - static ArkUI_AnimatorOption *option = OH_ArkUI_AnimatorOption_Create(NUM_0); // Animator动画状态数 - OH_ArkUI_AnimatorOption_SetDuration(option, NUM_2000); - OH_ArkUI_AnimatorOption_SetDelay(option, NUM_10); - OH_ArkUI_AnimatorOption_SetIterations(option, NUM_3); - OH_ArkUI_AnimatorOption_SetFill(option, ARKUI_ANIMATION_FILL_MODE_NONE); - OH_ArkUI_AnimatorOption_SetDirection(option, ARKUI_ANIMATION_DIRECTION_NORMAL); - ArkUI_CurveHandle curve = OH_ArkUI_Curve_CreateCubicBezierCurve(0.5f, 4.0f, 1.2f, 0.0f); // 构造三阶贝塞尔曲线对象 - OH_ArkUI_AnimatorOption_SetCurve(option, curve); - OH_ArkUI_AnimatorOption_SetBegin(option, NUM_100); - OH_ArkUI_AnimatorOption_SetEnd(option, NUM_150); - ArkUI_ExpectedFrameRateRange *range = new ArkUI_ExpectedFrameRateRange; - range->max = NUM_120; - range->expected = NUM_60; - range->min = NUM_30; - OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange(option, range); - OH_ArkUI_AnimatorOption_SetKeyframe(option, 0.5, 120.5, NUM_0); // 设置animator动画关键帧参数 - OH_ArkUI_AnimatorOption_SetKeyframeCurve(option, curve, NUM_0); // 设置animator动画关键帧曲线类型 - OH_ArkUI_AnimatorOption_RegisterOnFrameCallback(option, nullptr, [](ArkUI_AnimatorOnFrameEvent *event) - { - OH_ArkUI_AnimatorOnFrameEvent_GetUserData(event); // 获取动画事件对象中的用户自定义对象 - auto value = OH_ArkUI_AnimatorOnFrameEvent_GetValue(event); // 获取动画事件对象中的当前进度 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", - "CXX OH_ArkUI_AnimatorOption_RegisterOnFrameCallback %{public}f", value); - g_animator_button->SetWidth(value); - }); - OH_ArkUI_AnimatorOption_RegisterOnFinishCallback(option, nullptr, [](ArkUI_AnimatorEvent* event) - { - OH_ArkUI_AnimatorEvent_GetUserData(event); // 获取动画事件对象中的用户自定义对象 - }); - OH_ArkUI_AnimatorOption_RegisterOnCancelCallback(option, nullptr, [](ArkUI_AnimatorEvent* event) - { - }); - OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback(option, nullptr, [](ArkUI_AnimatorEvent* event) - { - }); - // 执行对应的动画 - animatorHandle = animateApi->createAnimator(context, option); - - auto duration = OH_ArkUI_AnimatorOption_GetDuration(option); - auto delay = OH_ArkUI_AnimatorOption_GetDelay(option); - auto iterations = OH_ArkUI_AnimatorOption_GetIterations(option); - auto fill = OH_ArkUI_AnimatorOption_GetFill(option); - auto direction = OH_ArkUI_AnimatorOption_GetDirection(option); - auto curves = OH_ArkUI_AnimatorOption_GetCurve(option); // 获取animator动画插值曲线 - auto begin = OH_ArkUI_AnimatorOption_GetBegin(option); - auto end = OH_ArkUI_AnimatorOption_GetEnd(option); // 获取animator动画插值终点 - auto expected = OH_ArkUI_AnimatorOption_GetExpectedFrameRateRange(option); // 获取关键帧动画参数的期望帧率 - auto keyframeTime = OH_ArkUI_AnimatorOption_GetKeyframeTime(option, NUM_0); // 获取animator动画关键帧时间 - auto keyframeValue = OH_ArkUI_AnimatorOption_GetKeyframeValue(option, NUM_0); // 获取animator动画关键帧数值 - auto keyframeCurve = OH_ArkUI_AnimatorOption_GetKeyframeCurve(option, NUM_0); // 获取animator动画关键帧动画插值曲线 - g_animator_text->AnimatorToString(duration, delay, iterations, fill, direction, begin, - end, *expected, keyframeTime, keyframeValue); - } - }; - // 注册点击事件的回调函数 - createButton->RegisterNodeEventReceiver(onTouch); - createButton->SetButtonLabel("create"); - // 创建容器,用于存放button按键 - auto buttoColumn = std::make_shared(); - buttoColumn->SetPadding(NUM_30, false); // 设置布局格式,调整组件内间距 - buttoColumn->SetWidth(NUM_300); - // 创建容器,用于存放playButton按键 - auto playButtonColumn = std::make_shared(); - playButtonColumn->SetPadding(NUM_10, false); // 设置布局格式,调整组件内间距 - playButtonColumn->SetWidth(NUM_300); - // 设置animator播放按钮 - auto playButton = std::make_shared(); - playButton->SetButtonLabel("play"); - playButton->RegisterNodeEvent(playButton->GetHandle(), NODE_ON_CLICK, NUM_4, nullptr); - auto onTouchPlay = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_4) { - OH_ArkUI_Animator_Play(animatorHandle); - } - }; - playButton->RegisterNodeEventReceiver(onTouchPlay); - // 设置animator结束按钮 - auto finishButton = std::make_shared(); - finishButton->SetButtonLabel("finish"); - finishButton->RegisterNodeEvent(finishButton->GetHandle(), NODE_ON_CLICK, NUM_5, nullptr); - auto onTouchFinish = [](ArkUI_NodeEvent *event) { - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_5) { - OH_ArkUI_Animator_Finish(animatorHandle); - } - }; - finishButton->RegisterNodeEventReceiver(onTouchFinish); - // 将button挂载在column上,返回column节点 - column->AddChild(g_animator_text); - column->AddChild(textNode); - column->AddChild(button); - buttoColumn->AddChild(createButton); - playButtonColumn->AddChild(playButton); - buttoColumn->AddChild(playButtonColumn); - buttoColumn->AddChild(finishButton); - column->AddChild(buttoColumn); - return column; -} - -std::shared_ptr CreateTransitionEffect() -{ - auto column = std::make_shared(); - column->SetWidth(NUM_300); - column->SetHeight(NUM_250); - // 创建文本节点,内容区介绍“这是TransitionEffect” - auto textNode = std::make_shared(); - textNode->SetTextContent("这是TransitionEffect"); - textNode->SetWidth(NUM_150); - textNode->SetHeight(NUM_50); - // 创建transitionButton,后续创建的动画作用在transitionButton组件上 - auto transitionButton = std::make_shared(); - // 设置button初始宽高及颜色 - transitionButton->SetWidth(NUM_100); - transitionButton->SetHeight(NUM_100); - transitionButton->SetBackgroundColor(0xFFA280FF); - // 存储button全局变量 - g_transition_button = transitionButton; - g_transition_button->SetVisibility(ARKUI_VISIBILITY_VISIBLE); - // 创建button,后续动画逻辑在button的点击事件中实现 - auto button = std::make_shared(); - button->SetButtonLabel("transition"); - // 创建buttonColumn容器,用于调整button的布局效果 - auto buttonColumn = std::make_shared(); - buttonColumn->SetWidth(NUM_300); - buttonColumn->SetPadding(NUM_10, false); // 设置布局格式,调整组件内间距 - // 注册点击事件到button上 - button->RegisterNodeEvent(button->GetHandle(), NODE_ON_CLICK, NUM_10, nullptr); - auto onTouch = [](ArkUI_NodeEvent *event) { - // 获取context对象 - static ArkUI_ContextHandle context = nullptr; - context = OH_ArkUI_GetContextByNode(g_transition_button->GetHandle()); - // 点击button按钮时触发该逻辑 - if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_10) { - // 获取ArkUI_NativeAnimateAPI接口 - ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - - // 设置动画参数 - ArkUI_AnimateOption *option = OH_ArkUI_AnimateOption_Create(); - OH_ArkUI_AnimateOption_SetDuration(option, NUM_2000); - OH_ArkUI_AnimateOption_SetCurve(option, ARKUI_CURVE_EASE); - // 根据业务所需调整OH_ArkUI_TransitionEffect_SetAnimation的第一个入参 - // 创建组件转场时的透明度效果对象 - auto opacityTransitionEffect = OH_ArkUI_CreateOpacityTransitionEffect(0.7); - // 创建组件转场时的平移效果对象 - ArkUI_TranslationOptions* translate = new ArkUI_TranslationOptions; - translate->x = NUM_10; - translate->y = NUM_0; - translate->z = NUM_0; - auto translationTransitionEffect = OH_ArkUI_CreateTranslationTransitionEffect(translate); - // 创建组件转场时的缩放效果对象 - ArkUI_ScaleOptions* scale = new ArkUI_ScaleOptions; - scale->x = 1.5; - scale->y = 0.0; - scale->z = 0.0; - scale->centerX = 0.0; - scale->centerY = 0.0; - auto scaleTransitionEffect = OH_ArkUI_CreateScaleTransitionEffect(scale); - // 创建组件转场时的旋转效果对象 - ArkUI_RotationOptions* rotate = new ArkUI_RotationOptions; - rotate->x = 10.0; - rotate->y = 0.0; - rotate->z = 0.0; - rotate->centerX = 0.0; - rotate->centerY = 0.1; - rotate->angle = 30.0; - rotate->centerZ = 0.1; - rotate->perspective = NUM_0; - auto rotationTransition = OH_ArkUI_CreateRotationTransitionEffect(rotate); - // 创建组件平移效果对象 - auto movementTransition = OH_ArkUI_CreateMovementTransitionEffect(ARKUI_TRANSITION_EDGE_TOP); - // 创建非对称的转场效果对象 - auto asymmetricTransition = OH_ArkUI_CreateAsymmetricTransitionEffect( - rotationTransition, movementTransition); - // 设置转场效果动画参数,此动画设置的是透明度效果 - OH_ArkUI_TransitionEffect_SetAnimation(opacityTransitionEffect, option); - // 设置转场效果链式组合,以形成包含多种转场效果的TransitionEffect - OH_ArkUI_TransitionEffect_Combine(translationTransitionEffect, scaleTransitionEffect); - - // 设置完成的回调 - ArkUI_AnimateCompleteCallback *completeCallback = new ArkUI_AnimateCompleteCallback; - completeCallback->type = ARKUI_FINISH_CALLBACK_REMOVED; - TransitionData* data = new TransitionData(); - data->option = option; - data->effect = opacityTransitionEffect; - completeCallback->userData = reinterpret_cast(data); - completeCallback->callback = [](void *userData) { - TransitionData* data = reinterpret_cast(userData); - if (data) { - ArkUI_AnimateOption* option = data->option; - ArkUI_TransitionEffect* effect = data->effect; - if (option) { - OH_ArkUI_AnimateOption_Dispose(option); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_AnimateOption_Dispose success!"); - } - if (effect) { - OH_ArkUI_TransitionEffect_Dispose(effect); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, - "Init", "CXX OH_ArkUI_TransitionEffect_Dispose success!"); - } - delete data; // 释放结构体 - } - }; - - // 设置闭包函数 - static bool transitionIsBack = false; - ArkUI_ContextCallback *update = new ArkUI_ContextCallback; - update->callback = [](void *user) { - // 通过transitionIsBack变量使组件做显隐变化 - if (transitionIsBack) { - g_transition_button->SetVisibility(ARKUI_VISIBILITY_VISIBLE); - } else { - g_transition_button->SetVisibility(ARKUI_VISIBILITY_HIDDEN); - } - transitionIsBack = !transitionIsBack; - }; - // 执行对应的动画 - animateApi->animateTo(context, option, update, completeCallback); - } - }; - button->RegisterNodeEventReceiver(onTouch); - column->AddChild(textNode); - column->AddChild(transitionButton); - buttonColumn->AddChild(button); - column->AddChild(buttonColumn); - return column; -} -} // namespace NativeModule -#endif // MYAPPLICATION_ARKUIDOBASENODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIBaseNode.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIBaseNode.h deleted file mode 100644 index 6c354f653ddaa06fa3136382b582c41abba5fe26..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIBaseNode.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIBASENODE_H -#define MYAPPLICATION_ARKUIBASENODE_H - -#include -#include -#include - -#include "NativeModule.h" - -namespace NativeModule { - -class ArkUIBaseNode { -public: - explicit ArkUIBaseNode(ArkUI_NodeHandle handle) - : handle_(handle), nativeModule_(NativeModuleInstance::GetInstance()->GetNativeNodeAPI()) {} - - virtual ~ArkUIBaseNode() - { - if (!children_.empty()) { - for (const auto& child : children_) { - nativeModule_->removeChild(handle_, child->GetHandle()); - } - children_.clear(); - } - nativeModule_->disposeNode(handle_); - } - void AddChild(const std::shared_ptr &child) - { - children_.emplace_back(child); - OnAddChild(child); - } - void RemoveChild(const std::shared_ptr &child) - { - children_.remove(child); - OnRemoveChild(child); - } - void InsertChild(const std::shared_ptr &child, int32_t index) - { - if (index >= children_.size()) { - AddChild(child); - } else { - auto iter = children_.begin(); - std::advance(iter, index); - children_.insert(iter, child); - OnInsertChild(child, index); - } - } - ArkUI_NodeHandle GetHandle() const { return handle_; } - ArkUI_NativeNodeAPI_1* GetNativeModule() const - { - return nativeModule_; - } - -protected: - virtual void OnAddChild(const std::shared_ptr &child) {} - virtual void OnRemoveChild(const std::shared_ptr &child) {} - virtual void OnInsertChild(const std::shared_ptr &child, int32_t index) {} - - ArkUI_NodeHandle handle_; - ArkUI_NativeNodeAPI_1 *nativeModule_ = nullptr; - -private: - std::list> children_; -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUIBASENODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIButtonNode.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIButtonNode.h deleted file mode 100644 index 69514851b07d18d4bcd163a589e422a19a4126e4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIButtonNode.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIBUTTONNODE_H -#define MYAPPLICATION_ARKUIBUTTONNODE_H - -#include "ArkUINode.h" - -#include - -namespace NativeModule { -class ArkUIButtonNode : public ArkUINode { -public: - // 创建ArkUI的button组件。 - ArkUIButtonNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_BUTTON)) {} - - ~ArkUIButtonNode() override {} - void SetContentWithAnimete() - {} - - void SetButtonLabel(const std::string &content) - { - ArkUI_AttributeItem item = {nullptr, 0, content.c_str()}; - nativeModule_->setAttribute(handle_, NODE_BUTTON_LABEL, &item); - } -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUIBUTTONNODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIColumnNode.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIColumnNode.h deleted file mode 100644 index b51935def52c4e1a5656c2ff53787dae02a8d0d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIColumnNode.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUICOLUMNNODE_H -#define MYAPPLICATION_ARKUICOLUMNNODE_H - -#include "ArkUINode.h" -#include - -namespace NativeModule { -class ArkUIColumnNode : public ArkUINode { -public: - ArkUIColumnNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_COLUMN)) {} - - void SetTranslate(float x, float y, float z) - { - ArkUI_NumberValue nums[NUMBER_3] = {x, y, z}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_3}; - nativeModule_->setAttribute(handle_, NODE_TRANSLATE, &item); - } - void SetScale(float x, float y) - { - ArkUI_NumberValue nums[NUMBER_2] = {x, y}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_2}; - nativeModule_->setAttribute(handle_, NODE_SCALE, &item); - } - void SetRotate(float x, float y, float z, float angle, float center) - { - ArkUI_NumberValue nums[NUMBER_5] = {x, y, z, angle, center}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_5}; - nativeModule_->setAttribute(handle_, NODE_ROTATE, &item); - } - void SetBrightness(float light) - { - ArkUI_NumberValue nums[NUMBER_1] = {light}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_BRIGHTNESS, &item); - } - void SetSaturate(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_SATURATION, &item); - } - int32_t SetLinearGradient(float angle, int32_t direction, int32_t repeat) - { - ArkUI_NumberValue nums[NUMBER_3]; - nums[NUMBER_0].f32 = angle; - nums[NUMBER_1].i32 = direction; - nums[NUMBER_2].i32 = repeat; - ArkUI_ColorStop colorStop; - const uint32_t colors[] = {COLOR_1, COLOR_2, COLOR_3}; - float stops[] = {NUMBER_00, NUMBER_05, NUMBER_1F}; - int size = NUMBER_3; - colorStop.colors = colors; - colorStop.stops = stops; - colorStop.size = size; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_3, .object = &colorStop}; - auto err = nativeModule_->setAttribute(handle_, NODE_LINEAR_GRADIENT, &item); - return err; - } - void SetOpacity(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_OPACITY, &item); - } - void SetBorderRadius(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_BORDER_RADIUS, &item); - } - int32_t SetClip(int32_t number) - { - ArkUI_NumberValue nums[NUMBER_1]; - nums[NUMBER_0].i32 = number; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_CLIP, &item); - return err; - } - int32_t SetCircleShape(int32_t number, float width, float height) - { - ArkUI_NumberValue nums[NUMBER_3]; - nums[NUMBER_0].i32 = number; - nums[NUMBER_1].f32 = width; - nums[NUMBER_2].f32 = height; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_3}; - auto err = nativeModule_->setAttribute(handle_, NODE_CLIP_SHAPE, &item); - return err; - } - int32_t SetTransform() - { - ArkUI_NumberValue value2[NUMBER_16]; - for (int i = NUMBER_0; i < NUMBER_16; i++) { - value2[i].f32 = NUMBER_0; - } - value2[NUMBER_0].f32 = NUMBER_1; - value2[NUMBER_1].f32 = NUMBER_1; - ArkUI_AttributeItem item = { .value = value2, .size = NUMBER_3 }; - auto err = nativeModule_->setAttribute(handle_, NODE_TRANSFORM, &item); - return err; - } - int32_t SetShadow(int32_t number) - { - ArkUI_NumberValue nums[NUMBER_0]; - nums[NUMBER_0].i32 = number; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_SHADOW, &item); - return err; - } - int32_t SetBackgroundBlurStyle(int32_t number) - { - ArkUI_NumberValue blurStyle[NUMBER_6]; - blurStyle[NUMBER_0].i32 = number; - blurStyle[NUMBER_2].i32 = ARKUI_ADAPTIVE_COLOR_AVERAGE; - ArkUI_AttributeItem item = { .value = blurStyle, .size = NUMBER_2}; - auto err = nativeModule_->setAttribute(handle_, NODE_BACKGROUND_BLUR_STYLE, &item); - return err; - } - int32_t SetTransformCenter(float number) - { - ArkUI_NumberValue centerPointArray[] = {number}; - ArkUI_AttributeItem item = { .value = centerPointArray, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_TRANSFORM_CENTER, &item); - return err; - } - int32_t SetSweepGradient() - { - ArkUI_NumberValue nums[NUMBER_6]; - nums[NUMBER_0].f32 = SMALL_LENGTH; - nums[NUMBER_1].f32 = SMALL_LENGTH; - nums[NUMBER_2].f32 = NUMBER_0; - nums[NUMBER_3].f32 = NUMBER_359; - nums[NUMBER_4].f32 = NUMBER_45; - nums[NUMBER_5].f32 = NUMBER_1; - ArkUI_ColorStop colorStop; - const uint32_t colors[] = {COLOR_1, COLOR_2, COLOR_3}; - float stops[] = {NUMBER_00, NUMBER_05, NUMBER_1F}; - int size = NUMBER_3; - colorStop.colors = colors; - colorStop.stops = stops; - colorStop.size = size; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_6, .object = &colorStop }; - auto err = nativeModule_->setAttribute(handle_, NODE_SWEEP_GRADIENT, &item); - return err; - } - int32_t SetRadialGradient() - { - ArkUI_NumberValue nums[NUMBER_4]; - nums[NUMBER_0].f32 = SMALL_LENGTH; - nums[NUMBER_1].f32 = SMALL_LENGTH; - nums[NUMBER_2].f32 = NUMBER_60; - nums[NUMBER_3].f32 = NUMBER_1; - ArkUI_ColorStop colorStop; - const uint32_t colors[] = {COLOR_1, COLOR_2, COLOR_3}; - float stops[] = {NUMBER_00, NUMBER_05, NUMBER_1F}; - int size = NUMBER_3; - colorStop.colors = colors; - colorStop.stops = stops; - colorStop.size = size; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_4, .object = &colorStop }; - auto err = nativeModule_->setAttribute(handle_, NODE_RADIAL_GRADIENT, &item); - return err; - } - int32_t SetMask() - { - ArkUI_NumberValue nums[NUMBER_4]; - nums[NUMBER_0].i32 = ARKUI_MASK_TYPE_PROGRESS; - nums[NUMBER_1].f32 = NUMBER_10; - nums[NUMBER_2].f32 = NUMBER_100; - nums[NUMBER_3].u32 = COLOR_WHITE; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_4 }; - auto err = nativeModule_->setAttribute(handle_, NODE_MASK, &item); - return err; - } - int32_t SetGrayScale(float number) - { - ArkUI_NumberValue nums[] = { number }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_GRAY_SCALE, &item); - return err; - } - int32_t SetInvert(float number) - { - ArkUI_NumberValue nums[] = { number }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_INVERT, &item); - return err; - } - int32_t SetSepia(float number) - { - ArkUI_NumberValue nums[] = { number }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_SEPIA, &item); - return err; - } - int32_t SetContrast(float number) - { - ArkUI_NumberValue nums[] = { number }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_CONTRAST, &item); - return err; - } - int32_t SetColumnJustifyContent(int32_t number) - { - ArkUI_NumberValue nums[] = { { .i32 = number } }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_COLUMN_JUSTIFY_CONTENT, &item); - return err; - } - ~ArkUIColumnNode() override {} -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUILISTNODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUINode.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUINode.h deleted file mode 100644 index 2da51a5a1297dbb173d2537ddc6131f320101850..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUINode.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUINODE_H -#define MYAPPLICATION_ARKUINODE_H - -#include "ArkUIBaseNode.h" -#include "NativeModule.h" -#include -#include -#include -#include -#include "ArkUINumber.h" - -namespace NativeModule { -class ArkUINode : public ArkUIBaseNode { -public: - explicit ArkUINode(ArkUI_NodeHandle handle) : ArkUIBaseNode(handle) {} - - ~ArkUINode() override {} - - void SetWidth(float width) - { - ArkUI_NumberValue value[] = {{.f32 = width}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_WIDTH, &item); - } - void SetPercentWidth(float percent) - { - ArkUI_NumberValue value[] = {{.f32 = percent}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_WIDTH_PERCENT, &item); - } - void SetHeight(float height) - { - ArkUI_NumberValue value[] = {{.f32 = height}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_HEIGHT, &item); - } - void SetPercentHeight(float percent) - { - ArkUI_NumberValue value[] = {{.f32 = percent}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_HEIGHT_PERCENT, &item); - } - void SetBackgroundColor(uint32_t color) - { - ArkUI_NumberValue value[] = {{.u32 = color}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - nativeModule_->setAttribute(handle_, NODE_BACKGROUND_COLOR, &item); - } - int32_t SetZIndex(int32_t number) - { - ArkUI_NumberValue value[] = {{.i32 = number}}; - ArkUI_AttributeItem item = {value, NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_Z_INDEX, &item); - return err; - } - int32_t SetForegroundColor(uint32_t color) - { - ArkUI_NumberValue nums[NUMBER_1]; - nums[NUMBER_0].u32 = color; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_FOREGROUND_COLOR, &item); - return err; - } - int32_t SetMarkAnchor(float x, float y) - { - ArkUI_NumberValue nums[NUMBER_2] = {x, y}; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_2}; - auto err = nativeModule_->setAttribute(handle_, NODE_MARK_ANCHOR, &item); - return err; - } - int32_t SetVisibility(int32_t visibility) - { - ArkUI_NumberValue nums[NUMBER_1]; - nums[NUMBER_0].i32 = visibility; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_VISIBILITY, &item); - return err; - } - void RegisterNodeEvent(ArkUI_NodeHandle node, - ArkUI_NodeEventType eventType, int32_t targetId, void* userData) - { - nativeModule_->registerNodeEvent(node, eventType, targetId, userData); - } - void RegisterNodeEventReceiver(void (*eventReceiver)(ArkUI_NodeEvent* event)) - { - nativeModule_->registerNodeEventReceiver(eventReceiver); - } - int32_t SetOpacityTransition() - { - ArkUI_NumberValue opacityTransition[] = { - NUMBER_02, - { .i32 = NUMBER_3000 }, - { .i32 = static_cast(ARKUI_CURVE_EASE_IN_OUT) } - }; - ArkUI_AttributeItem item = { .value = opacityTransition, .size = NUMBER_3}; - auto err = nativeModule_->setAttribute(handle_, NODE_OPACITY_TRANSITION, &item); - return err; - } - int32_t SetRotateTransition() - { - ArkUI_NumberValue rotateTransition[] = { - NUMBER_00, - NUMBER_00, - NUMBER_1F, - NUMBER_180, - NUMBER_0, - { .i32 = NUMBER_3000 }, - { .i32 = static_cast(ARKUI_CURVE_SHARP) } - }; - ArkUI_AttributeItem item = { .value = rotateTransition, .size = NUMBER_7}; - auto err = nativeModule_->setAttribute(handle_, NODE_ROTATE_TRANSITION, &item); - return err; - } - int32_t SetScaleTransition() - { - ArkUI_NumberValue scaleTransition[] = { - NUMBER_00, - NUMBER_00, - NUMBER_00, - { .i32 = NUMBER_3000 }, - { .i32 = static_cast(ARKUI_CURVE_SHARP) } - }; - ArkUI_AttributeItem item = { .value = scaleTransition, .size = NUMBER_5}; - auto err = nativeModule_->setAttribute(handle_, NODE_SCALE_TRANSITION, &item); - return err; - } - int32_t SetTranslateTransition() - { - ArkUI_NumberValue translateTransition[] = { - NUMBER_100F, - NUMBER_100F, - NUMBER_00, - { .i32 = NUMBER_3000 }, - { .i32 = static_cast(ARKUI_CURVE_SHARP) } - }; - ArkUI_AttributeItem item = { .value = translateTransition, .size = NUMBER_5}; - auto err = nativeModule_->setAttribute(handle_, NODE_TRANSLATE_TRANSITION, &item); - return err; - } - int32_t SetMoveTransition() - { - ArkUI_NumberValue translateTransition[] = { - {.i32 = ARKUI_TRANSITION_EDGE_START }, - {.i32 = NUMBER_3000 }, - {.i32 = static_cast(ARKUI_CURVE_SHARP) } - }; - ArkUI_AttributeItem item = { .value = translateTransition, .size = NUMBER_3}; - auto err = nativeModule_->setAttribute(handle_, NODE_MOVE_TRANSITION, &item); - return err; - } - int32_t SetForegroundBlurStyle(int32_t number) - { - ArkUI_NumberValue nums[] = { { .i32 = number} }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_FOREGROUND_BLUR_STYLE, &item); - return err; - } - int32_t SetColorBlend(uint32_t color) - { - ArkUI_NumberValue nums[] = { { .u32 = color} }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_COLOR_BLEND, &item); - return err; - } - int32_t SetTransition(ArkUI_TransitionEffect* effect) - { - ArkUI_AttributeItem item = { .object = effect}; - auto err = nativeModule_->setAttribute(handle_, NODE_TRANSITION, &item); - return err; - } - int32_t SetBackdropBlur(float round) - { - ArkUI_NumberValue nums[] = { round, NUMBER_100, NUMBER_100 }; - ArkUI_AttributeItem item = { .value = nums, .size = NUMBER_3}; - auto err = nativeModule_->setAttribute(handle_, NODE_BACKDROP_BLUR, &item); - return err; - } - void SetTranslateWithPercent(float x, float y, float z) - { - ArkUI_NumberValue nums[NUMBER_3] = {x, y, z}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_3}; - nativeModule_->setAttribute(handle_, NODE_TRANSLATE_WITH_PERCENT, &item); - } - void SetRotateAngle(float x, float y, float z, float see) - { - ArkUI_NumberValue nums[NUMBER_4] = {x, y, z, see}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_4}; - nativeModule_->setAttribute(handle_, NODE_ROTATE_ANGLE, &item); - } - int32_t SetGeometryTransition(int32_t share, const char* str) - { - ArkUI_NumberValue nums[NUMBER_1] = { {.i32 = share} }; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1, .string = str}; - auto err = nativeModule_->setAttribute(handle_, NODE_GEOMETRY_TRANSITION, &item); - return err; - } - int32_t SetCustomShadow() - { - ArkUI_NumberValue nums[NUMBER_7] = { - NUMBER_20, - {.i32 = NUMBER_0 }, - SMALL_LENGTH, - SMALL_LENGTH, - { .i32 = ARKUI_SHADOW_TYPE_COLOR }, - { .u32 = COLOR_RED }, - { .u32 = NUMBER_0 } - }; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_7}; - auto err = nativeModule_->setAttribute(handle_, NODE_CUSTOM_SHADOW, &item); - return err; - } - int32_t SetBlur(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_BLUR, &item); - return err; - } - int32_t SetBackGroundImage(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_BLUR, &item); - return err; - } - int32_t SetRenderFit(float number) - { - ArkUI_NumberValue nums[NUMBER_1] = {number}; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_RENDER_FIT, &item); - return err; - } - int32_t SetRenderGroup(int32_t number) - { - ArkUI_NumberValue nums[NUMBER_1] = { { .i32 = number } }; - ArkUI_AttributeItem item = {.value = nums, .size = NUMBER_1}; - auto err = nativeModule_->setAttribute(handle_, NODE_RENDER_GROUP, &item); - return err; - } - void SetPadding(float padding, bool isPercent = false) - { - ArkUI_NumberValue value[] = {{.f32 = padding}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, isPercent ? NODE_PADDING_PERCENT : NODE_PADDING, &item); - } -protected: - void OnAddChild(const std::shared_ptr &child) override - { - nativeModule_->addChild(handle_, child->GetHandle()); - } - void OnRemoveChild(const std::shared_ptr &child) override - { - nativeModule_->removeChild(handle_, child->GetHandle()); - } - void OnInsertChild(const std::shared_ptr &child, int32_t index) override - { - nativeModule_->insertChildAt(handle_, child->GetHandle(), index); - } -}; -} // namespace NativeModule -#endif // MYAPPLICATION_ARKUINODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUINodeAdapter.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUINodeAdapter.h deleted file mode 100644 index e8b0da0a9df3c39f28b104460cd1e993ba51800f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUINodeAdapter.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef ARKUINODEADAPTER_H -#define ARKUINODEADAPTER_H - -#include -#include -#include - -#include -#include -#include - -#include "ScrollableUtils.h" - -/** - * 通用 NodeAdapter 封装 - */ -struct NodeAdapterCallbacks { - std::function getTotalCount; - std::function getStableId; - std::function onCreate; - std::function onBind; - std::function onRecycle; -}; - -class ArkUINodeAdapter { -public: - using Callbacks = NodeAdapterCallbacks; - - ArkUINodeAdapter() : placeholderNodeType_(kInvalidNodeType) { InitializeApiAndAdapter(); } - - explicit ArkUINodeAdapter(int32_t placeholderNodeType) : placeholderNodeType_(placeholderNodeType) - { - InitializeApiAndAdapter(); - } - - ~ArkUINodeAdapter() - { - ClearNodeCache(); - OH_ArkUI_NodeAdapter_UnregisterEventReceiver(adapterHandle_); - OH_ArkUI_NodeAdapter_Dispose(adapterHandle_); - adapterHandle_ = nullptr; - } - - ArkUI_NodeAdapterHandle GetAdapter() const { return adapterHandle_; } - - void SetPlaceholderType(int32_t placeholderNodeType) { placeholderNodeType_ = placeholderNodeType; } - - void EnsurePlaceholderTypeOr(int32_t fallbackNodeType) - { - if (placeholderNodeType_ < 0) { - placeholderNodeType_ = fallbackNodeType; - } - } - - void SetCallbacks(const NodeAdapterCallbacks &callbacks) - { - callbacks_ = callbacks; - SynchronizeItemCount(GetTotalItemCount()); - } - - // ======================================== - // 数据变动通知接口 - // ======================================== - void ReloadAllItems() { OH_ArkUI_NodeAdapter_ReloadAllItems(adapterHandle_); } - - void InsertRange(int32_t index, int32_t count) - { - if (count <= 0) { - return; - } - int32_t validIndex = ClampIndexToRange(index, GetTotalItemCount()); - OH_ArkUI_NodeAdapter_InsertItem(adapterHandle_, validIndex, count); - SynchronizeItemCount(GetTotalItemCount()); - } - - void RemoveRange(int32_t index, int32_t count) - { - if (count <= 0) { - return; - } - if (!IsValidIndex(index, GetTotalItemCount())) { - return; - } - OH_ArkUI_NodeAdapter_RemoveItem(adapterHandle_, index, count); - SynchronizeItemCount(GetTotalItemCount()); - } - -protected: - // ======================================== - // 事件分发处理 - // ======================================== - static void OnStaticEvent(ArkUI_NodeAdapterEvent *event) - { - auto *self = reinterpret_cast(OH_ArkUI_NodeAdapterEvent_GetUserData(event)); - if (IsNotNull(self)) { - self->OnEvent(event); - } - } - - void OnEvent(ArkUI_NodeAdapterEvent *event) - { - const int32_t eventType = OH_ArkUI_NodeAdapterEvent_GetType(event); - switch (eventType) { - case NODE_ADAPTER_EVENT_ON_GET_NODE_ID: { - HandleGetNodeId(event); - break; - } - case NODE_ADAPTER_EVENT_ON_ADD_NODE_TO_ADAPTER: { - HandleAddNodeToAdapter(event); - break; - } - case NODE_ADAPTER_EVENT_ON_REMOVE_NODE_FROM_ADAPTER: { - HandleRemoveNodeFromAdapter(event); - break; - } - default: { - break; - } - } - } - -private: - // ======================================== - // 私有常量和工具方法 - // ======================================== - static constexpr int32_t kInvalidNodeType = -1; - - void InitializeApiAndAdapter() - { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeApi_); - adapterHandle_ = OH_ArkUI_NodeAdapter_Create(); - OH_ArkUI_NodeAdapter_RegisterEventReceiver(adapterHandle_, this, &ArkUINodeAdapter::OnStaticEvent); - SynchronizeItemCount(GetTotalItemCount()); - } - - void ClearNodeCache() - { - while (!nodeCache_.empty()) { - nodeCache_.pop(); - } - } - - int32_t GetTotalItemCount() const - { - if (callbacks_.getTotalCount) { - return callbacks_.getTotalCount(); - } - return 0; - } - - int32_t ClampIndexToRange(int32_t index, int32_t maxCount) const - { - if (index < 0) { - return 0; - } - if (index > maxCount) { - return maxCount; - } - return index; - } - - void SynchronizeItemCount(int32_t count) - { - OH_ArkUI_NodeAdapter_SetTotalNodeCount(adapterHandle_, static_cast(count)); - } - - ArkUI_NodeHandle PopFromCacheOrCreate(int32_t index) - { - if (!nodeCache_.empty()) { - ArkUI_NodeHandle handle = nodeCache_.top(); - nodeCache_.pop(); - return handle; - } - if (callbacks_.onCreate) { - return callbacks_.onCreate(nodeApi_, index); - } - const ArkUI_NodeType nodeType = (placeholderNodeType_ >= 0) ? static_cast(placeholderNodeType_) - : ARKUI_NODE_LIST_ITEM; - return nodeApi_->createNode(nodeType); - } - - // ======================================== - // 事件处理实现 - // ======================================== - void HandleGetNodeId(ArkUI_NodeAdapterEvent *event) - { - const int32_t index = OH_ArkUI_NodeAdapterEvent_GetItemIndex(event); - uint64_t nodeId = static_cast(index); - - if (IsValidIndex(index, GetTotalItemCount()) && callbacks_.getStableId) { - nodeId = callbacks_.getStableId(index); - } - OH_ArkUI_NodeAdapterEvent_SetNodeId(event, nodeId); - } - - void HandleAddNodeToAdapter(ArkUI_NodeAdapterEvent *event) - { - const int32_t index = OH_ArkUI_NodeAdapterEvent_GetItemIndex(event); - ArkUI_NodeHandle item = PopFromCacheOrCreate(index); - - if (callbacks_.onBind && IsValidIndex(index, GetTotalItemCount())) { - callbacks_.onBind(nodeApi_, item, index); - } - OH_ArkUI_NodeAdapterEvent_SetItem(event, item); - } - - void HandleRemoveNodeFromAdapter(ArkUI_NodeAdapterEvent *event) - { - ArkUI_NodeHandle node = OH_ArkUI_NodeAdapterEvent_GetRemovedNode(event); - if (!IsNotNull(node)) { - return; - } - - if (callbacks_.onRecycle) { - callbacks_.onRecycle(nodeApi_, node); - } - nodeCache_.push(node); - } - -private: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - ArkUI_NodeAdapterHandle adapterHandle_ = nullptr; - NodeAdapterCallbacks callbacks_; - std::stack nodeCache_; - int32_t placeholderNodeType_ = kInvalidNodeType; -}; - -#endif // COMMON_ARKUINODEADAPTER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUINumber.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUINumber.h deleted file mode 100644 index 9c0c30fe916f848a025be9fb1e36db003b1e01ba..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUINumber.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef ARKUINUMBER_H -#define ARKUINUMBER_H -namespace NativeModule { -constexpr uint32_t COLOR_1 = 0x33FF0000; -constexpr uint32_t COLOR_2 = 0x3300FF00; -constexpr uint32_t COLOR_3 = 0x330000FF; -constexpr uint32_t COLOR_BLACK = 0xFF000000; -constexpr uint32_t COLOR_PINK = 0x33FF0000; -constexpr uint32_t COLOR_RED = 0xFFFF0000; -constexpr uint32_t COLOR_WHITE = 0xFFFFFFFF; -constexpr int32_t DURATION_TIME = 2000; -constexpr int32_t LARGE_LENGTH = 300; -constexpr int32_t MIDDLE_LENGTH = 200; -constexpr int32_t NUMBER_0 = 0; -constexpr float NUMBER_00 = 0.0; -constexpr float NUMBER_01 = 0.1; -constexpr float NUMBER_02 = 0.2; -constexpr float NUMBER_03 = 0.3; -constexpr float NUMBER_04 = 0.4; -constexpr float NUMBER_05 = 0.5; -constexpr float NUMBER_06 = 0.6; -constexpr int32_t NUMBER_1 = 1; -constexpr float NUMBER_1F = 1.0; -constexpr int32_t NUMBER_2 = 2; -constexpr int32_t NUMBER_3 = 3; -constexpr int32_t NUMBER_4 = 4; -constexpr int32_t NUMBER_5 = 5; -constexpr int32_t NUMBER_6 = 6; -constexpr int32_t NUMBER_7 = 7; -constexpr int32_t NUMBER_10 = 10; -constexpr int32_t NUMBER_16 = 16; -constexpr int32_t NUMBER_20 = 20; -constexpr int32_t NUMBER_25 = 25; -constexpr int32_t NUMBER_30 = 30; -constexpr int32_t NUMBER_45 = 45; -constexpr int32_t NUMBER_60 = 60; -constexpr int32_t NUMBER_90 = 90; -constexpr int32_t NUMBER_100 = 100; -constexpr float NUMBER_100F = 100.0; -constexpr int32_t NUMBER_150 = 150; -constexpr int32_t NUMBER_180 = 180; -constexpr int32_t NUMBER_3000 = 3000; -constexpr int32_t NUMBER_359 = 359; -constexpr int32_t SMALL_LENGTH = 50; -} -#endif \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUITextNode.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUITextNode.h deleted file mode 100644 index 852bda881b6f385d4fa2b271fa55ec746cb6c00c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUITextNode.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// ArkUITextNode.h -#ifndef MYAPPLICATION_ARKUITEXTNODE_H -#define MYAPPLICATION_ARKUITEXTNODE_H - -#include "ArkUINode.h" - -#include - -namespace NativeModule { -class ArkUITextNode : public ArkUINode { -public: - ArkUITextNode() - : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_TEXT)) {} - void SetFontSize(float fontSize) - { - ArkUI_NumberValue value[] = {{.f32 = fontSize}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_FONT_SIZE, &item); - } - void SetFontColor(uint32_t color) - { - ArkUI_NumberValue value[] = {{.u32 = color}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_FONT_COLOR, &item); - } - void SetTextContent(const std::string &content) - { - ArkUI_AttributeItem item = {nullptr, 0, content.c_str()}; - nativeModule_->setAttribute(handle_, NODE_TEXT_CONTENT, &item); - } - void SetTextAlign(ArkUI_TextAlignment align) - { - ArkUI_NumberValue value[] = {{.i32 = align}}; - ArkUI_AttributeItem item = {value, 1}; - nativeModule_->setAttribute(handle_, NODE_TEXT_ALIGN, &item); - } - void AnimatetoToString( - int duration = 0, float tempo = 0, int curve = 0, int delay = 0, - int iteration = 0, ArkUI_AnimationPlayMode playmode = ARKUI_ANIMATION_PLAY_MODE_REVERSE, - const ArkUI_ExpectedFrameRateRange& expectedFrameRateRange = { 0, 0, 0 }) - { - SetTextContent("animateto{ dur:" + std::to_string(duration) - + "; tempo:" + std::to_string(tempo) - + "; curve:" + std::to_string(static_cast(curve)) - + "; delay:" + std::to_string(delay) - + "; iteration:" + std::to_string(iteration) - + "; playmode:" + std::to_string(static_cast(playmode)) - + "; expectedFrameRateRange:[ max:" + - std::to_string(expectedFrameRateRange.max) + ", min:" + - std::to_string(expectedFrameRateRange.min) + ", expected:" + - std::to_string(expectedFrameRateRange.expected) + "]}"); - } - void AnimatorToString( - int duration = 0, int delay = 0, int iterations = 0, - ArkUI_AnimationFillMode fill = ARKUI_ANIMATION_FILL_MODE_FORWARDS, - ArkUI_AnimationDirection direction = ARKUI_ANIMATION_DIRECTION_REVERSE, float begin = 0.0, float end = 0.0, - const ArkUI_ExpectedFrameRateRange& expectedFrameRateRange = { 0, 0, 0 }, - float keyframeTime = 0.0, float keyframeValue = 0.0) - { - SetTextContent("Animator{ dur:" + std::to_string(duration) - + "; delay:" + std::to_string(delay) - + "; iterations:" + std::to_string(iterations) - + "; fill:" + std::to_string(fill) - + "; direction:" + std::to_string(direction) - + "; begin:" + std::to_string(begin) - + "; end:" + std::to_string(end) - + "; expectedFrameRateRange:[ max:" + - std::to_string(expectedFrameRateRange.max) + ", min:" + - std::to_string(expectedFrameRateRange.min) + ", expected:" + - std::to_string(expectedFrameRateRange.expected) + "]" - + "; keyframeTime:" + std::to_string(keyframeTime) - + "; keyframeValue:" + std::to_string(keyframeValue) - + "}"); - } -}; -} // namespace NativeModule - -#endif // MYAPPLICATION_ARKUITEXTNODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIVisualEffectsNode.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIVisualEffectsNode.h deleted file mode 100644 index 1c8f268ef4d297812a3ff07c51fd9a22f0562d7a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ArkUIVisualEffectsNode.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_ARKUIVISUALEFFECTSNODE_H -#define MYAPPLICATION_ARKUIVISUALEFFECTSNODE_H -#include "ArkUIColumnNode.h" -#include "ArkUITextNode.h" -#include - -namespace NativeModule { -std::shared_ptr CreateVisualEffectsFrameNode1() -{ - auto column = std::make_shared(); - auto textNodeCustomShadow = std::make_shared(); - textNodeCustomShadow->SetTextContent("ArkUI_ShadowType"); - textNodeCustomShadow->SetWidth(MIDDLE_LENGTH); - textNodeCustomShadow->SetHeight(SMALL_LENGTH); - auto columnCustomShadow = std::make_shared(); - columnCustomShadow->SetWidth(MIDDLE_LENGTH); - columnCustomShadow->SetHeight(MIDDLE_LENGTH); - columnCustomShadow->SetBackgroundColor(COLOR_PINK); - columnCustomShadow->SetCustomShadow(); - column->AddChild(textNodeCustomShadow); - column->AddChild(columnCustomShadow); - - auto textNodeShadow = std::make_shared(); - textNodeShadow->SetTextContent("ArkUI_ShadowStyle"); - textNodeShadow->SetWidth(MIDDLE_LENGTH); - textNodeShadow->SetHeight(SMALL_LENGTH); - auto columnShadow = std::make_shared(); - columnShadow->SetWidth(MIDDLE_LENGTH); - columnShadow->SetHeight(MIDDLE_LENGTH); - columnShadow->SetBackgroundColor(COLOR_PINK); - columnShadow->SetShadow(ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG); - column->AddChild(textNodeShadow); - column->AddChild(columnShadow); - - auto textNodeMask = std::make_shared(); - textNodeMask->SetTextContent("ArkUI_MaskType"); - textNodeMask->SetWidth(MIDDLE_LENGTH); - textNodeMask->SetHeight(SMALL_LENGTH); - auto columnMask = std::make_shared(); - columnMask->SetWidth(MIDDLE_LENGTH); - columnMask->SetHeight(MIDDLE_LENGTH); - columnMask->SetBackgroundColor(COLOR_PINK); - columnMask->SetMask(); - column->AddChild(textNodeMask); - column->AddChild(columnMask); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode2() -{ - auto column = std::make_shared(); - auto textNodeBlurStyle = std::make_shared(); - textNodeBlurStyle->SetTextContent("ArkUI_AdaptiveColor ArkUI_BlurStyle"); - textNodeBlurStyle->SetWidth(MIDDLE_LENGTH); - textNodeBlurStyle->SetHeight(SMALL_LENGTH); - auto columnBlurStyle = std::make_shared(); - columnBlurStyle->SetWidth(MIDDLE_LENGTH); - columnBlurStyle->SetHeight(MIDDLE_LENGTH); - columnBlurStyle->SetBackgroundColor(COLOR_PINK); - columnBlurStyle->SetBackgroundBlurStyle(ARKUI_BLUR_STYLE_THICK); - column->AddChild(textNodeBlurStyle); - column->AddChild(columnBlurStyle); - - auto textNodeCircleShape = std::make_shared(); - textNodeCircleShape->SetTextContent("ArkUI_ClipType"); - textNodeCircleShape->SetWidth(MIDDLE_LENGTH); - textNodeCircleShape->SetHeight(SMALL_LENGTH); - auto columnCircleShape = std::make_shared(); - columnCircleShape->SetWidth(MIDDLE_LENGTH); - columnCircleShape->SetHeight(MIDDLE_LENGTH); - columnCircleShape->SetBackgroundColor(COLOR_PINK); - columnCircleShape->SetCircleShape(ARKUI_CLIP_TYPE_CIRCLE, MIDDLE_LENGTH, MIDDLE_LENGTH); - column->AddChild(textNodeCircleShape); - column->AddChild(columnCircleShape); - - return column; -} - -std::shared_ptr CreateVisualEffectsFrameNode3() -{ - auto column = std::make_shared(); - auto textNodeLinearGradient = std::make_shared(); - textNodeLinearGradient->SetTextContent("ArkUI_ColorStop ArkUI_LinearGradientDirection"); - textNodeLinearGradient->SetWidth(MIDDLE_LENGTH); - textNodeLinearGradient->SetHeight(SMALL_LENGTH); - auto columnLinearGradient = std::make_shared(); - columnLinearGradient->SetWidth(NUMBER_100); - columnLinearGradient->SetHeight(NUMBER_100); - columnLinearGradient->SetLinearGradient(NUMBER_90, ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, NUMBER_0); - column->AddChild(textNodeLinearGradient); - column->AddChild(columnLinearGradient); - - return column; -} -} // namespace NativeModule - -#endif \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ButtonMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ButtonMaker.cpp deleted file mode 100644 index 0949d423470f95fd91b6b020613306e1091a8f74..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ButtonMaker.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "ButtonMaker.h" -#include "baseUtils.h" - -constexpr int32_t DEFAULT_BUTTON_WIDTH = 200; -constexpr int32_t DEFAULT_BUTTON_HEIGHT = 60; -constexpr int32_t CIRCLE_BUTTON_SIZE = 200; - -// 按钮类型对应的文本 -const char *GetButtonText(ArkUI_ButtonType type) -{ - switch (type) { - case ARKUI_BUTTON_TYPE_NORMAL: - return "普通按钮"; - case ARKUI_BUTTON_TYPE_CAPSULE: - return "胶囊型按钮"; - case ARKUI_BUTTON_TYPE_CIRCLE: - return "圆形按钮"; - case ARKUI_BUTTON_ROUNDED_RECTANGLE: - return "圆角矩形按钮"; - default: - return "按钮"; - } -} - -// 设置按钮的基础属性(宽度、高度) -void SetButtonBaseAttributes(ArkUI_NodeHandle node, int32_t width, int32_t height) -{ - // 设置宽度和高度 - ArkUI_NumberValue widthValue[] = {{.f32 = static_cast(width)}}; - ArkUI_NumberValue heightValue[] = {{.f32 = static_cast(height)}}; - ArkUI_AttributeItem widthItem = {widthValue, sizeof(widthValue) / sizeof(ArkUI_NumberValue)}; - ArkUI_AttributeItem heightItem = {heightValue, sizeof(heightValue) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(node, NODE_WIDTH, &widthItem); - Manager::nodeAPI_->setAttribute(node, NODE_HEIGHT, &heightItem); -} - -// 设置按钮的基础属性(类型) -void SetButtonTypeAttributes(ArkUI_NodeHandle handleType, int32_t type, ArkUI_NodeAttributeType AttributeType) -{ - // 设置按钮类型 - ArkUI_NumberValue typeValue[] = {{.i32 = type}}; - ArkUI_AttributeItem typeItem = {typeValue, sizeof(typeValue) / sizeof(typeValue[0])}; - Manager::nodeAPI_->setAttribute(handleType, AttributeType, &typeItem); -} - -// 创建按钮文本节点 -ArkUI_NodeHandle CreateButtonText(const char *text) -{ - if (!text) { - return nullptr; - } - - ArkUI_NodeHandle textNode = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - if (!textNode) { - return nullptr; - } - - ArkUI_AttributeItem textItem = {.string = text}; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_CONTENT, &textItem); - return textNode; -} - -void SetButtonPropertiesWithCustomContent(ArkUI_ButtonType buttonType, ArkUI_NodeHandle column, ArkUI_NodeHandle button) -{ - switch (buttonType) { - case ARKUI_BUTTON_TYPE_NORMAL: - case ARKUI_BUTTON_TYPE_CAPSULE: - case ARKUI_BUTTON_ROUNDED_RECTANGLE: - SetButtonBaseAttributes(button, DEFAULT_BUTTON_WIDTH, DEFAULT_BUTTON_HEIGHT); - break; - case ARKUI_BUTTON_TYPE_CIRCLE: - SetButtonBaseAttributes(button, CIRCLE_BUTTON_SIZE, CIRCLE_BUTTON_SIZE); - break; - default: - Manager::nodeAPI_->disposeNode(button); - Manager::nodeAPI_->disposeNode(column); - return; - } -} - -ArkUI_NodeHandle ButtonMaker::SetButtonProperties(uint32_t type) -{ - ArkUI_NodeHandle column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - ArkUI_NodeHandle button = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_ButtonType buttonType = static_cast(type); - const char *buttonText = GetButtonText(buttonType); - SetButtonPropertiesWithCustomContent(buttonType, column, button); - SetButtonTypeAttributes(button, type, NODE_BUTTON_TYPE); - // 6. 添加文本子节点 - auto textNode = CreateButtonText(buttonText); - Manager::nodeAPI_->addChild(button, textNode); - // 7. 组装节点树并挂载 - Manager::nodeAPI_->addChild(column, button); - return column; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ButtonMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ButtonMaker.h deleted file mode 100644 index e63a03b49afcad07fc6e92cc5193c03eca9fa537..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ButtonMaker.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_BUTTONMAKER_H -#define NATIVE_TYPE_SAMPLE_BUTTONMAKER_H - -#include "manager.h" - -class ButtonMaker { -public: - ButtonMaker(){}; - ~ButtonMaker(){}; - static ArkUI_NodeHandle SetButtonProperties(uint32_t type); -}; - -#endif // NATIVE_TYPE_SAMPLE_BUTTONMAKER_H \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 23bb26c64111f27ac385fe4f4d4068645185c432..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.28.0) -project(native_type_sample) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -file(GLOB_RECURSE ENTRY_SOURCES CONFIGURE_DEPENDS - "${NATIVERENDER_ROOT_PATH}/*.cpp" -) - -add_library(entry SHARED ${ENTRY_SOURCES}) - -find_library(hilog-lib hilog_ndk.z) - -find_library( - # Sets the name of the path variable. - hilog-lib - libace-lib - libnapi-lib - ace_napi.z - EGL-lib - EGL - GLES-lib - GLESv3 -) -target_link_libraries(entry PUBLIC - libace_ndk.z.so - libace_napi.z.so - libhilog_ndk.z.so - libnative_drawing.so - libability_base_want.so - libpixelmap.so -) -target_link_libraries(entry PUBLIC ${hilog-lib} ${libace-lib} ${libnapi-lib}) -target_link_libraries(entry PUBLIC ${libace-lib} libace_napi.z.so libnative_drawing.so libhilog_ndk.z.so libpixelmap.so) -target_link_libraries(entry PUBLIC ${EGL-lib} ${GLES-lib} libace_napi.z.so libhilog_ndk.z.so libace_ndk.z.so libnative_window.so) -target_link_libraries(entry PUBLIC ${libace-lib} libace_napi.z.so libnative_drawing.so libhilog_ndk.z.so libability_base_want.so libpixelmap.so) \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/CheckboxShapeMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/CheckboxShapeMaker.cpp deleted file mode 100644 index f701141934c85d5469e36e15252273a58b317c5a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/CheckboxShapeMaker.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "CheckboxShapeMaker.h" -#include "baseUtils.h" - -namespace ConstIde { - const uint32_t NUMBER_100 = 100; -} // namespace ConstIde - -// 设置按钮的基础属性(宽度、高度) -void SetBaseAttributes(ArkUI_NodeHandle node, int32_t width, int32_t height) -{ - // 设置宽度和高度 - ArkUI_NumberValue widthValue[] = {{.f32 = static_cast(width)}}; - ArkUI_NumberValue heightValue[] = {{.f32 = static_cast(height)}}; - ArkUI_AttributeItem widthItem = {widthValue, sizeof(widthValue) / sizeof(ArkUI_NumberValue)}; - ArkUI_AttributeItem heightItem = {heightValue, sizeof(heightValue) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(node, NODE_WIDTH, &widthItem); - Manager::nodeAPI_->setAttribute(node, NODE_HEIGHT, &heightItem); -} - -void SetTypeAttributes( - ArkUI_NodeHandle handleType, - int32_t type, - ArkUI_NodeAttributeType AttributeType) -{ - // 设置按钮类型 - ArkUI_NumberValue typeValue[] = {{.i32 = type }}; - ArkUI_AttributeItem typeItem = {typeValue, sizeof(typeValue) / sizeof(typeValue[0])}; - Manager::nodeAPI_->setAttribute(handleType, AttributeType, &typeItem); -} - -ArkUI_NodeHandle CreateCheckboxText(const char* text) -{ - ArkUI_NodeHandle textNode = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - - ArkUI_AttributeItem textItem = {.string = text}; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_CONTENT, &textItem); - return textNode; -} - -ArkUI_NodeHandle CheckboxShapeMaker::SetCheckboxProperties(uint32_t type) -{ - ArkUI_NodeHandle column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - if (!column) { - return nullptr; - } - - ArkUI_NodeHandle checkBox = Manager::nodeAPI_->createNode(ARKUI_NODE_CHECKBOX); - if (!checkBox) { - Manager::nodeAPI_->disposeNode(column); - return nullptr; - } - SetBaseAttributes(checkBox, ConstIde::NUMBER_100, ConstIde::NUMBER_100); - SetTypeAttributes(checkBox, type, NODE_CHECKBOX_SHAPE); - - auto textNode = CreateCheckboxText("Click"); - Manager::nodeAPI_->addChild(checkBox, textNode); - Manager::nodeAPI_->addChild(column, checkBox); - - return column; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/CheckboxShapeMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/CheckboxShapeMaker.h deleted file mode 100644 index 5f964aa12672dc22c6a0162cdd79c1d91af1bdfc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/CheckboxShapeMaker.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_CHECKBOXSHAPEMAKER_H -#define NATIVE_TYPE_SAMPLE_CHECKBOXSHAPEMAKER_H - -#include "manager.h" - -class CheckboxShapeMaker { -public: - CheckboxShapeMaker(){}; - ~CheckboxShapeMaker(){}; - static ArkUI_NodeHandle SetCheckboxProperties(uint32_t type); -}; - -#endif // NATIVE_TYPE_SAMPLE_CHECKBOXSHAPEMAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/EmbeddedComponentMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/EmbeddedComponentMaker.cpp deleted file mode 100644 index 61053e51137e058cd579be6691b9d473c9acf8a5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/EmbeddedComponentMaker.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "EmbeddedComponentMaker.h" -#include -#include -#include -#include - -constexpr float TEXT_WIDTH_PX = 300.0f; -constexpr float TEXT_HEIGHT_PX = 100.0f; -constexpr int EMBEDDED_COMPONENT_WIDTH = 480; -constexpr int WANT_STR_BUF_LEN = 10; -constexpr int WANT_STR_COPY_LEN = 5; -constexpr int WANT_URI_BUF_LEN = 10; -constexpr int WANT_URI_COPY_LEN = 5; -constexpr float COL_WIDTH_PX = 300.0f; -static ArkUI_EmbeddedComponentOption* embeddedComponentOption_; - -ArkUI_NodeHandle EmbeddedComponentMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return nullptr; - } - // 创建一个Column容器组件 - ArkUI_NodeHandle column = BuildColumnNode(nodeApi); - - // 创建一个EmbeddedComponent组件节点 - ArkUI_NodeHandle embeddedNode = BuildEmbeddedComponentSection(nodeApi); - ArkUI_NodeHandle text2 = BuildTextNode(nodeApi, "嵌入式组件:"); - nodeApi->addChild(column, text2); - - // 将嵌入式组件添加到列容器 - nodeApi->addChild(column, embeddedNode); - // Column作为XComponent子组件 - return column; -} - -ArkUI_NodeHandle EmbeddedComponentMaker::BuildColumnNode(ArkUI_NativeNodeAPI_1* nodeApi) -{ - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = COL_WIDTH_PX}}; - ArkUI_AttributeItem widthItem = { colWidth, sizeof(colWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - return column; -} - -ArkUI_NodeHandle EmbeddedComponentMaker::BuildTextNode(ArkUI_NativeNodeAPI_1* nodeApi, const char* content) -{ - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = TEXT_WIDTH_PX}}; - ArkUI_AttributeItem textWidthItem = { textWidth, sizeof(textWidth) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = TEXT_HEIGHT_PX}}; - ArkUI_AttributeItem textHeightItem = { textHeight, sizeof(textHeight) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - ArkUI_AttributeItem valueItem = {.string = content}; - nodeApi->setAttribute(text, NODE_TEXT_CONTENT, &valueItem); - return text; -} - -EmbeddedComponentMaker::~EmbeddedComponentMaker() -{ - DisposeEmbeddedComponentOption(); -} - -ArkUI_NodeHandle EmbeddedComponentMaker::BuildEmbeddedComponentSection(ArkUI_NativeNodeAPI_1* nodeApi) -{ - // 创建嵌入式组件选项 - CreateEmbeddedComponentOption(); - // 设置错误回调 - SetEmbeddedComponentOnError(); - // 设置终止回调 - SetEmbeddedComponentOnTerminated(); - // 创建嵌入式组件节点 - ArkUI_NodeHandle embeddedNode = nodeApi->createNode(ARKUI_NODE_EMBEDDED_COMPONENT); - // 设置嵌入式组件的want - SetEmbeddedComponentWant(nodeApi, embeddedNode); - // 将嵌入式组件选项设置给嵌入式组件 - ArkUI_AttributeItem embeddedComponentOptionItem = { .object = embeddedComponentOption_ }; - nodeApi->setAttribute(embeddedNode, NODE_EMBEDDED_COMPONENT_OPTION, &embeddedComponentOptionItem); - ArkUI_NumberValue value[] = { EMBEDDED_COMPONENT_WIDTH }; - ArkUI_AttributeItem embeddedWidthItem = { value, sizeof(value) / sizeof(ArkUI_NumberValue) }; - nodeApi->setAttribute(embeddedNode, NODE_WIDTH, &embeddedWidthItem); - nodeApi->setAttribute(embeddedNode, NODE_HEIGHT, &embeddedWidthItem); - return embeddedNode; -} - -void EmbeddedComponentMaker::CreateEmbeddedComponentOption() -{ - if (!embeddedComponentOption_) { - embeddedComponentOption_ = OH_ArkUI_EmbeddedComponentOption_Create(); - } -} - -void EmbeddedComponentMaker::DisposeEmbeddedComponentOption() -{ - if (embeddedComponentOption_) { - OH_ArkUI_EmbeddedComponentOption_Dispose(embeddedComponentOption_); - embeddedComponentOption_ = nullptr; - } -} - -void EmbeddedComponentMaker::SetEmbeddedComponentOnError() -{ - if (embeddedComponentOption_) { - OH_ArkUI_EmbeddedComponentOption_SetOnError(embeddedComponentOption_, OnErrorCallback); - } -} - -void EmbeddedComponentMaker::SetEmbeddedComponentOnTerminated() -{ - if (embeddedComponentOption_) { - OH_ArkUI_EmbeddedComponentOption_SetOnTerminated(embeddedComponentOption_, OnTerminatedCallback); - } -} - -void EmbeddedComponentMaker::SetEmbeddedComponentWant(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node) -{ - if (nodeApi && node) { - // 创建一个Want对象并设置相关属性 - AbilityBase_Element element = { - .bundleName = "com.example.native_type_sample", - .abilityName = "SampleEmbeddedAbility", - .moduleName = "" - }; - AbilityBase_Want* want = OH_AbilityBase_CreateWant(element); - ArkUI_AttributeItem itemObjWant = {.object = want}; - nodeApi->setAttribute(node, NODE_EMBEDDED_COMPONENT_WANT, &itemObjWant); - } -} - -void EmbeddedComponentMaker::OnErrorCallback(int32_t code, const char* name, const char* msg) -{ - // 用户自定义的错误处理逻辑 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnErrorCallback:\ - code=%{public}d, name=%{public}s, message=%{public}s", code, name, msg); -} - -void EmbeddedComponentMaker::OnTerminatedCallback(int32_t code, AbilityBase_Want* want) -{ - // 用户自定义的终止处理逻辑 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: code=%{public}d", code); - if (want == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: want is nullptr"); - return; - } - - AbilityBase_Element element; - auto error = OH_AbilityBase_GetWantElement(want, &element); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: bundleName=%{public}s,\ - abilityName=%{public}s, moduleName=%{public}s", element.bundleName, element.abilityName, element.moduleName); - int wantInt = 0; - error = OH_AbilityBase_GetWantInt32Param(want, "int", &wantInt); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantInt=%{public}d", wantInt); - bool wantBool = false; - error = OH_AbilityBase_GetWantBoolParam(want, "bool2", &wantBool); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantBool=%{public}d", - wantBool); - char wantString[WANT_STR_BUF_LEN]; - error = OH_AbilityBase_GetWantCharParam(want, "string", wantString, WANT_STR_COPY_LEN); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantString=%{public}s", - wantString); - char wantUri[WANT_URI_BUF_LEN]; - error = OH_AbilityBase_GetWantUri(want, wantUri, WANT_URI_COPY_LEN); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantUri=%{public}s", wantUri); - int wantFd = 0; - error = OH_AbilityBase_GetWantFd(want, "keyFd2", &wantFd); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "OnTerminatedCallback: wantFd=%{public}d", wantFd); -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/EmbeddedComponentMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/EmbeddedComponentMaker.h deleted file mode 100644 index bcb604aabe93a37c0b8422aec03c2f02b1dc883d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/EmbeddedComponentMaker.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_EMBEDDED_COMPONENT_MAKER_H -#define NATIVE_TYPE_SAMPLE_EMBEDDED_COMPONENT_MAKER_H - -#include -#include -#include -#include -#include "manager.h" - -class EmbeddedComponentMaker { -public: - EmbeddedComponentMaker(){}; - ~EmbeddedComponentMaker(); - - static ArkUI_NodeHandle CreateNativeNode(); - static ArkUI_NodeHandle BuildEmbeddedComponentSection(ArkUI_NativeNodeAPI_1* nodeApi); - static ArkUI_NodeHandle BuildTextNode(ArkUI_NativeNodeAPI_1* nodeApi, const char* content); - static ArkUI_NodeHandle BuildColumnNode(ArkUI_NativeNodeAPI_1* nodeApi); - - static void CreateEmbeddedComponentOption(); - static void DisposeEmbeddedComponentOption(); - static void SetEmbeddedComponentOnError(); - static void SetEmbeddedComponentOnTerminated(); - static void SetEmbeddedComponentWant(ArkUI_NativeNodeAPI_1* nodeApi, ArkUI_NodeHandle node); - static void OnErrorCallback(int32_t code, const char* name, const char* message); - static void OnTerminatedCallback(int32_t code, AbilityBase_Want* want); -}; - -#endif // NATIVE_TYPE_SAMPLE_EMBEDDED_COMPONENT_MAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/GridMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/GridMaker.cpp deleted file mode 100644 index 1e886c1f0f67d2e64b6e72422293e38419ff077c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/GridMaker.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (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. - */ - -#include -#include -#include -#include // snprintf -#include -#include - -#include -#include - -#include "ScrollableNode.h" -#include "ArkUINodeAdapter.h" -#include "GridMaker.h" - -namespace { -// ===== 布局与样式常量 ===== -constexpr char K_ROWS_TEMPLATE[] = "auto"; -constexpr char K_COLUMNS_TEMPLATE[] = "1fr 1fr"; -constexpr float K_COLUMNS_GAP = 10.0f; -constexpr float K_ROWS_GAP = 15.0f; -constexpr uint32_t K_ITEM_BG_COLOR = 0xFFF1F3F5U; - -constexpr uint32_t K_GRID_CACHED_COUNT = 32; -constexpr bool K_GRID_SYNC_LOAD = true; -constexpr ArkUI_FocusWrapMode K_FOCUS_WRAP_MODE = ARKUI_FOCUS_WRAP_MODE_DEFAULT; - -constexpr int K_ITEM_COUNT = 60; -constexpr float K_ITEM_HEIGHT = 72.0f; -constexpr int K_GRID_INDEX_WIDTH = 2; -} // namespace - -// ---------- 生成数据:Grid01 ~ Grid60 ---------- -static std::vector MakeServicesData(size_t count = K_ITEM_COUNT) -{ - std::vector out; - out.reserve(count); - for (size_t i = 1; i <= count; ++i) { - std::ostringstream oss; - oss << "Grid" << std::setw(K_GRID_INDEX_WIDTH) << std::setfill('0') << i; - out.emplace_back(oss.str()); - } - return out; -} - -// ---------- 配置 Grid 外观/交互 ---------- -static void ConfigureGrid(const std::shared_ptr &grid) -{ - grid->SetWidthPercent(1.0f); - grid->SetDefaultScrollStyle(); - grid->SetColumnsTemplate(K_COLUMNS_TEMPLATE); - grid->SetCachedCount(K_GRID_CACHED_COUNT); - grid->SetFocusWrapMode(K_FOCUS_WRAP_MODE); - grid->SetSyncLoad(K_GRID_SYNC_LOAD); - grid->SetColumnsGap(K_COLUMNS_GAP); - grid->SetRowsGap(K_ROWS_GAP); -} - -// ---------- 适配器回调(创建/绑定) ---------- -static ArkUI_NodeHandle GridCreateItem(ArkUI_NativeNodeAPI_1 *api) -{ - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle item = api->createNode(ARKUI_NODE_GRID_ITEM); - api->addChild(item, text); - return item; -} - -static void GridBindItem(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index, - const std::shared_ptr> &data) -{ - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, K_ITEM_BG_COLOR); - SetAttributeFloat32(api, item, NODE_HEIGHT, K_ITEM_HEIGHT); - - ArkUI_NodeHandle text = api->getFirstChild(item); - if (!text) { - return; - } - - const int32_t n = static_cast(data->size()); - const char *s = (index >= 0 && index < n) ? (*data)[static_cast(index)].c_str() : ""; - SetTextContent(api, text, s); -} - -// ---------- 构建 Adapter ---------- -static std::shared_ptr MakeGridAdapter(const std::shared_ptr> &data) -{ - auto adapter = std::make_shared(); - adapter->EnsurePlaceholderTypeOr(static_cast(ARKUI_NODE_GRID_ITEM)); - - ArkUINodeAdapter::Callbacks cb{}; - cb.getTotalCount = [data]() -> int32_t { return static_cast(data->size()); }; - cb.getStableId = [data](int32_t i) -> uint64_t { - const int32_t n = static_cast(data->size()); - if (i >= 0 && i < n) { - return static_cast(std::hash{}((*data)[static_cast(i)])); - } - return static_cast(i); - }; - cb.onCreate = [](ArkUI_NativeNodeAPI_1 *api, int32_t /*index*/) -> ArkUI_NodeHandle { return GridCreateItem(api); }; - cb.onBind = [data](ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index) { - GridBindItem(api, item, index, data); - }; - - adapter->SetCallbacks(cb); - return adapter; -} - -// ---------- 整体构建 Grid ---------- -static std::shared_ptr BuildGrid() -{ - auto grid = std::make_shared(); - ConfigureGrid(grid); - - auto data = std::make_shared>(MakeServicesData(K_ITEM_COUNT)); - auto adapter = MakeGridAdapter(data); - grid->SetLazyAdapter(adapter); - adapter->ReloadAllItems(); - GetKeepAliveContainer().emplace_back(grid); - return grid; -} - -ArkUI_NodeHandle GridMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (api == nullptr) { - return nullptr; - } - - // 根容器全屏 - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (page == nullptr) { - return nullptr; - } - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - // 构建 Grid - std::shared_ptr grid = BuildGrid(); - if (grid && grid->GetHandle() != nullptr) { - SetAttributeFloat32(api, grid->GetHandle(), NODE_LAYOUT_WEIGHT, 1.0f); - api->addChild(page, grid->GetHandle()); - } - - return page; -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/GridMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/GridMaker.h deleted file mode 100644 index 125550fc86c347a716598dfeb4942725383c81b4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/GridMaker.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef GRID_NODE_H -#define GRID_NODE_H - -#include - -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollableEvent.h" -#include "ArkUINodeAdapter.h" - -class GridMaker : public BaseNode { -public: - static ArkUI_NodeHandle CreateNativeNode(); - - GridMaker() - : BaseNode(NodeApiInstance::GetInstance()->GetNativeNodeAPI()->createNode(ARKUI_NODE_GRID)), - nodeApi_(NodeApiInstance::GetInstance()->GetNativeNodeAPI()) - { - if (!IsNotNull(nodeApi_) || !IsNotNull(GetHandle())) { - return; - } - - nodeApi_->addNodeEventReceiver(GetHandle(), StaticEventReceiver); - scrollEventGuard_.Bind(nodeApi_, GetHandle(), this, SCROLL_EVT_ALL); - } - - ~GridMaker() override - { - scrollEventGuard_.Release(); - nodeAdapter_.reset(); - } - - // ======================================== - // 尺寸设置接口 - // ======================================== - void SetGridSize(float width, float height) - { - SetSize(width, height); - } - - void SetGridSizePercent(float widthPercent, float heightPercent) - { - SetSizePercent(widthPercent, heightPercent); - } - - // ======================================== - // 模板和间距设置 - // ======================================== - void SetRowsTemplate(const char *rowsTemplate) - { - SetAttributeString(nodeApi_, GetHandle(), NODE_GRID_ROW_TEMPLATE, rowsTemplate); - } - - void SetColumnsTemplate(const char *columnsTemplate) - { - SetAttributeString(nodeApi_, GetHandle(), NODE_GRID_COLUMN_TEMPLATE, columnsTemplate); - } - - void SetColumnsGap(float gap) - { - SetAttributeFloat32(nodeApi_, GetHandle(), NODE_GRID_COLUMN_GAP, gap); - } - - void SetRowsGap(float gap) - { - SetAttributeFloat32(nodeApi_, GetHandle(), NODE_GRID_ROW_GAP, gap); - } - - // ======================================== - // 行为和性能设置 - // ======================================== - void SetCachedCount(uint32_t count) - { - SetAttributeUInt32(nodeApi_, GetHandle(), NODE_GRID_CACHED_COUNT, count); - } - - void SetFocusWrapMode(ArkUI_FocusWrapMode mode) - { - SetAttributeInt32(nodeApi_, GetHandle(), NODE_GRID_FOCUS_WRAP_MODE, static_cast(mode)); - } - - void SetSyncLoad(bool enabled) - { - SetAttributeInt32(nodeApi_, GetHandle(), NODE_GRID_SYNC_LOAD, enabled ? 1 : 0); - } - - void SetDefaultScrollStyle() - { - ::SetDefaultScrollStyle(nodeApi_, GetHandle()); - } - - // ======================================== - // 适配器设置 - // ======================================== - void SetLazyAdapter(const std::shared_ptr &adapter) - { - if (!IsNotNull(adapter)) { - return; - } - ArkUI_AttributeItem item{nullptr, 0, nullptr, adapter->GetAdapter()}; - nodeApi_->setAttribute(GetHandle(), NODE_GRID_NODE_ADAPTER, &item); - nodeAdapter_ = adapter; - } - -protected: - void OnNodeEvent(ArkUI_NodeEvent *event) override - { - BaseNode::OnNodeEvent(event); - } - -private: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - std::shared_ptr nodeAdapter_; - ScrollEventGuard scrollEventGuard_; -}; - -#endif // SCROLLABLENDK_GRID_NODE_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/HoverModeAreaTypeMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/HoverModeAreaTypeMaker.cpp deleted file mode 100644 index ab329bf816562e4936e273ee2a4ddbfb564f7500..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/HoverModeAreaTypeMaker.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "HoverModeAreaTypeMaker.h" -#include "baseUtils.h" - -namespace ConstIde { - const uint32_t COLOR_GREEN = 0xFF00FF00; - const uint32_t COLOR_BLUE = 0xFF0000FF; - const uint32_t COLOR_YELLOW = 0xFFFFFF00; - const uint32_t COLOR_WHITE = 0xFFFFFFFF; - const uint32_t COLOR_PINK = 0xFFFFC0CB; - const uint32_t PARAM_10 = 10; - const uint32_t PARAM_240 = 240; -} // namespace ConstIde - -// 设置对话框样式属性 -static void SetDialogStyles(ArkUI_NativeDialogAPI_3 *dialogAPI3, ArkUI_NativeDialogHandle customDialog, - ArkUI_NodeHandle column) -{ - // 设置背景色 - int32_t ret = dialogAPI3->nativeDialogAPI1.setBackgroundColor(customDialog, ConstIde::COLOR_WHITE); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "SetDialogStyles setBackgroundColor failed, ret = %{public}d ", ret); - } - - // 设置边框 - ret = dialogAPI3->setBorderColor(customDialog, ConstIde::COLOR_GREEN, ConstIde::COLOR_BLUE, ConstIde::COLOR_PINK, - ConstIde::COLOR_YELLOW); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "SetDialogStyles setBorderColor failed, ret = %{public}d ", ret); - } - - ret = dialogAPI3->setBorderWidth(customDialog, ConstIde::PARAM_10, ConstIde::PARAM_10, ConstIde::PARAM_10, - ConstIde::PARAM_10, ARKUI_LENGTH_METRIC_UNIT_PX); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "SetDialogStyles setBorderWidth failed, ret = %{public}d ", ret); - } - - // 设置尺寸 - ret = dialogAPI3->setWidth(customDialog, ConstIde::PARAM_240, ARKUI_LENGTH_METRIC_UNIT_VP); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "SetDialogStyles setWidth failed, ret = %{public}d ", ret); - } - - ret = dialogAPI3->setHeight(customDialog, ConstIde::PARAM_240, ARKUI_LENGTH_METRIC_UNIT_VP); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "SetDialogStyles setHeight failed, ret = %{public}d ", ret); - } - // 设置对话框内容 - ret = dialogAPI3->nativeDialogAPI1.setContent(customDialog, column); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "SetDialogStyles setContent failed, ret = %{public}d ", ret); - } -} - -// 设置对话框悬停属性 -static void SetDialogInteractionProperties(ArkUI_NativeDialogAPI_3 *dialogAPI3, ArkUI_NativeDialogHandle customDialog, - ArkUI_HoverModeAreaType hoverModeAreaType) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "SetDialogInteractionProperties hoverModeAreaType = %{public}d ", hoverModeAreaType); - // 设置弹窗是否响应悬停态 - int32_t ret = dialogAPI3->enableHoverMode(customDialog, true); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "SetDialogInteractionProperties enableHoverMode failed, ret = %{public}d ", ret); - } - - // 设置悬停态下弹窗默认展示区域 - ret = dialogAPI3->setHoverModeArea(customDialog, hoverModeAreaType); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "SetDialogInteractionProperties setHoverModeArea failed, ret = %{public}d ", ret); - } -} - -ArkUI_NodeHandle HoverModeAreaTypeMaker::SetHoverModeAreaType(int32_t type) -{ - // 创建对话框内容 - auto column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - - // 创建对话框 - ArkUI_NativeDialogAPI_3 *dialogAPI3 = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_DIALOG, ArkUI_NativeDialogAPI_3, dialogAPI3); - auto customDialog = dialogAPI3->nativeDialogAPI1.create(); - - // 设置各种样式 - SetDialogStyles(dialogAPI3, customDialog, column); - // 设置悬停位置 - ArkUI_HoverModeAreaType hoverModeAreaType = static_cast(type); - SetDialogInteractionProperties(dialogAPI3, customDialog, hoverModeAreaType); - - // 显示对话框 - int32_t ret = dialogAPI3->nativeDialogAPI1.show(customDialog, true); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "TypeSampleTest", - "CreateHoverModeAreaTypePage show failed, ret = %{public}d ", ret); - } - return column; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/HoverModeAreaTypeMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/HoverModeAreaTypeMaker.h deleted file mode 100644 index a32cec36c1b90b3a214e04be992952c3c96fb2dd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/HoverModeAreaTypeMaker.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_HOVERMODEAREATYPEMAKER_H -#define NATIVE_TYPE_SAMPLE_HOVERMODEAREATYPEMAKER_H - -#include "manager.h" - -class HoverModeAreaTypeMaker { -public: - HoverModeAreaTypeMaker(){}; - ~HoverModeAreaTypeMaker(){}; - static ArkUI_NodeHandle SetHoverModeAreaType(int32_t type); -}; - -#endif // NATIVE_TYPE_SAMPLE_HOVERMODEAREATYPEMAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListItemGroup.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListItemGroup.h deleted file mode 100644 index 014ebd987ec6edffb03e30ff57fa12f6a262c336..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListItemGroup.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef LIST_ITEM_GROUP_H -#define LIST_ITEM_GROUP_H - -#include -#include -#include - -#include "ScrollableNode.h" -#include "ArkUINodeAdapter.h" - -/** 轻量封装:分组节点,仅提供示例所需 API */ -class ListItemGroupNode : public BaseNode { -public: - ListItemGroupNode() - : BaseNode(NodeApiInstance::GetInstance()->GetNativeNodeAPI()->createNode(ARKUI_NODE_LIST_ITEM_GROUP)), - api_(NodeApiInstance::GetInstance()->GetNativeNodeAPI()) - { - } - - ~ListItemGroupNode() override - { - if (!api_) { - return; - } - - // 清空 adapter - if (adapter_) { - ArkUI_AttributeItem it{nullptr, 0, nullptr, nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_NODE_ADAPTER, &it); - adapter_.reset(); - } - - // 清空 header / footer —— 传 nullptr 给同一属性即可 - if (header_) { - ArkUI_AttributeItem it{nullptr, 0, nullptr, nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_HEADER, &it); - header_.reset(); - } - if (footer_) { - ArkUI_AttributeItem it{nullptr, 0, nullptr, nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_FOOTER, &it); - footer_.reset(); - } - } - - // 设置/清空 Header:传 nullptr 即清空 - void SetHeader(const std::shared_ptr &header) - { - ArkUI_AttributeItem it{nullptr, 0, nullptr, header ? header->GetHandle() : nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_HEADER, &it); - header_ = header; - } - - // 设置/清空 Footer:传 nullptr 即清空 - void SetFooter(const std::shared_ptr &footer) - { - ArkUI_AttributeItem it{nullptr, 0, nullptr, footer ? footer->GetHandle() : nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_FOOTER, &it); - footer_ = footer; - } - - void SetLazyAdapter(const std::shared_ptr &adapter) - { - if (!adapter) { - ArkUI_AttributeItem it{nullptr, 0, nullptr, nullptr}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_NODE_ADAPTER, &it); - adapter_.reset(); - return; - } - adapter->EnsurePlaceholderTypeOr(static_cast(ARKUI_NODE_LIST_ITEM)); - ArkUI_AttributeItem it{nullptr, 0, nullptr, adapter->GetAdapter()}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_NODE_ADAPTER, &it); - adapter_ = adapter; - } - - // 可选:分组 divider - void SetDivider(float widthPx) - { - ArkUI_NumberValue v{.f32 = widthPx}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_SET_DIVIDER, &it); - } - - // 可选:分组 children main size - void SetChildrenMainSizeOption(ArkUI_ListChildrenMainSize *opt) - { - ArkUI_AttributeItem it{nullptr, 0, nullptr, opt}; - api_->setAttribute(GetHandle(), NODE_LIST_ITEM_GROUP_CHILDREN_MAIN_SIZE, &it); - } - -private: - ArkUI_NativeNodeAPI_1 *api_ = nullptr; - std::shared_ptr adapter_; - std::shared_ptr header_; - std::shared_ptr footer_; -}; - -#endif // LIST_ITEM_GROUP_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListItemSwipe.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListItemSwipe.h deleted file mode 100644 index 33e8f06d08e62f4ddf867b7706b4abbf41800f98..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListItemSwipe.h +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef LIST_ITEM_SWIPE_H -#define LIST_ITEM_SWIPE_H - -#include - -#include -#include -#include - -#ifndef LOG_TAG -#define LOG_TAG "ListItemSwipe" -#endif - -/** - * 轻量封装:为 ARKUI_NODE_LIST_ITEM 配置 Swipe Action(左右动作区、阈值、回调等) - */ -class ListItemSwipe { -public: - explicit ListItemSwipe(ArkUI_NativeNodeAPI_1 *api) : api_(api) {} - ~ListItemSwipe() - { - if (option_) { - OH_ArkUI_ListItemSwipeActionOption_Dispose(option_); - option_ = nullptr; - } - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_Dispose(startItem_); - startItem_ = nullptr; - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_Dispose(endItem_); - endItem_ = nullptr; - } - } - - // ====== 构建左右动作区 ====== - ListItemSwipe &BuildStartArea(const std::function &builder) - { - EnsureOption(); - if (!startItem_) { - startItem_ = OH_ArkUI_ListItemSwipeActionItem_Create(); - } - ArkUI_NodeHandle node = builder ? builder(api_) : nullptr; - OH_ArkUI_ListItemSwipeActionItem_SetContent(startItem_, node); - OH_ArkUI_ListItemSwipeActionOption_SetStart(option_, startItem_); - return *this; - } - - ListItemSwipe &BuildEndArea(const std::function &builder) - { - EnsureOption(); - if (!endItem_) { - endItem_ = OH_ArkUI_ListItemSwipeActionItem_Create(); - } - ArkUI_NodeHandle node = builder ? builder(api_) : nullptr; - OH_ArkUI_ListItemSwipeActionItem_SetContent(endItem_, node); - OH_ArkUI_ListItemSwipeActionOption_SetEnd(option_, endItem_); - return *this; - } - - // ====== 阈值(长距离删除阈值) ====== - ListItemSwipe &SetActionAreaDistance(float distance) - { - EnsureStartEnd(); - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetActionAreaDistance(startItem_, distance); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetActionAreaDistance(endItem_, distance); - } - return *this; - } - - float GetActionAreaDistanceStart() const - { - if (startItem_) { - return OH_ArkUI_ListItemSwipeActionItem_GetActionAreaDistance(startItem_); - } - return -1.0f; - } - - float GetActionAreaDistanceEnd() const - { - if (endItem_) { - return OH_ArkUI_ListItemSwipeActionItem_GetActionAreaDistance(endItem_); - } - return -1.0f; - } - - // ====== 进入/退出/触发/状态变化 ====== - ListItemSwipe &OnEnter(const std::function &cb) - { - EnsureStartEnd(); - enter_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionArea(startItem_, &ThunkEnter); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionArea(endItem_, &ThunkEnter); - } - return *this; - } - - ListItemSwipe &OnExit(const std::function &cb) - { - EnsureStartEnd(); - exit_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionArea(startItem_, &ThunkExit); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionArea(endItem_, &ThunkExit); - } - return *this; - } - - ListItemSwipe &OnAction(const std::function &cb) - { - EnsureStartEnd(); - action_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnAction(startItem_, &ThunkAction); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnAction(endItem_, &ThunkAction); - } - return *this; - } - - ListItemSwipe &OnStateChange(const std::function &cb) - { - EnsureStartEnd(); - state_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnStateChange(startItem_, &ThunkState); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnStateChange(endItem_, &ThunkState); - } - return *this; - } - - ListItemSwipe &OnEnterWithUserData(const std::function &cb) - { - EnsureStartEnd(); - enterUD_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionAreaWithUserData(startItem_, this, &ThunkEnterUD); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionAreaWithUserData(endItem_, this, &ThunkEnterUD); - } - return *this; - } - - ListItemSwipe &OnExitWithUserData(const std::function &cb) - { - EnsureStartEnd(); - exitUD_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionAreaWithUserData(startItem_, this, &ThunkExitUD); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionAreaWithUserData(endItem_, this, &ThunkExitUD); - } - return *this; - } - - ListItemSwipe &OnActionWithUserData(const std::function &cb) - { - EnsureStartEnd(); - actionUD_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnActionWithUserData(startItem_, this, &ThunkActionUD); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnActionWithUserData(endItem_, this, &ThunkActionUD); - } - return *this; - } - - ListItemSwipe &OnStateChangeWithUserData(const std::function &cb) - { - EnsureStartEnd(); - stateUD_ = cb; - if (startItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnStateChangeWithUserData(startItem_, this, &ThunkStateUD); - } - if (endItem_) { - OH_ArkUI_ListItemSwipeActionItem_SetOnStateChangeWithUserData(endItem_, this, &ThunkStateUD); - } - return *this; - } - - // ====== Edge Effect / Offset 回调 ====== - ListItemSwipe &SetEdgeEffect(int edgeEffect /*ArkUI_ListItemSwipeEdgeEffect*/) - { - EnsureOption(); - OH_ArkUI_ListItemSwipeActionOption_SetEdgeEffect( - option_, static_cast(edgeEffect)); - return *this; - } - - int GetEdgeEffect() const - { - if (option_) { - return OH_ArkUI_ListItemSwipeActionOption_GetEdgeEffect(option_); - } - return -1; - } - - ListItemSwipe &OnOffsetChange(const std::function &cb) - { - EnsureOption(); - offset_ = cb; - OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChange(option_, &ThunkOffset); - return *this; - } - - ListItemSwipe &OnOffsetChangeWithUserData(const std::function &cb) - { - EnsureOption(); - offsetUD_ = cb; - OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChangeWithUserData(option_, this, &ThunkOffsetUD); - return *this; - } - - // ====== 挂载到指定 LIST_ITEM 节点 ====== - void AttachToListItem(ArkUI_NodeHandle listItem) - { - if (!api_ || !listItem) { - return; - } - EnsureOption(); - ArkUI_AttributeItem it{nullptr, 0, nullptr, option_}; - api_->setAttribute(listItem, NODE_LIST_ITEM_SWIPE_ACTION, &it); - - (void)GetActionAreaDistanceStart(); - (void)GetActionAreaDistanceEnd(); - (void)GetEdgeEffect(); - } - -private: - void EnsureOption() - { - if (!option_) { - option_ = OH_ArkUI_ListItemSwipeActionOption_Create(); - } - } - - void EnsureStartEnd() - { - EnsureOption(); - if (!startItem_) { - startItem_ = OH_ArkUI_ListItemSwipeActionItem_Create(); - } - if (!endItem_) { - endItem_ = OH_ArkUI_ListItemSwipeActionItem_Create(); - } - OH_ArkUI_ListItemSwipeActionOption_SetStart(option_, startItem_); - OH_ArkUI_ListItemSwipeActionOption_SetEnd(option_, endItem_); - } - - static void ThunkEnter() {} - static void ThunkExit() {} - static void ThunkAction() {} - static void ThunkState(ArkUI_ListItemSwipeActionState state) { (void)state; } - static void ThunkOffset(float offset) { (void)offset; } - - static void ThunkEnterUD(void *ud) - { - if (auto *self = static_cast(ud); self && self->enterUD_) { - self->enterUD_(ud); - } - } - - static void ThunkExitUD(void *ud) - { - if (auto *self = static_cast(ud); self && self->exitUD_) { - self->exitUD_(ud); - } - } - - static void ThunkActionUD(void *ud) - { - if (auto *self = static_cast(ud); self && self->actionUD_) { - self->actionUD_(ud); - } - } - - static void ThunkStateUD(ArkUI_ListItemSwipeActionState state, void *ud) - { - if (auto *self = static_cast(ud); self && self->stateUD_) { - self->stateUD_(static_cast(state), ud); - } - if (auto *self2 = static_cast(ud); self2 && self2->state_) { - self2->state_(static_cast(state)); - } - } - - static void ThunkOffsetUD(float offset, void *ud) - { - if (auto *self = static_cast(ud); self && self->offsetUD_) { - self->offsetUD_(offset, ud); - } - } - -private: - ArkUI_NativeNodeAPI_1 *api_{nullptr}; - - ArkUI_ListItemSwipeActionItem *startItem_{nullptr}; - ArkUI_ListItemSwipeActionItem *endItem_{nullptr}; - ArkUI_ListItemSwipeActionOption *option_{nullptr}; - - // 无 userData 回调 - std::function enter_; - std::function exit_; - std::function action_; - std::function state_; - std::function offset_; - - // 带 userData 回调 - std::function enterUD_; - std::function exitUD_; - std::function actionUD_; - std::function stateUD_; - std::function offsetUD_; -}; - -#endif // LIST_ITEM_SWIPE_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListMaker.cpp deleted file mode 100644 index 1d627c50ab03ef467ca74e2e6c28e0539d14e176..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListMaker.cpp +++ /dev/null @@ -1,730 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "ScrollableUtils.h" - -#ifndef LOG_TAG -#define LOG_TAG "ListMaker" -#endif - -#include "ScrollableNode.h" -#include "ArkUINodeAdapter.h" -#include "ListMaker.h" -#include "ListItemGroup.h" -#include "ListItemSwipe.h" - -/** ======================== 常量配置:布局/样式/文案 ======================== */ -namespace { -constexpr int K_ALPHABET_COUNT = 26; -constexpr int K_INDEX_ITEM_HEIGHT = 22; -constexpr int32_t K_FIRST_GROUP_INDEX = 0; - -constexpr float K_LIST_WIDTH_PERCENT = 0.82f; -constexpr float K_FULL_PERCENT = 1.0f; -constexpr float K_LIST_SPACE = 8.0f; - -constexpr float K_ITEM_FONT_SIZE = 16.0f; -constexpr float K_INDEX_FONT_SIZE = 14.0f; -constexpr float K_ROW_HEIGHT = 80.0f; - -constexpr float K_DELETE_WIDTH = 88.0f; - -constexpr float K_INDEX_BAR_WIDTH = 56.0f; -constexpr float K_INDEX_BAR_PAD_TOP = 0.0f; -constexpr float K_INDEX_BAR_PAD_RIGHT = 0.0f; -constexpr float K_INDEX_BAR_PAD_BOTTOM = 0.0f; -constexpr float K_INDEX_BAR_PAD_LEFT = 8.0f; - -constexpr float K_HEADER_HEIGHT = 40.0f; -constexpr float K_FOOTER_HEIGHT = 28.0f; - -constexpr uint32_t K_COLOR_WHITE = 0xFFFFFFFFU; -constexpr uint32_t K_COLOR_BLACK = 0xFF000000U; -constexpr uint32_t K_COLOR_DELETE_BG = 0xFFE53935U; -constexpr uint32_t K_COLOR_INDEX_ACTIVE = 0xFF003366U; -constexpr uint32_t K_COLOR_INDEX_INACTIVE = 0xFF222222U; -constexpr uint32_t K_COLOR_INDEX_ACTIVE_BG = 0xFFE0F0FFU; -constexpr uint32_t K_COLOR_INDEX_INACTIVE_BG = 0x00000000U; - -constexpr uint32_t K_COLOR_HEADER_BG = 0xFFEFEFEFU; -constexpr uint32_t K_COLOR_FOOTER_BG = 0xFFF7F7F7U; - -constexpr int K_EDGE_EFFECT_NONE = 0; - -constexpr const char *K_DELETE_TEXT = "Delete"; -constexpr const char *K_FOOTER_TEXT = "—— 已到底 ——"; -constexpr const char *K_INVALID_TEXT = ""; - -constexpr unsigned int K_LOG_DOMAIN = 0xFF00; -} // namespace - -static const char *const NAMES_A[] = {"Alice", "Andrew", "Amy", "Aaron", "安娜", "安琪", "爱华", "阿明"}; -static const char *const NAMES_B[] = {"Ben", "Bella", "Brian", "Brandon", "博文", "斌", "白雪", "彬彬"}; -static const char *const NAMES_C[] = {"Chris", "Charlotte", "Cindy", "Caleb", "晨曦", "承泽", "楚怡", "春燕"}; -static const char *const NAMES_D[] = {"Daniel", "David", "Diana", "Dylan", "大伟", "东旭", "德华", "丹妮"}; -static const char *const NAMES_E[] = {"Emma", "Ethan", "Emily", "Eric", "恩泽", "恩雅", "尔雅", "恩宁"}; -static const char *const NAMES_F[] = {"Frank", "Fiona", "Felix", "Fred", "方圆", "芙蓉", "芳怡", "飞扬"}; -static const char *const NAMES_G[] = {"Grace", "George", "Gavin", "Gloria", "国强", "国华", "光耀", "桂英"}; -static const char *const NAMES_H[] = {"Henry", "Hannah", "Helen", "Harry", "海峰", "红梅", "宏伟", "浩然"}; -static const char *const NAMES_I[] = {"Isaac", "Ice", "Ian", "Isabella", "一涵", "一诺", "怡君", "依琳"}; -static const char *const NAMES_J[] = {"Jack", "James", "Jason", "Julia", "佳怡", "建国", "靖雯", "俊杰"}; -static const char *const NAMES_K[] = {"Kevin", "Kate", "Kelly", "Kyle", "可欣", "可可", "昆明", "康宁"}; -static const char *const NAMES_L[] = {"Lucas", "Leo", "Lily", "Lauren", "丽丽", "丽华", "立国", "林涛"}; -static const char *const NAMES_M[] = {"Michael", "Mary", "Mark", "Molly", "美玲", "明慧", "明杰", "梦瑶"}; -static const char *const NAMES_N[] = {"Nancy", "Nathan", "Nick", "Nora", "楠楠", "宁静", "娜娜", "乃文"}; -static const char *const NAMES_O[] = {"Oliver", "Olivia", "Owen", "Oscar", "欧阳娜", "欧莉", "欧阳晨", "欧文"}; -static const char *const NAMES_P[] = {"Peter", "Paul", "Philip", "Penny", "佩琪", "佩华", "平安", "鹏飞"}; -static const char *const NAMES_Q[] = {"Quentin", "Queenie", "Quinn", "Quincy", "琪琳", "倩倩", "清华", "强辉"}; -static const char *const NAMES_R[] = {"Robert", "Rachel", "Ryan", "Ruby", "荣辉", "若曦", "瑞雪", "日新"}; -static const char *const NAMES_S[] = {"Steven", "Susan", "Sarah", "Simon", "思远", "素芳", "诗涵", "少华"}; -static const char *const NAMES_T[] = {"Thomas", "Tony", "Tina", "Taylor", "天宇", "婷怡", "涛涛", "同辉"}; -static const char *const NAMES_U[] = {"Ulysses", "Uma", "Ulrich", "Ursula", "宇航", "宇轩", "宇宁", "宇泽"}; -static const char *const NAMES_V[] = {"Victor", "Victoria", "Vincent", "Vivian", "薇薇", "维娜", "维德", "维琪"}; -static const char *const NAMES_W[] = {"William", "Wendy", "Walter", "Willow", "伟强", "文静", "文博", "卫东"}; -static const char *const NAMES_X[] = {"Xavier", "Xander", "Xenia", "Xiomara", "晓明", "欣怡", "旭东", "霞"}; -static const char *const NAMES_Y[] = {"Yvonne", "Yolanda", "Yara", "Yvette", "怡然", "颖颖", "逸飞", "毅然"}; -static const char *const NAMES_Z[] = {"Zoe", "Zachary", "Zane", "Zara", "紫琪", "志强", "梓涵", "泽宇"}; - -struct GroupNames { - char letter; - const char *const *arr; - int size; -}; - -static const GroupNames g_groups[] = { - {'A', NAMES_A, ArrSize(NAMES_A)}, {'B', NAMES_B, ArrSize(NAMES_B)}, {'C', NAMES_C, ArrSize(NAMES_C)}, - {'D', NAMES_D, ArrSize(NAMES_D)}, {'E', NAMES_E, ArrSize(NAMES_E)}, {'F', NAMES_F, ArrSize(NAMES_F)}, - {'G', NAMES_G, ArrSize(NAMES_G)}, {'H', NAMES_H, ArrSize(NAMES_H)}, {'I', NAMES_I, ArrSize(NAMES_I)}, - {'J', NAMES_J, ArrSize(NAMES_J)}, {'K', NAMES_K, ArrSize(NAMES_K)}, {'L', NAMES_L, ArrSize(NAMES_L)}, - {'M', NAMES_M, ArrSize(NAMES_M)}, {'N', NAMES_N, ArrSize(NAMES_N)}, {'O', NAMES_O, ArrSize(NAMES_O)}, - {'P', NAMES_P, ArrSize(NAMES_P)}, {'Q', NAMES_Q, ArrSize(NAMES_Q)}, {'R', NAMES_R, ArrSize(NAMES_R)}, - {'S', NAMES_S, ArrSize(NAMES_S)}, {'T', NAMES_T, ArrSize(NAMES_T)}, {'U', NAMES_U, ArrSize(NAMES_U)}, - {'V', NAMES_V, ArrSize(NAMES_V)}, {'W', NAMES_W, ArrSize(NAMES_W)}, {'X', NAMES_X, ArrSize(NAMES_X)}, - {'Y', NAMES_Y, ArrSize(NAMES_Y)}, {'Z', NAMES_Z, ArrSize(NAMES_Z)}}; - -struct ClickCtx { - ArkUI_NativeNodeAPI_1 *api{nullptr}; - std::shared_ptr> items; - std::weak_ptr adapter; - int index{-1}; - uint64_t stableId{0}; - ArkUI_NodeHandle itemHandle{nullptr}; -}; - -static std::unordered_map> s_btnCtx; -static std::unordered_map s_itemToDeleteBtn; - -struct ItemCtx { - std::shared_ptr> items; - std::weak_ptr adapter; - int index{-1}; - uint64_t stableId{0}; -}; -static std::unordered_map s_itemCtx; - -static int FindIndexByStableId(const std::vector &items, uint64_t sid) -{ - const int n = static_cast(items.size()); - for (int i = 0; i < n; ++i) { - uint64_t v = static_cast(std::hash{}(items[static_cast(i)])); - if (v == sid) { - return i; - } - } - return -1; -} - -static int ClampFallbackIndex(int fallback, int n) -{ - if (n <= 0) { - return -1; - } - int idx = fallback; - if (idx < 0) { - idx = 0; - } - if (idx >= n) { - idx = n - 1; - } - return idx; -} - -static int ResolveDeleteIndex(const ItemCtx &cur, const std::vector &vec) -{ - const int n = static_cast(vec.size()); - if (n <= 0) { - return -1; - } - - if (cur.stableId != 0) { - const int idx = FindIndexByStableId(vec, cur.stableId); - if (idx >= 0) { - return idx; - } - } - - if (cur.index >= 0 && cur.index < n) { - const uint64_t sidAt = static_cast(std::hash{}(vec[static_cast(cur.index)])); - if (sidAt == cur.stableId || cur.stableId == 0) { - return cur.index; - } - } - - if (cur.stableId != 0) { - const int s = std::max(0, cur.index - 2); - const int e = std::min(n - 1, cur.index + 2); - for (int i = s; i <= e; ++i) { - const uint64_t sid = static_cast(std::hash{}(vec[static_cast(i)])); - if (sid == cur.stableId) { - return i; - } - } - } - - return ClampFallbackIndex(cur.index, n); -} - -static void DetachItemCtx(ItemCtx &cur) -{ - cur.items.reset(); - cur.index = -1; - cur.stableId = 0; -} - -static void EraseAndNotify(std::shared_ptr> &holdItems, int idx, - const std::weak_ptr &adapterWeak) -{ - auto &vecRef = *holdItems; - if (idx >= 0 && idx < static_cast(vecRef.size())) { - vecRef.erase(vecRef.begin() + idx); - } - if (auto ad = adapterWeak.lock()) { - ad->RemoveRange(idx, 1); // 触发 UI 回收/重绑 - } -} - -static ArkUI_NativeNodeAPI_1 *FindApiFromItem(ArkUI_NodeHandle item) -{ - auto itBtn = s_itemToDeleteBtn.find(item); - if (itBtn == s_itemToDeleteBtn.end()) { - return nullptr; - } - auto itCtx = s_btnCtx.find(itBtn->second); - if (itCtx == s_btnCtx.end() || !itCtx->second) { - return nullptr; - } - return itCtx->second->api; -} - -static void CollapseTailVisualIfNeeded(ArkUI_NodeHandle item, int erasedIdx, int prevSize, ArkUI_NativeNodeAPI_1 *api) -{ - if (!api || !item) { - return; - } - if (prevSize <= 0 || erasedIdx != prevSize - 1) { - return; - } - ArkUI_NodeHandle text = api->getFirstChild(item); - if (text) { - SetTextContent(api, text, ""); - SetAttributeFloat32(api, text, NODE_HEIGHT, 0.0f); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, 0.0f); - } - SetAttributeFloat32(api, item, NODE_HEIGHT, 0.0f); -} - -static void LogDeleteOutcome(const std::string &del, int idx, int newSize, bool wasLast) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: [%s] at idx=%d, newSize=%d (last=%s)", - del.c_str(), idx, newSize, wasLast ? "yes" : "no"); -} - -static bool DeleteByItem(ArkUI_NodeHandle item) -{ - auto it = s_itemCtx.find(item); - if (it == s_itemCtx.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: no ctx for item=%p", item); - return false; - } - - ItemCtx &cur = it->second; - if (!cur.items) { - OH_LOG_Print(LOG_APP, LOG_WARN, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: ignored (already consumed) item=%p", - item); - return false; - } - - auto &vec = *cur.items; - const int prevSize = static_cast(vec.size()); - if (prevSize <= 0) { - OH_LOG_Print(LOG_APP, LOG_WARN, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: empty vector"); - return false; - } - - const int idx = ResolveDeleteIndex(cur, vec); - if (idx < 0 || idx >= prevSize) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "DeleteByItem: invalid idx (bind=%d size=%d sid=%llu)", - cur.index, prevSize, static_cast(cur.stableId)); - return false; - } - - const std::string del = vec[static_cast(idx)]; - std::shared_ptr> holdItems = cur.items; - auto adapterWeak = cur.adapter; - - DetachItemCtx(cur); - EraseAndNotify(holdItems, idx, adapterWeak); - CollapseTailVisualIfNeeded(item, idx, prevSize, FindApiFromItem(item)); - LogDeleteOutcome(del, idx, static_cast(holdItems->size()), idx == prevSize - 1); - return true; -} - -static void StaticDeleteBtnEvent(ArkUI_NodeEvent *ev) -{ - if (ev == nullptr) { - return; - } - - const int et = OH_ArkUI_NodeEvent_GetEventType(ev); - if (et != NODE_ON_CLICK && et != NODE_ON_CLICK_EVENT) { - return; - } - - auto *ctx = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(ev)); - if (ctx == nullptr) { - return; - } - - if (!DeleteByItem(ctx->itemHandle)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "StaticDeleteBtnEvent: DeleteByItem failed (item=%p)", - ctx->itemHandle); - } -} - -static std::shared_ptr MakeText(const char *s, float h, uint32_t bg) -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - std::shared_ptr node = std::make_shared(text); - - SetTextContent(api, text, s); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_ITEM_FONT_SIZE); - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, K_FULL_PERCENT); - SetAttributeFloat32(api, text, NODE_HEIGHT, h); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, h); - SetAttributeInt32(api, text, NODE_TEXT_ALIGN, ARKUI_TEXT_ALIGNMENT_CENTER); - SetAttributeUInt32(api, text, NODE_BACKGROUND_COLOR, bg); - return node; -} - -static void SetIndexTextStyle(ArkUI_NodeHandle text, int h, bool active) -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_INDEX_FONT_SIZE); - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, K_FULL_PERCENT); - SetAttributeFloat32(api, text, NODE_HEIGHT, static_cast(h)); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, static_cast(h)); - SetAttributeInt32(api, text, NODE_TEXT_ALIGN, ARKUI_TEXT_ALIGNMENT_CENTER); - SetAttributeUInt32(api, text, NODE_FONT_COLOR, active ? K_COLOR_INDEX_ACTIVE : K_COLOR_INDEX_INACTIVE); - SetAttributeUInt32(api, text, NODE_BACKGROUND_COLOR, active ? K_COLOR_INDEX_ACTIVE_BG : K_COLOR_INDEX_INACTIVE_BG); -} - -struct IndexState { - std::vector> letters; - int selected; - std::vector groupVisible; - IndexState() : selected(-1) - { - } -}; - -static void UpdateIndexHighlight(const std::shared_ptr &st, int idx) -{ - if (!st) { - return; - } - if (st->selected == idx) { - return; - } - - int prev = st->selected; - if (prev >= 0 && prev < static_cast(st->letters.size())) { - ArkUI_NodeHandle prevHandle = st->letters[static_cast(prev)]->GetHandle(); - SetIndexTextStyle(prevHandle, K_INDEX_ITEM_HEIGHT, false); - } - if (idx >= 0 && idx < static_cast(st->letters.size())) { - ArkUI_NodeHandle nowHandle = st->letters[static_cast(idx)]->GetHandle(); - SetIndexTextStyle(nowHandle, K_INDEX_ITEM_HEIGHT, true); - st->selected = idx; - } -} - -static std::shared_ptr BuildRightIndexColumn(const std::shared_ptr &list, - const std::shared_ptr &st) -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - ArkUI_NodeHandle colHandle = api->createNode(ARKUI_NODE_COLUMN); - std::shared_ptr col = std::make_shared(colHandle); - - col->SetWidth(K_INDEX_BAR_WIDTH); - col->SetHeightPercent(K_FULL_PERCENT); - - SetPadding(api, col->GetHandle(), - Padding::Only(K_INDEX_BAR_PAD_TOP, K_INDEX_BAR_PAD_RIGHT, K_INDEX_BAR_PAD_BOTTOM, K_INDEX_BAR_PAD_LEFT)); - - st->letters.reserve(K_ALPHABET_COUNT); - for (int i = 0; i < K_ALPHABET_COUNT; ++i) { - char label[2]; - label[0] = static_cast('A' + i); - label[1] = '\0'; - - ArkUI_NodeHandle textHandle = api->createNode(ARKUI_NODE_TEXT); - std::shared_ptr t = std::make_shared(textHandle); - - SetTextContent(api, textHandle, label); - SetIndexTextStyle(textHandle, K_INDEX_ITEM_HEIGHT, false); - - int group = i; - t->RegisterOnClick([list, st, i, group](ArkUI_NodeEvent *) { - UpdateIndexHighlight(st, i); - list->ScrollToIndexInGroup(group, 0); - }); - - col->AddChild(t); - st->letters.emplace_back(t); - } - return col; -} - -static std::shared_ptr ApplyListSafeProps() -{ - std::shared_ptr list = std::make_shared(); - list->SetWidthPercent(K_LIST_WIDTH_PERCENT); - list->SetHeightPercent(K_FULL_PERCENT); - list->SetScrollBarState(true); - list->SetClipContent(true); - list->SetSpace(K_LIST_SPACE); - list->SetNestedScrollMode(ListMaker::kNestedScrollParentFirst); - return list; -} - -static ArkUI_NodeHandle CreateDeleteButton(ArkUI_NativeNodeAPI_1 *api) -{ - ArkUI_NodeHandle btn = api->createNode(ARKUI_NODE_BUTTON); - - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - SetTextContent(api, text, K_DELETE_TEXT); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_INDEX_FONT_SIZE); - SetAttributeUInt32(api, text, NODE_FONT_COLOR, K_COLOR_WHITE); - - ArkUI_NumberValue ta = {.i32 = ARKUI_TEXT_ALIGNMENT_CENTER}; - ArkUI_AttributeItem taItem = {&ta, 1}; - api->setAttribute(text, NODE_TEXT_ALIGN, &taItem); - - ArkUI_NumberValue hitValChild = {.i32 = ARKUI_HIT_TEST_MODE_TRANSPARENT}; - ArkUI_AttributeItem hitItemChild = {&hitValChild, 1}; - api->setAttribute(text, NODE_HIT_TEST_BEHAVIOR, &hitItemChild); - - api->addChild(btn, text); - - SetAttributeFloat32(api, btn, NODE_WIDTH, K_DELETE_WIDTH); - SetAttributeFloat32(api, btn, NODE_HEIGHT, K_ROW_HEIGHT); - SetAttributeUInt32(api, btn, NODE_BACKGROUND_COLOR, K_COLOR_DELETE_BG); - - ArkUI_NumberValue alignSelf = {.i32 = ARKUI_ITEM_ALIGNMENT_STRETCH}; - ArkUI_AttributeItem alignSelfItem = {&alignSelf, 1}; - api->setAttribute(btn, NODE_ALIGN_SELF, &alignSelfItem); - - ArkUI_NumberValue buttonTypeValue = {.i32 = ARKUI_BUTTON_TYPE_NORMAL}; - ArkUI_AttributeItem buttonTypeItem = {&buttonTypeValue, 1}; - api->setAttribute(btn, NODE_BUTTON_TYPE, &buttonTypeItem); - - ArkUI_NumberValue hitVal = {.i32 = ARKUI_HIT_TEST_MODE_BLOCK}; - ArkUI_AttributeItem hitItem = {&hitVal, 1}; - api->setAttribute(btn, NODE_HIT_TEST_BEHAVIOR, &hitItem); - - return btn; -} - -static void SetupSwipeForListItem(ArkUI_NodeHandle item, ArkUI_NativeNodeAPI_1 *api, - const std::shared_ptr> &items, - const std::weak_ptr &adapterWeak) -{ - static std::vector> s_swipeKeep; - std::unique_ptr swipe = std::make_unique(api); - - auto makeDeleteBtn = [items, adapterWeak, item](ArkUI_NativeNodeAPI_1 *apiInner) -> ArkUI_NodeHandle { - ArkUI_NodeHandle btn = CreateDeleteButton(apiInner); - if (!btn) { - return nullptr; - } - - std::shared_ptr ctx = std::make_shared(); - ctx->api = apiInner; - ctx->items = items; - ctx->adapter = adapterWeak; - ctx->itemHandle = item; - ctx->index = -1; - ctx->stableId = 0; - - s_itemToDeleteBtn[item] = btn; - s_btnCtx[btn] = ctx; - - apiInner->addNodeEventReceiver(btn, &StaticDeleteBtnEvent); - apiInner->registerNodeEvent(btn, NODE_ON_CLICK, 0, ctx.get()); - apiInner->registerNodeEvent(btn, NODE_ON_CLICK_EVENT, 0, ctx.get()); - return btn; - }; - - swipe->BuildEndArea(makeDeleteBtn) - .SetActionAreaDistance(K_DELETE_WIDTH) - .SetEdgeEffect(K_EDGE_EFFECT_NONE) - .OnActionWithUserData([item](void *) { DeleteByItem(item); }); - - swipe->AttachToListItem(item); - s_swipeKeep.emplace_back(std::move(swipe)); -} - -static ArkUI_NodeHandle CreateListItemWithSwipe(ArkUI_NativeNodeAPI_1 *api, - const std::shared_ptr> &items, - const std::weak_ptr &adapterWeak) -{ - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle item = api->createNode(ARKUI_NODE_LIST_ITEM); - api->addChild(item, text); - - SetAttributeFloat32(api, item, NODE_WIDTH_PERCENT, K_FULL_PERCENT); - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, K_FULL_PERCENT); - - SetupSwipeForListItem(item, api, items, adapterWeak); - return item; -} - -static void BindListItemContent(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index, - const std::shared_ptr> &items, - const std::weak_ptr &adapterWeak) -{ - if (!ValidateApiAndNode(api, item, "BindListItemContent")) { - return; - } - if (!IsNotNull(items)) { - return; - } - - ArkUI_NodeHandle text = api->getFirstChild(item); - if (!IsNotNull(text)) { - return; - } - - const int32_t n = static_cast(items->size()); - const bool valid = IsValidIndex(index, n); - const char *content = valid ? (*items)[static_cast(index)].c_str() : K_INVALID_TEXT; - - SetTextContent(api, text, content); - SetBackgroundColor(api, item, K_COLOR_WHITE); - SetTextStyle(api, text, K_ITEM_FONT_SIZE, K_COLOR_BLACK, ARKUI_TEXT_ALIGNMENT_CENTER); - SetAttributeFloat32(api, text, NODE_HEIGHT, K_ROW_HEIGHT); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, K_ROW_HEIGHT); - - // 更新上下文:保证删除时能稳定位中目标项 - auto itBtn = s_itemToDeleteBtn.find(item); - if (itBtn != s_itemToDeleteBtn.end()) { - auto itCtx = s_btnCtx.find(itBtn->second); - if (itCtx != s_btnCtx.end() && itCtx->second) { - ClickCtx &ctx = *itCtx->second; - ctx.index = index; - ctx.items = items; - ctx.adapter = adapterWeak; - ctx.stableId = - valid ? static_cast(std::hash{}((*items)[static_cast(index)])) : 0ULL; - } - } - - // 保存条目上下文 - ItemCtx &ic = s_itemCtx[item]; - ic.items = items; - ic.adapter = adapterWeak; - ic.index = index; - ic.stableId = valid ? static_cast(std::hash{}((*items)[static_cast(index)])) : 0ULL; - - OH_LOG_Print(LOG_APP, LOG_DEBUG, K_LOG_DOMAIN, LOG_TAG, - "BindListItemContent: item=%p index=%d/%d content=%s stableId=%llu", item, index, n, content, - static_cast(ic.stableId)); -} - -static NodeAdapterCallbacks CreateGroupCallbacks(const std::shared_ptr> &items) -{ - NodeAdapterCallbacks cb{}; - cb.getTotalCount = [items]() -> int32_t { return static_cast(items->size()); }; - cb.getStableId = [items](int32_t i) -> uint64_t { - const int32_t n = static_cast(items->size()); - if (i >= 0 && i < n) { - return static_cast(std::hash{}((*items)[static_cast(i)])); - } - return static_cast(i); - }; - return cb; -} - -static std::shared_ptr> CreateGroupItemsData(const GroupNames &gn) -{ - std::shared_ptr> items = std::make_shared>(); - items->reserve(static_cast(gn.size)); - for (int i = 0; i < gn.size; ++i) { - items->emplace_back(gn.arr[i]); - } - return items; -} - -/** 组头/组尾:头为字母,footer 显示“已到底” */ -static void SetupGroupHeaderAndFooter(std::shared_ptr &group, const GroupNames &gn, bool isLast) -{ - char title[16]{}; - title[0] = gn.letter; - title[1] = '\0'; - - std::shared_ptr header = MakeText(title, K_HEADER_HEIGHT, K_COLOR_HEADER_BG); - group->SetHeader(header); - - if (isLast) { - std::shared_ptr footer = MakeText(K_FOOTER_TEXT, K_FOOTER_HEIGHT, K_COLOR_FOOTER_BG); - group->SetFooter(footer); - } -} - -/** 为组创建 Adapter 回调:onCreate 生成可滑动条目,onBind 写入文案与上下文 */ -static NodeAdapterCallbacks CreateGroupAdapterCallbacks(const std::shared_ptr> &items, - std::shared_ptr adapter) -{ - NodeAdapterCallbacks cb = CreateGroupCallbacks(items); - - cb.onCreate = [items, adapterWeak = std::weak_ptr(adapter)]( - ArkUI_NativeNodeAPI_1 *api, int32_t /*index*/) -> ArkUI_NodeHandle { - OH_LOG_Print(LOG_APP, LOG_DEBUG, K_LOG_DOMAIN, LOG_TAG, "Creating list item"); - return CreateListItemWithSwipe(api, items, adapterWeak); - }; - - cb.onBind = [items, adapterWeak = std::weak_ptr(adapter)](ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle item, int32_t index) { - OH_LOG_Print(LOG_APP, LOG_DEBUG, K_LOG_DOMAIN, LOG_TAG, "Binding item at index=%d", index); - BindListItemContent(api, item, index, items, adapterWeak); - }; - - return cb; -} - -static std::shared_ptr BuildGroup(int gIndex, bool isLast, - const std::shared_ptr & /*st*/) -{ - const GroupNames &gn = g_groups[static_cast(gIndex)]; - std::shared_ptr group = std::make_shared(); - - SetupGroupHeaderAndFooter(group, gn, isLast); - - std::shared_ptr> items = CreateGroupItemsData(gn); - std::shared_ptr adapter = - std::make_shared(static_cast(ARKUI_NODE_LIST_ITEM)); - NodeAdapterCallbacks cb = CreateGroupAdapterCallbacks(items, adapter); - - adapter->SetCallbacks(cb); - group->SetLazyAdapter(adapter); - return group; -} - -/** 创建根布局:左侧列表 + 右侧索引条;支持滚动联动索引高亮与触底高亮 */ -std::shared_ptr CreateAlphabetIndexedListExample() -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - ArkUI_NodeHandle rootHandle = api->createNode(ARKUI_NODE_ROW); - std::shared_ptr root = std::make_shared(rootHandle); - - root->SetWidthPercent(K_FULL_PERCENT); - root->SetHeightPercent(K_FULL_PERCENT); - - std::shared_ptr list = ApplyListSafeProps(); - std::shared_ptr st = std::make_shared(); - st->groupVisible.assign(K_ALPHABET_COUNT, false); - - for (int g = 0; g < K_ALPHABET_COUNT; ++g) { - bool isLast = (g == K_ALPHABET_COUNT - 1); - std::shared_ptr grp = BuildGroup(g, isLast, st); - list->AddChild(std::static_pointer_cast(grp)); - } - - std::shared_ptr right = BuildRightIndexColumn(list, st); - list->RegisterOnScrollIndex([st](int32_t first, int32_t last) { - int idx = first; - if (last == K_ALPHABET_COUNT - 1) { - idx = last; - } - if (idx < 0) { - return; - } - if (idx >= K_ALPHABET_COUNT) { - idx = K_ALPHABET_COUNT - 1; - } - UpdateIndexHighlight(st, idx); - }); - - // 触底时强制高亮最后一组 - list->RegisterOnReachEnd([st]() { UpdateIndexHighlight(st, K_ALPHABET_COUNT - 1); }); - - // 初始高亮 A 组 - UpdateIndexHighlight(st, K_FIRST_GROUP_INDEX); - - root->AddChild(list); - root->AddChild(right); - - static std::vector> g_keepAlive; - g_keepAlive.emplace_back(root); - return root; -} - -ArkUI_NodeHandle ListMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (api == nullptr) { - return nullptr; - } - - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (page == nullptr) { - return nullptr; - } - - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - std::shared_ptr root = CreateAlphabetIndexedListExample(); - if (root && root->GetHandle() != nullptr) { - SetAttributeFloat32(api, root->GetHandle(), NODE_LAYOUT_WEIGHT, 1.0f); - api->addChild(page, root->GetHandle()); - } - return page; -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListMaker.h deleted file mode 100644 index 541fa3b460e74d7abdffcd339bcdf0b955f8e2bd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ListMaker.h +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef LIST_MAKER_H -#define LIST_MAKER_H - -#include -#include - -#include -#include -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollableEvent.h" -#include "ArkUINodeAdapter.h" - -#ifndef LOG_TAG -#define LOG_TAG "ListMaker" -#endif - -class ListMaker : public BaseNode { -public: - static ArkUI_NodeHandle CreateNativeNode(); - - // 嵌套滚动模式常量 - static constexpr int32_t kNestedScrollParentFirst = 0; - static constexpr int32_t kNestedScrollChildFirst = 1; - static constexpr int32_t kNestedScrollSelfFirst = 2; - - // 组件事件数据数组索引常量 - static constexpr int32_t kScrollIndexFirstDataIndex = 0; - static constexpr int32_t kScrollIndexLastDataIndex = 3; - - static constexpr int32_t kVisibleChangeFirstChildDataIndex = 0; - static constexpr int32_t kVisibleChangeStartAreaDataIndex = 1; - static constexpr int32_t kVisibleChangeStartIndexDataIndex = 2; - static constexpr int32_t kVisibleChangeLastChildDataIndex = 3; - static constexpr int32_t kVisibleChangeEndAreaDataIndex = 4; - static constexpr int32_t kVisibleChangeEndIndexDataIndex = 5; - - static constexpr int32_t kScrollFrameBeginDataIndex = 0; - - static constexpr uint32_t kColorTransparent = 0x00000000U; - - // —— 可视内容变化事件数据 —— // - struct VisibleContentChange { - int32_t firstChildIndex = -1; // 可视区域首个“子组件”(item/header/footer)索引 - ArkUI_ListItemGroupArea startArea = ARKUI_LIST_ITEM_GROUP_AREA_OUTSIDE; // 起点区 - int32_t startItemIndex = -1; // 若起点不是 item,则为 -1 - - int32_t lastChildIndex = -1; // 可视区域最后一个“子组件”索引 - ArkUI_ListItemGroupArea endArea = ARKUI_LIST_ITEM_GROUP_AREA_OUTSIDE; // 终点区 - int32_t endItemIndex = -1; // 若终点不是 item,则为 -1 - - bool StartOnItem() const { return startArea == ARKUI_LIST_ITEM_SWIPE_AREA_ITEM && startItemIndex >= 0; } - bool EndOnItem() const { return endArea == ARKUI_LIST_ITEM_SWIPE_AREA_ITEM && endItemIndex >= 0; } - }; - -public: - ListMaker() - : BaseNode(NodeApiInstance::GetInstance()->GetNativeNodeAPI()->createNode(ARKUI_NODE_LIST)), - nodeApi_(NodeApiInstance::GetInstance()->GetNativeNodeAPI()) - { - if (!IsNotNull(nodeApi_) || !IsNotNull(GetHandle())) { - return; - } - - nodeApi_->addNodeEventReceiver(GetHandle(), &ListMaker::StaticEventReceiver); - const uint32_t scrollEventMask = SCROLL_EVT_FRAME_BEGIN | SCROLL_EVT_REACH_END; - scrollEventGuard_.Bind(nodeApi_, GetHandle(), this, scrollEventMask); - } - - ~ListMaker() override - { - scrollEventGuard_.Release(); - - if (!IsNotNull(nodeApi_)) { - return; - } - UnregisterSpecificEvents(); - ResetListAdapter(); - CleanupChildrenMainSizeOption(); - } - - // ======================================== - // 通用属性设置接口 - // ======================================== - void SetClipContent(bool clipEnabled) - { - SetAttributeInt32(nodeApi_, GetHandle(), NODE_SCROLL_CLIP_CONTENT, clipEnabled ? 1 : 0); - } - - void SetEdgeEffectSpring(bool springEnabled) - { - int32_t effectValue = springEnabled ? ARKUI_EDGE_EFFECT_SPRING : ARKUI_EDGE_EFFECT_NONE; - SetAttributeInt32(nodeApi_, GetHandle(), NODE_SCROLL_EDGE_EFFECT, effectValue); - } - - void SetScrollBarVisible(bool visible) - { - int32_t displayMode = visible ? ARKUI_SCROLL_BAR_DISPLAY_MODE_ON : ARKUI_SCROLL_BAR_DISPLAY_MODE_OFF; - SetAttributeInt32(nodeApi_, GetHandle(), NODE_SCROLL_BAR_DISPLAY_MODE, displayMode); - } - - void SetItemSpacing(float spacing) { SetAttributeFloat32(nodeApi_, GetHandle(), NODE_LIST_SPACE, spacing); } - - void SetScrollBarState(bool visible) { SetScrollBarVisible(visible); } - void SetSpace(float spacing) { SetItemSpacing(spacing); } - - void SetNestedScrollMode(int32_t mode) - { - SetAttributeInt32(nodeApi_, GetHandle(), NODE_SCROLL_NESTED_SCROLL, mode); - } - - // ======================================== - // 滚动控制接口 - // ======================================== - void ScrollToIndex(int32_t index) { ScrollToIndex(index, false, ARKUI_SCROLL_ALIGNMENT_START); } - - void ScrollToIndex(int32_t index, bool smooth, ArkUI_ScrollAlignment align) - { - ArkUI_NumberValue v[3]; - v[0].i32 = index; // value[0] - v[1].i32 = smooth ? 1 : 0; // value[1] (optional) - v[2].i32 = static_cast(align); // value[2] (optional) - - ArkUI_AttributeItem it{v, 3}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_SCROLL_TO_INDEX, &it); - } - - void ScrollToIndexInGroup(int32_t groupIndex, int32_t itemIndex) - { - ArkUI_NumberValue values[] = {{.i32 = groupIndex}, {.i32 = itemIndex}}; - ArkUI_AttributeItem item{values, 2}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_SCROLL_TO_INDEX_IN_GROUP, &item); - } - - // ======================================== - // 适配器设置接口 - // ======================================== - void SetLazyAdapter(const std::shared_ptr &adapter) - { - if (!IsNotNull(adapter)) { - nodeApi_->resetAttribute(GetHandle(), NODE_LIST_NODE_ADAPTER); - listAdapter_.reset(); - return; - } - adapter->EnsurePlaceholderTypeOr(static_cast(ARKUI_NODE_LIST_ITEM)); - ArkUI_AttributeItem item{nullptr, 0, nullptr, adapter->GetAdapter()}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_NODE_ADAPTER, &item); - listAdapter_ = adapter; - } - - // —— 扩展属性 —— // - void SetDirection(ArkUI_Axis axis) - { - ArkUI_NumberValue v0{}; - v0.i32 = static_cast(axis); - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_DIRECTION, &it); - } - - void SetSticky(ArkUI_StickyStyle sticky) - { - ArkUI_NumberValue v0{}; - v0.i32 = static_cast(sticky); - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_STICKY, &it); - } - - void SetCachedCount(int32_t count) - { - ArkUI_NumberValue v0{}; - v0.i32 = count; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_CACHED_COUNT, &it); - } - - void SetInitialIndex(int32_t index) - { - ArkUI_NumberValue v0{}; - v0.i32 = index; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_INITIAL_INDEX, &it); - } - - void SetDivider(float widthPx) - { - ArkUI_NumberValue v0{}; - v0.f32 = widthPx; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_DIVIDER, &it); - } - - void SetAlignListItem(ArkUI_ListItemAlignment align) - { - ArkUI_NumberValue v0{}; - v0.i32 = static_cast(align); - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_ALIGN_LIST_ITEM, &it); - } - - void SetChildrenMainSizeOption(ArkUI_ListChildrenMainSize *opt) - { - ArkUI_AttributeItem it{nullptr, 0, nullptr, opt}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_CHILDREN_MAIN_SIZE, &it); - childrenMainSizeOption_ = opt; - } - - void SetFocusWrapMode(int mode) - { - ArkUI_NumberValue v0{}; - v0.i32 = mode; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_FOCUS_WRAP_MODE, &it); - } - - void SetMaintainVisibleContentPosition(bool on) - { - ArkUI_NumberValue v0{}; - v0.i32 = on ? 1 : 0; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_MAINTAIN_VISIBLE_CONTENT_POSITION, &it); - } - - void SetStackFromEnd(bool on) - { - ArkUI_NumberValue v0{}; - v0.i32 = on ? 1 : 0; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_STACK_FROM_END, &it); - } - - void SetSyncLoad(bool on) - { - ArkUI_NumberValue v0{}; - v0.i32 = on ? 1 : 0; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_SYNC_LOAD, &it); - } - - void SetScrollSnapAlign(int align /*ARKUI_SCROLL_SNAP_ALIGN_**/) - { - ArkUI_NumberValue v0{}; - v0.i32 = align; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_SCROLL_SNAP_ALIGN, &it); - } - - void SetLanes(int lanes) - { - ArkUI_NumberValue v0{}; - v0.i32 = lanes; - ArkUI_AttributeItem it{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_LIST_LANES, &it); - } - - void SetContentOffsets(float startPx, float endPx) - { - ArkUI_NumberValue v0{}; - v0.f32 = startPx; - ArkUI_AttributeItem it0{&v0, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_SCROLL_CONTENT_START_OFFSET, &it0); - - ArkUI_NumberValue v1{}; - v1.f32 = endPx; - ArkUI_AttributeItem it1{&v1, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_SCROLL_CONTENT_END_OFFSET, &it1); - } - - // ======================================== - // 事件注册接口 - // ======================================== - void RegisterOnScrollIndex(const std::function &callback) - { - onScrollIndexCallback_ = callback; - if (!isScrollIndexEventRegistered_) { - nodeApi_->registerNodeEvent(GetHandle(), NODE_LIST_ON_SCROLL_INDEX, 0, this); - isScrollIndexEventRegistered_ = true; - } - } - - // 可视区域变化 - void RegisterOnVisibleContentChange(const std::function &callback) - { - onVisibleChangeCallback_ = callback; - if (!isVisibleChangeEventRegistered_) { - nodeApi_->registerNodeEvent(GetHandle(), NODE_LIST_ON_SCROLL_VISIBLE_CONTENT_CHANGE, 0, this); - isVisibleChangeEventRegistered_ = true; - } - } - - void RegisterOnWillScroll(const std::function &callback) - { - onWillScrollCallback_ = callback; - if (!isWillScrollEventRegistered_) { - nodeApi_->registerNodeEvent(GetHandle(), NODE_LIST_ON_WILL_SCROLL, 0, this); - isWillScrollEventRegistered_ = true; - } - } - - void RegisterOnDidScroll(const std::function &callback) - { - onDidScrollCallback_ = callback; - if (!isDidScrollEventRegistered_) { - nodeApi_->registerNodeEvent(GetHandle(), NODE_LIST_ON_DID_SCROLL, 0, this); - isDidScrollEventRegistered_ = true; - } - } - - void RegisterOnReachEnd(const std::function &callback) { onReachEndCallback_ = callback; } - - void RegisterOnScrollFrameBegin(const std::function &callback) - { - onScrollFrameBeginCallback_ = callback; - } - -protected: - void OnNodeEvent(ArkUI_NodeEvent *event) override - { - BaseNode::OnNodeEvent(event); - - ArkUI_NodeComponentEvent *componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - if (!IsNotNull(componentEvent)) { - return; - } - - int32_t eventType = OH_ArkUI_NodeEvent_GetEventType(event); - HandleSpecificListEvent(eventType, componentEvent); - } - -private: - void UnregisterSpecificEvents() - { - if (isScrollIndexEventRegistered_) { - nodeApi_->unregisterNodeEvent(GetHandle(), NODE_LIST_ON_SCROLL_INDEX); - } - if (isVisibleChangeEventRegistered_) { - nodeApi_->unregisterNodeEvent(GetHandle(), NODE_LIST_ON_SCROLL_VISIBLE_CONTENT_CHANGE); - } - if (isWillScrollEventRegistered_) { - nodeApi_->unregisterNodeEvent(GetHandle(), NODE_LIST_ON_WILL_SCROLL); - } - if (isDidScrollEventRegistered_) { - nodeApi_->unregisterNodeEvent(GetHandle(), NODE_LIST_ON_DID_SCROLL); - } - } - - void ResetListAdapter() - { - if (IsNotNull(listAdapter_)) { - nodeApi_->resetAttribute(GetHandle(), NODE_LIST_NODE_ADAPTER); - listAdapter_.reset(); - } - } - - void CleanupChildrenMainSizeOption() - { - if (IsNotNull(childrenMainSizeOption_)) { - nodeApi_->resetAttribute(GetHandle(), NODE_LIST_CHILDREN_MAIN_SIZE); - OH_ArkUI_ListChildrenMainSizeOption_Dispose(childrenMainSizeOption_); - childrenMainSizeOption_ = nullptr; - } - } - - void OnScrollIndexEvt(const ArkUI_NodeComponentEvent *ev) - { - if (!onScrollIndexCallback_) { - return; - } - const int32_t firstIndex = ev->data[kScrollIndexFirstDataIndex].i32; - const int32_t lastIndex = ev->data[kScrollIndexLastDataIndex].i32; - onScrollIndexCallback_(firstIndex, lastIndex); - } - - void OnVisibleChangeEvt(const ArkUI_NodeComponentEvent *ev) - { - if (!onVisibleChangeCallback_) { - return; - } - VisibleContentChange v{}; - v.firstChildIndex = ev->data[kVisibleChangeFirstChildDataIndex].i32; - v.startArea = static_cast(ev->data[kVisibleChangeStartAreaDataIndex].i32); - v.startItemIndex = ev->data[kVisibleChangeStartIndexDataIndex].i32; - v.lastChildIndex = ev->data[kVisibleChangeLastChildDataIndex].i32; - v.endArea = static_cast(ev->data[kVisibleChangeEndAreaDataIndex].i32); - v.endItemIndex = ev->data[kVisibleChangeEndIndexDataIndex].i32; - onVisibleChangeCallback_(v); - } - - void OnReachEndEvt() - { - if (onReachEndCallback_) { - onReachEndCallback_(); - } - } - - void OnScrollFrameBeginEvt(const ArkUI_NodeComponentEvent *ev) - { - if (onScrollFrameBeginCallback_) { - onScrollFrameBeginCallback_(ev->data[kScrollFrameBeginDataIndex].f32); - } - } - - void OnWillScrollEvt() - { - if (onWillScrollCallback_) { - onWillScrollCallback_(); - } - } - - void OnDidScrollEvt() - { - if (onDidScrollCallback_) { - onDidScrollCallback_(); - } - } - - void HandleSpecificListEvent(int32_t eventType, ArkUI_NodeComponentEvent *ev) - { - switch (eventType) { - case NODE_LIST_ON_SCROLL_INDEX: - OnScrollIndexEvt(ev); - break; - case NODE_LIST_ON_SCROLL_VISIBLE_CONTENT_CHANGE: - OnVisibleChangeEvt(ev); - break; - case NODE_SCROLL_EVENT_ON_REACH_END: - OnReachEndEvt(); - break; - case NODE_SCROLL_EVENT_ON_SCROLL_FRAME_BEGIN: - OnScrollFrameBeginEvt(ev); - break; - case NODE_LIST_ON_WILL_SCROLL: - OnWillScrollEvt(); - break; - case NODE_LIST_ON_DID_SCROLL: - OnDidScrollEvt(); - break; - default: - break; - } - } - - ArkUI_ListChildrenMainSize *EnsureChildrenMainSizeOption() - { - if (!childrenMainSizeOption_) { - auto *opt = OH_ArkUI_ListChildrenMainSizeOption_Create(); - SetChildrenMainSizeOption(opt); - } - return childrenMainSizeOption_; - } - - void ChildrenMainSizeSetDefault(float mainSize) - { - auto *opt = EnsureChildrenMainSizeOption(); - if (!opt) { - return; - } - OH_ArkUI_ListChildrenMainSizeOption_SetDefaultMainSize(opt, mainSize); - } - - float ChildrenMainSizeGetDefault() const - { - if (!childrenMainSizeOption_) { - return 0.0f; - } - return OH_ArkUI_ListChildrenMainSizeOption_GetDefaultMainSize(childrenMainSizeOption_); - } - - void ChildrenMainSizeResize(int32_t size) - { - auto *opt = EnsureChildrenMainSizeOption(); - if (!opt) { - return; - } - OH_ArkUI_ListChildrenMainSizeOption_Resize(opt, size); - } - - void ChildrenMainSizeSplice(int32_t index, int32_t deleteCount, int32_t addCount) - { - auto *opt = EnsureChildrenMainSizeOption(); - if (!opt) { - return; - } - OH_ArkUI_ListChildrenMainSizeOption_Splice(opt, index, deleteCount, addCount); - } - - void ChildrenMainSizeUpdate(int32_t index, float mainSize) - { - auto *opt = EnsureChildrenMainSizeOption(); - if (!opt) { - return; - } - OH_ArkUI_ListChildrenMainSizeOption_UpdateSize(opt, index, mainSize); - } - - float ChildrenMainSizeGet(int32_t index) const - { - if (!childrenMainSizeOption_) { - return 0.0f; - } - return OH_ArkUI_ListChildrenMainSizeOption_GetMainSize(childrenMainSizeOption_, index); - } - -private: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - std::shared_ptr listAdapter_; - ArkUI_ListChildrenMainSize *childrenMainSizeOption_ = nullptr; - - // 事件回调函数 - std::function onScrollIndexCallback_; - std::function onVisibleChangeCallback_; - std::function onReachEndCallback_; - std::function onScrollFrameBeginCallback_; - std::function onWillScrollCallback_; - std::function onDidScrollCallback_; - - // 事件注册状态 - bool isScrollIndexEventRegistered_ = false; - bool isVisibleChangeEventRegistered_ = false; - bool isWillScrollEventRegistered_ = false; - bool isDidScrollEventRegistered_ = false; - - ScrollEventGuard scrollEventGuard_; -}; - -#endif // LIST_MAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/NativeModule.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/NativeModule.h deleted file mode 100644 index a46cd0b117e1efe682eacd358878e16c555360b9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/NativeModule.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MYAPPLICATION_NATIVEMODULE_H -#define MYAPPLICATION_NATIVEMODULE_H - -#include -#include -#include -#include - -namespace NativeModule { - -class NativeModuleInstance { -public: - static NativeModuleInstance *GetInstance() - { - static NativeModuleInstance instance; - return &instance; - } - - NativeModuleInstance() - { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, arkUINativeNodeApi_); - } - ArkUI_NativeNodeAPI_1 *GetNativeNodeAPI() { return arkUINativeNodeApi_; } - -private: - ArkUI_NativeNodeAPI_1 *arkUINativeNodeApi_ = nullptr; -}; -} // namespace NativeModule -#endif // MYAPPLICATION_NATIVEMODULE_H \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/NodeManager.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/NodeManager.cpp deleted file mode 100644 index b22bd8eeb631a58b11a5baacdb589673ab7c054f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/NodeManager.cpp +++ /dev/null @@ -1,770 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "NodeManager.h" -#include "arkui/native_type.h" -#include -#include -#include -#include -#include -#include - -#define NUM_0 0 -#define NUM_1 1 -#define NUM_2 2 -#define NUM_3 3 -#define NUM_4 4 -#define NUM_6 6 -#define NUM_96 96 -#define NUM_255 255 -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -NodeManager &NodeManager::GetInstance() -{ - static NodeManager instance; - return instance; -} - -void NodeManager::SetContentHandle(ArkUI_NodeContentHandle contentHandle) -{ - contentHandle_ = contentHandle; -} - -//设置进度条的值 -void NodeManager::SetProgressValue(float value) -{ - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - if (nodes_["progress"] != nullptr) { - ArkUI_NumberValue value1[] = {{.f32 = value}}; - ArkUI_AttributeItem item1 = {value1, sizeof(value1) / sizeof(ArkUI_NumberValue)}; - nodeApi->setAttribute(nodes_["progress"], NODE_PROGRESS_VALUE, &item1); - } -} - -//设置进度条的类型 -void NodeManager::SetProgressType(int32_t type) -{ - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - if (nodes_["progress"] != nullptr) { - ArkUI_NumberValue value[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem item = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - value[0].i32 = static_cast(type); - nodeApi->setAttribute(nodes_["progress"], NODE_PROGRESS_TYPE, &item); - } -} - -//用于存储生成的ProgressLinearStyleOption -static std::unordered_map g_styleOptions; -static int g_nextId = 1; - -//设置自定义进度条选项 -void NodeManager::SetProgressLinearStyleOption(bool scanEffect, - bool smoothEffect, int32_t strokeWidth, int32_t strokeRadius) -{ - for (auto option : g_styleOptions) { - OH_ArkUI_ProgressLinearStyleOption_Destroy(option.second); - } - g_styleOptions.clear(); - g_nextId = 1; - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - if (nodes_["progress"] != nullptr) { - auto option = OH_ArkUI_ProgressLinearStyleOption_Create(); - //设置进度条的扫描效果 - OH_ArkUI_ProgressLinearStyleOption_SetScanEffectEnabled(option, scanEffect); - //设置进度变化时的平滑过渡效果 - OH_ArkUI_ProgressLinearStyleOption_SetSmoothEffectEnabled(option, smoothEffect); - //设置线性进度条的线宽 - OH_ArkUI_ProgressLinearStyleOption_SetStrokeWidth(option, strokeWidth); - //设置线性进度条两端的圆角半径 - OH_ArkUI_ProgressLinearStyleOption_SetStrokeRadius(option, strokeRadius); - if (option != nullptr) { - int id = g_nextId++; - g_styleOptions[id] = option; - } - ArkUI_AttributeItem item = {0}; - item.object = option; - nodeApi->setAttribute(nodes_["progress"], NODE_PROGRESS_LINEAR_STYLE, &item); - } -} - -std::string NodeManager::GetProgressLinearStyleOptionAndDestroy() -{ - if (!contentHandle_) { - return ""; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return ""; - } - - auto option = g_styleOptions[g_nextId - 1]; - if (option == nullptr) { - return "has no ProgressLinearStyleOption"; - } - //获取进度条扫描效果 - auto scanEffectEnabled = OH_ArkUI_ProgressLinearStyleOption_GetScanEffectEnabled(option); - //获取进度变化时的平滑过度效果 - auto smoothEffectEnabled = OH_ArkUI_ProgressLinearStyleOption_GetSmoothEffectEnabled(option); - //获取线性进度条的线宽 - auto strokeWidth = OH_ArkUI_ProgressLinearStyleOption_GetStrokeWidth(option); - //获取线性进度条两端的圆角半径 - auto strokeRadius = OH_ArkUI_ProgressLinearStyleOption_GetStrokeRadius(option); - //销毁自定义选项 - OH_ArkUI_ProgressLinearStyleOption_Destroy(option); - g_styleOptions.erase(--g_nextId); - std::string result = "scanEffectEnabled = " + std::to_string(scanEffectEnabled) + - " smoothEffectEnabled = " + std::to_string(smoothEffectEnabled) + - " strokeWidth = " + std::to_string(strokeWidth) + - " strokeRadius = " + std::to_string(strokeRadius); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NativeTypeTest", "result = %{public}s", result.c_str()); - return result; -} - -static std::unordered_map g_ImageAnimator; -static int g_imageNextId = 1; -std::string NodeManager::GetImageAnimatorFrameInfo() -{ - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return ""; - } - - auto imageAnimator = g_ImageAnimator[g_imageNextId - 1]; - if (imageAnimator == nullptr) { - return "has no ImageAnimatorFrameInfo"; - } - //获取当前帧图片的宽度 - auto width = OH_ArkUI_ImageAnimatorFrameInfo_GetWidth(imageAnimator); - //获取当前帧图片的高度 - auto height = OH_ArkUI_ImageAnimatorFrameInfo_GetHeight(imageAnimator); - //获取当前帧在组件中的顶部坐标 - auto top = OH_ArkUI_ImageAnimatorFrameInfo_GetTop(imageAnimator); - //获取当前帧在组件中的左侧坐标 - auto left = OH_ArkUI_ImageAnimatorFrameInfo_GetLeft(imageAnimator); - //获取当前帧的播放时长 - auto duration = OH_ArkUI_ImageAnimatorFrameInfo_GetDuration(imageAnimator); - //释放 imageAnimator 对象占用的内存和资源 - OH_ArkUI_ImageAnimatorFrameInfo_Dispose(imageAnimator); - g_ImageAnimator.erase(--g_imageNextId); - std::string result = " height = " + std::to_string(height) + - " width = " + std::to_string(width) + - " top = " + std::to_string(top) + - " left = " + std::to_string(left) + - " duration = " + std::to_string(duration); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "NativeTypeTest", "result = %{public}s", result.c_str()); - return result; -} - -void NodeManager::CreateDatePicker(int32_t modeType) -{ - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - auto it = nodes_.find("datePicker_column"); - if (it != nodes_.end()) { - //删除原有的column组件 - OH_ArkUI_NodeContent_RemoveNode(contentHandle_, nodes_["datePicker_column"]); - nodeApi->disposeNode(nodes_["datePicker_column"]); - nodes_.erase(it); - } - auto date = nodes_.find("datePicker"); - if (date == nodes_.end()) { - //创建datepicker组件 - ArkUI_NodeHandle datePicker = nodeApi->createNode(ARKUI_NODE_DATE_PICKER); - nodes_["datePicker"] = datePicker; - } - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = 300.f}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - nodes_["datePicker_column"] = column; - - ArkUI_NumberValue value[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem modeItem = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - value[0].i32 = static_cast(modeType); - //设置datepicker组件的NODE_DATE_PICKER_MODE属性 - nodeApi->setAttribute(nodes_["datePicker"], NODE_DATE_PICKER_MODE, &modeItem); - nodeApi->addChild(nodes_["datePicker_column"], nodes_["datePicker"]); - OH_ArkUI_NodeContent_AddNode(contentHandle_, nodes_["datePicker_column"]); -} - -void NodeManager::CreateCalendarPicker(int32_t modeType) -{ - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - auto it = nodes_.find("calendarPicker_column"); - if (it != nodes_.end()) { - //删除原有的column组件 - OH_ArkUI_NodeContent_RemoveNode(contentHandle_, nodes_["calendarPicker_column"]); - nodeApi->disposeNode(nodes_["calendarPicker_column"]); - nodes_.erase(it); - } - auto calendar = nodes_.find("calendarPicker"); - if (calendar == nodes_.end()) { - //创建calendarPicker组件 - ArkUI_NodeHandle calendarPicker = nodeApi->createNode(ARKUI_NODE_CALENDAR_PICKER); - nodes_["calendarPicker"] = calendarPicker; - } - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = 500.f}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - nodes_["calendarPicker_column"] = column; - - ArkUI_NumberValue value[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem modeItem = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - value[0].i32 = static_cast(modeType); - //设置calendarPicker组件的NODE_CALENDAR_PICKER_EDGE_ALIGNMENT属性 - nodeApi->setAttribute(nodes_["calendarPicker"], NODE_CALENDAR_PICKER_EDGE_ALIGNMENT, &modeItem); - - ArkUI_NumberValue Width[] = {{.f32 = 300.f}}; - ArkUI_AttributeItem widthItem1 = {.value = Width, .size = 1}; - nodeApi->setAttribute(nodes_["calendarPicker"], NODE_WIDTH, &widthItem1); - nodeApi->addChild(nodes_["calendarPicker_column"], nodes_["calendarPicker"]); - OH_ArkUI_NodeContent_AddNode(contentHandle_, nodes_["calendarPicker_column"]); -} - -void NodeManager::CreateImageSize(int32_t objectFit, int32_t imageSize) -{ - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - auto it = nodes_.find("image_column"); - if (it != nodes_.end()) { - OH_ArkUI_NodeContent_RemoveNode(contentHandle_, nodes_["image_column"]); - nodeApi->disposeNode(nodes_["image_column"]); - nodes_.erase(it); - } - - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = 350.f}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = 400.f}}; - ArkUI_AttributeItem HeightItem = {.value = textHeight, .size = 1}; - nodeApi->setAttribute(column, NODE_HEIGHT, &HeightItem); - ArkUI_NumberValue borderWidth[] = {{.f32 = 1}}; - ArkUI_AttributeItem borderWidthItem = {.value = borderWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_BORDER_WIDTH, &borderWidthItem); - nodes_["image_column"] = column; - - auto image = nodes_.find("image"); - if (image == nodes_.end()) { - //创建Image组件 - ArkUI_NodeHandle image = nodeApi->createNode(ARKUI_NODE_IMAGE); - char src[] = "resources/base/media/startIcon.png"; - ArkUI_AttributeItem imageItem = {.string = src}; - //设置Image的NODE_IMAGE_SRC属性,为图片路径 - nodeApi->setAttribute(image, NODE_IMAGE_SRC, &imageItem); - nodes_["image"] = image; - } - - ArkUI_NumberValue FitValue[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem objectFitItem = {FitValue, sizeof(FitValue) / sizeof(ArkUI_NumberValue)}; - FitValue[0].i32 = static_cast(objectFit); - //设置Image的NODE_IMAGE_OBJECT_FIT属性 - nodeApi->setAttribute(nodes_["image"], NODE_IMAGE_OBJECT_FIT, &objectFitItem); - - ArkUI_NumberValue value[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem sizeItem = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - value[0].i32 = static_cast(imageSize); - //设置背景的NODE_BACKGROUND_IMAGE_SIZE_WITH_STYLE属性 - nodeApi->setAttribute(nodes_["image_column"], NODE_BACKGROUND_IMAGE_SIZE_WITH_STYLE, &sizeItem); - char backGroundSrc[] = "resources/base/media/640.jpg"; - ArkUI_AttributeItem backgroundItem = {.string = backGroundSrc}; - //设置背景的图片路径 - nodeApi->setAttribute(nodes_["image_column"], NODE_BACKGROUND_IMAGE, &backgroundItem); - nodeApi->addChild(nodes_["image_column"], nodes_["image"]); - OH_ArkUI_NodeContent_AddNode(contentHandle_, nodes_["image_column"]); -} - -void SetImageColumn(ArkUI_NativeNodeAPI_1 *nodeApi, ArkUI_NodeHandle column) -{ - ArkUI_NumberValue colWidth[] = {{.f32 = 350.f}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - ArkUI_NumberValue Height[] = {{.f32 = 400.f}}; - ArkUI_AttributeItem HeightItem = {.value = Height, .size = 1}; - nodeApi->setAttribute(column, NODE_HEIGHT, &HeightItem); - ArkUI_NumberValue borderWidth[] = {{.f32 = 1}}; - ArkUI_AttributeItem borderWidthItem = {.value = borderWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_BORDER_WIDTH, &borderWidthItem); - char backGroundSrc[] = "resources/base/media/startIcon.png"; - ArkUI_AttributeItem backgroundItem = {.string = backGroundSrc}; - nodeApi->setAttribute(column, NODE_BACKGROUND_IMAGE, &backgroundItem); -} - -void NodeManager::SetImageProperties(int32_t imageRepeat, int32_t imageInterpolation, int32_t imageRenderMode) -{ - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - - auto it = nodes_.find("image_column"); - if (it != nodes_.end()) { - OH_ArkUI_NodeContent_RemoveNode(contentHandle_, nodes_["image_column"]); - nodeApi->disposeNode(nodes_["image_column"]); - nodes_.erase(it); - } - //创建column - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - SetImageColumn(nodeApi, column); - nodes_["image_column"] = column; - - auto image = nodes_.find("image"); - if (image == nodes_.end()) { - //创建Image组件 - ArkUI_NodeHandle image = nodeApi->createNode(ARKUI_NODE_IMAGE); - char src[] = "resources/base/media/startIcon.png"; - ArkUI_AttributeItem imageItem = {.string = src}; - nodeApi->setAttribute(image, NODE_IMAGE_SRC, &imageItem); - nodes_["image"] = image; - } - - ArkUI_NumberValue InterpolationValue[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem InterpolationValueItem = {InterpolationValue, - sizeof(InterpolationValue) / sizeof(ArkUI_NumberValue)}; - InterpolationValue[0].i32 = static_cast(imageInterpolation); - //设置Image的NODE_IMAGE_INTERPOLATION属性 - nodeApi->setAttribute(nodes_["image"], NODE_IMAGE_INTERPOLATION, &InterpolationValueItem); - - ArkUI_NumberValue RenderModeValue[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem RenderModeValueItem = {RenderModeValue, - sizeof(RenderModeValue) / sizeof(ArkUI_NumberValue)}; - RenderModeValue[0].i32 = static_cast(imageRenderMode); - //设置Image的NODE_IMAGE_RENDER_MODE属性 - nodeApi->setAttribute(nodes_["image"], NODE_IMAGE_RENDER_MODE, &RenderModeValueItem); - - ArkUI_NumberValue imageRepeatValue[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem imageRepeatItem = {imageRepeatValue, - sizeof(imageRepeatValue) / sizeof(ArkUI_NumberValue)}; - imageRepeatValue[0].i32 = static_cast(imageRepeat); - char backGroundSrc[] = "resources/base/media/startIcon.png"; - imageRepeatItem.string = backGroundSrc; - nodeApi->setAttribute(nodes_["image_column"], NODE_BACKGROUND_IMAGE, &imageRepeatItem); - - nodeApi->addChild(nodes_["image_column"], nodes_["image"]); - OH_ArkUI_NodeContent_AddNode(contentHandle_, nodes_["image_column"]); -} - -void NodeManager::SetUpColumnAndText(ArkUI_NativeNodeAPI_1 *nodeApi, ArkUI_NodeHandle &column, ArkUI_NodeHandle &text) -{ - ArkUI_NumberValue colWidth[] = {{.f32 = 500.f}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - ArkUI_NumberValue backgroundColor[] = {{.f32 = 0xFFFF0000}}; - ArkUI_AttributeItem backgroundColorItem = {.value = backgroundColor, .size = 1}; - nodeApi->setAttribute(column, NODE_BACKGROUND_COLOR, &backgroundColorItem); - - //设置text控件的参数 - ArkUI_NumberValue textWidth[] = {{.f32 = 250}}; - ArkUI_AttributeItem textWidthItem = {.value = textWidth, .size = 1}; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = 50}}; - ArkUI_AttributeItem textHeightItem = {.value = textHeight, .size = 1}; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - ArkUI_NumberValue borderWidth[] = {{.f32 = 1}}; - ArkUI_AttributeItem borderWidthItem = {.value = borderWidth, .size = 1}; - nodeApi->setAttribute(text, NODE_BORDER_WIDTH, &borderWidthItem); - ArkUI_AttributeItem textOutput = {.string = "CrossLanguageOption"}; - nodeApi->setAttribute(text, NODE_TEXT_CONTENT, &textOutput); - nodeApi->addChild(column, text); -} - -//设置text控件的CrossLanguageOption -void NodeManager::SetUpTextCrossLanguage(bool isCross) -{ - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - //创建一个CrossLanguageOption - ArkUI_CrossLanguageOption* option = OH_ArkUI_CrossLanguageOption_Create(); - //设置option的状态 - OH_ArkUI_CrossLanguageOption_SetAttributeSettingStatus(option, isCross); - OH_ArkUI_NodeUtils_SetCrossLanguageOption(nodes_["text"], option); - //获取option的状态 - auto ret = OH_ArkUI_CrossLanguageOption_GetAttributeSettingStatus(option); - //销毁创建的CrossLanguageOption - OH_ArkUI_CrossLanguageOption_Destroy(option); - ArkUI_AttributeItem textOutput; - if (ret) { - textOutput = {.string = "CrossLanguageOption = ture"}; - } else { - textOutput = {.string = "CrossLanguageOption = false"}; - } - nodeApi->setAttribute(nodes_["text"], NODE_TEXT_CONTENT, &textOutput); -} - -void NodeManager::AddTextPicker(int32_t type, ArkUI_NativeNodeAPI_1 *nodeApi, ArkUI_NodeHandle &column) -{ - //创建textPicker组件 - ArkUI_NodeHandle textPicker = nodeApi->createNode(ARKUI_NODE_TEXT_PICKER); - //单列选择框和多列选择框的处理 - if (static_cast(type) == ARKUI_TEXTPICKER_RANGETYPE_SINGLE || - static_cast(type) == ARKUI_TEXTPICKER_RANGETYPE_MULTI) { - char example[] = "111,112;221,222;331,332"; - ArkUI_NumberValue value[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem rangeAttr = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - value[0].i32 = static_cast(type); - rangeAttr.string = example; - nodeApi->setAttribute(textPicker, NODE_TEXT_PICKER_OPTION_RANGE, &rangeAttr); - nodeApi->addChild(column, textPicker); - } - //可带图标的textPicker处理逻辑 - if (static_cast(type) == ARKUI_TEXTPICKER_RANGETYPE_RANGE_CONTENT) { - char path[] = "resources/base/media/startIcon.png"; - //创建两个TextPickerRangeContent - auto array = OH_ArkUI_TextPickerRangeContentArray_Create(2); - //为下标为0的元素设置文字描述 - OH_ArkUI_TextPickerRangeContentArray_SetTextAtIndex(array, "first", 0); - //为下标为1的元素设置文字描述 - OH_ArkUI_TextPickerRangeContentArray_SetTextAtIndex(array, "second", 1); - //为下标为0的元素设置图标 - OH_ArkUI_TextPickerRangeContentArray_SetIconAtIndex(array, path, 0); - //为下标为1的元素设置图标 - OH_ArkUI_TextPickerRangeContentArray_SetIconAtIndex(array, path, 1); - ArkUI_NumberValue value[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem rangeAttr = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - value[0].i32 = static_cast(type); - rangeAttr.object = array; - nodeApi->setAttribute(textPicker, NODE_TEXT_PICKER_OPTION_RANGE, &rangeAttr); - OH_ArkUI_TextPickerRangeContentArray_Destroy(array); - nodeApi->addChild(column, textPicker); - } - //级联形式的textPicker处理逻辑 - if (static_cast(type) == ARKUI_TEXTPICKER_RANGETYPE_CASCADE_RANGE_CONTENT) { - //创建两个父节点并初始化 - auto twoParent = OH_ArkUI_TextCascadePickerRangeContentArray_Create(2); - OH_ArkUI_TextCascadePickerRangeContentArray_SetTextAtIndex(twoParent, "firstParent", 0); - OH_ArkUI_TextCascadePickerRangeContentArray_SetTextAtIndex(twoParent, "secondParent", 1); - //分别为两个父节点创建两个子节点并初始化 - auto firstTwoChild = OH_ArkUI_TextCascadePickerRangeContentArray_Create(2); - auto secondTwoChild = OH_ArkUI_TextCascadePickerRangeContentArray_Create(2); - OH_ArkUI_TextCascadePickerRangeContentArray_SetTextAtIndex(firstTwoChild, "first_Child1", 0); - OH_ArkUI_TextCascadePickerRangeContentArray_SetTextAtIndex(firstTwoChild, "first_Child2", 1); - OH_ArkUI_TextCascadePickerRangeContentArray_SetTextAtIndex(secondTwoChild, "second_Child1", 0); - OH_ArkUI_TextCascadePickerRangeContentArray_SetTextAtIndex(secondTwoChild, "second_Child2", 1); - //将子节点连接到父节点上 - OH_ArkUI_TextCascadePickerRangeContentArray_SetChildAtIndex(twoParent, firstTwoChild, 0); - OH_ArkUI_TextCascadePickerRangeContentArray_SetChildAtIndex(twoParent, secondTwoChild, 1); - ArkUI_NumberValue value[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem rangeAttr = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - value[0].i32 = static_cast(type); - rangeAttr.object = twoParent; - nodeApi->setAttribute(textPicker, NODE_TEXT_PICKER_OPTION_RANGE, &rangeAttr); - OH_ArkUI_TextCascadePickerRangeContentArray_Destroy(twoParent); - nodeApi->addChild(column, textPicker); - } -} - -void NodeManager::CreateTextPickerWithCustomContent(int32_t type) -{ - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - auto it = nodes_.find("textPicker_column"); - if (it != nodes_.end()) { - OH_ArkUI_NodeContent_RemoveNode(contentHandle_, nodes_["textPicker_column"]); - nodeApi->disposeNode(nodes_["textPicker_column"]); - nodes_.erase(it); - } - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - nodes_["text"] = text; - SetUpColumnAndText(nodeApi, column, text); - AddTextPicker(type, nodeApi, column); - nodes_["textPicker_column"] = column; - OH_ArkUI_NodeContent_AddNode(contentHandle_, column); -} - -void NodeManager::ClearNodes() -{ - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - //销毁nodes_中的组件 - for (auto node : nodes_) { - nodeApi->disposeNode(node.second); - } - //销毁g_styleOptions中的option元素 - for (auto option : g_styleOptions) { - OH_ArkUI_ProgressLinearStyleOption_Destroy(option.second); - } - //重新初始化g_nextId - g_nextId = 1; - //销毁g_ImageAnimator中的FrameInfo元素 - for (auto image : g_ImageAnimator) { - OH_ArkUI_ImageAnimatorFrameInfo_Dispose(image.second); - } - //重新初始化g_imageNextId - g_imageNextId = 1; - //清空nodes_; - nodes_.clear(); - //清空g_styleOptions; - g_styleOptions.clear(); - //清空g_ImageAnimator; - g_ImageAnimator.clear(); -} - -void NodeManager::CreateProgress() -{ - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = 300}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - - if (nodes_.find("progress") == nodes_.end()) { - //创建progress组件 - ArkUI_NodeHandle progress = nodeApi->createNode(ARKUI_NODE_PROGRESS); - nodes_["progress"] = progress; - } - ArkUI_NumberValue value[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem item = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - value[0].i32 = ARKUI_PROGRESS_TYPE_CAPSULE; - nodeApi->setAttribute(nodes_["progress"], NODE_PROGRESS_TYPE, &item); - nodeApi->addChild(column, nodes_["progress"]); - OH_ArkUI_NodeContent_AddNode(contentHandle_, column); -} - -void SetImageAnimatorAndColumn(ArkUI_NativeNodeAPI_1 *nodeApi, - ArkUI_NodeHandle column, ArkUI_NodeHandle imageAnimator) -{ - ArkUI_NumberValue colWidth[] = {{.f32 = 350}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = 400}}; - ArkUI_AttributeItem heightItem = {.value = textHeight, .size = 1}; - nodeApi->setAttribute(column, NODE_HEIGHT, &heightItem); - ArkUI_NumberValue borderWidth[] = {{.f32 = 1}}; - ArkUI_AttributeItem borderWidthItem = {.value = borderWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_BORDER_WIDTH, &borderWidthItem); - nodeApi->setAttribute(imageAnimator, NODE_BORDER_WIDTH, &borderWidthItem); - nodeApi->setAttribute(imageAnimator, NODE_WIDTH, &widthItem); - nodeApi->setAttribute(imageAnimator, NODE_HEIGHT, &heightItem); -} - -void SetImageAnimator(ArkUI_NativeNodeAPI_1 *nodeApi, ArkUI_NodeHandle column, ArkUI_NodeHandle imageAnimator) -{ - ArkUI_NumberValue fixedSize[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem item = {fixedSize, sizeof(fixedSize) / sizeof(ArkUI_NumberValue)}; - fixedSize[0].i32 = 0; - SetImageAnimatorAndColumn(nodeApi, column, imageAnimator); - nodeApi->setAttribute(imageAnimator, NODE_IMAGE_ANIMATOR_FIXED_SIZE, &item); - - ArkUI_NumberValue start[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem item1 = {start, sizeof(start) / sizeof(ArkUI_NumberValue)}; - start[0].i32 = ARKUI_ANIMATION_STATUS_RUNNING; - SetImageAnimatorAndColumn(nodeApi, column, imageAnimator); - nodeApi->setAttribute(imageAnimator, NODE_IMAGE_ANIMATOR_STATE, &item1); - - ArkUI_NumberValue loop_Playback[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem item2 = {loop_Playback, sizeof(loop_Playback) / sizeof(ArkUI_NumberValue)}; - loop_Playback[0].i32 = -1; - SetImageAnimatorAndColumn(nodeApi, column, imageAnimator); - nodeApi->setAttribute(imageAnimator, NODE_IMAGE_ANIMATOR_ITERATION, &item2); -} - -void SetFrameInfoSize(int32_t width, - int32_t height, int32_t top, int32_t left, ArkUI_ImageAnimatorFrameInfo* info) -{ - OH_ArkUI_ImageAnimatorFrameInfo_SetWidth(info, width); - OH_ArkUI_ImageAnimatorFrameInfo_SetHeight(info, height); - OH_ArkUI_ImageAnimatorFrameInfo_SetTop(info, top); - OH_ArkUI_ImageAnimatorFrameInfo_SetLeft(info, left); -} - -void NodeManager::CreateImageAnimatorFromString(int32_t width, - int32_t height, int32_t top, int32_t left, int32_t duration) -{ - for (auto image : g_ImageAnimator) { - OH_ArkUI_ImageAnimatorFrameInfo_Dispose(image.second); - } - g_imageNextId = 1; - g_ImageAnimator.clear(); - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - auto it = nodes_.find("imageAnimator_column"); - if (it != nodes_.end()) { - OH_ArkUI_NodeContent_RemoveNode(contentHandle_, nodes_["imageAnimator_column"]); - nodeApi->disposeNode(nodes_["imageAnimator_column"]); - nodes_.erase(it); - } - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - nodes_["imageAnimator_column"] = column; - ArkUI_NodeHandle imageAnimator = nodeApi->createNode(ARKUI_NODE_IMAGE_ANIMATOR); - auto node = OH_ArkUI_ImageAnimatorFrameInfo_CreateFromString("resources/base/media/test.gif"); - auto node1 = OH_ArkUI_ImageAnimatorFrameInfo_CreateFromString("resources/base/media/test1.gif"); - if (node != nullptr) { - int id = g_imageNextId++; - g_ImageAnimator[id] = node; - } - ArkUI_AttributeItem frameInfo = {0}; - SetFrameInfoSize(width, height, top, left, node); - OH_ArkUI_ImageAnimatorFrameInfo_SetDuration(node, duration); - SetFrameInfoSize(width, height, top, left, node1); - OH_ArkUI_ImageAnimatorFrameInfo_SetDuration(node1, duration); - ArkUI_ImageAnimatorFrameInfo* array[] = { node, node1}; - frameInfo.size = NUM_2; - frameInfo.object = array; - nodeApi->setAttribute(imageAnimator, NODE_IMAGE_ANIMATOR_IMAGES, &frameInfo); - SetImageAnimator(nodeApi, column, imageAnimator); - OH_ArkUI_ImageAnimatorFrameInfo_Dispose(node1); - nodeApi->addChild(column, imageAnimator); - OH_ArkUI_NodeContent_AddNode(contentHandle_, column); -} - -ArkUI_DrawableDescriptor* NodeManager::CreateDescriptor(bool isBlack) -{ - OH_PixelmapNativeHandle pixelMap = nullptr; - ArkUI_DrawableDescriptor* descriptor = nullptr; - - uint8_t data[NUM_96]; - if (!isBlack) { - for (auto i = 0; i < NUM_96; i = i + NUM_4) { - data[i] = uint8_t(NUM_0); - data[i + NUM_1] = uint8_t(NUM_255); - data[i + NUM_2] = uint8_t(NUM_255); - data[i + NUM_3] = uint8_t(NUM_255); - } - } else { - for (auto i = 0; i < NUM_96; i = i + NUM_4) { - data[i] = uint8_t(NUM_0); - data[i + NUM_1] = uint8_t(NUM_0); - data[i + NUM_2] = uint8_t(NUM_0); - data[i + NUM_3] = uint8_t(NUM_255); - } - } - - uint8_t data1[NUM_96]; - for (auto j = 0; j < NUM_96; j++) { - data1[j] = uint8_t(j); - } - OH_Pixelmap_InitializationOptions* options = nullptr; - OH_PixelmapInitializationOptions_Create(&options); - OH_PixelmapInitializationOptions_SetWidth(options, NUM_4); - OH_PixelmapInitializationOptions_SetHeight(options, NUM_6); - OH_PixelmapInitializationOptions_SetPixelFormat(options, NUM_4); - OH_PixelmapInitializationOptions_SetAlphaType(options, NUM_0); - OH_PixelmapNative_CreatePixelmap(data, NUM_96, options, &pixelMap); - descriptor = OH_ArkUI_DrawableDescriptor_CreateFromPixelMap(pixelMap); - return descriptor; -} - -void NodeManager::CreateImageAnimatorFromDrawableDescriptor(int32_t width, - int32_t height, int32_t top, int32_t left, int32_t duration) -{ - for (auto image : g_ImageAnimator) { - OH_ArkUI_ImageAnimatorFrameInfo_Dispose(image.second); - } - g_imageNextId = 1; - g_ImageAnimator.clear(); - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - auto it = nodes_.find("imageAnimator_column"); - if (it != nodes_.end()) { - OH_ArkUI_NodeContent_RemoveNode(contentHandle_, nodes_["imageAnimator_column"]); - nodeApi->disposeNode(nodes_["imageAnimator_column"]); - nodes_.erase(it); - } - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - nodes_["imageAnimator_column"] = column; - auto descriptorBlack = CreateDescriptor(true); - auto descriptorYellow = CreateDescriptor(false); - auto nodeBlack = OH_ArkUI_ImageAnimatorFrameInfo_CreateFromDrawableDescriptor(descriptorBlack); - auto nodeYellow = OH_ArkUI_ImageAnimatorFrameInfo_CreateFromDrawableDescriptor(descriptorYellow); - if (nodeBlack != nullptr) { - int id = g_imageNextId++; - g_ImageAnimator[id] = nodeBlack; - } - ArkUI_AttributeItem frameInfo = {0}; - SetFrameInfoSize(width, height, top, left, nodeBlack); - OH_ArkUI_ImageAnimatorFrameInfo_SetDuration(nodeBlack, duration); - SetFrameInfoSize(width, height, top, left, nodeYellow); - OH_ArkUI_ImageAnimatorFrameInfo_SetDuration(nodeYellow, duration); - ArkUI_ImageAnimatorFrameInfo* array[] = { nodeBlack, nodeYellow }; - frameInfo.size = NUM_2; - frameInfo.object = array; - ArkUI_NodeHandle imageAnimator = nodeApi->createNode(ARKUI_NODE_IMAGE_ANIMATOR); - nodeApi->setAttribute(imageAnimator, NODE_IMAGE_ANIMATOR_IMAGES, &frameInfo); - SetImageAnimator(nodeApi, column, imageAnimator); - OH_ArkUI_ImageAnimatorFrameInfo_Dispose(nodeYellow); - nodeApi->addChild(column, imageAnimator); - OH_ArkUI_NodeContent_AddNode(contentHandle_, column); -} -// namespace NativeNode::Manager diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/NodeManager.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/NodeManager.h deleted file mode 100644 index dad874ee959ebfd9103d48680c52358f32c02c60..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/NodeManager.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef CAPI_MANAGER_H -#define CAPI_MANAGER_H - -#include -#include -#include -#include -#include - - -using EventCallback = std::function; - -class NodeManager { -public: - ~NodeManager() = default; - static NodeManager& GetInstance(); - void SetContentHandle(ArkUI_NodeContentHandle contentHandle); - void CreateProgress(); - void CreateTextPickerWithCustomContent(int32_t type); - void SetProgressType(int32_t type); - void SetProgressValue(float value); - void SetProgressLinearStyleOption(bool scanEffect, bool smoothEffect, int32_t strokeWidth, int32_t strokeRadius); - std::string GetProgressLinearStyleOptionAndDestroy(); - std::string GetImageAnimatorFrameInfo(); - void CreateDatePicker(int32_t modeType); - void CreateCalendarPicker(int32_t modeType); - void CreateImageSize(int32_t objectFit, int32_t imageSize); - void SetImageProperties(int32_t imageRepeat, int32_t imageInterpolation, int32_t imageRenderMode); - void SetUpColumnAndText(ArkUI_NativeNodeAPI_1 *nodeApi, ArkUI_NodeHandle &column, ArkUI_NodeHandle &text); - void AddTextPicker(int32_t type, ArkUI_NativeNodeAPI_1 *nodeApi, ArkUI_NodeHandle &column); - void SetUpTextCrossLanguage(bool isCross); - void CreateImageAnimatorFromString(int32_t width, int32_t height, int32_t top, int32_t left, int32_t duration); - ArkUI_DrawableDescriptor* CreateDescriptor(bool isBlack); - void CreateImageAnimatorFromDrawableDescriptor(int32_t width, - int32_t height, int32_t top, int32_t left, int32_t duration); - void ClearNodes(); -private: - NodeManager() = default; - ArkUI_NodeContentHandle contentHandle_; - //nodes_ 用来存储的是需要用到的node组件 - std::unordered_map nodes_; - std::unordered_map callbackMap_; -}; - - -#endif //CAPI_MANAGER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/PublicEvent.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/PublicEvent.cpp deleted file mode 100644 index 8ecdce35eadb66911046069ffc7f9de7b6f708cd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/PublicEvent.cpp +++ /dev/null @@ -1,826 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "manager.h" -#include "PublicEvent.h" - -const int32_t TARGET_ID_2 = 2; -const int32_t TARGET_ID_3 = 3; -const int32_t TARGET_ID_4 = 4; -const int32_t TARGET_ID_5 = 5; -const int32_t TARGET_ID_6 = 6; - -static bool g_isEnable = true; -OH_PixelmapNative *pixelMap = nullptr; -static int g_num = 0; -static int g_num1 = 0; -static ArkUI_NodeHandle image; -static ArkUI_AttributeItem NODE_IMAGE_SRC_Item; -static auto options_test = OH_ArkUI_CreateSnapshotOptions(); -static ArkUI_NodeHandle image2; -static int g_a[] = {1, 1, -1, 4, 10, 100}; -char *g_b[] = {"src/main/resources/base/media/background.png", - "src/main/resources/base/media/foreground.png", - "src/main/resources/base/media/startIcon.png"}; -static int g_arrayLength = sizeof(g_a) / sizeof(g_a[0]); -static int g_arrayLength1 = sizeof(g_b) / sizeof(g_b[0]); - -void SetScrollAttribute(ArkUI_NodeHandle &scroll) -{ - if (!Manager::nodeAPI_) { - return; - } - ArkUI_NumberValue scrollWidthValue[] = {500}; - ArkUI_AttributeItem scrollWidthItem = {scrollWidthValue, 1}; - Manager::nodeAPI_->setAttribute(scroll, NODE_WIDTH, &scrollWidthItem); - ArkUI_NumberValue scrollHeightValue[] = {750}; - ArkUI_AttributeItem scrollHeightItem = {scrollHeightValue, 1}; - Manager::nodeAPI_->setAttribute(scroll, NODE_HEIGHT, &scrollHeightItem); - ArkUI_AttributeItem scrollNodeIdItem = {.string = "testScroll"}; - Manager::nodeAPI_->setAttribute(scroll, NODE_ID, &scrollNodeIdItem); -} - -// 打印HitTestMode相关信息 -void PrintHitTestModeInfo(int32_t hitTestMode) -{ - switch (hitTestMode) { - case ARKUI_HIT_TEST_MODE_DEFAULT: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", - "Mode: DEFAULT - Default hit test behavior"); - break; - case ARKUI_HIT_TEST_MODE_TRANSPARENT: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", "Mode: TRANSPARENT - Events pass through"); - break; - case ARKUI_HIT_TEST_MODE_BLOCK: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", "Mode: BLOCK - Block hit test behavior"); - break; - case ARKUI_HIT_TEST_MODE_NONE: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", "Mode: NONE - No hit test"); - break; - case ARKUI_HIT_TEST_MODE_BLOCK_HIERARCHY: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", - "Mode: BLOCK_HIERARCHY - Block hierarchy hit test behavior"); - break; - case ARKUI_HIT_TEST_MODE_BLOCK_DESCENDANTS: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", - "Mode: BLOCK_DESCENDANTS - Block descendants hit test behavior"); - break; - default: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", "Mode: Unknown (%{public}d)", hitTestMode); - break; - } -} - -// 创建使用HitTestMode的组件 -ArkUI_NodeHandle CreateComponentWithHitTestMode(int32_t hitTestMode) -{ - ArkUI_NodeHandle textNode1 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_AttributeItem contentItem; - switch (hitTestMode) { - case ARKUI_HIT_TEST_MODE_DEFAULT: - contentItem = {.string = "ARKUI_HIT_TEST_MODE_DEFAULT"}; - break; - case ARKUI_HIT_TEST_MODE_TRANSPARENT: - contentItem = {.string = "ARKUI_HIT_TEST_MODE_TRANSPARENT"}; - break; - case ARKUI_HIT_TEST_MODE_BLOCK: - contentItem = {.string = "ARKUI_HIT_TEST_MODE_BLOCK"}; - break; - case ARKUI_HIT_TEST_MODE_NONE: - contentItem = {.string = "ARKUI_HIT_TEST_MODE_NONE"}; - break; - case ARKUI_HIT_TEST_MODE_BLOCK_HIERARCHY: - contentItem = {.string = "ARKUI_HIT_TEST_MODE_BLOCK_HIERARCHY"}; - break; - case ARKUI_HIT_TEST_MODE_BLOCK_DESCENDANTS: - contentItem = {.string = "ARKUI_HIT_TEST_MODE_BLOCK_DESCENDANTS"}; - break; - default: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", "Mode: Unknown (%{public}d)", hitTestMode); - break; - } - Manager::nodeAPI_->setAttribute(textNode1, NODE_TEXT_CONTENT, &contentItem); - ArkUI_NumberValue widthValue[] = {300}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - Manager::nodeAPI_->setAttribute(textNode1, NODE_WIDTH, &widthItem); - ArkUI_NumberValue heightValue[] = {100}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - Manager::nodeAPI_->setAttribute(textNode1, NODE_HEIGHT, &heightItem); - ArkUI_NumberValue bgColorValue[] = {{.u32 = 0xFFFFC107}}; - ArkUI_AttributeItem bgColorItem = {bgColorValue, 1}; - Manager::nodeAPI_->setAttribute(textNode1, NODE_BACKGROUND_COLOR, &bgColorItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", "Setting HitTestMode to: %{public}d", hitTestMode); - PrintHitTestModeInfo(hitTestMode); - ArkUI_NumberValue hitTestValue[] = {{.i32 = hitTestMode}}; - ArkUI_AttributeItem hitTestItem = {hitTestValue, 1}; - int32_t result = Manager::nodeAPI_->setAttribute(textNode1, NODE_HIT_TEST_BEHAVIOR, &hitTestItem); - if (result != 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "HitTestMode", - "Failed to set HitTestMode, error code: %{public}d", result); - } else { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "HitTestMode", "Successfully set HitTestMode"); - } - return textNode1; -} - -// 创建重叠组件以演示HitTestMode效果 -ArkUI_NodeHandle CreateHitTestModeDemo() -{ - ArkUI_NodeHandle container = Manager::nodeAPI_->createNode(ARKUI_NODE_STACK); - // 设置容器尺寸 - ArkUI_NumberValue containerWidthValue[] = {400}; - ArkUI_AttributeItem containerWidthItem = {containerWidthValue, 1}; - Manager::nodeAPI_->setAttribute(container, NODE_WIDTH, &containerWidthItem); - ArkUI_NumberValue containerHeightValue[] = {500}; - ArkUI_AttributeItem containerHeightItem = {containerHeightValue, 1}; - Manager::nodeAPI_->setAttribute(container, NODE_HEIGHT, &containerHeightItem); - // 创建背景组件 - DEFAULT模式 - ArkUI_NodeHandle backgroundComponent = CreateComponentWithHitTestMode(ARKUI_HIT_TEST_MODE_DEFAULT); - ArkUI_AttributeItem bgContentItem = {.string = "Background: DEFAULT Mode"}; - Manager::nodeAPI_->setAttribute(backgroundComponent, NODE_TEXT_CONTENT, &bgContentItem); - ArkUI_NumberValue bgBgColorValue[] = {{.u32 = 0xFF2196F3}}; - ArkUI_AttributeItem bgBgColorItem = {bgBgColorValue, 1}; - Manager::nodeAPI_->setAttribute(backgroundComponent, NODE_BACKGROUND_COLOR, &bgBgColorItem); - Manager::nodeAPI_->addChild(container, backgroundComponent); - // 创建中间组件 - TRANSPARENT模式 - ArkUI_NodeHandle transparentComponent = CreateComponentWithHitTestMode(ARKUI_HIT_TEST_MODE_TRANSPARENT); - ArkUI_AttributeItem transContentItem = {.string = "Middle: TRANSPARENT Mode"}; - Manager::nodeAPI_->setAttribute(transparentComponent, NODE_TEXT_CONTENT, &transContentItem); - ArkUI_NumberValue transBgColorValue[] = {{.u32 = 0xFF4CAF50}}; - ArkUI_AttributeItem transBgColorItem = {transBgColorValue, 1}; - Manager::nodeAPI_->setAttribute(transparentComponent, NODE_BACKGROUND_COLOR, &transBgColorItem); - // 调整位置使其与背景组件重叠 - ArkUI_NumberValue transPositionValue[] = {{.f32 = 50.0f}, {.f32 = 50.0f}}; - ArkUI_AttributeItem transPositionItem = {transPositionValue, 2}; - Manager::nodeAPI_->setAttribute(transparentComponent, NODE_POSITION, &transPositionItem); - Manager::nodeAPI_->addChild(container, transparentComponent); - // 创建前景组件 - DEFAULT模式 - ArkUI_NodeHandle foregroundComponent = CreateComponentWithHitTestMode(ARKUI_HIT_TEST_MODE_DEFAULT); - ArkUI_AttributeItem fgContentItem = {.string = "Foreground: DEFAULT Mode"}; - Manager::nodeAPI_->setAttribute(foregroundComponent, NODE_TEXT_CONTENT, &fgContentItem); - ArkUI_NumberValue fgBgColorValue[] = {{.u32 = 0xFFF44336}}; - ArkUI_AttributeItem fgBgColorItem = {fgBgColorValue, 1}; - Manager::nodeAPI_->setAttribute(foregroundComponent, NODE_BACKGROUND_COLOR, &fgBgColorItem); - // 调整位置使其与其它组件重叠 - ArkUI_NumberValue fgPositionValue[] = {{.f32 = 100.0f}, {.f32 = 100.0f}}; - ArkUI_AttributeItem fgPositionItem = {fgPositionValue, 2}; - Manager::nodeAPI_->setAttribute(foregroundComponent, NODE_POSITION, &fgPositionItem); - Manager::nodeAPI_->addChild(container, foregroundComponent); - return container; -} - -void PrintVisibilityInfo(int32_t visibility) -{ - switch (visibility) { - case ARKUI_VISIBILITY_VISIBLE: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Visibility", - "Visibility: VISIBLE - Component is visible"); - break; - case ARKUI_VISIBILITY_HIDDEN: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Visibility", - "Visibility: HIDDEN - Component is hidden but occupies space"); - break; - case ARKUI_VISIBILITY_NONE: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Visibility", - "Visibility: NONE - Component is invisible and doesn't occupy space"); - break; - default: - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Visibility", - "Visibility: Unknown (%{public}d)", visibility); - break; - } -} - -// 创建带有Visibility属性的组件 -ArkUI_NodeHandle CreateComponentWithVisibility(const char *name, int32_t visibility, uint32_t bgColor) -{ - ArkUI_NodeHandle textNode = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - std::stringstream statusStr; - statusStr << name << ":" ; - switch (visibility) { - case ARKUI_VISIBILITY_VISIBLE: - statusStr << "VISIBLE"; - break; - case ARKUI_VISIBILITY_HIDDEN: - statusStr << "HIDDEN"; - break; - case ARKUI_VISIBILITY_NONE: - statusStr << "NONE"; - break; - default: - statusStr << "Unknown"; - break; - } - std::string textContent = statusStr.str(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Visibility", - "Setting text content to: %{public}s", textContent.c_str()); - ArkUI_AttributeItem contentItem = {.string = textContent.c_str()}; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_CONTENT, &contentItem); - ArkUI_NumberValue widthValue[] = {250}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_WIDTH, &widthItem); - ArkUI_NumberValue heightValue[] = {80}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_HEIGHT, &heightItem); - ArkUI_NumberValue marginValue[] = {20}; - ArkUI_AttributeItem marginItem = {marginValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_MARGIN, &marginItem); - ArkUI_NumberValue bgColorValue[] = {{.u32 = bgColor}}; - ArkUI_AttributeItem bgColorItem = {bgColorValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_BACKGROUND_COLOR, &bgColorItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Visibility", - "Setting Visibility for '%{public}s' to: %{public}d", name, visibility); - PrintVisibilityInfo(visibility); - ArkUI_NumberValue visibilityValue[] = {{.i32 = visibility}}; - ArkUI_AttributeItem visibilityItem = {visibilityValue, 1}; - int32_t result = Manager::nodeAPI_->setAttribute(textNode, NODE_VISIBILITY, &visibilityItem); - if (result != 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Visibility", - "Failed to set Visibility for '%{public}s', error code: %{public}d", name, result); - } else { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Visibility", "Successfully set Visibility for '%{public}s'", - name); - } - return textNode; -} - -// 创建Visibility演示场景 -ArkUI_NodeHandle CreateVisibilityDemo() -{ - auto container = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue containerWidthValue[] = {400}; - ArkUI_AttributeItem containerWidthItem = {containerWidthValue, 1}; - Manager::nodeAPI_->setAttribute(container, NODE_WIDTH, &containerWidthItem); - ArkUI_NumberValue containerHeightValue[] = {600}; - ArkUI_AttributeItem containerHeightItem = {containerHeightValue, 1}; - Manager::nodeAPI_->setAttribute(container, NODE_HEIGHT, &containerHeightItem); - ArkUI_NodeHandle title = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_AttributeItem titleContentItem = {.string = "ArkUI Visibility Demo"}; - Manager::nodeAPI_->setAttribute(title, NODE_TEXT_CONTENT, &titleContentItem); - ArkUI_NumberValue titleWidthValue[] = {400}; - ArkUI_AttributeItem titleWidthItem = {titleWidthValue, 1}; - Manager::nodeAPI_->setAttribute(title, NODE_WIDTH, &titleWidthItem); - ArkUI_NumberValue titleHeightValue[] = {60}; - ArkUI_AttributeItem titleHeightItem = {titleHeightValue, 1}; - Manager::nodeAPI_->setAttribute(title, NODE_HEIGHT, &titleHeightItem); - ArkUI_NumberValue titleBgColorValue[] = {{.u32 = 0xFF9C27B0}}; - ArkUI_AttributeItem titleBgColorItem = {titleBgColorValue, 1}; - Manager::nodeAPI_->setAttribute(title, NODE_BACKGROUND_COLOR, &titleBgColorItem); - Manager::nodeAPI_->addChild(container, title); - ArkUI_NodeHandle instruction = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_AttributeItem instructionContentItem = {.string = "Different Visibility modes demonstration:"}; - Manager::nodeAPI_->setAttribute(instruction, NODE_TEXT_CONTENT, &instructionContentItem); - ArkUI_NumberValue instructionWidthValue[] = {400}; - ArkUI_AttributeItem instructionWidthItem = {instructionWidthValue, 1}; - Manager::nodeAPI_->setAttribute(instruction, NODE_WIDTH, &instructionWidthItem); - ArkUI_NumberValue instructionHeightValue[] = {40}; - ArkUI_AttributeItem instructionHeightItem = {instructionHeightValue, 1}; - Manager::nodeAPI_->setAttribute(instruction, NODE_HEIGHT, &instructionHeightItem); - Manager::nodeAPI_->addChild(container, instruction); - ArkUI_NodeHandle hiddenComponent = - CreateComponentWithVisibility("Hidden Component", ARKUI_VISIBILITY_HIDDEN, 0xFFFF9800); - if (hiddenComponent) { - Manager::nodeAPI_->addChild(container, hiddenComponent); - } - ArkUI_NodeHandle visibleComponent = - CreateComponentWithVisibility("Visible Component", ARKUI_VISIBILITY_VISIBLE, 0xFF4CAF50); - if (visibleComponent) { - Manager::nodeAPI_->addChild(container, visibleComponent); - } - ArkUI_NodeHandle noneComponent = CreateComponentWithVisibility("None Component", ARKUI_VISIBILITY_NONE, 0xFFF44336); - if (noneComponent) { - Manager::nodeAPI_->addChild(container, noneComponent); - } - return container; -} - -// @Styles normalStyles(): void -void ApplyNormalStyles(ArkUI_NodeHandle node) -{ - if (!node) { - return; - } - // .backgroundColor("#0A59F7") - ArkUI_NumberValue bgColorValue[] = {{.u32 = 0xFF0A59F7}}; - ArkUI_AttributeItem bgColorItem = {bgColorValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BACKGROUND_COLOR, &bgColorItem); - - // .borderRadius(10) - ArkUI_NumberValue borderRadiusValue[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem borderRadiusItem = {borderRadiusValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BORDER_RADIUS, &borderRadiusItem); - - // .borderStyle(BorderStyle.Solid) - ArkUI_NumberValue borderStyleValue[] = {{.i32 = ARKUI_BORDER_STYLE_SOLID}}; - ArkUI_AttributeItem borderStyleItem = {borderStyleValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BORDER_STYLE, &borderStyleItem); - - // .borderWidth(2) - ArkUI_NumberValue borderWidthValue[] = {{.f32 = 2.0f}}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BORDER_WIDTH, &borderWidthItem); - - // .borderColor("#33000000") - ArkUI_NumberValue borderColorValue[] = {{.u32 = 0x33000000}}; - ArkUI_AttributeItem borderColorItem = {borderColorValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BORDER_COLOR, &borderColorItem); - - // .width(100) - ArkUI_NumberValue widthValue[] = {{.f32 = 300.0f}}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_WIDTH, &widthItem); - - // .height(25) - ArkUI_NumberValue heightValue[] = {{.f32 = 100.0f}}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_HEIGHT, &heightItem); - - // .opacity(1) - ArkUI_NumberValue opacityValue[] = {{.f32 = 1.0f}}; - ArkUI_AttributeItem opacityItem = {opacityValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_OPACITY, &opacityItem); -} - -// 创建Text("normal")组件并应用normalStyles -ArkUI_NodeHandle CreateNormalTextComponent() -{ - // 创建文本组件 - static ArkUI_NodeHandle textNode = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - if (!textNode) { - return nullptr; - } - - // .fontSize(14) - ArkUI_NumberValue fontSizeValue[] = {{.f32 = 14.0f}}; - ArkUI_AttributeItem fontSizeItem = {fontSizeValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_FONT_SIZE, &fontSizeItem); - - // .fontColor(Color.White) - ArkUI_NumberValue fontColorValue[] = {{.u32 = 0xFFFFFFFF}}; - ArkUI_AttributeItem fontColorItem = {fontColorValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_FONT_COLOR, &fontColorItem); - - // .opacity(0.5) - ArkUI_NumberValue opacityValue[] = {{.f32 = 0.5f}}; - ArkUI_AttributeItem opacityItem = {opacityValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_OPACITY, &opacityItem); - - // .stateStyles({ normal: this.normalStyles }) - ApplyNormalStyles(textNode); - - // .margin({ bottom: 20 }) - ArkUI_NumberValue marginBottomValue[] = {{.f32 = 20.0f}}; - ArkUI_AttributeItem marginBottomItem = {marginBottomValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_MARGIN, &marginBottomItem); - - // .textAlign(TextAlign.Center) - ArkUI_NumberValue textAlignValue[] = {{.i32 = ARKUI_TEXT_ALIGNMENT_CENTER}}; - ArkUI_AttributeItem textAlignItem = {textAlignValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_ALIGN, &textAlignItem); - - // 设置文本内容 - ArkUI_AttributeItem contentItem = {.string = "normal"}; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_CONTENT, &contentItem); - - return textNode; -} - -// 创建Text(this.isEnable == true ? "effective" : "disabled")组件并应用disabledStyles -ArkUI_NodeHandle CreateEnableDisableTextComponent() -{ - // 创建文本组件 - static ArkUI_NodeHandle textNode = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue bgColorValue[] = {{.u32 = 0xFF0A59F7}}; - ArkUI_AttributeItem bgColorItem = {bgColorValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_BACKGROUND_COLOR, &bgColorItem); - ArkUI_NumberValue borderRadiusValue[] = {{.f32 = 20.0f}}; - ArkUI_AttributeItem borderRadiusItem = {borderRadiusValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_BORDER_RADIUS, &borderRadiusItem); - ArkUI_NumberValue borderStyleValue[] = {{.i32 = ARKUI_BORDER_STYLE_SOLID}}; - ArkUI_AttributeItem borderStyleItem = {borderStyleValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_BORDER_STYLE, &borderStyleItem); - ArkUI_NumberValue borderWidthValue[] = {{.f32 = 2.0f}}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_BORDER_WIDTH, &borderWidthItem); - ArkUI_NumberValue borderColorValue[] = {{.u32 = 0xFF808080}}; - ArkUI_AttributeItem borderColorItem = {borderColorValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_BORDER_COLOR, &borderColorItem); - ArkUI_NumberValue widthValue[] = {{.f32 = 300.0f}}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_WIDTH, &widthItem); - ArkUI_NumberValue heightValue[] = {{.f32 = 100.0f}}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_HEIGHT, &heightItem); - ArkUI_NumberValue opacityValue[] = {{.f32 = 1.0f}}; - ArkUI_AttributeItem opacityItem = {opacityValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_OPACITY, &opacityItem); - ArkUI_NumberValue fontSizeValue[] = {{.f32 = 14.0f}}; - ArkUI_AttributeItem fontSizeItem = {fontSizeValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_FONT_SIZE, &fontSizeItem); - ArkUI_NumberValue fontColorValue[] = {{.u32 = 0xFFFFFFFF}}; - ArkUI_AttributeItem fontColorItem = {fontColorValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_FONT_COLOR, &fontColorItem); - ArkUI_NumberValue enabledValue[] = {{.i32 = g_isEnable ? 1 : 0}}; - ArkUI_AttributeItem enabledItem = {enabledValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_ENABLED, &enabledItem); - ArkUI_NumberValue textAlignValue[] = {{.i32 = ARKUI_TEXT_ALIGNMENT_CENTER}}; - ArkUI_AttributeItem textAlignItem = {textAlignValue, 1}; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_ALIGN, &textAlignItem); - const char *textContent = g_isEnable ? "effective" : "disabled"; - ArkUI_AttributeItem contentItem = {.string = textContent}; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_CONTENT, &contentItem); - return textNode; -} - -void ApplyDisabledStyles(ArkUI_NodeHandle node) -{ - // .backgroundColor("#E5E5E5") - ArkUI_NumberValue bgColorValue[] = {{.u32 = 0xFFE5E5E5}}; - ArkUI_AttributeItem bgColorItem = {bgColorValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BACKGROUND_COLOR, &bgColorItem); - - // .borderRadius(10) - ArkUI_NumberValue borderRadiusValue[] = {{.f32 = 10.0f}}; - ArkUI_AttributeItem borderRadiusItem = {borderRadiusValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BORDER_RADIUS, &borderRadiusItem); - - // .borderStyle(BorderStyle.Solid) - ArkUI_NumberValue borderStyleValue[] = {{.i32 = ARKUI_BORDER_STYLE_SOLID}}; - ArkUI_AttributeItem borderStyleItem = {borderStyleValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BORDER_STYLE, &borderStyleItem); - - // .borderWidth(2) - ArkUI_NumberValue borderWidthValue[] = {{.f32 = 2.0f}}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BORDER_WIDTH, &borderWidthItem); - - // .borderColor("#2a4c1919") - ArkUI_NumberValue borderColorValue[] = {{.u32 = 0xFF2a4c19}}; - ArkUI_AttributeItem borderColorItem = {borderColorValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_BORDER_COLOR, &borderColorItem); - - // .width(90) - ArkUI_NumberValue widthValue[] = {{.f32 = 300.0f}}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_WIDTH, &widthItem); - - // .height(25) - ArkUI_NumberValue heightValue[] = {{.f32 = 100.0f}}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_HEIGHT, &heightItem); - - // .opacity(1) - ArkUI_NumberValue opacityValue[] = {{.f32 = 1.0f}}; - ArkUI_AttributeItem opacityItem = {opacityValue, 1}; - Manager::nodeAPI_->setAttribute(node, NODE_OPACITY, &opacityItem); -} - -// UI状态变化处理函数 -void StatesChangeHandler(int32_t currentStates, void *userData) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "UIStates", "UI state changed to: %{public}d", currentStates); - // 根据当前状态调整UI样式 - if (currentStates == ArkUI_UIState::UI_STATE_NORMAL) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "UIStates", "Button is in NORMAL state"); - } else { - if (currentStates & ArkUI_UIState::UI_STATE_PRESSED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo UIStates", "Button is PRESSED"); - } - if (currentStates & ArkUI_UIState::UI_STATE_FOCUSED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo UIStates", "Button is FOCUSED"); - } - if (currentStates & ArkUI_UIState::UI_STATE_DISABLED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo UIStates", "Button is DISABLED"); - } - if (currentStates & ArkUI_UIState::UI_STATE_SELECTED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "publicInfo UIStates", "Button is SELECTED"); - } - } -} - -void TargetIdTwo() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", "C-api test demo create gs button1"); - auto options = OH_ArkUI_CreateSnapshotOptions(); - auto scale = 0.5; - OH_ArkUI_SnapshotOptions_SetScale(options, scale); - auto createPixelMapRet = OH_ArkUI_GetNodeSnapshot(image, options, &pixelMap); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo create pixelmap result is %{public}d", createPixelMapRet); - uint32_t byteCnt = 0; - OH_PixelmapNative_GetByteCount(pixelMap, &byteCnt); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", "C-api test demo byteCnt is %{public}u", - byteCnt); - if (!pixelMap) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", "C-api test demo pixelMap is nullptr"); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo pixelMap is not nullptr"); - } - auto drawable = OH_ArkUI_DrawableDescriptor_CreateFromPixelMap(pixelMap); - if (!drawable) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", "C-api test demo drawable is nullptr"); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo drawable is not nullptr"); - } - ArkUI_AttributeItem NODE_IMAGE2_SRC_Item = {.object = drawable}; - auto rel = Manager::nodeAPI_->setAttribute(image2, NODE_IMAGE_SRC, &NODE_IMAGE2_SRC_Item); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo pixelMap setAttribute result is %{public}d", rel); - OH_PixelmapNative_Release(pixelMap); -} - -void TargetIdThree() -{ - // 动态切换scale - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", "C-api test demo create gs button2"); - g_num++; - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo g_num is %{public}d g_a[g_num] is %{public}d", g_num, g_a[g_num]); - auto options = OH_ArkUI_CreateSnapshotOptions(); - auto result = OH_ArkUI_SnapshotOptions_SetScale(options, g_a[g_num]); - if (result != ARKUI_ERROR_CODE_COMPONENT_SNAPSHOT_TIMEOUT && result != ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH) { - auto createPixelMapRet = OH_ArkUI_GetNodeSnapshot(image, options, &pixelMap); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo create pixelmap result is %{public}d", createPixelMapRet); - uint32_t byteCnt = 0; - OH_PixelmapNative_GetByteCount(pixelMap, &byteCnt); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", "C-api test demo byteCnt is %{public}u", - byteCnt); - - if (!pixelMap) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo pixelMap is nullptr"); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo pixelMap is not nullptr"); - } - auto drawable = OH_ArkUI_DrawableDescriptor_CreateFromPixelMap(pixelMap); - if (!drawable) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo drawable is nullptr"); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo drawable is not nullptr"); - } - ArkUI_AttributeItem NODE_IMAGE2_SRC_Item = {.object = drawable}; - auto rel = Manager::nodeAPI_->setAttribute(image2, NODE_IMAGE_SRC, &NODE_IMAGE2_SRC_Item); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo pixelMap setAttribute result is %{public}d", rel); - - OH_PixelmapNative_Release(pixelMap); - if (g_num >= g_arrayLength - 1) { - g_num = 0; - } - } -} - -void TargetIdFour() -{ - // 动态切换图片类型 - g_num1++; - NODE_IMAGE_SRC_Item = {.string = g_b[g_num1]}; - Manager::nodeAPI_->setAttribute(image, NODE_IMAGE_SRC, &NODE_IMAGE_SRC_Item); - if (g_num1 >= g_arrayLength1 - 1) { - g_num1 = 0; - } -} - -void TargetIdFive() -{ - if (!options_test) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo options_test is nullptr"); - } else { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ComponentSnapshot", - "C-api test demo options_test is not nullptr"); - } - OH_ArkUI_DestroySnapshotOptions(options_test); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentSnapshot", "C-api test Snapshot is destroied"); -} - -void EnableDisableText(ArkUI_NodeEventType eventType, int32_t targetId, ArkUI_NodeHandle node) -{ - auto gestureEvent = OH_ArkUI_GestureEvent_GetRawInputEvent(nullptr); - auto resultCloned = OH_ArkUI_PointerEvent_PostClonedEvent(node, gestureEvent); - if (resultCloned != ARKUI_ERROR_CODE_NOT_CLONED_POINTER_EVENT && - resultCloned != ARKUI_ERROR_CODE_POST_CLONED_COMPONENT_STATUS_ABNORMAL && - resultCloned != ARKUI_ERROR_CODE_POST_CLONED_NO_COMPONENT_HIT_TO_RESPOND_TO_THE_EVENT) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "ComponentCloned", - "C-api test demo clone event result is %{public}d", resultCloned); - } - bool ret = false; - auto gestureEventResult = OH_ArkUI_GestureEventTargetInfo_IsScrollBegin(nullptr, &ret); - if (gestureEventResult != ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GestureEvent", - "C-api test demo gesture event result is %{public}d", gestureEventResult); - } - bool isRepeat = true; - auto gestureParamResult = OH_ArkUI_GetGestureParam_repeat(nullptr, &isRepeat); - if (gestureParamResult != ARKUI_ERROR_CODE_RECOGNIZER_TYPE_NOT_SUPPORTED) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GestureParam", - "C-api test demo gesture param result is %{public}d", gestureParamResult); - } - auto requestDragResult = OH_ArkUI_DragEvent_RequestDragEndPending(nullptr, nullptr); - if (requestDragResult != ARKUI_ERROR_CODE_DRAG_DROP_OPERATION_NOT_ALLOWED) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "RequestDrag", - "C-api test demo request drag result is %{public}d", gestureParamResult); - } - if (g_isEnable == true) { - g_isEnable = false; - ApplyDisabledStyles(node); - auto result = - OH_ArkUI_AddSupportedUIStates(node, ArkUI_UIState::UI_STATE_DISABLED, StatesChangeHandler, true, nullptr); - if (result != ARKUI_ERROR_CODE_POST_CLONED_NO_COMPONENT_HIT_TO_RESPOND_TO_THE_EVENT) { - const char *textContent = g_isEnable ? "effective" : "disabled"; - ArkUI_AttributeItem contentItem = {.string = textContent}; - Manager::nodeAPI_->setAttribute(node, NODE_TEXT_CONTENT, &contentItem); - } - } else { - g_isEnable = true; - ApplyNormalStyles(node); - auto result = - OH_ArkUI_AddSupportedUIStates(node, ArkUI_UIState::UI_STATE_NORMAL, StatesChangeHandler, true, nullptr); - const char *textContent = g_isEnable ? "effective" : "disabled"; - ArkUI_AttributeItem contentItem = {.string = textContent}; - Manager::nodeAPI_->setAttribute(node, NODE_TEXT_CONTENT, &contentItem); - } -} - -void AllRegisterNodeEventReceiver() -{ - Manager::nodeAPI_->registerNodeEventReceiver([](ArkUI_NodeEvent *event) { - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); - auto targetId = OH_ArkUI_NodeEvent_GetTargetId(event); - switch (eventType) { - case NODE_ON_CLICK: { - switch (targetId) { - case TARGET_ID_2: { - TargetIdTwo(); - break; - } - case TARGET_ID_3: { - TargetIdThree(); - break; - } - case TARGET_ID_4: { - TargetIdFour(); - break; - } - case TARGET_ID_5: { - TargetIdFive(); - break; - } - case TARGET_ID_6: { - auto node = OH_ArkUI_NodeEvent_GetNodeHandle(event); - EnableDisableText(eventType, targetId, node); - break; - } - default: - break; - } - } - default: - break; - } - }); -} - -void SnapshotOptionsDemo(ArkUI_NodeHandle &touchEvent) -{ - auto button = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_AttributeItem LABEL_Item = {.string = "截图"}; - Manager::nodeAPI_->setAttribute(button, NODE_BUTTON_LABEL, &LABEL_Item); - Manager::nodeAPI_->addChild(touchEvent, button); - auto button1 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_AttributeItem LABEL_Item1 = {.string = "动态切换scale并截图"}; - Manager::nodeAPI_->setAttribute(button1, NODE_BUTTON_LABEL, &LABEL_Item1); - Manager::nodeAPI_->addChild(touchEvent, button1); - auto button2 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_AttributeItem LABEL_Item2 = {.string = "动态切换图片类型"}; - Manager::nodeAPI_->setAttribute(button2, NODE_BUTTON_LABEL, &LABEL_Item2); - Manager::nodeAPI_->addChild(touchEvent, button2); - auto button3 = Manager::nodeAPI_->createNode(ARKUI_NODE_BUTTON); - ArkUI_AttributeItem LABEL_Item3 = {.string = "销毁截图选项"}; - Manager::nodeAPI_->setAttribute(button3, NODE_BUTTON_LABEL, &LABEL_Item3); - Manager::nodeAPI_->addChild(touchEvent, button3); - Manager::nodeAPI_->registerNodeEvent(button, NODE_ON_CLICK, TARGET_ID_2, nullptr); - Manager::nodeAPI_->registerNodeEvent(button1, NODE_ON_CLICK, TARGET_ID_3, nullptr); - Manager::nodeAPI_->registerNodeEvent(button2, NODE_ON_CLICK, TARGET_ID_4, nullptr); - Manager::nodeAPI_->registerNodeEvent(button3, NODE_ON_CLICK, TARGET_ID_5, nullptr); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "ComponentSnapshot", "nodeAPI %p", Manager::nodeAPI_); - image = Manager::nodeAPI_->createNode(ARKUI_NODE_IMAGE); - NODE_IMAGE_SRC_Item = {.string = g_b[g_num1]}; - ArkUI_NumberValue imageWidthValue[] = {150}; - ArkUI_AttributeItem imageWidthItem = {imageWidthValue, 1}; - ArkUI_NumberValue imageHeightValue[] = {150}; - ArkUI_AttributeItem imageHeightItem = {imageHeightValue, 1}; - Manager::nodeAPI_->setAttribute(image, NODE_WIDTH, &imageWidthItem); - Manager::nodeAPI_->setAttribute(image, NODE_HEIGHT, &imageHeightItem); - Manager::nodeAPI_->setAttribute(image, NODE_IMAGE_SRC, &NODE_IMAGE_SRC_Item); - Manager::nodeAPI_->addChild(touchEvent, image); - ArkUI_AttributeItem NODE_IMAGE2_SRC_Item = {.string = "/pages/common/background.png"}; - ArkUI_AttributeItem attributeItem = {}; - ArkUI_NumberValue numberValue = {}; - numberValue.i32 = static_cast(ArkUI_ObjectFit::ARKUI_OBJECT_FIT_NONE); - attributeItem.value = &numberValue; - attributeItem.size = 1; - image2 = Manager::nodeAPI_->createNode(ARKUI_NODE_IMAGE); - auto objectFit = ArkUI_ObjectFit::ARKUI_OBJECT_FIT_NONE; - Manager::nodeAPI_->setAttribute(image2, NODE_WIDTH, &imageWidthItem); - Manager::nodeAPI_->setAttribute(image2, NODE_HEIGHT, &imageHeightItem); - Manager::nodeAPI_->setAttribute(image2, NODE_IMAGE_OBJECT_FIT, &attributeItem); - Manager::nodeAPI_->setAttribute(image2, NODE_IMAGE_SRC, &NODE_IMAGE2_SRC_Item); - Manager::nodeAPI_->addChild(touchEvent, image2); - AllRegisterNodeEventReceiver(); -} - -void AddScrollChild(ArkUI_NodeHandle &scroll) -{ - ArkUI_NumberValue borderWidthValue[] = {2}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - ArkUI_NodeHandle column1 = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - Manager::nodeAPI_->setAttribute(column1, NODE_BORDER_WIDTH, &borderWidthItem); - ArkUI_NumberValue widthValue[] = {500}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - Manager::nodeAPI_->setAttribute(column1, NODE_WIDTH, &widthItem); - ArkUI_NumberValue heightValue[] = {600}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - Manager::nodeAPI_->setAttribute(column1, NODE_HEIGHT, &heightItem); - ArkUI_NodeHandle defaultComponent = CreateComponentWithHitTestMode(ARKUI_HIT_TEST_MODE_DEFAULT); - ArkUI_NodeHandle transparentComponent = CreateComponentWithHitTestMode(ARKUI_HIT_TEST_MODE_TRANSPARENT); - ArkUI_NodeHandle noneComponent = CreateComponentWithHitTestMode(ARKUI_HIT_TEST_MODE_NONE); - ArkUI_NodeHandle blockComponent = CreateComponentWithHitTestMode(ARKUI_HIT_TEST_MODE_BLOCK); - ArkUI_NodeHandle demoContainer = CreateHitTestModeDemo(); - ArkUI_NodeHandle column2 = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - Manager::nodeAPI_->setAttribute(column2, NODE_BORDER_WIDTH, &borderWidthItem); - ArkUI_NumberValue heightValue2[] = {800}; - ArkUI_AttributeItem heightItem2 = {heightValue2, 1}; - Manager::nodeAPI_->setAttribute(column1, NODE_HEIGHT, &heightItem2); - ArkUI_NodeHandle demoContainer2 = CreateVisibilityDemo(); - ArkUI_NodeHandle column3 = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - Manager::nodeAPI_->setAttribute(column3, NODE_BORDER_WIDTH, &borderWidthItem); - Manager::nodeAPI_->setAttribute(column3, NODE_HEIGHT, &heightItem); - Manager::nodeAPI_->setAttribute(column3, NODE_WIDTH, &widthItem); - ArkUI_NodeHandle column4 = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - Manager::nodeAPI_->setAttribute(column4, NODE_BORDER_WIDTH, &borderWidthItem); - ArkUI_NumberValue heightValue4[] = {600}; - ArkUI_AttributeItem heightItem4 = {heightValue4, 1}; - Manager::nodeAPI_->setAttribute(column4, NODE_HEIGHT, &heightItem4); - Manager::nodeAPI_->setAttribute(column4, NODE_WIDTH, &widthItem); - Manager::nodeAPI_->addChild(column4, CreateNormalTextComponent()); - static auto enableDisableText = CreateEnableDisableTextComponent(); - Manager::nodeAPI_->registerNodeEvent(enableDisableText, NODE_ON_CLICK, TARGET_ID_6, nullptr); - Manager::nodeAPI_->addChild(column4, enableDisableText); - SnapshotOptionsDemo(column3); - Manager::nodeAPI_->addChild(column1, defaultComponent); - Manager::nodeAPI_->addChild(column1, transparentComponent); - Manager::nodeAPI_->addChild(column1, noneComponent); - Manager::nodeAPI_->addChild(column1, blockComponent); - Manager::nodeAPI_->addChild(column1, demoContainer); - Manager::nodeAPI_->addChild(column2, demoContainer2); - Manager::nodeAPI_->addChild(column2, column4); - Manager::nodeAPI_->addChild(column2, column3); - Manager::nodeAPI_->addChild(column2, column1); - Manager::nodeAPI_->addChild(scroll, column2); -} - -ArkUI_NodeHandle PublicMaker::CreateNativeNode() -{ - if (!Manager::nodeAPI_) { - return nullptr; - } - // 创建父子滚动容器 - ArkUI_NodeHandle scroll = Manager::nodeAPI_->createNode(ARKUI_NODE_SCROLL); - // 设置属性 - SetScrollAttribute(scroll); - AddScrollChild(scroll); - return scroll; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/PublicEvent.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/PublicEvent.h deleted file mode 100644 index 550c1b8709435aef50fb922099e09e6e1d9b2c5e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/PublicEvent.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -const int MAX_SIZE = 11; -class PublicMaker { -public: - PublicMaker(){}; - ~PublicMaker(){}; - - static ArkUI_NodeHandle CreateNativeNode(); -}; -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/RefreshMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/RefreshMaker.cpp deleted file mode 100644 index 76a9bfbe6d8c0b0ddcaf1299a9756bdc712358df..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/RefreshMaker.cpp +++ /dev/null @@ -1,617 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "ListMaker.h" -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#ifndef LOG_TAG -#define LOG_TAG "RefreshMaker" -#endif - -#include "ScrollableNode.h" -#include "ArkUINodeAdapter.h" -#include "ListItemGroup.h" -#include "ListItemSwipe.h" -#include "RefreshMaker.h" - -// ================= 业务常量 ================= -namespace { - -constexpr uint32_t K_COLOR_PAGE_BG = 0xFFF1F3F5U; -constexpr uint32_t K_ITEM_BG_COLOR = 0xFFFFFFFFU; -constexpr const char* K_LOADING_TEXT = "加载中…"; -constexpr float K_ITEM_FONT_SIZE = 16.0f; - -constexpr int K_INIT_COUNT = 10; -constexpr int K_LOAD_BATCH = 10; -constexpr int K_MAX_ITEMS = 100; -constexpr int K_REFRESH_PREPEND_COUNT = 5; -constexpr int K_MIN_REFRESH_MS = 350; - -constexpr float K_WIDTH_PERCENT_FULL = 1.0f; -constexpr float K_HEIGHT_PERCENT_FULL = 1.0f; -constexpr float K_LIST_SPACE = 12.0f; - -constexpr float K_REFRESH_OFFSET_VP = 64.0f; -constexpr float K_MAX_PULL_VP = 128.0f; -constexpr float K_PULL_DOWN_RATIO = 0.6f; - -constexpr bool K_LIST_CLIP_CONTENT = true; -constexpr bool K_LIST_EDGE_SPRING = true; -constexpr bool K_LIST_SCROLLBAR_VISIBLE = false; - -constexpr int K_MIN_INDEX = 0; -constexpr int K_LAST_INDEX_OFFSET = 1; - -// 样式 -constexpr float K_ROW_HEIGHT = 80.0f; -constexpr float K_FOOTER_HEIGHT = 64.0f; - -constexpr int64_t K_FOOTER_STABLE_ID = -16; - -} // namespace - -namespace { -constexpr int RET_OK = 0; - -inline bool Ok(int rc, const char* what) -{ - if (rc != RET_OK) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, - "%{public}s failed rc=%{public}d", what, rc); - return false; - } - return true; -} -} // namespace - -// ================= 状态 ================= -namespace { - -struct RefreshListState { - std::shared_ptr adapter; - std::vector data; - bool showLoadingFooter = false; - - int total = K_INIT_COUNT; // 逻辑总数(与 data.size() 同步增长) - int lastTriggeredTot = -1; - bool loading = false; - - bool NoMore() const { return total >= K_MAX_ITEMS; } - - int ItemsCount() const { return static_cast(data.size()); } - int RenderCount() const { return ItemsCount() + (showLoadingFooter ? 1 : 0); } -}; - -} // namespace - -// ================= 业务工具 ================= -namespace { - -/** - * 添加加载状态尾部 - * @param st 刷新列表状态 - */ -inline void AddLoadingFooter(const std::shared_ptr &st) -{ - const int footerIndex = st->ItemsCount(); - st->adapter->InsertRange(footerIndex, 1); - st->showLoadingFooter = true; -} - -/** - * 移除加载状态尾部 - * @param st 刷新列表状态 - */ -inline void RemoveLoadingFooter(const std::shared_ptr &st) -{ - const int footerIndex = st->ItemsCount(); - st->adapter->RemoveRange(footerIndex, 1); - st->showLoadingFooter = false; -} - -/** - * 切换加载状态尾部显示 - * @param st 刷新列表状态 - * @param on 是否显示 - */ -static void ToggleLoadingFooter(const std::shared_ptr &st, bool on) -{ - if (!st || !st->adapter) { - return; - } - - if (on && !st->showLoadingFooter) { - AddLoadingFooter(st); - } else if (!on && st->showLoadingFooter) { - RemoveLoadingFooter(st); - } -} - -/** - * 末尾追加批量数据 - * @param st 刷新列表状态 - * @param add 添加数量 - */ -static void AppendTailBatch(const std::shared_ptr &st, int add) -{ - if (!st || !st->adapter) { - return; - } - - const int base = st->total; - const int addClamped = std::min(add, K_MAX_ITEMS - base); - if (addClamped <= 0) { - return; - } - - // 先去掉 footer,再插入数据,再恢复 footer(避免 index 混淆) - const bool hadFooter = st->showLoadingFooter; - ToggleLoadingFooter(st, false); - - st->data.reserve(st->data.size() + static_cast(addClamped)); - for (int i = 0; i < addClamped; ++i) { - st->data.emplace_back(std::to_string(base + i)); - } - st->adapter->InsertRange(base, addClamped); - - st->total += addClamped; - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, - "AppendTailBatch add=%{public}d total=%{public}d", addClamped, st->total); - - if (hadFooter) { - ToggleLoadingFooter(st, true); - } -} - -} // namespace - -// ================= 适配器回调(通用 ArkUINodeAdapter) ================= -namespace { - -/** - * 创建列表项 - * @param api 原生节点API接口 - * @return 列表项节点句柄 - */ -static ArkUI_NodeHandle CreateListItem(ArkUI_NativeNodeAPI_1 *api) -{ - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - if (text == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, "create TEXT node null"); - return nullptr; - } - ArkUI_NodeHandle item = api->createNode(ARKUI_NODE_LIST_ITEM); - if (item == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, "create LIST_ITEM node null"); - return nullptr; - } - - if (int rc = api->addChild(item, text); !Ok(rc, "addChild(item,text)")) { - return nullptr; - } - - SetAttributeFloat32(api, item, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, K_ITEM_BG_COLOR); - - // 让文本也占满宽度 - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, 1.0f); - return item; -} - -/** - * 绑定为普通列表项 - * @param api 原生节点API接口 - * @param item 列表项节点句柄 - * @param txt 文本内容 - */ -static void BindAsNormal(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, const char *txt) -{ - ArkUI_NodeHandle text = api->getFirstChild(item); - if (!text) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, "BindAsNormal getFirstChild null"); - return; - } - - // 背景放在 item 上 - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, K_ITEM_BG_COLOR); - - // 文本占满宽度 - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, 1.0f); - - SetTextContent(api, text, txt); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_ITEM_FONT_SIZE); - SetAttributeFloat32(api, text, NODE_HEIGHT, K_ROW_HEIGHT); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, K_ROW_HEIGHT); - SetAttributeInt32(api, text, NODE_TEXT_ALIGN, ARKUI_TEXT_ALIGNMENT_CENTER); -} - -/** - * 绑定为加载尾部项 - * @param api 原生节点API接口 - * @param item 列表项节点句柄 - */ -static void BindAsFooter(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item) -{ - ArkUI_NodeHandle text = api->getFirstChild(item); - if (!text) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, LOG_TAG, "BindAsFooter getFirstChild null"); - return; - } - - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, K_ITEM_BG_COLOR); - SetAttributeFloat32(api, text, NODE_WIDTH_PERCENT, 1.0f); - - SetTextContent(api, text, K_LOADING_TEXT); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_ITEM_FONT_SIZE); - SetAttributeFloat32(api, text, NODE_HEIGHT, K_FOOTER_HEIGHT); - SetAttributeFloat32(api, text, NODE_TEXT_LINE_HEIGHT, K_FOOTER_HEIGHT); - SetAttributeInt32(api, text, NODE_TEXT_ALIGN, ARKUI_TEXT_ALIGNMENT_CENTER); -} - -/** - * 创建节点适配器回调 - * @param st 刷新列表状态 - * @return 节点适配器回调结构 - */ -static NodeAdapterCallbacks MakeCallbacks(const std::shared_ptr &st) -{ - NodeAdapterCallbacks cb{}; - - cb.getTotalCount = [st]() -> int32_t { - return st ? st->RenderCount() : 0; - }; - - cb.getStableId = [st](int32_t i) -> uint64_t { - if (!st) { - return static_cast(i); - } - const int items = st->ItemsCount(); - if (st->showLoadingFooter && i == items) { - return static_cast(K_FOOTER_STABLE_ID); - } - if (i >= 0 && i < items) { - return static_cast(std::hash{}(st->data[static_cast(i)])); - } - return static_cast(i); - }; - - cb.onCreate = [](ArkUI_NativeNodeAPI_1 *api, int32_t /*index*/) -> ArkUI_NodeHandle { - return CreateListItem(api); - }; - - cb.onBind = [st](ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index) { - if (!st) { - return; - } - - const int items = st->ItemsCount(); - if (st->showLoadingFooter && index == items) { - BindAsFooter(api, item); - return; - } - if (index >= 0 && index < items) { - BindAsNormal(api, item, st->data[static_cast(index)].c_str()); - return; - } - BindAsNormal(api, item, ""); - }; - - return cb; -} - -/** - * 创建 ArkUINodeAdapter - */ -static std::shared_ptr MakeListAdapter(const std::shared_ptr &st) -{ - std::shared_ptr adapter = - std::make_shared(static_cast(ARKUI_NODE_LIST_ITEM)); - adapter->SetCallbacks(MakeCallbacks(st)); - return adapter; -} - -} // namespace - -// ================= 视图拼装 ================= -namespace { - -/** - * 创建根节点 - * @return 根节点智能指针 - */ -static std::shared_ptr MakeRoot() -{ - ArkUI_NativeNodeAPI_1 *api = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - ArkUI_NodeHandle h = api->createNode(ARKUI_NODE_COLUMN); - - std::shared_ptr root = std::make_shared(h); - root->SetWidthPercent(K_WIDTH_PERCENT_FULL); - root->SetHeightPercent(K_HEIGHT_PERCENT_FULL); - SetAttributeUInt32(api, root->GetHandle(), NODE_BACKGROUND_COLOR, K_COLOR_PAGE_BG); - return root; -} - -static void ConfigureList(const std::shared_ptr &list) -{ - list->SetWidthPercent(K_WIDTH_PERCENT_FULL); - list->SetHeightPercent(K_HEIGHT_PERCENT_FULL); - list->SetTransparentBackground(); - list->SetClipContent(K_LIST_CLIP_CONTENT); - list->SetEdgeEffectSpring(K_LIST_EDGE_SPRING); - list->SetScrollBarState(K_LIST_SCROLLBAR_VISIBLE); - list->SetSpace(K_LIST_SPACE); - list->SetNestedScrollMode(ListMaker::kNestedScrollParentFirst); -} - -/** - * 创建列表节点 - * @param group 列表项组节点 - * @return 列表节点智能指针 - */ -inline std::shared_ptr MakeList(const std::shared_ptr &group) -{ - std::shared_ptr list = std::make_shared(); - ConfigureList(list); - list->AddChild(std::static_pointer_cast(group)); - return list; -} - -/** - * 创建刷新节点 - * @param list 列表节点 - * @return 刷新节点智能指针 - */ -static std::shared_ptr MakeRefresh(const std::shared_ptr &list) -{ - std::shared_ptr refresh = std::make_shared(); - refresh->AttachChild(list); - refresh->SetTransparentBackground(); - refresh->SetPullToRefresh(true); - refresh->SetRefreshOffset(K_REFRESH_OFFSET_VP); - refresh->SetPullDownRatio(K_PULL_DOWN_RATIO); - refresh->SetMaxPullDownDistance(K_MAX_PULL_VP); - return refresh; -} - -// 触底加载 -static void WireReachEnd(const std::shared_ptr &st, const std::shared_ptr &list) -{ - list->RegisterOnReachEnd([st, list]() { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnReachEnd triggered"); - - if (!st || st->loading || st->lastTriggeredTot == st->total) { - return; - } - st->lastTriggeredTot = st->total; - - if (st->NoMore()) { - const int count = st->RenderCount(); - const int idx = std::max(K_MIN_INDEX, count - K_LAST_INDEX_OFFSET); - list->ScrollToIndex(idx); - return; - } - - st->loading = true; - ToggleLoadingFooter(st, true); - AppendTailBatch(st, K_LOAD_BATCH); - ToggleLoadingFooter(st, false); - st->loading = false; - }); -} - -static void OnVisibleChangeCore(const std::shared_ptr &st, - const std::shared_ptr &list, - int32_t endIdxInGroup) -{ - if (!st) { - return; - } - - const int items = st->ItemsCount(); - if (items <= 0) { - return; - } - - if (endIdxInGroup < items - K_LAST_INDEX_OFFSET) { - return; - } - - if (st->loading || st->lastTriggeredTot == st->total) { - return; - } - - st->lastTriggeredTot = st->total; - - if (st->NoMore()) { - const int count = st->RenderCount(); - const int idx = std::max(K_MIN_INDEX, count - K_LAST_INDEX_OFFSET); - list->ScrollToIndex(idx); - return; - } - - st->loading = true; - ToggleLoadingFooter(st, true); - AppendTailBatch(st, K_LOAD_BATCH); - ToggleLoadingFooter(st, false); - st->loading = false; -} - -inline void WireVisibleChange(const std::shared_ptr &st, const std::shared_ptr &list) -{ - using V = ListMaker::VisibleContentChange; - list->RegisterOnVisibleContentChange([st, list](const V &ev) { - const int32_t endIdx = ev.EndOnItem() ? ev.endItemIndex : -1; - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnVisibleContentChange endIdxInGroup=%{public}d", - endIdx); - OnVisibleChangeCore(st, list, endIdx); - }); -} - -static void PrependNewData(const std::shared_ptr &st) -{ - std::vector news; - news.reserve(K_REFRESH_PREPEND_COUNT); - for (int i = 0; i < K_REFRESH_PREPEND_COUNT; ++i) { - news.emplace_back(std::string("New Item ") + std::to_string(i)); - } - - const bool hadFooter = st->showLoadingFooter; - ToggleLoadingFooter(st, false); - - st->data.insert(st->data.begin(), news.begin(), news.end()); - st->adapter->InsertRange(0, K_REFRESH_PREPEND_COUNT); - - st->total = std::min(st->total + K_REFRESH_PREPEND_COUNT, K_MAX_ITEMS); - st->lastTriggeredTot = -1; - - if (hadFooter) { - ToggleLoadingFooter(st, true); - } - - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, - "OnRefresh prepend=%{public}d total=%{public}d", - K_REFRESH_PREPEND_COUNT, st->total); -} - -/** - * 刷新行为 - */ -static void WireRefreshBehavior(const std::shared_ptr &st, - const std::shared_ptr &refresh) -{ - static std::atomic_bool sRefreshing{false}; - - refresh->RegisterOnRefresh([st, refresh]() { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnRefresh triggered"); - - if (sRefreshing.exchange(true)) { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnRefresh ignored: busy"); - return; - } - - using Clock = std::chrono::steady_clock; - const auto t0 = Clock::now(); - - if (st && !st->NoMore()) { - PrependNewData(st); - } - - const int elapsedMs = - static_cast(std::chrono::duration_cast(Clock::now() - t0).count()); - const int delay = std::max(0, K_MIN_REFRESH_MS - elapsedMs); - - PostDelayedTask(delay, [refresh]() { - refresh->SetRefreshing(false); - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnRefresh complete"); - }); - - sRefreshing = false; - }); -} - -inline void WireRefreshLogs(const std::shared_ptr &refresh) -{ - refresh->RegisterOnOffsetChange([](float offsetVp) { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnOffsetChange offsetVp=%{public}f", offsetVp); - }); - refresh->RegisterOnStateChange([](int32_t state) { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, LOG_TAG, "OnStateChange state=%{public}d", state); - }); -} - -/** - * Build - */ -static std::shared_ptr Build() -{ - // 根节点 - std::shared_ptr root = MakeRoot(); - - // 分组 + 列表 - std::shared_ptr group = std::make_shared(); - std::shared_ptr list = MakeList(group); - - // 刷新容器 - std::shared_ptr refresh = MakeRefresh(list); - - // 状态 - std::shared_ptr st = std::make_shared(); - st->data.reserve(K_MAX_ITEMS); - for (int i = 0; i < K_INIT_COUNT; ++i) { - st->data.emplace_back(std::to_string(i)); - } - st->total = K_INIT_COUNT; - - // 适配器 - st->adapter = MakeListAdapter(st); - group->SetLazyAdapter(st->adapter); - - // 行为绑定 - WireReachEnd(st, list); - WireVisibleChange(st, list); - WireRefreshBehavior(st, refresh); - WireRefreshLogs(refresh); - - // 组装 - root->AddChild(refresh); - - // keep alive - GetKeepAliveContainer().emplace_back(root); - GetKeepAliveContainer().emplace_back(refresh); - GetKeepAliveContainer().emplace_back(list); - GetKeepAliveContainer().emplace_back(group); - static std::vector> g_states; - g_states.emplace_back(st); - - return root; -} -} // namespace - -ArkUI_NodeHandle RefreshMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (api == nullptr) { - return nullptr; - } - - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (page == nullptr) { - return nullptr; - } - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - std::shared_ptr root = Build(); - if (root && root->GetHandle() != nullptr) { - SetAttributeFloat32(api, root->GetHandle(), NODE_LAYOUT_WEIGHT, 1.0f); - api->addChild(page, root->GetHandle()); - } - - return page; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/RefreshMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/RefreshMaker.h deleted file mode 100644 index 6a7903b06fed6fff0639f990e49fa64d53d85345..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/RefreshMaker.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef REFRESH_MAKER_H -#define REFRESH_MAKER_H - -#include -#include - -#include -#include - -#include "ScrollableNode.h" - -inline constexpr int32_t K_REFRESH_OFFSET_DATA_INDEX = 0; -inline constexpr int32_t K_REFRESH_STATE_DATA_INDEX = 0; - -class RefreshMaker : public BaseNode { -public: - static ArkUI_NodeHandle CreateNativeNode(); - - RefreshMaker() - : BaseNode(NodeApiInstance::GetInstance()->GetNativeNodeAPI()->createNode(ARKUI_NODE_REFRESH)), - registrar_(nodeApi_, GetHandle()) - { - nodeApi_->addNodeEventReceiver(GetHandle(), StaticEvent); - } - - // ===== 属性(组件范围)===== - void SetRefreshing(bool refreshing) - { - ArkUI_NumberValue v[]{{.i32 = refreshing ? 1 : 0}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_REFRESHING, &item); - } - - void SetHeaderContent(const std::shared_ptr &header) - { - if (header == nullptr) { - nodeApi_->resetAttribute(GetHandle(), NODE_REFRESH_CONTENT); - header_.reset(); - return; - } - ArkUI_AttributeItem item{nullptr, 0, nullptr, header->GetHandle()}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_CONTENT, &item); - header_ = header; - } - - void SetPullDownRatio(float ratio) - { - ArkUI_NumberValue v[]{{.f32 = ratio}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_PULL_DOWN_RATIO, &item); - } - - void SetRefreshOffset(float vp) - { - ArkUI_NumberValue v[]{{.f32 = vp}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_OFFSET, &item); - } - - void SetPullToRefresh(bool enable) - { - ArkUI_NumberValue v[]{{.i32 = enable ? 1 : 0}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_PULL_TO_REFRESH, &item); - } - - void SetMaxPullDownDistance(float vp) - { - ArkUI_NumberValue v[]{{.f32 = vp}}; - ArkUI_AttributeItem item{v, 1}; - nodeApi_->setAttribute(GetHandle(), NODE_REFRESH_MAX_PULL_DOWN_DISTANCE, &item); - } - - void AttachChild(const std::shared_ptr &child) - { - if (child != nullptr) { - AddChild(child); - } - } - - // ===== 事件注册 ===== - void RegisterOnRefresh(const std::function &cb) - { - onRefresh_ = cb; - registrar_.RegisterEvent(NODE_REFRESH_ON_REFRESH, this); - } - - void RegisterOnOffsetChange(const std::function &cb) - { - onOffsetChange_ = cb; - registrar_.RegisterEvent(NODE_REFRESH_ON_OFFSET_CHANGE, this); - } - - void RegisterOnStateChange(const std::function &cb) - { - onStateChange_ = cb; - registrar_.RegisterEvent(NODE_REFRESH_STATE_CHANGE, this); - } - -private: - static void StaticEvent(ArkUI_NodeEvent *ev) - { - if (ev == nullptr) { - return; - } - auto *self = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(ev)); - if (self == nullptr) { - return; - } - self->OnNodeEvent(ev); - } - - void OnNodeEvent(ArkUI_NodeEvent *ev) override - { - const int32_t type = OH_ArkUI_NodeEvent_GetEventType(ev); - ArkUI_NodeComponentEvent *ce = OH_ArkUI_NodeEvent_GetNodeComponentEvent(ev); - - switch (type) { - case NODE_REFRESH_ON_REFRESH: - if (onRefresh_) { - onRefresh_(); - } - break; - case NODE_REFRESH_ON_OFFSET_CHANGE: - if (ce != nullptr && onOffsetChange_) { - onOffsetChange_(ce->data[K_REFRESH_OFFSET_DATA_INDEX].f32); - } - break; - case NODE_REFRESH_STATE_CHANGE: - if (ce != nullptr && onStateChange_) { - onStateChange_(ce->data[K_REFRESH_STATE_DATA_INDEX].i32); - } - break; - default: - break; - } - } - -private: - std::shared_ptr header_; - std::function onRefresh_; - std::function onOffsetChange_; - std::function onStateChange_; - - NodeEventRegistrar registrar_; -}; - -#endif // REFRESH_MAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollMaker.cpp deleted file mode 100644 index 6d5c146d2f91aa66e4dc317f52c3c38ef6db7b67..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollMaker.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollMaker.h" - -#include -#ifndef LOG_TAG -#define LOG_TAG "ScrollMaker" -#endif - -// ===== 业务常量 ===== -namespace { -constexpr float K_WIDTH_PERCENT_FULL = 1.0f; -constexpr float K_HEIGHT_PERCENT_FULL = 1.0f; -constexpr uint32_t K_PAGE_BG = 0xFFFFFF00U; // Yellow - -constexpr uint32_t K_COLOR_BROWN = 0xFFA52A2AU; -constexpr uint32_t K_COLOR_BLUE = 0xFF0000FFU; -constexpr uint32_t K_COLOR_GREEN = 0xFF008000U; - -constexpr float K_TEXT_SIZE = 100.0f; - -// 其他行为参数 -constexpr float K_FRICTION = 0.9f; -constexpr float K_FLING_LIMIT = 12000.0f; - -constexpr unsigned int K_LOG_DOMAIN = 0xFF00; - -// 事件数据数组索引常量 -constexpr int32_t K_PRIMARY_DELTA_DATA_INDEX = 0; -constexpr int32_t K_SECONDARY_DELTA_DATA_INDEX = 1; -constexpr int32_t K_AREA_HEIGHT_FALLBACK_DATA_INDEX = 6; -constexpr int32_t K_AREA_HEIGHT_PRIMARY_DATA_INDEX = 7; -} // namespace - -// ===== 全局状态 ===== -static ArkUI_NativeNodeAPI_1 *gApi{nullptr}; -static std::shared_ptr gScroll; -static ArkUI_NodeHandle gRoot{nullptr}; -static ArkUI_NodeHandle gPageTop{nullptr}; -static ArkUI_NodeHandle gPageMid{nullptr}; -static ArkUI_NodeHandle gPageBot{nullptr}; - -static float g_selfH{0.0f}; -static float g_yOffset{0.0f}; - -// ===== 工具:页面创建与布局 ===== -/** - * 创建页面节点 - * @param bg 背景色 - * @param label 标签文本 - * @return 页面节点句柄 - */ -static ArkUI_NodeHandle CreatePage(uint32_t bg, const char *label) -{ - if (gApi == nullptr) { - return nullptr; - } - - ArkUI_NodeHandle page = gApi->createNode(ARKUI_NODE_STACK); - SetAttributeFloat32(gApi, page, NODE_WIDTH_PERCENT, K_WIDTH_PERCENT_FULL); - SetAttributeFloat32(gApi, page, NODE_HEIGHT_PERCENT, K_HEIGHT_PERCENT_FULL); - SetAttributeUInt32(gApi, page, NODE_BACKGROUND_COLOR, bg); - - ArkUI_NodeHandle text = gApi->createNode(ARKUI_NODE_TEXT); - SetTextContent(gApi, text, label); - SetAttributeFloat32(gApi, text, NODE_FONT_SIZE, K_TEXT_SIZE); - - gApi->addChild(page, text); - return page; -} - -/** - * 根据索引获取偏移量 - * @param index 索引值 - * @return 偏移量 - */ -static inline float GetOffsetByIndex(int index) -{ - float off = g_yOffset - static_cast(index) * g_selfH; - if (off > 1.5f * g_selfH) { - off -= 3.0f * g_selfH; - } else if (off < -1.5f * g_selfH) { - off += 3.0f * g_selfH; - } - return off; -} - -static void ApplyTranslate(ArkUI_NodeHandle n, float ty) -{ - ArkUI_NumberValue vx{.f32 = 0.0f}; - ArkUI_NumberValue vy{.f32 = ty}; - ArkUI_NumberValue vz{.f32 = 0.0f}; - - ArkUI_NumberValue v[] = {vx, vy, vz}; - ArkUI_AttributeItem it{v, 3}; - - gApi->setAttribute(n, NODE_TRANSLATE, &it); -} - -static void SyncAllTranslate() -{ - if (gApi == nullptr) { - return; - } - ApplyTranslate(gPageTop, -GetOffsetByIndex(-1)); - ApplyTranslate(gPageMid, -GetOffsetByIndex(0)); - ApplyTranslate(gPageBot, -GetOffsetByIndex(1)); -} - -// ===== 事件读取辅助 ===== -static inline float ReadDeltaPrimary(ArkUI_NodeComponentEvent *ce) { return ce->data[K_PRIMARY_DELTA_DATA_INDEX].f32; } -static inline float ReadDeltaSecondary(ArkUI_NodeComponentEvent *ce) -{ - return ce->data[K_SECONDARY_DELTA_DATA_INDEX].f32; -} - -// ===== 事件处理 ===== -static void OnAreaChange(ArkUI_NodeComponentEvent *ce) -{ - if (ce == nullptr) { - return; - } - - float h = ce->data[K_AREA_HEIGHT_PRIMARY_DATA_INDEX].f32; - if (h <= 0.0f) { - h = ce->data[K_AREA_HEIGHT_FALLBACK_DATA_INDEX].f32; - } - - if (h > 0.0f && std::fabs(h - g_selfH) > 0.5f) { - g_selfH = h; - SyncAllTranslate(); - } -} - -static void ApplyScrollDelta(float delta) -{ - if (std::fabs(delta) <= 1e-5f) { - return; - } - - g_yOffset += delta; - - const float period = 3.0f * g_selfH; - if (g_selfH > 0.0f && period > 0.0f) { - while (g_yOffset < 0.0f) { - g_yOffset += period; - } - while (g_yOffset >= period) { - g_yOffset -= period; - } - } - - SyncAllTranslate(); -} - -static void OnScrollFrameBegin(ArkUI_NodeComponentEvent *ce) -{ - if (ce == nullptr) { - return; - } - - float delta = ReadDeltaPrimary(ce); - if (std::fabs(delta) < 1e-5f) { - delta = ReadDeltaSecondary(ce); - } - - ApplyScrollDelta(delta); - - ce->data[K_PRIMARY_DELTA_DATA_INDEX].f32 = 0.0f; - ce->data[K_SECONDARY_DELTA_DATA_INDEX].f32 = 0.0f; -} - -static void OnScroll(ArkUI_NodeComponentEvent *ce) -{ - if (ce == nullptr) { - return; - } - float delta = ReadDeltaPrimary(ce); - if (std::fabs(delta) < 1e-5f) { - delta = ReadDeltaSecondary(ce); - } - ApplyScrollDelta(delta); -} - -static void OnSimpleLog(const char *tag) -{ - OH_LOG_Print(LOG_APP, LOG_DEBUG, K_LOG_DOMAIN, LOG_TAG, "%{public}s", tag); -} - -static bool HandleCoreScrollEvents(int32_t type, ArkUI_NodeComponentEvent *ce) -{ - switch (type) { - case NODE_SCROLL_EVENT_ON_SCROLL_FRAME_BEGIN: - OnScrollFrameBegin(ce); - return true; - case NODE_SCROLL_EVENT_ON_WILL_SCROLL: - OnSimpleLog("OnWillScroll"); - return true; - case NODE_SCROLL_EVENT_ON_SCROLL: - OnScroll(ce); - return true; - case NODE_SCROLL_EVENT_ON_DID_SCROLL: - OnSimpleLog("OnDidScroll"); - return true; - case NODE_SCROLL_EVENT_ON_SCROLL_START: - OnSimpleLog("OnScrollStart"); - return true; - case NODE_SCROLL_EVENT_ON_SCROLL_STOP: - OnSimpleLog("OnScrollStop"); - return true; - default: - return false; - } -} - -static bool HandleBoundaryEvents(int32_t type, ArkUI_NodeComponentEvent * /*ce*/) -{ - switch (type) { - case NODE_SCROLL_EVENT_ON_REACH_START: - OnSimpleLog("OnReachStart"); - return true; - case NODE_SCROLL_EVENT_ON_REACH_END: - OnSimpleLog("OnReachEnd"); - return true; - case NODE_SCROLL_EVENT_ON_WILL_STOP_DRAGGING: - OnSimpleLog("OnWillStopDragging"); - return true; - case NODE_SCROLL_EVENT_ON_SCROLL_EDGE: - OnSimpleLog("OnScrollEdge"); - return true; - default: - return false; - } -} - -static bool HandleZoomEvents(int32_t type, ArkUI_NodeComponentEvent * /*ce*/) -{ - switch (type) { - case NODE_SCROLL_EVENT_ON_ZOOM_START: - OnSimpleLog("OnZoomStart"); - return true; - case NODE_SCROLL_EVENT_ON_ZOOM_STOP: - OnSimpleLog("OnZoomStop"); - return true; - case NODE_SCROLL_EVENT_ON_DID_ZOOM: - OnSimpleLog("OnDidZoom"); - return true; - default: - return false; - } -} - -static void HandleNodeEvent(ArkUI_NodeEvent *ev) -{ - if (ev == nullptr) { - return; - } - - int32_t type = OH_ArkUI_NodeEvent_GetEventType(ev); - ArkUI_NodeComponentEvent *ce = OH_ArkUI_NodeEvent_GetNodeComponentEvent(ev); - - if (type == NODE_EVENT_ON_AREA_CHANGE) { - OnAreaChange(ce); - return; - } - - if (HandleCoreScrollEvents(type, ce)) { - return; - } - if (HandleBoundaryEvents(type, ce)) { - return; - } - if (HandleZoomEvents(type, ce)) { - return; - } -} - -// ===== 组装构建 ===== -static void SetupScroll() -{ - gScroll = std::make_shared(); - - gScroll->SetWidthPercent(K_WIDTH_PERCENT_FULL); - gScroll->SetHeightPercent(K_HEIGHT_PERCENT_FULL); - gScroll->SetBackgroundColor(K_PAGE_BG); - - gScroll->SetDirection(ARKUI_SCROLL_DIRECTION_VERTICAL); - gScroll->SetScrollBarDisplayMode(ARKUI_SCROLL_BAR_DISPLAY_MODE_OFF); - gScroll->SetScrollBarWidth(2.0f); - gScroll->SetScrollBarColor(0x66000000U); - gScroll->SetScrollBarMargin(0.0f, 0.0f, 0.0f, 0.0f); - - gScroll->SetEnableScrollInteraction(true); - gScroll->SetFriction(K_FRICTION); - gScroll->SetClipContent(true); - gScroll->SetPageEnabled(false); - gScroll->SetBackToTopEnabled(false); - gScroll->SetFadingEdge(0.0f); - gScroll->SetFlingSpeedLimit(K_FLING_LIMIT); - gScroll->SetEdgeEffect(ARKUI_EDGE_EFFECT_SPRING, true, - static_cast(ARKUI_EFFECT_EDGE_START | ARKUI_EFFECT_EDGE_END)); -} - -static void SetupRootAndPages() -{ - gRoot = gApi->createNode(ARKUI_NODE_STACK); - SetAttributeFloat32(gApi, gRoot, NODE_WIDTH_PERCENT, K_WIDTH_PERCENT_FULL); - SetAttributeFloat32(gApi, gRoot, NODE_HEIGHT_PERCENT, K_HEIGHT_PERCENT_FULL); - - gPageTop = CreatePage(K_COLOR_BROWN, "3"); - gPageMid = CreatePage(K_COLOR_BLUE, "1"); - gPageBot = CreatePage(K_COLOR_GREEN, "2"); - - gApi->addChild(gRoot, gPageTop); - gApi->addChild(gRoot, gPageMid); - gApi->addChild(gRoot, gPageBot); - - gScroll->AddChild(gRoot); -} - -static void RegisterEvents() -{ - gApi->addNodeEventReceiver(gScroll->GetScroll(), &HandleNodeEvent); - gApi->addNodeEventReceiver(gRoot, &HandleNodeEvent); - gApi->registerNodeEvent(gRoot, NODE_EVENT_ON_AREA_CHANGE, 0, nullptr); -} - -/** - * 构建滚动视图 - * @return 滚动节点句柄 - */ -static ArkUI_NodeHandle Build() -{ - gApi = NodeApiInstance::GetInstance()->GetNativeNodeAPI(); - if (gApi == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "GetNativeNodeAPI failed"); - return nullptr; - } - - SetupScroll(); - SetupRootAndPages(); - RegisterEvents(); - SyncAllTranslate(); - - return gScroll->GetScroll(); -} - -ArkUI_NodeHandle ScrollMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (api == nullptr) { - return nullptr; - } - - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (page == nullptr) { - return nullptr; - } - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - ArkUI_NodeHandle scroll = Build(); - if (scroll != nullptr) { - SetAttributeFloat32(api, scroll, NODE_LAYOUT_WEIGHT, 1.0f); - api->addChild(page, scroll); - } - - return page; -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollMaker.h deleted file mode 100644 index b1a8de21a96d047cbd7011254f98fc30e737bfb6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollMaker.h +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef SCROLL_MAKER_H -#define SCROLL_MAKER_H - -#include -#include - -#include -#include -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollableEvent.h" - -/** - * @brief ArkUI Scroll 节点轻封装 - */ -class ScrollMaker { -public: - using OnScrollState = std::function; - using OnWillScroll = std::function; - using OnDidScroll = std::function; - - void SetOnScrollStateChanged(OnScrollState cb) { onState_ = std::move(cb); } - void SetOnWillScroll(OnWillScroll cb) { onWill_ = std::move(cb); } - void SetOnDidScroll(OnDidScroll cb) { onDid_ = std::move(cb); } - - static ArkUI_NodeHandle CreateNativeNode(); - -public: - ScrollMaker() - { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api_); - scroll_ = api_->createNode(ARKUI_NODE_SCROLL); - api_->addNodeEventReceiver(scroll_, StaticEvent); - scrollGuard_.Bind(api_, scroll_, this, SCROLL_EVT_ALL); - } - - ~ScrollMaker() - { - scrollGuard_.Release(); - scroll_ = nullptr; - api_ = nullptr; - } - - // ===== 通用布局/外观 ===== - void SetWidthPercent(float percent) { SetAttributeFloat32(api_, scroll_, NODE_WIDTH_PERCENT, percent); } - void SetHeightPercent(float percent) { SetAttributeFloat32(api_, scroll_, NODE_HEIGHT_PERCENT, percent); } - void SetBackgroundColor(uint32_t color) { SetAttributeUInt32(api_, scroll_, NODE_BACKGROUND_COLOR, color); } - - void SetDirection(ArkUI_ScrollDirection direction) - { - ArkUI_NumberValue v{.i32 = static_cast(direction)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_SCROLL_DIRECTION, &it); - } - - void SetScrollBarDisplayMode(ArkUI_ScrollBarDisplayMode displayMode) - { - ArkUI_NumberValue v{.i32 = static_cast(displayMode)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_BAR_DISPLAY_MODE, &it); - } - - void SetScrollBarWidth(float w) - { - ArkUI_NumberValue v{.f32 = w}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_BAR_WIDTH, &it); - } - - void SetScrollBarColor(uint32_t argb) - { - ArkUI_NumberValue v{.u32 = argb}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_BAR_COLOR, &it); - } - - /** @brief 滚动条外边距:top,right,bottom,left(单位:vp) */ - void SetScrollBarMargin(float top, float right, float bottom, float left) - { - ArkUI_NumberValue vTop{.f32 = top}; - ArkUI_NumberValue vRight{.f32 = right}; - ArkUI_NumberValue vBottom{.f32 = bottom}; - ArkUI_NumberValue vLeft{.f32 = left}; - ArkUI_NumberValue v[] = {vTop, vRight, vBottom, vLeft}; - ArkUI_AttributeItem it{v, 4}; - api_->setAttribute(scroll_, NODE_SCROLL_BAR_MARGIN, &it); - } - - void SetEnableScrollInteraction(bool enable) - { - ArkUI_NumberValue v{.i32 = enable ? 1 : 0}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_ENABLE_SCROLL_INTERACTION, &it); - } - - void SetFriction(float friction) { SetAttributeFloat32(api_, scroll_, NODE_SCROLL_FRICTION, friction); } - - void SetNestedMode(ArkUI_ScrollNestedMode mode) - { - ArkUI_NumberValue v{.i32 = static_cast(mode)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_NESTED_SCROLL, &it); - } - - void SetScrollEdge(ArkUI_ScrollEdge edge) - { - ArkUI_NumberValue v{.i32 = static_cast(edge)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_EDGE, &it); - } - - void SetContentClipMode(ArkUI_ContentClipMode clipMode) - { - ArkUI_NumberValue v{.i32 = static_cast(clipMode)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_CLIP_CONTENT, &it); - } - - void SetClipContent(bool clip) - { - ArkUI_NumberValue v{.i32 = clip ? 1 : 0}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_CLIP_CONTENT, &it); - } - - void SetPageEnabled(bool enable) - { - ArkUI_NumberValue v{.i32 = enable ? 1 : 0}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_PAGE, &it); - } - - void SetBackToTopEnabled(bool enable) - { - ArkUI_NumberValue v{.i32 = enable ? 1 : 0}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_BACK_TO_TOP, &it); - } - - // 偏移/尺寸/By/Fling/渐隐/限速 - void SetOffset(float x, float y) - { - ArkUI_NumberValue vx{.f32 = x}; - ArkUI_NumberValue vy{.f32 = y}; - ArkUI_NumberValue v[] = {vx, vy}; - ArkUI_AttributeItem it{v, 2}; - api_->setAttribute(scroll_, NODE_SCROLL_OFFSET, &it); - } - - void SetSize(float w, float h) - { - ArkUI_NumberValue vw{.f32 = w}; - ArkUI_NumberValue vh{.f32 = h}; - ArkUI_NumberValue v[] = {vw, vh}; - ArkUI_AttributeItem it{v, 2}; - api_->setAttribute(scroll_, NODE_SCROLL_SIZE, &it); - } - - void ScrollBy(float dx, float dy) - { - ArkUI_NumberValue vx{.f32 = dx}; - ArkUI_NumberValue vy{.f32 = dy}; - ArkUI_NumberValue v[] = {vx, vy}; - ArkUI_AttributeItem it{v, 2}; - api_->setAttribute(scroll_, NODE_SCROLL_BY, &it); - } - - void Fling(float velocity) - { - ArkUI_NumberValue v{.f32 = velocity}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_FLING, &it); - } - - void SetFadingEdge(float len) - { - ArkUI_NumberValue v{.f32 = len}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_FADING_EDGE, &it); - } - - void SetFlingSpeedLimit(float limit) - { - ArkUI_NumberValue v{.f32 = limit}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_FLING_SPEED_LIMIT, &it); - } - - /** - * @brief 设置 Scroll 组件的边缘效果(越界回弹/发光等)。 - * @param effect [IN] 边缘效果类型,取值为 ArkUI_EdgeEffect(如 ARKUI_EDGE_EFFECT_NONE、ARKUI_EDGE_EFFECT_SPRING)。 - * @param enableWhenContentSmaller [IN] 当内容尺寸小于组件本身时是否仍启用边缘效果(1 启用,0 禁用)。 - * @param edge [IN] 生效方向,ArkUI_EffectEdge,可位或组合(如 ARKUI_EFFECT_EDGE_START | ARKUI_EFFECT_EDGE_END)。 - * @note 对应属性:NODE_SCROLL_EDGE_EFFECT;ArkUI_AttributeItem.value - * 含义:[0].i32=effect,[1].i32=enableWhenContentSmaller,[2].i32=edge。 - */ - void SetEdgeEffect(ArkUI_EdgeEffect effect, bool enableWhenContentSmaller, ArkUI_EffectEdge edge) - { - ArkUI_NumberValue v[3]; - v[0].i32 = static_cast(effect); // [0] 效果类型 - v[1].i32 = enableWhenContentSmaller ? 1 : 0; // [1] 小内容是否启用 - v[2].i32 = static_cast(edge); // [2] 生效边(位掩码) - - ArkUI_AttributeItem it{v, 3}; - api_->setAttribute(scroll_, NODE_SCROLL_EDGE_EFFECT, &it); - } - - void SetSnapAlign(ArkUI_ScrollSnapAlign align) - { - ArkUI_NumberValue v{.i32 = static_cast(align)}; - ArkUI_AttributeItem it{&v, 1}; - api_->setAttribute(scroll_, NODE_SCROLL_SNAP, &it); - } - - // ===== 子节点 ===== - void AddChild(ArkUI_NodeHandle child) - { - if (child != nullptr) { - api_->addChild(scroll_, child); - } - } - - ArkUI_NodeHandle GetScroll() const { return scroll_; } - -private: - inline void HandleScrollStateChanged(const ArkUI_NodeComponentEvent *comp) - { - if (!onState_) { - return; - } - auto state = static_cast(comp->data[0].i32); - onState_(state); - } - - inline void HandleWillScroll(const ArkUI_NodeComponentEvent *comp) - { - if (!onWill_) { - return; - } - float dx = comp->data[0].f32; - float dy = comp->data[1].f32; - auto state = static_cast(comp->data[2].i32); - auto src = static_cast(comp->data[3].i32); - onWill_(dx, dy, state, src); - } - - inline void HandleDidScroll(const ArkUI_NodeComponentEvent *comp) - { - if (!onDid_) { - return; - } - float dx = comp->data[0].f32; - float dy = comp->data[1].f32; - auto state = static_cast(comp->data[2].i32); - onDid_(dx, dy, state); - } - - inline void HandleListWillScroll(const ArkUI_NodeComponentEvent *comp) - { - if (!onWill_) { - return; - } - float dy = comp->data[0].f32; - auto state = static_cast(comp->data[1].i32); - auto src = static_cast(comp->data[2].i32); - onWill_(0.0f, dy, state, src); - } - - inline void HandleOnWillScroll(const ArkUI_NodeComponentEvent *comp) - { - if (!onWill_) { - return; - } - float d = comp->data[0].f32; // 单轴按约定复用 dy - auto state = static_cast(comp->data[1].i32); - auto src = static_cast(comp->data[2].i32); - onWill_(0.0f, d, state, src); - } - - static void StaticEvent(ArkUI_NodeEvent *ev) - { - if (!ev) { - return; - } - auto *self = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(ev)); - if (!self) { - return; - } - - const auto *comp = OH_ArkUI_NodeEvent_GetNodeComponentEvent(ev); - if (!comp) { - return; - } - - switch (OH_ArkUI_NodeEvent_GetEventType(ev)) { - case NODE_SWIPER_EVENT_ON_SCROLL_STATE_CHANGED: - self->HandleScrollStateChanged(comp); - break; - case NODE_SCROLL_EVENT_ON_WILL_SCROLL: - self->HandleWillScroll(comp); - break; - case NODE_SCROLL_EVENT_ON_DID_SCROLL: - self->HandleDidScroll(comp); - break; - case NODE_LIST_ON_WILL_SCROLL: - self->HandleListWillScroll(comp); - break; - case NODE_ON_WILL_SCROLL: - self->HandleOnWillScroll(comp); - break; - default: - break; - } - } - -private: - ArkUI_NativeNodeAPI_1 *api_{nullptr}; - ArkUI_NodeHandle scroll_{nullptr}; - ScrollEventGuard scrollGuard_{}; - - OnScrollState onState_{}; - OnWillScroll onWill_{}; - OnDidScroll onDid_{}; -}; -#endif // SCROLL_MAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableEvent.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableEvent.h deleted file mode 100644 index 6115991241c8b038f41e8ca645ca02eda926f0bf..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableEvent.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef SCROLL_EVENT_H -#define SCROLL_EVENT_H - -#include -#include - -/** - * 滚动事件掩码 - */ -enum : uint32_t { - SCROLL_EVT_FRAME_BEGIN = 1u << 0, - SCROLL_EVT_START = 1u << 1, - SCROLL_EVT_STOP = 1u << 2, - SCROLL_EVT_REACH_START = 1u << 3, - SCROLL_EVT_REACH_END = 1u << 4, - SCROLL_EVT_WILL_STOP_DRAG = 1u << 5, - SCROLL_EVT_ALL = SCROLL_EVT_FRAME_BEGIN | SCROLL_EVT_START | SCROLL_EVT_STOP | SCROLL_EVT_REACH_START | - SCROLL_EVT_REACH_END | SCROLL_EVT_WILL_STOP_DRAG -}; - -/** - * 事件 map - */ -struct ScrollEvtMap { - uint32_t bit; - ArkUI_NodeEventType evt; -}; - -inline constexpr ScrollEvtMap K_SCROLL_EVT_MAP[] = { - {SCROLL_EVT_FRAME_BEGIN, NODE_SCROLL_EVENT_ON_SCROLL_FRAME_BEGIN}, - {SCROLL_EVT_START, NODE_SCROLL_EVENT_ON_SCROLL_START}, - {SCROLL_EVT_STOP, NODE_SCROLL_EVENT_ON_SCROLL_STOP}, - {SCROLL_EVT_REACH_START, NODE_SCROLL_EVENT_ON_REACH_START}, - {SCROLL_EVT_REACH_END, NODE_SCROLL_EVENT_ON_REACH_END}, - {SCROLL_EVT_WILL_STOP_DRAG, NODE_SCROLL_EVENT_ON_WILL_STOP_DRAGGING}, -}; - -template inline void ForEachScrollEvt(uint32_t mask, F &&fn) -{ - for (const auto &m : K_SCROLL_EVT_MAP) { - if (mask & m.bit) { - fn(m.evt); - } - } -} - -/** - * 批量注册事件 - */ -inline void RegisterScrollEvents(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, void *userData, - uint32_t mask = SCROLL_EVT_ALL) -{ - if (!api || !node) { - return; - } - ForEachScrollEvt(mask, [&](ArkUI_NodeEventType evt) { api->registerNodeEvent(node, evt, 0, userData); }); -} - -/** - * 批量取消注册事件 - */ -inline void UnregisterScrollEvents(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, uint32_t mask = SCROLL_EVT_ALL) -{ - if (!api || !node) { - return; - } - ForEachScrollEvt(mask, [&](ArkUI_NodeEventType evt) { api->unregisterNodeEvent(node, evt); }); -} - -/** - * 滚动事件自动注册/注销 - */ -class ScrollEventGuard { -public: - ScrollEventGuard() = default; - - ScrollEventGuard(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, void *userData, uint32_t mask = SCROLL_EVT_ALL) - { - Bind(api, node, userData, mask); - } - - void Bind(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, void *userData, uint32_t mask = SCROLL_EVT_ALL) - { - api_ = api; - node_ = node; - user_ = userData; - mask_ = mask; - RegisterScrollEvents(api_, node_, user_, mask_); - armed_ = true; - } - - void Release() - { - if (armed_) { - UnregisterScrollEvents(api_, node_, mask_); - armed_ = false; - } - } - - ~ScrollEventGuard() - { - if (armed_) { - UnregisterScrollEvents(api_, node_, mask_); - } - } - -private: - ArkUI_NativeNodeAPI_1 *api_ = nullptr; - ArkUI_NodeHandle node_ = nullptr; - void *user_ = nullptr; - uint32_t mask_ = SCROLL_EVT_ALL; - bool armed_ = false; -}; - -#endif // SCROLL_EVENT_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableNode.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableNode.h deleted file mode 100644 index de11efca4c331349d441f689d56324654d3b227f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableNode.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef ARKUINODE_H -#define ARKUINODE_H - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "ScrollableUtils.h" - -class NodeApiInstance { -public: - static NodeApiInstance *GetInstance() - { - static NodeApiInstance instance; - return &instance; - } - ArkUI_NativeNodeAPI_1 *GetNativeNodeAPI() const { return nodeApi_; } - -private: - NodeApiInstance() { OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeApi_); } - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - - NodeApiInstance(const NodeApiInstance &) = delete; - NodeApiInstance &operator=(const NodeApiInstance &) = delete; -}; - -class BaseNode : public std::enable_shared_from_this { -public: - explicit BaseNode(ArkUI_NodeHandle handle) - : nodeApi_(NodeApiInstance::GetInstance()->GetNativeNodeAPI()), nodeHandle_(handle) - { - if (!IsNotNull(nodeApi_) || !IsNotNull(nodeHandle_)) { - return; - } - RegisterClickEvent(); - } - - virtual ~BaseNode() - { - UnregisterClickEvent(); - ClearChildren(); - nodeHandle_ = nullptr; - } - - BaseNode(const BaseNode &) = delete; - BaseNode &operator=(const BaseNode &) = delete; - - ArkUI_NodeHandle GetHandle() const { return nodeHandle_; } - - void AddChild(const std::shared_ptr &child) - { - if (!IsNotNull(child)) { - return; - } - children_.push_back(child); - nodeApi_->addChild(nodeHandle_, child->GetHandle()); - } - - void RemoveChild(const std::shared_ptr &child) - { - if (!IsNotNull(child)) { - return; - } - auto it = std::find(children_.begin(), children_.end(), child); - if (it != children_.end()) { - nodeApi_->removeChild(nodeHandle_, child->GetHandle()); - children_.erase(it); - } - } - - // ---------------- 通用属性 ---------------- - - void SetWidth(float width) { SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_WIDTH, width); } - void SetHeight(float height) { SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_HEIGHT, height); } - void SetWidthPercent(float percent) - { - SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_WIDTH_PERCENT, percent); - } - void SetHeightPercent(float percent) - { - SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_HEIGHT_PERCENT, percent); - } - void SetSize(float w, float h) { ::SetSize(nodeApi_, nodeHandle_, w, h); } - void SetSizePercent(float wp, float hp) { ::SetSizePercent(nodeApi_, nodeHandle_, wp, hp); } - void SetFullSize() { ::SetFullSize(nodeApi_, nodeHandle_); } - - void SetBackgroundColor(uint32_t color) { ::SetBackgroundColor(nodeApi_, nodeHandle_, color); } - - virtual void SetTransparentBackground() final { ::SetTransparentBackground(nodeApi_, nodeHandle_); } - - void SetOpacity(float opacity) - { - if (!ValidateApiAndNode(nodeApi_, nodeHandle_, "BaseNode::SetOpacity")) { - return; - } - SetAttributeFloat32(nodeApi_, nodeHandle_, NODE_OPACITY, opacity); - } - - // ---------------- 事件 ---------------- - - void RegisterOnClick(const std::function &callback) { onClickCallback_ = callback; } - -protected: - virtual void OnNodeEvent(ArkUI_NodeEvent *event) - { - if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_CLICK && onClickCallback_) { - onClickCallback_(event); - } - } - - static void StaticEventReceiver(ArkUI_NodeEvent *event) - { - auto *self = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(event)); - if (IsNotNull(self)) { - self->OnNodeEvent(event); - } - } - -private: - void RegisterClickEvent() - { - if (IsNotNull(nodeApi_) && IsNotNull(nodeHandle_)) { - nodeApi_->registerNodeEvent(nodeHandle_, NODE_ON_CLICK, 0, this); - hasClickEventRegistered_ = true; - } - } - - void UnregisterClickEvent() - { - if (IsNotNull(nodeApi_) && IsNotNull(nodeHandle_) && hasClickEventRegistered_) { - nodeApi_->unregisterNodeEvent(nodeHandle_, NODE_ON_CLICK); - hasClickEventRegistered_ = false; - } - } - - void ClearChildren() { children_.clear(); } - -protected: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - ArkUI_NodeHandle nodeHandle_ = nullptr; - std::list> children_; - std::function onClickCallback_; - bool hasClickEventRegistered_ = false; -}; - -// 保活容器 -template inline std::vector> &GetKeepAliveContainer() -{ - static std::vector> keepAliveContainer; - return keepAliveContainer; -} - -#endif // ARKUINODE_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableUtils.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableUtils.cpp deleted file mode 100644 index 3f138967c5a9f9fe1b4815812132df4d6a89064b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableUtils.cpp +++ /dev/null @@ -1,425 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "ScrollableUtils.h" - -#include -#include -#include - -// ------------------------------ -// 常量 -// ------------------------------ -namespace { -constexpr int K_EDGES = 4; -constexpr int K_EDGE_TOP = 0; -constexpr int K_EDGE_RIGHT = 1; -constexpr int K_EDGE_BOTTOM = 2; -constexpr int K_EDGE_LEFT = 3; - -constexpr int K_ENABLED = 1; - -constexpr float K_PERCENT_FULL = 1.0f; - -constexpr uint32_t K_COLOR_TRANSPARENT = 0x00000000U; -constexpr float K_DEFAULT_SCROLL_BAR_WIDTH = 4.0f; -constexpr uint32_t K_DEFAULT_SCROLL_BAR_COLOR = 0x66000000U; -constexpr float K_DEFAULT_SCROLL_FRICTION = 0.015f; -constexpr int32_t K_DEFAULT_FADING_EDGE = 12; - -// 属性数组的最大容量 -constexpr int K_MAX_ATTR_VALUES = 8; - -constexpr unsigned int K_LOG_DOMAIN = 0xFF00; - -struct NodeAttrTarget { - ArkUI_NativeNodeAPI_1 *api; - ArkUI_NodeHandle node; - ArkUI_NodeAttributeType attr; - const char *debugName; -}; -} // namespace - -// ------------------------------ -// 判空 / 校验 -// ------------------------------ -bool IsValidRange(int32_t start, int32_t end, int32_t count) -{ - if (!IsValidIndex(start, count)) { - return false; - } - if (end < start) { - return false; - } - if (end > count) { - return false; - } - return true; -} - -bool ValidateApiAndNode(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, const char *functionName) -{ - if (!IsNotNull(api)) { - if (functionName != nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "%{public}s: api is null", functionName); - } - return false; - } - if (!IsNotNull(node)) { - if (functionName != nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "%{public}s: node is null", functionName); - } - return false; - } - return true; -} - -// ------------------------------ -// 通用属性设置 -// ------------------------------ -void SetAttributeFloat32(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, ArkUI_NodeAttributeType attr, float value) -{ - if (!ValidateApiAndNode(api, node, "SetAttributeFloat32")) { - return; - } - ArkUI_NumberValue numberValue{}; - numberValue.f32 = value; - - ArkUI_AttributeItem item{&numberValue, 1}; - api->setAttribute(node, attr, &item); -} - -void SetAttributeUInt32(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, ArkUI_NodeAttributeType attr, uint32_t value) -{ - if (!ValidateApiAndNode(api, node, "SetAttributeUInt32")) { - return; - } - ArkUI_NumberValue numberValue{}; - numberValue.u32 = value; - - ArkUI_AttributeItem item{&numberValue, 1}; - api->setAttribute(node, attr, &item); -} - -void SetAttributeInt32(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, ArkUI_NodeAttributeType attr, int32_t value) -{ - if (!ValidateApiAndNode(api, node, "SetAttributeInt32")) { - return; - } - ArkUI_NumberValue numberValue{}; - numberValue.i32 = value; - - ArkUI_AttributeItem item{&numberValue, 1}; - api->setAttribute(node, attr, &item); -} - -void SetAttributeString(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, ArkUI_NodeAttributeType attr, - const char *value) -{ - if (!ValidateApiAndNode(api, node, "SetAttributeString")) { - return; - } - if (!IsNotNull(value)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "SetAttributeString: value is null"); - return; - } - - ArkUI_AttributeItem item{nullptr, 0, value}; - api->setAttribute(node, attr, &item); -} - -// 设置 float 数组属性 -static void ApplyFloatArrayAttribute(const NodeAttrTarget &target, const float *values, int count) -{ - if (!ValidateApiAndNode(target.api, target.node, target.debugName)) { - return; - } - if (values == nullptr || count <= 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "%{public}s: invalid values", - target.debugName ? target.debugName : "ApplyFloatArrayAttribute"); - return; - } - - std::array buf{}; - int capped = count; - if (capped > static_cast(buf.size())) { - OH_LOG_Print(LOG_APP, LOG_WARN, K_LOG_DOMAIN, LOG_TAG, "%{public}s: count too large=%{public}d", - target.debugName ? target.debugName : "ApplyFloatArrayAttribute", count); - capped = static_cast(buf.size()); - } - for (int i = 0; i < capped; ++i) { - buf[static_cast(i)].f32 = values[i]; - } - - ArkUI_AttributeItem item{buf.data(), static_cast(capped)}; - target.api->setAttribute(target.node, target.attr, &item); -} - -// ------------------------------ -// 尺寸 / 背景 -// ------------------------------ -void SetSize(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, float width, float height) -{ - SetAttributeFloat32(api, node, NODE_WIDTH, width); - SetAttributeFloat32(api, node, NODE_HEIGHT, height); -} - -void SetSizePercent(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, float widthPercent, float heightPercent) -{ - SetAttributeFloat32(api, node, NODE_WIDTH_PERCENT, widthPercent); - SetAttributeFloat32(api, node, NODE_HEIGHT_PERCENT, heightPercent); -} - -void SetFullSize(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node) -{ - SetSizePercent(api, node, K_PERCENT_FULL, K_PERCENT_FULL); -} - -void SetBackgroundColor(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, uint32_t color) -{ - SetAttributeUInt32(api, node, NODE_BACKGROUND_COLOR, color); -} - -void SetTransparentBackground(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node) -{ - SetBackgroundColor(api, node, K_COLOR_TRANSPARENT); -} - -void SetPadding(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, const Padding &padding) -{ - const float vals[K_EDGES] = {padding.top, padding.right, padding.bottom, padding.left}; - ApplyFloatArrayAttribute(NodeAttrTarget{api, node, NODE_PADDING, "SetPadding"}, vals, K_EDGES); -} - -// ------------------------------ -// 文本 -// ------------------------------ -ArkUI_NodeHandle CreateTextNode(ArkUI_NativeNodeAPI_1 *api, const char *text) -{ - if (!IsNotNull(api) || !IsNotNull(text)) { - return nullptr; - } - - ArkUI_NodeHandle textNode = api->createNode(ARKUI_NODE_TEXT); - if (!IsNotNull(textNode)) { - return nullptr; - } - - SetAttributeString(api, textNode, NODE_TEXT_CONTENT, text); - return textNode; -} - -void SetTextStyle(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle textNode, float fontSize, uint32_t fontColor, - int32_t textAlign) -{ - if (!ValidateApiAndNode(api, textNode, "SetTextStyle")) { - return; - } - SetAttributeFloat32(api, textNode, NODE_FONT_SIZE, fontSize); - SetAttributeUInt32(api, textNode, NODE_FONT_COLOR, fontColor); - SetAttributeInt32(api, textNode, NODE_TEXT_ALIGN, textAlign); -} - -void SetTextContent(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle textNode, const char *text) -{ - SetAttributeString(api, textNode, NODE_TEXT_CONTENT, text); -} - -// ------------------------------ -// 滚动 -// ------------------------------ -void SetScrollBarStyle(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, bool visible, float width, uint32_t color) -{ - if (!ValidateApiAndNode(api, node, "SetScrollBarStyle")) { - return; - } - - int32_t displayMode = visible ? ARKUI_SCROLL_BAR_DISPLAY_MODE_AUTO : ARKUI_SCROLL_BAR_DISPLAY_MODE_OFF; - SetAttributeInt32(api, node, NODE_SCROLL_BAR_DISPLAY_MODE, displayMode); - if (visible) { - SetAttributeFloat32(api, node, NODE_SCROLL_BAR_WIDTH, width); - SetAttributeUInt32(api, node, NODE_SCROLL_BAR_COLOR, color); - } -} - -void SetDefaultScrollStyle(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node) -{ - if (!ValidateApiAndNode(api, node, "SetDefaultScrollStyle")) { - return; - } - SetScrollBarStyle(api, node, true, K_DEFAULT_SCROLL_BAR_WIDTH, K_DEFAULT_SCROLL_BAR_COLOR); - SetAttributeInt32(api, node, NODE_SCROLL_EDGE_EFFECT, ARKUI_EDGE_EFFECT_SPRING); - SetAttributeInt32(api, node, NODE_SCROLL_ENABLE_SCROLL_INTERACTION, K_ENABLED); - SetAttributeFloat32(api, node, NODE_SCROLL_FRICTION, K_DEFAULT_SCROLL_FRICTION); - SetAttributeInt32(api, node, NODE_SCROLL_NESTED_SCROLL, ARKUI_SCROLL_NESTED_MODE_SELF_FIRST); - SetAttributeInt32(api, node, NODE_SCROLL_FADING_EDGE, K_DEFAULT_FADING_EDGE); -} - -// ------------------------------ -// 异步任务 -// ------------------------------ -void PostDelayedTask(int32_t delayMs, std::function task) -{ - if (!task) { - return; - } - - int32_t safeDelayMs = delayMs; - if (safeDelayMs < 0) { - safeDelayMs = 0; - } - - std::thread worker([safeDelayMs, fn = std::move(task)]() mutable { - if (safeDelayMs > 0) { - std::this_thread::sleep_for(std::chrono::milliseconds(safeDelayMs)); - } - fn(); - }); - worker.detach(); -} - -// ------------------------------ -// N-API 工具 -// ------------------------------ -std::string GetStringFromNapi(napi_env env, napi_value value) -{ - if (!IsNotNull(env) || !IsNotNull(value)) { - return std::string(); - } - - size_t length = 0; - napi_status s0 = napi_get_value_string_utf8(env, value, nullptr, 0, &length); - if (s0 != napi_ok) { - return std::string(); - } - - std::string result(length, '\0'); - size_t written = 0; - napi_status s1 = napi_get_value_string_utf8(env, value, result.data(), length + 1, &written); - if (s1 != napi_ok) { - return std::string(); - } - - return result; -} - -bool IsNapiArray(napi_env env, napi_value value) -{ - if (!IsNotNull(env) || !IsNotNull(value)) { - return false; - } - - bool isArray = false; - napi_status status = napi_is_array(env, value, &isArray); - if (status != napi_ok) { - return false; - } - - return isArray; -} - -ArkUI_NodeContentHandle GetNodeContentFromNapi(napi_env env, napi_callback_info info) -{ - if (!IsNotNull(env) || !IsNotNull(info)) { - return nullptr; - } - - size_t argc = 1; - napi_value arg0 = nullptr; - napi_status st = napi_get_cb_info(env, info, &argc, &arg0, nullptr, nullptr); - if (st != napi_ok || argc < 1) { - return nullptr; - } - - ArkUI_NodeContentHandle content = nullptr; - OH_ArkUI_GetNodeContentFromNapiValue(env, arg0, &content); - return content; -} - -void AddNodeToContent(ArkUI_NodeContentHandle content, ArkUI_NodeHandle node) -{ - if (!IsNotNull(content) || !IsNotNull(node)) { - return; - } - OH_ArkUI_NodeContent_AddNode(content, node); -} - -// ------------------------------ -// NodeEventRegistrar -// ------------------------------ -NodeEventRegistrar::NodeEventRegistrar(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node) - : nodeApi_(api), nodeHandle_(node) -{ - if (!ValidateApiAndNode(api, node, "NodeEventRegistrar::Constructor")) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "NodeEventRegistrar: invalid api or node"); - } -} - -NodeEventRegistrar::~NodeEventRegistrar() -{ - if (!IsNotNull(nodeApi_) || !IsNotNull(nodeHandle_)) { - return; - } - for (ArkUI_NodeEventType eventType : registeredEventTypes_) { - nodeApi_->unregisterNodeEvent(nodeHandle_, eventType); - } - registeredEventTypes_.clear(); -} - -void NodeEventRegistrar::RegisterEvent(ArkUI_NodeEventType eventType, void *userData) -{ - if (!ValidateApiAndNode(nodeApi_, nodeHandle_, "NodeEventRegistrar::RegisterEvent")) { - return; - } - nodeApi_->registerNodeEvent(nodeHandle_, eventType, 0, userData); - registeredEventTypes_.push_back(eventType); -} - -void NodeEventRegistrar::RegisterMultipleEvents(std::initializer_list eventTypes, void *userData) -{ - for (ArkUI_NodeEventType eventType : eventTypes) { - RegisterEvent(eventType, userData); - } -} - -// ------------------------------ -// AdapterEventRegistrar -// ------------------------------ -AdapterEventRegistrar::AdapterEventRegistrar(ArkUI_NodeAdapterHandle adapter, void *userData, - void (*callback)(ArkUI_NodeAdapterEvent *)) - : adapterHandle_(adapter) -{ - if (!IsNotNull(adapterHandle_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "AdapterEventRegistrar: adapter is null"); - return; - } - if (!IsNotNull(callback)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "AdapterEventRegistrar: callback is null"); - return; - } - - int32_t result = OH_ArkUI_NodeAdapter_RegisterEventReceiver(adapterHandle_, userData, callback); - if (result != 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, - "AdapterEventRegistrar: failed to register event receiver, result=%{public}d", result); - } -} - -AdapterEventRegistrar::~AdapterEventRegistrar() -{ - if (IsNotNull(adapterHandle_)) { - OH_ArkUI_NodeAdapter_UnregisterEventReceiver(adapterHandle_); - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableUtils.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableUtils.h deleted file mode 100644 index d3807641a418de7050d71a470f90a215124df409..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/ScrollableUtils.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef SCROLL_UTILS_H -#define SCROLL_UTILS_H - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#ifndef LOG_TAG -#define LOG_TAG "ScrollUtils" -#endif - -// ============================== -// 判空 / 校验 -// ============================== -template -inline bool IsNotNull(const T *ptr) -{ - return ptr != nullptr; -} - -template -inline bool IsNotNull(const std::shared_ptr &ptr) -{ - return ptr != nullptr; -} - -template -inline bool IsNotNull(T *ptr) -{ - return ptr != nullptr; -} - -inline bool IsValidIndex(int32_t index, int32_t count) -{ - return (index >= 0) && (index < count); -} - -inline bool IsValidRange(int32_t start, int32_t end, int32_t count); - -bool ValidateApiAndNode(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - const char *functionName = nullptr); - -template -constexpr int ArrSize(const T (&arr)[N]) noexcept -{ - return static_cast(N); -} - -// ============================== -// 尺寸 / 背景 -// ============================== - -struct Padding { - float top {0.f}; - float right {0.f}; - float bottom {0.f}; - float left {0.f}; - - static Padding All(float v) { return Padding{v, v, v, v}; } - static Padding Symmetric(float vertical, float horizontal) - { - return Padding{vertical, horizontal, vertical, horizontal}; - } - static Padding Only(float t, float r, float b, float l) - { - return Padding{t, r, b, l}; - } -}; - -void SetSize(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, float width, float height); - -void SetSizePercent(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - float widthPercent, - float heightPercent); - -void SetFullSize(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node); - -void SetBackgroundColor(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, uint32_t color); - -void SetTransparentBackground(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node); - -void SetPadding(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node, const Padding &padding); - -// ============================== -// 通用属性设置 -// ============================== -void SetAttributeFloat32(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - ArkUI_NodeAttributeType attr, - float value); - -void SetAttributeUInt32(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - ArkUI_NodeAttributeType attr, - uint32_t value); - -void SetAttributeInt32(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - ArkUI_NodeAttributeType attr, - int32_t value); - -void SetAttributeString(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - ArkUI_NodeAttributeType attr, - const char *value); - -// ============================== -// 文本节点工具 -// ============================== -ArkUI_NodeHandle CreateTextNode(ArkUI_NativeNodeAPI_1 *api, const char *text); - -void SetTextStyle(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle textNode, - float fontSize, - uint32_t fontColor, - int32_t textAlign); - -void SetTextContent(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle textNode, const char *text); - -// ============================== -// 滚动相关 -// ============================== -void SetScrollBarStyle(ArkUI_NativeNodeAPI_1 *api, - ArkUI_NodeHandle node, - bool visible, - float width, - uint32_t color); - -void SetDefaultScrollStyle(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node); - -// ============================== -// 异步任务 -// ============================== -void PostDelayedTask(int32_t delayMs, std::function task); - -// ============================== -// N-API 工具 -// ============================== -std::string GetStringFromNapi(napi_env env, napi_value value); - -bool IsNapiArray(napi_env env, napi_value value); - -ArkUI_NodeContentHandle GetNodeContentFromNapi(napi_env env, napi_callback_info info); - -void AddNodeToContent(ArkUI_NodeContentHandle content, ArkUI_NodeHandle node); - -// ============================== -// 节点事件注册器 -// ============================== -class NodeEventRegistrar { -public: - NodeEventRegistrar(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle node); - ~NodeEventRegistrar(); - - void RegisterEvent(ArkUI_NodeEventType eventType, void *userData); - void RegisterMultipleEvents(std::initializer_list eventTypes, void *userData); - -private: - ArkUI_NativeNodeAPI_1 *nodeApi_ = nullptr; - ArkUI_NodeHandle nodeHandle_ = nullptr; - std::vector registeredEventTypes_; -}; - -// ============================== -// Adapter 事件接收器 -// ============================== -class AdapterEventRegistrar { -public: - AdapterEventRegistrar(ArkUI_NodeAdapterHandle adapter, - void *userData, - void (*callback)(ArkUI_NodeAdapterEvent *)); - ~AdapterEventRegistrar(); - -private: - ArkUI_NodeAdapterHandle adapterHandle_ = nullptr; -}; - -#endif // SCROLL_UTILS_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SliderMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SliderMaker.cpp deleted file mode 100644 index c11bef7cc0ffca6bd31da4b2ed6a60ccf2f52d84..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SliderMaker.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "baseUtils.h" -#include "SliderMaker.h" -constexpr int32_t NUM_5 = 5; -constexpr int32_t NUM_10 = 10; -constexpr int32_t NUM_20 = 20; -// 设置BlockStyle属性 -void SetSliderBlockStyleType(int32_t sliderBlockStyle, ArkUI_NodeHandle slider) -{ - ArkUI_SliderBlockStyle BlockStyleType = static_cast(sliderBlockStyle); - if (BlockStyleType == ARKUI_SLIDER_BLOCK_STYLE_DEFAULT) { // 使用默认滑块(圆形) - ArkUI_NumberValue value[] = {{.i32 = sliderBlockStyle}}; - ArkUI_AttributeItem value_item = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_BLOCK_STYLE, &value_item); - } else if (BlockStyleType == ARKUI_SLIDER_BLOCK_STYLE_IMAGE) { // 使用图片资源作为滑块 - const char *imageUrl = "./resources/base/media/640.jpg"; - ArkUI_NumberValue value[] = {{.i32 = sliderBlockStyle}}; - ArkUI_AttributeItem value_item = {value, sizeof(value) / sizeof(ArkUI_NumberValue), imageUrl}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_BLOCK_STYLE, &value_item); - } else if ( - BlockStyleType == - ARKUI_SLIDER_BLOCK_STYLE_SHAPE) { // 使用自定义形状作为滑块,这里以矩形为例展示如何设置自定义形状的滑块。 - int32_t shapeType = ARKUI_SHAPE_TYPE_RECTANGLE; - float rectangleWidth = NUM_20; - float rectangleHeight = NUM_20; - float rectangularRoundedWidth = NUM_5; - float rectangularRoundedHeight = NUM_5; - - ArkUI_NumberValue value[] = {{.i32 = sliderBlockStyle}, {.i32 = shapeType}, - {.f32 = rectangleWidth}, {.f32 = rectangleHeight}, - {.f32 = rectangularRoundedWidth}, {.f32 = rectangularRoundedHeight}}; - ArkUI_AttributeItem value_item = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_BLOCK_STYLE, &value_item); - ArkUI_NumberValue colorValue[] = {{.u32 = 0xFFFF0000}}; - ArkUI_AttributeItem colorValue_item = {colorValue, sizeof(colorValue) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_BLOCK_COLOR, &colorValue_item); // 设置滑块颜色为红色 - } -} - -// 设置方向属性 -void SetSliderDirectionType(int32_t sliderDirection, ArkUI_NodeHandle slider) -{ - ArkUI_SliderDirection sliderDirectionType = static_cast(sliderDirection); - if (sliderDirectionType == ARKUI_SLIDER_DIRECTION_VERTICAL) { // 方向为纵向 - ArkUI_NumberValue value[] = {{.i32 = sliderDirection}}; - ArkUI_AttributeItem value_item = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_DIRECTION, &value_item); - } else if (sliderDirectionType == ARKUI_SLIDER_DIRECTION_HORIZONTAL) { // 方向为横向 - ArkUI_NumberValue value[] = {{.i32 = sliderDirection}}; - ArkUI_AttributeItem value_item = {value, sizeof(value) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_DIRECTION, &value_item); - } -} - -void SetSliderStyle(int32_t sliderStyle, ArkUI_NodeHandle slider) -{ - // 设置滑块与滑轨显示样式 - int32_t ret = 0; - ArkUI_SliderStyle sliderStyleType = static_cast(sliderStyle); - if (sliderStyleType == ARKUI_SLIDER_STYLE_OUT_SET) { // 滑块在滑轨上 - ArkUI_NumberValue value0[] = {{.i32 = sliderStyle}}; - ArkUI_AttributeItem value_item0 = {value0, sizeof(value0) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_STYLE, &value_item0); - - ArkUI_NumberValue value1[] = {{.f32 = -1}}; - ArkUI_AttributeItem value_item1 = {value1, sizeof(value1) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_TRACK_THICKNESS, &value_item1); - } else if (sliderStyleType == ARKUI_SLIDER_STYLE_IN_SET) { // 滑块在滑轨内 - ArkUI_NumberValue value0[] = {{.i32 = sliderStyle}}; - ArkUI_AttributeItem value_item0 = {value0, sizeof(value0) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_STYLE, &value_item0); - - ArkUI_NumberValue value1[] = {{.f32 = NUM_5}}; - ArkUI_AttributeItem value_item1 = {value1, sizeof(value1) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_TRACK_THICKNESS, &value_item1); - } else if (sliderStyleType == ARKUI_SLIDER_STYLE_NONE) { // 无滑块 - ArkUI_NumberValue value0[] = {{.i32 = sliderStyle}}; - ArkUI_AttributeItem value_item0 = {value0, sizeof(value0) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_STYLE, &value_item0); - - ArkUI_NumberValue value1[] = {{.f32 = NUM_5}}; - ArkUI_AttributeItem value_item1 = {value1, sizeof(value1) / sizeof(ArkUI_NumberValue)}; - Manager::nodeAPI_->setAttribute(slider, NODE_SLIDER_TRACK_THICKNESS, &value_item1); - } -} - -ArkUI_NodeHandle SliderMaker::SetSliderProperties(int32_t sliderBlockStyle, int32_t sliderDirection, - int32_t sliderStyle) -{ - ArkUI_NodeHandle column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - if (!column) { - return nullptr; - } - ArkUI_NodeHandle slider = Manager::nodeAPI_->createNode(ARKUI_NODE_SLIDER); - SetSliderBlockStyleType(sliderBlockStyle, slider); - // 设置方向属性 - SetSliderDirectionType(sliderDirection, slider); - // 设置滑块与滑轨显示样式 - SetSliderStyle(sliderStyle, slider); - - Manager::nodeAPI_->addChild(column, slider); - return column; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SliderMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SliderMaker.h deleted file mode 100644 index 171e20242866d5ac4a46fb597ca01fe7b79b012a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SliderMaker.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_SLIDERMAKER_H -#define NATIVE_TYPE_SAMPLE_SLIDERMAKER_H -#include "manager.h" -class SliderMaker { -public: - SliderMaker(){}; - ~SliderMaker(){}; - - static ArkUI_NodeHandle SetSliderProperties(int32_t sliderBlockStyle, int32_t sliderDirection, - int32_t sliderStyle); -}; - -#endif //NATIVE_TYPE_SAMPLE_SLIDERMAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SwiperMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SwiperMaker.cpp deleted file mode 100644 index e1f1a9a9bddf692f7d64bed6788e9f4d544569fb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SwiperMaker.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "SwiperMaker.h" -#include "baseUtils.h" - -namespace ConstIde { - const float TEXT_WIDTH_VP = 500.0f; // 宽度 - const float TEXT_HEIGHT_VP = 200.0f; // 高度 - const uint32_t TEXT_BG_COLOR = 0xFFAFEEEE; // 淡蓝色 - const int32_t TEXT_ALIGN_CENTER = 1; // 居中 - const float TEXT_FONT_SIZE_VP = 30.0f; // 字体大小 - - const uint32_t SHOW_BACKGROUND_ENABLED = 1; - const uint32_t SHOW_SIDEBAR_MIDDLE_ENABLED = 1; - const float ARROW_BACKGROUND_SIZE = 50.0; - const uint32_t ARROW_BACKGROUND_COLOR = 0xffffffff; // 白色 - const float ARROW_SIZE = 37.5; - const uint32_t ARROW_COLOR = 0xa9a9a9; // 浅灰色 - - const float INDICATOR_START_DISTANCE_VP = 10.0; // 距左侧 - const float INDICATOR_END_DISTANCE_VP = 0.0; // 距右侧 - const float INDICATOR_TOP_DISTANCE_VP = 10.0; // 距顶部 - const float INDICATOR_BOTTOM_DISTANCE_VP = 0.0; // 距底部 - const float ITEM_WIDTH_VP = 12.0; - const float ITEM_HEIGHT_VP = 6.0; - const float SELECTED_ITEM_WIDTH_VP = 20.0; - const float SELECTED_ITEM_HEIGHT_VP = 10.0; - const uint32_t IGNORE_BOTTOM_SIZE_DISABLED = 0; // 不忽略 SetBottomPosition - const uint32_t MASK_ENABLED = 1; // 显示蒙版 - const uint32_t INDICATOR_COLOR_DEFAULT = 0xA9A9A9A9; // 灰色 - const uint32_t INDICATOR_COLOR_SELECTED = 0xFFFF0000; // 红色 - const uint32_t MAX_DISPLAY_COUNT = 6; // 有效范围 [6,9] - - const float DIGIT_INDICATOR_START_DISTANCE_VP = 10.0; // 距左侧 - const float DIGIT_INDICATOR_END_DISTANCE_VP = 0.0; // 距右侧 - const float DIGIT_INDICATOR_TOP_DISTANCE_VP = 10.0; // 距顶部 - const float DIGIT_INDICATOR_BOTTOM_DISTANCE_VP = 0.0; // 距底部 - const uint32_t DIGIT_FONT_COLOR_DEFAULT = 0xA9A9A9A9; // 淡灰色 - const uint32_t DIGIT_FONT_COLOR_SELECTED = 0xFFFF0000; // 红色 - const float DIGIT_FONT_SIZE_DEFAULT = 30.0; // 默认字体大小 - const float DIGIT_FONT_SIZE_SELECTED = 50.0; // 选中字体大小 - - const uint32_t NUMBER_0 = 0; - const uint32_t NUMBER_1 = 1; - const uint32_t NUMBER_2 = 2; - const uint32_t MARGIN_NUMBER_30 = 30; - - const uint32_t BACKGROUND_COLOR = 0x2AA1A6B1; -} // namespace ConstIde - -void SwiperMaker::createSwiperNode(ArkUI_NodeHandle &swiper) -{ - const int size = 14; - // 设置swiper内容为0,1,2…… - const char *arr[size] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"}; - - for (int j = ConstIde::NUMBER_0; j < size; j++) { - ArkUI_NodeHandle textNode = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_AttributeItem content = {.string = arr[j]}; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_CONTENT, &content); - - ArkUI_NumberValue value[] = {0}; - ArkUI_AttributeItem item = {.value = value, .size = 1}; - value[ConstIde::NUMBER_0].f32 = ConstIde::TEXT_WIDTH_VP; - Manager::nodeAPI_->setAttribute(textNode, NODE_WIDTH, &item); - value[ConstIde::NUMBER_0].f32 = ConstIde::TEXT_HEIGHT_VP; - Manager::nodeAPI_->setAttribute(textNode, NODE_HEIGHT, &item); - value[ConstIde::NUMBER_0].u32 = ConstIde::TEXT_BG_COLOR; - Manager::nodeAPI_->setAttribute(textNode, NODE_BACKGROUND_COLOR, &item); - value[ConstIde::NUMBER_0].i32 = ConstIde::TEXT_ALIGN_CENTER; - Manager::nodeAPI_->setAttribute(textNode, NODE_TEXT_ALIGN, &item); - value[ConstIde::NUMBER_0].f32 = ConstIde::TEXT_FONT_SIZE_VP; - Manager::nodeAPI_->setAttribute(textNode, NODE_FONT_SIZE, &item); - - ArkUI_AttributeItem textId = {.string = "SwiperAutoPlayText"}; - Manager::nodeAPI_->setAttribute(textNode, NODE_ID, &textId); - Manager::nodeAPI_->addChild(swiper, textNode); - } - BaseUtils::SetNodeMargin(swiper, ConstIde::MARGIN_NUMBER_30); // 设置边距宽度为30vp -} - -void SwiperMaker::SetSwiperArrowStyle(ArkUI_NodeHandle &swiper) -{ - ArkUI_SwiperArrowStyle *arrowStyle = OH_ArkUI_SwiperArrowStyle_Create(); - OH_ArkUI_SwiperArrowStyle_SetShowBackground(arrowStyle, ConstIde::SHOW_BACKGROUND_ENABLED); - OH_ArkUI_SwiperArrowStyle_SetShowSidebarMiddle(arrowStyle, ConstIde::SHOW_SIDEBAR_MIDDLE_ENABLED); - OH_ArkUI_SwiperArrowStyle_SetBackgroundSize(arrowStyle, ConstIde::ARROW_BACKGROUND_SIZE); - OH_ArkUI_SwiperArrowStyle_SetBackgroundColor(arrowStyle, ConstIde::ARROW_BACKGROUND_COLOR); - OH_ArkUI_SwiperArrowStyle_SetArrowSize(arrowStyle, ConstIde::ARROW_SIZE); - OH_ArkUI_SwiperArrowStyle_SetArrowColor(arrowStyle, ConstIde::ARROW_COLOR); - - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1, .object = arrowStyle}; - value[ConstIde::NUMBER_0].i32 = ARKUI_SWIPER_ARROW_SHOW; // default ARKUI_SWIPER_ARROW_HIDE - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_SHOW_DISPLAY_ARROW, &item); - OH_ArkUI_SwiperArrowStyle_Destroy(arrowStyle); -} - -void SwiperMaker::GetSwiperArrowStyle(ArkUI_NodeHandle swiper) -{ - auto nodeSwiperShowDisplayArrow = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_SHOW_DISPLAY_ARROW); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow NODE_SWIPER_SHOW_DISPLAY_ARROW %{public}d", - nodeSwiperShowDisplayArrow->value[ConstIde::NUMBER_0].i32); - auto arrowStyleObject = static_cast(nodeSwiperShowDisplayArrow->object); - auto iRet = OH_ArkUI_SwiperArrowStyle_GetShowBackground(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetShowBackground %{public}d", iRet); - iRet = OH_ArkUI_SwiperArrowStyle_GetShowSidebarMiddle(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetShowSidebarMiddle %{public}d", iRet); - auto fRet = OH_ArkUI_SwiperArrowStyle_GetBackgroundSize(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetBackgroundSize %{public}f", fRet); - auto uRet = OH_ArkUI_SwiperArrowStyle_GetBackgroundColor(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetBackgroundColor %{public}x", uRet); - fRet = OH_ArkUI_SwiperArrowStyle_GetArrowSize(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetArrowSize %{public}f", fRet); - uRet = OH_ArkUI_SwiperArrowStyle_GetArrowColor(arrowStyleObject); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Arrow GetArrowColor %{public}x", uRet); -} - -void SwiperMaker::SetSwiperIndicatorTypeDot(ArkUI_NodeHandle &swiper) -{ - ArkUI_SwiperIndicator *swiperIndicatorStyle = OH_ArkUI_SwiperIndicator_Create(ARKUI_SWIPER_INDICATOR_TYPE_DOT); - OH_ArkUI_SwiperIndicator_SetStartPosition(swiperIndicatorStyle, ConstIde::INDICATOR_START_DISTANCE_VP); - OH_ArkUI_SwiperIndicator_SetEndPosition(swiperIndicatorStyle, ConstIde::INDICATOR_END_DISTANCE_VP); - OH_ArkUI_SwiperIndicator_SetTopPosition(swiperIndicatorStyle, ConstIde::INDICATOR_TOP_DISTANCE_VP); - OH_ArkUI_SwiperIndicator_SetBottomPosition(swiperIndicatorStyle, ConstIde::INDICATOR_BOTTOM_DISTANCE_VP); - OH_ArkUI_SwiperIndicator_SetIgnoreSizeOfBottom(swiperIndicatorStyle, ConstIde::IGNORE_BOTTOM_SIZE_DISABLED); - OH_ArkUI_SwiperIndicator_SetItemWidth(swiperIndicatorStyle, ConstIde::ITEM_WIDTH_VP); - OH_ArkUI_SwiperIndicator_SetItemHeight(swiperIndicatorStyle, ConstIde::ITEM_HEIGHT_VP); - OH_ArkUI_SwiperIndicator_SetSelectedItemWidth(swiperIndicatorStyle, ConstIde::SELECTED_ITEM_WIDTH_VP); - OH_ArkUI_SwiperIndicator_SetSelectedItemHeight(swiperIndicatorStyle, ConstIde::SELECTED_ITEM_HEIGHT_VP); - OH_ArkUI_SwiperIndicator_SetMask(swiperIndicatorStyle, ConstIde::MASK_ENABLED); - OH_ArkUI_SwiperIndicator_SetColor(swiperIndicatorStyle, ConstIde::INDICATOR_COLOR_DEFAULT); - OH_ArkUI_SwiperIndicator_SetSelectedColor(swiperIndicatorStyle, ConstIde::INDICATOR_COLOR_SELECTED); - OH_ArkUI_SwiperIndicator_SetMaxDisplayCount(swiperIndicatorStyle, ConstIde::MAX_DISPLAY_COUNT); - - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1, .object = swiperIndicatorStyle}; - value[ConstIde::NUMBER_0].i32 = ARKUI_SWIPER_INDICATOR_TYPE_DOT; // Different enum use different objects - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_INDICATOR, &item); - - OH_ArkUI_SwiperIndicator_Dispose(swiperIndicatorStyle); -} - -void SwiperMaker::GetSwiperIndicatorTypeDot(ArkUI_NodeHandle swiper) -{ - auto nodeSwiperIndicator = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_INDICATOR); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "NODE_SWIPER_INDICATOR %{public}d", - nodeSwiperIndicator->value[ConstIde::NUMBER_0].i32); - auto swiperIndicatorStyleObject = static_cast(nodeSwiperIndicator->object); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "StartPosition: %{public}f", - OH_ArkUI_SwiperIndicator_GetStartPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "EndPosition: %{public}f", - OH_ArkUI_SwiperIndicator_GetEndPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "TopPosition: %{public}f", - OH_ArkUI_SwiperIndicator_GetTopPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "BottomPosition: %{public}f", - OH_ArkUI_SwiperIndicator_GetBottomPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "IgnoreSizeOfBottom: %{public}d", - OH_ArkUI_SwiperIndicator_GetIgnoreSizeOfBottom(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ItemWidth: %{public}f", - OH_ArkUI_SwiperIndicator_GetItemWidth(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ItemHeight: %{public}f", - OH_ArkUI_SwiperIndicator_GetItemHeight(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ItemHeight: %{public}f", - OH_ArkUI_SwiperIndicator_GetSelectedItemWidth(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "ItemHeight: %{public}f", - OH_ArkUI_SwiperIndicator_GetSelectedItemHeight(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Mask: %{public}d", - OH_ArkUI_SwiperIndicator_GetMask(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Color: %{public}x", - OH_ArkUI_SwiperIndicator_GetColor(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "SelectedColor: %{public}x", - OH_ArkUI_SwiperIndicator_GetSelectedColor(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "MaxDisplayCount: %{public}d", - OH_ArkUI_SwiperIndicator_GetMaxDisplayCount(swiperIndicatorStyleObject)); -} - -void SwiperMaker::SetSwiperIndicatorTypeDigit(ArkUI_NodeHandle &swiper) -{ - ArkUI_SwiperDigitIndicator *swiperIndicatorStyle = OH_ArkUI_SwiperDigitIndicator_Create(); - OH_ArkUI_SwiperDigitIndicator_SetStartPosition(swiperIndicatorStyle, ConstIde::DIGIT_INDICATOR_START_DISTANCE_VP); - OH_ArkUI_SwiperDigitIndicator_SetEndPosition(swiperIndicatorStyle, ConstIde::DIGIT_INDICATOR_END_DISTANCE_VP); - OH_ArkUI_SwiperDigitIndicator_SetTopPosition(swiperIndicatorStyle, ConstIde::DIGIT_INDICATOR_TOP_DISTANCE_VP); - OH_ArkUI_SwiperDigitIndicator_SetBottomPosition(swiperIndicatorStyle, ConstIde::DIGIT_INDICATOR_BOTTOM_DISTANCE_VP); - OH_ArkUI_SwiperDigitIndicator_SetFontColor(swiperIndicatorStyle, ConstIde::DIGIT_FONT_COLOR_DEFAULT); - OH_ArkUI_SwiperDigitIndicator_SetSelectedFontColor(swiperIndicatorStyle, ConstIde::DIGIT_FONT_COLOR_SELECTED); - OH_ArkUI_SwiperDigitIndicator_SetFontSize(swiperIndicatorStyle, ConstIde::DIGIT_FONT_SIZE_DEFAULT); - OH_ArkUI_SwiperDigitIndicator_SetSelectedFontSize(swiperIndicatorStyle, ConstIde::DIGIT_FONT_SIZE_SELECTED); - OH_ArkUI_SwiperDigitIndicator_SetFontWeight(swiperIndicatorStyle, ARKUI_FONT_WEIGHT_W200); - OH_ArkUI_SwiperDigitIndicator_SetSelectedFontWeight(swiperIndicatorStyle, ARKUI_FONT_WEIGHT_W700); - - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1, .object = swiperIndicatorStyle}; - value[ConstIde::NUMBER_0].i32 = ARKUI_SWIPER_INDICATOR_TYPE_DIGIT; // Different enum use different objects - Manager::nodeAPI_->setAttribute(swiper, NODE_SWIPER_INDICATOR, &item); - - OH_ArkUI_SwiperDigitIndicator_Destroy(swiperIndicatorStyle); -} - -void SwiperMaker::GetSwiperIndicatorTypeDigit(ArkUI_NodeHandle swiper) -{ - auto nodeSwiperIndicator = Manager::nodeAPI_->getAttribute(swiper, NODE_SWIPER_INDICATOR); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "NODE_SWIPER_INDICATOR %{public}d", - nodeSwiperIndicator->value[ConstIde::NUMBER_0].i32); - auto swiperIndicatorStyleObject = static_cast(nodeSwiperIndicator->object); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "StartPosition: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetStartPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "EndPosition: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetEndPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "TopPosition: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetBottomPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "BottomPosition: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetTopPosition(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "FontColor: %{public}x", - OH_ArkUI_SwiperDigitIndicator_GetFontColor(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "SelectedFontColor: %{public}x", - OH_ArkUI_SwiperDigitIndicator_GetSelectedFontColor(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "FontSize: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetFontSize(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "SelectedFontColor: %{public}f", - OH_ArkUI_SwiperDigitIndicator_GetSelectedFontSize(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "FontWeight: %{public}d", - OH_ArkUI_SwiperDigitIndicator_GetFontWeight(swiperIndicatorStyleObject)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "SelectedFontWeight: %{public}d", - OH_ArkUI_SwiperDigitIndicator_GetSelectedFontWeight(swiperIndicatorStyleObject)); -} - -ArkUI_NodeHandle SwiperMaker::createSwiperPage() -{ - static ArkUI_NodeHandle swiper1 = Manager::nodeAPI_->createNode(ARKUI_NODE_SWIPER); - static ArkUI_NodeHandle swiper2 = Manager::nodeAPI_->createNode(ARKUI_NODE_SWIPER); - static ArkUI_NodeHandle swiper3 = Manager::nodeAPI_->createNode(ARKUI_NODE_SWIPER); - ArkUI_NodeHandle scroll = Manager::nodeAPI_->createNode(ARKUI_NODE_SCROLL); - BaseUtils::SetNodeBackGroundColor(scroll, ConstIde::BACKGROUND_COLOR); // 设置节点背景颜色为淡灰色 - ArkUI_NodeHandle column = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - SwiperMaker::createSwiperNode(swiper1); - SwiperMaker::SetSwiperArrowStyle(swiper1); - SwiperMaker::GetSwiperArrowStyle(swiper1); - SwiperMaker::createSwiperNode(swiper2); - SwiperMaker::SetSwiperIndicatorTypeDot(swiper2); - SwiperMaker::GetSwiperIndicatorTypeDot(swiper2); - SwiperMaker::createSwiperNode(swiper3); - SwiperMaker::SetSwiperIndicatorTypeDigit(swiper3); - SwiperMaker::GetSwiperIndicatorTypeDigit(swiper3); - Manager::nodeAPI_->addChild(column, swiper1); - Manager::nodeAPI_->addChild(column, swiper2); - Manager::nodeAPI_->addChild(column, swiper3); - Manager::nodeAPI_->addChild(scroll, column); - return scroll; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SwiperMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SwiperMaker.h deleted file mode 100644 index 127be5e2e3eb0499a95722a3e5e0980541c7e172..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/SwiperMaker.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_SWIPERMAKER_H -#define NATIVE_TYPE_SAMPLE_SWIPERMAKER_H - -#include "manager.h" - -class SwiperMaker { -public: - SwiperMaker(){}; - ~SwiperMaker(){}; - static void createSwiperNode(ArkUI_NodeHandle &swiper); - static void SetSwiperArrowStyle(ArkUI_NodeHandle &swiper); - static void GetSwiperArrowStyle(ArkUI_NodeHandle swiper); - static void SetSwiperIndicatorTypeDot(ArkUI_NodeHandle &swiper); - static void GetSwiperIndicatorTypeDot(ArkUI_NodeHandle swiper); - static void SetSwiperIndicatorTypeDigit(ArkUI_NodeHandle &swiper); - static void GetSwiperIndicatorTypeDigit(ArkUI_NodeHandle swiper); - static ArkUI_NodeHandle createSwiperPage(); -}; - -#endif // NATIVE_TYPE_SAMPLE_SWIPERMAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/TextMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/TextMaker.cpp deleted file mode 100644 index b222d8652ddb7f5987f9f0969ca6b3dfdb2170c1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/TextMaker.cpp +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "TextMaker.h" -#include "baseUtils.h" -#include "manager.h" -#include -#include -#include -#include -#include -#include -#include - -#define LOG_TAG "manager" -#define LOG_ERROR(...) OH_LOG_Print(LOG_APP, LOG_ERROR, 0xD001400, LOG_TAG, __VA_ARGS__) -#define VALUE_0 0 -#define VALUE_1 1 -#define VALUE_30 30 -#define VALUE_50 50 -#define VALUE_200 200 -#define VALUE_300 300 -#define VALUE_350 350 -#define VALUE_1024 1024 - -constexpr int32_t ON_ERROR_CODE_DEMO_106107 = 106107; // 参数下标越界 -constexpr int32_t ON_ERROR_CODE_DEMO_106109 = 106109; // 不支持返回值 - -typedef struct { - ArkUI_NodeHandle textNode; - ArkUI_NativeNodeAPI_1 *nodeApi; -} FontChangeCtx; - -void OnSystemFontChange(ArkUI_SystemFontStyleEvent *event, void *userData) -{ - if (event == nullptr || userData == nullptr) { - return; - } - FontChangeCtx *ctx = (FontChangeCtx *)userData; - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "System font style changed!"); -} - -static void OnEventReceive(ArkUI_NodeEvent *event) -{ - if (event == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "错误码: %d", ARKUI_ERROR_CODE_NODE_EVENT_PARAM_INVALID); - return; - } - int32_t eventId = OH_ArkUI_NodeEvent_GetTargetId(event); - ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - auto nodeHandler = OH_ArkUI_NodeEvent_GetNodeHandle(event); - switch (eventId) { - // 参数下标越界 - case ON_ERROR_CODE_DEMO_106107: { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "错误码: %d", - ARKUI_ERROR_CODE_NODE_EVENT_PARAM_INDEX_OUT_OF_RANGE); - return; - } - // 不支持返回值 - case ON_ERROR_CODE_DEMO_106109: { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "错误码: %d", ARKUI_ERROR_CODE_NODE_EVENT_NO_RETURN); - return; - } - default: - break; - } -} - -void setBasicTextVal(ArkUI_NodeHandle &basicText) -{ - const char *textContent = - "这是一段包含字体样式、字重、对齐方式、不支持复制、超长时跑马灯显示、的文字,以及无障碍文本"; - ArkUI_AttributeItem contentItem = {.string = textContent}; - Manager::nodeAPI_->setAttribute(basicText, NODE_TEXT_CONTENT, &contentItem); - - // 字体样式:斜体样式(ARKUI_FONT_STYLE_ITALIC) - ArkUI_NumberValue fontStyleVal = {.i32 = ARKUI_FONT_STYLE_ITALIC}; - ArkUI_AttributeItem fontStyleItem = {&fontStyleVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_FONT_STYLE, &fontStyleItem); - - // 字重:600(ARKUI_FONT_WEIGHT_W600) - ArkUI_NumberValue fontWeightVal = {.i32 = ARKUI_FONT_WEIGHT_W600}; - ArkUI_AttributeItem fontWeightItem = {&fontWeightVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_FONT_WEIGHT, &fontWeightItem); - - // 水平对齐:首部对齐(ARKUI_TEXT_ALIGNMENT_START) - ArkUI_NumberValue hAlignVal = {.i32 = ARKUI_TEXT_ALIGNMENT_START}; - ArkUI_AttributeItem hAlignItem = {&hAlignVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_TEXT_ALIGN, &hAlignItem); - - // 垂直对齐:基线对齐(ARKUI_TEXT_VERTICAL_ALIGNMENT_BASELINE) - ArkUI_NumberValue vAlignVal = {.i32 = ARKUI_TEXT_VERTICAL_ALIGNMENT_BASELINE}; - ArkUI_AttributeItem vAlignItem = {&vAlignVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_TEXT_VERTICAL_ALIGN, &vAlignItem); - - // 文本溢出:跑马灯(ARKUI_TEXT_OVERFLOW_MARQUEE) - ArkUI_NumberValue overflowVal = {.i32 = ARKUI_TEXT_OVERFLOW_MARQUEE}; - ArkUI_AttributeItem overflowItem = {&overflowVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_TEXT_OVERFLOW, &overflowItem); - - // 省略位置:行首省略(ARKUI_ELLIPSIS_MODE_START) - ArkUI_NumberValue ellipsisVal = {.i32 = ARKUI_ELLIPSIS_MODE_START}; - ArkUI_AttributeItem ellipsisItem = {&ellipsisVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_TEXT_ELLIPSIS_MODE, &ellipsisItem); - - // 复制粘贴:不支持复制(ARKUI_COPY_OPTIONS_NONE / ARKUI_TEXT_COPY_OPTIONS_NONE) - ArkUI_NumberValue copyOptVal = {.i32 = ARKUI_COPY_OPTIONS_NONE}; - ArkUI_AttributeItem copyOptItem = {©OptVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_TEXT_COPY_OPTION, ©OptItem); -} - -void setBasicText(ArkUI_NodeHandle &textContainer) -{ - // --------------------------基础Text组件(应用文本样式枚举)-------------------------- - auto basicText = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = VALUE_200}}; - ArkUI_AttributeItem textWidthItem = {.value = textWidth, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = VALUE_30}}; - ArkUI_AttributeItem textHeightItem = {.value = textHeight, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_HEIGHT, &textHeightItem); - ArkUI_NumberValue borderWidth[] = {{.f32 = VALUE_1}}; - ArkUI_AttributeItem borderWidthItem = {.value = borderWidth, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText, NODE_BORDER_WIDTH, &borderWidthItem); - if (basicText != nullptr) { - setBasicTextVal(basicText); - // 设置无障碍文本 - ArkUI_AccessibilityValue *accessibilityVal = OH_ArkUI_AccessibilityValue_Create(); - OH_ArkUI_AccessibilityValue_SetText(accessibilityVal, "基础文本组件,包含字体样式和对齐设置"); - const char *a11yItemVal = OH_ArkUI_AccessibilityValue_GetText(accessibilityVal); - ArkUI_AttributeItem a11yItem = {.string = a11yItemVal}; - Manager::nodeAPI_->setAttribute(basicText, NODE_TEXT_CONTENT, &a11yItem); - - FontChangeCtx *ctx = (FontChangeCtx *)malloc(sizeof(FontChangeCtx)); - if (ctx != nullptr) { - ctx->textNode = basicText; - ctx->nodeApi = Manager::nodeAPI_; - int32_t ret = OH_ArkUI_RegisterSystemFontStyleChangeEvent(basicText, // 目标Text节点 - ctx, // 自定义数据(回调中传回) - OnSystemFontChange); // 字体变化回调 - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", - "Register system font event failed, code: %{public}d", ret); - free(ctx); // 注册失败释放数据 - } - } - Manager::nodeAPI_->addChild(textContainer, basicText); - } -} - -void setBasicText1(ArkUI_NodeHandle &textContainer) -{ - //--------------------------第二段text文本----------------------------------------------------- - auto basicText1 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth1[] = {{.f32 = VALUE_350}}; - ArkUI_AttributeItem textWidthItem1 = {.value = textWidth1, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText1, NODE_WIDTH, &textWidthItem1); - ArkUI_NumberValue borderWidth1[] = {{.f32 = VALUE_1}}; - ArkUI_AttributeItem borderWidthItem1 = {.value = borderWidth1, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText1, NODE_BORDER_WIDTH, &borderWidthItem1); - if (basicText1 != nullptr) { - const char *textContent = "this is a egg: case_upper、braeak_normal、max_lines_first "; - ArkUI_AttributeItem contentItem = {.string = textContent}; - Manager::nodeAPI_->setAttribute(basicText1, NODE_TEXT_CONTENT, &contentItem); - - // 文本大小写:(ARKUI_TEXT_CASE_UPPER) - ArkUI_NumberValue textCaseVal = {.i32 = ARKUI_TEXT_CASE_UPPER}; - ArkUI_AttributeItem textCaseItem = {&textCaseVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText1, NODE_TEXT_CASE, &textCaseItem); - - // 断行规则:CJK任意断行(ARKUI_WORD_BREAK_NORMAL) - ArkUI_NumberValue wordBreakVal = {.i32 = ARKUI_WORD_BREAK_NORMAL}; - ArkUI_AttributeItem wordBreakItem = {&wordBreakVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText1, NODE_TEXT_WORD_BREAK, &wordBreakItem); - - // 自适应高度:MaxLines优先(ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MAX_LINES_FIRST) - ArkUI_NumberValue adaptPolicyVal = {.i32 = ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MAX_LINES_FIRST}; - ArkUI_AttributeItem adaptPolicyItem = {&adaptPolicyVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText1, NODE_TEXT_HEIGHT_ADAPTIVE_POLICY, &adaptPolicyItem); - - // 装饰线:下划线(ARKUI_TEXT_DECORATION_TYPE_UNDERLINE) - ArkUI_NumberValue decoTypeVal = {.i32 = ARKUI_TEXT_DECORATION_TYPE_UNDERLINE}; - ArkUI_NumberValue decoStyleVal = {.i32 = ARKUI_TEXT_DECORATION_STYLE_SOLID}; - ArkUI_AttributeItem decoTypeItem = {&decoTypeVal, VALUE_1}; - ArkUI_AttributeItem decoStyleItem = {&decoStyleVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText1, NODE_TEXT_DECORATION, &decoTypeItem); - Manager::nodeAPI_->setAttribute(basicText1, NODE_TEXT_DECORATION, &decoStyleItem); - - // 添加到容器 - Manager::nodeAPI_->addChild(textContainer, basicText1); - } -} - -void setBasicText2(ArkUI_NodeHandle &textContainer) -{ - //--------------------------第三段text文本----------------------------------------------------- - auto basicText2 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth2[] = {{.f32 = VALUE_350}}; - ArkUI_AttributeItem textWidthItem2 = {.value = textWidth2, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText2, NODE_WIDTH, &textWidthItem2); - ArkUI_NumberValue textHeight1[] = {{.f32 = VALUE_50}}; - ArkUI_AttributeItem textHeight1Item = {.value = textHeight1, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText2, NODE_HEIGHT, &textHeight1Item); - ArkUI_NumberValue borderWidth2[] = {{.f32 = VALUE_1}}; - ArkUI_AttributeItem borderWidthItem2 = {.value = borderWidth2, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText2, NODE_BORDER_WIDTH, &borderWidthItem2); - - // 设置文本识别 - ArkUI_NumberValue enableDataDetector = {.i32 = true}; - ArkUI_AttributeItem enableDataDetectorItem = {.value = &enableDataDetector, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(basicText2, NODE_TEXT_ENABLE_DATA_DETECTOR, &enableDataDetectorItem); - ArkUI_NumberValue detectorConfig = {.i32 = ARKUI_TEXT_DATA_DETECTOR_TYPE_PHONE_NUMBER}; - ArkUI_AttributeItem detectorConfigItem = {.value = &detectorConfig, .size = 2}; - Manager::nodeAPI_->setAttribute(basicText2, NODE_TEXT_ENABLE_DATA_DETECTOR_CONFIG, &detectorConfigItem); - - auto testText = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - const char *testTextStr = "测试ARKUI_ERROR_CODE_INVALID_STYLED_STRING"; - ArkUI_AttributeItem testTextItem = {.string = testTextStr}; - Manager::nodeAPI_->setAttribute(testText, NODE_TEXT_CONTENT, &testTextItem); - Manager::nodeAPI_->addChild(textContainer, testText); - // 序列化过程中返回空值,会打印ARKUI_ERROR_CODE_INVALID_STYLED_STRING的值 - if (basicText2 != nullptr) { - ArkUI_StyledString_Descriptor *descriptor = OH_ArkUI_StyledString_Descriptor_Create(); - uint8_t buffer[VALUE_1024] = {VALUE_0}; - size_t resultSize = VALUE_0; - // 序列化 字节数组 - int32_t marshalResult = - OH_ArkUI_MarshallStyledStringDescriptor(buffer, sizeof(buffer), descriptor, &resultSize); - if (marshalResult != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "序列化失败%{public}d", marshalResult); - } else if (marshalResult == ARKUI_ERROR_CODE_INVALID_STYLED_STRING) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "无效的属性字符串错误码%{public}d", marshalResult); - } - const char *invalidA11yText = "序列化过程中返回值为空"; - ArkUI_AttributeItem a11yItem = {.string = invalidA11yText}; - int32_t setA11yRet = Manager::nodeAPI_->setAttribute(basicText2, NODE_TEXT_CONTENT, &a11yItem); - - Manager::nodeAPI_->addChild(textContainer, basicText2); - } -} - -void setBasicInputText(ArkUI_NodeHandle &textContainer) -{ - // --------------------------TextInput组件(单行输入框)-------------------------- - auto inputText = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - const char *inputTextStr = "单行输入框:输入框风格只支持InputType.Normal,回车newline"; - ArkUI_AttributeItem inputTextItem = {.string = inputTextStr}; - Manager::nodeAPI_->setAttribute(inputText, NODE_TEXT_CONTENT, &inputTextItem); - Manager::nodeAPI_->addChild(textContainer, inputText); - auto textInput = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT_INPUT); - if (textInput != nullptr) { - // 输入类型:基本模式(ARKUI_TEXTINPUT_TYPE_NORMAL) - ArkUI_NumberValue inputTypeVal = {.i32 = ARKUI_TEXTINPUT_TYPE_NORMAL}; - ArkUI_AttributeItem inputTypeItem = {&inputTypeVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput, NODE_TEXT_INPUT_TYPE, &inputTypeItem); - - // 回车键类型 - ArkUI_NumberValue enterKeyVal = {.i32 = ARKUI_ENTER_KEY_TYPE_NEW_LINE}; - ArkUI_AttributeItem enterKeyItem = {&enterKeyVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput, NODE_TEXT_INPUT_ENTER_KEY_TYPE, &enterKeyItem); - - // 自动填充类型 - ArkUI_NumberValue autoFillVal = {.i32 = ARKUI_TEXTINPUT_CONTENT_TYPE_USER_NAME}; - ArkUI_AttributeItem autoFillItem = {&autoFillVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput, NODE_TEXT_INPUT_CONTENT_TYPE, &autoFillItem); - - // 输入框风格 - ArkUI_NumberValue inputStyleVal = {.i32 = ARKUI_TEXTINPUT_STYLE_INLINE}; - ArkUI_AttributeItem inputStyleItem = {&inputStyleVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput, NODE_TEXT_INPUT_STYLE, &inputStyleItem); - - // 键盘样式 - ArkUI_NumberValue keyboardStyleVal = {.i32 = ARKUI_KEYBOARD_APPEARANCE_DARK_IMMERSIVE}; - ArkUI_AttributeItem keyboardStyleItem = {&keyboardStyleVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput, NODE_TEXT_INPUT_KEYBOARD_APPEARANCE, &keyboardStyleItem); - - // 添加到容器 - Manager::nodeAPI_->addChild(textContainer, textInput); - } - auto textInput2 = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT_INPUT); - // 清除按钮 - ArkUI_NumberValue cancelButton[] = {{.i32 = ARKUI_CANCELBUTTON_STYLE_CONSTANT}}; - ArkUI_AttributeItem cancelButtonItem = {cancelButton, VALUE_1}; - Manager::nodeAPI_->setAttribute(textInput2, NODE_TEXT_INPUT_CANCEL_BUTTON, &cancelButtonItem); - Manager::nodeAPI_->addChild(textContainer, textInput2); -} - -void setBasicAreaText(ArkUI_NodeHandle &textContainer) -{ - // --------------------------TextArea组件(多行输入框,应用多行输入枚举)-------------------------- - auto areaText = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - const char *areaTextStr = "多行输入框:基本模式"; - ArkUI_AttributeItem areaTextItem = {.string = areaTextStr}; - Manager::nodeAPI_->setAttribute(areaText, NODE_TEXT_CONTENT, &areaTextItem); - Manager::nodeAPI_->addChild(textContainer, areaText); - auto textArea = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT_AREA); - if (textArea != nullptr) { - // 多行输入类型:基本模式(ARKUI_TEXTAREA_TYPE_NORMAL) - ArkUI_NumberValue textAreaTypeVal = {.i32 = ARKUI_TEXTAREA_TYPE_NORMAL}; - ArkUI_NumberValue textAreaTypeVal1 = {.u32 = 0xFFFF0000}; - ArkUI_AttributeItem textAreaTypeItem = {&textAreaTypeVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(textArea, NODE_TEXT_AREA_TYPE, &textAreaTypeItem); - // 添加到容器 - Manager::nodeAPI_->addChild(textContainer, textArea); - } -} - -void setCustomSpanText(ArkUI_NodeHandle &textContainer) -{ - // -------------------------自定义段落组件(应用CustomSpan相关结构体及函数)-------------------------- - auto customSpanText = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - const char *customSpanTextStr = "自定义段落组件:"; - ArkUI_AttributeItem customSpanTextItem = {.string = customSpanTextStr}; - Manager::nodeAPI_->setAttribute(customSpanText, NODE_TEXT_CONTENT, &customSpanTextItem); - Manager::nodeAPI_->addChild(textContainer, customSpanText); - // 创建自定义段落测量信息 - ArkUI_CustomSpanMeasureInfo *measureInfo = OH_ArkUI_CustomSpanMeasureInfo_Create(); - if (measureInfo != nullptr) { - // 获取父Text组件字体大小(模拟场景) - float parentFontSize = OH_ArkUI_CustomSpanMeasureInfo_GetFontSize(measureInfo); - - // 创建自定义段落度量指标 - ArkUI_CustomSpanMetrics *metrics = OH_ArkUI_CustomSpanMetrics_Create(); - // 设置自定义段落宽度(200vp)、高度(30vp) - int32_t setWidthRet = OH_ArkUI_CustomSpanMetrics_SetWidth(metrics, 200.0f); - int32_t setHeightRet = OH_ArkUI_CustomSpanMetrics_SetHeight(metrics, 30.0f); - if (setWidthRet == ARKUI_ERROR_CODE_NO_ERROR && setHeightRet == ARKUI_ERROR_CODE_NO_ERROR) { - // 创建自定义段落绘制信息 - ArkUI_CustomSpanDrawInfo *drawInfo = OH_ArkUI_CustomSpanDrawInfo_Create(); - if (drawInfo != nullptr) { - // 获取绘制偏移量、边距等信息 - float xOffset = OH_ArkUI_CustomSpanDrawInfo_GetXOffset(drawInfo); - float lineTop = OH_ArkUI_CustomSpanDrawInfo_GetLineTop(drawInfo); - float lineBottom = OH_ArkUI_CustomSpanDrawInfo_GetLineBottom(drawInfo); - float baseline = OH_ArkUI_CustomSpanDrawInfo_GetBaseline(drawInfo); - } - // 基于自定义信息创建Text组件(模拟自定义段落渲染) - auto customSpanText = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - if (customSpanText != nullptr) { - const char *customText = "自定义段落组件:宽度200vp,高度30vp"; - ArkUI_AttributeItem customTextItem = {.string = customText}; - Manager::nodeAPI_->setAttribute(customSpanText, NODE_TEXT_CONTENT, &customTextItem); - Manager::nodeAPI_->addChild(textContainer, customSpanText); - } - // 销毁绘制信息 - OH_ArkUI_CustomSpanDrawInfo_Dispose(drawInfo); - } - // 销毁度量指标 - OH_ArkUI_CustomSpanMetrics_Dispose(metrics); - // 销毁测量信息 - OH_ArkUI_CustomSpanMeasureInfo_Dispose(measureInfo); - } -} - -void setSpanText(ArkUI_NodeHandle &textContainer) -{ - auto SpanText = Manager::nodeAPI_->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle imageSpan = Manager::nodeAPI_->createNode(ARKUI_NODE_IMAGE_SPAN); - ArkUI_AttributeItem spanUrl = {.string = "/resources/base/media/background.png"}; - ArkUI_NumberValue widthVal[VALUE_1]{}; - widthVal[VALUE_0].f32 = 30.f; - ArkUI_AttributeItem width = {.value = widthVal, .size = VALUE_1}; - ArkUI_NumberValue heightVal[VALUE_1]{}; - heightVal[VALUE_0].f32 = 30.f; - ArkUI_AttributeItem height = {.value = heightVal, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(imageSpan, NODE_WIDTH, &width); - Manager::nodeAPI_->setAttribute(imageSpan, NODE_HEIGHT, &height); - Manager::nodeAPI_->setAttribute(imageSpan, NODE_IMAGE_SPAN_SRC, &spanUrl); - ArkUI_NumberValue imageSpanVal = {.i32 = ARKUI_IMAGE_SPAN_ALIGNMENT_BASELINE}; - ArkUI_AttributeItem imageSpanValItem = {&imageSpanVal, VALUE_1}; - Manager::nodeAPI_->setAttribute(imageSpan, NODE_IMAGE_SPAN_VERTICAL_ALIGNMENT, &imageSpanValItem); - Manager::nodeAPI_->addChild(SpanText, imageSpan); - Manager::nodeAPI_->addChild(textContainer, SpanText); -} - -ArkUI_NodeHandle TextMaker::createTextPage() -{ -// 创建父容器column - ArkUI_NodeHandle textContainer = Manager::nodeAPI_->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = VALUE_300}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = VALUE_1}; - Manager::nodeAPI_->setAttribute(textContainer, NODE_WIDTH, &widthItem); - setBasicText(textContainer); - setBasicText1(textContainer); - setBasicText2(textContainer); - OnEventReceive(nullptr); - setBasicInputText(textContainer); - setBasicAreaText(textContainer); - setCustomSpanText(textContainer); - setSpanText(textContainer); - return textContainer; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/TextMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/TextMaker.h deleted file mode 100644 index bea13eb36c7d08b787a2ea5708773a62565d0890..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/TextMaker.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_TEXTMAKER_H -#define NATIVE_TYPE_SAMPLE_TEXTMAKER_H - -#include "manager.h" - -class TextMaker { -public: - TextMaker(){}; - ~TextMaker(){}; - - static ArkUI_NodeHandle createTextPage(); -}; - -#endif // NATIVE_TYPE_SAMPLE_SWIPERMAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/WaterFlowMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/WaterFlowMaker.cpp deleted file mode 100644 index cbf38fa5af2275a5948b8d868c5f36858d33708a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/WaterFlowMaker.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include - -#include - -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ArkUINodeAdapter.h" -#include "WaterFlowMaker.h" -#include "WaterFlowSection.h" - -namespace { -constexpr char K_ITEM_TITLE_PREFIX[] = "FlowItem "; -constexpr float K_FONT_SIZE = 16.0f; - -constexpr float K_MAIN_A = 120.0f; -constexpr float K_MAIN_B = 160.0f; -constexpr float K_MAIN_C = 100.0f; - -constexpr float K_WATER_FLOW_W = 400.0f; -constexpr float K_WATER_FLOW_H = 600.0f; - -constexpr int K_INIT_RESERVE = 200; -constexpr int K_INIT_SEED = 100; - -constexpr int32_t K_CROSS_COUNT = 2; -constexpr float K_COLUMN_GAP = 10.0f; -constexpr float K_ROW_GAP = 10.0f; -constexpr int32_t K_MARGIN_TOP = 12, K_MARGIN_RIGHT = 12, K_MARGIN_BOTTOM = 12, K_MARGIN_LEFT = 12; - -constexpr float K_WIDTH_PERCENT_FULL = 1.0f; -constexpr bool K_SYNC_LOAD = true; -constexpr int32_t K_CACHED_ITEM_COUNT = 24; -constexpr float K_ITEM_MAIN_MIN = 80.0f; -constexpr float K_ITEM_MAIN_MAX = 220.0f; - -constexpr int32_t K_LAYOUT_DIRECTION_RTL = 1; -constexpr int32_t K_LAYOUT_MODE_WATER_FLOW = 1; - -constexpr char K_COLUMN_TEMPLATE[] = "1fr 1fr"; -constexpr char K_ROW_TEMPLATE[] = "auto"; - -constexpr int32_t K_SCROLL_TO_INDEX = 5; -constexpr int32_t K_SCROLL_ALIGN_CENTER = static_cast(ARKUI_SCROLL_ALIGNMENT_CENTER); - -constexpr int K_AUTO_THRESHOLD = 20; -constexpr int K_AUTO_BATCH = 100; -constexpr int K_AUTO_MAX_ITEMS = 100000; - -constexpr float K_MAIN_SEQ[] = {K_MAIN_A, K_MAIN_B, K_MAIN_C}; -constexpr size_t K_MAIN_SEQ_COUNT = sizeof(K_MAIN_SEQ) / sizeof(K_MAIN_SEQ[0]); -constexpr uint32_t K_PALETTE[] = {0xFF6A5ACD, 0xFF00FFFF, 0xFF00FF7F, 0xFFDA70D6, 0xFFFFC0CB}; -constexpr size_t K_PALETTE_COUNT = sizeof(K_PALETTE) / sizeof(K_PALETTE[0]); -} // namespace - -static std::shared_ptr gNode; -static std::shared_ptr gAdapter; -static std::shared_ptr gSection; -static std::vector gItems; - -struct AutoAppendConfig { - bool enabled = true; - int threshold = K_AUTO_THRESHOLD; - int batch = K_AUTO_BATCH; - int maxItems = K_AUTO_MAX_ITEMS; - bool appending = false; - int lastSizeTriggered = -1; -}; -static AutoAppendConfig g_auto; - -/** - * 根据索引获取主轴尺寸 - * @param idx 索引值 - * @return 主轴尺寸 - */ -static inline float MainSizeByIndex(int32_t idx) -{ - if (K_MAIN_SEQ_COUNT == 0U) { - return K_MAIN_C; - } - - const size_t i = static_cast(idx) % K_MAIN_SEQ_COUNT; - return K_MAIN_SEQ[i]; -} - -/** - * 根据索引获取颜色 - * @param index 索引值 - * @return 颜色值 - */ -static inline uint32_t ColorByIndex(int index) -{ - if (K_PALETTE_COUNT == 0U) { - return 0xFFFFFFFFU; - } - - const size_t i = static_cast(index) % K_PALETTE_COUNT; - return K_PALETTE[i]; -} - -static inline void BindText(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle flowItem, int32_t index) -{ - ArkUI_NodeHandle text = api->getFirstChild(flowItem); - if (!text) { - return; - } - - SetTextContent(api, text, gItems[static_cast(index)].c_str()); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, K_FONT_SIZE); -} - -/** - * 方法描述 - * @param total 参数描述 - * @return 返回值描述 - */ -static inline bool ReachedBoundary(int total) -{ - return (total >= g_auto.maxItems) || (total == g_auto.lastSizeTriggered); -} - -static inline bool ShouldAppend(int32_t index, int total) -{ - return g_auto.enabled && !g_auto.appending && !ReachedBoundary(total) && index >= (total - g_auto.threshold); -} - -static void AppendBatchInternal(int addCount) -{ - if (!gAdapter || !gSection || !gNode || addCount <= 0) { - return; - } - - const int32_t start = static_cast(gItems.size()); - gItems.reserve(gItems.size() + static_cast(addCount)); - - for (int i = 0; i < addCount; ++i) { - gItems.emplace_back(std::string(K_ITEM_TITLE_PREFIX) + std::to_string(start + i)); - } - - gAdapter->InsertRange(start, addCount); - - const int32_t newCount = static_cast(gItems.size()); - OH_ArkUI_WaterFlowSectionOption_SetItemCount(gSection->GetSectionOptions(), 0, newCount); - - gNode->SetSection(gSection); - g_auto.lastSizeTriggered = static_cast(gItems.size()); -} - -static void MaybeAppendOnTail(int32_t index) -{ - const int total = static_cast(gItems.size()); - if (!ShouldAppend(index, total)) { - return; - } - - g_auto.appending = true; - const int remain = g_auto.maxItems - total; - const int toAdd = remain > 0 ? std::min(g_auto.batch, remain) : 0; - AppendBatchInternal(toAdd); - g_auto.appending = false; -} - -static int32_t AdapterGetTotalCount() { return static_cast(gItems.size()); } - -static uint64_t AdapterGetStableId(int32_t i) -{ - const std::string &key = gItems[static_cast(i)]; - return static_cast(std::hash{}(key)); -} - -static ArkUI_NodeHandle AdapterOnCreate(ArkUI_NativeNodeAPI_1 *api, int32_t /*index*/) -{ - if (!api) { - return nullptr; - } - - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - ArkUI_NodeHandle item = api->createNode(ARKUI_NODE_FLOW_ITEM); - api->addChild(item, text); - return item; -} - -static void AdapterOnBind(ArkUI_NativeNodeAPI_1 *api, ArkUI_NodeHandle item, int32_t index) -{ - SetAttributeFloat32(api, item, NODE_HEIGHT, MainSizeByIndex(index)); - SetAttributeFloat32(api, item, NODE_WIDTH_PERCENT, K_WIDTH_PERCENT_FULL); - SetAttributeUInt32(api, item, NODE_BACKGROUND_COLOR, ColorByIndex(index)); - BindText(api, item, index); - MaybeAppendOnTail(index); -} - -static ArkUINodeAdapter::Callbacks MakeCallbacks() -{ - ArkUINodeAdapter::Callbacks cb{}; - cb.getTotalCount = &AdapterGetTotalCount; - cb.getStableId = &AdapterGetStableId; - cb.onCreate = &AdapterOnCreate; - cb.onBind = &AdapterOnBind; - cb.onRecycle = nullptr; - return cb; -} - -static ArkUI_NodeHandle CreateFooter() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (!api) { - return nullptr; - } - - ArkUI_NodeHandle text = api->createNode(ARKUI_NODE_TEXT); - SetTextContent(api, text, "到底啦…"); - SetAttributeFloat32(api, text, NODE_FONT_SIZE, 14.0f); - - ArkUI_NodeHandle footer = api->createNode(ARKUI_NODE_FLOW_ITEM); - SetAttributeFloat32(api, footer, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, footer, NODE_HEIGHT, 48.0f); - SetAttributeUInt32(api, footer, NODE_BACKGROUND_COLOR, 0x11000000U); - api->addChild(footer, text); - return footer; -} - -static void SetupSection() -{ - ArkUI_Margin margin{K_MARGIN_TOP, K_MARGIN_RIGHT, K_MARGIN_BOTTOM, K_MARGIN_LEFT}; - - SingleSectionParams params{}; - params.itemCount = static_cast(gItems.size()); - params.crossCount = K_CROSS_COUNT; - params.colGap = K_COLUMN_GAP; - params.rowGap = K_ROW_GAP; - params.margin = margin; - params.getMainSizeByIndex = &MainSizeByIndex; - params.userData = nullptr; - params.getMainSizeByIndexWithUserData = nullptr; - - gNode->SetSingleSection(params); - gSection = gNode->GetWaterFlowSection(); -} - -static void SetupNodeAndAdapter() -{ - gNode = std::make_shared(); - gNode->SetHeight(K_WATER_FLOW_H); - gNode->SetWidth(K_WATER_FLOW_W); - gNode->SetScrollCommon(); - gNode->SetLayoutDirection(K_LAYOUT_DIRECTION_RTL); - gNode->SetColumnTemplate(K_COLUMN_TEMPLATE); - gNode->SetRowTemplate(K_ROW_TEMPLATE); - gNode->SetGaps(K_COLUMN_GAP, K_ROW_GAP); - gNode->SetCachedCount(K_CACHED_ITEM_COUNT); - gNode->SetItemConstraintSize(K_ITEM_MAIN_MIN, K_ITEM_MAIN_MAX); - gNode->SetLayoutMode(ARKUI_WATER_FLOW_LAYOUT_MODE_SLIDING_WINDOW); - gNode->SetSyncLoad(K_SYNC_LOAD); - - SetupSection(); - - if (ArkUI_NodeHandle footer = CreateFooter()) { - gNode->SetFooter(footer); - } - - gAdapter = std::make_shared(); - gAdapter->SetCallbacks(MakeCallbacks()); - gNode->SetLazyAdapter(gAdapter); - gAdapter->ReloadAllItems(); -} - -static void InitData() -{ - gItems.clear(); - gItems.reserve(static_cast(K_INIT_RESERVE)); - for (int i = 0; i < K_INIT_SEED; ++i) { - gItems.emplace_back(std::string(K_ITEM_TITLE_PREFIX) + std::to_string(i)); - } -} - -static ArkUI_NodeHandle BuildWaterFlow() -{ - InitData(); - SetupNodeAndAdapter(); - return gNode->GetWaterFlow(); -} - -ArkUI_NodeHandle WaterFlowMaker::CreateNativeNode() -{ - ArkUI_NativeNodeAPI_1 *api = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api); - if (!api) { - return nullptr; - } - - ArkUI_NodeHandle page = api->createNode(ARKUI_NODE_COLUMN); - if (!page) { - return nullptr; - } - SetAttributeFloat32(api, page, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, page, NODE_HEIGHT_PERCENT, 1.0f); - - ArkUI_NodeHandle waterflow = BuildWaterFlow(); - if (waterflow) { - SetAttributeFloat32(api, waterflow, NODE_WIDTH_PERCENT, 1.0f); - SetAttributeFloat32(api, waterflow, NODE_LAYOUT_WEIGHT, 1.0f); - - api->addChild(page, waterflow); - } - return page; -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/WaterFlowMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/WaterFlowMaker.h deleted file mode 100644 index c6cb2c7562c02c313567516062fe9978c45282a0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/WaterFlowMaker.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef WATERFLOW_MAKER_H -#define WATERFLOW_MAKER_H - -#include -#include -#include -#include -#include - -#include "ArkUINodeAdapter.h" -#include "WaterFlowSection.h" -#include "ScrollableNode.h" -#include "ScrollableUtils.h" -#include "ScrollableEvent.h" - -#ifndef LOG_TAG -#define LOG_TAG "WaterFlowMaker" -#endif - -// ===== 业务常量 ===== -constexpr unsigned int K_LOG_DOMAIN = 0xFF00; -constexpr float K_DEFAULT_SCROLL_BAR_WIDTH = 4.0f; -constexpr uint32_t K_DEFAULT_SCROLL_BAR_COLOR = 0x66000000U; -constexpr float K_DEFAULT_SCROLL_FRICTION = 0.12f; -constexpr float K_DEFAULT_FLING_SPEED_LIMIT = 2800.0f; -// 渐隐边缘尺寸 -constexpr int32_t K_DEFAULT_FADING_EDGE = 12; -// 单分组索引 -constexpr int32_t K_SINGLE_SECTION_INDEX = 0; - -// ---- 新增:单分组配置结构体 ---- -struct SingleSectionParams { - int32_t itemCount = 0; - int32_t crossCount = 1; - float colGap = 0.0f; - float rowGap = 0.0f; - ArkUI_Margin margin{}; // {top,right,bottom,left} - - // 必填:按 index 计算主轴尺寸的回调 - float (*getMainSizeByIndex)(int32_t) = nullptr; - - // 可选:带 userData 的回调 - void *userData = nullptr; - float (*getMainSizeByIndexWithUserData)(int32_t, void *) = nullptr; -}; - -class WaterFlowMaker { -public: - static ArkUI_NodeHandle CreateNativeNode(); - - WaterFlowMaker() - { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, api_); - waterFlow_ = api_->createNode(ARKUI_NODE_WATER_FLOW); - api_->addNodeEventReceiver(waterFlow_, StaticEvent); - - scrollGuard_.Bind(api_, waterFlow_, this, SCROLL_EVT_ALL); - - OH_LOG_Print(LOG_APP, LOG_INFO, K_LOG_DOMAIN, LOG_TAG, "WaterFlowNode created"); - } - - ~WaterFlowMaker() - { - scrollGuard_.Release(); - - adapter_.reset(); - section_.reset(); - waterFlow_ = nullptr; - } - - // ---- Size ---- - void SetWidth(float width) { SetAttributeFloat32(api_, waterFlow_, NODE_WIDTH, width); } - - void SetHeight(float height) { SetAttributeFloat32(api_, waterFlow_, NODE_HEIGHT, height); } - - // ---- Adapter ---- - void SetLazyAdapter(const std::shared_ptr &adapter) - { - if (adapter == nullptr) { - return; - } - ArkUI_AttributeItem item{nullptr, 0, nullptr, adapter->GetAdapter()}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_NODE_ADAPTER, &item); - adapter_ = adapter; - } - - // ---- Section ---- - void SetSection(const std::shared_ptr §ion) - { - if (section == nullptr) { - return; - } - auto *opts = section->GetSectionOptions(); - if (opts == nullptr) { - return; - } - ArkUI_NumberValue start[] = {{.i32 = K_SINGLE_SECTION_INDEX}}; - ArkUI_AttributeItem item{start, 1, nullptr, opts}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_SECTION_OPTION, &item); - section_ = section; - } - - // ---- Layout / template / gap ---- - void SetLayoutDirection(int32_t direction) - { - ArkUI_NumberValue v[] = {{.i32 = direction}}; - ArkUI_AttributeItem item{v, 1}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_LAYOUT_DIRECTION, &item); - } - - void SetColumnTemplate(const char *tpl) - { - ArkUI_AttributeItem item{nullptr, 0, tpl, nullptr}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_COLUMN_TEMPLATE, &item); - } - - void SetRowTemplate(const char *tpl) - { - ArkUI_AttributeItem item{nullptr, 0, tpl, nullptr}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_ROW_TEMPLATE, &item); - } - - void SetGaps(float colGap, float rowGap) - { - SetAttributeFloat32(api_, waterFlow_, NODE_WATER_FLOW_COLUMN_GAP, colGap); - SetAttributeFloat32(api_, waterFlow_, NODE_WATER_FLOW_ROW_GAP, rowGap); - } - - // ---- Cache / scroll / mode ---- - void SetCachedCount(int32_t count) - { - SetAttributeInt32(api_, waterFlow_, NODE_WATER_FLOW_CACHED_COUNT, count); - } - - void SetFooter(ArkUI_NodeHandle footer) - { - ArkUI_AttributeItem item{nullptr, 0, nullptr, footer}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_FOOTER, &item); - } - - void ScrollToIndex(int32_t index, int32_t align) - { - ArkUI_NumberValue v[] = {{.i32 = index}, {.i32 = align}}; - ArkUI_AttributeItem item{v, 2}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_SCROLL_TO_INDEX, &item); - } - - void SetItemConstraintSize(float mainMin, float mainMax) - { - ArkUI_NumberValue v[] = {{.f32 = mainMin}, {.f32 = mainMax}}; - ArkUI_AttributeItem item{v, 2}; - api_->setAttribute(waterFlow_, NODE_WATER_FLOW_ITEM_CONSTRAINT_SIZE, &item); - } - - void SetLayoutMode(ArkUI_WaterFlowLayoutMode mode) - { - SetAttributeInt32(api_, waterFlow_, NODE_WATER_FLOW_LAYOUT_MODE, static_cast(mode)); - } - - void SetSyncLoad(bool enabled) - { - SetAttributeInt32(api_, waterFlow_, NODE_WATER_FLOW_SYNC_LOAD, enabled ? 1 : 0); - } - - void SetScrollFriction(float f) { SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_FRICTION, f); } - - void SetFlingSpeedLimit(float limit) - { - SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_FLING_SPEED_LIMIT, limit); - } - - // ---- 通用滚动外观/行为预设 ---- - void SetScrollCommon() - { - // 滚动条外观 - SetAttributeInt32(api_, waterFlow_, NODE_SCROLL_BAR_DISPLAY_MODE, - static_cast(ARKUI_SCROLL_BAR_DISPLAY_MODE_AUTO)); - SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_BAR_WIDTH, K_DEFAULT_SCROLL_BAR_WIDTH); - SetAttributeUInt32(api_, waterFlow_, NODE_SCROLL_BAR_COLOR, K_DEFAULT_SCROLL_BAR_COLOR); - - // 交互与摩擦 - SetAttributeInt32(api_, waterFlow_, NODE_SCROLL_ENABLE_SCROLL_INTERACTION, 1); - SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_FRICTION, K_DEFAULT_SCROLL_FRICTION); - SetAttributeFloat32(api_, waterFlow_, NODE_SCROLL_FLING_SPEED_LIMIT, K_DEFAULT_FLING_SPEED_LIMIT); - - // 嵌套滚动策略 & 渐隐边缘 - SetAttributeInt32(api_, waterFlow_, NODE_SCROLL_NESTED_SCROLL, - static_cast(ARKUI_SCROLL_NESTED_MODE_SELF_FIRST)); - SetAttributeInt32(api_, waterFlow_, NODE_SCROLL_FADING_EDGE, K_DEFAULT_FADING_EDGE); - } - - ArkUI_NodeHandle GetWaterFlow() const { return waterFlow_; } - - std::shared_ptr GetWaterFlowSection() const { return section_; } - - void SetSingleSection(const SingleSectionParams &p) - { - if (!ValidateSingleSectionParams(p)) { - return; - } - - EnsureSectionSized(1); - - SectionOption opt = BuildSectionOption(p.itemCount, p.crossCount, p.colGap, p.rowGap, p.margin); - opt.onGetItemMainSizeByIndex = p.getMainSizeByIndex; - opt.userData = p.userData; - - ApplySectionOption(opt); - RegisterUserDataCallbackIfNeeded(p.userData, p.getMainSizeByIndexWithUserData); - SetSection(section_); - } - -private: - static void StaticEvent(ArkUI_NodeEvent *ev) { (void)ev; } - - static bool ValidateSingleSectionParams(const SingleSectionParams &p) - { - if (p.getMainSizeByIndex == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, "getMainSizeByIndex is null"); - return false; - } - if (p.itemCount < 0 || p.crossCount <= 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, K_LOG_DOMAIN, LOG_TAG, - "invalid counts: itemCount=%{public}d, crossCount=%{public}d", p.itemCount, p.crossCount); - return false; - } - return true; - } - - void EnsureSectionSized(int32_t sectionCount) - { - if (section_ == nullptr) { - section_ = std::make_shared(); - } - section_->Resize(sectionCount); - } - - SectionOption BuildSectionOption(int32_t itemCount, int32_t crossCount, float colGap, float rowGap, - ArkUI_Margin margin) const - { - SectionOption opt{}; - opt.itemsCount = itemCount; - opt.crossCount = crossCount; - opt.columnsGap = colGap; - opt.rowsGap = rowGap; - opt.margin = margin; - return opt; - } - - void ApplySectionOption(const SectionOption &opt) - { - section_->SetSection(section_->GetSectionOptions(), K_SINGLE_SECTION_INDEX, opt); - } - - void RegisterUserDataCallbackIfNeeded(void *userData, float (*cb)(int32_t, void *)) - { - if (userData != nullptr && cb != nullptr) { - OH_ArkUI_WaterFlowSectionOption_RegisterGetItemMainSizeCallbackByIndexWithUserData( - section_->GetSectionOptions(), K_SINGLE_SECTION_INDEX, userData, cb); - } - } - -private: - ArkUI_NativeNodeAPI_1 *api_ = nullptr; - ArkUI_NodeHandle waterFlow_ = nullptr; - std::shared_ptr section_ = nullptr; - std::shared_ptr adapter_; - - ScrollEventGuard scrollGuard_; -}; - -#endif // WATERFLOW_MAKER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/WaterFlowSection.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/WaterFlowSection.h deleted file mode 100644 index 7352f04e5663ea896c6bffaed0620ceda0d4cc35..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/WaterFlowSection.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef WATERFLOW_SECTION_H -#define WATERFLOW_SECTION_H - -#include - -struct SectionOption { - int32_t itemsCount = 0; - int32_t crossCount = 1; - float columnsGap = 0.0f; - float rowsGap = 0.0f; - ArkUI_Margin margin{0, 0, 0, 0}; // {top, right, bottom, left} - float (*onGetItemMainSizeByIndex)(int32_t) = nullptr; - void *userData = nullptr; -}; - -class WaterFlowSection { -public: - WaterFlowSection() : sectionOptions_(OH_ArkUI_WaterFlowSectionOption_Create()) {} - - ~WaterFlowSection() - { - OH_ArkUI_WaterFlowSectionOption_Dispose(sectionOptions_); - sectionOptions_ = nullptr; - } - - void Resize(int32_t size) { OH_ArkUI_WaterFlowSectionOption_SetSize(sectionOptions_, size); } - - int32_t Size() const { return OH_ArkUI_WaterFlowSectionOption_GetSize(sectionOptions_); } - - void SetSection(ArkUI_WaterFlowSectionOption *opts, int32_t index, const SectionOption &s) - { - if (opts == nullptr) { - return; - } - OH_ArkUI_WaterFlowSectionOption_SetItemCount(opts, index, s.itemsCount); - OH_ArkUI_WaterFlowSectionOption_SetCrossCount(opts, index, s.crossCount); - OH_ArkUI_WaterFlowSectionOption_SetColumnGap(opts, index, s.columnsGap); - OH_ArkUI_WaterFlowSectionOption_SetRowGap(opts, index, s.rowsGap); - OH_ArkUI_WaterFlowSectionOption_SetMargin(opts, index, s.margin.top, s.margin.right, s.margin.bottom, - s.margin.left); - if (s.onGetItemMainSizeByIndex != nullptr) { - OH_ArkUI_WaterFlowSectionOption_RegisterGetItemMainSizeCallbackByIndex(opts, index, - s.onGetItemMainSizeByIndex); - } - } - - SectionOption GetSection(ArkUI_WaterFlowSectionOption *opts, int32_t index) - { - SectionOption s{}; - if (opts == nullptr) { - return s; - } - - s.itemsCount = OH_ArkUI_WaterFlowSectionOption_GetItemCount(opts, index); - s.crossCount = OH_ArkUI_WaterFlowSectionOption_GetCrossCount(opts, index); - s.columnsGap = OH_ArkUI_WaterFlowSectionOption_GetColumnGap(opts, index); - s.rowsGap = OH_ArkUI_WaterFlowSectionOption_GetRowGap(opts, index); - s.margin = OH_ArkUI_WaterFlowSectionOption_GetMargin(opts, index); - - return s; - } - - ArkUI_WaterFlowSectionOption *GetSectionOptions() const { return sectionOptions_; } - -private: - ArkUI_WaterFlowSectionOption *sectionOptions_ = nullptr; -}; - -#endif // WATERFLOW_SECTION_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/XComponentMaker.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/XComponentMaker.cpp deleted file mode 100644 index 07cffe59ad19fcc1898a787bdd529cb37a25c3c8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/XComponentMaker.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "XComponentMaker.h" -#include "manager.h" -#include -#include -#include -#include -#include -#include -#include -#include "napi/native_api.h" -#include -#include -#include -#include - -#define ON_ERROR_CODE_DEMO_103501 103501 -#define ON_ERROR_CODE_DEMO_106104 106104 -#define COLUMN_MARGIN 10 -#define VALUEF f32 -#define VALUEU u32 -#define VALUEI i32 -#define XC_TWO 2 -#define XC_TEN 10 -#define XC_FORTY 40 -static void xOnEventReceive(ArkUI_NodeEvent *event) -{ - if (event == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "错误码: %d", ARKUI_ERROR_CODE_NODE_EVENT_PARAM_INVALID); - return; - } - int32_t eventId = OH_ArkUI_NodeEvent_GetTargetId(event); - ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - auto nodeHandler = OH_ArkUI_NodeEvent_GetNodeHandle(event); - switch (eventId) { - // XComponent状态异常 - case ON_ERROR_CODE_DEMO_103501: { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "错误码: %d", - ARKUI_ERROR_CODE_XCOMPONENT_STATE_INVALID); - return; - } - // 懒加载适配器未绑定到组件上 - case ON_ERROR_CODE_DEMO_106104: { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "manager", "错误码: %d", ARKUI_ERROR_CODE_ADAPTER_NOT_BOUND); - return; - } - default: - break; - } -} -ArkUI_NodeHandle XComponentMaker::CreateNodeHandle(const std::string &tag) -{ - ArkUI_NodeHandle xc; - ArkUI_NodeHandle XCHandle; - ArkUI_NodeHandle column = Manager::XnodeAPI->createNode(ARKUI_NODE_COLUMN); - XCHandle = Manager::XnodeAPI->createNode(ARKUI_NODE_XCOMPONENT); - ArkUI_NumberValue value_xc[] = {{.VALUEF = 200}}; - ArkUI_AttributeItem item_xc = {value_xc, 1}; - ArkUI_NumberValue valuexc[] = {480}; - ArkUI_NumberValue value1xc[] = {{.VALUEU = 15}, {.VALUEF = 15}}; - ArkUI_AttributeItem itemxc = {valuexc, 1, "changeSize"}; - ArkUI_AttributeItem item1xc = {value1xc, 2}; - Manager::XnodeAPI->setAttribute(column, NODE_WIDTH, &itemxc); - valuexc[0].VALUEF = COLUMN_MARGIN; - Manager::XnodeAPI->setAttribute(column, NODE_MARGIN, &itemxc); - xc = Manager::XnodeAPI->createNode(ARKUI_NODE_XCOMPONENT_TEXTURE); // 使用示例 - xc = Manager::XnodeAPI->createNode(ARKUI_NODE_XCOMPONENT); - valuexc[0].VALUEU = ARKUI_XCOMPONENT_TYPE_SURFACE; - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_TYPE, &itemxc); - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_ID, &itemxc); - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_SURFACE_SIZE, &item1xc); - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_SURFACE_RECT, &item1xc); - Manager::XnodeAPI->setAttribute(xc, NODE_XCOMPONENT_ENABLE_ANALYZER, &item1xc); - valuexc[0].VALUEI = ARKUI_XCOMPONENT_TYPE_TEXTURE; // 使用示例 - valuexc[0].VALUEI = ARKUI_XCOMPONENT_TYPE_SURFACE; - int32_t ret = Manager::XnodeAPI->setAttribute(XCHandle, NODE_XCOMPONENT_TYPE, &item_xc); - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "XComponent_Native", "CYC_ set NODE_XCOMPONENT_TYPE ret=%{public}d", ret); - OH_NativeXComponent *nativeXComponent = OH_NativeXComponent_GetNativeXComponent(XCHandle); - ArkUI_NumberValue value[] = {{.VALUEF = 1}}; - ArkUI_AttributeItem item = {value, 1}; - ArkUI_AttributeItem content = {.string = tag.c_str()}; - Manager::XnodeAPI->setAttribute(column, NODE_WIDTH_PERCENT, &item); - value[0].VALUEF = XC_FORTY; - Manager::XnodeAPI->setAttribute(column, NODE_HEIGHT, &item); - value[0].VALUEF = XC_TEN; - Manager::XnodeAPI->setAttribute(column, NODE_MARGIN, &item); - Manager::XnodeAPI->setAttribute(column, NODE_ID, &content); - ArkUI_NodeHandle text = Manager::XnodeAPI->createNode(ARKUI_NODE_TEXT); - content = {.string = "本实例仅展示接口的使用方法,不涉及具体图像的创建"}; - Manager::XnodeAPI->setAttribute(text, NODE_TEXT_CONTENT, &content); - Manager::XnodeAPI->registerNodeEvent(column, NODE_ON_CLICK, 1, nullptr); - Manager::XnodeAPI->addChild(column, text); - Manager::XnodeAPI->addChild(column, XCHandle); - Manager::XnodeAPI->addChild(column, xc); - xOnEventReceive(nullptr); //test - return column; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/XComponentMaker.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/XComponentMaker.h deleted file mode 100644 index ae5b82132d639820debbc966ef3fe0b008448776..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/XComponentMaker.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_XCOMPONENTMAKER_H -#define NATIVE_TYPE_SAMPLE_XCOMPONENTMAKER_H - -#include "manager.h" - -class XComponentMaker { -public: - XComponentMaker(){}; - ~XComponentMaker(){}; - - static ArkUI_NodeHandle CreateNodeHandle(const std::string &tag); -}; - -#endif diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/baseUtils.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/baseUtils.cpp deleted file mode 100644 index eab2a0f5f267fab2008cf75b129bbeabdfdd2b53..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/baseUtils.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "baseUtils.h" -#include "SwiperMaker.h" - -namespace ConstIde { - const uint32_t NUMBER_0 = 0; - const uint32_t NUMBER_1 = 1; - const uint32_t NUMBER_2 = 2; - const uint32_t MARGIN_NUMBER_30 = 30; -} - -void BaseUtils::SetNodeMargin(ArkUI_NodeHandle &node, float margin) -{ - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1}; - value[ConstIde::NUMBER_0].f32 = margin; - Manager::nodeAPI_->setAttribute(node, NODE_MARGIN, &item); -} - -void BaseUtils::SetNodeBackGroundColor(ArkUI_NodeHandle &node, uint32_t color) -{ - ArkUI_NumberValue value[ConstIde::NUMBER_1]; - ArkUI_AttributeItem item = {.value = value, .size = ConstIde::NUMBER_1}; - value[ConstIde::NUMBER_0].u32 = color; - Manager::nodeAPI_->setAttribute(node, NODE_BACKGROUND_COLOR, &item); -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/baseUtils.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/baseUtils.h deleted file mode 100644 index c8be5afa4c7c96d341c4c8bc53294e9b5d1d643a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/baseUtils.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_TYPE_SAMPLE_BASEUTILS_H -#define NATIVE_TYPE_SAMPLE_BASEUTILS_H - -#include "manager.h" -#include - -class BaseUtils { -public: - BaseUtils() {} - ~BaseUtils() {} - static void SetNodeMargin(ArkUI_NodeHandle &node, float margin); - static void SetNodeBackGroundColor(ArkUI_NodeHandle &node, uint32_t color); -}; - -#endif // NATIVE_TYPE_SAMPLE_BASEUTILS_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/manager.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/manager.cpp deleted file mode 100644 index 0b00be632b2a84c8a7c89af4dd24cd6ce54e7adb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,641 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "manager.h" -#include "ArkUIAnimationNode.h" -#include "ArkUIVisualEffectsNode.h" -#include "ButtonMaker.h" -#include "SliderMaker.h" -#include "GridMaker.h" -#include "ListMaker.h" -#include "RefreshMaker.h" -#include "ScrollMaker.h" -#include "SwiperMaker.h" -#include "PublicEvent.h" -#include "CheckboxShapeMaker.h" -#include "HoverModeAreaTypeMaker.h" -#include "TextMaker.h" -#include "AccessibilityMaker.h" -#include "EmbeddedComponentMaker.h" -#include "WaterFlowMaker.h" -#include "baseUtils.h" -#include "napi/native_api.h" -#include "XComponentMaker.h" -#include -#include -#include -#include -#include -#include -#include - -namespace ConstIde { - const uint32_t NUMBER_0 = 0; - const uint32_t NUMBER_1 = 1; - const uint32_t NUMBER_2 = 2; - const uint32_t NUMBER_3 = 3; - const uint32_t NUMBER_4 = 4; - const uint32_t MARGIN_NUMBER_30 = 30; -} - -Manager Manager::manager_; -ArkUI_NativeNodeAPI_1 *Manager::nodeAPI_ = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - -napi_value Manager::CreateNativeSwiperNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = SwiperMaker::createSwiperPage(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateNativeTextNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = TextMaker::createTextPage(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value createNativeRootAnimation1(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateAnimationFrameNode1(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootAnimation2(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateAnimationFrameNode2(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootAnimation3(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateAnimeteto(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootAnimation4(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateAnimator(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootAnimation5(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateTransitionEffect(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects1(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode1(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects2(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode2(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value createNativeRootVisualEffects3(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - Manager::GetInstance()->SetContentHandle(contentHandle); - - auto column = NativeModule::CreateVisualEffectsFrameNode3(); - Manager::GetInstance()->SetRootNode(column); - return nullptr; -} - -napi_value DestroyNativeRoot(napi_env env, napi_callback_info info) -{ - Manager::GetInstance()->DisposeRootNode(); - return nullptr; -} - -napi_value Manager::CreateNativeAccessibilityNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = AccessibilityMaker::CreateNativeNode(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateNativeEmbeddedComponentNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = EmbeddedComponentMaker::CreateNativeNode(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateWaterFlowNativeNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = WaterFlowMaker::CreateNativeNode(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateGridNativeNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = GridMaker::CreateNativeNode(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateScrollNativeNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = ScrollMaker::CreateNativeNode(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateRefreshNativeNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = RefreshMaker::CreateNativeNode(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateListNativeNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = ListMaker::CreateNativeNode(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -ArkUI_NativeNodeAPI_1 *Manager::XnodeAPI = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - -napi_value Manager::createNativeXComponentNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argc = 2; - napi_value args[2] = {nullptr, nullptr}; - if (napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - if (argc != 1 + 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - ArkUI_NodeContentHandle nodeContentHandle_ = nullptr; - int32_t ret = OH_ArkUI_NodeContent_SetUserData(nodeContentHandle_, - new int32_t(123)); - void *userDataNull = - OH_ArkUI_NodeContent_GetUserData(nodeContentHandle_); // 非法获取,返回空指针 - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &nodeContentHandle_); - - if (XnodeAPI == nullptr) { - return nullptr; - } - if (XnodeAPI->createNode == nullptr || XnodeAPI->addChild == nullptr) { - return nullptr; - } - auto nodeContentEvent = [](ArkUI_NodeContentEvent *event) { - ArkUI_NodeContentHandle handle = OH_ArkUI_NodeContentEvent_GetNodeContentHandle(event); - std::string *userData = reinterpret_cast(OH_ArkUI_NodeContent_GetUserData(handle)); - if (OH_ArkUI_NodeContentEvent_GetEventType(event) == NODE_CONTENT_EVENT_ON_ATTACH_TO_WINDOW) { - ArkUI_NodeHandle testNode; - if (userData) { - testNode = XComponentMaker::CreateNodeHandle(*userData); - } else { - testNode = XComponentMaker::CreateNodeHandle("noUserData"); - } - OH_ArkUI_NodeContent_InsertNode(handle, testNode, 0); // 接口使用示例 - OH_ArkUI_NodeContent_RemoveNode(handle, testNode); - OH_ArkUI_NodeContent_AddNode(handle, testNode); - } else { - if (userData) { - delete userData; - userData = nullptr; - } - } - }; - OH_ArkUI_NodeContent_RegisterCallback(nodeContentHandle_, nodeContentEvent); - - return nullptr; -} - -napi_value Manager::CreateNativeCheckboxShapePage(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_2; - napi_value args[ConstIde::NUMBER_2] = {nullptr, 0}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - int32_t type; - napi_get_value_int32(env, args[1], &type); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = CheckboxShapeMaker::SetCheckboxProperties(type); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateHoverModeAreaTypePage(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argCnt = ConstIde::NUMBER_2; - napi_value args[ConstIde::NUMBER_2] = {nullptr, 0}; - - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - int32_t type; - napi_get_value_int32(env, args[1], &type); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = HoverModeAreaTypeMaker::SetHoverModeAreaType(type); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateNativeButtonNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_2; - napi_value args[ConstIde::NUMBER_2] = {nullptr, 0}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - int32_t type = ConstIde::NUMBER_0; - napi_get_value_int32(env, args[ConstIde::NUMBER_1], &type); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = ButtonMaker::SetButtonProperties(type); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::CreateNativeSliderNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_4; - napi_value args[ConstIde::NUMBER_4] = {nullptr, 0, 0, 0}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - int32_t blockStyle = ConstIde::NUMBER_0; - napi_get_value_int32(env, args[ConstIde::NUMBER_1], &blockStyle); - int32_t direction = ConstIde::NUMBER_0; - napi_get_value_int32(env, args[ConstIde::NUMBER_2], &direction); - int32_t style = ConstIde::NUMBER_0; - napi_get_value_int32(env, args[ConstIde::NUMBER_3], &style); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = SliderMaker::SetSliderProperties(blockStyle, direction, style); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} - -napi_value Manager::createPublicNativeNode(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode BEGIN"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = ConstIde::NUMBER_1; - napi_value args[ConstIde::NUMBER_1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - ArkUI_NodeContentHandle nodeContentHandle = nullptr; - - OH_ArkUI_GetNodeContentFromNapiValue(env, args[ConstIde::NUMBER_0], &nodeContentHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "OH_ArkUI_GetBasicNodeAPI after"); - if (nodeAPI_ != nullptr) { - if (nodeAPI_->createNode != nullptr && nodeAPI_->addChild != nullptr) { - ArkUI_NodeHandle testNode = PublicMaker::CreateNativeNode(); - OH_ArkUI_NodeContent_AddNode(nodeContentHandle, testNode); - } - } - return nullptr; -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/manager.h b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/manager.h deleted file mode 100644 index 8620b36d23d2a60cc4bfda7964e6e070bc49eeec..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_NODE_NAPI_SAMPLE_MANAGER_H -#define NATIVE_NODE_NAPI_SAMPLE_MANAGER_H -#include "ArkUIBaseNode.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; -napi_value createNativeRootAnimation1(napi_env env, napi_callback_info info); -napi_value createNativeRootAnimation2(napi_env env, napi_callback_info info); -napi_value createNativeRootAnimation3(napi_env env, napi_callback_info info); -napi_value createNativeRootAnimation4(napi_env env, napi_callback_info info); -napi_value createNativeRootAnimation5(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects1(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects2(napi_env env, napi_callback_info info); -napi_value createNativeRootVisualEffects3(napi_env env, napi_callback_info info); -napi_value DestroyNativeRoot(napi_env env, napi_callback_info info); - -class Manager { -public: - static ArkUI_NativeNodeAPI_1 *nodeAPI_; - static ArkUI_NativeNodeAPI_1 *XnodeAPI; - ~Manager(){}; - static Manager *GetInstance() - { - static Manager nativeEntry; - return &nativeEntry; - } - - void SetContentHandle(ArkUI_NodeContentHandle handle) - { - handle_ = handle; - } - - void SetRootNode(const std::shared_ptr &baseNode) - { - root_ = baseNode; - OH_ArkUI_NodeContent_AddNode(handle_, root_->GetHandle()); - } - void DisposeRootNode() - { - OH_ArkUI_NodeContent_RemoveNode(handle_, root_->GetHandle()); - root_.reset(); - } - - static napi_value CreateNativeSwiperNode(napi_env env, napi_callback_info info); - static napi_value CreateNativeTextNode(napi_env env, napi_callback_info info); - static napi_value CreateNativeAccessibilityNode(napi_env env, napi_callback_info info); - static napi_value CreateNativeEmbeddedComponentNode(napi_env env, napi_callback_info info); - static napi_value CreateWaterFlowNativeNode(napi_env env, napi_callback_info info); - static napi_value CreateGridNativeNode(napi_env env, napi_callback_info info); - static napi_value CreateScrollNativeNode(napi_env env, napi_callback_info info); - static napi_value CreateRefreshNativeNode(napi_env env, napi_callback_info info); - static napi_value CreateListNativeNode(napi_env env, napi_callback_info info); - static napi_value createNativeXComponentNode(napi_env env, napi_callback_info info); - static napi_value CreateNativeButtonNode(napi_env env, napi_callback_info info); - static napi_value CreateNativeSliderNode(napi_env env, napi_callback_info info); - static napi_value CreateNativeCheckboxShapePage(napi_env env, napi_callback_info info); - static napi_value CreateHoverModeAreaTypePage(napi_env env, napi_callback_info info); - static napi_value createPublicNativeNode(napi_env env, napi_callback_info info); - -private: - static Manager manager_; - std::shared_ptr root_; - ArkUI_NodeContentHandle handle_; -}; - -#endif // NATIVE_NODE_NAPI_SAMPLE_MANAGER_H diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index c2341b5738a0b7d0fb96ddb747cb0a0d2c077161..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "manager.h" -#include "NodeManager.h" -#include -#include -#include -#include - -constexpr int32_t NUM_2 = 2; -constexpr int32_t NUM_3 = 3; -constexpr int32_t NUM_4 = 4; -constexpr int32_t NUM_5 = 5; - -static napi_value CreateProgress(napi_env env, napi_callback_info info) -{ - NodeManager::GetInstance().CreateProgress(); - return nullptr; -} - -static napi_value CreateTextPickerWithCustomContent(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value argv[1]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - int32_t type; - napi_get_value_int32(env, argv[0], &type); - NodeManager::GetInstance().CreateTextPickerWithCustomContent(type); - return nullptr; -} - -static napi_value SetProgressLinearStyleOption(napi_env env, napi_callback_info info) -{ - size_t argc = NUM_4; - napi_value argv[NUM_4]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - bool scanEffect; - napi_get_value_bool(env, argv[0], &scanEffect); - bool smoothEffect; - napi_get_value_bool(env, argv[1], &smoothEffect); - int32_t strokeWidth; - napi_get_value_int32(env, argv[NUM_2], &strokeWidth); - int32_t strokeRadius; - napi_get_value_int32(env, argv[NUM_3], &strokeRadius); - NodeManager::GetInstance().SetProgressLinearStyleOption(scanEffect, smoothEffect, strokeWidth, strokeRadius); - return nullptr; -} - -static napi_value CreateImageAnimatorFromString(napi_env env, napi_callback_info info) -{ - size_t argc = NUM_5; - napi_value argv[NUM_5]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - int32_t width; - napi_get_value_int32(env, argv[0], &width); - int32_t height; - napi_get_value_int32(env, argv[1], &height); - int32_t top; - napi_get_value_int32(env, argv[NUM_2], &top); - int32_t left; - napi_get_value_int32(env, argv[NUM_3], &left); - int32_t duration; - napi_get_value_int32(env, argv[NUM_4], &duration); - NodeManager::GetInstance().CreateImageAnimatorFromString(width, height, top, left, duration); - return nullptr; -} - -static napi_value CreateImageAnimatorFromDrawableDescriptor(napi_env env, napi_callback_info info) -{ - size_t argc = NUM_5; - napi_value argv[NUM_5]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - int32_t width; - napi_get_value_int32(env, argv[0], &width); - int32_t height; - napi_get_value_int32(env, argv[1], &height); - int32_t top; - napi_get_value_int32(env, argv[NUM_2], &top); - int32_t left; - napi_get_value_int32(env, argv[NUM_3], &left); - int32_t duration; - napi_get_value_int32(env, argv[NUM_4], &duration); - NodeManager::GetInstance().CreateImageAnimatorFromDrawableDescriptor(width, height, top, left, duration); - return nullptr; -} - -static napi_value GetProgressLinearStyleOptionAndDestroy(napi_env env, napi_callback_info info) -{ - napi_value result; - auto styleOption = NodeManager::GetInstance().GetProgressLinearStyleOptionAndDestroy(); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "CustomDialogTest", "napiResult = %{public}s", styleOption.c_str()); - napi_create_string_utf8(env, styleOption.c_str(), NAPI_AUTO_LENGTH, &result); - return result; -} - -static napi_value GetImageAnimatorFrameInfo(napi_env env, napi_callback_info info) -{ - napi_value result; - auto styleOption = NodeManager::GetInstance().GetImageAnimatorFrameInfo(); - OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00, "CustomDialogTest", "napiResult = %{public}s", styleOption.c_str()); - napi_create_string_utf8(env, styleOption.c_str(), NAPI_AUTO_LENGTH, &result); - return result; -} - -static napi_value SetProgressType(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value argv[1]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - int32_t type; - napi_get_value_int32(env, argv[0], &type); - NodeManager::GetInstance().SetProgressType(type); - return nullptr; -} - -static napi_value SetProgressValue(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value argv[1]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - int32_t value; - napi_get_value_int32(env, argv[0], &value); - NodeManager::GetInstance().SetProgressValue(value); - return nullptr; -} - -static napi_value CreateDatePicker(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value argv[1]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - int32_t type; - napi_get_value_int32(env, argv[0], &type); - NodeManager::GetInstance().CreateDatePicker(type); - return nullptr; -} - -static napi_value CreateCalendarPicker(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value argv[1]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - int32_t type; - napi_get_value_int32(env, argv[0], &type); - NodeManager::GetInstance().CreateCalendarPicker(type); - return nullptr; -} - -static napi_value CreateImageSize(napi_env env, napi_callback_info info) -{ - size_t argc = NUM_2; - napi_value argv[NUM_2]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - int32_t fit; - napi_get_value_int32(env, argv[0], &fit); - int32_t size; - napi_get_value_int32(env, argv[1], &size); - NodeManager::GetInstance().CreateImageSize(fit, size); - return nullptr; -} - -static napi_value SetImageProperties(napi_env env, napi_callback_info info) -{ - size_t argc = NUM_3; - napi_value argv[NUM_3]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - int32_t repeat; - napi_get_value_int32(env, argv[0], &repeat); - int32_t interpolation; - napi_get_value_int32(env, argv[1], &interpolation); - int32_t mode; - napi_get_value_int32(env, argv[NUM_2], &mode); - NodeManager::GetInstance().SetImageProperties(repeat, interpolation, mode); - return nullptr; -} - -static napi_value SetContentHandle(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "nativeTypeSample", "CreateNativeNode napi_get_cb_info failed"); - return nullptr; - } - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - NodeManager::GetInstance().SetContentHandle(contentHandle); - return nullptr; -} - -static napi_value SetUpTextCrossLanguage(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value argv[1]; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - - bool isCross; - napi_get_value_bool(env, argv[0], &isCross); - NodeManager::GetInstance().SetUpTextCrossLanguage(isCross); - return nullptr; -} - -static napi_value ClearNodes(napi_env env, napi_callback_info info) -{ - NodeManager::GetInstance().ClearNodes(); - return nullptr; -} -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"createNativeRootAnimation1", nullptr, createNativeRootAnimation1, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootAnimation2", nullptr, createNativeRootAnimation2, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootAnimation3", nullptr, createNativeRootAnimation3, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootAnimation4", nullptr, createNativeRootAnimation4, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootAnimation5", nullptr, createNativeRootAnimation5, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects1", nullptr, createNativeRootVisualEffects1, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects2", nullptr, createNativeRootVisualEffects2, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeRootVisualEffects3", nullptr, createNativeRootVisualEffects3, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"destroyNativeRoot", nullptr, DestroyNativeRoot, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeTextNode", nullptr, Manager::CreateNativeTextNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createNativeSwiperNode", nullptr, Manager::CreateNativeSwiperNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createNativeAccessibilityNode", nullptr, Manager::CreateNativeAccessibilityNode, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"createNativeEmbeddedComponentNode", nullptr, Manager::CreateNativeEmbeddedComponentNode, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"createWaterFlowNativeNode", nullptr, Manager::CreateWaterFlowNativeNode, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"createGridNativeNode", nullptr, Manager::CreateGridNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createScrollNativeNode", nullptr, Manager::CreateScrollNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createRefreshNativeNode", nullptr, Manager::CreateRefreshNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createListNativeNode", nullptr, Manager::CreateListNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createNativeNodexc", nullptr, Manager::createNativeXComponentNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createNativeButtonNode", nullptr, Manager::CreateNativeButtonNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createNativeSliderNode", nullptr, Manager::CreateNativeSliderNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createNativeCheckboxShapePage", nullptr, Manager::CreateNativeCheckboxShapePage, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"createHoverModeAreaTypePage", nullptr, Manager::CreateHoverModeAreaTypePage, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"createPublicNativeNode", nullptr, Manager::createPublicNativeNode, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"createProgress", nullptr, CreateProgress, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createTextPickerWithCustomContent", nullptr, CreateTextPickerWithCustomContent, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"setProgressType", nullptr, SetProgressType, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setProgressValue", nullptr, SetProgressValue, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setImageProperties", nullptr, SetImageProperties, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createDatePicker", nullptr, CreateDatePicker, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createCalendarPicker", nullptr, CreateCalendarPicker, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createImageSize", nullptr, CreateImageSize, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setProgressLinearStyleOption", nullptr, SetProgressLinearStyleOption, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"getProgressLinearStyleOptionAndDestroy", nullptr, GetProgressLinearStyleOptionAndDestroy, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"getImageAnimatorFrameInfo", nullptr, GetImageAnimatorFrameInfo, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"setContentHandle", nullptr, SetContentHandle, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"setUpTextCrossLanguage", nullptr, SetUpTextCrossLanguage, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"clearNodes", nullptr, ClearNodes, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createImageAnimatorFromDrawableDescriptor", nullptr, CreateImageAnimatorFromDrawableDescriptor, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createImageAnimatorFromString", nullptr, CreateImageAnimatorFromString, nullptr, nullptr, nullptr, - napi_default, nullptr}, - // 参考新增其他createNative方法和Maker类 - }; - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - return exports; -} -EXTERN_C_END -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index a9d44283f238eff0d59805c5f08cf38340d1850a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const createNativeSwiperNode: (content: Object) =>void; -export const createNativeTextNode: (content: Object) =>void; -export const createNativeRootAnimation1: (content: Object) => void; -export const createNativeRootAnimation2: (content: Object) => void; -export const createNativeRootAnimation3: (content: Object) => void; -export const createNativeRootAnimation4: (content: Object) => void; -export const createNativeRootAnimation5: (content: Object) => void; -export const createNativeRootVisualEffects1: (content: Object) => void; -export const createNativeRootVisualEffects2: (content: Object) => void; -export const createNativeRootVisualEffects3: (content: Object) => void; -export const destroyNativeRoot: () => void; -export const createNativeAccessibilityNode: (content: Object) => void; -export const createNativeEmbeddedComponentNode: (content: Object) => void; -export const createWaterFlowNativeNode: (content: Object) => void; -export const createGridNativeNode: (content: Object) => void; -export const createScrollNativeNode: (content: Object) => void; -export const createRefreshNativeNode: (content: Object) => void; -export const createListNativeNode: (content: Object) => void; -export const createNativeCheckboxShapePage: (content: Object, type: number) => void; -export const createHoverModeAreaTypePage: (content: Object, type: number) => void; -export const createNativeButtonNode: (content: Object, type: number) => void; -export const createNativeSliderNode: (content: Object, sliderBlockStyle: number, sliderDirection: number, sliderStyle: number) => void; -export const createNativeNodexc: (content: Object, tag: string) => void; -export const createPublicNativeNode: (content: Object) => void; -export const createProgress: () =>void; -export const createTextPickerWithCustomContent: (type: number) =>void; -export const setProgressType: (type: number) =>void; -export const setProgressValue: (value: number) =>void; -export const createDatePicker: (type: number) =>void; -export const createCalendarPicker: (type: number) =>void; -export const createImageSize: (fit: number, size: number) =>void; -export const setImageProperties: (repeat: number, interpolation: number, mode: number) =>void; -export const setProgressLinearStyleOption: (scanEffect: boolean, - smoothEffect: boolean, strokeWidth: number, strokeRadius: number) =>void; -export const createImageAnimatorFromDrawableDescriptor: (width: number, - height: number, top: number, left: number, duration: number) =>void; -export const createImageAnimatorFromString: (width: number, - height: number, top: number, left: number, duration: number) =>void; -export const getProgressLinearStyleOptionAndDestroy: () =>string; -export const getImageAnimatorFrameInfo: () =>string; -export const setContentHandle: (content: Object) =>void; -export const setUpTextCrossLanguage: (isCross: boolean) =>void; -export const clearNodes: () =>void; \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NativeTypeSample/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index b81656fe96ca09694282eed65e33f57ddc1d2a05..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6678a198c2f39c9309ca7c3e5a9f36999ce001f7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2025 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 { BusinessError } from '@kit.BasicServicesKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; -const BACKGROUND_COLOR = '#2AA1A6B1' -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - let windowClass: window.Window | undefined = undefined; - windowStage.getMainWindow((err: BusinessError, data) => { - const errCode: number = err.code; - if (errCode) { - console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`); - return; - } - windowClass = data; - let systemBarProperties: window.SystemBarProperties = { - statusBarColor: BACKGROUND_COLOR, - navigationBarColor: BACKGROUND_COLOR, - //以下两个属性从API Version8开始支持 - }; - try { - let promise = windowClass.setWindowSystemBarProperties(systemBarProperties); - promise.then(() => { - console.info('Succeeded in setting the system bar properties.'); - }).catch((err: BusinessError) => { - console.error(`Failed to set the system bar properties. Cause code: ${err.code}, message: ${err.message}`); - }); - } catch (exception) { - console.error(`Failed to set the system bar properties. Cause code: ${exception.code}, message: ${exception.message}`); - } - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b37e4b57cd7849ab462574297ff70345c2132ab2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/extensionAbility/SampleEmbeddedAbility.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/extensionAbility/SampleEmbeddedAbility.ets deleted file mode 100644 index e1f327c40a2d8d67f76ef0d9d3ccd6e7bbf1c247..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/extensionAbility/SampleEmbeddedAbility.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 { EmbeddedUIExtensionAbility, UIExtensionContentSession, Want } from '@kit.AbilityKit' - -export default class SampleEmbeddedAbility extends EmbeddedUIExtensionAbility { - onForeground() { - this.context.terminateSelf() - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 8389e634a2d5dcb69b6958fa9dd28417dee58d1e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2025 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 { router } from '@kit.ArkUI'; - -interface ListCategories { - title: string, - url: string -} - -@Entry -@Component -struct MenuIndex { - private items: ListCategories[] = - [ - { title: 'Swiper', url: 'pages/page_swiper' }, - { title: 'text', url: 'pages/page_text' }, - { title: 'Animation', url: 'pages/page_animation' }, - { title: 'Visual Effects', url: 'pages/page_visual_effects' }, - { title: 'accessibility', url: 'pages/page_accessibility' }, - { title: 'embedded component', url: 'pages/page_embedded_component' }, - { title: 'WaterFlow', url: 'pages/page_waterflow' }, - { title: 'Grid', url: 'pages/page_grid' }, - { title: 'Scroll', url: 'pages/page_scroll' }, - { title: 'Refresh', url: 'pages/page_refresh' }, - { title: 'List', url: 'pages/page_list' }, - { title: 'Button', url: 'pages/page_button' }, - { title: 'Slider', url: 'pages/page_slider' }, - { title: 'CheckboxShape', url: 'pages/page_checkbox_shape' }, - { title: 'HoverModeAreaType', url: 'pages/page_hovermode_areatype' }, - { title: 'Public', url: 'pages/page_public_event' }, - { title: 'XComponent', url: 'pages/page_xcomponent' }, - { title: 'Progress', url: 'pages/page_progress' }, - { title: 'DatePicker', url: 'pages/page_date_picker' }, - { title: 'Image', url: 'pages/page_image' }, - { title: 'TextPicker', url: 'pages/page_text_picker' }, - { title: 'CalendarPicker', url: 'pages/page_calendar_picker' }, - { title: 'ImageAnimator', url: 'pages/page_image_animator' }, - ]; - - build() { - Scroll(new Scroller()) { - Column() { - Text('native_type_sample') - .fontWeight(FontWeight.Bold) - .fontSize('20vp') - .textAlign(TextAlign.Center) - .height('5%') - .margin($r('sys.float.titlebar_title_margin_right')) - List() { - ForEach(this.items, (item: ListCategories) => { - ListItem() { - Row() { - Text(item.title) - .fontSize($r('sys.float.text_button_font_size')) - .fontColor(Color.Black) - .textAlign(TextAlign.Start) - .height('100%') - .width('50%') - .padding($r('sys.float.padding_level10')) - Text('>') - .fontSize('25vp') - .fontColor(Color.Black) - .textAlign(TextAlign.End) - .fontColor(Color.Gray) - .height('100%') - .width('50%') - .padding($r('sys.float.padding_level10')) - } - .width('100%') - .height('10%') - .borderRadius($r('sys.float.select_border_radius_default')) - .backgroundColor(Color.White) - .onClick(() => { - router.pushUrl({ url: item.url }) - }) - }.margin($r('sys.float.menu_item_content_align')) - }) - }.width('95%').height('90%').alignListItem(ListItemAlign.Center) - }.width('100%') - }.height('100%').backgroundColor($r('app.color.background_color')) - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex1.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex1.ets deleted file mode 100644 index 718551ca481f01c5be53a48b5e7a2c349c5ebdbc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex1.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation1(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex2.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex2.ets deleted file mode 100644 index e0da3b35858f77852687d8ff031b20ff33a7a8a7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex2.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation2(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex3.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex3.ets deleted file mode 100644 index 4acc67fe2e3454e4624c570d84054f37de5ae9c4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex3.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation3(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex4.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex4.ets deleted file mode 100644 index c73973af743e1a640a235e152a300d5665f0e6d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex4.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation4(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex5.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex5.ets deleted file mode 100644 index 767658ca272f81e84b4d9d0e7be9cf6f9cbff728..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/animation/animationIndex5.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootAnimation5(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_accessibility.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_accessibility.ets deleted file mode 100644 index 9368bede5d6e3160cbddc45f7bd9235d4d4efeac..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_accessibility.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createNativeAccessibilityNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_animation.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_animation.ets deleted file mode 100644 index 503c7af84a8d1fecd883eb8963fec1b19b72837f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_animation.ets +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2025 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 router from '@ohos.router'; - -interface ListCategories { - title:string, - url:string -} - -@Entry -@Component -struct AnimationIndex { - @State message: string = 'CApi'; - @State isShow: boolean = false; - private items : ListCategories[] = [ - {title:'ArkUI_TransitionEdge',url:'pages/animation/animationIndex1'}, - {title:'ArkUI_RenderFit',url:'pages/animation/animationIndex2'}, - {title:'ArkUI_AnimationCurve, ArkUI_AnimationPlayMode, ArkUI_FinishCallbackType', - url:'pages/animation/animationIndex3'}, - {title:'ArkUI_AnimationFillMode, ArkUI_AnimationDirection',url:'pages/animation/animationIndex4'}, - {title:'ArkUI_TranslationOptions, ArkUI_TranslationOptions, ArkUI_RotationOptions', - url:'pages/animation/animationIndex5'}, - ]; - - @Builder cApiMenu() { - Grid() { - ForEach(this.items, (item: ListCategories) => { - GridItem() { - Button(item.title) - .key(item.title) - .width('100%') - .height('100%') - .fontSize(10) - .padding(1) - .onClick(() => { - router.pushUrl({ url: item.url }); - }) - } - }) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr') - .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr') - .columnsGap(8) - .rowsGap(8) - .width('100%') - } - - build() { - Scroll(new Scroller()) { - Column() { - Stack() { - Row() { - Text(this.message) - .fontSize(22) - .fontColor(0xFFFFFF) - .fontWeight(FontWeight.Bold) - .textAlign(TextAlign.Center) - .width('100%') - .height(50) - .backgroundColor('#FF08528A') - }.width('100%') - Button('menu') - .key('menu') - .onClick(() => { - this.isShow = true; - }) - .fontSize(10) - .position({top: 5, right: 5}) - .backgroundColor(Color.Transparent) - .fontColor(Color.Transparent) - .bindSheet($$this.isShow, this.cApiMenu(), { - showClose: false, - preferType: SheetType.BOTTOM - }) - } - - List({ space: '20vp' }) { - ForEach(this.items, (item: ListCategories) => { - ListItem() { - Button(item.title) - .fontSize(15) - .labelStyle({ maxLines: 10 }) - .onClick(() => { - router.pushUrl({ url: item.url }); - }) - } - }) - }.alignListItem(ListItemAlign.Center).margin({ top: '10vp' }).width('90%').height('90%') - }.width('100%').height('100%').backgroundColor('#FFDDE7F6') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_button.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_button.ets deleted file mode 100644 index 88683420cf8ed262a836f5a12e9b593ebe10ca4a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_button.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -enum ArkUIButtonType { - ARKUI_BUTTON_TYPE_NORMAL = 0, - ARKUI_BUTTON_TYPE_CAPSULE = 1, - ARKUI_BUTTON_TYPE_CIRCLE, - ARKUI_BUTTON_ROUNDED_RECTANGLE = 8 -} -@Entry -@Component -struct Index { - @State nodeContent: NodeContent = new NodeContent(); - @State buttonType: number = ArkUIButtonType.ARKUI_BUTTON_TYPE_NORMAL; - - @Builder - SubMenuModeType() { - Menu() { - MenuItem({ content: 'ARKUI_BUTTON_TYPE_NORMAL' }).width('50%').onChange(() => { this.buttonType = ArkUIButtonType.ARKUI_BUTTON_TYPE_NORMAL; this.nodeContent = new NodeContent(); Napi.createNativeButtonNode(this.nodeContent, this.buttonType); }) - MenuItem({ content: 'ARKUI_BUTTON_TYPE_CAPSULE' }).width('50%').onChange(() => { this.buttonType = ArkUIButtonType.ARKUI_BUTTON_TYPE_CAPSULE; this.nodeContent = new NodeContent(); Napi.createNativeButtonNode(this.nodeContent, this.buttonType); }) - MenuItem({ content: 'ARKUI_BUTTON_TYPE_CIRCLE' }).width('50%').onChange(() => { this.buttonType = ArkUIButtonType.ARKUI_BUTTON_TYPE_CIRCLE; this.nodeContent = new NodeContent(); Napi.createNativeButtonNode(this.nodeContent, this.buttonType); }) - MenuItem({ content: 'ARKUI_BUTTON_ROUNDED_RECTANGLE' }).width('50%').onChange(() => { this.buttonType = ArkUIButtonType.ARKUI_BUTTON_ROUNDED_RECTANGLE; this.nodeContent = new NodeContent(); Napi.createNativeButtonNode(this.nodeContent, this.buttonType); }) - } - } - - build() { - Row() { - Column() { - Button($r('app.string.set_button_type')) - .height(50) - .width('40%') - .bindMenu(this.SubMenuModeType) - .margin({ top: 40, bottom: 10 }) - Button($r('app.string.return_to_home_screen')) - .height(50) - .width('40%') - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - Column() { - ContentSlot(this.nodeContent) - } - .margin({ top: 100, bottom: 10 }) - .width('100%') - } - } - .height('100%') - .alignItems(VerticalAlign.Top) - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_calendar_picker.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_calendar_picker.ets deleted file mode 100644 index 59ab58e373948f530c2fe663f16cb83bde50af33..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_calendar_picker.ets +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2025 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 CalendarNapi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -enum ArkUICalendarAlignment { - ARKUI_CALENDAR_ALIGNMENT_START = 0, - ARKUI_CALENDAR_ALIGNMENT_CENTER = 1, - ARKUI_CALENDAR_ALIGNMENT_END = 2, -} -@Entry -@Component -struct calendarPicker { - @State calendarAlignment : number = ArkUICalendarAlignment.ARKUI_CALENDAR_ALIGNMENT_CENTER; - private nodeContent: Content = new NodeContent(); - - @Builder - SubMenuCalendarType() { - Menu() { - MenuItem({ content: 'ARKUI_CALENDAR_ALIGNMENT_START' }) - .width('50%') - .onChange(()=> { - this.calendarAlignment = ArkUICalendarAlignment.ARKUI_CALENDAR_ALIGNMENT_START; - CalendarNapi.createCalendarPicker(this.calendarAlignment); - }); - MenuItem({ content: 'ARKUI_CALENDAR_ALIGNMENT_CENTER'}) - .width('50%') - .onChange(()=> { - this.calendarAlignment = ArkUICalendarAlignment.ARKUI_CALENDAR_ALIGNMENT_CENTER; - CalendarNapi.createCalendarPicker(this.calendarAlignment); - }); - MenuItem({ content: 'ARKUI_CALENDAR_ALIGNMENT_END'}) - .width('50%') - .onChange(()=> { - this.calendarAlignment = ArkUICalendarAlignment.ARKUI_CALENDAR_ALIGNMENT_END; - CalendarNapi.createCalendarPicker(this.calendarAlignment); - }) - } - } - - build() { - Row() { - Column() { - Row() { - Button($r('app.string.Set_alignment_mode')) - .height(50) - .width('50%') - .bindMenu(this.SubMenuCalendarType) - } - .padding({bottom: 10}) - Button($r('app.string.Back')) - .height(50) - .width('50%') - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - .margin({ bottom: 10 }) - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - } - } - .height('100%') - } - async aboutToAppear() { - CalendarNapi.setContentHandle(this.nodeContent); - CalendarNapi.createCalendarPicker(this.calendarAlignment); - } - async aboutToDisappear() { - CalendarNapi.clearNodes(); - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_checkbox_shape.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_checkbox_shape.ets deleted file mode 100644 index 7e9036c42058aae8ed2b1a26363319e2e6a74b6d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_checkbox_shape.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -enum ArkUICheckboxShape { - ArkUI_CHECKBOX_SHAPE_CIRCLE = 0, - ArkUI_CHECKBOX_SHAPE_ROUNDED_SQUARE -} - -@Entry -@Component -struct Index { - @State checkboxType: number = ArkUICheckboxShape.ArkUI_CHECKBOX_SHAPE_CIRCLE; - @State currentNodeContent: NodeContent = new NodeContent(); - @Builder - SubMenuModeType() { - Menu() { - MenuItem({ content: 'ArkUI_CHECKBOX_SHAPE_CIRCLE' }).width('50%').onChange(() => { this.checkboxType = ArkUICheckboxShape.ArkUI_CHECKBOX_SHAPE_CIRCLE; this.currentNodeContent = new NodeContent(); Napi.createNativeCheckboxShapePage(this.currentNodeContent, this.checkboxType) }) - MenuItem({ content: 'ArkUI_CHECKBOX_SHAPE_ROUNDED_SQUARE' }).width('50%').onChange(() => { this.checkboxType = ArkUICheckboxShape.ArkUI_CHECKBOX_SHAPE_ROUNDED_SQUARE; this.currentNodeContent = new NodeContent(); Napi.createNativeCheckboxShapePage(this.currentNodeContent, this.checkboxType) }) - } - } - - build() { - Column() { - Button($r('app.string.set_checkbox_shape')) - .height(50) - .width('40%') - .bindMenu(this.SubMenuModeType) - .margin({ top: 40, bottom: 10 }) - Button($r('app.string.return_to_home_screen')) - .height(50) - .width('40%') - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - Blank() - .height(200) - ContentSlot(this.currentNodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_date_picker.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_date_picker.ets deleted file mode 100644 index c8b9eb9f09118782e27863c065407b333cca3418..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_date_picker.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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 dateNapi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -enum DatePickerMode { - ARKUI_DATEPICKER_MODE_DATE = 0, - ARKUI_DATEPICKER_YEAR_AND_MONTH = 1, - ARKUI_DATEPICKER_MONTH_AND_DAY = 2, -} -@Entry -@Component -struct datePicker { - @State datepickerMode : number = DatePickerMode.ARKUI_DATEPICKER_MODE_DATE; - private nodeContent: Content = new NodeContent(); - @Builder - SubMenuModeType() { - Menu() { - MenuItem({ content: 'ARKUI_DATEPICKER_MODE_DATE' }) - .width('50%') - .onChange(()=> { - this.datepickerMode = DatePickerMode.ARKUI_DATEPICKER_MODE_DATE; - dateNapi.createDatePicker(this.datepickerMode); - }) - MenuItem({ content: 'ARKUI_DATEPICKER_YEAR_AND_MONTH'}) - .width('50%') - .onChange(()=> { - this.datepickerMode = DatePickerMode.ARKUI_DATEPICKER_YEAR_AND_MONTH; - dateNapi.createDatePicker(this.datepickerMode); - }) - MenuItem({ content: 'ARKUI_DATEPICKER_MONTH_AND_DAY'}) - .width('50%') - .onChange(()=> { - this.datepickerMode = DatePickerMode.ARKUI_DATEPICKER_MONTH_AND_DAY; - dateNapi.createDatePicker(this.datepickerMode); - }) - } - } - build() { - Row() { - Column() { - Button($r('app.string.Select_datepicker_mode')) - .height(50) - .width('50%') - .bindMenu(this.SubMenuModeType) - .margin({ bottom: 10 }) - Button($r('app.string.Back')) - .height(50) - .width('50%') - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - .margin({ bottom: 10 }) - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - } - } - .height('100%') - } - async aboutToAppear() { - dateNapi.setContentHandle(this.nodeContent); - } - async aboutToDisappear() { - dateNapi.clearNodes(); - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_embedded_component.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_embedded_component.ets deleted file mode 100644 index 040bd81c11fdffac89c05193b2125d60d09e20aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_embedded_component.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createNativeEmbeddedComponentNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_grid.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_grid.ets deleted file mode 100644 index 91c26abb9ae1b8ac294be7b10afca240220e8cb4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_grid.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createGridNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_hovermode_areatype.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_hovermode_areatype.ets deleted file mode 100644 index 39df479413cd7aa73bbc028e9709e8349842d062..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_hovermode_areatype.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -enum ArkUIHoverModeAreaType { - ARKUI_HOVER_MODE_AREA_TYPE_TOP = 0, - ARKUI_HOVER_MODE_AREA_TYPE_BOTTOM, -} - -@Entry -@Component -struct Index { - @State hoverModeAreaType: number = ArkUIHoverModeAreaType.ARKUI_HOVER_MODE_AREA_TYPE_TOP; - @State currentNodeContent: NodeContent = new NodeContent(); - @Builder - SubMenuModeType() { - Menu() { - MenuItem({ content: 'ARKUI_HOVER_MODE_AREA_TYPE_TOP' }).width('50%').onChange(() => { - this.hoverModeAreaType = ArkUIHoverModeAreaType.ARKUI_HOVER_MODE_AREA_TYPE_TOP; - this.currentNodeContent = new NodeContent(); - Napi.createHoverModeAreaTypePage(this.currentNodeContent, this.hoverModeAreaType) - }) - MenuItem({ content: 'ARKUI_HOVER_MODE_AREA_TYPE_BOTTOM' }).width('50%').onChange(() => { - this.hoverModeAreaType = ArkUIHoverModeAreaType.ARKUI_HOVER_MODE_AREA_TYPE_BOTTOM; - this.currentNodeContent = new NodeContent(); - Napi.createHoverModeAreaTypePage(this.currentNodeContent, this.hoverModeAreaType) - }) - } - } - - build() { - Column() { - Button($r('app.string.set_hover_mode_area_type')) - .height(50) - .width('50%') - .bindMenu(this.SubMenuModeType) - .margin({ top: 40, bottom: 10 }) - Button($r('app.string.return_to_home_screen')) - .height(50) - .width('50%') - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - ContentSlot(this.currentNodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_image.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_image.ets deleted file mode 100644 index 96e7bf81ede57a9cfabd375ab673299e9056df8a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_image.ets +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Copyright (c) 2025 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 ImageNapi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -enum ArkUIImageSize { - ARKUI_IMAGE_SIZE_AUTO = 0, - ARKUI_IMAGE_SIZE_COVER = 1, - ARKUI_IMAGE_SIZE_CONTAIN = 2, -} - -enum ArkUIImageInterpolation { - ARKUI_IMAGE_INTERPOLATION_NONE = 0, - ARKUI_IMAGE_INTERPOLATION_LOW, - ARKUI_IMAGE_INTERPOLATION_MEDIUM, - ARKUI_IMAGE_INTERPOLATION_HIGH, -} - -enum ArkUIImageRenderMode { - ARKUI_IMAGE_RENDER_MODE_ORIGINAL = 0, - ARKUI_IMAGE_RENDER_MODE_TEMPLATE, -} - -enum ArkUIImageRepeat { - ARKUI_IMAGE_REPEAT_NONE = 0, - ARKUI_IMAGE_REPEAT_X, - ARKUI_IMAGE_REPEAT_Y, - ARKUI_IMAGE_REPEAT_XY, -} - -enum ArkUIObjectFit { - /** The image is scaled with its aspect ratio retained for the content to be completely displayed within the - * display boundaries. */ - ARKUI_OBJECT_FIT_CONTAIN = 0, - /** The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the - * display boundaries. */ - ARKUI_OBJECT_FIT_COVER, - /** The image is scaled automatically to fit the display area. */ - ARKUI_OBJECT_FIT_AUTO, - /** The image is scaled to fill the display area, and its aspect ratio is not retained. */ - ARKUI_OBJECT_FIT_FILL, - /** The image content is displayed with its aspect ratio retained. The size is smaller than or equal to the - * original size. */ - ARKUI_OBJECT_FIT_SCALE_DOWN, - /** The original size is retained. */ - ARKUI_OBJECT_FIT_NONE, - /** Not resized, the image is aligned with the start edge of the top of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_START, - /** Not resized, the image is horizontally centered at the top of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP, - /** Not resized, the image is aligned with the end edge at the top of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_END, - /** Not resized, the image is vertically centered on the start edge of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_START, - /** Not resized, the image is horizontally and vertically centered in the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_CENTER, - /** Not resized, the image is vertically centered on the end edge of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_END, - /** Not resized, the image is aligned with the start edge at the bottom of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_START, - /** Not resized, the image is horizontally centered at the bottom of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM, - /** Not resized, the image is aligned with the end edge at the bottom of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_END, -} -@Entry -@Component -struct ImageSize { - @State imageSize : number = ArkUIImageSize.ARKUI_IMAGE_SIZE_AUTO; - @State objectFit : number = ArkUIObjectFit.ARKUI_OBJECT_FIT_CONTAIN; - @State imageInterpolation : number = ArkUIImageInterpolation.ARKUI_IMAGE_INTERPOLATION_NONE; - @State imageRenderMode : number = ArkUIImageRenderMode.ARKUI_IMAGE_RENDER_MODE_ORIGINAL; - @State imageRepeat : number = ArkUIImageRepeat.ARKUI_IMAGE_REPEAT_NONE; - private nodeContent: Content = new NodeContent(); - @Builder - SubMenuImageSize() { - Menu() { - MenuItem({ content: 'ARKUI_IMAGE_SIZE_AUTO'}) - .width('50%') - .onChange(()=> { - this.imageSize = ArkUIImageSize.ARKUI_IMAGE_SIZE_AUTO; - ImageNapi.createImageSize( this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_IMAGE_SIZE_COVER'}) - .width('50%') - .onChange(()=> { - this.imageSize = ArkUIImageSize.ARKUI_IMAGE_SIZE_COVER; - ImageNapi.createImageSize( this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_IMAGE_SIZE_CONTAIN'}) - .width('50%') - .onChange(()=> { - this.imageSize = ArkUIImageSize.ARKUI_IMAGE_SIZE_CONTAIN; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - } - } - @Builder - SubMenuImageRepeat() { - Menu() { - MenuItem({ content: 'ARKUI_IMAGE_REPEAT_NONE'}) - .width('50%') - .onChange(()=> { - this.imageRepeat = ArkUIImageRepeat.ARKUI_IMAGE_REPEAT_NONE; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - MenuItem({ content: 'ARKUI_IMAGE_REPEAT_X'}) - .width('50%') - .onChange(()=> { - this.imageRepeat = ArkUIImageRepeat.ARKUI_IMAGE_REPEAT_X; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - MenuItem({ content: 'ARKUI_IMAGE_REPEAT_Y'}) - .width('50%') - .onChange(()=> { - this.imageRepeat = ArkUIImageRepeat.ARKUI_IMAGE_REPEAT_Y; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - MenuItem({ content: 'ARKUI_IMAGE_REPEAT_XY'}) - .width('50%') - .onChange(()=> { - this.imageRepeat = ArkUIImageRepeat.ARKUI_IMAGE_REPEAT_XY; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - } - } - @Builder - SubMenuImageInterpolation() { - Menu() { - MenuItem({ content: 'ARKUI_IMAGE_INTERPOLATION_NONE'}) - .width('50%') - .onChange(()=> { - this.imageInterpolation = ArkUIImageInterpolation.ARKUI_IMAGE_INTERPOLATION_NONE; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - MenuItem({ content: 'ARKUI_IMAGE_INTERPOLATION_LOW'}) - .width('50%') - .onChange(()=> { - this.imageInterpolation = ArkUIImageInterpolation.ARKUI_IMAGE_INTERPOLATION_LOW; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - MenuItem({ content: 'ARKUI_IMAGE_INTERPOLATION_MEDIUM'}) - .width('50%') - .onChange(()=> { - this.imageInterpolation = ArkUIImageInterpolation.ARKUI_IMAGE_INTERPOLATION_MEDIUM; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - MenuItem({ content: 'ARKUI_IMAGE_INTERPOLATION_HIGH'}) - .width('50%') - .onChange(()=> { - this.imageInterpolation = ArkUIImageInterpolation.ARKUI_IMAGE_INTERPOLATION_HIGH; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - } - } - @Builder - SubMenuMode() { - Menu() { - MenuItem({ content: 'ARKUI_IMAGE_RENDER_MODE_ORIGINAL'}) - .width('50%') - .onChange(()=> { - this.imageRenderMode = ArkUIImageRenderMode.ARKUI_IMAGE_RENDER_MODE_ORIGINAL; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - MenuItem({ content: 'ARKUI_IMAGE_RENDER_MODE_TEMPLATE'}) - .width('50%') - .onChange(()=> { - this.imageRenderMode = ArkUIImageRenderMode.ARKUI_IMAGE_RENDER_MODE_TEMPLATE; - ImageNapi.setImageProperties(this.imageRepeat, this.imageInterpolation, this.imageRenderMode); - }) - } - } - @Builder - SubMenuObjectFit() { - Menu() { - MenuItem({ content: 'ARKUI_OBJECT_FIT_CONTAIN'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_CONTAIN; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_COVER'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_COVER; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_AUTO'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_AUTO; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_FILL'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_FILL; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_SCALE_DOWN'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_SCALE_DOWN; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_START'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_START; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_END'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_END; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE_AND_ALIGN_START'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE_AND_ALIGN_START; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE_AND_ALIGN_CENTER'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE_AND_ALIGN_CENTER; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE_AND_ALIGN_END'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE_AND_ALIGN_END; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_START'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_START; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - MenuItem({ content: 'ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_END'}) - .width('50%') - .onChange(()=> { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_END; - ImageNapi.createImageSize(this.objectFit, this.imageSize); - }) - } - } - build() { - Row() { - Column() { - Row() { - Button($r('app.string.Select_image_coverage_mode')) - .height(50) - .width('50%') - .onClick(() => { - this.objectFit = ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE; - }) - .bindMenu(this.SubMenuImageSize) - - Button($r('app.string.Select_image_adaptation_mode')) - .height(50) - .width('50%') - .bindMenu(this.SubMenuObjectFit) - } - .padding({bottom: 10}) - Row() { - Button($r('app.string.Select_image_interpolation_mode')) - .height(50) - .width('50%') - .onClick(() => { - ImageNapi.createImageSize(ArkUIObjectFit.ARKUI_OBJECT_FIT_CONTAIN, ArkUIImageSize.ARKUI_IMAGE_SIZE_AUTO); - this.imageRenderMode = ArkUIImageRenderMode.ARKUI_IMAGE_RENDER_MODE_ORIGINAL; - this.imageRepeat = ArkUIImageRepeat.ARKUI_IMAGE_REPEAT_NONE; - }) - .bindMenu(this.SubMenuImageInterpolation) - Button($r('app.string.Select_image_rendering_mode')) - .height(50) - .width('50%') - .bindMenu(this.SubMenuMode) - } - .padding({bottom: 10}) - Row() { - Button($r('app.string.Select_background_overlay_mode')) - .height(50) - .width('50%') - .onClick(() => { - ImageNapi.createImageSize(ArkUIObjectFit.ARKUI_OBJECT_FIT_NONE, ArkUIImageSize.ARKUI_IMAGE_SIZE_AUTO); - }) - .bindMenu(this.SubMenuImageRepeat) - Button($r('app.string.Back')) - .height(50) - .width('50%') - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - } - .padding({bottom: 10}) - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - } - } - .height('100%') - } - async aboutToAppear() { - ImageNapi.setContentHandle(this.nodeContent); - } - async aboutToDisappear() { - ImageNapi.clearNodes(); - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_image_animator.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_image_animator.ets deleted file mode 100644 index c9194e70f378b56c8c488601fd65c4618782789c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_image_animator.ets +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2025 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 AnimatorNapi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent: Content = new NodeContent(); - @State styleOption: string = ''; - @State imageWidth: number = 100; - @State imageHeight: number = 100; - @State imageTop: number = 100; - @State imageLeft: number = 100; - @State imageDuration: number = 1000; - @Builder - SubMenuMode() { - Menu() { - MenuItem({ content: 'createImageAnimatorFromString'}) - .width('50%') - .onChange(()=> { - AnimatorNapi.createImageAnimatorFromString(this.imageWidth, this.imageHeight, - this.imageTop, this.imageLeft, this.imageDuration); - }) - MenuItem({ content: 'createImageAnimatorFromDrawableDescriptor'}) - .width('50%') - .onChange(()=> { - AnimatorNapi.createImageAnimatorFromDrawableDescriptor(this.imageWidth, this.imageHeight, - this.imageTop, this.imageLeft, this.imageDuration); - - }) - } - } - - build() { - Row() { - Column() { - Row() { - Column() { - Row() { - Text($r('app.string.ImageAnimator_width')) - TextInput() - .type(InputType.Number) - .onChange((value) => { - this.imageWidth = parseInt(value); - }) - .width(100) - } - .padding({bottom: 5}) - Row() { - Text($r('app.string.ImageAnimator_height')) - TextInput() - .type(InputType.Number) - .onChange((value) => { - this.imageHeight = parseInt(value); - }) - .width(100) - } - .padding({bottom: 5}) - Row() { - Text($r('app.string.ImageAnimator_top')) - TextInput() - .type(InputType.Number) - .onChange((value) => { - this.imageTop = parseInt(value); - }) - .width(100) - } - .padding({bottom: 5}) - Row() { - Text($r('app.string.ImageAnimator_left')) - TextInput() - .type(InputType.Number) - .onChange((value) => { - this.imageLeft = parseInt(value); - }) - .width(100) - } - .padding({bottom: 5}) - Row() { - Text($r('app.string.ImageAnimator_duration')) - TextInput() - .type(InputType.Number) - .onChange((value) => { - this.imageDuration = parseInt(value); - }) - .width(100) - } - .padding({bottom: 5}) - Row() { - Button($r('app.string.Creat_imageAnimator')) - .height(50) - .width('50%') - .bindMenu(this.SubMenuMode()) - Button($r('app.string.Get_frameInfo')) - .height(50) - .width('50%') - .onClick(() => { - this.styleOption = AnimatorNapi.getImageAnimatorFrameInfo(); - }) - } - } - } - Text(this.styleOption) - .margin({ top: 5, bottom: 5 }) - Button($r('app.string.Back')) - .height(50) - .width('50%') - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - .margin({ bottom: 5 }) - ContentSlot(this.nodeContent) - } - .width('100%') - } - .height('100%') - } - async aboutToAppear() { - AnimatorNapi.setContentHandle(this.nodeContent); - } - async aboutToDisappear() { - AnimatorNapi.clearNodes(); - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_list.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_list.ets deleted file mode 100644 index 52a9dc01c451fae835a75bafb8b092635071db18..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_list.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createListNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_progress.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_progress.ets deleted file mode 100644 index e490a865102fc7eeb652f980347287504e49d5e0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_progress.ets +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2025 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 ProgressNapi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -enum ProgressType { - LINEAR = 0, - RING = 1, - ECLIPSE, - SCALE_RING, - CAPSULE, -} -interface LinearProgressStyle { - scanEffect?: boolean; // 扫描效果开关 - smoothEffect?: boolean; // 平滑效果开关 - strokeWidth?: number; // 线宽 - strokeRadius?: number; // 圆角半径 - // 可根据实际需求扩展其他属性,如颜色、进度值等 -} - -@Entry -@Component -struct Index { - private nodeContent: Content = new NodeContent(); - @State progressType: string = '未设置'; - @State status: string = ''; - @State styleOption: string = ''; - @State progressValue: number = 0; - @State customStyle: LinearProgressStyle = { - scanEffect: true, - smoothEffect: true, - strokeWidth: 10, - strokeRadius: 10 - }; - - @Builder - SubMenuProgressType() { - Menu() { - MenuItem({ content: 'ARKUI_PROGRESS_TYPE_LINEAR' }).width('50%').onChange(()=> { - this.progressType = 'ARKUI_PROGRESS_TYPE_LINEAR';ProgressNapi.setProgressType(ProgressType.LINEAR) - }) - MenuItem({ content: 'ARKUI_PROGRESS_TYPE_RING'}).width('50%').onChange(()=> { - this.progressType = 'ARKUI_PROGRESS_TYPE_RING' ;ProgressNapi.setProgressType(ProgressType.RING) - }) - MenuItem({ content: 'ARKUI_PROGRESS_TYPE_ECLIPSE'}).width('50%').onChange(()=> { - this.progressType = 'ARKUI_PROGRESS_TYPE_ECLIPSE' ;ProgressNapi.setProgressType(ProgressType.ECLIPSE) - }) - MenuItem({ content: 'ARKUI_PROGRESS_TYPE_SCALE_RING'}).width('50%').onChange(()=> { - this.progressType = 'ARKUI_PROGRESS_TYPE_SCALE_RING' ;ProgressNapi.setProgressType(ProgressType.SCALE_RING) - }) - MenuItem({ content: 'ARKUI_PROGRESS_TYPE_CAPSULE'}).width('50%').onChange(()=> { - this.progressType = 'ARKUI_PROGRESS_TYPE_CAPSULE' ;ProgressNapi.setProgressType(ProgressType.CAPSULE) - }) - } - } - - build() { - Row() { - Column() { - Row() { - Column() { - Row() { - Text($r('app.string.Smooth_effect')) - Toggle({ type: ToggleType.Switch, isOn: true }) - .onChange((isOn) => { - this.customStyle.smoothEffect = isOn; - }) - Text($r('app.string.Scan_effect')) - Toggle({ type: ToggleType.Switch, isOn: true }) - .onChange((isOn) => { - this.customStyle.scanEffect = isOn; - }) - } - Row() { - Text($r('app.string.Stroke_width')) - TextInput() - .type(InputType.Number) - .onChange((value) => { - this.customStyle.strokeWidth = parseInt(value); - }) - .width(100) - } - Row() { - Text($r('app.string.Stroke_radius')) - TextInput() - .type(InputType.Number) - .onChange((value) => { - this.customStyle.strokeRadius = parseInt(value); - }) - .width(100) - } - Button($r('app.string.Select_node_type')) - .height(50) - .width('50%') - .margin({ left: 10 }) - .bindMenu(this.SubMenuProgressType) - Text(`${this.progressType}`) - .fontSize(14) - .margin(10) - Button($r('app.string.Set_style_option')) - .height(50) - .width('50%') - .margin({ left: 10 }) - .onClick(() => { - if (this.progressType == 'ARKUI_PROGRESS_TYPE_LINEAR') { - ProgressNapi.setProgressLinearStyleOption(this.customStyle.scanEffect, - this.customStyle.smoothEffect, this.customStyle.strokeWidth, this.customStyle.strokeRadius); - } else { - this.status = 'please set the progress indicator type to linear'; - } - }) - Text(this.status) - .fontSize(14) - .margin(10) - } - } - Row() { - Button($r('app.string.Get_style_option')) - .height(50) - .width('50%') - .onClick(() => { - this.styleOption = ProgressNapi.getProgressLinearStyleOptionAndDestroy(); - console.log('styleOption ' + this.styleOption); - }) - .margin({ top: 5, bottom: 5 }) - } - Text('styleOption: '+this.styleOption) - .fontSize(14) - .margin(10) - Row() { - Text($r('app.string.Input_progress_value')) - TextInput() - .type(InputType.Number) - .onChange((value) => { - this.progressValue = parseInt(value); - }) - .width(100) - } - .padding({bottom: 5}) - Button($r('app.string.Set_progress_value')) - .height(50) - .width('50%') - .onClick(() => { - ProgressNapi.setProgressValue(this.progressValue); - }) - .margin({ bottom: 10 }) - Button($r('app.string.Back')) - .height(50) - .width('50%') - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - .margin({ bottom: 10 }) - ContentSlot(this.nodeContent) - } - .width('100%') - } - .height('100%') - } - async aboutToAppear() { - ProgressNapi.setContentHandle(this.nodeContent); - ProgressNapi.createProgress(); - } - async aboutToDisappear() { - ProgressNapi.clearNodes(); - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_public_event.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_public_event.ets deleted file mode 100644 index 1ccffddbab35b4f81affd0e8153050c6c0add7cb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_public_event.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct PublicComponent { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createPublicNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_refresh.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_refresh.ets deleted file mode 100644 index 73f028421fae3cd3b811dfb8e49884da9ae12ed6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_refresh.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createRefreshNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_scroll.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_scroll.ets deleted file mode 100644 index fe8e5a35cabbab5092aeabafd8e71e945117b8b5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_scroll.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createScrollNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_slider.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_slider.ets deleted file mode 100644 index ba33487b8e8fe8f3ba1aa75ce4f93cb97d925437..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_slider.ets +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -enum ArkUISliderBlockStyle { - ARKUI_SLIDER_BLOCK_STYLE_DEFAULT = 0, - ARKUI_SLIDER_BLOCK_STYLE_IMAGE, - ARKUI_SLIDER_BLOCK_STYLE_SHAPE, -} - -enum ArkUISliderDirection { - ARKUI_SLIDER_DIRECTION_VERTICAL = 0, - ARKUI_SLIDER_DIRECTION_HORIZONTAL, -} - -enum ArkUISliderStyle { - ARKUI_SLIDER_STYLE_OUT_SET = 0, - ARKUI_SLIDER_STYLE_IN_SET, - ARKUI_SLIDER_STYLE_NONE, -} - -@Entry -@Component -struct thirdIndex { - @State sliderBlockStyle: number = ArkUISliderBlockStyle.ARKUI_SLIDER_BLOCK_STYLE_DEFAULT; - @State sliderDirection: number = ArkUISliderDirection.ARKUI_SLIDER_DIRECTION_HORIZONTAL; - @State sliderStyle: number = ArkUISliderStyle.ARKUI_SLIDER_STYLE_OUT_SET; - @State nodeContent: NodeContent = new NodeContent(); - - @Builder - SubMenuSliderBlockStyle() { - Menu() { - MenuItem({ content: 'ARKUI_SLIDER_BLOCK_STYLE_DEFAULT' }).width('50%').onChange(() => { - this.sliderBlockStyle = ArkUISliderBlockStyle.ARKUI_SLIDER_BLOCK_STYLE_DEFAULT; - this.nodeContent = new NodeContent(); - Napi.createNativeSliderNode(this.nodeContent, this.sliderBlockStyle, this.sliderDirection, this.sliderStyle) - }) - MenuItem({ content: 'ARKUI_SLIDER_BLOCK_STYLE_IMAGE' }).width('50%').onChange(() => { - this.sliderBlockStyle = ArkUISliderBlockStyle.ARKUI_SLIDER_BLOCK_STYLE_IMAGE; - this.nodeContent = new NodeContent(); - Napi.createNativeSliderNode(this.nodeContent, this.sliderBlockStyle, this.sliderDirection, this.sliderStyle) - }) - MenuItem({ content: 'ARKUI_SLIDER_BLOCK_STYLE_SHAPE' }).width('50%').onChange(() => { - this.sliderBlockStyle = ArkUISliderBlockStyle.ARKUI_SLIDER_BLOCK_STYLE_SHAPE; - this.nodeContent = new NodeContent(); - Napi.createNativeSliderNode(this.nodeContent, this.sliderBlockStyle, this.sliderDirection, this.sliderStyle) - }) - } - } - - @Builder - SubMenuSliderDirection() { - Menu() { - MenuItem({ content: 'ARKUI_SLIDER_DIRECTION_VERTICAL' }).width('50%').onChange(() => { - this.sliderDirection = ArkUISliderDirection.ARKUI_SLIDER_DIRECTION_VERTICAL; - this.nodeContent = new NodeContent(); - Napi.createNativeSliderNode(this.nodeContent, this.sliderBlockStyle, this.sliderDirection, this.sliderStyle) - }) - MenuItem({ content: 'ARKUI_SLIDER_DIRECTION_HORIZONTAL' }).width('50%').onChange(() => { - this.sliderDirection = ArkUISliderDirection.ARKUI_SLIDER_DIRECTION_HORIZONTAL; - this.nodeContent = new NodeContent(); - Napi.createNativeSliderNode(this.nodeContent, this.sliderBlockStyle, this.sliderDirection, this.sliderStyle) - }) - } - } - - @Builder - SubMenuSliderStyle() { - Menu() { - MenuItem({ content: 'ARKUI_SLIDER_STYLE_OUT_SET' }).width('50%').onChange(() => { - this.sliderStyle = ArkUISliderStyle.ARKUI_SLIDER_STYLE_OUT_SET; - this.nodeContent = new NodeContent(); - Napi.createNativeSliderNode(this.nodeContent, this.sliderBlockStyle, this.sliderDirection, this.sliderStyle) - }) - MenuItem({ content: 'ARKUI_SLIDER_STYLE_IN_SET' }).width('50%').onChange(() => { - this.sliderStyle = ArkUISliderStyle.ARKUI_SLIDER_STYLE_IN_SET; - this.nodeContent = new NodeContent(); - Napi.createNativeSliderNode(this.nodeContent, this.sliderBlockStyle, this.sliderDirection, this.sliderStyle) - }) - MenuItem({ content: 'ARKUI_SLIDER_STYLE_NONE' }).width('50%').onChange(() => { - this.sliderStyle = ArkUISliderStyle.ARKUI_SLIDER_STYLE_NONE; - this.nodeContent = new NodeContent(); - Napi.createNativeSliderNode(this.nodeContent, this.sliderBlockStyle, this.sliderDirection, this.sliderStyle) - }) - } - } - - build() { - Column() { - Column() { - Button($r('app.string.set_slider_block_style')) - .height(50) - .width('40%') - .bindMenu(this.SubMenuSliderBlockStyle) - .margin({ top: 10, bottom: 10 }) - Button($r('app.string.set_slider_direction')) - .height(50) - .width('40%') - .bindMenu(this.SubMenuSliderDirection) - .margin({ top: 10, bottom: 10 }) - Button($r('app.string.set_slider_style')) - .height(50) - .width('40%') - .bindMenu(this.SubMenuSliderStyle) - .margin({ top: 10, bottom: 10 }) - Button($r('app.string.return_to_home_screen')) - .height(50) - .width('40%') - .margin({ top: 10, bottom: 10 }) - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - ContentSlot(this.nodeContent) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_swiper.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_swiper.ets deleted file mode 100644 index 9bf930dc3c0098b68073c2228776e907d3ef85a8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_swiper.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createNativeSwiperNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_text.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_text.ets deleted file mode 100644 index 736e6e97c1ecd00ad31fd7f0236257586c073f16..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_text.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct textComponent { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createNativeTextNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_text_picker.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_text_picker.ets deleted file mode 100644 index 1a37bc2d3ae42b1163d2ba74700eac020caf54a0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_text_picker.ets +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2025 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 TextNapi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -enum TextPickerRangeType { - ARKUI_TEXTPICKER_RANGETYPE_SINGLE = 0, - ARKUI_TEXTPICKER_RANGETYPE_MULTI = 1, - RKUI_TEXTPICKER_RANGETYPE_RANGE_CONTENT, - ARKUI_TEXTPICKER_RANGETYPE_CASCADE_RANGE_CONTENT -} -@Entry -@Component -struct secondIndex { - private nodeContent: Content = new NodeContent(); - @State rangeType: number = TextPickerRangeType.ARKUI_TEXTPICKER_RANGETYPE_SINGLE; - @State isCross: boolean = false; - @State isInit: boolean = false; - @Builder - SubMenuModeType() { - Menu() { - MenuItem({content: 'ARKUI_TEXTPICKER_RANGETYPE_SINGLE' }) - .width('50%') - .onChange(()=> { - this.isInit = true; - this.rangeType = TextPickerRangeType.ARKUI_TEXTPICKER_RANGETYPE_SINGLE; - TextNapi.createTextPickerWithCustomContent(this.rangeType); - }) - MenuItem({content: 'ARKUI_TEXTPICKER_RANGETYPE_MULTI'}) - .width('50%') - .onChange(()=> { - this.isInit = true; - this.rangeType = TextPickerRangeType.ARKUI_TEXTPICKER_RANGETYPE_MULTI; - TextNapi.createTextPickerWithCustomContent(this.rangeType); - }) - MenuItem({content: 'RKUI_TEXTPICKER_RANGETYPE_RANGE_CONTENT'}) - .width('50%') - .onChange(()=> { - this.isInit = true; - this.rangeType = TextPickerRangeType.RKUI_TEXTPICKER_RANGETYPE_RANGE_CONTENT; - TextNapi.createTextPickerWithCustomContent(this.rangeType); - }) - MenuItem({content: 'ARKUI_TEXTPICKER_RANGETYPE_CASCADE_RANGE_CONTENT'}) - .width('50%') - .onChange(()=> { - this.isInit = true; - this.rangeType = TextPickerRangeType.ARKUI_TEXTPICKER_RANGETYPE_CASCADE_RANGE_CONTENT; - TextNapi.createTextPickerWithCustomContent(this.rangeType); - }) - } - } - - @Builder - CrossLanguageOption() { - Menu() { - MenuItem({content: 'true' }) - .width('50%') - .onChange(()=> { - this.isCross = true; - TextNapi.setUpTextCrossLanguage(this.isCross); - }) - MenuItem({content: 'false'}) - .width('50%') - .onChange(()=> { - this.isCross = false; - TextNapi.setUpTextCrossLanguage(this.isCross); - }) - } - } - - build() { - Row() { - Column() { - Row() { - Button($r('app.string.Select_textPicker_type')) - .height(50) - .width('50%') - .bindMenu(this.SubMenuModeType) - } - .padding({bottom: 10}) - if (this.isInit) { - Row() { - Button($r('app.string.Set_crossLanguage')) - .height(50) - .width('50%') - .bindMenu(this.CrossLanguageOption) - } - .padding({bottom: 10}) - } - Button($r('app.string.Back')) - .height(50) - .width('50%') - .onClick(() => { - this.getUIContext().getRouter().back(); - }) - .margin({ bottom: 10 }) - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - } - } - .height('100%') - } - async aboutToAppear() { - TextNapi.setContentHandle(this.nodeContent); - } - async aboutToDisappear() { - TextNapi.clearNodes(); - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_visual_effects.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_visual_effects.ets deleted file mode 100644 index d6a0a5a901319a49cca2be0f7594a91b57ddae1a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_visual_effects.ets +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2025 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 router from '@ohos.router'; - -interface ListCategories { - title:string, - url:string -} - -@Entry -@Component -struct VisualEffectsIndex { - @State message: string = 'CApi'; - @State isShow: boolean = false; - private items : ListCategories[] = [ - {title:'ArkUI_ShadowType, ArkUI_ShadowStyle, ArkUI_MaskType',url:'pages/visualEffects/visualEffectsIndex1'}, - {title:'ArkUI_AdaptiveColor, ArkUI_BlurStyle, ArkUI_ClipType',url:'pages/visualEffects/visualEffectsIndex2'}, - {title:'ArkUI_ColorStop, ArkUI_LinearGradientDirection',url:'pages/visualEffects/visualEffectsIndex3'}, - ]; - - @Builder cApiMenu() { - Grid() { - ForEach(this.items, (item: ListCategories) => { - GridItem() { - Button(item.title) - .key(item.title) - .width('100%') - .height('100%') - .fontSize(10) - .padding(1) - .onClick(() => { - router.pushUrl({ url: item.url }); - }) - } - }) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr') - .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr') - .columnsGap(8) - .rowsGap(8) - .width('100%') - } - - build() { - Scroll(new Scroller()) { - Column() { - Stack() { - Row() { - Text(this.message) - .fontSize(22) - .fontColor(0xFFFFFF) - .fontWeight(FontWeight.Bold) - .textAlign(TextAlign.Center) - .width('100%') - .height(50) - .backgroundColor('#FF08528A') - }.width('100%') - Button('menu') - .key('menu') - .onClick(() => { - this.isShow = true; - }) - .fontSize(10) - .position({top: 5, right: 5}) - .backgroundColor(Color.Transparent) - .fontColor(Color.Transparent) - .bindSheet($$this.isShow, this.cApiMenu(), { - showClose: false, - preferType: SheetType.BOTTOM - }) - } - - List({ space: '20vp' }) { - ForEach(this.items, (item: ListCategories) => { - ListItem() { - Button(item.title) - .fontSize(15) - .labelStyle({ maxLines: 10 }) - .onClick(() => { - router.pushUrl({ url: item.url }); - }) - } - }) - }.alignListItem(ListItemAlign.Center).margin({ top: '10vp' }).width('90%').height('90%') - }.width('100%').height('100%').backgroundColor('#FFDDE7F6') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_waterflow.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_waterflow.ets deleted file mode 100644 index 8cc63eea5f9e166d4ff9b9e1f593db458306aeb2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_waterflow.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent = new NodeContent(); - aboutToAppear() { - // 通过C-API创建节点,并添加到管理器nodeContent上 - Napi.createWaterFlowNativeNode(this.nodeContent); - } - build() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_xcomponent.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_xcomponent.ets deleted file mode 100644 index c200e5a4c3681e88273d46b3bf184619d40ceb72..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/page_xcomponent.ets +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libentry.so'; -import { NodeContent } from '@ohos.arkui.node'; - -class Params { - public insert: boolean = false - public nodeContent: NodeContent; - - constructor(insert: boolean, nodeContent: NodeContent) { - this.insert = insert; - this.nodeContent = nodeContent; - } -} - -class MyNodeContent extends NodeContent { - onAttachToWindow(): void { - // TODO - } - - onDetachFromWindow(): void { - // TODO - } - - constructor() { - super() - } -} - -@Builder -function buildNodeContent(params: Params) { - ContentSlot(params.insert ? params.nodeContent : undefined) -} - -@Entry -@Component -struct Parent { - @State insert: boolean = true - public nodeContent = new MyNodeContent() - public nodeContent2 = new MyNodeContent() - @State xcWidth: number = 200 - aboutToAppear(): void { - nativeNode.createNativeNodexc(this.nodeContent, 'nodeContent1234'); - } - - build() { - - Row() { - Column() { - buildNodeContent(new Params(this.insert, this.nodeContent)) - } - .width(this.xcWidth) - } - .width('100%') - .height('100%') - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex1.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex1.ets deleted file mode 100644 index 94fc947ff9f496f1792947e56aa91951a2e6d7b2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex1.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects1(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex2.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex2.ets deleted file mode 100644 index d8f357ffdd2900058a1a2627550a316f55d200b0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex2.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects2(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex3.ets b/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex3.ets deleted file mode 100644 index bc29d96ff9fd107baa0fe45048a6ef48fc3fc1c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/ets/pages/visualEffects/visualEffectsIndex3.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 Napi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -@Entry -@Component -struct Index5 { - private rootSlot = new NodeContent(); - @State isModuleLoaded: boolean = false; - - aboutToAppear(): void { - if (Napi) { - Napi?.createNativeRootVisualEffects3(this.rootSlot); - } - } - aboutToDisappear(): void { - if (Napi) { - Napi.destroyNativeRoot(); - } - } - - build() { - Column() { - Row() { - ContentSlot(this.rootSlot) - }.layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/module.json5 b/ArkUIKit/NativeTypeSample/entry/src/main/module.json5 deleted file mode 100644 index e1680535d25163b2fd407d46f2ae41f70d71cf14..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/module.json5 +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2025 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, - "orientation": "auto_rotation", - "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" - } - ] - }, - { - "name": "SampleEmbeddedAbility", - "srcEntry": "./ets/extensionAbility/SampleEmbeddedAbility.ets", - "type": "embeddedUI" - } - ] - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/element/color.json b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index e14ec8929bece8fe009d91f1145ec962c16661ab..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "background_color", - "value": "#2AA1A6B1" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/element/float.json b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/element/string.json b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index a295eb94784aee2e70da9d2afc1fc13f0f811295..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "native_type_sample" - }, - { - "name": "set_hover_mode_area_type", - "value": "HoverModeAreaType" - }, - { - "name": "set_button_type", - "value": "ButtonType" - }, - { - "name": "set_slider_block_style", - "value": "SliderBlockStyle" - }, - { - "name": "set_slider_direction", - "value": "SliderDirection" - }, - { - "name": "set_slider_style", - "value": "SliderStyle" - }, - { - "name": "set_checkbox_shape", - "value": "CheckboxShape" - }, - { - "name": "return_to_home_screen", - "value": "返回" - }, - { - "name": "Set_alignment_mode", - "value": "设置对齐方式" - }, - { - "name": "Select_datepicker_mode", - "value": "选择DATEPICKER模式" - }, - { - "name": "Select_image_coverage_mode", - "value": "选择图片的宽高样式IMAGE_SIZE" - }, - { - "name": "Select_image_adaptation_mode", - "value": "选择图片填充效果ObjectFit" - }, - { - "name": "Select_image_interpolation_mode", - "value": "选择图片插值方式ImageInterpolation" - }, - { - "name": "Select_image_rendering_mode", - "value": "选择图片渲染方式ImageRenderMode" - }, - { - "name": "Select_background_overlay_mode", - "value": "选择背景覆盖方式ImageRepeat" - }, - { - "name": "ImageAnimator_width", - "value": "宽度" - }, - { - "name": "ImageAnimator_height", - "value": "高度" - }, - { - "name": "ImageAnimator_top", - "value": "顶部" - }, - { - "name": "ImageAnimator_left", - "value": "左侧" - }, - { - "name": "ImageAnimator_duration", - "value": "持续时间(ms)" - }, - { - "name": "Creat_imageAnimator", - "value": "创建imageAnimator" - }, - { - "name": "Get_frameInfo", - "value": "获取FrameInfo值并销毁" - }, - { - "name": "Smooth_effect", - "value": "平滑效果:" - }, - { - "name": "Scan_effect", - "value": "扫描效果:" - }, - { - "name": "Stroke_width", - "value": "线宽:" - }, - { - "name": "Stroke_radius", - "value": "圆角半径:" - }, - { - "name": "Select_node_type", - "value": "选择节点类型:" - }, - { - "name": "Set_style_option", - "value": "设置styleOption:" - }, - { - "name": "Get_style_option", - "value": "获取styleOption值并销毁" - }, - { - "name": "Select_textPicker_type", - "value": "选择TextPicker类型" - }, - { - "name": "Set_crossLanguage", - "value": "设置CrossLanguage并获取结果" - }, - { - "name": "Set_progress_value", - "value": "设置进度条值" - }, - { - "name": "Input_progress_value", - "value": "输入进度条值:" - }, - { - "name": "Back", - "value": "返回上级" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/640.jpg b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/640.jpg deleted file mode 100644 index 784dd7d0153e43098837fd1fd70428ca51bcb332..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/640.jpg and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/background.png b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/test.gif b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/test.gif deleted file mode 100644 index 3c947c61334a64df3b53567e9570b329b48d9407..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/test.gif and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/test1.gif b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/test1.gif deleted file mode 100644 index 33b7085d41046e832ce426114918871af96b535f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/media/test1.gif and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 0a0cee4bcb72bbcf0438a04df063d714098144cf..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/page_text", - "pages/page_swiper", - "pages/page_accessibility", - "pages/page_embedded_component", - "pages/page_waterflow", - "pages/page_grid", - "pages/page_scroll", - "pages/page_refresh", - "pages/page_xcomponent", - "pages/page_list", - "pages/page_button", - "pages/page_slider", - "pages/page_checkbox_shape", - "pages/page_hovermode_areatype", - "pages/page_public_event", - "pages/page_progress", - "pages/page_text_picker", - "pages/page_date_picker", - "pages/page_image", - "pages/page_calendar_picker", - "pages/page_image_animator" - ] -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/main/resources/dark/element/color.json b/ArkUIKit/NativeTypeSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index bd7fc7c773d766afaad54f86caede9361e448455..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - }, - { - "name": "background_color", - "value": "#2AA1A6B1" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NativeTypeSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 3c81579a25ae2430d5c8050c62a1fc14a7b0cf62..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NativeTypeSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index cefb5e406030b28a58d7835468d0fe131e352cc0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/ohosTest/module.json5 b/ArkUIKit/NativeTypeSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 321c0b4e60f2f4e74219cfac290052130539b178..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NativeTypeSample/entry/src/test/List.test.ets b/ArkUIKit/NativeTypeSample/entry/src/test/List.test.ets deleted file mode 100644 index 74ba3a099410b447742c4a6ecac5c511bb63e5e7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NativeTypeSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index b367c75db8ae9ad0864a7c14f9bf2ce8c2b5e021..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/hvigor/hvigor-config.json5 b/ArkUIKit/NativeTypeSample/hvigor/hvigor-config.json5 deleted file mode 100644 index c46181e346e0b1a9f966305a9164616bd2db470e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "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/ArkUIKit/NativeTypeSample/hvigorfile.ts b/ArkUIKit/NativeTypeSample/hvigorfile.ts deleted file mode 100644 index de06c780c9687a49f0161e161816f18af7354ff0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/oh-package.json5 b/ArkUIKit/NativeTypeSample/oh-package.json5 deleted file mode 100644 index c1f77ef1fa70a9ffe74e46cdf21b6e0bda81aed5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/NativeTypeSample/ohosTest.md b/ArkUIKit/NativeTypeSample/ohosTest.md deleted file mode 100644 index 03d55be9956e1c1547ca5d0c27fe364ca165c43c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeTypeSample/ohosTest.md +++ /dev/null @@ -1,45 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期显示 | 是否自动 | 测试结果 | -| ------------------------------ | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | -------- | -| 启动应用 | 设备正常运行 | 1.开启开发板
2.编译hap包并将hap包及环境烧录进开发板,运行测试用例
| 成功拉起应用。 | 否 | 验证通过 | -| swiper设置自定义箭头功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第一个swiper左右两侧各有一个圆形的淡灰色的箭头,swiper内容为“0” | 否 | 验证通过 | -| swiper设置自定义导航点功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第二个swiper左上角有一个被选中为红色未被选中为灰色的导航栏,swiper内容为“0” | 否 | 验证通过 | -| swiper设置自定义数字导航栏功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第三个swiper左上角显示数字导航栏,左侧数字为1/14,其中数字1为红色,14为灰色,swiper内容为“0” | 否 | 验证通过 | -| DatePicker设置为年月模式 | 1.手机正常开机 2.应用正常安装 | 1.打开应用 2.选择DatePicker选项 3.点击"选择DATEPICKER模式",选择ARKUI_DATEPICKER_YEAR_AND_MONTH选项 4.点击"返回上级"按钮 | 1.应用成功打开 2.datePicker页面正常跳转 3.显示的datePicker为只有年和月的选项 4.成功返回上层页面 | 否 | 验证通过 | -| Progress自定义样式功能 | 1.手机正常开机 2.应用正常安装 | 1.打开应用 2.选择Progress选项 3.点击按钮"选择节点类型:",选择ARKUI_PROGRESS_TYPE_LINEAR 4.平滑效果打开,扫描效果打开,线宽输入30,圆角半径输入40,并点击按钮"设置styleOption:" 5.点击按钮"获取styleOption值并销毁" 6.点击"返回上级"按钮 | 1.应用成功打开 2.Progress页面正常跳转 3.显示的Progress组件为linear样式 4.显示的Progress组件为linear样式并线宽为30,圆角半径为40 5.显示"styleOption: scanEffectEnabled = 1 smoothEffectEnabled = 1 strokeWidth = 30.000000 strikeRadius = 40.000000" 6.成功返回上层页面 | 否 | 验证通过 | -| Image背景Y轴覆盖功能 | 1.手机正常开机 2.应用正常安装 | 1.打开应用 2.选择Image选项 3.点击按钮"选择背景覆盖方式ImageRepeat",选择ARKUI_IMAGE_REPEAT_Y 4.点击"返回上级"按钮 | 1.应用成功打开 2.Image页面正常跳转 3.显示图片的区域背景左侧为应用图标的竖向排列,并在中间单独显示一个应用图标 4.成功返回上层页面 | 否 | 验证通过 | -| Image图片适应左上角功能 | 1.手机正常开机 2.应用正常安装 | 1.打开应用 2.选择Image选项 3.点击按钮"选择图片填充效果ObjectFit",选择ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_START 4.点击"返回上级"按钮 | 1.应用成功打开 2.Image页面正常跳转 3.显示图片的区域背景为草原风景图,并在左上角单独显示一个应用图标 4.成功返回上层页面 | 否 | 验证通过 | -| TextPicker单列带图标显示功能 | 1.手机正常开机 2.应用正常安装 | 1.打开应用 2.选择TextPicker选项 3.点击按钮"选择TextPicker类型",选择ARKUI_TEXTPICKER_RANGETYPE_RANGE_CONTENT 4.点击"返回上级"按钮 | 1.应用成功打开 2.TextPicker页面正常跳转 3.按钮"选择TextPicker类型"下方出现新按钮"设置CrossLanguage并获取结果",还有一个显示CrossLanguageOption的Text组件,以及下方出现元素为"应用图标+first","应用图标+second"的TextPicker 4.成功返回上层页面 | 否 | 验证通过 | -| TextPicker级联显示功能 | 1.手机正常开机 2.应用正常安装 | 1.打开应用 2.选择TextPicker选项 3.点击按钮"选择TextPicker类型",选择ARKUI_TEXTPICKER_RANGETYPE_CASCADE_RANGE_CONTENT 4.点击按钮"设置CrossLanguage并获取结果",选择true 5.点击"返回上级"按钮 | 1.应用成功打开 2.TextPicker页面正常跳转 3.按钮"选择TextPicker类型"下方出现新按钮"设置CrossLanguage并获取结果",还有一个显示"CrossLanguageOption"的Text组件,以及下方出现父节点为"firstParent,secondParent"的级联TextPicker 4.Text组件中显示"CrossLanguageOption = true" 4.成功返回上层页面 | 否 | 验证通过 | -| Calendar选择框左对齐功能 | 1.手机正常开机 2.应用正常安装 | 1.打开应用 2.选择CalendarPicker选项 3.点击按钮"设置对齐方式",选择ARKUI_CALENDAR_ALIGNMENT_START,并点击CalendarPicker组件 4.点击"返回上级"按钮 | 1.应用成功打开 2.CalendarPicker页面正常跳转 3.显示出来的日历选择窗口,和CalendarPicker为左对齐形式 4.成功返回上层页面 | 否 | 验证通过 | -| ImageAnimator通过String创建并显示 | 1.手机正常开机 2.应用正常安装 | 1.打开应用 2.选择ImageAnimator选项 3.宽度处输入300,高度处输入300,顶部处输入200,左侧处输入200,持续时间处输入2000,点击按钮"创建mageAnimator",选择createImageAnimatorFromString 4.点击按钮"获取FrameInfo值并销毁" 5.点击"返回上级"按钮 | 1.应用成功打开 2.ImageAnimator页面正常跳转 3.以2000ms间隔交替显示两个动态图片,宽300px,高300px,位于距上边框200px,左侧200px处 4.显示"height = 300 width = 300 top = 200 left = 200 duration = 2000" 5.成功返回上层页面 | 否 | 验证通过 | -| ImageAnimator通过DrawableDescriptor创建并显示 | 1.手机正常开机 2.应用正常安装 | 1.打开应用 2.选择ImageAnimator选项 3.宽度处输入300,高度处输入300,顶部处输入200,左侧处输入200,持续时间处输入2000,点击按钮"创建mageAnimator",选择createImageAnimatorFromDrawableDescriptor 4.点击按钮"获取FrameInfo值并销毁" 5.点击"返回上级"按钮 | 1.应用成功打开 2.ImageAnimator页面正常跳转 3.以2000ms间隔交替显示两个纯色图片,宽300px,高300px,位于距上边框200px,左侧200px处 4.显示"height = 300 width = 300 top = 200 left = 200 duration = 2000" 5.成功返回上层页面 | 否 | 验证通过 | -| 基础 Text 样式展示 | 应用加载完成 | 1.查看第一段文本 | 1.宽 200vp 高 30vp 带边框,斜体 600 字重,超长跑马灯、不可复制 | 否 | 验证通过 | -| TextInput 输入功能 | 应用加载完成 | 1.点击输入框尝试输入 | 1.支持输入,第一个样式内联,第二个带清除按钮 | 否 | 验证通过 | -| Button普通样式展示 | 应用位于首页 | 1.点击首页Button按钮 2.点击ButtonType按钮 3.选择ARKUI_BUTTON_TYPE_NORMAL 4.点击返回按钮返回首页 | Button为普通按钮 | 否 | 验证通过 | -| Button胶囊样式展示 | 应用位于首页 | 1.点击首页Button按钮 2.点击ButtonType按钮 3.选择ARKUI_BUTTON_TYPE_CAPSULE 4.点击返回按钮返回首页 | Button为胶囊型按钮 | 否 | 验证通过 | -| Button圆形样式展示 | 应用位于首页 | 1.点击首页Button按钮 2.点击ButtonType按钮 3.选择ARKUI_BUTTON_TYPE_CIRCLE 4.点击返回按钮返回首页 | Button为圆形按钮 | 否 | 验证通过 | -| Button圆角矩形展示 | 应用位于首页 | 1.点击首页Button按钮 2.点击ButtonType按钮 3.选择ARKUI_BUTTON_ROUNDED_RECTANGLE 4.点击返回按钮返回首页 | Button为圆角矩形按钮 | 否 | 验证通过 | -| Slider默认圆形滑块展示 | 应用位于首页 | 1.点击首页Slider按钮 2.点击SliderBlockStyle按钮 3.选择ARKUI_SLIDER_BLOCK_STYLE_DEFAULT 4.点击返回按钮返回首页 | Slider使用默认圆形滑块 | 否 | 验证通过 | -| Slider图片资源滑块展示 | 应用位于首页 | 1.点击首页Slider按钮 2.点击SliderBlockStyle按钮 3.选择ARKUI_SLIDER_BLOCK_STYLE_IMAGE 4.点击返回按钮返回首页 | Slider使用图片资源作为滑块 | 否 | 验证通过 | -| Slider自定义形状滑块展示 | 应用位于首页 | 1.点击首页Slider按钮 2.点击SliderBlockStyle按钮 3.选择ARKUI_SLIDER_BLOCK_STYLE_SHAPE 4.点击返回按钮返回首页 | Slider使用自定义形状作为滑块,示例中为矩形 | 否 | 验证通过 | -| Slider设置滑块在滑轨上 | 应用位于首页 | 1.点击首页Slider按钮 2.点击SliderStyle按钮 3.选择ARKUI_SLIDER_STYLE_OUT_SET 4.点击返回按钮返回首页 | Slider滑块在滑轨上 | 否 | 验证通过 | -| Slider设置滑块在滑轨内 | 应用位于首页 | 1.点击首页Slider按钮 2.点击SliderStyle按钮 3.选择ARKUI_SLIDER_STYLE_IN_SET 4.点击返回按钮返回首页 | Slider滑块在滑轨内 | 否 | 验证通过 | -| Slider设置无滑块 | 应用位于首页 | 1.点击首页Slider按钮 2.点击SliderStyle按钮 3.选择ARKUI_SLIDER_STYLE_NONE 4.点击返回按钮返回首页 | Slider无滑块 | 否 | 验证通过 | -| Slider设置方向为纵向 | 应用位于首页 | 1.点击首页Slider按钮 2.点击SliderDirection按钮 3.选择ARKUI_SLIDER_DIRECTION_VERTICAL 4.点击返回按钮返回首页 | Slider方向变为为纵向 | 否 | 验证通过 | -| Slider设置方向为横向 | 应用位于首页 | 1.点击首页Slider按钮 2.点击SliderDirection按钮 3.选择ARKUI_SLIDER_DIRECTION_HORIZONTAL 4.点击返回按钮返回首页 | Slider方向变为为横向 | 否 | 验证通过 | -| Checkbox圆形样式展示 | 应用位于首页 | 1.点击首页CheckboxShape按钮 2.点击菜单CheckboxShape,选择ArkUI_CHECKBOX_SHAPE_CIRCLE 3.点击返回按钮返回首页 | 圆形样式Checkbox,可点击进行复选 | 否 | 验证通过 | -| Checkbox方形样式展示 | 应用位于首页 | 1.点击首页CheckboxShape按钮 2.点击菜单CheckboxShape,选择ArkUI_CHECKBOX_SHAPE_SQUARE 3.点击返回按钮返回首页 | 方形样式Checkbox,可点击进行复选 | 否 | 验证通过 | -| 设置悬停模式下显示区域的类型为屏幕上半部分区域(仅在折叠屏使用) | 应用位于首页 | 1.点击首页HoverModeAreaType按钮 2.点击菜单HoverModeAreaType,选择ARKUI_HOVER_MODE_AREA_TYPE_TOP 3.点击返回按钮返回首页 | 悬停模式下显示区域的类型为屏幕上半部分区域 | 否 | 验证通过 | -| 设置悬停模式下显示区域的类型为屏幕下半部分区域(仅在折叠屏使用) | 应用位于首页 | 1.点击首页HoverModeAreaType按钮 2.点击菜单HoverModeAreaType,选择ARKUI_HOVER_MODE_AREA_TYPE_BOTTOM 3.点击返回按钮返回首页 | 悬停模式下显示区域的类型为屏幕下半部分区域 | 否 | 验证通过 | -| EmbeddedComponent OnErrorCallback回调成功 | 执行 hdc shell param set persist.sys.abilityms.multi_process_model false 后重启,应用位于首页 | 1.点击首页embedded component按钮 | EmbeddedComponent onError回调被触发,打印日志{OnErrorCallback: code=100018, name=start_ability_fail, message=Start ui extension ability failed, please check the want of UIextensionAbility.} | 否 | 验证通过 | -| EmbeddedComponent OnTerminatedCallback回调成功 | 执行 hdc shell param set persist.sys.abilityms.multi_process_model true 后重启,应用位于首页 | 1.点击首页embedded component按钮 | EmbeddedComponent onError回调被触发,打印日志{OnTerminatedCallback: code=0} | 否 | 验证通过 | -| 文本无障碍属性设置 | 应用位于首页 | 1.点击首页Accessibility按钮 | 观测Get日志设置属性值与Set函数一致 | 否 | 验证通过 | -| visiblity属性设置 | 应用位于首页 | 1.点击首页Public按钮 | 观测页面ArkUI Visibility Demo下方有个设置了属性为VISIBLE的背景色为绿色的Text文本,同时该文本上方有一个Text文本大小的空白区域,为设置了Hidden被隐藏的Text文本。 | 否 | 验证通过 | -| 多态样式属性设置 | 应用位于首页 | 1.点击首页Public按钮
2.向下滑动,寻找标记为normal和effective的两个按钮 | 点击effective的按钮后,按钮样式发生变化,再次点击,按钮样式还原。 | 否 | 验证通过 | -| 截图属性设置 | 应用位于首页 | 1.点击首页Public按钮
2.向下滑动,寻找标记为截图的按钮 | 点击截图按钮后,打印出ComponentSnapshot相关日志。 | 否 | 验证通过 | -| ArkUI_HitTestMode属性设置 | 应用位于首页 | 1.点击首页Public按钮
2.向下滑动,寻找标记为ARKUI_HIT_TEST_MODE_DEFAULT的Text | 有四个分别设置了不同ArkUI_HitTestMode参数的背景色为黄色的Text,下方为设置ARKUI_HIT_TEST_MODE_DEFAULT的红色Text堆叠在设置为ARKUI_HIT_TEST_MODE_TRANSPARENT的绿色文本组件上,同时有设置ARKUI_HIT_TEST_MODE_DEFAULT的蓝色Text。 | 否 | 验证通过 | -| 验证XComponent创建成功 | 应用位于首页 | 1.点击首页XComponent按钮 | 1.包含两个XComponent显示框 | 否 | 验证通过 | \ No newline at end of file diff --git a/ArkUIKit/NativeTypeSample/screenshots/button.jpeg b/ArkUIKit/NativeTypeSample/screenshots/button.jpeg deleted file mode 100755 index 358954e776611aa4c35f7f9aab2e864e61f64e2e..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/button.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/checkbox_shape_circle.jpeg b/ArkUIKit/NativeTypeSample/screenshots/checkbox_shape_circle.jpeg deleted file mode 100755 index 682076cd716ce1ebc8ff5dcddd5a0f18242aee1a..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/checkbox_shape_circle.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/datePicker.png b/ArkUIKit/NativeTypeSample/screenshots/datePicker.png deleted file mode 100644 index 44ceae216a8077df58bae18de410c1a0f58216b4..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/datePicker.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/nativeType.png b/ArkUIKit/NativeTypeSample/screenshots/nativeType.png deleted file mode 100644 index e3cb9030a6cf763030bb783ba247d27185cebbbb..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/nativeType.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/page_calendarPicker.png b/ArkUIKit/NativeTypeSample/screenshots/page_calendarPicker.png deleted file mode 100644 index 01219db3e603a941f95553c6c3876e48fac48415..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/page_calendarPicker.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/page_image.png b/ArkUIKit/NativeTypeSample/screenshots/page_image.png deleted file mode 100644 index 103ad559aacb45ce37889aac74fac77898f1b09e..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/page_image.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/page_imageAnimator.png b/ArkUIKit/NativeTypeSample/screenshots/page_imageAnimator.png deleted file mode 100644 index afc0643734b81721edbfe2183b20ceddf8a1aace..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/page_imageAnimator.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/page_progress.png b/ArkUIKit/NativeTypeSample/screenshots/page_progress.png deleted file mode 100644 index c5dc5a214302d73c81b9bdc69e28acdcca5d4b23..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/page_progress.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/page_public.jpg b/ArkUIKit/NativeTypeSample/screenshots/page_public.jpg deleted file mode 100644 index fd64255045db1763b3ce92c0df90d26f2ccb75e0..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/page_public.jpg and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/page_swiper.jpeg b/ArkUIKit/NativeTypeSample/screenshots/page_swiper.jpeg deleted file mode 100644 index 714a9b9b5aa1fc5dc638805d0ba595236aec0429..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/page_swiper.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/page_textPicker.png b/ArkUIKit/NativeTypeSample/screenshots/page_textPicker.png deleted file mode 100644 index 7765772a1e7bf369e286008b443e78a0c791260b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/page_textPicker.png and /dev/null differ diff --git a/ArkUIKit/NativeTypeSample/screenshots/slider.jpeg b/ArkUIKit/NativeTypeSample/screenshots/slider.jpeg deleted file mode 100755 index 5bba21d451628d25e058d752d1cb0a42b33496da..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeTypeSample/screenshots/slider.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeXComponent/.gitignore b/ArkUIKit/NativeXComponent/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NativeXComponent/AppScope/app.json5 b/ArkUIKit/NativeXComponent/AppScope/app.json5 deleted file mode 100644 index 33e40e31af85a79aaa9242b628f577e0157a7ee4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.example.nativexcomponent", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NativeXComponent/AppScope/resources/base/element/string.json b/ArkUIKit/NativeXComponent/AppScope/resources/base/element/string.json deleted file mode 100644 index 79421a57da43fb2a471e3ade57c18b8d845b3647..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "NativeXComponent" - } - ] -} diff --git a/ArkUIKit/NativeXComponent/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NativeXComponent/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponent/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponent/README_zh.md b/ArkUIKit/NativeXComponent/README_zh.md deleted file mode 100644 index b58cb31d852f5f3c6a6311e141863e8edfd800b9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/README_zh.md +++ /dev/null @@ -1,111 +0,0 @@ -# NativeXComponent - -### 介绍 - -本示例主要介绍开发者如何使用ArkUI NDK API创建XComponent组件进行自定义绘制。主要包括:创建组件,获取ArkUI_NodeHandle和OH_ArkUI_SurfaceHolder实例,注册Surface生命周期和无障碍回调,设置可变帧率,获取NativeWindow后使用OpenGL ES/EGL接口在XComponent组件上进行图形绘制。功能主要包括绘制一个五角星,期望帧率设置,点击按钮开启/关闭软键盘,并可以通过点击XComponent区域改变五角星的颜色。 - -### 效果预览 - -| 绘制五角星 | 改变颜色 | -|-----------------------------------------------|-----------------------------------------------------| -| ![draw star](screenshots/device/drawStar.jpeg) | ![change color](screenshots/device/changeColor.jpeg) | - -使用说明 - -1. 安装编译生成的hap包,并打开应用。 -3. 点击XComponent组件区域(页面中蓝色五角星所在区域)改变五角星颜色。 -3. 点击“单指点击XComponent软键盘消失”对应区域,软键盘拉起;点击XComponent组件区域,软键盘消失。 -4. 点击needSoftKeyboard=false 按钮,点击“单指点击XComponent软键盘消失”对应区域,软键盘拉起;点击XComponent组件区域,软键盘不消失。 -5. 拖动期望帧率设置下的滑动条,可以控制期望帧率,具体通过打印日志的速度来衡量,日志检索"OnFrameCallback count"关键字。 - - -### 工程目录 - -``` -├──entry/src/main -│ ├──cpp // C++代码区 -│ │ ├──CMakeLists.txt // CMake配置文件 -│ │ ├──napi_init.cpp // Napi模块注册 -│ │ ├──manager // 生命周期管理模块 -│ │ │ ├──plugin_manager.cpp -│ │ │ └──plugin_manager.h -│ │ ├──render // 渲染模块 -│ │ │ ├──EGLConst.h -│ │ │ ├──EGLRender.cpp -│ │ │ └──EGLRender.h -| | ├──types -| | | ├──libnativerender -| | | | ├──Index.d.ts -| | | | ├──oh-package.json5 -│ ├──ets // ets代码区 -│ │ ├──entryability -│ │ │ ├──EntryAbility.ts // 程序入口类 -| | ├──entrybackupability -| | | ├──EntryBackupAbility.ets -│ │ ├──pages // 页面文件 -│ │ ├──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -通过在IDE中创建Native c++ 工程,在c++代码中定义对外接口为BindNode,在ArkTS侧调用该接口用于注册Surface生命周期、事件和无障碍等回调,在回调逻辑中实现绘制五角星的逻辑。 - -基于OH_ArkUI_SurfaceHolder实例,在Native侧调用OH_ArkUI_XComponent_GetNativeWindow创建NativeWindow实例并初始化 -EGL环境。在Native侧的OnsurfaceChanged回调中,传入OH_ArkUI_SurfaceHolder、宽和高,并以此为输入调用EGL相关的接口改变对应NativeWindow的尺寸和内容。 - -源码参考:[main目录](entry/src/main/)下的文件。涉及到的相关接口: - -| 接口名 | 描述 | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| OH_ArkUI_QueryModuleInterfaceByName(ArkUI_NativeAPIVariantKind type, const char* structName) | 获取指定类型的Native模块接口集合。 | -| OH_ArkUI_XComponent_GetNativeWindow(OH_ArkUI_SurfaceHolder* surfaceHolder) | 获取与OH_ArkUI_SurfaceHolder实例关联的nativeWindow。 | -| OH_ArkUI_SurfaceHolder_RemoveSurfaceCallback(OH_ArkUI_SurfaceHolder* surfaceHolder, OH_ArkUI_SurfaceCallback* callback) | 从OH_ArkUI_SurfaceHolder实例中移除先前添加的Surface生命周期回调。 | -| OH_ArkUI_SurfaceCallback_Dispose(OH_ArkUI_SurfaceCallback* callback) | 释放OH_ArkUI_SurfaceCallback对象。 | -| OH_ArkUI_SurfaceHolder_Dispose(OH_ArkUI_SurfaceHolder* surfaceHolder) | 释放OH_ArkUI_SurfaceHolder对象。 | -| OH_ArkUI_NodeEvent_GetEventType(ArkUI_NodeEvent* event) | 从组件事件获取事件类型。 | -| OH_ArkUI_NodeEvent_GetNodeHandle(ArkUI_NodeEvent* event) | 获取触发组件事件的组件对象。 | -| OH_ArkUI_GetNodeHandleFromNapiValue(napi_env env, napi_value frameNode, ArkUI_NodeHandle* handle) | 获取ArkTS侧创建的FrameNode节点对象映射到native侧的ArkUI_NodeHandle。 | -| OH_ArkUI_SurfaceHolder_Create(ArkUI_NodeHandle node) | 从XComponent节点创建一个OH_ArkUI_SurfaceHolder对象。 | -| OH_ArkUI_SurfaceCallback_Create() | 创建一个OH_ArkUI_SurfaceCallback对象。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceCreatedEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceCreated)(OH_ArkUI_SurfaceHolder* surfaceHolder)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceCreated回调。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceChangedEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceChanged)(OH_ArkUI_SurfaceHolder* surfaceHolder, uint64_t width, uint64_t height)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceChanged回调。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceDestroyedEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceDestroyed)(OH_ArkUI_SurfaceHolder* surfaceHolder)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceDestroyed回调。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceShowEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceShow)(OH_ArkUI_SurfaceHolder* surfaceHolder)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceShow回调。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceHide)(OH_ArkUI_SurfaceHolder* surfaceHolder)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceHide回调。 | -| OH_ArkUI_XComponent_RegisterOnFrameCallback(ArkUI_NodeHandle node, void (*callback)(ArkUI_NodeHandle node, uint64_t timestamp, uint64_t targetTimestamp)) | 为XComponent节点注册onFrame回调。 | -| OH_ArkUI_SurfaceHolder_AddSurfaceCallback(OH_ArkUI_SurfaceHolder* surfaceHolder, OH_ArkUI_SurfaceCallback* callback) | 往OH_ArkUI_SurfaceHolder实例注册OH_ArkUI_SurfaceCallback对象。 | -| OH_ArkUI_AccessibilityProvider_Create(ArkUI_NodeHandle node) | 从XComponent节点创建一个ArkUI_AccessibilityProvider对象。 | -| OH_ArkUI_XComponent_UnregisterOnFrameCallback(ArkUI_NodeHandle node) | 取消注册XComponent节点的onFrame回调。 | -| OH_ArkUI_AccessibilityProvider_Dispose(ArkUI_AccessibilityProvider* provider) | 释放ArkUI_AccessibilityProvider对象。 | -| OH_ArkUI_XComponent_SetExpectedFrameRateRange(ArkUI_NodeHandle node, OH_NativeXComponent_ExpectedRateRange range) | 为XComponent节点设置预期的帧率范围。 | -| OH_ArkUI_XComponent_SetNeedSoftKeyboard(ArkUI_NodeHandle node, bool needSoftKeyboard) | 设置XComponent节点在获得焦点时是否需要显示软键盘。 | - - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机、平板 - -2. 本示例为Stage模型,支持API20版本SDK,SDK版本号(API Version 20 Release),镜像版本号(6.0 Release) - -3. 本示例需要使用DevEco Studio 版本号(6.0.0 Release)及以上版本才可编译运行 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo ArkUIKit/NativeXComponent/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` diff --git a/ArkUIKit/NativeXComponent/build-profile.json5 b/ArkUIKit/NativeXComponent/build-profile.json5 deleted file mode 100644 index 3c424f6b26804dddb8116234ca937728c277e06b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/build-profile.json5 +++ /dev/null @@ -1,36 +0,0 @@ -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "5.0.0(12)", - "compatibleSdkVersion": "5.0.0(12)", - "runtimeOS": "HarmonyOS", - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/.gitignore b/ArkUIKit/NativeXComponent/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/build-profile.json5 b/ArkUIKit/NativeXComponent/entry/build-profile.json5 deleted file mode 100644 index 04e6f44bf067f702f7d6ff7d965bb2f54d15a7cf..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/build-profile.json5 +++ /dev/null @@ -1,40 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": true, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/hvigorfile.ts b/ArkUIKit/NativeXComponent/entry/hvigorfile.ts deleted file mode 100644 index c6edcd90486dd5a853cf7d34c8647f08414ca7a3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/ArkUIKit/NativeXComponent/entry/oh-package.json5 b/ArkUIKit/NativeXComponent/entry/oh-package.json5 deleted file mode 100644 index 811a0b10e04f84946f75b69e8b72f3bf7ec35000..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/oh-package.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": { - "libnativerender.so": "file:./src/main/cpp/types/libnativerender" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NativeXComponent/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 382141fc2d6da550b6a5108b36455c3e910f03a4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(LCNXComponent2) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/render - ${NATIVERENDER_ROOT_PATH}/manager) - -add_library(nativerender SHARED - render/EGLRender.cpp - manager/plugin_manager.cpp - napi_init.cpp) -find_library( - # Sets the name of the path variable. - EGL-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - EGL -) - -find_library( - # Sets the name of the path variable. - GLES-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - GLESv3 -) - -find_library( - # Sets the name of the path variable. - hilog-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - hilog_ndk.z -) - -find_library( - # Sets the name of the path variable. - libace-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_ndk.z -) - -find_library( - # Sets the name of the path variable. - libnapi-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_napi.z -) - -find_library( - # Sets the name of the path variable. - libuv-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - uv -) - -target_link_libraries(nativerender PUBLIC ${EGL-lib} ${GLES-lib} ${hilog-lib} ${libace-lib} ${libnapi-lib} ${libuv-lib} libnative_window.so) diff --git a/ArkUIKit/NativeXComponent/entry/src/main/cpp/manager/plugin_manager.cpp b/ArkUIKit/NativeXComponent/entry/src/main/cpp/manager/plugin_manager.cpp deleted file mode 100644 index 2fd0cda95a2280c5aaaf264ab8121269af58b2ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/cpp/manager/plugin_manager.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "plugin_manager.h" -#include -#include -#include -#include - -namespace NativeXComponentSample { -std::unordered_map PluginManager::nodeHandleMap_; -std::unordered_map PluginManager::callbackMap_; -std::unordered_map PluginManager::surfaceHolderMap_; -ArkUI_AccessibilityProvider *PluginManager::provider_ = nullptr; -ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); -namespace { -std::string value2String(napi_env env, napi_value value) // 将napi_value转化为string类型的变量 -{ - size_t stringSize = 0; - napi_get_value_string_utf8(env, value, nullptr, 0, &stringSize); - std::string valueString; - valueString.resize(stringSize); - napi_get_value_string_utf8(env, value, &valueString[0], stringSize + 1, &stringSize); - return valueString; -} - -void OnSurfaceCreated(OH_ArkUI_SurfaceHolder *holder) -{ - auto window = OH_ArkUI_XComponent_GetNativeWindow(holder); // 获取native window - auto render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->SetUpEGLContext(window); // 初始化egl环境 -} - -void OnSurfaceChanged(OH_ArkUI_SurfaceHolder *holder, uint64_t width, uint64_t height) -{ - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->SetEGLWindowSize(width, height); // 设置绘制区域大小 - render->DrawStar(true); // 绘制五角星 -} - -void OnSurfaceDestroyed(OH_ArkUI_SurfaceHolder *holder) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "onBind", "on destroyed"); - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->DestroySurface(); // 销毁eglSurface相关资源 -} - -void OnSurfaceShow(OH_ArkUI_SurfaceHolder *holder) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "on surface show"); -} - -void OnSurfaceHide(OH_ArkUI_SurfaceHolder *holder) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "on surface hide"); -} - -void OnFrameCallback(ArkUI_NodeHandle node, uint64_t timestamp, uint64_t targetTimestamp) -{ - if (!PluginManager::surfaceHolderMap_.count(node)) { - return; - } - static uint64_t count = 0; - count++; - if (count % FRAME_COUNT == 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "OnFrameCallback count = %{public}ld", count); - } -} - -void onEvent(ArkUI_NodeEvent *event) -{ - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); // 获取组件事件类型 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "on event"); - if (eventType == NODE_TOUCH_EVENT) { - ArkUI_NodeHandle handle = OH_ArkUI_NodeEvent_GetNodeHandle(event); // 获取触发该事件的组件对象 - auto holder = PluginManager::surfaceHolderMap_[handle]; - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->DrawStar(false); // 绘制五角星 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "on touch"); - } -} -} // namespace - -napi_value PluginManager::BindNode(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle handle; - OH_ArkUI_GetNodeHandleFromNapiValue(env, args[1], &handle); // 获取 nodeHandle - OH_ArkUI_SurfaceHolder *holder = OH_ArkUI_SurfaceHolder_Create(handle); // 获取 SurfaceHolder - nodeHandleMap_[nodeId] = handle; - surfaceHolderMap_[handle] = holder; - auto callback = OH_ArkUI_SurfaceCallback_Create(); // 创建 SurfaceCallback - callbackMap_[holder] = callback; - auto render = new EGLRender(); - OH_ArkUI_SurfaceHolder_SetUserData(holder, render); // 将render保存在holder中 - OH_ArkUI_SurfaceCallback_SetSurfaceCreatedEvent(callback, OnSurfaceCreated); // 注册OnSurfaceCreated回调 - OH_ArkUI_SurfaceCallback_SetSurfaceChangedEvent(callback, OnSurfaceChanged); // 注册OnSurfaceChanged回调 - OH_ArkUI_SurfaceCallback_SetSurfaceDestroyedEvent(callback, OnSurfaceDestroyed); // 注册OnSurfaceDestroyed回调 - OH_ArkUI_SurfaceCallback_SetSurfaceShowEvent(callback, OnSurfaceShow); // 注册OnSurfaceShow回调 - OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent(callback, OnSurfaceHide); // 注册OnSurfaceHide回调 - OH_ArkUI_XComponent_RegisterOnFrameCallback(handle, OnFrameCallback); // 注册OnFrameCallback回调 - OH_ArkUI_SurfaceHolder_AddSurfaceCallback(holder, callback); // 注册SurfaceCallback回调 - if (!nodeAPI->addNodeEventReceiver(handle, onEvent)) { // 添加事件监听,返回成功码 0 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "addNodeEventReceiver error"); - } - if (!nodeAPI->registerNodeEvent(handle, NODE_TOUCH_EVENT, 0, nullptr)) { // 用C接口注册touch事件,返回成功码 0 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "registerTouchEvent error"); - } - provider_ = OH_ArkUI_AccessibilityProvider_Create(handle); // 创建一个ArkUI_AccessibilityProvider类型的对象 - /** - * 获取ArkUI_AccessibilityProvider后,如果注册无障碍回调函数请参考: - * https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/ndk-accessibility-xcomponent.md - * **/ - return nullptr; -} - -napi_value PluginManager::UnbindNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - OH_ArkUI_XComponent_UnregisterOnFrameCallback(node); // 解注册帧回调 - OH_ArkUI_AccessibilityProvider_Dispose(provider_); // 销毁 ArkUI_AccessibilityProvider - auto holder = surfaceHolderMap_[node]; - if (PluginManager::callbackMap_.count(holder)) { - auto callback = PluginManager::callbackMap_[holder]; - OH_ArkUI_SurfaceHolder_RemoveSurfaceCallback(holder, callback); // 移除SurfaceCallback - OH_ArkUI_SurfaceCallback_Dispose(callback); // 销毁surfaceCallback - PluginManager::callbackMap_.erase(holder); - } - auto render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - delete render; // 销毁EGLRender对象 - OH_ArkUI_SurfaceHolder_Dispose(holder); // 销毁surfaceHolder - nodeAPI->disposeNode(node); // 销毁nodeHandle - nodeHandleMap_.erase(nodeId); - return nullptr; -} - -napi_value PluginManager::SetFrameRate(napi_env env, napi_callback_info info) -{ - size_t argc = 4; - napi_value args[4] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - auto node = nodeHandleMap_[nodeId]; - - int32_t min = 0; - napi_get_value_int32(env, args[FIRST_ARG], &min); - - int32_t max = 0; - napi_get_value_int32(env, args[SECOND_ARG], &max); - - int32_t expected = 0; - napi_get_value_int32(env, args[THIRD_ARG], &expected); - OH_NativeXComponent_ExpectedRateRange range = {.min = min, .max = max, .expected = expected}; - OH_ArkUI_XComponent_SetExpectedFrameRateRange(node, range); // 设置期望帧率 - return nullptr; -} - -napi_value PluginManager::SetNeedSoftKeyboard(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - - bool needSoftKeyboard = false; - napi_get_value_bool(env, args[1], &needSoftKeyboard); - OH_ArkUI_XComponent_SetNeedSoftKeyboard(node, needSoftKeyboard); // 设置是否需要软键盘 - return nullptr; -} - -napi_value PluginManager::Initialize(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - OH_ArkUI_XComponent_Initialize(node); - auto holder = surfaceHolderMap_[node]; - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->DrawStar(true); // 绘制五角星 - return nullptr; -} - -napi_value PluginManager::Finalize(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - auto holder = surfaceHolderMap_[node]; - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->Clear(); - OH_ArkUI_XComponent_Finalize(node); - return nullptr; -} - -napi_value PluginManager::DrawStar(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - auto holder = surfaceHolderMap_[node]; - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "onBind", "YGB DrawStar w:[%{public}d],h[%{public}d]", render->width_, - render->height_); - render->DrawStar(true); // 绘制五角星 - return nullptr; -} -} // namespace NativeXComponentSample \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/cpp/manager/plugin_manager.h b/ArkUIKit/NativeXComponent/entry/src/main/cpp/manager/plugin_manager.h deleted file mode 100644 index 04315fe5d0c15ecc38b3454348713743c9e59f8f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/cpp/manager/plugin_manager.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVEXCOMPONENT_PLUGIN_MANAGER_H -#define NATIVEXCOMPONENT_PLUGIN_MANAGER_H - -#include "render/EGLRender.h" -#include -#include "napi/native_api.h" -#include -#include -#include - -namespace NativeXComponentSample { -constexpr const int FIRST_ARG = 1; -constexpr const int SECOND_ARG = 2; -constexpr const int THIRD_ARG = 3; -constexpr const int FRAME_COUNT = 50; -class PluginManager { -public: - ~PluginManager(); - static napi_value BindNode(napi_env env, napi_callback_info info); - static napi_value UnbindNode(napi_env env, napi_callback_info info); - static napi_value SetFrameRate(napi_env env, napi_callback_info info); - static napi_value SetNeedSoftKeyboard(napi_env env, napi_callback_info info); - static napi_value Initialize(napi_env env, napi_callback_info info); - static napi_value Finalize(napi_env env, napi_callback_info info); - static napi_value DrawStar(napi_env env, napi_callback_info info); - -public: - static std::unordered_map nodeHandleMap_; - static std::unordered_map callbackMap_; - static std::unordered_map surfaceHolderMap_; - static ArkUI_AccessibilityProvider *provider_; -}; -} // namespace NativeXComponentSample -#endif // NATIVEXCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NativeXComponent/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NativeXComponent/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 7aa0de275908f43d7d015274fdd56a4b60df7812..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "manager/plugin_manager.h" - -namespace NativeXComponentSample { - -// 在napi_init.cpp文件中,Init方法注册接口函数,从而将封装的C++方法传递出来,供ArkTS侧调用 -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - // 向ArkTS侧暴露接口 - napi_property_descriptor desc[] = { - {"bindNode", nullptr, PluginManager::BindNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"unbindNode", nullptr, PluginManager::UnbindNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setFrameRate", nullptr, PluginManager::SetFrameRate, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setNeedSoftKeyboard", nullptr, PluginManager::SetNeedSoftKeyboard, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"initialize", nullptr, PluginManager::Initialize, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"finalize", nullptr, PluginManager::Finalize, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"drawStar", nullptr, PluginManager::DrawStar, nullptr, nullptr, nullptr, napi_default, nullptr}, - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -// 编写接口的描述信息,根据实际需要可以修改对应参数 -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - // 入口函数 - .nm_register_func = Init, // 指定加载对应模块时的回调函数 - // 模块名称 - .nm_modname = - "nativerender", // 指定模块名称,对于XComponent相关开发,这个名称必须和ArkTS侧XComponent中libraryname的值保持一致 - .nm_priv = ((void *)0), - .reserved = {0}, -}; -} // namespace NativeXComponentSample - -// __attribute__((constructor))修饰的方法由系统自动调用,使用Node-API接口napi_module_register()传入模块描述信息进行模块注册 -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&NativeXComponentSample::demoModule); -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/cpp/render/EGLConst.h b/ArkUIKit/NativeXComponent/entry/src/main/cpp/render/EGLConst.h deleted file mode 100644 index 898610fb6961e8b788a2f50fb544afb53e0ffa2a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/cpp/render/EGLConst.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVEXCOMPONENT_EGLCONST_H -#define NATIVEXCOMPONENT_EGLCONST_H -#include -#include -#include - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -/** - * Program error. - */ -const GLuint PROGRAM_ERROR = 0; - -/** - * Position error. - */ -const GLint POSITION_ERROR = -1; - -/** - * Default x position. - */ -const int DEFAULT_X_POSITION = 0; - -/** - * Default y position. - */ -const int DEFAULT_Y_POSITION = 0; - -/** - * Gl red default. - */ -const GLfloat GL_RED_DEFAULT = 0.0; - -/** - * Gl green default. - */ -const GLfloat GL_GREEN_DEFAULT = 0.0; - -/** - * Gl blue default. - */ -const GLfloat GL_BLUE_DEFAULT = 0.0; - -/** - * Gl alpha default. - */ -const GLfloat GL_ALPHA_DEFAULT = 1.0; - -/** - * Pointer size. - */ -const GLint POINTER_SIZE = 2; - -/** - * Triangle fan size. - */ -const GLsizei TRIANGLE_FAN_SIZE = 4; - -/** - * Fifty percent. - */ -const float FIFTY_PERCENT = 0.5; - -/** - * Position handle name. - */ -const char POSITION_NAME[] = "a_position"; - -/** - * numeric value 0. - */ -const int NUM_0 = 0; - -/** - * numeric value 4. - */ -const int NUM_4 = 4; - -/** - * Background color #f4f4f4. - */ -const GLfloat BACKGROUND_COLOR[] = {244.0f / 255, 244.0f / 255, 244.0f / 255, 1.0f}; - -/** - * Background color #ffffff00. - */ -const GLfloat TRANSPARENT_COLOR[] = {255.0f / 255, 255.0f / 255, 255.0f / 255, 0.0f}; - -/** - * Draw color #7E8FFB. - */ -const GLfloat DRAW_COLOR[] = {126.0f / 255, 143.0f / 255, 251.0f / 255, 1.0f}; - -/** - * Change color #92D6CC. - */ -const GLfloat CHANGE_COLOR[] = {146.0f / 255, 214.0f / 255, 204.0f / 255, 1.0f}; - -/** - * Background area. - */ -const GLfloat BACKGROUND_RECTANGLE_VERTICES[] = {-1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f}; - -const EGLint ATTRIB_LIST[] = { - // Key,value. - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, 8, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - // End. - EGL_NONE}; - -const EGLint CONTEXT_ATTRIBS[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE}; - -/** - * Vertex shader. - */ -const char VERTEX_SHADER[] = "#version 300 es\n" - "layout(location = 0) in vec4 a_position;\n" - "layout(location = 1) in vec4 a_color; \n" - "out vec4 v_color; \n" - "void main() \n" - "{ \n" - " gl_Position = a_position; \n" - " v_color = a_color; \n" - "} \n"; - -/** - * Fragment shader. - */ -const char FRAGMENT_SHADER[] = "#version 300 es\n" - "precision mediump float; \n" - "in vec4 v_color; \n" - "out vec4 fragColor; \n" - "void main() \n" - "{ \n" - " fragColor = v_color; \n" - "} \n"; -#endif // NATIVEXCOMPONENT_EGLCONST_H diff --git a/ArkUIKit/NativeXComponent/entry/src/main/cpp/render/EGLRender.cpp b/ArkUIKit/NativeXComponent/entry/src/main/cpp/render/EGLRender.cpp deleted file mode 100644 index f82795fc79e40b56fb40674430c0e8f34e62fd68..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/cpp/render/EGLRender.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "EGLRender.h" -#include "EGLConst.h" -#include -#include -#include -#include -#include -#include -#include -#include - -namespace { -void Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat *rotateX, GLfloat *rotateY, GLfloat theta) -{ - GLfloat tempX = cos(theta) * (*rotateX - centerX) - sin(theta) * (*rotateY - centerY); - GLfloat tempY = sin(theta) * (*rotateX - centerX) + cos(theta) * (*rotateY - centerY); - *rotateX = tempX + centerX; - *rotateY = tempY + centerY; -} - -GLuint LoadShader(GLenum type, const char *shaderSrc) -{ - if ((type <= 0) || (shaderSrc == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "glCreateShader type or shaderSrc error"); - return PROGRAM_ERROR; - } - - GLuint shader = glCreateShader(type); - if (shader == 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "glCreateShader unable to load shader"); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glShaderSource(shader, 1, &shaderSrc, nullptr); - glCompileShader(shader); - - GLint compiled; - glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); - if (compiled != 0) { - return shader; - } - - GLint infoLen = 0; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen <= 1) { - glDeleteShader(shader); - return PROGRAM_ERROR; - } - - char *infoLog = (char *)malloc(sizeof(char) * (infoLen + 1)); - if (infoLog != nullptr) { - memset(infoLog, 0, infoLen + 1); - glGetShaderInfoLog(shader, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "glCompileShader error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(shader); - return PROGRAM_ERROR; -} - -GLuint CreateProgram(const char *vertexShader, const char *fragShader) -{ - if ((vertexShader == nullptr) || (fragShader == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", - "createProgram: vertexShader or fragShader is null"); - return PROGRAM_ERROR; - } - - GLuint vertex = LoadShader(GL_VERTEX_SHADER, vertexShader); - if (vertex == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "createProgram vertex error"); - return PROGRAM_ERROR; - } - - GLuint fragment = LoadShader(GL_FRAGMENT_SHADER, fragShader); - if (fragment == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "createProgram fragment error"); - return PROGRAM_ERROR; - } - - GLuint program = glCreateProgram(); - if (program == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "createProgram program error"); - glDeleteShader(vertex); - glDeleteShader(fragment); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glAttachShader(program, vertex); - glAttachShader(program, fragment); - glLinkProgram(program); - - GLint linked; - glGetProgramiv(program, GL_LINK_STATUS, &linked); - if (linked != 0) { - glDeleteShader(vertex); - glDeleteShader(fragment); - return program; - } - - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "createProgram linked error"); - GLint infoLen = 0; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen > 1) { - char *infoLog = (char *)malloc(sizeof(char) * (infoLen + 1)); - memset(infoLog, 0, infoLen + 1); - glGetProgramInfoLog(program, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "glLinkProgram error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(vertex); - glDeleteShader(fragment); - glDeleteProgram(program); - return PROGRAM_ERROR; -} -} // namespace - -bool EGLRender::SetUpEGLContext(void *window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLRender", "EglContextInit execute"); - eglWindow_ = (EGLNativeWindowType)(window); - // Init display. - eglDisplay_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (eglDisplay_ == EGL_NO_DISPLAY) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "eglGetDisplay: unable to get EGL display"); - return false; - } - EGLint majorVersion; - EGLint minorVersion; - if (!eglInitialize(eglDisplay_, &majorVersion, &minorVersion)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", - "eglInitialize: unable to get initialize EGL display"); - return false; - }; - // Select configuration. - const EGLint maxConfigSize = 1; - EGLint numConfigs; - if (!eglChooseConfig(eglDisplay_, ATTRIB_LIST, &eglConfig_, maxConfigSize, &numConfigs)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "eglChooseConfig: unable to choose configs"); - return false; - }; - // CreateEnvironment. - // Create surface. - eglSurface_ = eglCreateWindowSurface(eglDisplay_, eglConfig_, eglWindow_, NULL); - if (eglSurface_ == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", - "eglCreateWindowSurface: unable to create surface"); - return false; - } - if (eglSurface_ == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", - "eglCreateWindowSurface: unable to create surface"); - return false; - } - // Create context. - eglContext_ = eglCreateContext(eglDisplay_, eglConfig_, EGL_NO_CONTEXT, CONTEXT_ATTRIBS); - if (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "eglMakeCurrent failed"); - return false; - } - // Create program. - program_ = CreateProgram(VERTEX_SHADER, FRAGMENT_SHADER); - if (program_ == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "CreateProgram: unable to create program"); - return false; - } - return true; -} - -GLint EGLRender::PrepareDraw() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (eglContext_ == nullptr) || - (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "PrepareDraw: param error"); - return POSITION_ERROR; - } - - // The gl function has no return value. - glViewport(DEFAULT_X_POSITION, DEFAULT_Y_POSITION, width_, height_); - glClearColor(GL_RED_DEFAULT, GL_GREEN_DEFAULT, GL_BLUE_DEFAULT, GL_ALPHA_DEFAULT); - glClear(GL_COLOR_BUFFER_BIT); - glUseProgram(program_); - - return glGetAttribLocation(program_, POSITION_NAME); -} - -void EGLRender::DrawStar(bool drawColor) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLRender", "Draw"); - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, BACKGROUND_RECTANGLE_VERTICES)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw execute draw background failed"); - return; - } - - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices - GLfloat rotateX = 0; - GLfloat rotateY = FIFTY_PERCENT * height_; - GLfloat centerX = 0; - // Convert DEG(54° & 18°) to RAD - GLfloat centerY = -rotateY * (M_PI / 180 * 54) * (M_PI / 180 * 18); - // Convert DEG(18°) to RAD - GLfloat leftX = -rotateY * (M_PI / 180 * 18); - GLfloat leftY = 0; - // Convert DEG(18°) to RAD - GLfloat rightX = rotateY * (M_PI / 180 * 18); - GLfloat rightY = 0; - - const GLfloat shapeVertices[] = {centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_}; - auto color = drawColor ? DRAW_COLOR : CHANGE_COLOR; - if (!ExecuteDraw(position, color, shapeVertices)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw execute draw shape failed"); - return; - } - - // Convert DEG(72°) to RAD - GLfloat rad = M_PI / 180 * 72; - // Rotate four times - for (int i = NUM_0; i < NUM_4; ++i) { - Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); - Rotate2d(centerX, centerY, &leftX, &leftY, rad); - Rotate2d(centerX, centerY, &rightX, &rightY, rad); - - const GLfloat shapeVertices[] = {centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_}; - - if (!ExecuteDraw(position, color, shapeVertices)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw execute draw shape failed"); - return; - } - } - // 将绘制命令提交给GPU,GPU执行完成后将渲染结果显示到屏幕 - glFlush(); - glFinish(); - if (!eglSwapBuffers(eglDisplay_, eglSurface_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw FinishDraw failed"); - return; - } -} - -void EGLRender::Clear() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (eglContext_ == nullptr) || - (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "PrepareDraw: param error"); - return; - } - - // The gl function has no return value. - glViewport(DEFAULT_X_POSITION, DEFAULT_Y_POSITION, width_, height_); - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); - glFlush(); - glFinish(); - eglSwapBuffers(eglDisplay_, eglSurface_); -} - -bool EGLRender::ExecuteDraw(GLint position, const GLfloat *color, const GLfloat shapeVertices[]) -{ - if ((position > 0) || (color == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glEnableVertexAttribArray(position); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - - return true; -} - -void EGLRender::SetEGLWindowSize(int width, int height) -{ - width_ = width; - height_ = height; -} - -void EGLRender::DestroySurface() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (!eglDestroySurface(eglDisplay_, eglSurface_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "EGLRender", "Release eglDestroySurface failed"); - } - - if ((eglDisplay_ == nullptr) || (eglContext_ == nullptr) || (!eglDestroyContext(eglDisplay_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "EGLRender", "Release eglDestroySurface failed"); - } - - if ((eglDisplay_ == nullptr) || (!eglTerminate(eglDisplay_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "EGLRender", "Release eglDestroySurface failed"); - } - eglDisplay_ = EGL_NO_DISPLAY; - eglSurface_ = EGL_NO_SURFACE; - eglContext_ = EGL_NO_CONTEXT; -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/cpp/render/EGLRender.h b/ArkUIKit/NativeXComponent/entry/src/main/cpp/render/EGLRender.h deleted file mode 100644 index eeed4f21d33a9e32b989bd45694eccd723a10815..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/cpp/render/EGLRender.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVEXCOMPONENT_EGLRENDER_H -#define NATIVEXCOMPONENT_EGLRENDER_H - -#include "EGLConst.h" -#include -#include -#include -#include -#include - -class EGLRender { -public: - bool SetUpEGLContext(void *window); - void SetEGLWindowSize(int width, int height); - void DrawStar(bool drawColor); - void DestroySurface(); - void Clear(); - - std::string xcomponentId; - EGLNativeWindowType eglWindow_; - - EGLDisplay eglDisplay_ = EGL_NO_DISPLAY; - EGLConfig eglConfig_ = EGL_NO_CONFIG_KHR; - EGLSurface eglSurface_ = EGL_NO_SURFACE; - EGLContext eglContext_ = EGL_NO_CONTEXT; - GLuint program_; - int width_ = 0; - int height_ = 0; - -private: - GLint PrepareDraw(); - bool ExecuteDraw(GLint position, const GLfloat *color, const GLfloat shapeVertices[]); -}; -#endif // NATIVEXCOMPONENT_EGLRENDER_H diff --git a/ArkUIKit/NativeXComponent/entry/src/main/cpp/types/libnativerender/Index.d.ts b/ArkUIKit/NativeXComponent/entry/src/main/cpp/types/libnativerender/Index.d.ts deleted file mode 100644 index 6145f43c5c7d82c0a044755eebca11883ad05de0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/cpp/types/libnativerender/Index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -export const bindNode: (id: string, node: object) => void; -export const unbindNode: (id: string) => void; -export const setFrameRate: (id: string, min: number, max: number, expected: number) => void; -export const setNeedSoftKeyboard: (id: string, needSoftKeyborad: boolean) => void; -export const initialize: (id: string) => void; -export const finalize: (id: string) => void; -export const drawStar: (id: string) => void; diff --git a/ArkUIKit/NativeXComponent/entry/src/main/cpp/types/libnativerender/oh-package.json5 b/ArkUIKit/NativeXComponent/entry/src/main/cpp/types/libnativerender/oh-package.json5 deleted file mode 100644 index 78545bfb4030791657a728b8cc790495fd7e29be..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/cpp/types/libnativerender/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libnativerender.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NativeXComponent/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6a1b23532e867a0d7c63e1b6c1b9c21b0350ae88..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeXComponent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NativeXComponent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 2a89be4fd2886b169f4a62f1a1f3cbf7b9211c08..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeXComponent/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeXComponent/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 73d3039df13c4cf1c0ced1cfc0641b97e1028e3b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2025 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 native from 'libnativerender.so'; -import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; - -class MyNodeController extends NodeController { - xComponent: typeNode.XComponent | undefined = undefined; - xComponentId: string = 'xcp' + (new Date().getTime()); - node: FrameNode | undefined = undefined; - column: typeNode.Column | undefined = undefined; - attachButton: typeNode.Button | undefined = undefined; - detachButton: typeNode.Button | undefined = undefined; - makeNode(uiContext: UIContext): FrameNode | null { - this.node = new FrameNode(uiContext); - this.column = typeNode.createNode(uiContext, "Column") - this.column.initialize() - .width("100%") - .height("100%") - this.node.appendChild(this.column) - - this.xComponent = typeNode.createNode(uiContext, 'XComponent', { type: XComponentType.SURFACE }); - this.xComponent.attribute - .id(this.xComponentId) - .focusable(true) - .focusOnTouch(true) - native.bindNode(this.xComponentId, this.xComponent) - this.column.appendChild(this.xComponent); - - return this.node; - } - - aboutToDisappear(): void { - native.unbindNode(this.xComponentId) - this.node?.removeChild(this.xComponent) - this.xComponent?.dispose(); - } -} - -@Entry -@Component -struct Index { - @State isShow: boolean = true; - @State minRate: number = 0; - @State maxRate: number = 120; - @State expected: number = 60; - needSoftKeyboard: boolean = false; - @State needSoftKeyboardState: string = 'needSoftKeyboard=' + this.needSoftKeyboard; - @State text: string = '单指点击XComponent软键盘消失'; - controller: TextInputController = new TextInputController(); - myNodeController: MyNodeController = new MyNodeController(); - - build() { - Column() { - TextInput({ text: this.text, placeholder: 'please input ...', controller: this.controller }) - .id('textInput') - .placeholderColor(Color.Grey) - .placeholderFont({ size: 14, weight: 400 }) - .caretColor(Color.Blue) - .width(400) - .height(40) - .margin(20) - .fontSize(14) - .fontColor(Color.Black) - .onChange((value: string) => { - this.text = value - }) - Column() { - if (this.isShow) { - NodeContainer(this.myNodeController) - .width(200) - .height(200) - .focusable(true) - .focusOnTouch(true) - .defaultFocus(true) - } - }.height(200) - - Button('创建/销毁').onClick(() => { - this.isShow = !this.isShow; - }) - - Column() { - Text('期望帧率设置:') - .textAlign(TextAlign.Start) - .fontSize(15) - .border({ width: 1 }) - .padding(10) - .width('100%') - .margin(5) - Text('min: ' + this.minRate) - Slider({ - value: this.minRate, - min: 0, - max: 240, - step: 1 - }).onChange((value: number, mode: SliderChangeMode) => { - this.minRate = value; - native.setFrameRate(this.myNodeController.xComponentId, this.minRate, this.maxRate, this.expected) - }).width('100%') - .id('minSlider') - Text('max: ' + this.maxRate) - Slider({ - value: this.maxRate, - min: 0, - max: 240, - step: 1 - }).onChange((value: number, mode: SliderChangeMode) => { - this.maxRate = value; - native.setFrameRate(this.myNodeController.xComponentId, this.minRate, this.maxRate, this.expected) - }).width('100%') - .id('maxSlider') - Text('expected: ' + this.expected) - Slider({ - value: this.expected, - min: 0, - max: 240, - step: 1 - }).onChange((value: number, mode: SliderChangeMode) => { - this.expected = value; - native.setFrameRate(this.myNodeController.xComponentId, this.minRate, this.maxRate, this.expected) - }).width('100%') - .id('expectedSlider') - }.backgroundColor("#F0FAFF") - - Button(this.needSoftKeyboardState) - .onClick(() => { - this.needSoftKeyboard = !this.needSoftKeyboard; - this.needSoftKeyboardState = 'needSoftKeyboard=' + this.needSoftKeyboard; - native.setNeedSoftKeyboard(this.myNodeController.xComponentId, this.needSoftKeyboard); - this.text = this.needSoftKeyboard ? '单指点击XComponent软键盘不消失' : '单指点击XComponent软键盘消失' - }) - Button("Initialize") - .onClick(()=>{ - native.initialize(this.myNodeController.xComponentId) - }) - Button("Finalize") - .onClick(()=>{ - native.finalize(this.myNodeController.xComponentId) - }) - } - .width('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/module.json5 b/ArkUIKit/NativeXComponent/entry/src/main/module.json5 deleted file mode 100644 index 6dab6c3ea382e4cc82e8f63389773dfc1daddb59..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/module.json5 +++ /dev/null @@ -1,51 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "phone", - "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/ArkUIKit/NativeXComponent/entry/src/main/resources/base/element/color.json b/ArkUIKit/NativeXComponent/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/element/string.json b/ArkUIKit/NativeXComponent/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/background.png b/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NativeXComponent/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NativeXComponent/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NativeXComponent/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NativeXComponent/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NativeXComponent/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NativeXComponent/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 7bd75c438f414741963133cf22b130b218b3f99c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2025 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { describe, it, expect } from '@ohos/hypium'; -import { Driver, MatchPattern, ON, MouseButton } from '@ohos.UiTest'; - -const TAG = '[Sample_Native_XComponent]'; - -export default function abilityTest() { - - describe('ActsAbilityTest', () => { - /** - * 打开应用 - */ - it('StartAbility_001', 0, async (done: Function) => { - console.info(TAG, 'StartAbility_001 begin'); - let driver = Driver.create(); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - try { - await abilityDelegator.startAbility({ - bundleName: 'com.example.nativexcomponent', - abilityName: 'EntryAbility' - }); - } catch (exception) { - console.info(TAG, `StartAbility_001 exception = ${JSON.stringify(exception)}`); - expect().assertFail(); - } - await driver.delayMs(1000); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard=',MatchPattern.STARTS_WITH)); - done(); - console.info(TAG, 'StartAbility_001 end'); - }) - - /** - * 点击按钮,按钮 - */ - it('DrawShape_001', 2, async (done: Function) => { - console.info(TAG, 'CreateFiles_001 begin'); - let driver = Driver.create(); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.id('xcp',MatchPattern.STARTS_WITH)); - // 判断是否有按键 - await driver.assertComponentExist(ON.text('创建/销毁')); - let drawStarBtn = await driver.findComponent(ON.text('创建/销毁')); - // 点击'创建/销毁'按钮 - await drawStarBtn.click(); - await driver.delayMs(1000); - - // 判断xcomponent组件已经消失 - let xcomponent = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent === null).assertTrue(); - - await drawStarBtn.click(); - await driver.delayMs(1000); - // 判断xcomponent组件复现 - let xcomponent2 = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent2 === null).assertFalse(); - done(); - console.info(TAG, 'DrawShape_001 end'); - }) - - it('DrawShape_002', 2, async (done: Function) => { - console.info(TAG, 'DrawShape_002 begin'); - let driver = Driver.create(); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.id('xcp',MatchPattern.STARTS_WITH)); - // 判断是否有按键 - await driver.assertComponentExist(ON.text('创建/销毁')); - - // 点击XComponent组件 - let xcomponent = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent === null).assertFalse(); - await xcomponent.click(); - await driver.delayMs(1000); - // 判断touch回调已执行 - await driver.assertComponentExist(ON.id('xcp',MatchPattern.STARTS_WITH)); - done(); - console.info(TAG, 'DrawShape_002 end'); - }) - - it('SetExpectedFrameRate_001 ', 2, async (done: Function) => { - console.info(TAG, 'SetExpectedFrameRate_001 start'); - let driver = await Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let minBtn = await driver.findComponent(ON.text('min', MatchPattern.STARTS_WITH)); - expect(minBtn === null).assertFalse(); - - let minSlider = await driver.findComponent(ON.id('minSlider')); - expect(minSlider === null).assertFalse(); - let point = await minSlider.getBoundsCenter(); - await driver.mouseClick(point, MouseButton.MOUSE_BUTTON_LEFT); - await driver.delayMs(1000); - - let text = await minBtn.getText(); - expect(text.toString() == 'min: 120').assertTrue(); - - done(); - console.info(TAG, 'SetExpectedFrameRate_001 end'); - }) - - it('SetExpectedFrameRate_002 ', 2, async (done: Function) => { - console.info(TAG, 'SetExpectedFrameRate_002 start'); - let driver = await Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let maxBtn = await driver.findComponent(ON.text('max', MatchPattern.STARTS_WITH)); - expect(maxBtn === null).assertFalse(); - - let maxSlider = await driver.findComponent(ON.id('maxSlider')); - expect(maxSlider === null).assertFalse(); - let rect = await maxSlider.getBounds(); - await driver.mouseClick({x:rect.right, y:(rect.top+rect.bottom)/2}, MouseButton.MOUSE_BUTTON_LEFT); - await driver.delayMs(1000); - - let text = await maxBtn.getText(); - expect(text.toString() == 'max: 240').assertTrue(); - - done(); - console.info(TAG, 'SetExpectedFrameRate_002 end'); - }) - - it('SetExpectedFrameRate_003 ', 2, async (done: Function) => { - console.info(TAG, 'SetExpectedFrameRate_003 start'); - let driver = await Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let expectedBtn = await driver.findComponent(ON.text('expected', MatchPattern.STARTS_WITH)); - expect(expectedBtn === null).assertFalse(); - - let expectedSlider = await driver.findComponent(ON.id('expectedSlider')); - expect(expectedSlider === null).assertFalse(); - let point = await expectedSlider.getBoundsCenter(); - await driver.mouseClick(point, MouseButton.MOUSE_BUTTON_LEFT); - await driver.delayMs(1000); - - let text = await expectedBtn.getText(); - expect(text.toString() == 'expected: 120').assertTrue(); - - done(); - console.info(TAG, 'SetExpectedFrameRate_003 end'); - }) - - it('SetSoftKeyboard_001', 2, async (done: Function) => { - console.info(TAG, 'SetSoftKeyboard_001 start'); - let driver = Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let text = await driver.findComponent(ON.id('textInput')); - expect(text === null).assertFalse(); - await text.click(); - await driver.delayMs(1000); - expect(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH) == null).assertFalse(); - - // 点击XComponent组件 - let xcomponent = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent === null).assertFalse(); - await xcomponent.click(); - await driver.delayMs(1000); - - done(); - console.info(TAG, 'SetSoftKeyboard_001 end'); - }) - - it('SetSoftKeyboard_002', 2, async (done: Function) => { - console.info(TAG, 'SetSoftKeyboard_002 start'); - let driver = Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let button_softKeyboard = await driver.findComponent(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - expect(button_softKeyboard === null).assertFalse(); - await button_softKeyboard.click(); - let text = await driver.findComponent(ON.id('textInput')); - expect(text === null).assertFalse(); - await text.click(); - await driver.delayMs(1000); - expect(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH) == null).assertFalse(); - - // 点击XComponent组件 - let xcomponent = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent === null).assertFalse(); - await xcomponent.click(); - await driver.delayMs(1000); - - done(); - console.info(TAG, 'SetSoftKeyboard_002 end'); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NativeXComponent/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/ohosTest/module.json5 b/ArkUIKit/NativeXComponent/entry/src/ohosTest/module.json5 deleted file mode 100644 index 69026872775eebd0844900b225c411959ae5608b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NativeXComponent/entry/src/test/List.test.ets b/ArkUIKit/NativeXComponent/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NativeXComponent/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponent/hvigor/hvigor-config.json5 b/ArkUIKit/NativeXComponent/hvigor/hvigor-config.json5 deleted file mode 100644 index 06b2783670a348f95533b352c1ceda909a842bbc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/ArkUIKit/NativeXComponent/hvigorfile.ts b/ArkUIKit/NativeXComponent/hvigorfile.ts deleted file mode 100644 index f3cb9f1a87a81687554a76283af8df27d8bda775..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/ArkUIKit/NativeXComponent/oh-package.json5 b/ArkUIKit/NativeXComponent/oh-package.json5 deleted file mode 100644 index ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponent/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "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/ArkUIKit/NativeXComponent/screenshots/device/changeColor.jpeg b/ArkUIKit/NativeXComponent/screenshots/device/changeColor.jpeg deleted file mode 100644 index 010cf4609b1b1196b26e68b12cf2211e6f3d8a45..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponent/screenshots/device/changeColor.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeXComponent/screenshots/device/drawStar.jpeg b/ArkUIKit/NativeXComponent/screenshots/device/drawStar.jpeg deleted file mode 100644 index d729f5aafa9797662099c5ce9d02c8656a47b7d3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponent/screenshots/device/drawStar.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/.gitignore b/ArkUIKit/NativeXComponentSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NativeXComponentSample/AppScope/app.json5 b/ArkUIKit/NativeXComponentSample/AppScope/app.json5 deleted file mode 100644 index 33e40e31af85a79aaa9242b628f577e0157a7ee4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.example.nativexcomponent", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NativeXComponentSample/AppScope/resources/base/element/string.json b/ArkUIKit/NativeXComponentSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 79421a57da43fb2a471e3ade57c18b8d845b3647..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "NativeXComponent" - } - ] -} diff --git a/ArkUIKit/NativeXComponentSample/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NativeXComponentSample/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/README_zh.md b/ArkUIKit/NativeXComponentSample/README_zh.md deleted file mode 100644 index 955f14a6dffb05827bc0f816eaeac928fcb645a7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/README_zh.md +++ /dev/null @@ -1,248 +0,0 @@ -# Native XComponent -本示例包含三个小示例。 - -示例一:使用NDK接口创建XComponent,并使用NativeXComponent相关接口 - -示例二:使用ArkTS声明式方法创建XComponent,并使用NativeXComponent相关接口 - -示例三:使用自定义节点创建XComponent,并使用SurfaceHolder相关接口 - -### 工程目录 - -``` -├──entry/src/main -│ ├──cpp // C++代码区 -│ │ ├──CMakeLists.txt // CMake配置文件 -│ │ ├──napi_init.cpp // Napi模块注册 -│ │ ├──manager // 生命周期管理模块 -│ │ │ ├──plugin_manager.cpp -│ │ │ └──plugin_manager.h -│ │ ├──render // 渲染模块 -│ │ │ ├──egl_core.cpp -│ │ │ ├──egl_core.h -│ │ │ ├──EGLConst.h -│ │ │ ├──plugin_render.cpp -│ │ │ ├──plugin_render.h -│ │ │ ├──EGLRender.cpp -│ │ │ └──EGLRender.h -| | ├──types -| | | ├──libnativerender -| | | | ├──Index.d.ts -| | | | ├──oh-package.json5 -│ ├──ets // ets代码区 -│ │ ├──entryability -│ │ │ ├──EntryAbility.ts // 程序入口类 -| | ├──entrybackupability -| | | ├──EntryBackupAbility.ets -│ │ ├──pages // 页面文件 -│ │ ├──Index.ets // 主界面 -| | ├──PageOne.ets -| | ├──PageTwo.ets -| | ├──PageThree.ets -| ├──resources // 资源文件目录 -``` - -# Native XComponent(样例一) - -### 简介 - -本示例展示了如何在native侧使用ArkUI NDK API创建XComponent组件进行自定义绘制。具体步骤包括:创建组件,获取NativeXComponent实例,注册XComponent生命周期和事件回调,通过回调获取NativeWindow后使用OpenGL ES/EGL接口在XComponent组件上进行图形绘制,最后在ArkTS层使用ContentSlot站位组件进行挂载显示。功能主要包括点击按钮绘制一个五角星,并可以通过点击XComponent区域改变五角星的颜色。 - -### 效果预览 - -| 主页 | 绘制五角星 | 改变颜色 | -| ------------------------------------ | --------------------------------------------- | --------------------------------------------------- | -| ![main](screenshots/device/mainNDK.png) | ![draw star](screenshots/device/drawStarNDK.png) | ![change color](screenshots/device/changeColorNDK.png) | - -使用说明 - -1. 安装编译生成的hap包,并打开应用。 - -2. 点击页面底部“Draw Star”按钮,页面将绘制一个五角星。 - -3. 点击XComponent组件区域(页面中灰色区域)改变五角星颜色。 - - -### 具体实现 - -通过在IDE中创建Native c++ 工程,在c++代码中定义对外接口为drawPattern,在js侧调用该接口可在页面上绘制出一个三角形。 - -在XComponent的OnSurfaceCreated回调中获取NativeWindow实例并初始化EGL环境。调用OH_NativeXComponent_GetXComponentSize接口获取XComponent的宽高,并以此为输入调用EGL相关的绘制接口在NativeWindow上绘制出一个五角星。在DispatchTouchEvent回调中再次调用EGL相关的绘制接口在NativeWindow上绘制出一个大小相同、颜色不同的五角星,以达到点击后改变颜色的目的。 - -源码参考:[render目录](entry/src/main/cpp/render)下的文件。 - -涉及到的相关接口: - -| 接口名 | 描述 | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| OH_NativeXComponent_GetXComponentId(OH_NativeXComponent* component, char* id, uint64_t* size) | 获取XComponent的id。 | -| OH_NativeXComponent_GetXComponentSize(OH_NativeXComponent* component, const void* window, uint64_t* width, uint64_t* height) | 获取XComponent持有的surface的大小。 | -| OH_NativeXComponent_GetXComponentOffset(OH_NativeXComponent* component, const void* window, double* x, double* y) | 获取XComponent持有的surface相对窗口左上角的偏移量。 | -| OH_NativeXComponent_GetTouchEvent(OH_NativeXComponent* component, const void* window, OH_NativeXComponent_TouchEvent* touchEvent) | 获取由XComponent触发的触摸事件。 | -| OH_NativeXComponent_GetTouchPointToolType(OH_NativeXComponent* component, uint32_t pointIndex, OH_NativeXComponent_TouchPointToolType* toolType) | 获取XComponent触摸点的工具类型。 | -| OH_NativeXComponent_GetTouchPointTiltX(OH_NativeXComponent* component, uint32_t pointIndex, float* tiltX) | 获取XComponent触摸点处相对X轴的倾斜角度。 | -| OH_NativeXComponent_GetTouchPointTiltY(OH_NativeXComponent* component, uint32_t pointIndex, float* tiltY) | 获取XComponent触摸点处相对Y轴的倾斜角度。 | -| OH_NativeXComponent_GetMouseEvent(OH_NativeXComponent* component, const void* window, OH_NativeXComponent_MouseEvent* mouseEvent) | 获取由XComponent触发的鼠标事件。 | -| OH_NativeXComponent_RegisterCallback(OH_NativeXComponent* component, OH_NativeXComponent_Callback* callback) | 为此OH_NativeXComponent实例注册生命周期和触摸事件回调。 | -| OH_NativeXComponent_RegisterMouseEventCallback(OH_NativeXComponent* component, OH_NativeXComponent_MouseEvent_Callback* callback) | 为此OH_NativeXComponent实例注册鼠标事件回调。 | -| OH_NativeXComponent_RegisterFocusEventCallback(OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)) | 为此OH_NativeXComponent实例注册获得焦点事件回调。 | -| OH_NativeXComponent_RegisterKeyEventCallback(OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)) | 为此OH_NativeXComponent实例注册按键事件回调。 | -| OH_NativeXComponent_RegisterBlurEventCallback(OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)) | 为此OH_NativeXComponent实例注册失去焦点事件回调。 | -| OH_NativeXComponent_GetKeyEvent(OH_NativeXComponent* component, OH_NativeXComponent_KeyEvent** keyEvent) | 获取由XComponent触发的按键事件。 | -| OH_NativeXComponent_GetKeyEventAction(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyAction* action) | 获取按键事件的动作。 | -| OH_NativeXComponent_GetKeyEventCode(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyCode* code) | 获取按键事件的键码值。 | -| OH_NativeXComponent_GetKeyEventSourceType(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_EventSourceType* sourceType) | 获取按键事件的输入源类型。 | -| OH_NativeXComponent_GetKeyEventDeviceId(OH_NativeXComponent_KeyEvent* keyEvent, int64_t* deviceId) | 获取按键事件的设备ID。 | -| OH_NativeXComponent_GetKeyEventTimestamp(OH_NativeXComponent_KeyEvent* keyEvent, int64_t* timestamp) | 获取按键事件的时间戳。 | -| OH_ArkUI_QueryModuleInterfaceByName(ArkUI_NativeAPIVariantKind type, const char* structName) | 获取指定类型的Native模块接口集合。 | -| OH_ArkUI_GetNodeContentFromNapiValue(napi_env env, napi_value value, ArkUI_NodeContentHandle* content) | 获取ArkTS侧创建的NodeContent对象映射到native侧的ArkUI_NodeContentHandle。 | -| OH_ArkUI_NodeContent_SetUserData(ArkUI_NodeContentHandle content, void* userData) | 在NodeContent对象上保存自定义数据。 | -| OH_ArkUI_NodeContentEvent_GetNodeContentHandle(ArkUI_NodeContentEvent* event) | 获取触发事件的NodeContent对象。 | -| OH_ArkUI_NodeContent_GetUserData(ArkUI_NodeContentHandle content) | 获取在NodeContent对象上保存的自定义数据。 | -| OH_ArkUI_NodeContentEvent_GetEventType(ArkUI_NodeContentEvent* event) | 获取触发NodeContent事件的事件类型。 | -| OH_ArkUI_NodeContent_AddNode(ArkUI_NodeContentHandle content, ArkUI_NodeHandle node) | 将一个ArkUI组件节点添加到对应的NodeContent对象下。 | -| OH_ArkUI_NodeContent_RegisterCallback(ArkUI_NodeContentHandle content, ArkUI_NodeContentCallback callback) | 注册NodeContent事件函数。 | -| OH_NativeXComponent_GetNativeXComponent(ArkUI_NodeHandle node) | 基于Native接口创建的组件实例获取OH_NativeXComponent类型的指针。 | - - -# Native XComponent(样例二) - -### 介绍 - -本示例中主要介绍开发者如何使用Native XComponent接口来获取NativeWindow实例、获取布局/事件信息、注册事件回调并通过OpenGL/EGL实现在页面上绘制形状。功能主要包括点击按钮绘制一个五角星,并可以通过点击XComponent区域改变五角星的颜色。 - -### 效果预览 - -| 主页 | 绘制五角星 | 改变颜色 | -| ------------------------------------ | --------------------------------------------- | --------------------------------------------------- | -| ![main](screenshots/device/Xmain.png) | ![draw star](screenshots/device/XdrawStar.png) | ![change color](screenshots/device/XchangeColor.png) | - -使用说明 - -1. 安装编译生成的hap包,并打开应用。 - -2. 点击页面底部“Draw Star”按钮,页面将绘制一个五角星。 - -3. 点击XComponent组件区域(页面中灰色区域)改变五角星颜色。 - - - - -### 具体实现 - -通过在IDE中创建Native c++ 工程,在c++代码中定义对外接口为drawPattern,在js侧调用该接口可在页面上绘制出一个三角形。 - -在XComponent的OnSurfaceCreated回调中获取NativeWindow实例并初始化EGL环境。调用OH_NativeXComponent_GetXComponentSize接口获取XComponent的宽高,并以此为输入调用EGL相关的绘制接口在NativeWindow上绘制出一个五角星。在DispatchTouchEvent回调中再次调用EGL相关的绘制接口在NativeWindow上绘制出一个大小相同、颜色不同的五角星,以达到点击后改变颜色的目的。 - -源码参考:[render目录](entry/src/main/cpp/render)下的文件。 - -涉及到的相关接口: - -| 接口名 | 描述 | -| ------------------------------------------------------------ | ------------------------------------------------------- | -| OH_NativeXComponent_GetXComponentId(OH_NativeXComponent* component, char* id, uint64_t* size) | 获取XComponent的id。 | -| OH_NativeXComponent_GetXComponentSize(OH_NativeXComponent* component, const void* window, uint64_t* width, uint64_t* height) | 获取XComponent持有的surface的大小。 | -| OH_NativeXComponent_GetXComponentOffset(OH_NativeXComponent* component, const void* window, double* x, double* y) | 获取XComponent持有的surface相对窗口左上角的偏移量。 | -| OH_NativeXComponent_GetTouchEvent(OH_NativeXComponent* component, const void* window, OH_NativeXComponent_TouchEvent* touchEvent) | 获取由XComponent触发的触摸事件。 | -| OH_NativeXComponent_GetTouchPointToolType(OH_NativeXComponent* component, uint32_t pointIndex, OH_NativeXComponent_TouchPointToolType* toolType) | 获取XComponent触摸点的工具类型。 | -| OH_NativeXComponent_GetTouchPointTiltX(OH_NativeXComponent* component, uint32_t pointIndex, float* tiltX) | 获取XComponent触摸点处相对X轴的倾斜角度。 | -| OH_NativeXComponent_GetTouchPointTiltY(OH_NativeXComponent* component, uint32_t pointIndex, float* tiltY) | 获取XComponent触摸点处相对Y轴的倾斜角度。 | -| OH_NativeXComponent_GetMouseEvent(OH_NativeXComponent* component, const void* window, OH_NativeXComponent_MouseEvent* mouseEvent) | 获取由XComponent触发的鼠标事件。 | -| OH_NativeXComponent_RegisterCallback(OH_NativeXComponent* component, OH_NativeXComponent_Callback* callback) | 为此OH_NativeXComponent实例注册生命周期和触摸事件回调。 | -| OH_NativeXComponent_RegisterMouseEventCallback(OH_NativeXComponent* component, OH_NativeXComponent_MouseEvent_Callback* callback) | 为此OH_NativeXComponent实例注册鼠标事件回调。 | -| OH_NativeXComponent_RegisterFocusEventCallback(OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)) | 为此OH_NativeXComponent实例注册获得焦点事件回调。 | -| OH_NativeXComponent_RegisterKeyEventCallback(OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)) | 为此OH_NativeXComponent实例注册按键事件回调。 | -| OH_NativeXComponent_RegisterBlurEventCallback(OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)) | 为此OH_NativeXComponent实例注册失去焦点事件回调。 | -| OH_NativeXComponent_GetKeyEvent(OH_NativeXComponent* component, OH_NativeXComponent_KeyEvent** keyEvent) | 获取由XComponent触发的按键事件。 | -| OH_NativeXComponent_GetKeyEventAction(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyAction* action) | 获取按键事件的动作。 | -| OH_NativeXComponent_GetKeyEventCode(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyCode* code) | 获取按键事件的键码值。 | -| OH_NativeXComponent_GetKeyEventSourceType(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_EventSourceType* sourceType) | 获取按键事件的输入源类型。 | -| OH_NativeXComponent_GetKeyEventDeviceId(OH_NativeXComponent_KeyEvent* keyEvent, int64_t* deviceId) | 获取按键事件的设备ID。 | -| OH_NativeXComponent_GetKeyEventTimestamp(OH_NativeXComponent_KeyEvent* keyEvent, int64_t* timestamp) | 获取按键事件的时间戳。 | - - - -# NativeXComponent(样例三) - -### 介绍 - -本示例主要介绍开发者如何使用ArkUI NDK API创建XComponent组件进行自定义绘制。主要包括:创建组件,获取ArkUI_NodeHandle和OH_ArkUI_SurfaceHolder实例,注册Surface生命周期和无障碍回调,设置可变帧率,获取NativeWindow后使用OpenGL ES/EGL接口在XComponent组件上进行图形绘制。功能主要包括绘制一个五角星,期望帧率设置,点击按钮开启/关闭软键盘,并可以通过点击XComponent区域改变五角星的颜色。 - -### 效果预览 - -| 绘制五角星 | 改变颜色 | -|-----------------------------------------------|-----------------------------------------------------| -| ![draw star](screenshots/device/drawStar.jpeg) | ![change color](screenshots/device/changeColor.jpeg) | - -使用说明 - -1. 安装编译生成的hap包,并打开应用。 -3. 点击XComponent组件区域(页面中蓝色五角星所在区域)改变五角星颜色。 -3. 点击“单指点击XComponent软键盘消失”对应区域,软键盘拉起;点击XComponent组件区域,软键盘消失。 -4. 点击needSoftKeyboard=false 按钮,点击“单指点击XComponent软键盘不消失”对应区域,软键盘拉起;点击XComponent组件区域,软键盘不消失。 -5. 拖动期望帧率设置下的滑动条,可以控制期望帧率,具体通过打印日志的速度来衡量,日志检索"OnFrameCallback count"关键字。 - - - -### 具体实现 - -通过在IDE中创建Native c++ 工程,在c++代码中定义对外接口为BindNode,在ArkTS侧调用该接口用于注册Surface生命周期、事件和无障碍等回调,在回调逻辑中实现绘制五角星的逻辑。 - -基于OH_ArkUI_SurfaceHolder实例,在Native侧调用OH_ArkUI_XComponent_GetNativeWindow创建NativeWindow实例并初始化 -EGL环境。在Native侧的OnsurfaceChanged回调中,传入OH_ArkUI_SurfaceHolder、宽和高,并以此为输入调用EGL相关的接口改变对应NativeWindow的尺寸和内容。 - -源码参考:[main目录](entry/src/main/)下的文件。涉及到的相关接口: - -| 接口名 | 描述 | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| OH_ArkUI_QueryModuleInterfaceByName(ArkUI_NativeAPIVariantKind type, const char* structName) | 获取指定类型的Native模块接口集合。 | -| OH_ArkUI_XComponent_GetNativeWindow(OH_ArkUI_SurfaceHolder* surfaceHolder) | 获取与OH_ArkUI_SurfaceHolder实例关联的nativeWindow。 | -| OH_ArkUI_SurfaceHolder_RemoveSurfaceCallback(OH_ArkUI_SurfaceHolder* surfaceHolder, OH_ArkUI_SurfaceCallback* callback) | 从OH_ArkUI_SurfaceHolder实例中移除先前添加的Surface生命周期回调。 | -| OH_ArkUI_SurfaceCallback_Dispose(OH_ArkUI_SurfaceCallback* callback) | 释放OH_ArkUI_SurfaceCallback对象。 | -| OH_ArkUI_SurfaceHolder_Dispose(OH_ArkUI_SurfaceHolder* surfaceHolder) | 释放OH_ArkUI_SurfaceHolder对象。 | -| OH_ArkUI_NodeEvent_GetEventType(ArkUI_NodeEvent* event) | 从组件事件获取事件类型。 | -| OH_ArkUI_NodeEvent_GetNodeHandle(ArkUI_NodeEvent* event) | 获取触发组件事件的组件对象。 | -| OH_ArkUI_GetNodeHandleFromNapiValue(napi_env env, napi_value frameNode, ArkUI_NodeHandle* handle) | 获取ArkTS侧创建的FrameNode节点对象映射到native侧的ArkUI_NodeHandle。 | -| OH_ArkUI_SurfaceHolder_Create(ArkUI_NodeHandle node) | 从XComponent节点创建一个OH_ArkUI_SurfaceHolder对象。 | -| OH_ArkUI_SurfaceCallback_Create() | 创建一个OH_ArkUI_SurfaceCallback对象。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceCreatedEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceCreated)(OH_ArkUI_SurfaceHolder* surfaceHolder)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceCreated回调。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceChangedEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceChanged)(OH_ArkUI_SurfaceHolder* surfaceHolder, uint64_t width, uint64_t height)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceChanged回调。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceDestroyedEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceDestroyed)(OH_ArkUI_SurfaceHolder* surfaceHolder)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceDestroyed回调。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceShowEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceShow)(OH_ArkUI_SurfaceHolder* surfaceHolder)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceShow回调。 | -| OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent(OH_ArkUI_SurfaceCallback* callback, void (\*onSurfaceHide)(OH_ArkUI_SurfaceHolder* surfaceHolder)) | 往OH_ArkUI_SurfaceCallback对象中注册onSurfaceHide回调。 | -| OH_ArkUI_XComponent_RegisterOnFrameCallback(ArkUI_NodeHandle node, void (*callback)(ArkUI_NodeHandle node, uint64_t timestamp, uint64_t targetTimestamp)) | 为XComponent节点注册onFrame回调。 | -| OH_ArkUI_SurfaceHolder_AddSurfaceCallback(OH_ArkUI_SurfaceHolder* surfaceHolder, OH_ArkUI_SurfaceCallback* callback) | 往OH_ArkUI_SurfaceHolder实例注册OH_ArkUI_SurfaceCallback对象。 | -| OH_ArkUI_AccessibilityProvider_Create(ArkUI_NodeHandle node) | 从XComponent节点创建一个ArkUI_AccessibilityProvider对象。 | -| OH_ArkUI_XComponent_UnregisterOnFrameCallback(ArkUI_NodeHandle node) | 取消注册XComponent节点的onFrame回调。 | -| OH_ArkUI_AccessibilityProvider_Dispose(ArkUI_AccessibilityProvider* provider) | 释放ArkUI_AccessibilityProvider对象。 | -| OH_ArkUI_XComponent_SetExpectedFrameRateRange(ArkUI_NodeHandle node, OH_NativeXComponent_ExpectedRateRange range) | 为XComponent节点设置预期的帧率范围。 | -| OH_ArkUI_XComponent_SetNeedSoftKeyboard(ArkUI_NodeHandle node, bool needSoftKeyboard) | 设置XComponent节点在获得焦点时是否需要显示软键盘。 | - - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:rk3568 - -2. 本示例为Stage模型,支持API20版本SDK,SDK版本号(API Version 20 Release),镜像版本号(6.0 Release) - -3. 本示例需要使用DevEco Studio 版本号(6.0.0 Release)及以上版本才可编译运行 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/BasicFeature/Native/NativeXComponent/ > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/ArkUIKit/NativeXComponentSample/build-profile.json5 b/ArkUIKit/NativeXComponentSample/build-profile.json5 deleted file mode 100644 index 632e7527e3473b32fa33fcf0ae6a65dcffd895eb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/.gitignore b/ArkUIKit/NativeXComponentSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/build-profile.json5 b/ArkUIKit/NativeXComponentSample/entry/build-profile.json5 deleted file mode 100644 index a35f5de28aeed0d7c8d6df195a806a24b825b9de..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2023-2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a", - "x86_64" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/hvigorfile.ts b/ArkUIKit/NativeXComponentSample/entry/hvigorfile.ts deleted file mode 100644 index 80e4ec5b81689f238c34614b167a0b9e9c83e8d9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/ArkUIKit/NativeXComponentSample/entry/oh-package.json5 b/ArkUIKit/NativeXComponentSample/entry/oh-package.json5 deleted file mode 100644 index 6ad2f1f5bc79d30ece0755087131274acf2103a8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/oh-package.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "license": "", - "devDependencies": {}, - "author": "", - "name": "entry", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": { - "libnativerender.so": "file:./src/main/cpp/types/libnativerender" - } -} diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index d5cab7ca9db442f7432d846e17f32c3b5b1c6d4f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.4.1) -project(XComponent) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -add_definitions(-DOHOS_PLATFORM) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories( - ${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include - ${NATIVERENDER_ROOT_PATH}/render - ${NATIVERENDER_ROOT_PATH}/manager -) - -add_library(nativerender SHARED - render/EGLRender.cpp - render/egl_core.cpp - render/plugin_render.cpp - manager/plugin_manager.cpp - napi_init.cpp -) - -find_library( - # Sets the name of the path variable. - EGL-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - EGL -) - -find_library( - # Sets the name of the path variable. - GLES-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - GLESv3 -) - -find_library( - # Sets the name of the path variable. - hilog-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - hilog_ndk.z -) - -find_library( - # Sets the name of the path variable. - libace-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_ndk.z -) - -find_library( - # Sets the name of the path variable. - libnapi-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_napi.z -) - -find_library( - # Sets the name of the path variable. - libuv-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - uv -) - -target_link_libraries(nativerender PUBLIC - ${EGL-lib} ${GLES-lib} ${hilog-lib} ${libace-lib} ${libnapi-lib} ${libuv-lib} libnative_window.so) \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/common/common.h b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/common/common.h deleted file mode 100644 index c7760109da75f11204bd359ac3a65900b6749872..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/common/common.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -#ifndef NATIVE_XCOMPONENT_COMMON_H -#define NATIVE_XCOMPONENT_COMMON_H - -#include -#include -#include -#include -#include - -namespace NativeXComponentSample { -/** - * Log print domain. - */ -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_COMMON_H diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.cpp deleted file mode 100644 index 8d92150e619d14d46c26ff4078b1ccd8eeae2f30..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.cpp +++ /dev/null @@ -1,684 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "plugin_manager.h" -#include -#include -#include -#include -#include -#include "arkui/native_node.h" -#include "arkui/native_node_napi.h" -#include "arkui/native_interface.h" -#include "../common/common.h" - -#define COLUMN_MARGIN 10 -#define XC_WIDTH 300 -#define XC_HEIGHT 300 -#define ARG_CNT 2 - -namespace NativeXComponentSample { -std::unordered_map PluginManager::nodeHandleMap_; -std::unordered_map PluginManager::callbackMap_; -std::unordered_map PluginManager::surfaceHolderMap_; -ArkUI_AccessibilityProvider *PluginManager::provider_ = nullptr; -ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - -PluginManager PluginManager::pluginManager_; -OH_NativeXComponent_Callback PluginManager::callback_; -ArkUI_NodeHandle xc; -int32_t PluginManager::hasDraw_ = 0; -int32_t PluginManager::hasChangeColor_ = 0; - -PluginManager::~PluginManager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "~PluginManager"); - nativeXComponentMap_.clear(); - if (eglcore_ != nullptr) { - delete eglcore_; - eglcore_ = nullptr; - } - - for (auto iter = pluginManagerMap_.begin(); iter != pluginManagerMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - pluginManagerMap_.clear(); -} - -void OnSurfaceCreatedNative(OH_ArkUI_SurfaceHolder *holder) -{ - auto window = OH_ArkUI_XComponent_GetNativeWindow(holder); // 获取native window - auto render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->SetUpEGLContext(window); // 初始化egl环境 -} - -void OnSurfaceChangedNative(OH_ArkUI_SurfaceHolder *holder, uint64_t width, uint64_t height) -{ - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->SetEGLWindowSize(width, height); // 设置绘制区域大小 - render->DrawStar(true); // 绘制五角星 -} - -void OnSurfaceDestroyedNative(OH_ArkUI_SurfaceHolder *holder) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "onBind", "on destroyed"); - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->DestroySurface(); // 销毁eglSurface相关资源 -} - -void OnSurfaceShowNative(OH_ArkUI_SurfaceHolder *holder) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "on surface show"); -} - -void OnSurfaceHideNative(OH_ArkUI_SurfaceHolder *holder) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "on surface hide"); -} - -void OnFrameCallbackNative(ArkUI_NodeHandle node, uint64_t timestamp, uint64_t targetTimestamp) -{ - if (!PluginManager::surfaceHolderMap_.count(node)) { - return; - } - static uint64_t count = 0; - count++; - if (count % FRAME_COUNT == 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "OnFrameCallback count = %{public}ld", count); - } -} - -void onEvent(ArkUI_NodeEvent *event) -{ - auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); // 获取组件事件类型 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "on event"); - if (eventType == NODE_TOUCH_EVENT) { - ArkUI_NodeHandle handle = OH_ArkUI_NodeEvent_GetNodeHandle(event); // 获取触发该事件的组件对象 - auto holder = PluginManager::surfaceHolderMap_[handle]; - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->DrawStar(false); // 绘制五角星 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "on touch"); - } -} - -static std::string value2String(napi_env env, napi_value value) -{ - size_t stringSize = 0; - napi_get_value_string_utf8(env, value, nullptr, 0, &stringSize); - std::string valueString; - valueString.resize(stringSize); - napi_get_value_string_utf8(env, value, &valueString[0], stringSize+1, &stringSize); - return valueString; -} -napi_value PluginManager::GetXComponentStatus(napi_env env, napi_callback_info info) -{ - napi_value hasDraw; - napi_value hasChangeColor; - - napi_status ret = napi_create_int32(env, hasDraw_, &(hasDraw)); - if (ret != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", "napi_create_int32 hasDraw_ error"); - return nullptr; - } - ret = napi_create_int32(env, hasChangeColor_, &(hasChangeColor)); - if (ret != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", "napi_create_int32 hasChangeColor_ error"); - return nullptr; - } - - napi_value obj; - ret = napi_create_object(env, &obj); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", "napi_create_object error"); - return nullptr; - } - ret = napi_set_named_property(env, obj, "hasDraw", hasDraw); - if (ret != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", "napi_set_named_property hasDraw error"); - return nullptr; - } - ret = napi_set_named_property(env, obj, "hasChangeColor", hasChangeColor); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", - "napi_set_named_property hasChangeColor error"); - return nullptr; - } - return obj; -} - -napi_value PluginManager::NapiDrawPattern(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginManager", "NapiDrawPattern"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "NapiDrawPattern: env or info is null"); - return nullptr; - } - napi_value thisArg; - if (napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "NapiDrawPattern: napi_get_cb_info fail"); - return nullptr; - } - - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->eglcore_->Draw(hasDraw_); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginManager", "render->eglCore_->Draw() executed"); - - return nullptr; -} - -void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "OnSurfaceCreatedCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "OnSurfaceCreatedCB id=%{public}s", - id.c_str()); - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->OnSurfaceCreated(component, window); -} -void OnSurfaceChangedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "OnSurfaceChangedCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - std::string id(idStr); - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->OnSurfaceChanged(component, window); -} -void OnSurfaceDestroyedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - std::string id(idStr); - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->OnSurfaceDestroyed(component, window); -} -void DispatchTouchEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - std::string id(idStr); - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->DispatchTouchEvent(component, window); -} -PluginManager::PluginManager() -{ - eglcore_ = new EGLCore(); - callback_.OnSurfaceCreated = OnSurfaceCreatedCB; - callback_.OnSurfaceChanged = OnSurfaceChangedCB; - callback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - callback_.DispatchTouchEvent = DispatchTouchEventCB; -} - -ArkUI_NodeHandle CreateNodeHandle(const std::string &tag) -{ - ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue value[] = {480}; - ArkUI_NumberValue value1[] = {{.u32 = 15}, {.f32 = 15}}; - ArkUI_AttributeItem item = {value, 1, "changeSize"}; - ArkUI_AttributeItem item1 = {value1, 2}; - nodeAPI->setAttribute(column, NODE_WIDTH, &item); - value[0].f32 = COLUMN_MARGIN; - nodeAPI->setAttribute(column, NODE_MARGIN, &item); - xc = nodeAPI->createNode(ARKUI_NODE_XCOMPONENT); - value[0].u32 = ARKUI_XCOMPONENT_TYPE_SURFACE; - nodeAPI->setAttribute(xc, NODE_XCOMPONENT_TYPE, &item); - nodeAPI->setAttribute(xc, NODE_XCOMPONENT_ID, &item); - nodeAPI->setAttribute(xc, NODE_XCOMPONENT_SURFACE_SIZE, &item1); - ArkUI_NumberValue focusable[] = {1}; - focusable[0].i32 = 1; - ArkUI_AttributeItem focusableItem = {focusable, 1}; - nodeAPI->setAttribute(xc, NODE_FOCUSABLE, &focusableItem); - ArkUI_NumberValue valueSize[] = {480}; - ArkUI_AttributeItem itemSize = {valueSize, 1}; - valueSize[0].f32 = XC_WIDTH; - nodeAPI->setAttribute(xc, NODE_WIDTH, &itemSize); - valueSize[0].f32 = XC_HEIGHT; - nodeAPI->setAttribute(xc, NODE_HEIGHT, &itemSize); - ArkUI_AttributeItem item2 = {value, 1, "ndkxcomponent"}; - nodeAPI->setAttribute(xc, NODE_ID, &item2); - - auto *nativeXComponent = OH_NativeXComponent_GetNativeXComponent(xc); - if (!nativeXComponent) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "GetNativeXComponent error"); - return column; - } - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "GetNativeXComponent success"); - OH_NativeXComponent_RegisterCallback(nativeXComponent, &PluginManager::callback_); - auto typeRet = nodeAPI->getAttribute(xc, NODE_XCOMPONENT_TYPE); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "xcomponent type: %{public}d", - typeRet->value[0].i32); - auto idRet = nodeAPI->getAttribute(xc, NODE_XCOMPONENT_ID); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "xcomponent id: %{public}s", - idRet->string); - nodeAPI->addChild(column, xc); - return column; -} - -napi_value PluginManager::createNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = 2; - napi_value args[2] = { nullptr, nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "CreateNativeNode napi_get_cb_info failed"); - } - if (argCnt != ARG_CNT) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - ArkUI_NodeContentHandle nodeContentHandle_ = nullptr; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &nodeContentHandle_); - nodeAPI = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1") - ); - std::string tag = value2String(env, args[1]); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "tag=%{public}s", tag.c_str()); - int32_t ret = OH_ArkUI_NodeContent_SetUserData(nodeContentHandle_, new std::string(tag)); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "setUserData failed error=%{public}d", ret); - } - if (nodeAPI != nullptr && nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", - "CreateNativeNode tag=%{public}s", tag.c_str()); - auto nodeContentEvent = [](ArkUI_NodeContentEvent *event) { - ArkUI_NodeContentHandle handle = OH_ArkUI_NodeContentEvent_GetNodeContentHandle(event); - std::string *userDate = reinterpret_cast(OH_ArkUI_NodeContent_GetUserData(handle)); - if (OH_ArkUI_NodeContentEvent_GetEventType(event) == NODE_CONTENT_EVENT_ON_ATTACH_TO_WINDOW) { - ArkUI_NodeHandle testNode; - if (userDate) { - testNode = CreateNodeHandle(*userDate); - delete userDate; - userDate = nullptr; - } else { - testNode = CreateNodeHandle("noUserData"); - } - OH_ArkUI_NodeContent_AddNode(handle, testNode); - } - }; - OH_ArkUI_NodeContent_RegisterCallback(nodeContentHandle_, nodeContentEvent); - } - return nullptr; -} - -void PluginManager::OnSurfaceCreated(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "PluginManager::OnSurfaceCreated"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - ret = OH_NativeXComponent_GetXComponentSize(component, window, &width_, &height_); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - eglcore_->EglContextInit(window, width_, height_); - eglcore_->Background(); - } -} - -void PluginManager::OnSurfaceDestroyed(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "PluginManager::OnSurfaceDestroyed"); -} - -void PluginManager::DispatchTouchEvent(OH_NativeXComponent* component, void* window) -{ - int32_t ret = OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent_); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - float tiltX = 2.2; - float tiltY = 2.2; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", - "Touch Info : x=%{public}f, y=%{public}f screenx=%{public}f, screeny=%{public}f," - "type=%{public}d, force=%{public}f, tiltX=%{public}f, tiltY=%{public}f, toolType=%{public}d", - touchEvent_.x, touchEvent_.y, touchEvent_.screenX, - touchEvent_.screenY, touchEvent_.type, touchEvent_.force, tiltX, tiltY, toolType); - if (touchEvent_.type == OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UP) { - eglcore_->ChangeColor(hasChangeColor_); - } - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "touch fail"); - } - - int32_t size = 0; - OH_NativeXComponent_HistoricalPoint *points = nullptr; - - if (OH_NativeXComponent_GetHistoricalPoints(component, window, &size, &points) == - OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "XComponent_Native", "HistoricalPoints size=%{public}d", - size); - for (auto i = 0; i < size; i++) { - auto point = points[i]; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "XComponent_Native", - "HistoricalPoint %{public}d Info : id=%{public}d, x=%{public}f, y=%{public}f, " - "type=%{public}d, timeStamp=%{public}lld, sourceTool=%{public}d", - i, point.id, point.x, point.y, point.type, point.timeStamp, point.sourceTool); - } - } -} -void PluginManager::OnSurfaceChanged(OH_NativeXComponent* component, void* window) -{ - int32_t ret = OH_NativeXComponent_GetXComponentSize(component, window, &width_, &height_); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", - "OnSurfaceChanged ret=%{public}d width=%{public}lu, height=%{public}lu", ret, width_, height_); -} - -napi_value PluginManager::GetContext(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "GetContext env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "GetContext napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_number) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - int64_t value; - if (napi_get_value_int64(env, args[0], &value) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_create_object failed"); - return nullptr; - } - - return exports; -} - -void PluginManager::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent* nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto context = PluginManager::GetInstance(); - if ((context != nullptr) && (nativeXComponent != nullptr)) { - context->SetNativeXComponent(id, nativeXComponent); - auto render = context->GetRender(id); - if (render != nullptr) { - render->RegisterCallback(nativeXComponent); - render->Export(env, exports); - } - } -} - -void PluginManager::SetNativeXComponent(std::string& id, OH_NativeXComponent* nativeXComponent) -{ - if (nativeXComponent == nullptr) { - return; - } - nativeXComponentMap_[id] = nativeXComponent; -} - -PluginRender* PluginManager::GetRender(std::string& id) -{ - if (pluginRenderMap_.find(id) == pluginRenderMap_.end()) { - PluginRender* instance = PluginRender::GetInstance(id); - pluginRenderMap_[id] = instance; - return instance; - } - - return pluginRenderMap_[id]; -} - -napi_value PluginManager::BindNode(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle handle; - OH_ArkUI_GetNodeHandleFromNapiValue(env, args[1], &handle); // 获取 nodeHandle - OH_ArkUI_SurfaceHolder *holder = OH_ArkUI_SurfaceHolder_Create(handle); // 获取 SurfaceHolder - nodeHandleMap_[nodeId] = handle; - surfaceHolderMap_[handle] = holder; - auto callback = OH_ArkUI_SurfaceCallback_Create(); // 创建 SurfaceCallback - callbackMap_[holder] = callback; - auto render = new EGLRender(); - OH_ArkUI_SurfaceHolder_SetUserData(holder, render); // 将render保存在holder中 - OH_ArkUI_SurfaceCallback_SetSurfaceCreatedEvent(callback, OnSurfaceCreatedNative); // 注册OnSurfaceCreated回调 - OH_ArkUI_SurfaceCallback_SetSurfaceChangedEvent(callback, OnSurfaceChangedNative); // 注册OnSurfaceChanged回调 - OH_ArkUI_SurfaceCallback_SetSurfaceDestroyedEvent(callback, OnSurfaceDestroyedNative); // 注册OnSurfaceDestroyed回调 - OH_ArkUI_SurfaceCallback_SetSurfaceShowEvent(callback, OnSurfaceShowNative); // 注册OnSurfaceShow回调 - OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent(callback, OnSurfaceHideNative); // 注册OnSurfaceHide回调 - OH_ArkUI_XComponent_RegisterOnFrameCallback(handle, OnFrameCallbackNative); // 注册OnFrameCallback回调 - OH_ArkUI_SurfaceHolder_AddSurfaceCallback(holder, callback); // 注册SurfaceCallback回调 - if (!nodeAPI->addNodeEventReceiver(handle, onEvent)) { // 添加事件监听,返回成功码 0 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "addNodeEventReceiver error"); - } - if (!nodeAPI->registerNodeEvent(handle, NODE_TOUCH_EVENT, 0, nullptr)) { // 用C接口注册touch事件,返回成功码 0 - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "registerTouchEvent error"); - } - provider_ = OH_ArkUI_AccessibilityProvider_Create(handle); // 创建一个ArkUI_AccessibilityProvider类型的对象 - /** - * 获取ArkUI_AccessibilityProvider后,如果注册无障碍回调函数请参考: - * https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/ndk-accessibility-xcomponent.md - * **/ - return nullptr; -} - -napi_value PluginManager::UnbindNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - OH_ArkUI_XComponent_UnregisterOnFrameCallback(node); // 解注册帧回调 - OH_ArkUI_AccessibilityProvider_Dispose(provider_); // 销毁 ArkUI_AccessibilityProvider - auto holder = surfaceHolderMap_[node]; - if (PluginManager::callbackMap_.count(holder)) { - auto callback = PluginManager::callbackMap_[holder]; - OH_ArkUI_SurfaceHolder_RemoveSurfaceCallback(holder, callback); // 移除SurfaceCallback - OH_ArkUI_SurfaceCallback_Dispose(callback); // 销毁surfaceCallback - PluginManager::callbackMap_.erase(holder); - } - auto render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - delete render; // 销毁EGLRender对象 - OH_ArkUI_SurfaceHolder_Dispose(holder); // 销毁surfaceHolder - nodeAPI->disposeNode(node); // 销毁nodeHandle - nodeHandleMap_.erase(nodeId); - return nullptr; -} - -napi_value PluginManager::SetFrameRate(napi_env env, napi_callback_info info) -{ - size_t argc = 4; - napi_value args[4] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - auto node = nodeHandleMap_[nodeId]; - - int32_t min = 0; - napi_get_value_int32(env, args[FIRST_ARG], &min); - - int32_t max = 0; - napi_get_value_int32(env, args[SECOND_ARG], &max); - - int32_t expected = 0; - napi_get_value_int32(env, args[THIRD_ARG], &expected); - OH_NativeXComponent_ExpectedRateRange range = {.min = min, .max = max, .expected = expected}; - OH_ArkUI_XComponent_SetExpectedFrameRateRange(node, range); // 设置期望帧率 - return nullptr; -} - -napi_value PluginManager::SetNeedSoftKeyboard(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - - bool needSoftKeyboard = false; - napi_get_value_bool(env, args[1], &needSoftKeyboard); - OH_ArkUI_XComponent_SetNeedSoftKeyboard(node, needSoftKeyboard); // 设置是否需要软键盘 - return nullptr; -} - -napi_value PluginManager::Initialize(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - bool autoInitialize = 1; - OH_ArkUI_XComponent_SetAutoInitialize(node, autoInitialize); - OH_ArkUI_XComponent_Initialize(node); - bool isInitialized; - OH_ArkUI_XComponent_IsInitialized(node, &isInitialized); - auto holder = surfaceHolderMap_[node]; - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->DrawStar(true); // 绘制五角星 - return nullptr; -} - -napi_value PluginManager::Finalize(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - auto holder = surfaceHolderMap_[node]; - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - render->Clear(); - OH_ArkUI_XComponent_Finalize(node); - return nullptr; -} - -napi_value PluginManager::DrawStar(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - std::string nodeId = value2String(env, args[0]); - ArkUI_NodeHandle node; - if (nodeHandleMap_.find(nodeId) == nodeHandleMap_.end()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "SetNeedSoftKeyboard", "nodeId not exit error"); - return nullptr; - } - node = nodeHandleMap_[nodeId]; - auto holder = surfaceHolderMap_[node]; - EGLRender* render = reinterpret_cast(OH_ArkUI_SurfaceHolder_GetUserData(holder)); - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "onBind", "YGB DrawStar w:[%{public}d],h[%{public}d]", render->width_, - render->height_); - render->DrawStar(true); // 绘制五角星 - return nullptr; -} - -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.h b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.h deleted file mode 100644 index 73812e165801bf353abe53e6ad677a57edc7dad5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include -#include "../render/egl_core.h" -#include "render/EGLRender.h" -#include "arkui/native_node.h" -#include "arkui/native_node_napi.h" - -#include "../render/plugin_render.h" - -namespace NativeXComponentSample { -constexpr const int FIRST_ARG = 1; -constexpr const int SECOND_ARG = 2; -constexpr const int THIRD_ARG = 3; -constexpr const int FRAME_COUNT = 50; -class PluginManager { -public: - - static OH_NativeXComponent_Callback callback_; - PluginManager(); - ~PluginManager(); - - static PluginManager* GetInstance() - { - return &PluginManager::pluginManager_; - } - static napi_value createNativeNode(napi_env env, napi_callback_info info); - static napi_value GetXComponentStatus(napi_env env, napi_callback_info info); - static napi_value NapiDrawPattern(napi_env env, napi_callback_info info); - static napi_value GetContext(napi_env env, napi_callback_info info); - - static napi_value BindNode(napi_env env, napi_callback_info info); - static napi_value UnbindNode(napi_env env, napi_callback_info info); - static napi_value SetFrameRate(napi_env env, napi_callback_info info); - static napi_value SetNeedSoftKeyboard(napi_env env, napi_callback_info info); - static napi_value Initialize(napi_env env, napi_callback_info info); - static napi_value Finalize(napi_env env, napi_callback_info info); - static napi_value DrawStar(napi_env env, napi_callback_info info); - - // CApi XComponent - void OnSurfaceChanged(OH_NativeXComponent* component, void* window); - void OnSurfaceDestroyed(OH_NativeXComponent* component, void* window); - void DispatchTouchEvent(OH_NativeXComponent* component, void* window); - void OnSurfaceCreated(OH_NativeXComponent* component, void* window); - - void SetNativeXComponent(std::string& id, OH_NativeXComponent* nativeXComponent); - PluginRender* GetRender(std::string& id); - void Export(napi_env env, napi_value exports); - -private: - static PluginManager pluginManager_; - - std::unordered_map nativeXComponentMap_; - std::unordered_map pluginRenderMap_; - std::unordered_map pluginManagerMap_; - -public: - EGLCore *eglcore_; - uint64_t width_; - uint64_t height_; - OH_NativeXComponent_TouchEvent touchEvent_; - static int32_t hasDraw_; - static int32_t hasChangeColor_; - static std::unordered_map nodeHandleMap_; - static std::unordered_map callbackMap_; - static std::unordered_map surfaceHolderMap_; - static ArkUI_AccessibilityProvider *provider_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index fa96bb11a8b5d8394dc489c444fd9714de104dc2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,71 +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. - */ - -#include - -#include "common/common.h" -#include "manager/plugin_manager.h" - -namespace NativeXComponentSample { -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"createNativeNode", nullptr, PluginManager::createNativeNode, nullptr, nullptr, nullptr, - napi_default, nullptr }, - {"getStatus", nullptr, PluginManager::GetXComponentStatus, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"drawPattern", nullptr, PluginManager::NapiDrawPattern, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"getContext", nullptr, PluginManager::GetContext, nullptr, nullptr, nullptr, - napi_default, nullptr }, - {"bindNode", nullptr, PluginManager::BindNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"unbindNode", nullptr, PluginManager::UnbindNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setFrameRate", nullptr, PluginManager::SetFrameRate, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setNeedSoftKeyboard", nullptr, PluginManager::SetNeedSoftKeyboard, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"initialize", nullptr, PluginManager::Initialize, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"finalize", nullptr, PluginManager::Finalize, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"drawStar", nullptr, PluginManager::DrawStar, nullptr, nullptr, nullptr, napi_default, nullptr}, - }; - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - - PluginManager::GetInstance()->Export(env, exports); - return exports; -} -EXTERN_C_END - -static napi_module nativerenderModule = { .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativerender", - .nm_priv = ((void*)0), - .reserved = { 0 } }; - -extern "C" __attribute__((constructor)) void RegisterModule(void) -{ - napi_module_register(&nativerenderModule); -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLConst.h b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLConst.h deleted file mode 100644 index 898610fb6961e8b788a2f50fb544afb53e0ffa2a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLConst.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVEXCOMPONENT_EGLCONST_H -#define NATIVEXCOMPONENT_EGLCONST_H -#include -#include -#include - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -/** - * Program error. - */ -const GLuint PROGRAM_ERROR = 0; - -/** - * Position error. - */ -const GLint POSITION_ERROR = -1; - -/** - * Default x position. - */ -const int DEFAULT_X_POSITION = 0; - -/** - * Default y position. - */ -const int DEFAULT_Y_POSITION = 0; - -/** - * Gl red default. - */ -const GLfloat GL_RED_DEFAULT = 0.0; - -/** - * Gl green default. - */ -const GLfloat GL_GREEN_DEFAULT = 0.0; - -/** - * Gl blue default. - */ -const GLfloat GL_BLUE_DEFAULT = 0.0; - -/** - * Gl alpha default. - */ -const GLfloat GL_ALPHA_DEFAULT = 1.0; - -/** - * Pointer size. - */ -const GLint POINTER_SIZE = 2; - -/** - * Triangle fan size. - */ -const GLsizei TRIANGLE_FAN_SIZE = 4; - -/** - * Fifty percent. - */ -const float FIFTY_PERCENT = 0.5; - -/** - * Position handle name. - */ -const char POSITION_NAME[] = "a_position"; - -/** - * numeric value 0. - */ -const int NUM_0 = 0; - -/** - * numeric value 4. - */ -const int NUM_4 = 4; - -/** - * Background color #f4f4f4. - */ -const GLfloat BACKGROUND_COLOR[] = {244.0f / 255, 244.0f / 255, 244.0f / 255, 1.0f}; - -/** - * Background color #ffffff00. - */ -const GLfloat TRANSPARENT_COLOR[] = {255.0f / 255, 255.0f / 255, 255.0f / 255, 0.0f}; - -/** - * Draw color #7E8FFB. - */ -const GLfloat DRAW_COLOR[] = {126.0f / 255, 143.0f / 255, 251.0f / 255, 1.0f}; - -/** - * Change color #92D6CC. - */ -const GLfloat CHANGE_COLOR[] = {146.0f / 255, 214.0f / 255, 204.0f / 255, 1.0f}; - -/** - * Background area. - */ -const GLfloat BACKGROUND_RECTANGLE_VERTICES[] = {-1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f}; - -const EGLint ATTRIB_LIST[] = { - // Key,value. - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, 8, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - // End. - EGL_NONE}; - -const EGLint CONTEXT_ATTRIBS[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE}; - -/** - * Vertex shader. - */ -const char VERTEX_SHADER[] = "#version 300 es\n" - "layout(location = 0) in vec4 a_position;\n" - "layout(location = 1) in vec4 a_color; \n" - "out vec4 v_color; \n" - "void main() \n" - "{ \n" - " gl_Position = a_position; \n" - " v_color = a_color; \n" - "} \n"; - -/** - * Fragment shader. - */ -const char FRAGMENT_SHADER[] = "#version 300 es\n" - "precision mediump float; \n" - "in vec4 v_color; \n" - "out vec4 fragColor; \n" - "void main() \n" - "{ \n" - " fragColor = v_color; \n" - "} \n"; -#endif // NATIVEXCOMPONENT_EGLCONST_H diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.cpp deleted file mode 100644 index f82795fc79e40b56fb40674430c0e8f34e62fd68..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "EGLRender.h" -#include "EGLConst.h" -#include -#include -#include -#include -#include -#include -#include -#include - -namespace { -void Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat *rotateX, GLfloat *rotateY, GLfloat theta) -{ - GLfloat tempX = cos(theta) * (*rotateX - centerX) - sin(theta) * (*rotateY - centerY); - GLfloat tempY = sin(theta) * (*rotateX - centerX) + cos(theta) * (*rotateY - centerY); - *rotateX = tempX + centerX; - *rotateY = tempY + centerY; -} - -GLuint LoadShader(GLenum type, const char *shaderSrc) -{ - if ((type <= 0) || (shaderSrc == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "glCreateShader type or shaderSrc error"); - return PROGRAM_ERROR; - } - - GLuint shader = glCreateShader(type); - if (shader == 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "glCreateShader unable to load shader"); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glShaderSource(shader, 1, &shaderSrc, nullptr); - glCompileShader(shader); - - GLint compiled; - glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); - if (compiled != 0) { - return shader; - } - - GLint infoLen = 0; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen <= 1) { - glDeleteShader(shader); - return PROGRAM_ERROR; - } - - char *infoLog = (char *)malloc(sizeof(char) * (infoLen + 1)); - if (infoLog != nullptr) { - memset(infoLog, 0, infoLen + 1); - glGetShaderInfoLog(shader, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "glCompileShader error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(shader); - return PROGRAM_ERROR; -} - -GLuint CreateProgram(const char *vertexShader, const char *fragShader) -{ - if ((vertexShader == nullptr) || (fragShader == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", - "createProgram: vertexShader or fragShader is null"); - return PROGRAM_ERROR; - } - - GLuint vertex = LoadShader(GL_VERTEX_SHADER, vertexShader); - if (vertex == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "createProgram vertex error"); - return PROGRAM_ERROR; - } - - GLuint fragment = LoadShader(GL_FRAGMENT_SHADER, fragShader); - if (fragment == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "createProgram fragment error"); - return PROGRAM_ERROR; - } - - GLuint program = glCreateProgram(); - if (program == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "createProgram program error"); - glDeleteShader(vertex); - glDeleteShader(fragment); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glAttachShader(program, vertex); - glAttachShader(program, fragment); - glLinkProgram(program); - - GLint linked; - glGetProgramiv(program, GL_LINK_STATUS, &linked); - if (linked != 0) { - glDeleteShader(vertex); - glDeleteShader(fragment); - return program; - } - - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "createProgram linked error"); - GLint infoLen = 0; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen > 1) { - char *infoLog = (char *)malloc(sizeof(char) * (infoLen + 1)); - memset(infoLog, 0, infoLen + 1); - glGetProgramInfoLog(program, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "glLinkProgram error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(vertex); - glDeleteShader(fragment); - glDeleteProgram(program); - return PROGRAM_ERROR; -} -} // namespace - -bool EGLRender::SetUpEGLContext(void *window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLRender", "EglContextInit execute"); - eglWindow_ = (EGLNativeWindowType)(window); - // Init display. - eglDisplay_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (eglDisplay_ == EGL_NO_DISPLAY) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "eglGetDisplay: unable to get EGL display"); - return false; - } - EGLint majorVersion; - EGLint minorVersion; - if (!eglInitialize(eglDisplay_, &majorVersion, &minorVersion)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", - "eglInitialize: unable to get initialize EGL display"); - return false; - }; - // Select configuration. - const EGLint maxConfigSize = 1; - EGLint numConfigs; - if (!eglChooseConfig(eglDisplay_, ATTRIB_LIST, &eglConfig_, maxConfigSize, &numConfigs)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "eglChooseConfig: unable to choose configs"); - return false; - }; - // CreateEnvironment. - // Create surface. - eglSurface_ = eglCreateWindowSurface(eglDisplay_, eglConfig_, eglWindow_, NULL); - if (eglSurface_ == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", - "eglCreateWindowSurface: unable to create surface"); - return false; - } - if (eglSurface_ == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", - "eglCreateWindowSurface: unable to create surface"); - return false; - } - // Create context. - eglContext_ = eglCreateContext(eglDisplay_, eglConfig_, EGL_NO_CONTEXT, CONTEXT_ATTRIBS); - if (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "eglMakeCurrent failed"); - return false; - } - // Create program. - program_ = CreateProgram(VERTEX_SHADER, FRAGMENT_SHADER); - if (program_ == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "CreateProgram: unable to create program"); - return false; - } - return true; -} - -GLint EGLRender::PrepareDraw() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (eglContext_ == nullptr) || - (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "PrepareDraw: param error"); - return POSITION_ERROR; - } - - // The gl function has no return value. - glViewport(DEFAULT_X_POSITION, DEFAULT_Y_POSITION, width_, height_); - glClearColor(GL_RED_DEFAULT, GL_GREEN_DEFAULT, GL_BLUE_DEFAULT, GL_ALPHA_DEFAULT); - glClear(GL_COLOR_BUFFER_BIT); - glUseProgram(program_); - - return glGetAttribLocation(program_, POSITION_NAME); -} - -void EGLRender::DrawStar(bool drawColor) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLRender", "Draw"); - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, BACKGROUND_RECTANGLE_VERTICES)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw execute draw background failed"); - return; - } - - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices - GLfloat rotateX = 0; - GLfloat rotateY = FIFTY_PERCENT * height_; - GLfloat centerX = 0; - // Convert DEG(54° & 18°) to RAD - GLfloat centerY = -rotateY * (M_PI / 180 * 54) * (M_PI / 180 * 18); - // Convert DEG(18°) to RAD - GLfloat leftX = -rotateY * (M_PI / 180 * 18); - GLfloat leftY = 0; - // Convert DEG(18°) to RAD - GLfloat rightX = rotateY * (M_PI / 180 * 18); - GLfloat rightY = 0; - - const GLfloat shapeVertices[] = {centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_}; - auto color = drawColor ? DRAW_COLOR : CHANGE_COLOR; - if (!ExecuteDraw(position, color, shapeVertices)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw execute draw shape failed"); - return; - } - - // Convert DEG(72°) to RAD - GLfloat rad = M_PI / 180 * 72; - // Rotate four times - for (int i = NUM_0; i < NUM_4; ++i) { - Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); - Rotate2d(centerX, centerY, &leftX, &leftY, rad); - Rotate2d(centerX, centerY, &rightX, &rightY, rad); - - const GLfloat shapeVertices[] = {centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_}; - - if (!ExecuteDraw(position, color, shapeVertices)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw execute draw shape failed"); - return; - } - } - // 将绘制命令提交给GPU,GPU执行完成后将渲染结果显示到屏幕 - glFlush(); - glFinish(); - if (!eglSwapBuffers(eglDisplay_, eglSurface_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw FinishDraw failed"); - return; - } -} - -void EGLRender::Clear() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (eglContext_ == nullptr) || - (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "PrepareDraw: param error"); - return; - } - - // The gl function has no return value. - glViewport(DEFAULT_X_POSITION, DEFAULT_Y_POSITION, width_, height_); - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); - glFlush(); - glFinish(); - eglSwapBuffers(eglDisplay_, eglSurface_); -} - -bool EGLRender::ExecuteDraw(GLint position, const GLfloat *color, const GLfloat shapeVertices[]) -{ - if ((position > 0) || (color == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glEnableVertexAttribArray(position); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - - return true; -} - -void EGLRender::SetEGLWindowSize(int width, int height) -{ - width_ = width; - height_ = height; -} - -void EGLRender::DestroySurface() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (!eglDestroySurface(eglDisplay_, eglSurface_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "EGLRender", "Release eglDestroySurface failed"); - } - - if ((eglDisplay_ == nullptr) || (eglContext_ == nullptr) || (!eglDestroyContext(eglDisplay_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "EGLRender", "Release eglDestroySurface failed"); - } - - if ((eglDisplay_ == nullptr) || (!eglTerminate(eglDisplay_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xff00, "EGLRender", "Release eglDestroySurface failed"); - } - eglDisplay_ = EGL_NO_DISPLAY; - eglSurface_ = EGL_NO_SURFACE; - eglContext_ = EGL_NO_CONTEXT; -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.h b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.h deleted file mode 100644 index eeed4f21d33a9e32b989bd45694eccd723a10815..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVEXCOMPONENT_EGLRENDER_H -#define NATIVEXCOMPONENT_EGLRENDER_H - -#include "EGLConst.h" -#include -#include -#include -#include -#include - -class EGLRender { -public: - bool SetUpEGLContext(void *window); - void SetEGLWindowSize(int width, int height); - void DrawStar(bool drawColor); - void DestroySurface(); - void Clear(); - - std::string xcomponentId; - EGLNativeWindowType eglWindow_; - - EGLDisplay eglDisplay_ = EGL_NO_DISPLAY; - EGLConfig eglConfig_ = EGL_NO_CONFIG_KHR; - EGLSurface eglSurface_ = EGL_NO_SURFACE; - EGLContext eglContext_ = EGL_NO_CONTEXT; - GLuint program_; - int width_ = 0; - int height_ = 0; - -private: - GLint PrepareDraw(); - bool ExecuteDraw(GLint position, const GLfloat *color, const GLfloat shapeVertices[]); -}; -#endif // NATIVEXCOMPONENT_EGLRENDER_H diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.cpp deleted file mode 100644 index 7ee82f7ce0bf21ee29ab86d4f823962d9d75c2c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.cpp +++ /dev/null @@ -1,613 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "egl_core.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "../common/common.h" -#include "plugin_render.h" - -namespace NativeXComponentSample { -namespace { -constexpr int32_t NUM_4 = 4; -/** - * Vertex shader. - */ -const char VERTEX_SHADER[] = "#version 300 es\n" - "layout(location = 0) in vec4 a_position;\n" - "layout(location = 1) in vec4 a_color; \n" - "out vec4 v_color; \n" - "void main() \n" - "{ \n" - " gl_Position = a_position; \n" - " v_color = a_color; \n" - "} \n"; - -/** - * Fragment shader. - */ -const char FRAGMENT_SHADER[] = "#version 300 es\n" - "precision mediump float; \n" - "in vec4 v_color; \n" - "out vec4 fragColor; \n" - "void main() \n" - "{ \n" - " fragColor = v_color; \n" - "} \n"; - -/** - * Background color #f4f4f4. - */ -const GLfloat BACKGROUND_COLOR[] = {244.0f / 255, 244.0f / 255, 244.0f / 255, 1.0f}; - -/** - * Draw color #7E8FFB. - */ -const GLfloat DRAW_COLOR[] = {126.0f / 255, 143.0f / 255, 251.0f / 255, 1.0f}; - -/** - * Change color #92D6CC. - */ -const GLfloat CHANGE_COLOR[] = {146.0f / 255, 214.0f / 255, 204.0f / 255, 1.0f}; - -/** - * Background area. - */ -const GLfloat BACKGROUND_RECTANGLE_VERTICES[] = { - -1.0f, 1.0f, - 1.0f, 1.0f, - 1.0f, -1.0f, - -1.0f, -1.0f}; - -/** - * Get context parameter count. - */ -const size_t GET_CONTEXT_PARAM_CNT = 1; - -/** - * Fifty percent. - */ -const float FIFTY_PERCENT = 0.5; - -/** - * Pointer size. - */ -const GLint POINTER_SIZE = 2; - -/** - * Triangle fan size. - */ -const GLsizei TRIANGLE_FAN_SIZE = 4; - -/** - * Egl red size default. - */ -const int EGL_RED_SIZE_DEFAULT = 8; - -/** - * Egl green size default. - */ -const int EGL_GREEN_SIZE_DEFAULT = 8; - -/** - * Egl blue size default. - */ -const int EGL_BLUE_SIZE_DEFAULT = 8; - -/** - * Egl alpha size default. - */ -const int EGL_ALPHA_SIZE_DEFAULT = 8; - -/** - * Default x position. - */ -const int DEFAULT_X_POSITION = 0; - -/** - * Default y position. - */ -const int DEFAULT_Y_POSITION = 0; - -/** - * Gl red default. - */ -const GLfloat GL_RED_DEFAULT = 0.0; - -/** - * Gl green default. - */ -const GLfloat GL_GREEN_DEFAULT = 0.0; - -/** - * Gl blue default. - */ -const GLfloat GL_BLUE_DEFAULT = 0.0; - -/** - * Gl alpha default. - */ -const GLfloat GL_ALPHA_DEFAULT = 1.0; - -/** - * Program error. - */ -const GLuint PROGRAM_ERROR = 0; - -/** - * Shape vertices size. - */ -const int SHAPE_VERTICES_SIZE = 8; - -/** - * Position handle name. - */ -const char POSITION_NAME[] = "a_position"; - -/** - * Position error. - */ -const GLint POSITION_ERROR = -1; - -/** - * Config attribute list. - */ -const EGLint ATTRIB_LIST[] = { - // Key,value. - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RED_SIZE, EGL_RED_SIZE_DEFAULT, - EGL_GREEN_SIZE, EGL_GREEN_SIZE_DEFAULT, - EGL_BLUE_SIZE, EGL_BLUE_SIZE_DEFAULT, - EGL_ALPHA_SIZE, EGL_ALPHA_SIZE_DEFAULT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - // End. - EGL_NONE}; - -/** - * Context attributes. - */ -const EGLint CONTEXT_ATTRIBS[] = { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE}; -} // namespace -bool EGLCore::EglContextInit(void* window, int width, int height) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "EglContextInit execute"); - if ((window == nullptr) || (width <= 0) || (height <= 0)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "EglContextInit: param error"); - return false; - } - - UpdateSize(width, height); - eglWindow_ = static_cast(window); - - // Init display. - eglDisplay_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (eglDisplay_ == EGL_NO_DISPLAY) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglGetDisplay: unable to get EGL display"); - return false; - } - - EGLint majorVersion; - EGLint minorVersion; - if (!eglInitialize(eglDisplay_, &majorVersion, &minorVersion)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglInitialize: unable to get initialize EGL display"); - return false; - } - - // Select configuration. - const EGLint maxConfigSize = 1; - EGLint numConfigs; - if (!eglChooseConfig(eglDisplay_, ATTRIB_LIST, &eglConfig_, maxConfigSize, &numConfigs)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglChooseConfig: unable to choose configs"); - return false; - } - - return CreateEnvironment(); -} - -bool EGLCore::CreateEnvironment() -{ - // Create surface. - if (eglWindow_ == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglWindow_ is null"); - return false; - } - eglSurface_ = eglCreateWindowSurface(eglDisplay_, eglConfig_, eglWindow_, NULL); - if (eglSurface_ == nullptr) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglCreateWindowSurface: unable to create surface"); - return false; - } - // Create context. - eglContext_ = eglCreateContext(eglDisplay_, eglConfig_, EGL_NO_CONTEXT, CONTEXT_ATTRIBS); - if (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglMakeCurrent failed"); - return false; - } - // Create program. - program_ = CreateProgram(VERTEX_SHADER, FRAGMENT_SHADER); - if (program_ == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "CreateProgram: unable to create program"); - return false; - } - return true; -} - -void EGLCore::Background() -{ - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Background get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, - BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Background execute draw failed"); - return; - } - - if (!FinishDraw()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Background FinishDraw failed"); - return; - } -} - -void EGLCore::Draw(int& hasDraw) -{ - flag_ = false; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "Draw"); - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, - BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw background failed"); - return; - } - - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices - GLfloat rotateX = 0; - GLfloat rotateY = FIFTY_PERCENT * height_; - GLfloat centerX = 0; - // Convert DEG(54° & 18°) to RAD - GLfloat centerY = -rotateY * (M_PI / 180 * 54) * (M_PI / 180 * 18); - // Convert DEG(18°) to RAD - GLfloat leftX = -rotateY * (M_PI / 180 * 18); - GLfloat leftY = 0; - // Convert DEG(18°) to RAD - GLfloat rightX = rotateY * (M_PI / 180 * 18); - GLfloat rightY = 0; - - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawStar(position, DRAW_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - - // Convert DEG(72°) to RAD - GLfloat rad = M_PI / 180 * 72; - // Rotate four times - for (int i = 0; i < NUM_4; ++i) { - Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); - Rotate2d(centerX, centerY, &leftX, &leftY, rad); - Rotate2d(centerX, centerY, &rightX, &rightY, rad); - - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawStar(position, DRAW_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - } - - if (!FinishDraw()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw FinishDraw failed"); - return; - } - hasDraw = 1; - - flag_ = true; -} - -void EGLCore::ChangeColor(int& hasChangeColor) -{ - if (!flag_) { - return; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor"); - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, - BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor execute draw background failed"); - return; - } - - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices - GLfloat rotateX = 0; - GLfloat rotateY = FIFTY_PERCENT * height_; - GLfloat centerX = 0; - // Convert DEG(54° & 18°) to RAD - GLfloat centerY = -rotateY * (M_PI / 180 * 54) * (M_PI / 180 * 18); - // Convert DEG(18°) to RAD - GLfloat leftX = -rotateY * (M_PI / 180 * 18); - GLfloat leftY = 0; - // Convert DEG(18°) to RAD - GLfloat rightX = rotateY * (M_PI / 180 * 18); - GLfloat rightY = 0; - - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawNewStar(0, CHANGE_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - - // Convert DEG(72°) to RAD - GLfloat rad = M_PI / 180 * 72; - // Rotate four times - for (int i = 0; i < NUM_4; ++i) { - Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); - Rotate2d(centerX, centerY, &leftX, &leftY, rad); - Rotate2d(centerX, centerY, &rightX, &rightY, rad); - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawNewStar(position, CHANGE_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - } - - if (!FinishDraw()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor FinishDraw failed"); - } - hasChangeColor = 1; -} - -GLint EGLCore::PrepareDraw() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (eglContext_ == nullptr) || - (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "PrepareDraw: param error"); - return POSITION_ERROR; - } - - // The gl function has no return value. - glViewport(DEFAULT_X_POSITION, DEFAULT_Y_POSITION, width_, height_); - glClearColor(GL_RED_DEFAULT, GL_GREEN_DEFAULT, GL_BLUE_DEFAULT, GL_ALPHA_DEFAULT); - glClear(GL_COLOR_BUFFER_BIT); - glUseProgram(program_); - - return glGetAttribLocation(program_, POSITION_NAME); -} - -bool EGLCore::ExecuteDraw(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) -{ - if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glEnableVertexAttribArray(position); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - - return true; -} - -bool EGLCore::ExecuteDrawStar( - GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) -{ - if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glVertexAttribPointer(1, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, color); - glEnableVertexAttribArray(position); - glEnableVertexAttribArray(1); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - glDisableVertexAttribArray(1); - - return true; -} - -bool EGLCore::ExecuteDrawNewStar( - GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) -{ - if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glEnableVertexAttribArray(position); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - - return true; -} - -void EGLCore::Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat* rotateX, GLfloat* rotateY, GLfloat theta) -{ - GLfloat tempX = cos(theta) * (*rotateX - centerX) - sin(theta) * (*rotateY - centerY); - GLfloat tempY = sin(theta) * (*rotateX - centerX) + cos(theta) * (*rotateY - centerY); - *rotateX = tempX + centerX; - *rotateY = tempY + centerY; -} - -bool EGLCore::FinishDraw() -{ - // The gl function has no return value. - glFlush(); - glFinish(); - return eglSwapBuffers(eglDisplay_, eglSurface_); -} - -GLuint EGLCore::LoadShader(GLenum type, const char* shaderSrc) -{ - if ((type <= 0) || (shaderSrc == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCreateShader type or shaderSrc error"); - return PROGRAM_ERROR; - } - - GLuint shader = glCreateShader(type); - if (shader == 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCreateShader unable to load shader"); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glShaderSource(shader, 1, &shaderSrc, nullptr); - glCompileShader(shader); - - GLint compiled; - glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); - if (compiled != 0) { - return shader; - } - - GLint infoLen = 0; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen <= 1) { - glDeleteShader(shader); - return PROGRAM_ERROR; - } - - char* infoLog = (char*)malloc(sizeof(char) * (infoLen + 1)); - if (infoLog != nullptr) { - memset(infoLog, 0, infoLen + 1); - glGetShaderInfoLog(shader, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCompileShader error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(shader); - return PROGRAM_ERROR; -} - -GLuint EGLCore::CreateProgram(const char* vertexShader, const char* fragShader) -{ - if ((vertexShader == nullptr) || (fragShader == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram: vertexShader or fragShader is null"); - return PROGRAM_ERROR; - } - - GLuint vertex = LoadShader(GL_VERTEX_SHADER, vertexShader); - if (vertex == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram vertex error"); - return PROGRAM_ERROR; - } - - GLuint fragment = LoadShader(GL_FRAGMENT_SHADER, fragShader); - if (fragment == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram fragment error"); - return PROGRAM_ERROR; - } - - GLuint program = glCreateProgram(); - if (program == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram program error"); - glDeleteShader(vertex); - glDeleteShader(fragment); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glAttachShader(program, vertex); - glAttachShader(program, fragment); - glLinkProgram(program); - - GLint linked; - glGetProgramiv(program, GL_LINK_STATUS, &linked); - if (linked != 0) { - glDeleteShader(vertex); - glDeleteShader(fragment); - return program; - } - - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram linked error"); - GLint infoLen = 0; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen > 1) { - char* infoLog = (char*)malloc(sizeof(char) * (infoLen + 1)); - memset(infoLog, 0, infoLen + 1); - glGetProgramInfoLog(program, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glLinkProgram error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(vertex); - glDeleteShader(fragment); - glDeleteProgram(program); - return PROGRAM_ERROR; -} - -void EGLCore::UpdateSize(int width, int height) -{ - width_ = width; - height_ = height; - if (width_ > 0) { - widthPercent_ = FIFTY_PERCENT * height_ / width_; - } -} - -void EGLCore::Release() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (!eglDestroySurface(eglDisplay_, eglSurface_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroySurface failed"); - } - - if ((eglDisplay_ == nullptr) || (eglContext_ == nullptr) || (!eglDestroyContext(eglDisplay_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroyContext failed"); - } - - if ((eglDisplay_ == nullptr) || (!eglTerminate(eglDisplay_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglTerminate failed"); - } -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.h b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.h deleted file mode 100644 index 3a7c4bf1cef056ebff9f19d281e3fef1f050f483..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef NATIVE_XCOMPONENT_EGL_CORE_H -#define NATIVE_XCOMPONENT_EGL_CORE_H - -#include -#include -#include -#include "string" - -namespace NativeXComponentSample { -class EGLCore { -public: - explicit EGLCore() {} - ~EGLCore() {} - bool EglContextInit(void* window, int width, int height); - bool CreateEnvironment(); - void Draw(int& hasDraw); - void Background(); - void ChangeColor(int& hasChangeColor); - void Release(); - void UpdateSize(int width, int height); - -private: - GLuint LoadShader(GLenum type, const char* shaderSrc); - GLuint CreateProgram(const char* vertexShader, const char* fragShader); - GLint PrepareDraw(); - bool ExecuteDraw(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize); - bool ExecuteDrawStar(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize); - bool ExecuteDrawNewStar(GLint position, const GLfloat* color, - const GLfloat shapeVertices[], unsigned long vertSize); - void Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat* rotateX, GLfloat* rotateY, GLfloat theta); - bool FinishDraw(); - -private: - EGLNativeWindowType eglWindow_; - EGLDisplay eglDisplay_ = EGL_NO_DISPLAY; - EGLConfig eglConfig_ = EGL_NO_CONFIG_KHR; - EGLSurface eglSurface_ = EGL_NO_SURFACE; - EGLContext eglContext_ = EGL_NO_CONTEXT; - GLuint program_; - bool flag_ = false; - int width_; - int height_; - GLfloat widthPercent_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_EGL_CORE_H diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.cpp deleted file mode 100644 index 8b3ee120c674d83e2a9b3ff208294ccefa6617b4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.cpp +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#include -#include -#include - -#include "../common/common.h" -#include "../manager/plugin_manager.h" -#include "plugin_render.h" - -namespace NativeXComponentSample { -namespace { -void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - uint64_t width; - uint64_t height; - int32_t xSize = OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - if ((xSize == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) && (render != nullptr)) { - if (render->eglCore_->EglContextInit(window, width, height)) { - render->eglCore_->Background(); - } - } -} - -void OnSurfaceChangedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "surface changed"); - } -} - -void OnSurfaceDestroyedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - PluginRender::Release(id); -} - -void DispatchTouchEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - PluginRender* render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } -} - -void DispatchMouseEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchMouseEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - OH_NativeXComponent_ExtraMouseEventInfo* mouseEventInfo = NULL; - ret = OH_NativeXComponent_GetExtraMouseEventInfo(component, &mouseEventInfo); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - uint64_t mouseKey; - ret = OH_NativeXComponent_GetMouseEventModifierKeyStates(mouseEventInfo, &mouseKey); - if (ret == OH_NATIVEXCOMPONENT_RESULT_FAILED || ret == OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER) { - return; - } - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnMouseEvent(component, window); - } -} - -void DispatchHoverEventCB(OH_NativeXComponent* component, bool isHover) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchHoverEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnHoverEvent(component, isHover); - } -} - -void OnFocusEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnFocusEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnFocusEvent(component, window); - } -} - -void OnBlurEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnBlurEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnBlurEvent(component, window); - } -} - -void OnKeyEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnKeyEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnKeyEvent(component, window); - } -} -} // namespace - -std::unordered_map PluginRender::instance_; -int32_t PluginRender::hasDraw_ = 0; -int32_t PluginRender::hasChangeColor_ = 0; - -PluginRender::PluginRender(std::string& id) -{ - this->id_ = id; - this->eglCore_ = new EGLCore(); -} - -PluginRender* PluginRender::GetInstance(std::string& id) -{ - if (instance_.find(id) == instance_.end()) { - PluginRender* instance = new PluginRender(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } -} - -void PluginRender::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "Export: env or exports is null"); - return; - } - - napi_property_descriptor desc[] = { - {"drawPatternX", nullptr, PluginRender::NapiDrawPattern, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"getStatusX", nullptr, PluginRender::TestGetXComponentStatus, nullptr, nullptr, - nullptr, napi_default, nullptr}}; - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "Export: napi_define_properties failed"); - } -} - -// NAPI registration method type napi_callback. If no value is returned, nullptr is returned. -napi_value PluginRender::NapiDrawPattern(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginRender", "NapiDrawPattern"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "NapiDrawPattern: env or info is null"); - return nullptr; - } - - napi_value thisArg; - if (napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "NapiDrawPattern: napi_get_cb_info fail"); - return nullptr; - } - - napi_value exportInstance; - if (napi_get_named_property(env, thisArg, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "NapiDrawPattern: napi_get_named_property fail"); - return nullptr; - } - - OH_NativeXComponent* nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "NapiDrawPattern: napi_unwrap fail"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "NapiDrawPattern: Unable to get XComponent id"); - return nullptr; - } - - std::string id(idStr); - PluginRender* render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->eglCore_->Draw(hasDraw_); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginRender", "render->eglCore_->Draw() executed"); - } - return nullptr; -} - -void PluginRender::Release(std::string& id) -{ - PluginRender* render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->eglCore_->Release(); - delete render->eglCore_; - render->eglCore_ = nullptr; - instance_.erase(instance_.find(id)); - } -} - -void PluginRender::OnSurfaceChanged(OH_NativeXComponent* component, void* window) -{ - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChanged: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - PluginRender* render = PluginRender::GetInstance(id); - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OH_NativeXComponent_GetXComponentOffset", - "offsetX = %{public}lf, offsetY = %{public}lf", offsetX, offsetY); - uint64_t width; - uint64_t height; - OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - if (render != nullptr) { - render->eglCore_->UpdateSize(width, height); - } -} - -void PluginRender::OnTouchEvent(OH_NativeXComponent* component, void* window) -{ - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent_SourceTool sourceTool = OH_NATIVEXCOMPONENT_SOURCETOOL_UNKNOWN; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: OH_NATIVEXCOMPONENT_SOURCETOOL_UNKNOWN = %{public}d", sourceTool); - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - std::string id(idStr); - PluginRender* render = PluginRender::GetInstance(id); - if (render != nullptr && touchEvent.type == OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UP) { - render->eglCore_->ChangeColor(hasChangeColor_); - } - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - float windowX = 0; - float windowY = 0; - float displayX = 0; - float displayY = 0; - OH_NativeXComponent_GetTouchPointWindowX(component, 0, &windowX); - OH_NativeXComponent_GetTouchPointWindowY(component, 0, &windowY); - OH_NativeXComponent_GetTouchPointDisplayX(component, 0, &displayX); - OH_NativeXComponent_GetTouchPointDisplayY(component, 0, &displayY); - int32_t pointId = 0; - OH_NativeXComponent_EventSourceType sourceType; - OH_NativeXComponent_GetTouchEventSourceType(component, pointId, &sourceType); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: max_touch_points_number = %{public}d", OH_MAX_TOUCH_POINTS_NUMBER); - bool isshowSample = 0; - if (isshowSample == 1) { - // 仅展示使用方法 - ShowSample(component); - } -} - -void SampleCallback(OH_NativeXComponent* component, uint64_t timestamp, uint64_t targettimestamp) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "SampleCallback", "SampleCallback"); -} - -void SampleInputeventCallback(OH_NativeXComponent *component, ArkUI_UIInputEvent *event, ArkUI_UIInputEvent_Type type) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "SampleInputeventCallback", "SampleInputeventCallback"); -} - -HitTestMode SampleInterceptCallback(OH_NativeXComponent *component, ArkUI_UIInputEvent *event) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "SampleInterceptCallback", "SampleInterceptCallback"); -} - -void SampleSurfaceShowCallback(OH_NativeXComponent *component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "SampleSurfaceShowCallback", "SampleSurfaceShowCallback"); -} - -bool SampleCallbackWithResult(OH_NativeXComponent *component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "SampleCallbackWithResult", "SampleCallbackWithResult"); - return false; -} - -void SampleAnalyzer(ArkUI_NodeHandle node, ArkUI_XComponent_ImageAnalyzerState statusCode, void* userData) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "SampleAnalyzer", "SampleAnalyzer"); -} - -void myContentHandler(ArkUI_NodeContentEvent* event) { - // 处理内容变化 -} - -void PluginRender::ShowSample(OH_NativeXComponent* component) -{ - int32_t min = 0; - int32_t max = 0; - int32_t expected = 0; - OH_NativeXComponent_ExpectedRateRange range = {.min = min, .max = max, .expected = expected}; - OH_NativeXComponent_SetExpectedFrameRateRange(component, &range); - bool needSoftKeyboard = 0; - OH_NativeXComponent_SetNeedSoftKeyboard(component, needSoftKeyboard); - ArkUI_AccessibilityProvider* sampleHandle; //此处需要绑定handle - OH_NativeXComponent_GetNativeAccessibilityProvider(component, &sampleHandle); - OH_NativeXComponent_RegisterOnFrameCallback(component, SampleCallback); - OH_NativeXComponent_UnregisterOnFrameCallback(component); - ArkUI_UIInputEvent_Type type = ARKUI_UIINPUTEVENT_TYPE_UNKNOWN; - OH_NativeXComponent_RegisterUIInputEventCallback(component, SampleInputeventCallback, type); - OH_NativeXComponent_RegisterOnTouchInterceptCallback(component, SampleInterceptCallback); - OH_NativeXComponent_RegisterSurfaceShowCallback(component, SampleSurfaceShowCallback); - OH_NativeXComponent_RegisterSurfaceHideCallback(component, SampleSurfaceShowCallback); - OH_NativeXComponent_RegisterKeyEventCallbackWithResult(component, SampleCallbackWithResult); - ArkUI_NodeHandle node; - void* userData; - OH_ArkUI_XComponent_StartImageAnalyzer(node, userData, SampleAnalyzer); - OH_ArkUI_XComponent_StopImageAnalyzer(node); - ArkUI_NodeContentCallback callback1 = myContentHandler; -} - -void PluginRender::RegisterCallback(OH_NativeXComponent* nativeXComponent) -{ - renderCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - renderCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - renderCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - renderCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &renderCallback_); - - mouseCallback_.DispatchMouseEvent = DispatchMouseEventCB; - mouseCallback_.DispatchHoverEvent = DispatchHoverEventCB; - OH_NativeXComponent_RegisterMouseEventCallback(nativeXComponent, &mouseCallback_); - - OH_NativeXComponent_RegisterFocusEventCallback(nativeXComponent, OnFocusEventCB); - OH_NativeXComponent_RegisterKeyEventCallback(nativeXComponent, OnKeyEventCB); - OH_NativeXComponent_RegisterBlurEventCallback(nativeXComponent, OnBlurEventCB); -} - -void PluginRender::OnMouseEvent(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginRender", "OnMouseEvent"); - OH_NativeXComponent_MouseEvent mouseEvent; - int32_t ret = OH_NativeXComponent_GetMouseEvent(component, window, &mouseEvent); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginRender", - "MouseEvent Info: x = %{public}f, y = %{public}f, action = %{public}d, button = %{public}d", mouseEvent.x, - mouseEvent.y, mouseEvent.action, mouseEvent.button); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "GetMouseEvent error"); - } -} - -void PluginRender::OnHoverEvent(OH_NativeXComponent* component, bool isHover) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginRender", "OnHoverEvent isHover_ = %{public}d", isHover); -} - -void PluginRender::OnFocusEvent(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginRender", "OnFocusEvent"); -} - -void PluginRender::OnBlurEvent(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginRender", "OnBlurEvent"); -} - -void PluginRender::OnKeyEvent(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginRender", "OnKeyEvent"); - - OH_NativeXComponent_KeyEvent* keyEvent = nullptr; - if (OH_NativeXComponent_GetKeyEvent(component, &keyEvent) >= 0) { - OH_NativeXComponent_KeyAction action; - OH_NativeXComponent_GetKeyEventAction(keyEvent, &action); - OH_NativeXComponent_KeyCode code; - OH_NativeXComponent_GetKeyEventCode(keyEvent, &code); - OH_NativeXComponent_EventSourceType sourceType; - OH_NativeXComponent_GetKeyEventSourceType(keyEvent, &sourceType); - int64_t deviceId; - OH_NativeXComponent_GetKeyEventDeviceId(keyEvent, &deviceId); - int64_t timeStamp; - OH_NativeXComponent_GetKeyEventTimestamp(keyEvent, &timeStamp); - uint64_t keys; - OH_NativeXComponent_GetKeyEventModifierKeyStates(keyEvent, &keys); - bool isNumLockOn; - OH_NativeXComponent_GetKeyEventNumLockState(keyEvent, &isNumLockOn); - bool isCapsLockOn; - OH_NativeXComponent_GetKeyEventCapsLockState(keyEvent, &isCapsLockOn); - bool isScrollLockOn; - OH_NativeXComponent_GetKeyEventScrollLockState(keyEvent, &isScrollLockOn); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginRender", - "KeyEvent Info: action=%{public}d, code=%{public}d, sourceType=%{public}d, deviceId=%{public}ld, " - "timeStamp=%{public}ld", - action, code, sourceType, deviceId, timeStamp); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "GetKeyEvent error"); - } -} - -napi_value PluginRender::TestGetXComponentStatus(napi_env env, napi_callback_info info) -{ - napi_value hasDraw; - napi_value hasChangeColor; - - napi_status ret = napi_create_int32(env, hasDraw_, &(hasDraw)); - if (ret != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "TestGetXComponentStatus", "napi_create_int32 hasDraw_ error"); - return nullptr; - } - ret = napi_create_int32(env, hasChangeColor_, &(hasChangeColor)); - if (ret != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "TestGetXComponentStatus", "napi_create_int32 hasChangeColor_ error"); - return nullptr; - } - - napi_value obj; - ret = napi_create_object(env, &obj); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "TestGetXComponentStatus", "napi_create_object error"); - return nullptr; - } - ret = napi_set_named_property(env, obj, "hasDraw", hasDraw); - if (ret != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "TestGetXComponentStatus", "napi_set_named_property hasDraw error"); - return nullptr; - } - ret = napi_set_named_property(env, obj, "hasChangeColor", hasChangeColor); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "TestGetXComponentStatus", - "napi_set_named_property hasChangeColor error"); - return nullptr; - } - return obj; -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.h b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.h deleted file mode 100644 index 5ee88b082c9fae82c4c2ce05ac8f94377e48e70e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef NATIVE_XCOMPONENT_PLUGIN_RENDER_H -#define NATIVE_XCOMPONENT_PLUGIN_RENDER_H - -#include -#include -#include -#include - -#include "egl_core.h" - -namespace NativeXComponentSample { -class PluginRender { -public: - explicit PluginRender(std::string& id); - ~PluginRender() - { - if (eglCore_ != nullptr) { - eglCore_->Release(); - delete eglCore_; - eglCore_ = nullptr; - } - } - static PluginRender* GetInstance(std::string& id); - static void Release(std::string& id); - static napi_value NapiDrawPattern(napi_env env, napi_callback_info info); - static napi_value TestGetXComponentStatus(napi_env env, napi_callback_info info); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent* component, void* window); - void OnTouchEvent(OH_NativeXComponent* component, void* window); - void OnMouseEvent(OH_NativeXComponent* component, void* window); - void OnHoverEvent(OH_NativeXComponent* component, bool isHover); - void OnFocusEvent(OH_NativeXComponent* component, void* window); - void OnBlurEvent(OH_NativeXComponent* component, void* window); - void OnKeyEvent(OH_NativeXComponent* component, void* window); - void RegisterCallback(OH_NativeXComponent* nativeXComponent); - void ShowSample(OH_NativeXComponent* component); - -public: - static std::unordered_map instance_; - EGLCore* eglCore_; - std::string id_; - static int32_t hasDraw_; - static int32_t hasChangeColor_; - -private: - OH_NativeXComponent_Callback renderCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_RENDER_H diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/types/libnativerender/Index.d.ts b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/types/libnativerender/Index.d.ts deleted file mode 100644 index ed3b8d30430b44a68e2ad6ad28c77e23be726b6c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/types/libnativerender/Index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 { NodeContent } from '@ohos.arkui.node'; -type XComponentContextStatus = { - hasDraw: boolean, - hasChangeColor: boolean -}; -export const createNativeNode: (content: NodeContent, tag: string) => void; -export const getStatus: () => XComponentContextStatus; -export const drawPattern: () => void; -export const bindNode: (id: string, node: object) => void; -export const unbindNode: (id: string) => void; -export const setFrameRate: (id: string, min: number, max: number, expected: number) => void; -export const setNeedSoftKeyboard: (id: string, needSoftKeyborad: boolean) => void; -export const initialize: (id: string) => void; -export const finalize: (id: string) => void; -export const drawStar: (id: string) => void; diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/types/libnativerender/oh-package.json5 b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/types/libnativerender/oh-package.json5 deleted file mode 100644 index 30e314ffe36c19975a60b090fec2df2e0b4158b2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/types/libnativerender/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libnativerender.so", - "types": "./Index.d.ts", - "version": " ", - "description": "Please describe the basic infomation" -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/entryability/EntryAbility.ts b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index aefdd5b7b8cf82af003c29651f07d7c7412d6060..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 UIAbility from '@ohos.app.ability.UIAbility'; -import hilog from '@ohos.hilog'; -import window from '@ohos.window'; - -export default class EntryAbility extends UIAbility { - onCreate(want, launchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - // Main window is created, set main page for this ability - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - 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. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground() { - // Ability has back to background - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -}; diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 2a89be4fd2886b169f4a62f1a1f3cbf7b9211c08..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NativeXComponentSample/entry/src/main/ets/interface/XComponentContext.ts b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/interface/XComponentContext.ts deleted file mode 100644 index 589c97e95744aedea86a822af3d3af89160c9afc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/interface/XComponentContext.ts +++ /dev/null @@ -1,25 +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. - */ - -export default interface XComponentContext { - drawPatternX(): void; - - getStatusX(): XComponentContextStatus; -}; - -type XComponentContextStatus = { - hasDraw: boolean, - hasChangeColor: boolean, -}; diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 53d735eb93219ead5122e16701ef80b334eacb05..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - pageInfos: NavPathStack = new NavPathStack(); - isUseInterception: boolean = false; - - build() { - Navigation(this.pageInfos) { - Tabs() { - TabContent() { - Column() { - Button('点击此处进入', { stateEffect: true, type: ButtonType.Capsule }) - .width('80%') - .height(40) - .margin(20) - .onClick(() => { - this.pageInfos.pushPath({ name: 'pageOne'}); - }) - Text(' 使用NDK接口创建XComponent,并使用NativeXComponent相关接口') - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Start) - } - .tabBar('NDK接口') - TabContent() { - Column() { - Button('点击此处进入', { stateEffect: true, type: ButtonType.Capsule }) - .width('80%') - .height(40) - .margin(20) - .onClick(() => { - this.pageInfos.pushPath({ name: 'pageTwo'}); - }) - Text(' 使用ArkTS声明式方法创建XComponent,并使用NativeXComponent相关接口') - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Start) - } - .tabBar('ArkTS声明式') - TabContent() { - Column() { - Button('点击此处进入', { stateEffect: true, type: ButtonType.Capsule }) - .width('80%') - .height(40) - .margin(20) - .onClick(() => { - this.pageInfos.pushPath({ name: 'pageThree'}); - }) - Text(' 使用自定义节点创建XComponent,并使用SurfaceHolder相关接口') - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Start) - } - .tabBar('自定义节点') - } - }.title('XComponent') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageOne.ets b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageOne.ets deleted file mode 100644 index 99a1dddbcb38addeb3d44ccaf7fe7e6a580e50a3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageOne.ets +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libnativerender.so'; -import {NodeContent} from '@kit.ArkUI'; - -@Builder -export function PageOneBuilder(name: string, param: Object){ - PageOne() -} -@Component -export struct PageOne { - @State currentStatus: string = 'init'; - private nodeContent: NodeContent = new NodeContent(); - aboutToAppear():void{ - nativeNode.createNativeNode(this.nodeContent,'CreatNativeNode'); - } - - build() { - NavDestination() { - Column() { - Row() { - Text('Native XComponent Sample') - .fontSize('24fp') - .fontWeight(500) - .margin({ - left: 24, - top: 12 - }) - } - .margin({ top: 24 }) - .width('100%') - .height(56) - - Column({ space: 10 }) { - ContentSlot(this.nodeContent); - Column().height(20) - Text(this.currentStatus) - .fontSize('24fp') - .fontWeight(500) - } - .onClick(() => { - let hasChangeColor: boolean = false; - if (nativeNode.getStatus()) { - hasChangeColor = nativeNode.getStatus().hasChangeColor; - } - if (hasChangeColor) { - this.currentStatus = 'change color'; - } - }) - .margin({ - top: 27, - left: 12, - right: 12 - }) - .height('40%') - .width('90%') - - Row() { - Button('Draw Star') - .fontSize('16fp') - .fontWeight(500) - .margin({ bottom: 24 }) - .onClick(() => { - nativeNode.drawPattern(); - let hasDraw: boolean = false; - if (nativeNode.getStatus()) { - hasDraw = nativeNode.getStatus().hasDraw; - } - if (hasDraw) { - this.currentStatus = 'draw star'; - } - }) - .width('53.6%') - .height(40) - } - .width('100%') - .justifyContent(FlexAlign.Center) - .alignItems(VerticalAlign.Bottom) - .layoutWeight(1) - } - .width('100%') - .height('100%') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageThree.ets b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageThree.ets deleted file mode 100644 index 0cb210d1a4c3fddb6a495ab3921beb13474e5232..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageThree.ets +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2025 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 native from 'libnativerender.so'; -import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; - -class MyNodeController extends NodeController { - public xComponent: typeNode.XComponent | undefined = undefined; - public xComponentId: string = 'xcp' + (new Date().getTime()); - public node: FrameNode | undefined = undefined; - public column: typeNode.Column | undefined = undefined; - public attachButton: typeNode.Button | undefined = undefined; - public detachButton: typeNode.Button | undefined = undefined; - makeNode(uiContext: UIContext): FrameNode | null { - this.node = new FrameNode(uiContext); - this.column = typeNode.createNode(uiContext, 'Column') - this.column.initialize() - .width('100%') - .height('100%') - try { - this.node.appendChild(this.column); - } catch (error) { - console.error('Fail to append child: ', error); - } - - this.xComponent = typeNode.createNode(uiContext, 'XComponent', { type: XComponentType.SURFACE }); - this.xComponent.attribute - .id(this.xComponentId) - .focusable(true) - .focusOnTouch(true) - native.bindNode(this.xComponentId, this.xComponent) - try { - this.column.appendChild(this.xComponent); - } catch (error) { - console.error('Fail to append child: ', error); - } - - return this.node; - } - - aboutToDisappear(): void { - native.unbindNode(this.xComponentId) - try { - this.node?.removeChild(this.xComponent); - } catch (error) { - console.error('Fail to remove child: ', error); - } - this.xComponent?.dispose(); - } -} - -@Builder -export function PageThreeBuilder(name: string, param: Object){ - PageThree() -} -@Component -export struct PageThree { - @State isShow: boolean = true; - @State minRate: number = 0; - @State maxRate: number = 120; - @State expected: number = 60; - needSoftKeyboard: boolean = false; - @State needSoftKeyboardState: string = 'needSoftKeyboard=' + this.needSoftKeyboard; - @State text: string = '单指点击XComponent软键盘消失'; - controller: TextInputController = new TextInputController(); - myNodeController: MyNodeController = new MyNodeController(); - - build() { - NavDestination() { - Column() { - TextInput({ text: this.text, placeholder: 'please input ...', controller: this.controller }) - .id('textInput') - .placeholderColor(Color.Grey) - .placeholderFont({ size: 14, weight: 400 }) - .caretColor(Color.Blue) - .width(400) - .height(40) - .margin(10) - .fontSize(14) - .fontColor(Color.Black) - .onChange((value: string) => { - this.text = value - }) - Column() { - if (this.isShow) { - NodeContainer(this.myNodeController) - .width(200) - .height(200) - .focusable(true) - .focusOnTouch(true) - .defaultFocus(true) - } - }.height(200) - - Button('创建/销毁').onClick(() => { - this.isShow = !this.isShow; - }).width('50%') - .margin({ - top: 10, - bottom: 10, - left: 12, - right: 12 - }) - - Column() { - Text('期望帧率设置:') - .textAlign(TextAlign.Start) - .fontSize(15) - .border({ width: 1 }) - .padding(10) - .width('100%') - .margin(5) - Text('min: ' + this.minRate) - Slider({ - value: this.minRate, - min: 0, - max: 240, - step: 1 - }).onChange((value: number, mode: SliderChangeMode) => { - this.minRate = value; - native.setFrameRate(this.myNodeController.xComponentId, this.minRate, this.maxRate, this.expected) - }).width('100%') - .id('minSlider') - Text('max: ' + this.maxRate) - Slider({ - value: this.maxRate, - min: 0, - max: 240, - step: 1 - }).onChange((value: number, mode: SliderChangeMode) => { - this.maxRate = value; - native.setFrameRate(this.myNodeController.xComponentId, this.minRate, this.maxRate, this.expected) - }).width('100%') - .id('maxSlider') - Text('expected: ' + this.expected) - Slider({ - value: this.expected, - min: 0, - max: 240, - step: 1 - }).onChange((value: number, mode: SliderChangeMode) => { - this.expected = value; - native.setFrameRate(this.myNodeController.xComponentId, this.minRate, this.maxRate, this.expected) - }).width('100%') - .id('expectedSlider') - }.backgroundColor('#F0FAFF') - - Button(this.needSoftKeyboardState) - .onClick(() => { - this.needSoftKeyboard = !this.needSoftKeyboard; - this.needSoftKeyboardState = 'needSoftKeyboard=' + this.needSoftKeyboard; - native.setNeedSoftKeyboard(this.myNodeController.xComponentId, this.needSoftKeyboard); - this.text = this.needSoftKeyboard ? '单指点击XComponent软键盘不消失' : '单指点击XComponent软键盘消失' - }) - .width('50%') - .margin({ - top: 10, - bottom: 10, - left: 12, - right: 12 - }) - Button('Initialize') - .onClick(()=>{ - native.initialize(this.myNodeController.xComponentId) - }) - .width('50%') - .margin({ - top: 10, - left: 12, - right: 12 - }) - Button('Finalize') - .onClick(()=>{ - native.finalize(this.myNodeController.xComponentId) - }) - .width('50%') - .margin({ - top: 10, - left: 12, - right: 12 - }) - } - .width('100%') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageTwo.ets b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageTwo.ets deleted file mode 100644 index ece54848cfea6c3c75fbb8e5cd41959c0c1eab35..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageTwo.ets +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2025 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 XComponentContext from '../interface/XComponentContext'; - -@Builder -export function PageTwoBuilder(name: string, param: Object){ - PageTwo() -} -@Component -export struct PageTwo { - @State currentStatus: string = 'init'; - private xComponentContext: XComponentContext | undefined = undefined; - - build() { - NavDestination() { - Column() { - Row() { - Text('Native XComponent Sample') - .fontSize('24fp') - .fontWeight(500) - .margin({ - left: 24, - top: 12 - }) - } - .margin({ top: 24 }) - .width('100%') - .height(56) - - Column({ space: 10 }) { - XComponent({ - id: 'xcomponentId', - type: XComponentType.SURFACE, - libraryname: 'nativerender' - }) - .onLoad((xComponentContext) => { - this.xComponentContext = xComponentContext as XComponentContext; - this.currentStatus = 'index'; - }) - .onDestroy(() => { - console.info('onDestroy'); - }) - .id('xcomponent') - - Text(this.currentStatus) - .fontSize('24fp') - .fontWeight(500) - } - .onClick(() => { - let hasChangeColor: boolean = false; - if (this.xComponentContext && this.xComponentContext.getStatusX()) { - hasChangeColor = this.xComponentContext.getStatusX().hasChangeColor; - } - if (hasChangeColor) { - this.currentStatus = 'change color'; - } - }) - .margin({ - top: 27, - left: 12, - right: 12 - }) - .height('40%') - .width('90%') - - Row() { - Button('Draw Star') - .fontSize('16fp') - .fontWeight(500) - .margin({ bottom: 24 }) - .onClick(() => { - if (this.xComponentContext) { - this.xComponentContext.drawPatternX(); - let hasDraw: boolean = false; - if (this.xComponentContext.getStatusX()) { - hasDraw = this.xComponentContext.getStatusX().hasDraw; - } - if (hasDraw) { - this.currentStatus = 'draw star'; - } - } - }) - .width('53.6%') - .height(40) - } - .width('100%') - .justifyContent(FlexAlign.Center) - .alignItems(VerticalAlign.Bottom) - .layoutWeight(1) - } - .width('100%') - .height('100%') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/module.json5 b/ArkUIKit/NativeXComponentSample/entry/src/main/module.json5 deleted file mode 100644 index e7b75dfc8e403d0f9720431d26529dacc62a8bf6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/module.json5 +++ /dev/null @@ -1,52 +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. - */ - -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default" - ], - "routerMap": "$profile:router_map", - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/element/color.json b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/element/string.json b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/background.png b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/icon.png b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/profile/router_map.json b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/profile/router_map.json deleted file mode 100644 index 1e3f946cb68ae4bf634ffcfd4be70ef1ba08d270..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/base/profile/router_map.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "routerMap": [ - { - "name": "pageOne", - "pageSourceFile": "src/main/ets/pages/PageOne.ets", - "buildFunction": "PageOneBuilder" - }, - { - "name": "pageTwo", - "pageSourceFile": "src/main/ets/pages/PageTwo.ets", - "buildFunction": "PageTwoBuilder" - }, - { - "name": "pageThree", - "pageSourceFile": "src/main/ets/pages/PageThree.ets", - "buildFunction": "PageThreeBuilder" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NativeXComponentSample/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 585a000d65aaf0cc128e3e9edde5d7bbd9cb7d88..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 '@ohos.hilog'; -import TestRunner from '@ohos.application.testRunner'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -let abilityDelegator = undefined; -let abilityDelegatorArguments = undefined; - -async function onAbilityCreateCallback() { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); - let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; - let debug = abilityDelegatorArguments.parameters['-D']; - if (debug == 'true') { - cmd += ' -D'; - } - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }); - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index bb7cf6661905cf657c737fd814ad2e1500818ed7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 abilityTest1 from './XComponentAbility1.test' -import abilityTest2 from './XComponentAbility2.test' -import abilityTest3 from './XComponentAbility3.test' - -export default function testsuite() { - abilityTest1() - abilityTest2() - abilityTest3() -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/XComponentAbility1.test.ets b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/XComponentAbility1.test.ets deleted file mode 100644 index fa02c4de75de1fce361aa34072f83f2d8c50a59a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/XComponentAbility1.test.ets +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2025 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { describe, it, expect } from '@ohos/hypium'; -import { Driver, MatchPattern, ON, MouseButton } from '@ohos.UiTest'; - -const TAG = '[Sample_Native_XComponent]'; - -export default function abilityTest1() { - - describe('ActsAbilityTest1', () => { - /** - * 打开应用 - */ - it('StartAbility_001', 0, async (done: Function) => { - console.info(TAG, 'StartAbility_001 begin'); - let driver = Driver.create(); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - try { - await abilityDelegator.startAbility({ - bundleName: 'com.example.nativexcomponent', - abilityName: 'EntryAbility' - }); - } catch (exception) { - console.info(TAG, `StartAbility_001 exception = ${JSON.stringify(exception)}`); - expect().assertFail(); - } - await driver.delayMs(1000); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('NDK接口')); - let drawStarBtn = await driver.findComponent(ON.text('NDK接口')); - await drawStarBtn.click(); - await driver.assertComponentExist(ON.text('点击此处进入')); - drawStarBtn = await driver.findComponent(ON.text('点击此处进入')); - await drawStarBtn.click(); - done(); - console.info(TAG, 'StartAbility_001 end'); - }) - - /** - * 点击按钮,绘制图形,之后点击XComponent改变颜色 - */ - it('DrawShape_001', 2, async () => { - console.info(TAG, 'CreateFiles_001 begin'); - let driver = Driver.create(); - // 判断是否有按键 - await driver.assertComponentExist(ON.text('Draw Star')); - let drawStarBtn = await driver.findComponent(ON.text('Draw Star')); - // 点击'Draw Star'按钮 - await drawStarBtn.click(); - await driver.delayMs(1000); - // 判断drawPattern方法已执行 - await driver.assertComponentExist(ON.text('draw star')); - - // 判断是否有XComponent组件 - let xcomponent = await driver.findComponent(ON.id('ndkxcomponent')); - // 点击XComponent组件 - await xcomponent.click(); - await driver.delayMs(1000); - // 判断touch回调已执行 - await driver.assertComponentExist(ON.text('change color')); - console.info(TAG, 'DrawShape_001 end'); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/XComponentAbility2.test.ets b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/XComponentAbility2.test.ets deleted file mode 100644 index 10e6a2a8b75659caa21d530830a8a0a2aff70cd5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/XComponentAbility2.test.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { describe, it, expect } from '@ohos/hypium'; -import { Driver, MatchPattern, ON, MouseButton } from '@ohos.UiTest'; - -const TAG = '[Sample_Native_XComponent]'; - -export default function abilityTest2() { - - describe('ActsAbilityTest2', () => { - /** - * 打开应用 - */ - it('StartAbility_001', 0, async (done: Function) => { - console.info(TAG, 'StartAbility_001 begin'); - let driver = Driver.create(); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - try { - await abilityDelegator.startAbility({ - bundleName: 'com.example.nativexcomponent', - abilityName: 'EntryAbility' - }); - } catch (exception) { - console.info(TAG, `StartAbility_001 exception = ${JSON.stringify(exception)}`); - expect().assertFail(); - } - await driver.delayMs(1000); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('ArkTS声明式')); - let drawStarBtn = await driver.findComponent(ON.text('ArkTS声明式')); - await drawStarBtn.click(); - await driver.assertComponentExist(ON.text('点击此处进入')); - drawStarBtn = await driver.findComponent(ON.text('点击此处进入')); - await drawStarBtn.click(); - done(); - console.info(TAG, 'StartAbility_001 end'); - }) - - /** - * 点击按钮,绘制图形,之后点击XComponent改变颜色 - */ - it('DrawShape_001', 2, async () => { - console.info(TAG, 'CreateFiles_001 begin'); - let driver = Driver.create(); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('index')); - // 判断是否有按键 - await driver.assertComponentExist(ON.text('Draw Star')); - let drawStarBtn = await driver.findComponent(ON.text('Draw Star')); - // 点击'Draw Star'按钮 - await drawStarBtn.click(); - await driver.delayMs(1000); - // 判断drawPattern方法已执行 - await driver.assertComponentExist(ON.text('draw star')); - - // 判断是否有XComponent组件 - let xcomponent = await driver.findComponent(ON.id('xcomponent')); - // 点击XComponent组件 - await xcomponent.click(); - await driver.delayMs(1000); - // 判断touch回调已执行 - await driver.assertComponentExist(ON.text('change color')); - console.info(TAG, 'DrawShape_001 end'); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/XComponentAbility3.test.ets b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/XComponentAbility3.test.ets deleted file mode 100644 index b9e69e186ff3f57c8b8031476c4d4cf701953901..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/test/XComponentAbility3.test.ets +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2025 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { describe, it, expect } from '@ohos/hypium'; -import { Driver, MatchPattern, ON, MouseButton } from '@ohos.UiTest'; - -const TAG = '[Sample_Native_XComponent]'; - -export default function abilityTest3() { - - describe('ActsAbilityTest3', () => { - /** - * 打开应用 - */ - it('StartAbility_001', 0, async (done: Function) => { - console.info(TAG, 'StartAbility_001 begin'); - let driver = Driver.create(); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - try { - await abilityDelegator.startAbility({ - bundleName: 'com.example.nativexcomponent', - abilityName: 'EntryAbility' - }); - } catch (exception) { - console.info(TAG, `StartAbility_001 exception = ${JSON.stringify(exception)}`); - expect().assertFail(); - } - await driver.delayMs(1000); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('自定义节点')); - let drawStarBtn = await driver.findComponent(ON.text('自定义节点')); - await drawStarBtn.click(); - await driver.assertComponentExist(ON.text('点击此处进入')); - drawStarBtn = await driver.findComponent(ON.text('点击此处进入')); - await drawStarBtn.click(); - done(); - console.info(TAG, 'StartAbility_001 end'); - }) - - /** - * 点击按钮,XComponent组件销毁,再次点击按钮,XComponent组件创建 - */ - it('DrawShape_001', 2, async (done: Function) => { - console.info(TAG, 'CreateFiles_001 begin'); - let driver = Driver.create(); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard=',MatchPattern.STARTS_WITH)); - await driver.assertComponentExist(ON.text('Initialize')); - await driver.assertComponentExist(ON.text('Finalize')); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.id('xcp',MatchPattern.STARTS_WITH)); - // 判断是否有按键 - await driver.assertComponentExist(ON.text('创建/销毁')); - let drawStarBtn = await driver.findComponent(ON.text('创建/销毁')); - // 点击'创建/销毁'按钮 - await drawStarBtn.click(); - await driver.delayMs(1000); - - // 判断xcomponent组件已经消失 - let xcomponent = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent === null).assertTrue(); - - await drawStarBtn.click(); - await driver.delayMs(1000); - // 判断xcomponent组件复现 - let xcomponent2 = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent2 === null).assertFalse(); - done(); - console.info(TAG, 'DrawShape_001 end'); - }) - - /** - * 点击XComponent组件区域,绘制内容颜色改变 - */ - it('DrawShape_002', 2, async (done: Function) => { - console.info(TAG, 'DrawShape_002 begin'); - let driver = Driver.create(); - // 判断XComponent onLoad回调执行成功 - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.id('xcp',MatchPattern.STARTS_WITH)); - // 判断是否有按键 - await driver.assertComponentExist(ON.text('创建/销毁')); - - // 点击XComponent组件 - let xcomponent = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent === null).assertFalse(); - await xcomponent.click(); - await driver.delayMs(1000); - // 判断touch回调已执行 - await driver.assertComponentExist(ON.id('xcp',MatchPattern.STARTS_WITH)); - done(); - console.info(TAG, 'DrawShape_002 end'); - }) - - /** - * 点击min对应滑动条,设置最小帧率为120 - */ - it('SetExpectedFrameRate_001 ', 2, async (done: Function) => { - console.info(TAG, 'SetExpectedFrameRate_001 start'); - let driver = await Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let minBtn = await driver.findComponent(ON.text('min', MatchPattern.STARTS_WITH)); - expect(minBtn === null).assertFalse(); - - let minSlider = await driver.findComponent(ON.id('minSlider')); - expect(minSlider === null).assertFalse(); - let point = await minSlider.getBoundsCenter(); - await driver.mouseClick(point, MouseButton.MOUSE_BUTTON_LEFT); - await driver.delayMs(1000); - - let text = await minBtn.getText(); - expect(text.toString() == 'min: 120').assertTrue(); - - done(); - console.info(TAG, 'SetExpectedFrameRate_001 end'); - }) - - /** - * 点击max对应滑动条,设置最大帧率为240 - */ - it('SetExpectedFrameRate_002 ', 2, async (done: Function) => { - console.info(TAG, 'SetExpectedFrameRate_002 start'); - let driver = await Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let maxBtn = await driver.findComponent(ON.text('max', MatchPattern.STARTS_WITH)); - expect(maxBtn === null).assertFalse(); - - let maxSlider = await driver.findComponent(ON.id('maxSlider')); - expect(maxSlider === null).assertFalse(); - let rect = await maxSlider.getBounds(); - await driver.mouseClick({x:rect.right, y:(rect.top+rect.bottom)/2}, MouseButton.MOUSE_BUTTON_LEFT); - await driver.delayMs(1000); - - let text = await maxBtn.getText(); - expect(text.toString() == 'max: 240').assertTrue(); - - done(); - console.info(TAG, 'SetExpectedFrameRate_002 end'); - }) - - /** - * 点击expected对应滑动条,设置期望帧率为120 - */ - it('SetExpectedFrameRate_003 ', 2, async (done: Function) => { - console.info(TAG, 'SetExpectedFrameRate_003 start'); - let driver = await Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let expectedBtn = await driver.findComponent(ON.text('expected', MatchPattern.STARTS_WITH)); - expect(expectedBtn === null).assertFalse(); - - let expectedSlider = await driver.findComponent(ON.id('expectedSlider')); - expect(expectedSlider === null).assertFalse(); - let point = await expectedSlider.getBoundsCenter(); - await driver.mouseClick(point, MouseButton.MOUSE_BUTTON_LEFT); - await driver.delayMs(1000); - - let text = await expectedBtn.getText(); - expect(text.toString() == 'expected: 120').assertTrue(); - - done(); - console.info(TAG, 'SetExpectedFrameRate_003 end'); - }) - - it('SetSoftKeyboard_001', 2, async (done: Function) => { - console.info(TAG, 'SetSoftKeyboard_001 start'); - let driver = Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let text = await driver.findComponent(ON.id('textInput')); - expect(text === null).assertFalse(); - await text.click(); - await driver.delayMs(1000); - expect(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH) == null).assertFalse(); - - // 点击XComponent组件 - let xcomponent = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent === null).assertFalse(); - await xcomponent.click(); - await driver.delayMs(1000); - - done(); - console.info(TAG, 'SetSoftKeyboard_001 end'); - }) - - it('SetSoftKeyboard_002', 2, async (done: Function) => { - console.info(TAG, 'SetSoftKeyboard_002 start'); - let driver = Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('期望帧率设置:')); - await driver.assertComponentExist(ON.text('单指点击XComponent软键盘消失')); - await driver.assertComponentExist(ON.text('创建/销毁')); - await driver.assertComponentExist(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - - let button_softKeyboard = await driver.findComponent(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH)); - expect(button_softKeyboard === null).assertFalse(); - await button_softKeyboard.click(); - let text = await driver.findComponent(ON.id('textInput')); - expect(text === null).assertFalse(); - await text.click(); - await driver.delayMs(1000); - expect(ON.text('needSoftKeyboard', MatchPattern.STARTS_WITH) == null).assertFalse(); - - // 点击XComponent组件 - let xcomponent = await driver.findComponent(ON.id('xcp', MatchPattern.STARTS_WITH)); - expect(xcomponent === null).assertFalse(); - await xcomponent.click(); - await driver.delayMs(1000); - - done(); - console.info(TAG, 'SetSoftKeyboard_002 end'); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/testability/TestAbility.ets b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index 41857cadc2b07849a89d6cda4fdccd0c6ee23589..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 UIAbility from '@ohos.app.ability.UIAbility'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import hilog from '@ohos.hilog'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; -import window from '@ohos.window'; -import Want from '@ohos.app.ability.Want'; -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; - -export default class TestAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs = AbilityDelegatorRegistry.getArguments(); - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - 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. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/testability/pages/Index.ets b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index 5991a3ef4b41ec78e4977a7d65d84a589ee1eb20..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 '@ohos.hilog'; - -@Entry -@Component -struct Index { - aboutToAppear() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); - } - - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - } - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(() => { - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/module.json5 b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index a7685a59ea27672ae8074c984c4699bd73f36a5b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/element/color.json b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/element/string.json b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/media/icon.png b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/profile/test_pages.json b/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/ArkUIKit/NativeXComponentSample/hvigor/hvigor-config.json5 b/ArkUIKit/NativeXComponentSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 06b2783670a348f95533b352c1ceda909a842bbc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/ArkUIKit/NativeXComponentSample/hvigorfile.ts b/ArkUIKit/NativeXComponentSample/hvigorfile.ts deleted file mode 100644 index f3cb9f1a87a81687554a76283af8df27d8bda775..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/ArkUIKit/NativeXComponentSample/oh-package.json5 b/ArkUIKit/NativeXComponentSample/oh-package.json5 deleted file mode 100644 index ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "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/ArkUIKit/NativeXComponentSample/ohosTest.md b/ArkUIKit/NativeXComponentSample/ohosTest.md deleted file mode 100644 index 3a6bb7f5009c10c47bfe3b3167fd88f2d8bd0976..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeXComponentSample/ohosTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# NdkXComponent 测试用例归档 - -## 用例表 - -|测试功能|预置条件|输入|预期输出|是否自动|测试结果| -|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------| -| 拉起应用 | 设备正常运行 | |成功拉起应用|是| Pass | -| 组件创建和销毁 | 位于首页 | 1、点击"创建/销毁"按钮。2、再次点击"创建/销毁"按钮。 | 1、组件消失。2、组件显示 | 是 | Pass | -| 响应触摸事件 | 位于首页 | 1、点击XComponent区域(灰色背景部分) | 1、页面中的五角星改变颜色 | 是 | Pass | -| 设置最小帧率 | 位于首页 | 1、点击min对应滑动条,设置最小帧率为120 | 1、滑动条滑块位于中间位置 | 是 | Pass | -| 设置最大帧率 | 位于首页 | 1、点击max对应滑动条,设置最大帧率为240 | 1、滑动条滑块位于最右侧 | 是 | Pass | -| 设置期望帧率 | 位于首页 | 1、点击expected对应滑动条,设置期望帧率为120 | 1、滑动条滑块位于中间位置 | 是 | Pass | -| 单指点击XComponent软键盘消失 | 位于首页 | 1、点击“单指点击XComponent软键盘消失”对应文本输入框。 2、再次点击XComponent区域(灰色背景部分) | 1、软件盘正常拉起2、软件盘消失 | 是 | Pass | -| 单指点击XComponent软键盘不消失 | 位于首页 | 1、点击needSoftKeyboard=false按钮。2、点击“单指点击XComponent软键盘消失”对应文本输入框。3、再次点击XComponent区域(灰色背景部分) | 2、软件盘正常拉起3、软件盘不消失 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/screenshots/device/XchangeColor.png b/ArkUIKit/NativeXComponentSample/screenshots/device/XchangeColor.png deleted file mode 100644 index 07586fceb2d038482dd984b921a7c80871824bb8..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/screenshots/device/XchangeColor.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/screenshots/device/XdrawStar.png b/ArkUIKit/NativeXComponentSample/screenshots/device/XdrawStar.png deleted file mode 100644 index e8be339ee8a16dae2c1ce350747f8e1f09782692..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/screenshots/device/XdrawStar.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/screenshots/device/Xmain.png b/ArkUIKit/NativeXComponentSample/screenshots/device/Xmain.png deleted file mode 100644 index a51df8c9cf759098882721219d5c9f4b5acfb0c8..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/screenshots/device/Xmain.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/screenshots/device/changeColor.jpeg b/ArkUIKit/NativeXComponentSample/screenshots/device/changeColor.jpeg deleted file mode 100644 index 7913266ad1e38dcca5e9ba9a1eb102ed21ed628c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/screenshots/device/changeColor.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/screenshots/device/changeColorNDK.png b/ArkUIKit/NativeXComponentSample/screenshots/device/changeColorNDK.png deleted file mode 100644 index 07586fceb2d038482dd984b921a7c80871824bb8..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/screenshots/device/changeColorNDK.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/screenshots/device/drawStar.jpeg b/ArkUIKit/NativeXComponentSample/screenshots/device/drawStar.jpeg deleted file mode 100644 index e2ed15e03817e896ce6275fa2b9b991e64939401..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/screenshots/device/drawStar.jpeg and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/screenshots/device/drawStarNDK.png b/ArkUIKit/NativeXComponentSample/screenshots/device/drawStarNDK.png deleted file mode 100644 index e8be339ee8a16dae2c1ce350747f8e1f09782692..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/screenshots/device/drawStarNDK.png and /dev/null differ diff --git a/ArkUIKit/NativeXComponentSample/screenshots/device/mainNDK.png b/ArkUIKit/NativeXComponentSample/screenshots/device/mainNDK.png deleted file mode 100644 index a51df8c9cf759098882721219d5c9f4b5acfb0c8..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeXComponentSample/screenshots/device/mainNDK.png and /dev/null differ diff --git a/ArkUIKit/NdkFocus/.gitignore b/ArkUIKit/NdkFocus/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NdkFocus/AppScope/app.json5 b/ArkUIKit/NdkFocus/AppScope/app.json5 deleted file mode 100644 index 5f2cd25cf295014c3ab25d67e3c0b792ad7ec872..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.sample.ndkfocus", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NdkFocus/AppScope/resources/base/element/string.json b/ArkUIKit/NdkFocus/AppScope/resources/base/element/string.json deleted file mode 100644 index d71e5ead1ce20b4ac3384d18e6d104f1ea4d83b4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - } - ] -} diff --git a/ArkUIKit/NdkFocus/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NdkFocus/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkFocus/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NdkFocus/README_zh.md b/ArkUIKit/NdkFocus/README_zh.md deleted file mode 100644 index d93c319abc34d55d91889e8c6696a0010cef37e2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/README_zh.md +++ /dev/null @@ -1,70 +0,0 @@ -# ArkUI指南文档示例 - -### 介绍 - -本示例通过使用[ArkUI指南文档](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/reference)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [焦点开发指导](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-interface-focus-h.md)。 -### 效果预览 - -| 首页 | -|------------------------------------| -| ![](screenshots/device/image1.jpg) | - -### 使用说明 - -1. 在首页可以查看通过焦点CAPI接口实现焦点管理示例。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -entry/src/main/ets/ -|---cpp -| |---types -| |---CMakeLists.txt -| |---container.cpp -| |---container.h -| |---init.cpp -| |---manager.cpp -| |---manager.h -| |---focus_manager.cpp // 通过焦点CAPI接口实现焦点管理示例代码 -| |---focus_manager.h // focus_manager头文件 -| |---napi_init.cpp -|---ets -| |---pages -| | |---Index.ets // 应用主页面 -entry/src/ohosTest/ -|---ets -| |---Focus.test.ets // 示例代码测试代码 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例支持仅标准系统上运行,支持设备:华为手机、华为平板。 - -2.HarmonyOS系统:HarmonyOS 6.0.0 Beta3版本及以上。 - -3.DevEco Studio版本:DevEco Studio 6.0.0 Beta3版本及以上。 - -4.HarmonyOS SDK版本:HarmonyOS 6.0.0 Beta3 SDK版本及以上。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/NdkFocus > .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/ArkUIKit/NdkFocus/build-profile.json5 b/ArkUIKit/NdkFocus/build-profile.json5 deleted file mode 100644 index 1a4efe780afd7fdb22c76ae2f927496b12c2cf07..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/code-linter.json5 b/ArkUIKit/NdkFocus/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/.gitignore b/ArkUIKit/NdkFocus/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/build-profile.json5 b/ArkUIKit/NdkFocus/entry/build-profile.json5 deleted file mode 100644 index a3fb55f64807002769e3e58e9ecf01a1a2198aa3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a", - "x86_64" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/hvigorfile.ts b/ArkUIKit/NdkFocus/entry/hvigorfile.ts deleted file mode 100644 index a3d28cb60475cede46d0aa36973096d5544dbcd1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkFocus/entry/obfuscation-rules.txt b/ArkUIKit/NdkFocus/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NdkFocus/entry/oh-package.json5 b/ArkUIKit/NdkFocus/entry/oh-package.json5 deleted file mode 100644 index 5d993e5251fd56950970aa593aefef1b8d71e976..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NdkFocus/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 63d865985e15ea9200e8d32cb594ed7c1ad0bc5e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(MyApplication) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(nativeNode SHARED init.cpp manager.cpp container.cpp focus_manager.cpp) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libnative_drawing.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so libpixelmap.so) \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/container.cpp b/ArkUIKit/NdkFocus/entry/src/main/cpp/container.cpp deleted file mode 100644 index f7f4b15dc54c259a62b0ec1ce7411ff21c4e7bbc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/container.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "container.h" - -#include -#include -#include -#include -#include - - -namespace NativeXComponentSample { -namespace { -void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } -} - -void OnSurfaceChangedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "surface changed"); - } -} - -void OnSurfaceDestroyedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container::Release(id); -} - -void DispatchTouchEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container* render = Container::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } -} - -void DispatchMouseEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchMouseEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = Container::GetInstance(id); - if (render != nullptr) { - render->OnMouseEvent(component, window); - } -} - -void DispatchHoverEventCB(OH_NativeXComponent* component, bool isHover) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchHoverEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnHoverEvent(component, isHover); - } -} -} // namespace - -std::unordered_map Container::instance_; - -Container::Container(const std::string& id) -{ - this->id_ = id; -} - -Container* Container::GetInstance(const std::string& id) -{ - if (instance_.find(id) == instance_.end()) { - Container* instance = new Container(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } -} - -void Container::Release(const std::string& id) -{ - if (instance_.find(id) != instance_.end()) { - instance_[id] = nullptr; - } -} - -void Container::OnSurfaceChanged(OH_NativeXComponent* component, void* window) -{ - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChanged: Unable to get XComponent id"); - return; - } - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OH_NativeXComponent_GetXComponentOffset", - "offsetX = %{public}lf, offsetY = %{public}lf", offsetX, offsetY); - uint64_t width; - uint64_t height; - OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); -} - -void Container::OnTouchEvent(OH_NativeXComponent* component, void* window) -{ - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - std::string id(idStr); - Container* container = Container::GetInstance(id); - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, tiltY); -} - -void Container::RegisterCallback(OH_NativeXComponent* nativeXComponent) -{ - containerCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - containerCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - containerCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - containerCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &containerCallback_); - - mouseCallback_.DispatchMouseEvent = DispatchMouseEventCB; - mouseCallback_.DispatchHoverEvent = DispatchHoverEventCB; - OH_NativeXComponent_RegisterMouseEventCallback(nativeXComponent, &mouseCallback_); - OH_NativeXComponent_RegisterOnTouchInterceptCallback( - nativeXComponent, [](OH_NativeXComponent*, ArkUI_UIInputEvent*) -> HitTestMode { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "callback", - "OH_NativeXComponent_RegisterOnTouchInterceptCallback"); - return HitTestMode::HTM_TRANSPARENT; - }); -} - -void Container::OnMouseEvent(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnMouseEvent"); - OH_NativeXComponent_MouseEvent mouseEvent; - int32_t ret = OH_NativeXComponent_GetMouseEvent(component, window, &mouseEvent); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", - "MouseEvent Info: x = %{public}f, y = %{public}f, action = %{public}d, button = %{public}d", mouseEvent.x, - mouseEvent.y, mouseEvent.action, mouseEvent.button); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Container", "GetMouseEvent error"); - } -} - -void Container::OnHoverEvent(OH_NativeXComponent* component, bool isHover) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnHoverEvent isHover_ = %{public}d", isHover); -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/container.h b/ArkUIKit/NdkFocus/entry/src/main/cpp/container.h deleted file mode 100644 index 8290fa3d85fe4c58fe153e981337456dfdf03c54..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/container.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MY_APPLICATION_CONTAINER_H -#define MY_APPLICATION_CONTAINER_H - -#include -#include -#include -#include - - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -namespace NativeXComponentSample { - -class Container { -public: - explicit Container(const std::string& id); - ~Container() = default; - static Container* GetInstance(const std::string& id); - static void Release(const std::string& id); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent* component, void* window); - void OnTouchEvent(OH_NativeXComponent* component, void* window); - void OnMouseEvent(OH_NativeXComponent* component, void* window); - void OnHoverEvent(OH_NativeXComponent* component, bool isHover); - void OnKeyEvent(OH_NativeXComponent* component, void* window); - void RegisterCallback(OH_NativeXComponent* nativeXComponent); - -public: - static std::unordered_map instance_; - std::string id_; - -private: - OH_NativeXComponent_Callback containerCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; -}; - -} // namespace NativeXComponentSample -#endif // MY_APPLICATION_CONTAINER_H diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/focus_manager.cpp b/ArkUIKit/NdkFocus/entry/src/main/cpp/focus_manager.cpp deleted file mode 100644 index 3a399e6681327394bcea47665a95d1edc6ac00f6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/focus_manager.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "focus_manager.h" - -#include -#include -#include - -#include "container.h" -#include "arkui/native_interface_focus.h" - - -namespace NativeXComponentSample { - -static ArkUI_NativeNodeAPI_1* g_nodeAPI = nullptr; - -int FocusManager::RequestFocus(const char* nodeId) -{ - if (!nodeId) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "RequestFocus: nodeId is null"); - return -1; - } - - ArkUI_NodeHandle nodeHandle; - OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(nodeId, &nodeHandle); - if (!nodeHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "RequestFocus: nodeHandle is null for id %{public}s", nodeId); - return -1; - } - - // 获取NodeAPI实例 - if (!g_nodeAPI) { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, g_nodeAPI); - } - - if (!g_nodeAPI) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "RequestFocus: g_nodeAPI is null"); - return -1; - } - - // 使用原生接口OH_ArkUI_FocusRequest请求焦点 - ArkUI_ErrorCode result = OH_ArkUI_FocusRequest(nodeHandle); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "RequestFocus: OH_ArkUI_FocusRequest result=%{public}d for node %{public}s", result, nodeId); - - if (result == ARKUI_ERROR_CODE_NO_ERROR) { - currentFocusNodeId_ = std::string(nodeId); - RegisterNodeHandle(std::string(nodeId), nodeHandle); - return 0; - } else { - const char* errorMsg = "未知错误"; - switch (result) { - case ARKUI_ERROR_CODE_FOCUS_NON_FOCUSABLE: - errorMsg = "节点不可聚焦"; - break; - case ARKUI_ERROR_CODE_FOCUS_NON_FOCUSABLE_ANCESTOR: - errorMsg = "节点祖先不可聚焦"; - break; - case ARKUI_ERROR_CODE_FOCUS_NON_EXISTENT: - errorMsg = "节点不存在"; - break; - default: - errorMsg = "其他错误"; - break; - } - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "RequestFocus failed: %{public}s (code=%{public}d)", errorMsg, result); - return result; - } -} - -int FocusManager::RequestFocusAsync(const char* nodeId) -{ - if (!nodeId) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "RequestFocus: nodeId is null"); - return -1; - } - - ArkUI_NodeHandle nodeHandle; - OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(nodeId, &nodeHandle); - if (!nodeHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "RequestFocus: nodeHandle is null for id %{public}s", nodeId); - return -1; - } - - // 获取NodeAPI实例 - if (!g_nodeAPI) { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, g_nodeAPI); - } - - if (!g_nodeAPI) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "RequestFocus: g_nodeAPI is null"); - return -1; - } - - // 先设置节点为可聚焦 - ArkUI_NumberValue focusableValue[] = { { .i32 = 1 } }; - ArkUI_AttributeItem focusableItem = { focusableValue, 1 }; - g_nodeAPI->setAttribute(nodeHandle, NODE_FOCUSABLE, &focusableItem); - - // 使用原生接口OH_ArkUI_FocusRequest请求焦点 - ArkUI_NumberValue requetValue[] = { { .i32 = 1 } }; - ArkUI_AttributeItem requetItem = { requetValue, 1 }; - int result = g_nodeAPI->setAttribute(nodeHandle, NODE_FOCUS_STATUS, &requetItem); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "RequestFocus: NODE_FOCUS_STATUS result=%{public}d for node %{public}s", result, nodeId); - return result; -} - -void FocusManager::ClearFocus(void* uiContext) -{ - // 使用原生接口OH_ArkUI_FocusClear清除焦点到root scope - if (uiContext) { - OH_ArkUI_FocusClear(static_cast(uiContext)); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", "ClearFocus: OH_ArkUI_FocusClear called"); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "ClearFocus: uiContext is null"); - } - - currentFocusNodeId_.clear(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", "ClearFocus: success"); -} - -void FocusManager::ActivateFocus(ArkUI_ContextHandle uiContext, bool isActive, bool isAutoInactive) -{ - OH_ArkUI_FocusActivate(uiContext, isActive, !isActive); - isActive_ = isActive; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "ActivateFocus: isActive=%{public}d, isAutoInactive=%{public}d", isActive, !isActive); -} - -void FocusManager::SetAutoTransfer(void* uiContext, bool autoTransfer) -{ - // 使用原生接口OH_ArkUI_FocusSetAutoTransfer设置焦点自动转移 - if (uiContext) { - OH_ArkUI_FocusSetAutoTransfer(static_cast(uiContext), autoTransfer); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "SetAutoTransfer: OH_ArkUI_FocusSetAutoTransfer called with autoTransfer=%{public}d", autoTransfer); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetAutoTransfer: uiContext is null"); - } - - autoTransfer_ = autoTransfer; - OH_LOG_Print( - LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", "SetAutoTransfer: autoTransfer=%{public}d", autoTransfer); -} - -void FocusManager::SetKeyProcessingMode(void* uiContext, FocusKeyProcessingMode mode) -{ - // 将FocusKeyProcessingMode映射到ArkUI_KeyProcessingMode - ArkUI_KeyProcessingMode arkuiMode; - switch (mode) { - case FOCUS_KEY_PROCESSING_MODE_NAVIGATION: - arkuiMode = ARKUI_KEY_PROCESSING_MODE_FOCUS_NAVIGATION; - break; - case FOCUS_KEY_PROCESSING_MODE_ANCESTOR_EVENT: - arkuiMode = ARKUI_KEY_PROCESSING_MODE_FOCUS_ANCESTOR_EVENT; - break; - default: - arkuiMode = ARKUI_KEY_PROCESSING_MODE_FOCUS_NAVIGATION; - break; - } - - // 使用原生接口OH_ArkUI_FocusSetKeyProcessingMode设置按键处理模式 - if (uiContext) { - OH_ArkUI_FocusSetKeyProcessingMode(static_cast(uiContext), arkuiMode); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "SetKeyProcessingMode: OH_ArkUI_FocusSetKeyProcessingMode called with mode=%{public}d", arkuiMode); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetKeyProcessingMode: uiContext is null"); - } - - keyProcessingMode_ = mode; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", "SetKeyProcessingMode: mode=%{public}d", mode); -} - -int FocusManager::SetNodeFocusable(const char* nodeId, bool focusable) -{ - if (!nodeId) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeFocusable: nodeId is null"); - return -1; - } - - ArkUI_NodeHandle nodeHandle; - OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(nodeId, &nodeHandle); - if (!nodeHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeFocusable: nodeHandle is null for id %{public}s", nodeId); - return -1; - } - - if (!g_nodeAPI) { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, g_nodeAPI); - } - - if (!g_nodeAPI) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeFocusable: g_nodeAPI is null"); - return -1; - } - - // 设置节点可聚焦属性 - ArkUI_NumberValue focusableValue[] = { { .i32 = focusable ? 1 : 0 } }; - ArkUI_AttributeItem focusableItem = { focusableValue, 1 }; - g_nodeAPI->setAttribute(nodeHandle, NODE_FOCUSABLE, &focusableItem); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeFocusable: success for node %{public}s, focusable=%{public}d", nodeId, focusable); - return 0; -} - -std::string FocusManager::GetCurrentFocusNodeId() const -{ - return currentFocusNodeId_; -} - -void FocusManager::RegisterNodeHandle(const std::string& nodeId, ArkUI_NodeHandle nodeHandle) -{ - nodeHandleMap_[nodeId] = nodeHandle; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", "RegisterNodeHandle: registered node %{public}s", - nodeId.c_str()); -} - -int FocusManager::SetFocusOnTouch(const char* nodeId, bool focusOnTouch) -{ - if (!nodeId) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "RequestFocus: nodeId is null"); - return -1; - } - - ArkUI_NodeHandle nodeHandle; - OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(nodeId, &nodeHandle); - if (!nodeHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "RequestFocus: nodeHandle is null for id %{public}s", nodeId); - return -1; - } - - // 获取NodeAPI实例 - if (!g_nodeAPI) { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, g_nodeAPI); - } - - // 设置FocusOnTouch - ArkUI_NumberValue focusValue[] = { { .i32 = focusOnTouch ? 1 : 0 } }; - ArkUI_AttributeItem focusItem = { focusValue, 1 }; - int result = g_nodeAPI->setAttribute(nodeHandle, NODE_FOCUS_ON_TOUCH, &focusItem); - return result; -} - -int FocusManager::SetNodeDefaultFocus(const char* nodeId, bool isDefault) -{ - if (!nodeId) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeDefaultFocus: nodeId is null"); - return -1; - } - - ArkUI_NodeHandle nodeHandle; - OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(nodeId, &nodeHandle); - if (!nodeHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeDefaultFocus: nodeHandle is null for id %{public}s", nodeId); - return -1; - } - - if (!g_nodeAPI) { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, g_nodeAPI); - } - - if (!g_nodeAPI) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeDefaultFocus: g_nodeAPI is null"); - return -1; - } - - // 设置默认焦点 - ArkUI_NumberValue defaultValue[] = { { .i32 = isDefault ? 1 : 0 } }; - ArkUI_AttributeItem defaultItem = { defaultValue, 1 }; - int result = g_nodeAPI->setAttribute(nodeHandle, NODE_DEFAULT_FOCUS, &defaultItem); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeDefaultFocus: result=%{public}d for node %{public}s, isDefault=%{public}d", result, nodeId, isDefault); - return result; -} - -int FocusManager::SetNodeFocusBox(const char* nodeId, float distance, float width, uint32_t color) -{ - if (!nodeId) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeFocusBox: nodeId is null"); - return -1; - } - - ArkUI_NodeHandle nodeHandle; - OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(nodeId, &nodeHandle); - if (!nodeHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeFocusBox: nodeHandle is null for id %{public}s", nodeId); - return -1; - } - - if (!g_nodeAPI) { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, g_nodeAPI); - } - - if (!g_nodeAPI) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeFocusBox: g_nodeAPI is null"); - return -1; - } - - // 设置焦点框样式 - 根据CAPI定义:distance, width, color - ArkUI_NumberValue focusBoxValues[] = { - { .f32 = distance }, // 焦点框距离组件边缘的距离 - { .f32 = width }, // 焦点框宽度 - { .u32 = color } // 焦点框颜色 - }; - ArkUI_AttributeItem focusBoxItem = { focusBoxValues, 3 }; - int result = g_nodeAPI->setAttribute(nodeHandle, NODE_FOCUS_BOX, &focusBoxItem); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeFocusBox: result=%{public}d for node %{public}s, distance=%{public}f, width=%{public}f, " - "color=%{public}u", - result, nodeId, distance, width, color); - return result; -} - -int FocusManager::SetNodeNextFocus(const char* nodeId, const char* nextNodeId, int direction) -{ - if (!nodeId || !nextNodeId) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeNextFocus: nodeId or nextNodeId is null"); - return -1; - } - - ArkUI_NodeHandle nodeHandle; - OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(nodeId, &nodeHandle); - if (!nodeHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeNextFocus: nodeHandle is null for id %{public}s", nodeId); - return -1; - } - - ArkUI_NodeHandle nextNodeHandle; - OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(nextNodeId, &nextNodeHandle); - if (!nextNodeHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeNextFocus: nextNodeHandle is null for id %{public}s", nextNodeId); - return -1; - } - - if (!g_nodeAPI) { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, g_nodeAPI); - } - - if (!g_nodeAPI) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeNextFocus: g_nodeAPI is null"); - return -1; - } - - // 设置下一个焦点 - 根据CAPI定义:direction和next node handle - ArkUI_NumberValue directionValue[] = { { .i32 = direction } }; - ArkUI_AttributeItem nextFocusItem = { .value = directionValue, .size = 1, .object = nextNodeHandle }; - - int result = g_nodeAPI->setAttribute(nodeHandle, NODE_NEXT_FOCUS, &nextFocusItem); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeNextFocus: result=%{public}d for node %{public}s -> %{public}s, direction=%{public}d", result, nodeId, - nextNodeId, direction); - return result; -} - -int FocusManager::SetNodeTabStop(const char* nodeId, bool tabStop) -{ - if (!nodeId) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeTabStop: nodeId is null"); - return -1; - } - - ArkUI_NodeHandle nodeHandle; - OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(nodeId, &nodeHandle); - if (!nodeHandle) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeTabStop: nodeHandle is null for id %{public}s", nodeId); - return -1; - } - - if (!g_nodeAPI) { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, g_nodeAPI); - } - - if (!g_nodeAPI) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "FocusManager", "SetNodeTabStop: g_nodeAPI is null"); - return -1; - } - - // 设置Tab停止属性 - ArkUI_NumberValue tabStopValue[] = { { .i32 = tabStop ? 1 : 0 } }; - ArkUI_AttributeItem tabStopItem = { tabStopValue, 1 }; - int result = g_nodeAPI->setAttribute(nodeHandle, NODE_TAB_STOP, &tabStopItem); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "FocusManager", - "SetNodeTabStop: result=%{public}d for node %{public}s, tabStop=%{public}d", result, nodeId, tabStop); - return result; -} - -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/focus_manager.h b/ArkUIKit/NdkFocus/entry/src/main/cpp/focus_manager.h deleted file mode 100644 index 6c2aa30c1bfba18989caa19415d181a59e8047c8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/focus_manager.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef FOCUS_MANAGER_H -#define FOCUS_MANAGER_H - -#include -#include -#include -#include -#include - -namespace NativeXComponentSample { - -/** - * @brief 焦点处理模式枚举 - */ -typedef enum { - /** 按键事件用于焦点导航 */ - FOCUS_KEY_PROCESSING_MODE_NAVIGATION = 0, - /** 按键事件向上冒泡到祖先节点 */ - FOCUS_KEY_PROCESSING_MODE_ANCESTOR_EVENT, -} FocusKeyProcessingMode; - -/** - * @brief 焦点管理器类,负责处理焦点相关的操作 - */ -class FocusManager { -public: - static FocusManager* GetInstance() - { - static FocusManager instance; - return &instance; - } - - int RequestFocus(const char* nodeId); - int RequestFocusAsync(const char* nodeId); - void ClearFocus(void* uiContext); - void ActivateFocus(ArkUI_ContextHandle uiContext, bool isActive, bool isAutoInactive); - void SetAutoTransfer(void* uiContext, bool autoTransfer); - void SetKeyProcessingMode(void* uiContext, FocusKeyProcessingMode mode); - int SetNodeFocusable(const char* nodeId, bool focusable); - std::string GetCurrentFocusNodeId() const; - void RegisterNodeHandle(const std::string& nodeId, ArkUI_NodeHandle nodeHandle); - int SetFocusOnTouch(const char* nodeId, bool focusOnTouch); - int SetNodeDefaultFocus(const char* nodeId, bool isDefault); - int SetNodeFocusBox(const char* nodeId, float distance, float width, uint32_t color); - int SetNodeNextFocus(const char* nodeId, const char* nextNodeId, int direction); - int SetNodeTabStop(const char* nodeId, bool tabStop); - -private: - FocusManager() = default; - ~FocusManager() = default; - FocusManager(const FocusManager&) = delete; - FocusManager& operator=(const FocusManager&) = delete; - - std::string currentFocusNodeId_; - std::unordered_map nodeHandleMap_; - bool isActive_ = false; - bool autoTransfer_ = true; - FocusKeyProcessingMode keyProcessingMode_ = FOCUS_KEY_PROCESSING_MODE_NAVIGATION; -}; - -} // namespace NativeXComponentSample - -#endif // FOCUS_MANAGER_H diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/init.cpp b/ArkUIKit/NdkFocus/entry/src/main/cpp/init.cpp deleted file mode 100644 index e797c80aa46ad7ab064be729fa90eedbb0a9963c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/init.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include - -#include "manager.h" - - -namespace NativeXComponentSample { -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - { "getContext", nullptr, Manager::GetContext, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "createNativeNode", nullptr, Manager::CreateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "upDateNativeNode", nullptr, Manager::UpdateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "requestFocus", nullptr, Manager::RequestFocus, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "requestFocusAsync", nullptr, Manager::RequestFocusAsync, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "clearFocus", nullptr, Manager::ClearFocus, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "activateFocus", nullptr, Manager::ActivateFocus, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "setAutoTransfer", nullptr, Manager::SetAutoTransfer, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "setKeyProcessingMode", nullptr, Manager::SetKeyProcessingMode, nullptr, nullptr, nullptr, napi_default, - nullptr }, - { "setNodeFocusable", nullptr, Manager::SetNodeFocusable, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "setNodeFocusOnTouch", nullptr, Manager::SetNodeFocusOnTouch, nullptr, nullptr, nullptr, napi_default, - nullptr }, - { "getCurrentFocusNodeId", nullptr, Manager::GetCurrentFocusNodeId, nullptr, nullptr, nullptr, napi_default, - nullptr }, - { "setNodeDefaultFocus", nullptr, Manager::SetNodeDefaultFocus, nullptr, nullptr, nullptr, napi_default, - nullptr }, - { "setNodeFocusBox", nullptr, Manager::SetNodeFocusBox, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "setNodeNextFocus", nullptr, Manager::SetNodeNextFocus, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "setNodeTabStop", nullptr, Manager::SetNodeTabStop, nullptr, nullptr, nullptr, napi_default, nullptr } }; - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - - Manager::GetInstance()->Export(env, exports); - return exports; -} -EXTERN_C_END - -static napi_module nativeNodeModule = { .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativeNode", - .nm_priv = ((void*)0), - .reserved = { 0 } }; - -extern "C" __attribute__((constructor)) void RegisterModule(void) -{ - napi_module_register(&nativeNodeModule); -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/manager.cpp b/ArkUIKit/NdkFocus/entry/src/main/cpp/manager.cpp deleted file mode 100644 index c55173e2d33cfb532287ae677afa253d8393445e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,977 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "manager.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "container.h" -#include "focus_manager.h" -#include "napi/native_api.h" - -namespace NativeXComponentSample { -Manager Manager::manager_; - -Manager::~Manager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "~Manager"); - for (auto& [key, component] : nativeXComponentMap_) { - component = nullptr; - } - nativeXComponentMap_.clear(); -} - -static ArkUI_NativeNodeAPI_1* nodeAPI = nullptr; -static ArkUI_Context* context_ = nullptr; - -// 颜色常量 -const uint32_t RED_COLOR = 0xFFFF0000; -const uint32_t BLACK_COLOR = 0xFF000000; -const uint32_t DEFAULT_COLOR = 0xF2F2F3F0; - -// 数字常量 -const int32_t NUMBER_ZERO = 0; -const int32_t NUMBER_ONE = 1; -const int32_t NUMBER_TWO = 2; -const int32_t NUMBER_THREE = 3; -const int32_t NUMBER_FOUR = 4; -const int32_t NUMBER_NINE = 9; - -// 获焦回调函数 -void EventReceiver(ArkUI_NodeEvent* event) -{ - if (!event || !nodeAPI) { - return; - } - // 从事件中提取关键信息(根据ArkUI_NodeEvent结构体定义) - ArkUI_NodeHandle node = OH_ArkUI_NodeEvent_GetNodeHandle(event); // 事件所属节点 - ArkUI_NodeEventType eventType = OH_ArkUI_NodeEvent_GetEventType(event); // 事件类型 - // 处理焦点相关事件 - if (eventType == NODE_ON_FOCUS) { - // 获焦:设置红色背景 - ArkUI_NumberValue colorValue[] = { { .u32 = RED_COLOR } }; - ArkUI_AttributeItem colorItem = { colorValue, 1 }; - nodeAPI->setAttribute(node, NODE_BACKGROUND_COLOR, &colorItem); - } else if (eventType == NODE_ON_BLUR) { - // 失焦:设置黑色背景 - ArkUI_NumberValue colorValue[] = { { .u32 = BLACK_COLOR } }; - ArkUI_AttributeItem colorItem = { colorValue, 1 }; - nodeAPI->setAttribute(node, NODE_BACKGROUND_COLOR, &colorItem); - } else if (eventType == NODE_ON_CLICK) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EventReceiver", - "Button9 clicked, creating real menu for AutoTransfer test"); - bool autoTransfer = true; - auto focusManager = FocusManager::GetInstance(); - focusManager->SetAutoTransfer(context_, autoTransfer); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EventReceiver", "AutoTransfer set to true"); - } -} - -void SetListAttribute(ArkUI_NodeHandle& list) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue listWidthValue[] = { 400 }; - ArkUI_AttributeItem listWidthItem = { listWidthValue, 1 }; - nodeAPI->setAttribute(list, NODE_WIDTH, &listWidthItem); - ArkUI_NumberValue listHeightValue[] = { 200 }; - ArkUI_AttributeItem listHeightItem = { listHeightValue, 1 }; - nodeAPI->setAttribute(list, NODE_HEIGHT, &listHeightItem); - ArkUI_NumberValue borderColorValue[] = { { .u32 = 0xCCCCCCCC } }; - ArkUI_AttributeItem borderColorItem = { borderColorValue, 1 }; - nodeAPI->setAttribute(list, NODE_BORDER_COLOR, &borderColorItem); - ArkUI_NumberValue borderWidthValue[] = { 5 }; - ArkUI_AttributeItem borderWidthItem = { borderWidthValue, 1 }; - nodeAPI->setAttribute(list, NODE_BORDER_WIDTH, &borderWidthItem); - ArkUI_NumberValue initialIndexValue[] = { { .i32 = 5 } }; - ArkUI_AttributeItem initialIndexItem = { initialIndexValue, 1 }; - nodeAPI->setAttribute(list, NODE_LIST_INITIAL_INDEX, &initialIndexItem); - ArkUI_NumberValue edgeEffectValue[] = { { .i32 = ARKUI_EDGE_EFFECT_NONE } }; - ArkUI_AttributeItem edgeEffectItem = { edgeEffectValue, 1 }; - nodeAPI->setAttribute(list, NODE_SCROLL_EDGE_EFFECT, &edgeEffectItem); - ArkUI_AttributeItem nodeIdItem = { .string = "inner" }; - nodeAPI->setAttribute(list, NODE_ID, &nodeIdItem); -} - -void SetScrollAttribute(ArkUI_NodeHandle& scroll) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue scrollWidthValue[] = { 500 }; - ArkUI_AttributeItem scrollWidthItem = { scrollWidthValue, 1 }; - nodeAPI->setAttribute(scroll, NODE_WIDTH, &scrollWidthItem); - ArkUI_NumberValue scrollHeightValue[] = { 400 }; - ArkUI_AttributeItem scrollHeightItem = { scrollHeightValue, 1 }; - nodeAPI->setAttribute(scroll, NODE_HEIGHT, &scrollHeightItem); - ArkUI_NumberValue scrollColorValue[] = { { .u32 = 0xFF2F2F4F } }; - ArkUI_AttributeItem backColorItem = { scrollColorValue, 1 }; - nodeAPI->setAttribute(scroll, NODE_BACKGROUND_COLOR, &backColorItem); - ArkUI_AttributeItem scrollNodeIdItem = { .string = "outer" }; - nodeAPI->setAttribute(scroll, NODE_ID, &scrollNodeIdItem); -} - -// 创建默认按钮 -ArkUI_NodeHandle CreateDefaultButton( - const ArkUI_AttributeItem& marginItem, const ArkUI_AttributeItem& widthItem, const ArkUI_AttributeItem& heightItem) -{ - ArkUI_NodeHandle defaultListItem = nodeAPI->createNode(ARKUI_NODE_LIST_ITEM); - nodeAPI->setAttribute(defaultListItem, NODE_MARGIN, &marginItem); - - ArkUI_NodeHandle defaultButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); - nodeAPI->setAttribute(defaultButton, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(defaultButton, NODE_HEIGHT, &heightItem); - - // 设置默认按钮背景色 - ArkUI_NumberValue defaultBackColorValue[] = { { .u32 = 0xFFE6F3FF } }; - ArkUI_AttributeItem defaultBackColorItem = { defaultBackColorValue, 1 }; - nodeAPI->setAttribute(defaultButton, NODE_BACKGROUND_COLOR, &defaultBackColorItem); - - // 设置默认按钮文本和ID - ArkUI_AttributeItem defaultContentItem = { .string = "ButtonDefault" }; - nodeAPI->setAttribute(defaultButton, NODE_BUTTON_LABEL, &defaultContentItem); - nodeAPI->setAttribute(defaultButton, NODE_ID, &defaultContentItem); - - // 设置为默认焦点 - ArkUI_NumberValue defaultFocusValue[] = { { .i32 = 1 } }; - ArkUI_AttributeItem defaultFocusItem = { defaultFocusValue, 1 }; - nodeAPI->setAttribute(defaultButton, NODE_DEFAULT_FOCUS, &defaultFocusItem); - - // 注册焦点事件 - nodeAPI->registerNodeEvent(defaultButton, NODE_ON_FOCUS, 0, defaultButton); - nodeAPI->registerNodeEvent(defaultButton, NODE_ON_BLUR, 0, defaultButton); - nodeAPI->registerNodeEventReceiver(EventReceiver); - - nodeAPI->addChild(defaultListItem, defaultButton); - return defaultListItem; -} - -// 创建普通按钮 -ArkUI_NodeHandle CreateNormalButton(int index, const ArkUI_AttributeItem& marginItem, - const ArkUI_AttributeItem& widthItem, const ArkUI_AttributeItem& heightItem) -{ - ArkUI_NodeHandle listItem = nodeAPI->createNode(ARKUI_NODE_LIST_ITEM); - nodeAPI->setAttribute(listItem, NODE_MARGIN, &marginItem); - - ArkUI_NodeHandle button = nodeAPI->createNode(ARKUI_NODE_BUTTON); - nodeAPI->setAttribute(button, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(button, NODE_HEIGHT, &heightItem); - - // 设置按钮默认背景色 - ArkUI_NumberValue backColorValue[] = { { .u32 = DEFAULT_COLOR } }; - ArkUI_AttributeItem backColorItem = { backColorValue, 1 }; - nodeAPI->setAttribute(button, NODE_BACKGROUND_COLOR, &backColorItem); - - // 设置按钮文本和ID - std::string content = "Button" + std::to_string(index); - ArkUI_AttributeItem contentItem = { .string = content.c_str() }; - nodeAPI->setAttribute(button, NODE_BUTTON_LABEL, &contentItem); - nodeAPI->setAttribute(button, NODE_ID, &contentItem); - - // Button9需要注册点击事件 - if (index == NUMBER_NINE) { - nodeAPI->registerNodeEvent(button, NODE_ON_CLICK, 0, button); - } - - // 注册焦点事件 - nodeAPI->registerNodeEvent(button, NODE_ON_FOCUS, 0, button); - nodeAPI->registerNodeEvent(button, NODE_ON_BLUR, 0, button); - nodeAPI->registerNodeEventReceiver(EventReceiver); - - nodeAPI->addChild(listItem, button); - return listItem; -} - -// 创建特殊按钮(Button4包装在Column中) -ArkUI_NodeHandle CreateSpecialButton(int index, const ArkUI_AttributeItem& marginItem, - const ArkUI_AttributeItem& widthItem, const ArkUI_AttributeItem& heightItem) -{ - ArkUI_NodeHandle listItem = nodeAPI->createNode(ARKUI_NODE_LIST_ITEM); - nodeAPI->setAttribute(listItem, NODE_MARGIN, &marginItem); - - ArkUI_NodeHandle button = nodeAPI->createNode(ARKUI_NODE_BUTTON); - nodeAPI->setAttribute(button, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(button, NODE_HEIGHT, &heightItem); - - // 设置按钮默认背景色 - ArkUI_NumberValue backColorValue[] = { { .u32 = DEFAULT_COLOR } }; - ArkUI_AttributeItem backColorItem = { backColorValue, 1 }; - nodeAPI->setAttribute(button, NODE_BACKGROUND_COLOR, &backColorItem); - - // 设置按钮文本和ID - std::string content = "Button" + std::to_string(index); - ArkUI_AttributeItem contentItem = { .string = content.c_str() }; - nodeAPI->setAttribute(button, NODE_BUTTON_LABEL, &contentItem); - nodeAPI->setAttribute(button, NODE_ID, &contentItem); - - // 注册焦点事件 - nodeAPI->registerNodeEvent(button, NODE_ON_FOCUS, 0, button); - nodeAPI->registerNodeEvent(button, NODE_ON_BLUR, 0, button); - nodeAPI->registerNodeEventReceiver(EventReceiver); - - // 创建Column4包装 - ArkUI_NodeHandle column4 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - nodeAPI->setAttribute(column4, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(column4, NODE_HEIGHT, &heightItem); - ArkUI_AttributeItem columnContentItem = { .string = "Column4" }; - nodeAPI->setAttribute(column4, NODE_ID, &columnContentItem); - - nodeAPI->addChild(column4, button); - nodeAPI->addChild(listItem, column4); - return listItem; -} - -void AddListChild(ArkUI_NodeHandle& list) -{ - if (!nodeAPI) { - return; - } - - // 创建公共属性 - ArkUI_NumberValue marginValues[] = { { 10 }, { 5 }, { 10 }, { 5 } }; - ArkUI_AttributeItem marginItem = { marginValues, 4 }; - ArkUI_NumberValue widthValue[] = { 370 }; - ArkUI_AttributeItem widthItem = { widthValue, 1 }; - ArkUI_NumberValue heightValue[] = { 40 }; - ArkUI_AttributeItem heightItem = { heightValue, 1 }; - - // 创建默认按钮 - ArkUI_NodeHandle defaultListItem = CreateDefaultButton(marginItem, widthItem, heightItem); - nodeAPI->addChild(list, defaultListItem); - - // 创建Button0-Button9 - for (int i = NUMBER_ZERO; i < NUMBER_NINE; i++) { - ArkUI_NodeHandle listItem; - - if (i == NUMBER_FOUR) { - listItem = CreateSpecialButton(i, marginItem, widthItem, heightItem); - } else { - listItem = CreateNormalButton(i, marginItem, widthItem, heightItem); - } - - nodeAPI->addChild(list, listItem); - } -} - -void AddScrollChild(ArkUI_NodeHandle& scroll, ArkUI_NodeHandle& list) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue itemWidthValue[] = { 400 }; - ArkUI_AttributeItem itemWidthItem = { itemWidthValue, 1 }; - ArkUI_NumberValue itemHeightValue[] = { 40 }; - ArkUI_AttributeItem itemHeightItem = { itemHeightValue, 1 }; - ArkUI_NumberValue itemBackColorvalue[] = { { .u32 = 0xFF00FFFF } }; - ArkUI_AttributeItem itemBackColoritem = { itemBackColorvalue, 1 }; - ArkUI_NodeHandle text = nodeAPI->createNode(ARKUI_NODE_TEXT); - nodeAPI->setAttribute(text, NODE_WIDTH, &itemWidthItem); - nodeAPI->setAttribute(text, NODE_HEIGHT, &itemHeightItem); - nodeAPI->setAttribute(text, NODE_BACKGROUND_COLOR, &itemBackColoritem); - ArkUI_AttributeItem contentItem = { .string = "TestFocus" }; - nodeAPI->setAttribute(text, NODE_TEXT_CONTENT, &contentItem); - nodeAPI->setAttribute(text, NODE_ID, &contentItem); - ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - nodeAPI->addChild(column, text); - nodeAPI->addChild(column, list); - - nodeAPI->addChild(scroll, column); -} - -void CreateFocusTree(napi_env env, napi_value arg, OH_NativeXComponent* component) -{ - // 创建父子滚动容器 - ArkUI_NodeHandle scroll = nodeAPI->createNode(ARKUI_NODE_SCROLL); - ArkUI_NodeHandle list = nodeAPI->createNode(ARKUI_NODE_LIST); - // 设置属性 - SetListAttribute(list); - SetScrollAttribute(scroll); - AddListChild(list); - AddScrollChild(scroll, list); - OH_NativeXComponent_AttachNativeRootNode(component, scroll); - auto manager = NativeXComponentSample::Manager::GetInstance(); - if (!manager) { - return; - } - context_ = OH_ArkUI_GetContextByNode(scroll); -} - -napi_value Manager::CreateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - if (argCnt < 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent* component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - - if (nodeAPI != nullptr) { - if (nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { - CreateFocusTree(env, args[1], component); - } - } - return nullptr; -} - -napi_value Manager::UpdateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode env or info is null"); - return nullptr; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "UpdateNativeNode 1111"); - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "CreateNativeNode %{public}s", idStr); - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent* component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - - if ((env == nullptr) || (info == nullptr || component == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - return nullptr; -} - -napi_value Manager::GetContext(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_number) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - int64_t value; - if (napi_get_value_int64(env, args[0], &value) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_create_object failed"); - return nullptr; - } - - return exports; -} - -void Manager::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent* nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto manager = Manager::GetInstance(); - if ((manager != nullptr) && (nativeXComponent != nullptr)) { - manager->SetNativeXComponent(id, nativeXComponent); - } -} - -void Manager::SetNativeXComponent(std::string& id, OH_NativeXComponent* nativeXComponent) -{ - if (nativeXComponent == nullptr) { - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent* tmp = nativeXComponentMap_[id]; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -OH_NativeXComponent* Manager::GetNativeXComponent(const std::string& id) -{ - return nativeXComponentMap_[id]; -} - -// 焦点相关接口实现 -napi_value Manager::RequestFocus(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "RequestFocus env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "RequestFocus napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char nodeId[256] = { 0 }; - size_t length; - if (napi_get_value_string_utf8(env, args[0], nodeId, sizeof(nodeId) - 1, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_string_utf8 failed"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "接收的nodeId: %s, 长度: %zu", nodeId, length); - - auto focusManager = FocusManager::GetInstance(); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "qqh -> start request"); - int result = focusManager->RequestFocus(nodeId); - - napi_value returnValue; - napi_create_int32(env, result, &returnValue); - return returnValue; -} - -napi_value Manager::RequestFocusAsync(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "RequestFocus env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "RequestFocus napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char nodeId[256] = { 0 }; - size_t length; - if (napi_get_value_string_utf8(env, args[0], nodeId, sizeof(nodeId) - 1, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_string_utf8 failed"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "接收的nodeId: %s, 长度: %zu", nodeId, length); - - auto focusManager = FocusManager::GetInstance(); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "qqh -> start request"); - int result = focusManager->RequestFocusAsync(nodeId); - - napi_value returnValue; - napi_create_int32(env, result, &returnValue); - return returnValue; -} - -napi_value Manager::ClearFocus(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "ClearFocus env or info is null"); - return nullptr; - } - - auto focusManager = FocusManager::GetInstance(); - focusManager->ClearFocus(context_); - - return nullptr; -} - -napi_value Manager::ActivateFocus(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "ActivateFocus env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "ActivateFocus napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != NUMBER_TWO) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - bool isActive = false; - bool isAutoInactive = true; - - napi_get_value_bool(env, args[0], &isActive); - napi_get_value_bool(env, args[1], &isAutoInactive); - - auto focusManager = FocusManager::GetInstance(); - focusManager->ActivateFocus(context_, isActive, isAutoInactive); - - return nullptr; -} - -napi_value Manager::SetAutoTransfer(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetAutoTransfer env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetAutoTransfer napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - bool autoTransfer = true; - napi_get_value_bool(env, args[0], &autoTransfer); - - auto focusManager = FocusManager::GetInstance(); - focusManager->SetAutoTransfer(context_, autoTransfer); - - return nullptr; -} - -napi_value Manager::SetKeyProcessingMode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetKeyProcessingMode env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetKeyProcessingMode napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - int32_t mode = 0; - napi_get_value_int32(env, args[0], &mode); - - auto focusManager = FocusManager::GetInstance(); - focusManager->SetKeyProcessingMode(context_, static_cast(mode)); - - return nullptr; -} - -napi_value Manager::SetNodeFocusable(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeFocusable env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeFocusable napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != NUMBER_TWO) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - char nodeId[256] = { 0 }; - size_t length; - if (napi_get_value_string_utf8(env, args[0], nodeId, sizeof(nodeId) - 1, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_string_utf8 failed"); - return nullptr; - } - - bool focusable = false; - napi_get_value_bool(env, args[1], &focusable); - - auto focusManager = FocusManager::GetInstance(); - int result = focusManager->SetNodeFocusable(nodeId, focusable); - - napi_value returnValue; - napi_create_int32(env, result, &returnValue); - return returnValue; -} - -napi_value Manager::SetNodeFocusOnTouch(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeFocusOnTouch env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeFocusOnTouch napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != NUMBER_TWO) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - char nodeId[256] = { 0 }; - size_t length; - if (napi_get_value_string_utf8(env, args[0], nodeId, sizeof(nodeId) - 1, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_string_utf8 failed"); - return nullptr; - } - - bool focusable = false; - napi_get_value_bool(env, args[1], &focusable); - - auto focusManager = FocusManager::GetInstance(); - int result = focusManager->SetFocusOnTouch(nodeId, focusable); - - napi_value returnValue; - napi_create_int32(env, result, &returnValue); - return returnValue; -} - -napi_value Manager::GetCurrentFocusNodeId(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetCurrentFocusNodeId env or info is null"); - return nullptr; - } - - auto focusManager = FocusManager::GetInstance(); - std::string currentNodeId = focusManager->GetCurrentFocusNodeId(); - - napi_value returnValue; - napi_create_string_utf8(env, currentNodeId.c_str(), currentNodeId.length(), &returnValue); - return returnValue; -} - -napi_value Manager::SetNodeDefaultFocus(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeDefaultFocus env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeDefaultFocus napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != NUMBER_TWO) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - char nodeId[256] = { 0 }; - size_t length; - if (napi_get_value_string_utf8(env, args[0], nodeId, sizeof(nodeId) - 1, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_string_utf8 failed"); - return nullptr; - } - - bool isDefault = false; - napi_get_value_bool(env, args[1], &isDefault); - - auto focusManager = FocusManager::GetInstance(); - int result = focusManager->SetNodeDefaultFocus(nodeId, isDefault); - - napi_value returnValue; - napi_create_int32(env, result, &returnValue); - return returnValue; -} - -napi_value Manager::SetNodeFocusBox(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeFocusBox env or info is null"); - return nullptr; - } - - size_t argCnt = 4; - napi_value args[4] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeFocusBox napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != NUMBER_FOUR) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - char nodeId[256] = { 0 }; - size_t length; - if (napi_get_value_string_utf8(env, args[0], nodeId, sizeof(nodeId) - 1, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_string_utf8 failed"); - return nullptr; - } - - double distance = 0.0; - double width = 0.0; - uint32_t color = 0; - - napi_get_value_double(env, args[NUMBER_ONE], &distance); - napi_get_value_double(env, args[NUMBER_TWO], &width); - napi_get_value_uint32(env, args[NUMBER_THREE], &color); - - auto focusManager = FocusManager::GetInstance(); - int result = focusManager->SetNodeFocusBox(nodeId, static_cast(distance), static_cast(width), color); - - napi_value returnValue; - napi_create_int32(env, result, &returnValue); - return returnValue; -} - -napi_value Manager::SetNodeNextFocus(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeNextFocus env or info is null"); - return nullptr; - } - - size_t argCnt = 3; - napi_value args[3] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeNextFocus napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != NUMBER_THREE) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - char nodeId[256] = { 0 }; - char nextNodeId[256] = { 0 }; - size_t length; - - if (napi_get_value_string_utf8(env, args[0], nodeId, sizeof(nodeId) - 1, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_string_utf8 failed for nodeId"); - return nullptr; - } - - if (napi_get_value_string_utf8(env, args[1], nextNodeId, sizeof(nextNodeId) - 1, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_string_utf8 failed for nextNodeId"); - return nullptr; - } - - int32_t direction = 0; - napi_get_value_int32(env, args[NUMBER_TWO], &direction); - - auto focusManager = FocusManager::GetInstance(); - int result = focusManager->SetNodeNextFocus(nodeId, nextNodeId, direction); - - napi_value returnValue; - napi_create_int32(env, result, &returnValue); - return returnValue; -} - -napi_value Manager::SetNodeTabStop(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeTabStop env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "SetNodeTabStop napi_get_cb_info failed"); - return nullptr; - } - - if (argCnt != NUMBER_TWO) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - char nodeId[256] = { 0 }; - size_t length; - if (napi_get_value_string_utf8(env, args[0], nodeId, sizeof(nodeId) - 1, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_string_utf8 failed"); - return nullptr; - } - - bool tabStop = false; - napi_get_value_bool(env, args[1], &tabStop); - - auto focusManager = FocusManager::GetInstance(); - int result = focusManager->SetNodeTabStop(nodeId, tabStop); - - napi_value returnValue; - napi_create_int32(env, result, &returnValue); - return returnValue; -} - -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/manager.h b/ArkUIKit/NdkFocus/entry/src/main/cpp/manager.h deleted file mode 100644 index ce692ab75713cb2a073971f0cc9b7f10f97f2587..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include - -#include "container.h" -#include "focus_manager.h" - -namespace NativeXComponentSample { -class Manager { -public: - ~Manager(); - - static Manager* GetInstance() - { - return &Manager::manager_; - } - - static napi_value GetContext(napi_env env, napi_callback_info info); - static napi_value CreateNativeNode(napi_env env, napi_callback_info info); - static napi_value UpdateNativeNode(napi_env env, napi_callback_info info); - - // 焦点相关接口 - static napi_value RequestFocus(napi_env env, napi_callback_info info); - static napi_value RequestFocusAsync(napi_env env, napi_callback_info info); - static napi_value ClearFocus(napi_env env, napi_callback_info info); - static napi_value ActivateFocus(napi_env env, napi_callback_info info); - static napi_value SetAutoTransfer(napi_env env, napi_callback_info info); - static napi_value SetKeyProcessingMode(napi_env env, napi_callback_info info); - static napi_value SetNodeFocusable(napi_env env, napi_callback_info info); - static napi_value SetNodeFocusOnTouch(napi_env env, napi_callback_info info); - static napi_value GetCurrentFocusNodeId(napi_env env, napi_callback_info info); - static napi_value SetNodeDefaultFocus(napi_env env, napi_callback_info info); - static napi_value SetNodeFocusBox(napi_env env, napi_callback_info info); - static napi_value SetNodeNextFocus(napi_env env, napi_callback_info info); - static napi_value SetNodeTabStop(napi_env env, napi_callback_info info); - - void SetNativeXComponent(std::string& id, OH_NativeXComponent* nativeXComponent); - OH_NativeXComponent* GetNativeXComponent(const std::string& id); - - void Export(napi_env env, napi_value exports); - -private: - static Manager manager_; - - std::unordered_map nativeXComponentMap_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NdkFocus/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 1ebee157faa8ccf9c15a7cd9ab28e356f824a7a6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = { nullptr }; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NdkFocus/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NdkFocus/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 846e4c7e13ead48abe6019bd40f3a13bf8f9c083..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NdkFocus/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 252b7dad746191e35c874f2fc83685e3c8ae115b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkFocus/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NdkFocus/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1504a74f09dfdcfae408be979f99369a2c5affab..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkFocus/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NdkFocus/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index eb6141a74435e1f2f785e7c5f84998b198a7124b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libnativeNode.so'; - -@Entry -@Component -struct Index { - @State focusActive: boolean = false; - @State autoTransfer: boolean = true; - @State nodeTabStop: boolean = true; - @State keyProcessingMode: number = 0; - - build() { - Column({ space: 15 }) { - // 标题 - Text('Native Interface Focus API 用例测试') - .fontSize(22) - .fontWeight(FontWeight.Bold) - .margin({ top: 20 }) - .textAlign(TextAlign.Center) - - // 当前焦点状态显示 - Column({ space: 8 }) { - Text('焦点状态信息') - .fontSize(16) - .fontWeight(FontWeight.Medium) - - Row() { - Text('手动激活状态: ') - .fontSize(14) - Text(this.focusActive ? '已激活' : '未激活') - .fontSize(14) - .fontColor(this.focusActive ? Color.Green : Color.Red) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .justifyContent(FlexAlign.Start) - - Row() { - Text('自动转移状态: ') - .fontSize(14) - Text(this.autoTransfer ? '启用' : '禁用') - .fontSize(14) - .fontColor(this.autoTransfer ? Color.Green : Color.Red) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .justifyContent(FlexAlign.Start) - } - .width('100%') - .padding(15) - .backgroundColor('#F0F8FF') - .borderRadius(10) - - // Native组件区域 - XComponent({ - id: 'focusTest', - type: XComponentType.NODE, - libraryname: 'nativeNode' - }) - .onAppear(() => { - nativeNode.createNativeNode('focusTest', this.getUIContext()); - }) - .width('100%') - .height(280) - .backgroundColor('#FFFAFA') - .border({ width: 2, color: Color.Gray, style: BorderStyle.Dashed }) - .borderRadius(8) - - // 焦点控制按钮区域 - Scroll() { - Column() { - Column({ space: 15 }) { - Text('焦点控制操作') - .fontSize(18) - .fontWeight(FontWeight.Medium) - - // Menu测试 - Row({ space: 10 }) { - Button('菜单测试按钮') - .bindMenu([ - { - value: '拉起菜单观察是否Button失焦', - action: () => { - } - } - ]) - .id('menu') - .fontSize(12) - .width(150) - .focusable(true) - } - - // 节点可聚焦控制 - Row({ space: 10 }) { - Button('设置Button0可聚焦') - .onClick(() => { - this.setNodeFocusable('Button0', true); - }) - .id('setNodeFocusableTrue') - .fontSize(12) - .width(200) - - Button('设置Button0不可聚焦') - .onClick(() => { - this.setNodeFocusable('Button0', false); - }) - .id('setNodeFocusableFalse') - .fontSize(12) - .width(200) - } - - // 请求焦点/清理焦点操作 - Row({ space: 10 }) { - Button('同步请求焦点(0)') - .onClick(() => { - this.requestFocus('Button0'); - }) - .fontSize(12) - .width(200) - .id('requestButton0') - - Button('异步请求焦点(1)') - .onClick(() => { - this.requestFocusAsync('Button1'); - }) - .fontSize(12) - .width(120) - - Button('清除焦点') - .onClick(() => { - this.clearFocus(); - }) - .fontSize(12) - .width(80) - } - - // 焦点通用属性 - - Row({ space: 10 }) { - Button('SetFocusOnTouch(2) false') - .onClick(() => { - this.setNodeFocusOnTouch('Button2', false); - }) - .fontSize(12) - .width(200) - - Button('SetFocusOnTouch(3) true') - .onClick(() => { - this.setNodeFocusOnTouch('Button3', true); - }) - .fontSize(12) - .width(200) - } - - Row({ space: 10 }) { - Button('SetTabStop(4) ' + this.nodeTabStop) - .onClick(() => { - this.setNodeTabStop('Column4', this.nodeTabStop); - this.nodeTabStop = !this.nodeTabStop; - }) - .fontSize(12) - .width(200) - .id('setTabStopButton') - } - - Row({ space: 10 }) { - Button('SetNextFocus(5→7)') - .onClick(() => { - this.setNodeNextFocus('Button5', 'Button7', 0); // 0表示tab - }) - .fontSize(12) - .width(200) - - Button('SetFocusBox(8)') - .onClick(() => { - this.setNodeFocusBox('Button8', 5.0, 2.0, 0xFF00FF00); - }) - .fontSize(12) - .width(200) - } - - // 焦点激活控制 - Row({ space: 10 }) { - Button(this.focusActive ? '取消激活' : '激活焦点') - .onClick(() => { - this.focusActive = !this.focusActive; - this.activateFocus(this.focusActive); - }) - .fontSize(12) - .width(100) - - Button(this.autoTransfer ? '禁用自动转移' : '启用自动转移') - .onClick(() => { - this.autoTransfer = !this.autoTransfer; - this.setAutoTransfer(this.autoTransfer); - }) - .fontSize(12) - .width(120) - } - } - .width('100%') - .padding(20) - .backgroundColor('#F5F5F5') - .borderRadius(10) - } - }.height(300) - } - .width('100%') - .height('100%') - .padding(20) - } - - // 请求焦点 - private requestFocus(nodeId: string) { - try { - let result: number = nativeNode.requestFocus(nodeId); - } catch (error) { - } - } - - // 请求焦点异步 - private requestFocusAsync(nodeId: string) { - try { - let result: number = nativeNode.requestFocusAsync(nodeId); - } catch (error) { - } - } - - // 清除焦点 - private clearFocus() { - try { - nativeNode.clearFocus(); - } catch (error) { - } - } - - // 激活焦点 - private activateFocus(isActive: boolean) { - try { - nativeNode.activateFocus(isActive, true); - } catch (error) { - } - } - - // 设置自动转移 - private setAutoTransfer(autoTransfer: boolean) { - try { - nativeNode.setAutoTransfer(autoTransfer); - } catch (error) { - } - } - - // 设置节点可聚焦 - private setNodeFocusable(nodeId: string, focusable: boolean) { - try { - let result: number = nativeNode.setNodeFocusable(nodeId, focusable); - } catch (error) { - } - } - - // 设置节点TabStop属性 - private setNodeTabStop(nodeId: string, tabStop: boolean) { - try { - let result: number = nativeNode.setNodeTabStop(nodeId, tabStop); - } catch (error) { - } - } - - // 设置节点可点击获焦 - private setNodeFocusOnTouch(nodeId: string, focusOnTouch: boolean) { - try { - let result: number = nativeNode.setNodeFocusOnTouch(nodeId, focusOnTouch); - } catch (error) { - } - } - - // 设置节点焦点框 - private setNodeFocusBox(nodeId: string, distance: number, width: number, color: number) { - try { - let result: number = nativeNode.setNodeFocusBox(nodeId, distance, width, color); - } catch (error) { - } - } - - // 设置节点默认焦点 - private setNodeDefaultFocus(nodeId: string, defaultFocus: boolean) { - try { - let result: number = nativeNode.setNodeDefaultFocus(nodeId, defaultFocus); - } catch (error) { - } - } - - // 设置节点下一个焦点 - private setNodeNextFocus(nodeId: string, nextNodeId: string, direction: number) { - try { - let result: number = nativeNode.setNodeNextFocus(nodeId, nextNodeId, direction); - const directionName = ['tab', 'shift+tab', 'up', 'down', 'left', 'right'][direction] || '未知'; - } catch (error) { - } - } -} diff --git a/ArkUIKit/NdkFocus/entry/src/main/module.json5 b/ArkUIKit/NdkFocus/entry/src/main/module.json5 deleted file mode 100644 index 1d783f389c78a73c75e6c782d07d3433877a671f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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/ArkUIKit/NdkFocus/entry/src/main/resources/base/element/color.json b/ArkUIKit/NdkFocus/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/main/resources/base/element/string.json b/ArkUIKit/NdkFocus/entry/src/main/resources/base/element/string.json deleted file mode 100644 index bfbdf4f34792baf7edea50e8a2d4d7d9dcbd2f11..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkFocus" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/background.png b/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index 4f9ad6307a2bc56beb6d0fce0a49cbf213b20a74..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "layered-image": { - "background": "$media:background", - "foreground": "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkFocus/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NdkFocus/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NdkFocus/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NdkFocus/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NdkFocus/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NdkFocus/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index bfbdf4f34792baf7edea50e8a2d4d7d9dcbd2f11..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkFocus" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NdkFocus/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 2b99bdcbc7d07426fe3664d6d94c541674595686..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkFocus" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/mock/Libentry.mock.ets b/ArkUIKit/NdkFocus/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 133fac9027ff6bbdcccfe98838fdbb2dc34639ab..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const nativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default nativeMock; \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/mock/mock-config.json5 b/ArkUIKit/NdkFocus/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NdkFocus/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/ohosTest/ets/test/Focus.test.ets b/ArkUIKit/NdkFocus/entry/src/ohosTest/ets/test/Focus.test.ets deleted file mode 100644 index 29f63df42375d683516267892bd85b6a8d38cfde..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/ohosTest/ets/test/Focus.test.ets +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; -import { abilityDelegatorRegistry, BY, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import nativeNode from 'libnativeNode.so'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -interface optionsObj { - url: string -} - -export default function FocusInterfaceTest() { - describe('FocusInterfaceTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(2000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - beforeEach(async () => { - }) - - afterEach(() => { - hilog.info(0x0000, 'FocusTest', 'Focus interface test case completed'); - }) - - afterAll(() => { - hilog.info(0x0000, 'FocusTest', 'All focus interface tests completed'); - }) - - /** - * @tc.number FocusInterface_001 - * @tc.name test DefaultFocus - * @tc.desc 测试默认焦点接口 - 验证ButtonDefault在XComponent创建后是否获得默认焦点 - */ - it('testDefaultFocus', 0, async (done: Function) => { - hilog.info(0x0000, 'FocusTest', 'testDefaultFocus begin'); - let driver = Driver.create(); - await driver.delayMs(2000); // 等待XComponent和native节点创建完成 - try { - const list = await driver.findComponent(ON.id('inner')); - await list.scrollSearch(ON.id('ButtonDefault')); // 滚动到ButtonDefault - await driver.delayMs(1500); // 等待滚动动画 - - // 检查ButtonDefault是否已经获得默认焦点(应该是红色背景) - let strJson = getInspectorByKey('ButtonDefault'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'ButtonDefault backgroundColor: %{public}s', obj.$attrs.backgroundColor); - - strJson = getInspectorByKey('ButtonDefault'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'ButtonDefault focus backgroundColor after activate: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000') - } catch (error) { - hilog.error(0x0000, 'FocusTest', 'testDefaultFocus failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'FocusTest', 'testDefaultFocus end'); - done(); - }) - - /** - * @tc.number FocusInterface_002 - * @tc.name testOH_ArkUI_FocusRequest - * @tc.desc 测试OH_ArkUI_FocusRequest接口 - 测试请求焦点和focusable - */ - it('testOH_ArkUI_FocusRequest_Normal', 0, async (done: Function) => { - hilog.info(0x0000, 'FocusTest', 'testOH_ArkUI_FocusRequest_Normal begin'); - let driver = Driver.create(); - await driver.delayMs(1500); - try { - const list = await driver.findComponent(ON.id('inner')); - await list.scrollSearch(ON.id('Button0')); // 滚动到Button0 - await driver.delayMs(500); // 等待滚动动画 - // 设置Button0不可获焦并请求Button0焦点 - let result: number = nativeNode.setNodeFocusable('Button0', false); - expect(result).assertEqual(0); - await driver.delayMs(1000); - let result2: number = nativeNode.requestFocus('Button0'); - await driver.delayMs(1000); - expect(result2).assertEqual(150001); - hilog.info(0x0000, 'FocusTest', 'Button0 focus request result: %{public}d', result); - - // 焦点设置失败 - let strJson = getInspectorByKey('Button0'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'node focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#F2F2F3F0') - - let result3: number = nativeNode.setNodeFocusable('Button0', true); - expect(result3).assertEqual(0); - let result4: number = nativeNode.requestFocus('Button0'); - await driver.delayMs(1000); - expect(result4).assertEqual(0); - hilog.info(0x0000, 'FocusTest', 'Button0 focus request result: %{public}d', result); - - // 焦点设置成功 - let strJson2 = getInspectorByKey('Button0'); - let obj2: ESObject = JSON.parse(strJson2); - hilog.info(0x0000, 'FocusTest', 'node focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj2.$attrs.backgroundColor).assertEqual('#FFFF0000') - - } catch (error) { - hilog.error(0x0000, 'FocusTest', 'testOH_ArkUI_FocusRequest_Normal failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'FocusTest', 'testOH_ArkUI_FocusRequest_Normal end'); - done(); - }) - - /** - * @tc.number FocusInterface_003 - * @tc.name testOH_ArkUI_FocusClear - * @tc.desc 测试OH_ArkUI_FocusClear接口 - 异步请求和清除焦点 - */ - it('testOH_ArkUI_FocusClear', 0, async (done: Function) => { - hilog.info(0x0000, 'FocusTest', 'testOH_ArkUI_FocusClear begin'); - let driver = Driver.create(); - await driver.delayMs(1500); - try { - const list = await driver.findComponent(ON.id('inner')); - await list.scrollSearch(ON.id('Button1')); // 滚动到Button0 - await driver.delayMs(1000); // 等待滚动动画 - // 请求Button1焦点 - let result: number = nativeNode.requestFocusAsync('Button1'); - await driver.delayMs(1000); - expect(result).assertEqual(0); - hilog.info(0x0000, 'FocusTest', 'Button1 focus request result: %{public}d', result); - let strJson = getInspectorByKey('Button1'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'node focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000') - - nativeNode.clearFocus(); - await driver.delayMs(1000); - let strJson2 = getInspectorByKey('Button1'); - let obj2: ESObject = JSON.parse(strJson2); - hilog.info(0x0000, 'FocusTest', 'node blur backgroundColor: %{public}s', obj2.$attrs.backgroundColor); - expect(obj2.$attrs.backgroundColor).assertEqual('#FF000000') - - } catch (error) { - hilog.error(0x0000, 'FocusTest', 'testOH_ArkUI_FocusRequest_Normal failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'FocusTest', 'testOH_ArkUI_FocusClear end'); - done(); - }) - - /** - * @tc.number FocusInterface_004 - * @tc.name testFocusOnTouch - * @tc.desc 测试FocusOnTouch接口 - Button2 and Button3 - */ - it('testFocusOnTouch', 0, async (done: Function) => { - hilog.info(0x0000, 'FocusTest', 'testFocusOnTouch begin'); - let driver = Driver.create(); - await driver.delayMs(1500); - try { - const list = await driver.findComponent(ON.id('inner')); - let result: number = nativeNode.setNodeFocusOnTouch('Button2', false); - expect(result).assertEqual(0); - await list.scrollSearch(ON.id('Button2')); // 滚动到Button2 - await driver.delayMs(2000); // 等待滚动动画 - let component = await driver.findComponent(ON.id('Button2')); - await driver.delayMs(1000); - await component.click(); - await driver.delayMs(1000); - let strJson = getInspectorByKey('Button2'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button2 backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#F2F2F3F0') - - let result2: number = nativeNode.setNodeFocusOnTouch('Button3', true); - expect(result2).assertEqual(0); - - await list.scrollSearch(ON.id('Button3')); // 滚动到Button3 - await driver.delayMs(1500); // 等待滚动动画 - let component2 = await driver.findComponent(ON.id('Button3')); - await driver.delayMs(1000); - await component2.click(); - await driver.delayMs(1000); - let strJson2 = getInspectorByKey('Button3'); - let obj2: ESObject = JSON.parse(strJson2); - hilog.info(0x0000, 'FocusTest', 'Button3 focus backgroundColor: %{public}s', obj2.$attrs.backgroundColor); - expect(obj2.$attrs.backgroundColor).assertEqual('#FFFF0000') - } catch (error) { - hilog.error(0x0000, 'FocusTest', 'testFocusOnTouch failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'FocusTest', 'testFocusOnTouch end'); - done(); - }) - - /** - * @tc.number FocusInterface_005 - * @tc.name test tabStop - * @tc.desc 测试tabStop接口 - tabStop - */ - it('testTabStop', 0, async (done: Function) => { - hilog.info(0x0000, 'FocusTest', 'testTabStop begin'); - let driver = Driver.create(); - await driver.delayMs(1500); - try { - const list = await driver.findComponent(ON.id('inner')); - await list.scrollSearch(ON.id('Button3')); // 滚动到Button3 - await driver.delayMs(1500); // 等待滚动动画 - let result: number = nativeNode.requestFocus('Button3'); - expect(result).assertEqual(0); - await driver.delayMs(1000); - let strJson = getInspectorByKey('Button3'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button3 backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); - let result2: number = nativeNode.setNodeTabStop('Column4', true); - expect(result2).assertEqual(0); - await driver.triggerKey(2049); - await driver.delayMs(1000); - await driver.triggerKey(2049); - await driver.delayMs(1000); - strJson = getInspectorByKey('Button4'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button3 backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#F2F2F3F0'); - await driver.triggerKey(2054); - await driver.delayMs(1000); - strJson = getInspectorByKey('Button4'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button4 focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000') - } catch (error) { - hilog.error(0x0000, 'FocusTest', 'testTabStop failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'FocusTest', 'testTabStop end'); - done(); - }) - - /** - * @tc.number FocusInterface_006 - * @tc.name test nextFocus - * @tc.desc 测试nextFocus接口 - nextFocus - */ - it('testNextFocus', 0, async (done: Function) => { - hilog.info(0x0000, 'FocusTest', 'testNextFocus begin'); - let driver = Driver.create(); - await driver.delayMs(1500); - try { - let result: number = nativeNode.requestFocus('Button5'); - expect(result).assertEqual(0); - await driver.delayMs(1000); - let strJson = getInspectorByKey('Button5'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button5 backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); - let result2: number = nativeNode.setNodeNextFocus('Button5', 'Button7', 0); - expect(result2).assertEqual(0); - nativeNode.activateFocus(true, true); - await driver.triggerKey(2049); - await driver.delayMs(3000); - strJson = getInspectorByKey('Button7'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button7 backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000') - } catch (error) { - hilog.error(0x0000, 'FocusTest', 'testNextFocus failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'FocusTest', 'testNextFocus end'); - done(); - }) - - /** - * @tc.number FocusInterface_007 - * @tc.name test FocusBox - * @tc.desc 测试FocusBox接口 - FocusBox - */ - it('testFocusBox', 0, async (done: Function) => { - hilog.info(0x0000, 'FocusTest', 'testFocusBox begin'); - let driver = Driver.create(); - await driver.delayMs(1500); - try { - let result: number = nativeNode.requestFocus('Button8'); - expect(result).assertEqual(0); - await driver.delayMs(1500); - let strJson = getInspectorByKey('Button8'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button8 backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); - let result2: number = nativeNode.setNodeFocusBox('Button8', 5.0, 2.0, 0xFF00FF00); - expect(result2).assertEqual(0); - nativeNode.activateFocus(false, true); - await driver.delayMs(1000); - nativeNode.activateFocus(true, true); - await driver.delayMs(1000); - strJson = getInspectorByKey('Button8'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button8 backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000') - } catch (error) { - hilog.error(0x0000, 'FocusTest', 'testFocusBox failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'FocusTest', 'testFocusBox end'); - done(); - }) - - /** - * @tc.number FocusInterface_008 - * @tc.name test OH_ArkUI_FocusSetAutoTransfer - * @tc.desc 测试OH_ArkUI_FocusSetAutoTransfer接口 - 通过Button9点击创建menu测试页面层级变化时的焦点自动转移 - */ - it('testAutoTransfer', 0, async (done: Function) => { - hilog.info(0x0000, 'FocusTest', 'testAutoTransfer begin'); - let driver = Driver.create(); - await driver.delayMs(1500); - try { - // 请求Button9焦点 - let result: number = nativeNode.requestFocus('Button9'); - expect(result).assertEqual(0); - await driver.delayMs(1000); - - // 验证Button9获得焦点 - let strJson = getInspectorByKey('Button9'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button9 backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); - - // 测试禁用AutoTransfer的情况 - nativeNode.setAutoTransfer(false); - await driver.delayMs(500); - nativeNode.activateFocus(false, true); - await driver.delayMs(1000); - // 触发menu创建(测试新层级页面的焦点转移) - let menuButton = await driver.findComponent(ON.id('menu')); - await menuButton.click(); - await driver.delayMs(1000); - - hilog.info(0x0000, 'FocusTest', 'menu should be created for AutoTransfer test'); - strJson = getInspectorByKey('Button9'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'FocusTest', 'Button9 backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); - hilog.info(0x0000, 'FocusTest', 'AutoTransfer re-enabled'); - - } catch (error) { - hilog.error(0x0000, 'FocusTest', 'testAutoTransfer failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'FocusTest', 'testAutoTransfer end'); - done(); - }) - }) -} diff --git a/ArkUIKit/NdkFocus/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NdkFocus/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 87f34f4ee3310d57372e44e12cb53835dcb32a9d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import FocusInterfaceTest from './Focus.test'; - -export default function testsuite() { - abilityTest(); - FocusInterfaceTest(); -} diff --git a/ArkUIKit/NdkFocus/entry/src/ohosTest/module.json5 b/ArkUIKit/NdkFocus/entry/src/ohosTest/module.json5 deleted file mode 100644 index 2a9b780876c5d0e4ed4aaae0f8fda64d855dcf82..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - } -} diff --git a/ArkUIKit/NdkFocus/entry/src/ohosTest/resources/base/element/color.json b/ArkUIKit/NdkFocus/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 2a604a0205123ca3cd4100ea10a183b6d488e944..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} diff --git a/ArkUIKit/NdkFocus/entry/src/ohosTest/resources/base/element/string.json b/ArkUIKit/NdkFocus/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 3a5d56ad4a2bb76296526ec935166e21b0af4b97..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "TestAbility_desc", - "value": "Test Ability for Focus Interface Testing" - }, - { - "name": "TestAbility_label", - "value": "Focus Test" - } - ] -} diff --git a/ArkUIKit/NdkFocus/entry/src/ohosTest/resources/base/media/icon.png b/ArkUIKit/NdkFocus/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkFocus/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/ArkUIKit/NdkFocus/entry/src/test/List.test.ets b/ArkUIKit/NdkFocus/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NdkFocus/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/hvigor/hvigor-config.json5 b/ArkUIKit/NdkFocus/hvigor/hvigor-config.json5 deleted file mode 100644 index 06cd7b9ed2566b9c4676235fbf6252399ecbe651..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.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*/ - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/hvigorfile.ts b/ArkUIKit/NdkFocus/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkFocus/oh-package.json5 b/ArkUIKit/NdkFocus/oh-package.json5 deleted file mode 100644 index f53e8a0a7a1ece7beea30f4f258eb44a2ebcbdc5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/ohosTest.md b/ArkUIKit/NdkFocus/ohosTest.md deleted file mode 100644 index 862bd0d01e352fa97048f0817a189b025a47bd71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkFocus/ohosTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# NdkFocus 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------------- | -------------- |-------------|-------------------------| :------- | -------- | -| NODE_DEFAULT_FOCUS示例代码验证 | 设备正常运行 | 设置Buttondefault为默认焦点 | 打开首页,Buttondefault默认获焦,背景色变为红色 | 是 | Pass | -| NODE_FOCUSABLE和OH_ArkUI_FocusRequest示例代码验证 | 设备正常运行 | 1.设置Button0不可获焦,给Button0请求焦点
2.设置Button0可获焦,给Button0请求焦点 | 1.Button0未获焦,返回错误码150002
2.Button0获焦,背景色变为红色 | 是 | Pass | -| OH_ArkUI_FocusClear和NODE_FOCUS_STATE示例代码验证 | 设备正常运行 | 1.通过NODE_FOCUS_STATE异步请求Button1焦点
2.通过OH_ArkUI_FocusClear清理焦点到根容器 | 1.Button1获焦,背景色变成红色
2.Button1失焦,背景色变为黑色 | 是 | Pass | -| NODE_FOCUS_ON_TOUCH示例代码验证 | 设备正常运行 | 1.配置Button2不可触摸获焦,并点击
2.配置Button3可触摸获焦并点击 | 1.Button2未获焦,背景色保持蓝色
2.Button3获焦,背景色变为红色 | 是 | Pass | -| NODE_TAB_STOP示例代码验证 | 设备正常运行 | 1.配置Button4父组件NODE_TAB_STOP为true后给Button3请求焦点并使用Tab走焦
2.按下Enter键 | 1.Tab走焦后,Button4未获焦,焦点停留在Button4父组件上
2.Button4获焦,背景色变为红色 | 是 | Pass | -| NODE_NEXT_FOCUS示例代码验证 | 设备正常运行 | 配置Button5的Tab键走焦的组件为Button7,让Button5获焦并使用Tab键走焦 | 焦点可以从Button5通过Tab走焦Button7,Button6未获焦过,背景色不变 | 是 | Pass | -| NODE_FOCUS_BOX示例代码验证 | 设备正常运行 | 配置Button8的NODE_FOCUS_BOX,让Button8获焦并进入走焦态 | 焦点框为自定义的黄色外框 | 是 | Pass | -| OH_ArkUI_FocusSetAutoTransfer示例代码验证 | 设备正常运行 | 给Button9请求焦点,设置AutoTransfer为false,通过菜单测试按钮拉起menu | Button9保持焦点,背景为红色 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/NdkFocus/screenshots/device/image1.jpg b/ArkUIKit/NdkFocus/screenshots/device/image1.jpg deleted file mode 100644 index c008f8af50adb2a65b48da021e4df0d09c810f3a..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkFocus/screenshots/device/image1.jpg and /dev/null differ diff --git a/ArkUIKit/NdkGestureBlocking/.gitignore b/ArkUIKit/NdkGestureBlocking/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NdkGestureBlocking/AppScope/app.json5 b/ArkUIKit/NdkGestureBlocking/AppScope/app.json5 deleted file mode 100644 index bb593be1a0c71e7f8fe484238fde34035c537e85..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.samples.ndkgesture", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NdkGestureBlocking/AppScope/resources/base/element/string.json b/ArkUIKit/NdkGestureBlocking/AppScope/resources/base/element/string.json deleted file mode 100644 index 1080233f01384411ec684b58955cb8808746fdd3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - } - ] -} diff --git a/ArkUIKit/NdkGestureBlocking/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NdkGestureBlocking/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureBlocking/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureBlocking/README_zh.md b/ArkUIKit/NdkGestureBlocking/README_zh.md deleted file mode 100644 index 85736d8fd783d35be3f8a5d626fed20ed2c51490..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/README_zh.md +++ /dev/null @@ -1,66 +0,0 @@ -# ArkUI指南文档示例 - -### 介绍 - -本示例通过使用[ArkUI指南文档](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/reference)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [手势 (Gesture)开发指导](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/native__gesture_8h.md)。 -### 效果预览 - -| 首页 | -|------------------------------------| -|| - -### 使用说明 - -1. 在首页可以查看手势拦截示例。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -entry/src/main/ets/ -|---cpp -| |---types -| |---CMakeLists.txt -| |---container.cpp -| |---container.h -| |---init.cpp -| |---manager.cpp // 手势拦截示例代码 -| |---manager.h // manager头文件 -| |---napi_init.cpp -|---ets -| |---pages -| | |---Index.ets // 应用主页面 -entry/src/ohosTest/ -|---ets -| |---index.test.ets // 示例代码测试代码 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API20版本SDK,版本号:5.1.0.56,镜像版本号:OpenHarmony_5.1.0.56。 - -3.本示例需要使用DevEco Studio NEXT Developer Preview2 (Build Version: 5.0.5.306, built on December 12, 2024)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/NdkGestureBlocking > .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/ArkUIKit/NdkGestureBlocking/build-profile.json5 b/ArkUIKit/NdkGestureBlocking/build-profile.json5 deleted file mode 100644 index ba221bc20f11c76a63dc7acb8128ef1bbe905134..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": 20, - "compatibleSdkVersion": 20, - "runtimeOS": "OpenHarmony", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/code-linter.json5 b/ArkUIKit/NdkGestureBlocking/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/.gitignore b/ArkUIKit/NdkGestureBlocking/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/build-profile.json5 b/ArkUIKit/NdkGestureBlocking/entry/build-profile.json5 deleted file mode 100644 index 471250ade0685f26d9ed6c8fb7761e0f0882c8ec..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64", "armeabi-v7a"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/hvigorfile.ts b/ArkUIKit/NdkGestureBlocking/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureBlocking/entry/obfuscation-rules.txt b/ArkUIKit/NdkGestureBlocking/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NdkGestureBlocking/entry/oh-package.json5 b/ArkUIKit/NdkGestureBlocking/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 19e9044ce2252727562f3561584b76bb12cb6acd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(MyApplication) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(nativeNode SHARED init.cpp manager.cpp container.cpp) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libnative_drawing.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so libpixelmap.so) \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/container.cpp b/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/container.cpp deleted file mode 100644 index d91d9c500d6a2a71ffa40a3351c5b74d738b44a9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/container.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include - -#include -#include -#include - -#include "container.h" - -namespace NativeXComponentSample { - namespace { - void OnSurfaceCreatedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - } - - void OnSurfaceChangedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "surface changed"); - } - } - - void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container::Release(id); - } - - void DispatchTouchEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container *render = Container::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } - } - - void DispatchMouseEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchMouseEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = Container::GetInstance(id); - if (render != nullptr) { - render->OnMouseEvent(component, window); - } - } - - - void DispatchHoverEventCB(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchHoverEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnHoverEvent(component, isHover); - } - } - } // namespace - - std::unordered_map Container::instance_; - - Container::Container(const std::string &id) - { - this->id_ = id; - } - - Container *Container::GetInstance(const std::string &id) - { - if (instance_.find(id) == instance_.end()) { - Container *instance = new Container(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } - } - - void Container::Release(const std::string &id) - { - Container *render = Container::GetInstance(id); - if (render != nullptr) { - } - } - - void Container::OnSurfaceChanged(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChanged: Unable to get XComponent id"); - return; - } - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OH_NativeXComponent_GetXComponentOffset", - "offsetX = %{public}lf, offsetY = %{public}lf", offsetX, offsetY); - uint64_t width; - uint64_t height; - OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - } - - void Container::OnTouchEvent(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - std::string id(idStr); - Container *container = Container::GetInstance(id); - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, - tiltY); - } - - void Container::RegisterCallback(OH_NativeXComponent* nativeXComponent) - { - containerCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - containerCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - containerCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - containerCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &containerCallback_); - - mouseCallback_.DispatchMouseEvent = DispatchMouseEventCB; - mouseCallback_.DispatchHoverEvent = DispatchHoverEventCB; - OH_NativeXComponent_RegisterMouseEventCallback(nativeXComponent, &mouseCallback_); - OH_NativeXComponent_RegisterOnTouchInterceptCallback( - nativeXComponent, [](OH_NativeXComponent*, ArkUI_UIInputEvent*) -> HitTestMode { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "callback", - "OH_NativeXComponent_RegisterOnTouchInterceptCallback"); - return HitTestMode::HTM_TRANSPARENT; - }); - } - - void Container::OnMouseEvent(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnMouseEvent"); - OH_NativeXComponent_MouseEvent mouseEvent; - int32_t ret = OH_NativeXComponent_GetMouseEvent(component, window, &mouseEvent); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", - "MouseEvent Info: x = %{public}f, y = %{public}f, action = %{public}d, button = %{public}d", - mouseEvent.x, mouseEvent.y, mouseEvent.action, mouseEvent.button); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Container", "GetMouseEvent error"); - } - } - - void Container::OnHoverEvent(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnHoverEvent isHover_ = %{public}d", isHover); - } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/container.h b/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/container.h deleted file mode 100644 index 4d2c090ad0ef3632520a3097ff79ee722bf88662..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/container.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MY_APPLICATION_CONTAINER_H -#define MY_APPLICATION_CONTAINER_H - -#include -#include - -#include -#include - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -namespace NativeXComponentSample { - - class Container { - public: - explicit Container(const std::string &id); - ~Container() = default; - static Container *GetInstance(const std::string &id); - static void Release(const std::string &id); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent *component, void *window); - void OnTouchEvent(OH_NativeXComponent *component, void *window); - void OnMouseEvent(OH_NativeXComponent *component, void *window); - void OnHoverEvent(OH_NativeXComponent *component, bool isHover); - void OnKeyEvent(OH_NativeXComponent *component, void *window); - void RegisterCallback(OH_NativeXComponent *nativeXComponent); - - public: - static std::unordered_map instance_; - std::string id_; - - private: - OH_NativeXComponent_Callback containerCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; - }; - -} // namespace NativeXComponentSample -#endif // MY_APPLICATION_CONTAINER_H diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/init.cpp b/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/init.cpp deleted file mode 100644 index c0a59c6e508ef0e7e7babfe349fce391e8591e7a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/init.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include "manager.h" - -namespace NativeXComponentSample { - EXTERN_C_START - static napi_value Init(napi_env env, napi_value exports) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"getContext", nullptr, Manager::GetContext, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeNode", nullptr, Manager::CreateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"upDateNativeNode", nullptr, Manager::UpdateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}}; - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - - Manager::GetInstance()->Export(env, exports); - return exports; - } - EXTERN_C_END - - static napi_module nativeNodeModule = {.nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativeNode", - .nm_priv = ((void *)0), - .reserved = {0}}; - - extern "C" __attribute__((constructor)) void RegisterModule(void) { napi_module_register(&nativeNodeModule); } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/manager.cpp b/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/manager.cpp deleted file mode 100644 index dff9ae680279ca6cb635c8cf5f61d00a1bad1a04..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,516 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "manager.h" - - -namespace NativeXComponentSample { -Manager Manager::manager_; -ArkUI_NodeHandle refresh; - -Manager::~Manager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "~Manager"); - for (auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for (auto iter = containerMap_.begin(); iter != containerMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - containerMap_.clear(); -} - -static ArkUI_AnimatorHandle animatorHandle = nullptr; -static ArkUI_AnimatorOption *animatorOption = nullptr; -static ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; -static ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; -static ArkUI_NodeHandle showContent = nullptr; -static ArkUI_NodeHandle textInput = nullptr; -static ArkUI_NativeGestureAPI_1 *gestureApi = nullptr; - -struct AA { - int32_t a; -}; - -static const int NUM_3 = 3; - -const char *ConvertTypeToName(ArkUI_GestureRecognizerType type) -{ - const char *name = ""; - switch (type) { - case TAP_GESTURE: { - name = "TapGesture is preventBegin"; - break; - } - case LONG_PRESS_GESTURE: { - name = "LongPressGesture is preventBegin"; - break; - } - case PAN_GESTURE: { - name = "PanGesture is preventBegin"; - break; - } - default: { - name = "default"; - } - } - return name; -} - -void SetTextAttribute(ArkUI_NodeHandle& node, const char* str) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue marginValue[] = {5}; - ArkUI_AttributeItem marginItem = {marginValue, 1}; - ArkUI_AttributeItem text_valueItem = {.string = str}; - nodeAPI->setAttribute(node, NODE_TEXT_CONTENT, &text_valueItem); - nodeAPI->setAttribute(node, NODE_MARGIN, &marginItem); -} - -void SetColumnAttribute(ArkUI_NodeHandle& node, float width, float height, unsigned int color) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue widthValue[] = { width }; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - ArkUI_NumberValue heightValue[] = { height }; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - ArkUI_NumberValue colorValue[] = {{.u32 = color}}; - ArkUI_AttributeItem colorItem = {colorValue, 1}; - nodeAPI->setAttribute(node, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(node, NODE_HEIGHT, &heightItem); - nodeAPI->setAttribute(node, NODE_BACKGROUND_COLOR, &colorItem); -} - -void Manager::CreateNode(ArkUI_NodeHandle& button, ArkUI_NodeHandle& buttonText, ArkUI_NodeHandle& textShow, - ArkUI_NodeHandle& textShow2) -{ - ArkUI_NumberValue marginValue[] = {5}; - ArkUI_AttributeItem marginItem = {marginValue, 1}; - ArkUI_AttributeItem textShow_valueItem = {.string = ConvertTypeToName(manager_.list_[manager_.index_])}; - nodeAPI->setAttribute(textShow, NODE_TEXT_CONTENT, &textShow_valueItem); - nodeAPI->setAttribute(textShow, NODE_MARGIN, &marginItem); - manager_.textShow_ = textShow; - - ArkUI_NumberValue button_widthValue[] = {200}; - ArkUI_AttributeItem button_widthItem = {button_widthValue, 1}; - ArkUI_NumberValue button_heightValue1[] = {50}; - ArkUI_AttributeItem button_heightItem = {button_heightValue1, 1}; - nodeAPI->setAttribute(button, NODE_WIDTH, &button_widthItem); - nodeAPI->setAttribute(button, NODE_HEIGHT, &button_heightItem); - nodeAPI->setAttribute(button, NODE_MARGIN, &marginItem); - - ArkUI_AttributeItem buttonText_valueItem = {.string = "Click to change Type"}; - nodeAPI->setAttribute(buttonText, NODE_TEXT_CONTENT, &buttonText_valueItem); - nodeAPI->addChild(button, buttonText); - - ArkUI_AttributeItem textShow2_valueItem = {.string = ""}; - nodeAPI->setAttribute(textShow2, NODE_TEXT_CONTENT, &textShow2_valueItem); - nodeAPI->setAttribute(textShow2, NODE_MARGIN, &marginItem); - manager_.textShow2_ = textShow2; - - nodeAPI->registerNodeEvent(button, NODE_ON_CLICK, 0, nullptr); - nodeAPI->addNodeEventReceiver(button, [](ArkUI_NodeEvent *event) { - manager_.index_++; - manager_.index_ %= NUM_3; - ArkUI_AttributeItem textShow_valueItem = {.string = ConvertTypeToName(manager_.list_[manager_.index_])}; - nodeAPI->setAttribute(manager_.textShow_, NODE_TEXT_CONTENT, &textShow_valueItem); - }); -} - -void Manager::SetTapGesture(ArkUI_GestureRecognizer *tapGesture, ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - gestureApi->setGestureEventTarget( - tapGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "tapGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "touchTestDone", "column1 tapGesture is called"); - }); - gestureApi->addGestureToNode(column, tapGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -void Manager::SetPanGesture(ArkUI_GestureRecognizer *panGesture, ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - gestureApi->setGestureEventTarget( - panGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "panGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "touchTestDone", "column2 panGesture is called"); - }); - gestureApi->addGestureToNode(column, panGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -void Manager::SetLongPressGesture(ArkUI_GestureRecognizer *longPressGesture, ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - gestureApi->setGestureEventTarget( - longPressGesture, GESTURE_EVENT_ACTION_ACCEPT, column, - [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "longPressGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "touchTestDone", - "column longPressGesture is called"); - }); - gestureApi->addGestureToNode(column, longPressGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -void Manager::SetGestureBlocking(ArkUI_NodeHandle &stack, ArkUI_NodeHandle &column1, OH_NativeXComponent* component) -{ - auto onTouchTestDoneCallback = [](ArkUI_GestureEvent *event, ArkUI_GestureRecognizerHandleArray recognizers, - int32_t count, void *userData) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "touchTestDone", "touchTestDone count is %{public}d", - count); - for (int i = 0; i < count; i++) { - auto type = gestureApi->getGestureType(recognizers[i]); - if (type == manager_.list_[manager_.index_]) { - OH_ArkUI_PreventGestureRecognizerBegin(recognizers[i]); - } - } - }; - OH_ArkUI_SetTouchTestDoneCallback(column1, nullptr, onTouchTestDoneCallback); - nodeAPI->registerNodeEvent(stack, NODE_ON_CLICK, 0, nullptr); - nodeAPI->addNodeEventReceiver(stack, [](ArkUI_NodeEvent *event) { - ArkUI_AttributeItem valueItem = {.string = "stack click is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "touchTestDone", "stack click tap is called"); - }); - OH_NativeXComponent_AttachNativeRootNode(component, stack); -} - -void BindingGesture(napi_env env, napi_value arg, OH_NativeXComponent* component) -{ - // 此场景为多层嵌套组件场景,stack绑定了onClick,column1 2 3分别绑定了tap手势 - static ArkUI_ContextHandle context = nullptr; - - auto text1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text1, "TapGesture"); - - auto text2 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text2, "PanGesture"); - - auto text3 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text3, "LongPressGesture"); - - float stackWidth = 400; - float stackHeight = 800; - unsigned int stackColor = 0xFEF5F5F5; - auto stack = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnAttribute(stack, stackWidth, stackHeight, stackColor); - - // column - float column1Width = 250; - float column1Height = 500; - unsigned int column1Color = 0xFF2FF3FF; - auto column1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnAttribute(column1, column1Width, column1Height, column1Color); - nodeAPI->addChild(stack, column1); - - float column2Width = 200; - float column2Height = 400; - unsigned int column2Color = 0xFF20F30F; - auto column2 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnAttribute(column2, column2Width, column2Height, column2Color); - nodeAPI->addChild(column1, column2); - nodeAPI->addChild(column1, text1); - - float column3Width = 150; - float column3Height = 300; - unsigned int column3Color = 0xF2F2F3F0; - auto column3 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnAttribute(column3, column3Width, column3Height, column3Color); - nodeAPI->addChild(column2, column3); - nodeAPI->addChild(column2, text2); - nodeAPI->addChild(column3, text3); - - auto button = nodeAPI->createNode(ARKUI_NODE_BUTTON); - auto buttonText = nodeAPI->createNode(ARKUI_NODE_TEXT); - auto textShow = nodeAPI->createNode(ARKUI_NODE_TEXT); - auto textShow2 = nodeAPI->createNode(ARKUI_NODE_TEXT); - Manager::CreateNode(button, buttonText, textShow, textShow2); - - nodeAPI->addChild(stack, textShow); - nodeAPI->addChild(stack, button); - nodeAPI->addChild(stack, textShow2); - - auto tapGesture = gestureApi->createTapGesture(1, 1); - auto panGesture = gestureApi->createPanGesture(1, GESTURE_DIRECTION_ALL, 1); - auto longPressGesture = gestureApi->createLongPressGesture(1, false, 500); - Manager::SetTapGesture(tapGesture, column1); - Manager::SetPanGesture(panGesture, column2); - Manager::SetLongPressGesture(longPressGesture, column3); - - Manager::SetGestureBlocking(stack, column1, component); -} - -napi_value Manager::CreateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - if (argCnt < 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_GESTURE, ArkUI_NativeGestureAPI_1, gestureApi); - - if (nodeAPI != nullptr) { - if (nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { - BindingGesture(env, args[1], component); - } - } - return nullptr; -} - -napi_value Manager::UpdateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode env or info is null"); - return nullptr; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "UpdateNativeNode 1111"); - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "CreateNativeNode %{public}s", idStr); - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - - if ((env == nullptr) || (info == nullptr || component == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - return nullptr; -} - -napi_value Manager::GetContext(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_number) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - int64_t value; - if (napi_get_value_int64(env, args[0], &value) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_create_object failed"); - return nullptr; - } - - return exports; -} - -void Manager::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", - "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto manager = Manager::GetInstance(); - if ((manager != nullptr) && (nativeXComponent != nullptr)) { - manager->SetNativeXComponent(id, nativeXComponent); - } -} - -void Manager::SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent) -{ - if (nativeXComponent == nullptr) { - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent *tmp = nativeXComponentMap_[id]; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -OH_NativeXComponent *Manager::GetNativeXComponent(const std::string &id) { return nativeXComponentMap_[id]; } - -Container *Manager::GetContainer(std::string &id) -{ - if (containerMap_.find(id) == containerMap_.end()) { - Container *instance = Container::GetInstance(id); - containerMap_[id] = instance; - return instance; - } - - return containerMap_[id]; -} -} // namespace NativeXComponentSample \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/manager.h b/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/manager.h deleted file mode 100644 index cd81e94f7827558685055914c5a54339fe92bbad..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "container.h" -namespace NativeXComponentSample { -const int MAX_SIZE = 11; -class Manager { -public: - ~Manager(); - - static Manager *GetInstance() { return &Manager::manager_; } - - static napi_value GetContext(napi_env env, napi_callback_info info); - static napi_value CreateNativeNode(napi_env env, napi_callback_info info); - static napi_value UpdateNativeNode(napi_env env, napi_callback_info info); - - void SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent); - OH_NativeXComponent *GetNativeXComponent(const std::string &id); - - Container *GetContainer(std::string &id); - void Export(napi_env env, napi_value exports); - - static void CreateNode(ArkUI_NodeHandle& button, ArkUI_NodeHandle& buttonText, ArkUI_NodeHandle& textShow, - ArkUI_NodeHandle& textShow2); - static void SetTapGesture(ArkUI_GestureRecognizer *tapGesture, ArkUI_NodeHandle &column); - static void SetPanGesture(ArkUI_GestureRecognizer *panGesture, ArkUI_NodeHandle &column); - static void SetLongPressGesture(ArkUI_GestureRecognizer *LongPressGesture, ArkUI_NodeHandle &column); - static void SetGestureBlocking(ArkUI_NodeHandle &stack, ArkUI_NodeHandle &column1, OH_NativeXComponent* component); - -private: - static Manager manager_; - - std::unordered_map nativeXComponentMap_; - std::unordered_map containerMap_; - ArkUI_NodeHandle button_; - ArkUI_NodeHandle textShow_; - ArkUI_NodeHandle textShow2_; - ArkUI_GestureRecognizerType list_[3] = {TAP_GESTURE, LONG_PRESS_GESTURE, PAN_GESTURE}; - int32_t index_ = 0; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index f4fb7fabbc60dffb99d41d578848f7fb0b50c5a6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index e44f3615a4767c36b4fdc841b781af96bf1971a8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index ea410725a8826704d061021d98cf02aa76cd8016..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NdkGestureBlocking/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index c5539bddd7a772710f55da0ddd7b5676305469de..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureBlocking/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NdkGestureBlocking/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureBlocking/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NdkGestureBlocking/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 6560719a55939151721c0479faf9e3e2f0c51906..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libnativeNode.so'; -import image from '@ohos.multimedia.image'; - -@Entry -@Component -struct Xcomponent { - build() { - Column() { - XComponent({ - id: 'dragStart', - type: XComponentType.NODE, - libraryname: 'nativeNode' - }) - .onAppear(() => { - nativeNode.createNativeNode("dragStart", this.getUIContext()); - }) - .width('100%') - .height(700) - .backgroundColor('#FFFAFA') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/module.json5 b/ArkUIKit/NdkGestureBlocking/entry/src/main/module.json5 deleted file mode 100644 index f09d09a7bc661e848418aaf40ba4506a86649bb1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/element/color.json b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/element/string.json b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e768d0e6629106145080e316afa02eb4a696c1a0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkGestureBlocking" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/background.png b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index e768d0e6629106145080e316afa02eb4a696c1a0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkGestureBlocking" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 721b0bf9e9932d28e6a5eb61ade0ebd4372ff379..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkGestureBlocking" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/mock/Libentry.mock.ets b/ArkUIKit/NdkGestureBlocking/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index eebf1ed910f6a8f2a9e7e565aa71b179b7b8b537..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/mock/mock-config.json5 b/ArkUIKit/NdkGestureBlocking/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 7c16bc08c6fb53175fcdc9d628a4d6a9b34bef4c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import IndexTest from './index.test'; - -export default function testsuite() { - abilityTest(); - IndexTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/ets/test/index.test.ets b/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/ets/test/index.test.ets deleted file mode 100644 index 02936d52be454cbd2a38be5ce3e079a18f87cc71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/ets/test/index.test.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect, beforeAll } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON, MouseButton, Component, MatchPattern } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -export default function IndexTest() { - - describe('IndexTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - /** - * @tc.number UiTest_001 - * @tc.name testSingleGestureJudge - * @tc.desc 测试手势拦截示例 - */ - it('testGestureBlock', 0, async (done: Function) => { - console.info('uitest: testGestureBlock begin'); - let driver = Driver.create(); - let button = await driver.findComponent(ON.text('Click to change Type', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - let longPressGesture = await driver.findComponent(ON.text('LongPressGesture', MatchPattern.CONTAINS)); - await longPressGesture.longClick(); - await driver.delayMs(1000); - //已进入测试界面 - await driver.pressBack(); - console.info('uitest: testGestureBlock end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/module.json5 b/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/test/List.test.ets b/ArkUIKit/NdkGestureBlocking/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NdkGestureBlocking/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/hvigor/hvigor-config.json5 b/ArkUIKit/NdkGestureBlocking/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureBlocking/hvigorfile.ts b/ArkUIKit/NdkGestureBlocking/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureBlocking/oh-package.json5 b/ArkUIKit/NdkGestureBlocking/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/NdkGestureBlocking/ohosTest.md b/ArkUIKit/NdkGestureBlocking/ohosTest.md deleted file mode 100644 index a1695d574a544087ae767859442c921041f8b032..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureBlocking/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# NdkGestureBlocking 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------------- | -------------- | ----------------------- | ------------------------------------------------------------ | :------- | -------- | -| NdkGestureBlocking示例代码验证 | 设备正常运行 | 进入首页,点击按钮后长按LongPressGesture | 预期显示tapGesture is called | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/NdkGestureBlocking/screenshots/device/image1.png b/ArkUIKit/NdkGestureBlocking/screenshots/device/image1.png deleted file mode 100644 index 9e5ef403c43203f998570b5853683a568a9549a3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureBlocking/screenshots/device/image1.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureNestScroll/.gitignore b/ArkUIKit/NdkGestureNestScroll/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NdkGestureNestScroll/AppScope/app.json5 b/ArkUIKit/NdkGestureNestScroll/AppScope/app.json5 deleted file mode 100644 index 273fff28a77ffa3e5e6d97859978b3e369657444..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.sample.ndkgesture", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NdkGestureNestScroll/AppScope/resources/base/element/string.json b/ArkUIKit/NdkGestureNestScroll/AppScope/resources/base/element/string.json deleted file mode 100644 index 1080233f01384411ec684b58955cb8808746fdd3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - } - ] -} diff --git a/ArkUIKit/NdkGestureNestScroll/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NdkGestureNestScroll/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureNestScroll/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureNestScroll/README_zh.md b/ArkUIKit/NdkGestureNestScroll/README_zh.md deleted file mode 100644 index 32b9b4f070c3d79b8fe0d15772fea52a0749d4fc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/README_zh.md +++ /dev/null @@ -1,68 +0,0 @@ -# ArkUI指南文档示例 - -### 介绍 - -本示例通过使用[ArkUI指南文档](https://gitcode.com/openharmony/docs/tree/master/zh-cn/application-dev/reference)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [手势 (Gesture)开发指导](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-gesture-h.md)。 -### 效果预览 - -| 首页 | -|------------------------------------| -|| - -### 使用说明 - -1. 在首页可以查看通过手势CAPI接口实现嵌套滚动的示例。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -entry/src/main/ets/ -|---cpp -| |---types -| |---CMakeLists.txt -| |---container.cpp -| |---container.h -| |---init.cpp -| |---manager.cpp // 通过手势CAPI接口实现嵌套滚动示例代码 -| |---manager.h // manager头文件 -| |---napi_init.cpp -|---ets -| |---pages -| | |---Index.ets // 应用主页面 -entry/src/ohosTest/ -|---ets -| |---index.test.ets // 示例代码测试代码 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例支持仅标准系统上运行,支持设备:华为手机、华为平板。 - -2.HarmonyOS系统:HarmonyOS 6.0.0 Beta3版本及以上。 - -3.DevEco Studio版本:DevEco Studio 6.0.0 Beta3版本及以上。 - -4.HarmonyOS SDK版本:HarmonyOS 6.0.0 Beta3 SDK版本及以上。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/NdkGestureNestScroll > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/build-profile.json5 b/ArkUIKit/NdkGestureNestScroll/build-profile.json5 deleted file mode 100644 index 1a4efe780afd7fdb22c76ae2f927496b12c2cf07..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/code-linter.json5 b/ArkUIKit/NdkGestureNestScroll/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/.gitignore b/ArkUIKit/NdkGestureNestScroll/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/build-profile.json5 b/ArkUIKit/NdkGestureNestScroll/entry/build-profile.json5 deleted file mode 100644 index fea31f4580540c7c560b62bf531292c471c410f1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/hvigorfile.ts b/ArkUIKit/NdkGestureNestScroll/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureNestScroll/entry/obfuscation-rules.txt b/ArkUIKit/NdkGestureNestScroll/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NdkGestureNestScroll/entry/oh-package.json5 b/ArkUIKit/NdkGestureNestScroll/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 19e9044ce2252727562f3561584b76bb12cb6acd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(MyApplication) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(nativeNode SHARED init.cpp manager.cpp container.cpp) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libnative_drawing.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so libpixelmap.so) \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/container.cpp b/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/container.cpp deleted file mode 100644 index 080da8a0be18ae16434b854e5ee0995d3a17c528..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/container.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include - -#include -#include -#include - -#include "container.h" - -namespace NativeXComponentSample { - namespace { - void OnSurfaceCreatedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - } - - void OnSurfaceChangedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "surface changed"); - } - } - - void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container::Release(id); - } - - void DispatchTouchEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container *render = Container::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } - } - - void DispatchMouseEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchMouseEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = Container::GetInstance(id); - if (render != nullptr) { - render->OnMouseEvent(component, window); - } - } - - - void DispatchHoverEventCB(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchHoverEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnHoverEvent(component, isHover); - } - } - } // namespace - - std::unordered_map Container::instance_; - - Container::Container(const std::string &id) - { - this->id_ = id; - } - - Container *Container::GetInstance(const std::string &id) - { - if (instance_.find(id) == instance_.end()) { - Container *instance = new Container(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } - } - - void Container::Release(const std::string &id) - { - Container *render = Container::GetInstance(id); - if (render != nullptr) { - } - } - - void Container::OnSurfaceChanged(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChanged: Unable to get XComponent id"); - return; - } - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OH_NativeXComponent_GetXComponentOffset", - "offsetX = %{public}lf, offsetY = %{public}lf", offsetX, offsetY); - uint64_t width; - uint64_t height; - OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - } - - void Container::OnTouchEvent(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - std::string id(idStr); - Container *container = Container::GetInstance(id); - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, - tiltY); - } - - void Container::RegisterCallback(OH_NativeXComponent *nativeXComponent) - { - containerCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - containerCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - containerCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - containerCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &containerCallback_); - - mouseCallback_.DispatchMouseEvent = DispatchMouseEventCB; - mouseCallback_.DispatchHoverEvent = DispatchHoverEventCB; - OH_NativeXComponent_RegisterMouseEventCallback(nativeXComponent, &mouseCallback_); - OH_NativeXComponent_RegisterOnTouchInterceptCallback( - nativeXComponent, [](OH_NativeXComponent *, ArkUI_UIInputEvent *) -> HitTestMode { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "callback", - "OH_NativeXComponent_RegisterOnTouchInterceptCallback"); - return HitTestMode::HTM_TRANSPARENT; - }); - } - - void Container::OnMouseEvent(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnMouseEvent"); - OH_NativeXComponent_MouseEvent mouseEvent; - int32_t ret = OH_NativeXComponent_GetMouseEvent(component, window, &mouseEvent); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", - "MouseEvent Info: x = %{public}f, y = %{public}f, action = %{public}d, button = %{public}d", - mouseEvent.x, mouseEvent.y, mouseEvent.action, mouseEvent.button); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Container", "GetMouseEvent error"); - } - } - - void Container::OnHoverEvent(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnHoverEvent isHover_ = %{public}d", isHover); - } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/container.h b/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/container.h deleted file mode 100644 index 4d2c090ad0ef3632520a3097ff79ee722bf88662..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/container.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MY_APPLICATION_CONTAINER_H -#define MY_APPLICATION_CONTAINER_H - -#include -#include - -#include -#include - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -namespace NativeXComponentSample { - - class Container { - public: - explicit Container(const std::string &id); - ~Container() = default; - static Container *GetInstance(const std::string &id); - static void Release(const std::string &id); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent *component, void *window); - void OnTouchEvent(OH_NativeXComponent *component, void *window); - void OnMouseEvent(OH_NativeXComponent *component, void *window); - void OnHoverEvent(OH_NativeXComponent *component, bool isHover); - void OnKeyEvent(OH_NativeXComponent *component, void *window); - void RegisterCallback(OH_NativeXComponent *nativeXComponent); - - public: - static std::unordered_map instance_; - std::string id_; - - private: - OH_NativeXComponent_Callback containerCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; - }; - -} // namespace NativeXComponentSample -#endif // MY_APPLICATION_CONTAINER_H diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/init.cpp b/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/init.cpp deleted file mode 100644 index c0a59c6e508ef0e7e7babfe349fce391e8591e7a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/init.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include "manager.h" - -namespace NativeXComponentSample { - EXTERN_C_START - static napi_value Init(napi_env env, napi_value exports) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"getContext", nullptr, Manager::GetContext, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeNode", nullptr, Manager::CreateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"upDateNativeNode", nullptr, Manager::UpdateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}}; - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - - Manager::GetInstance()->Export(env, exports); - return exports; - } - EXTERN_C_END - - static napi_module nativeNodeModule = {.nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativeNode", - .nm_priv = ((void *)0), - .reserved = {0}}; - - extern "C" __attribute__((constructor)) void RegisterModule(void) { napi_module_register(&nativeNodeModule); } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/manager.cpp b/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/manager.cpp deleted file mode 100644 index 09dcdde21fed5f504d40642d712e5afb5902a3b8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,706 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "manager.h" - - -namespace NativeXComponentSample { -Manager Manager::manager_; - -Manager::~Manager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "~Manager"); - for (auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for (auto iter = containerMap_.begin(); iter != containerMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - containerMap_.clear(); -} - -static ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; -static ArkUI_NativeGestureAPI_1 *gestureApi = nullptr; -static ArkUI_NativeGestureAPI_2 *gestureApi2 = nullptr; -static const int NUM_6 = 6; -static const int CHILD_SIZE = 20; - -namespace { - -void SetGestureEnableState(float offsetY, ArkUI_GestureRecognizer *childRecognizer, - ArkUI_GestureRecognizer *currentRecognizer, ArkUI_GestureEventTargetInfo *childTargetInfo, - ArkUI_GestureEventTargetInfo *currentTargetInfo) -{ - // 获取当前父子组件的滚动容器状态 - bool childIsEnd = false; - OH_ArkUI_GestureEventTargetInfo_IsScrollEnd(childTargetInfo, &childIsEnd); - bool childIsBegin = false; - OH_ArkUI_GestureEventTargetInfo_IsScrollBegin(childTargetInfo, &childIsBegin); - bool currentIsEnd = false; - OH_ArkUI_GestureEventTargetInfo_IsScrollEnd(currentTargetInfo, ¤tIsEnd); - bool currentIsBegin = false; - OH_ArkUI_GestureEventTargetInfo_IsScrollBegin(currentTargetInfo, ¤tIsBegin); - if (offsetY < 0) { - if (currentIsEnd) { - // 当父组件已经到达底部时,继续向上滑动时,设置子组件滑动,父组件禁止滑动 - OH_ArkUI_SetGestureRecognizerEnabled(childRecognizer, true); - OH_ArkUI_SetGestureRecognizerEnabled(currentRecognizer, false); - } else { - // 当父组件没有到达底部时,继续向上滑动时,设置子组件禁止滑动,父组件滑动 - OH_ArkUI_SetGestureRecognizerEnabled(childRecognizer, false); - OH_ArkUI_SetGestureRecognizerEnabled(currentRecognizer, true); - } - } else if (offsetY > 0) { - if (childIsBegin) { - // 当子组件到达顶部时,继续向下滑动时,设置子组件禁止滑动,父组件滑动 - OH_ArkUI_SetGestureRecognizerEnabled(childRecognizer, false); - OH_ArkUI_SetGestureRecognizerEnabled(currentRecognizer, true); - } else { - // 当子组件没有到达顶部时,继续向下滑动时,设置子组件滑动,父组件禁止滑动 - OH_ArkUI_SetGestureRecognizerEnabled(childRecognizer, true); - OH_ArkUI_SetGestureRecognizerEnabled(currentRecognizer, false); - } - } -} - -// 子组件自定义手势判定回调 -ArkUI_GestureInterruptResult ChildGestureInterruptFunc(ArkUI_GestureInterruptInfo *info) -{ - auto manager = NativeXComponentSample::Manager::GetInstance(); - if (!manager) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - // 获取自定义手势判定回调中的用户自定义信息 - int *userData = reinterpret_cast(OH_ArkUI_GestureInterrupter_GetUserData(info)); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "ArkUI_GestureInterruptInfo userData is %{public}d", - *userData); - auto currentRecognizer = manager->GetCurrentRecognizer(); - auto childRecognizer = manager->GetChildRecognizer(); - char *nodeId = (char *)malloc(sizeof(char) * NUM_6); - int result = 0; - // 获取手势绑定的节点的inspectorId - OH_ArkUI_GetGestureBindNodeId(currentRecognizer, nodeId, NUM_6, &result); - char *childNodeId = (char *)malloc(sizeof(char) * NUM_6); - int childResult = 0; - // 获取手势绑定的节点的inspectorId - OH_ArkUI_GetGestureBindNodeId(childRecognizer, childNodeId, NUM_6, &childResult); - if (!gestureApi) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - ArkUI_GestureDirectionMask mask; - // 获取pan手势的方向 - OH_ArkUI_GetPanGestureDirectionMask(currentRecognizer, &mask); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "currentRecognizer direction mask is %{public}d", - mask); - if (strcmp(nodeId, "outer") == 0 && OH_ArkUI_IsBuiltInGesture(currentRecognizer) && - gestureApi->getGestureType(currentRecognizer) == ArkUI_GestureRecognizerType::PAN_GESTURE && - strcmp(childNodeId, "inner") == 0) { - ArkUI_GestureEvent *event = OH_ArkUI_GestureInterruptInfo_GetGestureEvent(info); - if (!event) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - // 获取手势的垂直位移 - auto offsetY = OH_ArkUI_PanGesture_GetOffsetY(event); - ArkUI_GestureEventTargetInfo *childTargetInfo; - OH_ArkUI_GetGestureEventTargetInfo(childRecognizer, &childTargetInfo); - ArkUI_GestureEventTargetInfo *currentTargetInfo; - OH_ArkUI_GetGestureEventTargetInfo(currentRecognizer, ¤tTargetInfo); - if (!childTargetInfo || !currentTargetInfo) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - SetGestureEnableState(offsetY, childRecognizer, currentRecognizer, childTargetInfo, currentTargetInfo); - } - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; -} - -// 父组件自定义手势判定回调 -ArkUI_GestureInterruptResult GestureInterruptFunc(ArkUI_GestureInterruptInfo *info) -{ - auto outerRecognizer = OH_ArkUI_GestureInterruptInfo_GetRecognizer(info); - if (!outerRecognizer) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - char *nodeId = (char *)malloc(sizeof(char) * NUM_6); - int result = 0; - OH_ArkUI_GetGestureBindNodeId(outerRecognizer, nodeId, NUM_6, &result); - if (!gestureApi) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - if (strcmp(nodeId, "outer") == 0 && OH_ArkUI_IsBuiltInGesture(outerRecognizer) && - gestureApi->getGestureType(outerRecognizer) == ArkUI_GestureRecognizerType::PAN_GESTURE) { - int count = 0; - ArkUI_GestureRecognizer **recognizers; - // 获取响应链上的手势识别器 - OH_ArkUI_GetResponseRecognizersFromInterruptInfo(info, &recognizers, &count); - for (int index = 0; index < count; index++) { - auto item = recognizers[index]; - if (!item) { - continue; - } - char *childNodeId = (char *)malloc(sizeof(char) * NUM_6); - int childResult = 0; - OH_ArkUI_GetGestureBindNodeId(item, childNodeId, NUM_6, &childResult); - if (strcmp(childNodeId, "inner") != 0) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - ArkUI_GestureEvent *event = OH_ArkUI_GestureInterruptInfo_GetGestureEvent(info); - if (!event) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - // 获取手势的垂直位移 - auto offsetY = OH_ArkUI_PanGesture_GetOffsetY(event); - auto manager = NativeXComponentSample::Manager::GetInstance(); - if (!manager) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - auto currentRecognizer = manager->GetCurrentRecognizer(); - auto childRecognizer = manager->GetChildRecognizer(); - ArkUI_GestureEventTargetInfo *childTargetInfo; - OH_ArkUI_GetGestureEventTargetInfo(childRecognizer, &childTargetInfo); - ArkUI_GestureEventTargetInfo *currentTargetInfo; - OH_ArkUI_GetGestureEventTargetInfo(currentRecognizer, ¤tTargetInfo); - if (!childTargetInfo || !currentTargetInfo) { - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - SetGestureEnableState(offsetY, childRecognizer, currentRecognizer, childTargetInfo, currentTargetInfo); - } - } - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; -} - -// 并行内部手势事件回调 -ArkUI_GestureRecognizer *ParallelInnerGestureFunc(ArkUI_ParallelInnerGestureEvent *event) -{ - // 获取并行内部手势事件回调中的用户自定义信息 - int *userData = reinterpret_cast(OH_ArkUI_ParallelInnerGestureEvent_GetUserData(event)); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "ArkUI_GestureInterruptInfo userData is %{public}d", - *userData); - int count = 0; - ArkUI_GestureRecognizer **others; - // 获取并行内部手势事件回调中的冲突手势 - OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers(event, &others, &count); - // 获取并行内部手势事件回调中的当前手势 - auto current = OH_ArkUI_ParallelInnerGestureEvent_GetCurrentRecognizer(event); - for (auto index = 0; index < count; index++) { - auto item = others[index]; - if (!item) { - continue; - } - char *nodeId = (char *)malloc(sizeof(char) * NUM_6); - int result = 0; - OH_ArkUI_GetGestureBindNodeId(item, nodeId, NUM_6, &result); - if (strcmp(nodeId, "inner") != 0) { - continue; - } - // 判断是否为内置手势 - auto isBuiltIn = OH_ArkUI_IsBuiltInGesture(item); - ArkUI_GestureRecognizerType type = ArkUI_GestureRecognizerType::TAP_GESTURE; - if (gestureApi != nullptr) { - type = gestureApi->getGestureType(item); - } - if (isBuiltIn && type == ArkUI_GestureRecognizerType::PAN_GESTURE) { - auto manager = NativeXComponentSample::Manager::GetInstance(); - // 保存并行的父组件手势和子组件手势 - manager->SetCurrentRecognizer(current); - manager->SetChildRecognizer(item); - // 绑定手势识别器析构回调 - OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify( - current, - [](ArkUI_GestureRecognizer *recognizer, void *userData) { - auto manager = NativeXComponentSample::Manager::GetInstance(); - manager->SetCurrentRecognizer(nullptr); - }, - nullptr); - OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify( - item, - [](ArkUI_GestureRecognizer *recognizer, void *userData) { - auto manager = NativeXComponentSample::Manager::GetInstance(); - manager->SetChildRecognizer(nullptr); - }, - nullptr); - return item; - } - } - return nullptr; -} -} // namespace - -void SetListAttribute(ArkUI_NodeHandle &list) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue listWidthValue[] = {400}; - ArkUI_AttributeItem listWidthItem = {listWidthValue, 1}; - nodeAPI->setAttribute(list, NODE_WIDTH, &listWidthItem); - ArkUI_NumberValue listHeightValue[] = {400}; - ArkUI_AttributeItem listHeightItem = {listHeightValue, 1}; - nodeAPI->setAttribute(list, NODE_HEIGHT, &listHeightItem); - ArkUI_NumberValue borderColorValue[] = {{.u32 = 0xCCCCCCCC}}; - ArkUI_AttributeItem borderColorItem = {borderColorValue, 1}; - nodeAPI->setAttribute(list, NODE_BORDER_COLOR, &borderColorItem); - ArkUI_NumberValue borderWidthValue[] = {5}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - nodeAPI->setAttribute(list, NODE_BORDER_WIDTH, &borderWidthItem); - ArkUI_NumberValue initialIndexValue[] = {{.i32 = 5}}; - ArkUI_AttributeItem initialIndexItem = {initialIndexValue, 1}; - nodeAPI->setAttribute(list, NODE_LIST_INITIAL_INDEX, &initialIndexItem); - ArkUI_NumberValue edgeEffectValue[] = {{.i32 = ARKUI_EDGE_EFFECT_NONE}}; - ArkUI_AttributeItem edgeEffectItem = {edgeEffectValue, 1}; - nodeAPI->setAttribute(list, NODE_SCROLL_EDGE_EFFECT, &edgeEffectItem); - ArkUI_AttributeItem nodeIdItem = {.string = "inner"}; - nodeAPI->setAttribute(list, NODE_ID, &nodeIdItem); -} - -void SetScrollAttribute(ArkUI_NodeHandle &scroll) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue scrollWidthValue[] = {500}; - ArkUI_AttributeItem scrollWidthItem = {scrollWidthValue, 1}; - nodeAPI->setAttribute(scroll, NODE_WIDTH, &scrollWidthItem); - ArkUI_NumberValue scrollHeightValue[] = {600}; - ArkUI_AttributeItem scrollHeightItem = {scrollHeightValue, 1}; - nodeAPI->setAttribute(scroll, NODE_HEIGHT, &scrollHeightItem); - ArkUI_NumberValue scrollColorValue[] = {{.u32 = 0xFF2F2F4F}}; - ArkUI_AttributeItem backColorItem = {scrollColorValue, 1}; - nodeAPI->setAttribute(scroll, NODE_BACKGROUND_COLOR, &backColorItem); - ArkUI_AttributeItem scrollNodeIdItem = {.string = "outer"}; - nodeAPI->setAttribute(scroll, NODE_ID, &scrollNodeIdItem); -} - -void AddListChild(ArkUI_NodeHandle &list) -{ - if (!nodeAPI) { - return; - } - for (int i = 0; i < CHILD_SIZE; i++) { - ArkUI_NumberValue widthValue[] = {400}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - ArkUI_NumberValue heightValue[] = {100}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - ArkUI_NumberValue backColorValue[] = {{.u32 = 0xF2F2F3F0}}; - ArkUI_AttributeItem backColorItem = {backColorValue, 1}; - ArkUI_NodeHandle listItem = nodeAPI->createNode(ARKUI_NODE_LIST_ITEM); - ArkUI_NodeHandle text = nodeAPI->createNode(ARKUI_NODE_TEXT); - nodeAPI->setAttribute(text, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(text, NODE_HEIGHT, &heightItem); - nodeAPI->setAttribute(text, NODE_BACKGROUND_COLOR, &backColorItem); - std::string content = "listItem"; - content.append(std::to_string(i)); - ArkUI_AttributeItem contentItem = {.string = content.c_str()}; - nodeAPI->setAttribute(text, NODE_TEXT_CONTENT, &contentItem); - nodeAPI->addChild(listItem, text); - nodeAPI->addChild(list, listItem); - } -} - -void AddScrollChild(ArkUI_NodeHandle &scroll, ArkUI_NodeHandle &list) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue itemWidthValue[] = {400}; - ArkUI_AttributeItem itemWidthItem = {itemWidthValue, 1}; - ArkUI_NumberValue itemHeightValue[] = {400}; - ArkUI_AttributeItem itemHeightItem = {itemHeightValue, 1}; - ArkUI_NumberValue itemBackColorvalue[] = {{.u32 = 0xFF00FFFF}}; - ArkUI_AttributeItem itemBackColoritem = {itemBackColorvalue, 1}; - ArkUI_NodeHandle text = nodeAPI->createNode(ARKUI_NODE_TEXT); - nodeAPI->setAttribute(text, NODE_WIDTH, &itemWidthItem); - nodeAPI->setAttribute(text, NODE_HEIGHT, &itemHeightItem); - nodeAPI->setAttribute(text, NODE_BACKGROUND_COLOR, &itemBackColoritem); - ArkUI_AttributeItem contentItem = {.string = "scrollItem"}; - nodeAPI->setAttribute(text, NODE_TEXT_CONTENT, &contentItem); - ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - nodeAPI->addChild(column, text); - nodeAPI->addChild(column, list); - - nodeAPI->addChild(scroll, column); -} - -void SetGestureEnableStateDynamic(float delta, ArkUI_GestureRecognizer *childRecognizer, - ArkUI_GestureRecognizer *currentRecognizer, ArkUI_GestureEventTargetInfo *childTargetInfo, - ArkUI_GestureEventTargetInfo *currentTargetInfo) -{ - // 获取当前父子组件的滚动容器状态 - bool childIsEnd = false; - OH_ArkUI_GestureEventTargetInfo_IsScrollEnd(childTargetInfo, &childIsEnd); - bool childIsBegin = false; - OH_ArkUI_GestureEventTargetInfo_IsScrollBegin(childTargetInfo, &childIsBegin); - bool currentIsEnd = false; - OH_ArkUI_GestureEventTargetInfo_IsScrollEnd(currentTargetInfo, ¤tIsEnd); - bool currentIsBegin = false; - OH_ArkUI_GestureEventTargetInfo_IsScrollBegin(currentTargetInfo, ¤tIsBegin); - if (delta < 0) { - if (currentIsEnd) { - // 当父组件已经到达底部时,继续向上滑动时,设置子组件滑动,父组件禁止滑动 - OH_ArkUI_SetGestureRecognizerEnabled(childRecognizer, true); - bool isEnabled = OH_ArkUI_GetGestureRecognizerEnabled(childRecognizer); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "child isEnabled state %{public}d", - isEnabled); - OH_ArkUI_SetGestureRecognizerEnabled(currentRecognizer, false); - } else { - // 当父组件没有到达底部时,继续向上滑动时,设置子组件禁止滑动,父组件滑动 - OH_ArkUI_SetGestureRecognizerEnabled(childRecognizer, false); - OH_ArkUI_SetGestureRecognizerEnabled(currentRecognizer, true); - } - } else if (delta > 0) { - if (childIsBegin) { - // 当子组件到达顶部时,继续向下滑动时,设置子组件禁止滑动,父组件滑动 - OH_ArkUI_SetGestureRecognizerEnabled(childRecognizer, false); - OH_ArkUI_SetGestureRecognizerEnabled(currentRecognizer, true); - } else { - // 当子组件没有到达顶部时,继续向下滑动时,设置子组件滑动,父组件禁止滑动 - OH_ArkUI_SetGestureRecognizerEnabled(childRecognizer, true); - OH_ArkUI_SetGestureRecognizerEnabled(currentRecognizer, false); - } - } -} - -void LogRecognizerState(ArkUI_GestureRecognizerState state) -{ - // 判断当前手势识别器状态 - switch (state) { - case ArkUI_GestureRecognizerState::ARKUI_GESTURE_RECOGNIZER_STATE_READY: - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "childState is ready"); - break; - case ARKUI_GESTURE_RECOGNIZER_STATE_DETECTING: - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "childState is detecting"); - break; - case ARKUI_GESTURE_RECOGNIZER_STATE_PENDING: - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "childState is pending"); - break; - case ARKUI_GESTURE_RECOGNIZER_STATE_BLOCKED: - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "childState is block"); - break; - case ARKUI_GESTURE_RECOGNIZER_STATE_SUCCESSFUL: - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "childState is success"); - break; - case ARKUI_GESTURE_RECOGNIZER_STATE_FAILED: - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "childState is fail"); - break; - } -} - -// 绑定动态控制器 -void BindPanGesture(ArkUI_NodeHandle &scroll) -{ - if (!gestureApi) { - return; - } - auto panGesture = gestureApi->createPanGesture(1, 15, 5); - // 设置回调 - auto onActionUpdateCallBack = [](ArkUI_GestureEvent *event, void *extraParam) { - auto manager = NativeXComponentSample::Manager::GetInstance(); - if (!manager) { - return; - } - auto currentRecognizer = manager->GetCurrentRecognizer(); - auto childRecognizer = manager->GetChildRecognizer(); - if (!OH_ArkUI_IsGestureRecognizerValid(currentRecognizer) || - !OH_ArkUI_IsGestureRecognizerValid(childRecognizer)) { - return; - } - ArkUI_GestureRecognizerState childState; - ArkUI_GestureRecognizerState currentState; - OH_ArkUI_GetGestureRecognizerState(childRecognizer, &childState); - OH_ArkUI_GetGestureRecognizerState(currentRecognizer, ¤tState); - LogRecognizerState(childState); - if (childState != ArkUI_GestureRecognizerState::ARKUI_GESTURE_RECOGNIZER_STATE_SUCCESSFUL || - currentState != ArkUI_GestureRecognizerState::ARKUI_GESTURE_RECOGNIZER_STATE_SUCCESSFUL) { - return; - } - // 获取手势的垂直位移 - auto offsetY = OH_ArkUI_PanGesture_GetOffsetY(event); - ArkUI_GestureEventTargetInfo *childTargetInfo; - OH_ArkUI_GetGestureEventTargetInfo(childRecognizer, &childTargetInfo); - ArkUI_GestureEventTargetInfo *currentTargetInfo; - OH_ArkUI_GetGestureEventTargetInfo(currentRecognizer, ¤tTargetInfo); - if (!childTargetInfo || !currentTargetInfo) { - return; - } - SetGestureEnableStateDynamic(offsetY - manager->GetLastOffset(), childRecognizer, currentRecognizer, - childTargetInfo, currentTargetInfo); - // 更新前一次的offset - manager->SetLastOffset(offsetY); - }; - // 将手势设置到组件上 - gestureApi->setGestureEventTarget(panGesture, GESTURE_EVENT_ACTION_UPDATE, scroll, onActionUpdateCallBack); - gestureApi->addGestureToNode(scroll, panGesture, PARALLEL, NORMAL_GESTURE_MASK); -} - -void BindingGesture(napi_env env, napi_value arg, OH_NativeXComponent *component) -{ - // 创建父子滚动容器 - ArkUI_NodeHandle scroll = nodeAPI->createNode(ARKUI_NODE_SCROLL); - ArkUI_NodeHandle list = nodeAPI->createNode(ARKUI_NODE_LIST); - // 设置属性 - SetListAttribute(list); - SetScrollAttribute(scroll); - AddListChild(list); - AddScrollChild(scroll, list); - OH_NativeXComponent_AttachNativeRootNode(component, scroll); - if (!gestureApi) { - return; - } - auto manager = NativeXComponentSample::Manager::GetInstance(); - if (!manager) { - return; - } - // 绑定回调 - gestureApi2->setGestureInterrupterToNode(list, manager->GetCustomData(), ChildGestureInterruptFunc); - gestureApi->setGestureInterrupterToNode(scroll, GestureInterruptFunc); - gestureApi->setInnerGestureParallelTo(scroll, manager->GetCustomData(), ParallelInnerGestureFunc); - // 绑定嵌套滚动的动态控制器 - BindPanGesture(scroll); -} - -napi_value Manager::CreateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - if (argCnt < 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_GESTURE, ArkUI_NativeGestureAPI_1, gestureApi); - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_GESTURE, ArkUI_NativeGestureAPI_2, gestureApi2); - - if (nodeAPI != nullptr) { - if (nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { - BindingGesture(env, args[1], component); - } - } - return nullptr; -} - -napi_value Manager::UpdateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode env or info is null"); - return nullptr; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "UpdateNativeNode 1111"); - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "CreateNativeNode %{public}s", idStr); - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - - if ((env == nullptr) || (info == nullptr || component == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - return nullptr; -} - -napi_value Manager::GetContext(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_number) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - int64_t value; - if (napi_get_value_int64(env, args[0], &value) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_create_object failed"); - return nullptr; - } - - return exports; -} - -void Manager::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", - "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto manager = Manager::GetInstance(); - if ((manager != nullptr) && (nativeXComponent != nullptr)) { - manager->SetNativeXComponent(id, nativeXComponent); - } -} - -void Manager::SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent) -{ - if (nativeXComponent == nullptr) { - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent *tmp = nativeXComponentMap_[id]; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -OH_NativeXComponent *Manager::GetNativeXComponent(const std::string &id) { return nativeXComponentMap_[id]; } -} // namespace NativeXComponentSample \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/manager.h b/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/manager.h deleted file mode 100644 index 1deec23914a05be8200c895e82873efc6c16a26b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "container.h" -namespace NativeXComponentSample { -const int MAX_SIZE = 11; -class Manager { -public: - ~Manager(); - - static Manager *GetInstance() { return &Manager::manager_; } - - static napi_value GetContext(napi_env env, napi_callback_info info); - static napi_value CreateNativeNode(napi_env env, napi_callback_info info); - static napi_value UpdateNativeNode(napi_env env, napi_callback_info info); - - void SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent); - OH_NativeXComponent *GetNativeXComponent(const std::string &id); - - void Export(napi_env env, napi_value exports); - void SetCurrentRecognizer(ArkUI_GestureRecognizer *current) { currentRecognizer_ = current; } - void SetChildRecognizer(ArkUI_GestureRecognizer *child) { childRecognizer_ = child; } - - ArkUI_GestureRecognizer *GetChildRecognizer() { return childRecognizer_; } - ArkUI_GestureRecognizer *GetCurrentRecognizer() { return currentRecognizer_; } - void SetLastOffset(float lastOffset) { lastOffset_ = lastOffset; } - float GetLastOffset() { return lastOffset_; } - int *GetCustomData() { return &customData_; }; - -private: - static Manager manager_; - - std::unordered_map nativeXComponentMap_; - std::unordered_map containerMap_; - ArkUI_NodeHandle button_; - ArkUI_NodeHandle textShow_; - ArkUI_NodeHandle textShow2_; - ArkUI_GestureRecognizer *currentRecognizer_ = nullptr; - ArkUI_GestureRecognizer *childRecognizer_ = nullptr; - ArkUI_GestureRecognizerType list_[3] = {TAP_GESTURE, LONG_PRESS_GESTURE, PAN_GESTURE}; - int32_t index_ = 0; - float lastOffset_ = 0.0f; - int customData_ = 2; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index f4fb7fabbc60dffb99d41d578848f7fb0b50c5a6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index e44f3615a4767c36b4fdc841b781af96bf1971a8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index ea410725a8826704d061021d98cf02aa76cd8016..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NdkGestureNestScroll/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index c5539bddd7a772710f55da0ddd7b5676305469de..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureNestScroll/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NdkGestureNestScroll/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureNestScroll/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NdkGestureNestScroll/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 6560719a55939151721c0479faf9e3e2f0c51906..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libnativeNode.so'; -import image from '@ohos.multimedia.image'; - -@Entry -@Component -struct Xcomponent { - build() { - Column() { - XComponent({ - id: 'dragStart', - type: XComponentType.NODE, - libraryname: 'nativeNode' - }) - .onAppear(() => { - nativeNode.createNativeNode("dragStart", this.getUIContext()); - }) - .width('100%') - .height(700) - .backgroundColor('#FFFAFA') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/module.json5 b/ArkUIKit/NdkGestureNestScroll/entry/src/main/module.json5 deleted file mode 100644 index f09d09a7bc661e848418aaf40ba4506a86649bb1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/element/color.json b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/element/string.json b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e768d0e6629106145080e316afa02eb4a696c1a0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkGestureBlocking" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/background.png b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index e768d0e6629106145080e316afa02eb4a696c1a0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkGestureBlocking" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 721b0bf9e9932d28e6a5eb61ade0ebd4372ff379..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkGestureBlocking" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/mock/Libentry.mock.ets b/ArkUIKit/NdkGestureNestScroll/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index c2171716d040a605ef6af71e90b937a945f2677d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,7 +0,0 @@ -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/mock/mock-config.json5 b/ArkUIKit/NdkGestureNestScroll/entry/src/mock/mock-config.json5 deleted file mode 100644 index 6540976c9acc8afbd45895db6404334cff195465..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 7c16bc08c6fb53175fcdc9d628a4d6a9b34bef4c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import IndexTest from './index.test'; - -export default function testsuite() { - abilityTest(); - IndexTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/ets/test/index.test.ets b/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/ets/test/index.test.ets deleted file mode 100644 index b623b812e0be005e5c04d65295450012c1a91385..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/ets/test/index.test.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect, beforeAll } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON, MouseButton, Component, MatchPattern } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -export default function IndexTest() { - - describe('IndexTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - /** - * @tc.number UiTest_001 - * @tc.name testNestScroll - * @tc.desc 测试嵌套滚动示例 - */ - it('testNestScroll', 0, async (done: Function) => { - console.info('uitest: testNestScroll begin'); - let driver = Driver.create(); - let size = await driver.getDisplaySize() - let startX = Math.floor(size.x * 0.5) - let endX = Math.floor(size.x * 0.5) - await driver.swipe(startX, 700, endX, 0, 1000); - await driver.delayMs(1000); - await driver.swipe(startX, 700, endX, 0, 1000); - await driver.delayMs(1000); - await driver.swipe(startX, 500, endX, 1000, 1000); - await driver.delayMs(1000); - await driver.swipe(startX, 500, endX, 1000, 1000); - await driver.delayMs(1000); - await driver.swipe(startX, 500, endX, 1000, 1000); - await driver.delayMs(1000); - await driver.pressBack(); - console.info('uitest: testNestScroll end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/module.json5 b/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/test/List.test.ets b/ArkUIKit/NdkGestureNestScroll/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NdkGestureNestScroll/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/hvigor/hvigor-config.json5 b/ArkUIKit/NdkGestureNestScroll/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureNestScroll/hvigorfile.ts b/ArkUIKit/NdkGestureNestScroll/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureNestScroll/oh-package.json5 b/ArkUIKit/NdkGestureNestScroll/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/NdkGestureNestScroll/ohosTest.md b/ArkUIKit/NdkGestureNestScroll/ohosTest.md deleted file mode 100644 index dc81ea69089d35dacf52803ad011ae3c2ccbc7e7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureNestScroll/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# NdkGestureNestScroll 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------------- | -------------- |-------------|-------------------------| :------- | -------- | -| NdkGestureNestScroll示例代码验证 | 设备正常运行 | 进入首页,滑动页面多次 | 外层scroll组件和内层list组件滑动正常 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/NdkGestureNestScroll/screenshots/device/image1.png b/ArkUIKit/NdkGestureNestScroll/screenshots/device/image1.png deleted file mode 100644 index a6b3c2ea3e95d0858c3f91ccadd48553235338a1..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureNestScroll/screenshots/device/image1.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureSetting/.gitignore b/ArkUIKit/NdkGestureSetting/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NdkGestureSetting/AppScope/app.json5 b/ArkUIKit/NdkGestureSetting/AppScope/app.json5 deleted file mode 100644 index 273fff28a77ffa3e5e6d97859978b3e369657444..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.sample.ndkgesture", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NdkGestureSetting/AppScope/resources/base/element/string.json b/ArkUIKit/NdkGestureSetting/AppScope/resources/base/element/string.json deleted file mode 100644 index 1080233f01384411ec684b58955cb8808746fdd3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - } - ] -} diff --git a/ArkUIKit/NdkGestureSetting/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NdkGestureSetting/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureSetting/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureSetting/README_zh.md b/ArkUIKit/NdkGestureSetting/README_zh.md deleted file mode 100644 index 1387297ad5242a0ff2100759f483f8ef3c6a4b04..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/README_zh.md +++ /dev/null @@ -1,68 +0,0 @@ -# ArkUI指南文档示例 - -### 介绍 - -本示例通过使用[ArkUI指南文档](https://gitcode.com/openharmony/docs/tree/master/zh-cn/application-dev/reference)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [手势 (Gesture)开发指导](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-gesture-h.md)。 -### 效果预览 - -| 首页 | -|------------------------------------| -|| - -### 使用说明 - -1. 在首页可以查看多种手势API的使用示例,包括手势绑定、手势移除以及自定义手势判定。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -entry/src/main/ets/ -|---cpp -| |---types -| |---CMakeLists.txt -| |---container.cpp -| |---container.h -| |---init.cpp -| |---manager.cpp // 手势拦截示例代码 -| |---manager.h // manager头文件 -| |---napi_init.cpp -|---ets -| |---pages -| | |---Index.ets // 应用主页面 -entry/src/ohosTest/ -|---ets -| |---index.test.ets // 示例代码测试代码 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例支持仅标准系统上运行,支持设备:华为手机、华为平板。 - -2.HarmonyOS系统:HarmonyOS 6.0.0 Beta3版本及以上。 - -3.DevEco Studio版本:DevEco Studio 6.0.0 Beta3版本及以上。 - -4.HarmonyOS SDK版本:HarmonyOS 6.0.0 Beta3 SDK版本及以上。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/NdkGestureSetting > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/build-profile.json5 b/ArkUIKit/NdkGestureSetting/build-profile.json5 deleted file mode 100644 index 1a4efe780afd7fdb22c76ae2f927496b12c2cf07..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/code-linter.json5 b/ArkUIKit/NdkGestureSetting/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/.gitignore b/ArkUIKit/NdkGestureSetting/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/build-profile.json5 b/ArkUIKit/NdkGestureSetting/entry/build-profile.json5 deleted file mode 100644 index fea31f4580540c7c560b62bf531292c471c410f1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/hvigorfile.ts b/ArkUIKit/NdkGestureSetting/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureSetting/entry/obfuscation-rules.txt b/ArkUIKit/NdkGestureSetting/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NdkGestureSetting/entry/oh-package.json5 b/ArkUIKit/NdkGestureSetting/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 19e9044ce2252727562f3561584b76bb12cb6acd..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(MyApplication) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(nativeNode SHARED init.cpp manager.cpp container.cpp) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libnative_drawing.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so libpixelmap.so) \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/container.cpp b/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/container.cpp deleted file mode 100644 index 080da8a0be18ae16434b854e5ee0995d3a17c528..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/container.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include - -#include -#include -#include - -#include "container.h" - -namespace NativeXComponentSample { - namespace { - void OnSurfaceCreatedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - } - - void OnSurfaceChangedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "surface changed"); - } - } - - void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container::Release(id); - } - - void DispatchTouchEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container *render = Container::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } - } - - void DispatchMouseEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchMouseEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = Container::GetInstance(id); - if (render != nullptr) { - render->OnMouseEvent(component, window); - } - } - - - void DispatchHoverEventCB(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchHoverEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnHoverEvent(component, isHover); - } - } - } // namespace - - std::unordered_map Container::instance_; - - Container::Container(const std::string &id) - { - this->id_ = id; - } - - Container *Container::GetInstance(const std::string &id) - { - if (instance_.find(id) == instance_.end()) { - Container *instance = new Container(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } - } - - void Container::Release(const std::string &id) - { - Container *render = Container::GetInstance(id); - if (render != nullptr) { - } - } - - void Container::OnSurfaceChanged(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChanged: Unable to get XComponent id"); - return; - } - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OH_NativeXComponent_GetXComponentOffset", - "offsetX = %{public}lf, offsetY = %{public}lf", offsetX, offsetY); - uint64_t width; - uint64_t height; - OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - } - - void Container::OnTouchEvent(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - std::string id(idStr); - Container *container = Container::GetInstance(id); - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, - tiltY); - } - - void Container::RegisterCallback(OH_NativeXComponent *nativeXComponent) - { - containerCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - containerCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - containerCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - containerCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &containerCallback_); - - mouseCallback_.DispatchMouseEvent = DispatchMouseEventCB; - mouseCallback_.DispatchHoverEvent = DispatchHoverEventCB; - OH_NativeXComponent_RegisterMouseEventCallback(nativeXComponent, &mouseCallback_); - OH_NativeXComponent_RegisterOnTouchInterceptCallback( - nativeXComponent, [](OH_NativeXComponent *, ArkUI_UIInputEvent *) -> HitTestMode { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "callback", - "OH_NativeXComponent_RegisterOnTouchInterceptCallback"); - return HitTestMode::HTM_TRANSPARENT; - }); - } - - void Container::OnMouseEvent(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnMouseEvent"); - OH_NativeXComponent_MouseEvent mouseEvent; - int32_t ret = OH_NativeXComponent_GetMouseEvent(component, window, &mouseEvent); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", - "MouseEvent Info: x = %{public}f, y = %{public}f, action = %{public}d, button = %{public}d", - mouseEvent.x, mouseEvent.y, mouseEvent.action, mouseEvent.button); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Container", "GetMouseEvent error"); - } - } - - void Container::OnHoverEvent(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnHoverEvent isHover_ = %{public}d", isHover); - } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/container.h b/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/container.h deleted file mode 100644 index 4d2c090ad0ef3632520a3097ff79ee722bf88662..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/container.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MY_APPLICATION_CONTAINER_H -#define MY_APPLICATION_CONTAINER_H - -#include -#include - -#include -#include - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -namespace NativeXComponentSample { - - class Container { - public: - explicit Container(const std::string &id); - ~Container() = default; - static Container *GetInstance(const std::string &id); - static void Release(const std::string &id); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent *component, void *window); - void OnTouchEvent(OH_NativeXComponent *component, void *window); - void OnMouseEvent(OH_NativeXComponent *component, void *window); - void OnHoverEvent(OH_NativeXComponent *component, bool isHover); - void OnKeyEvent(OH_NativeXComponent *component, void *window); - void RegisterCallback(OH_NativeXComponent *nativeXComponent); - - public: - static std::unordered_map instance_; - std::string id_; - - private: - OH_NativeXComponent_Callback containerCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; - }; - -} // namespace NativeXComponentSample -#endif // MY_APPLICATION_CONTAINER_H diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/init.cpp b/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/init.cpp deleted file mode 100644 index c0a59c6e508ef0e7e7babfe349fce391e8591e7a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/init.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include "manager.h" - -namespace NativeXComponentSample { - EXTERN_C_START - static napi_value Init(napi_env env, napi_value exports) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"getContext", nullptr, Manager::GetContext, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeNode", nullptr, Manager::CreateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"upDateNativeNode", nullptr, Manager::UpdateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}}; - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - - Manager::GetInstance()->Export(env, exports); - return exports; - } - EXTERN_C_END - - static napi_module nativeNodeModule = {.nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativeNode", - .nm_priv = ((void *)0), - .reserved = {0}}; - - extern "C" __attribute__((constructor)) void RegisterModule(void) { napi_module_register(&nativeNodeModule); } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/manager.cpp b/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/manager.cpp deleted file mode 100644 index 26717aa0b6e40022bf93e30e1cce4f8993b0a5ae..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,1015 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "manager.h" - - -namespace NativeXComponentSample { -Manager Manager::manager_; - -Manager::~Manager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "~Manager"); - for (auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for (auto iter = containerMap_.begin(); iter != containerMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - containerMap_.clear(); -} - -static ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; -static ArkUI_NativeGestureAPI_1 *gestureApi = nullptr; -static const int NUM_2 = 2; -static const int COLUMN_SIZE = 600; - - -void SetTextAttribute(ArkUI_NodeHandle &node, const char *str) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue widthValue[] = {200}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - ArkUI_NumberValue heightValue[] = {150}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - ArkUI_NumberValue colorValue[] = {{.u32 = 0xFF2FF3FF}}; - ArkUI_AttributeItem colorItem = {colorValue, 1}; - ArkUI_AttributeItem text_valueItem = {.string = str}; - ArkUI_NumberValue borderWidthValue[] = {1}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - nodeAPI->setAttribute(node, NODE_BORDER_WIDTH, &borderWidthItem); - nodeAPI->setAttribute(node, NODE_TEXT_CONTENT, &text_valueItem); - nodeAPI->setAttribute(node, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(node, NODE_HEIGHT, &heightItem); - nodeAPI->setAttribute(node, NODE_BACKGROUND_COLOR, &colorItem); -} - -void SetColumnAttribute(ArkUI_NodeHandle &node, float width, float height, unsigned int color) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue widthValue[] = {width}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - ArkUI_NumberValue heightValue[] = {height}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - ArkUI_NumberValue colorValue[] = {{.u32 = color}}; - ArkUI_AttributeItem colorItem = {colorValue, 1}; - nodeAPI->setAttribute(node, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(node, NODE_HEIGHT, &heightItem); - nodeAPI->setAttribute(node, NODE_BACKGROUND_COLOR, &colorItem); -} - -void Manager::CreateNode(ArkUI_NodeHandle &textShow2) -{ - ArkUI_NumberValue widthValue[] = {200}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - ArkUI_NumberValue heightValue[] = {150}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - ArkUI_NumberValue colorValue[] = {{.u32 = 0xF2F2F3F0}}; - ArkUI_AttributeItem colorItem = {colorValue, 1}; - ArkUI_AttributeItem text_valueItem = {.string = "output"}; - ArkUI_NumberValue borderWidthValue[] = {1}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - nodeAPI->setAttribute(textShow2, NODE_BORDER_WIDTH, &borderWidthItem); - nodeAPI->setAttribute(textShow2, NODE_TEXT_CONTENT, &text_valueItem); - nodeAPI->setAttribute(textShow2, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(textShow2, NODE_HEIGHT, &heightItem); - nodeAPI->setAttribute(textShow2, NODE_BACKGROUND_COLOR, &colorItem); - ArkUI_AttributeItem textShow2_valueItem = {.string = ""}; - nodeAPI->setAttribute(textShow2, NODE_TEXT_CONTENT, &textShow2_valueItem); - manager_.textShow2_ = textShow2; -} - -void SetRowAttribute(ArkUI_NodeHandle &node) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue widthValue[] = {400}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - ArkUI_NumberValue heightValue[] = {150}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - ArkUI_NumberValue colorValue[] = {{.u32 = 0xFF2FF3FF}}; - ArkUI_AttributeItem colorItem = {colorValue, 1}; - ArkUI_NumberValue borderWidthValue[] = {1}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - nodeAPI->setAttribute(node, NODE_WIDTH, &widthItem); - nodeAPI->setAttribute(node, NODE_HEIGHT, &heightItem); - nodeAPI->setAttribute(node, NODE_BACKGROUND_COLOR, &colorItem); - nodeAPI->setAttribute(node, NODE_BORDER_WIDTH, &borderWidthItem); -} - -ArkUI_GestureInterruptResult ProcessDifferentGesture(int32_t type, ArkUI_GestureRecognizer* recognizer) -{ - // 判断手势类型 - switch (type) { - case ArkUI_GestureRecognizerType::TAP_GESTURE: { - double distanceThreshold = 0; - OH_ArkUI_GetGestureParam_distanceThreshold(recognizer, &distanceThreshold); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "onGestureJudgeBeginCallback distanceThreshold %{public}lf", distanceThreshold); - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - case ArkUI_GestureRecognizerType::LONG_PRESS_GESTURE: { - bool repeat = false; - OH_ArkUI_GetGestureParam_repeat(recognizer, &repeat); - int duration = false; - OH_ArkUI_GetGestureParam_duration(recognizer, &duration); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "onGestureJudgeBeginCallback repeat %{public}d duration %{public}d", repeat, duration); - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_REJECT; - } - case ArkUI_GestureRecognizerType::PAN_GESTURE: { - ArkUI_GestureDirectionMask direction = ArkUI_GestureDirection::GESTURE_DIRECTION_NONE; - OH_ArkUI_GetGestureParam_DirectMask(recognizer, &direction); - double distance = 0.0; - OH_ArkUI_GetGestureParam_distance(recognizer, &distance); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "onGestureJudgeBeginCallback direction %{public}d distance %{public}lf", direction, distance); - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - case ArkUI_GestureRecognizerType::PINCH_GESTURE: - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_REJECT; - case ArkUI_GestureRecognizerType::ROTATION_GESTURE: { - double angle = 0.0; - OH_ArkUI_GetGestureParam_angle(recognizer, &angle); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "onGestureJudgeBeginCallback angle %{public}lf", angle); - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_REJECT; - } - case ArkUI_GestureRecognizerType::SWIPE_GESTURE: { - double speed = 0.0; - OH_ArkUI_GetGestureParam_speed(recognizer, &speed); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "onGestureJudgeBeginCallback speed %{public}lf", speed); - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_REJECT; - } - case ArkUI_GestureRecognizerType::CLICK_GESTURE: - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_REJECT; - case ArkUI_GestureRecognizerType::DRAG_DROP: - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_REJECT; - } - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; -} - -// 绑定单一点击手势 -void Manager::SetTapGesture(ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - auto tapGesture = gestureApi->createTapGesture(1, 1); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - tapGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "tapGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column1 tapGesture is called"); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, tapGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -// 绑定单一移动手势 -void Manager::SetPanGestureWithDirection(ArkUI_NodeHandle &column, ArkUI_GestureDirection direction) -{ - if (!gestureApi) { - return; - } - auto panGesture = gestureApi->createPanGesture(1, direction, 1); - // 设置手势限定手指数 - OH_ArkUI_SetGestureRecognizerLimitFingerCount(panGesture, true); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - panGesture, - ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_ACCEPT | - ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_UPDATE | - ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_END | - ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_CANCEL, - nullptr, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "panGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column2 panGesture is called"); - // 获取手势回调信息 - auto rawInputEvent = OH_ArkUI_GestureEvent_GetRawInputEvent(event); - auto action = OH_ArkUI_UIInputEvent_GetAction(rawInputEvent); - auto node = OH_ArkUI_GestureEvent_GetNode(event); - auto childSize = nodeAPI->getTotalChildCount(node); - auto actionType = OH_ArkUI_GestureEvent_GetActionType(event); - auto offsetX = OH_ArkUI_PanGesture_GetOffsetX(event); - auto offsetY = OH_ArkUI_PanGesture_GetOffsetY(event); - auto velocityX = OH_ArkUI_PanGesture_GetVelocityX(event); - auto velocityY = OH_ArkUI_PanGesture_GetVelocityY(event); - auto velocity = OH_ArkUI_PanGesture_GetVelocity(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "column2 panGesture is called rawEvent action %{public}d childSize %{public}d actionType " - "%{public}d, offsetX " - "%{public}f, offsetY %{public}f, " - "velocityX %{public}f, velocityY %{public}f, velocity %{public}f", - action, childSize, actionType, offsetX, offsetY, velocityX, velocityY, velocity); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, panGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -// 绑定单一长按手势 -void Manager::SetLongPressGesture(ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - auto longPressGesture = gestureApi->createLongPressGesture(1, true, 500); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - longPressGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "longPressGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column longPressGesture is called"); - // 获取手势回调信息 - auto repeat = OH_ArkUI_LongPress_GetRepeatCount(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "column longPressGesture is called repeat %{public}d", repeat); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, longPressGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -// 绑定单一捏合手势 -void Manager::SetPinchGesture(ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - auto pinchGesture = gestureApi->createPinchGesture(2, 5); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - pinchGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "pinchGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column longPressGesture is called"); - // 获取手势回调信息 - auto scale = OH_ArkUI_PinchGesture_GetScale(event); - auto pinchCenterX = OH_ArkUI_PinchGesture_GetCenterX(event); - auto pinchCenterY = OH_ArkUI_PinchGesture_GetCenterY(event); - OH_LOG_Print( - LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "column longPressGesture is called scale %{public}f pinchCenterX %{public}f pinchCenterY %{public}f", - scale, pinchCenterX, pinchCenterY); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, pinchGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -// 绑定单一旋转手势 -void Manager::SetRotationGesture(ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - auto rotationGesture = gestureApi->createRotationGesture(2, 10); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - rotationGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "rotationGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column rotationGesture is called"); - // 获取手势回调信息 - auto angle = OH_ArkUI_RotationGesture_GetAngle(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "column rotationGesture is called angle %{public}f", angle); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, rotationGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -// 绑定单一快滑手势 -void Manager::SetSwipeGesture(ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - auto swipeGesture = gestureApi->createSwipeGesture(1, ArkUI_GestureDirection::GESTURE_DIRECTION_HORIZONTAL, 100); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - swipeGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "swipeGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column swipeGesture is called"); - // 获取手势回调信息 - auto angle = OH_ArkUI_SwipeGesture_GetAngle(event); - auto velocity = OH_ArkUI_SwipeGesture_GetVelocity(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "column swipeGesture is called angle %{public}f velocity %{public}f", angle, velocity); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, swipeGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -// 绑定带移动阈值的点击手势 -void Manager::SetTapGestureWithDistance(ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - auto tapGesture = gestureApi->createTapGestureWithDistanceThreshold(1, 1, 10); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - tapGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "createTapGestureWithDistanceThreshold is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "createTapGestureWithDistanceThreshold tapGesture is called"); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, tapGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -// 绑定手势组 -void Manager::CreateGestureGroup(ArkUI_NodeHandle &column, ArkUI_GroupGestureMode mode) -{ - if (!gestureApi) { - return; - } - auto group = gestureApi->createGroupGesture(mode); - auto longPressGesture = gestureApi->createLongPressGesture(1, true, 500); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - longPressGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "longPressGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column longPressGesture is called"); - auto repeat = OH_ArkUI_LongPress_GetRepeatCount(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "column longPressGesture is called repeat %{public}d", repeat); - }); - auto panGesture = gestureApi->createPanGesture(1, ArkUI_GestureDirection::GESTURE_DIRECTION_HORIZONTAL, 1); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - panGesture, - ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_ACCEPT | - ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_UPDATE | - ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_END | - ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_CANCEL, - nullptr, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "panGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column2 panGesture is called"); - auto rawInputEvent = OH_ArkUI_GestureEvent_GetRawInputEvent(event); - auto action = OH_ArkUI_UIInputEvent_GetAction(rawInputEvent); - auto node = OH_ArkUI_GestureEvent_GetNode(event); - auto childSize = nodeAPI->getTotalChildCount(node); - auto actionType = OH_ArkUI_GestureEvent_GetActionType(event); - auto offsetX = OH_ArkUI_PanGesture_GetOffsetX(event); - auto offsetY = OH_ArkUI_PanGesture_GetOffsetY(event); - auto velocityX = OH_ArkUI_PanGesture_GetVelocityX(event); - auto velocityY = OH_ArkUI_PanGesture_GetVelocityY(event); - auto velocity = OH_ArkUI_PanGesture_GetVelocity(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "column2 panGesture is called rawEvent action %{public}d childSize %{public}d actionType " - "%{public}d, offsetX " - "%{public}f, offsetY %{public}f, " - "velocityX %{public}f, velocityY %{public}f, velocity %{public}f", - action, childSize, actionType, offsetX, offsetY, velocityX, velocityY, velocity); - }); - // 给手势组添加子手势 - gestureApi->addChildGesture(group, longPressGesture); - // 给手势组删除子手势 - gestureApi->removeChildGesture(group, longPressGesture); - gestureApi->addChildGesture(group, longPressGesture); - gestureApi->addChildGesture(group, panGesture); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, group, ArkUI_GesturePriority::NORMAL, ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -// 设置事件响应设置 -void Manager::CreateGestureWithMask(ArkUI_NodeHandle &column, ArkUI_GestureMask mask) -{ - if (!gestureApi) { - return; - } - auto tapGesture = gestureApi->createTapGesture(1, 1); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - tapGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "tapGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column1 tapGesture is called"); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, tapGesture, ArkUI_GesturePriority::NORMAL, mask); -} - -// 设置手势绑定的优先级 -void Manager::CreateGestureWithPriority(ArkUI_NodeHandle &column, ArkUI_GesturePriority priority) -{ - if (!gestureApi) { - return; - } - auto tapGesture = gestureApi->createTapGesture(1, 1); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - tapGesture, GESTURE_EVENT_ACTION_ACCEPT, column, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "tapGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column1 tapGesture is called"); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, tapGesture, priority, ArkUI_GestureMask::NORMAL_GESTURE_MASK); -} - -// 绑定多种手势组成的手势组 -void Manager::SetMultiGesture(ArkUI_NodeHandle &node) -{ - auto tapGesture = gestureApi->createTapGesture(1, 1); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - tapGesture, GESTURE_EVENT_ACTION_ACCEPT, node, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "tapGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - }); - auto group = gestureApi->createGroupGesture(ArkUI_GroupGestureMode::EXCLUSIVE_GROUP); - auto longPressGesture = gestureApi->createLongPressGesture(1, true, 500); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - longPressGesture, GESTURE_EVENT_ACTION_ACCEPT, node, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "longPressGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - }); - auto panGesture = gestureApi->createPanGesture(1, ArkUI_GestureDirection::GESTURE_DIRECTION_HORIZONTAL, 1); - // 给手势绑定回调 - gestureApi->setGestureEventTarget(panGesture, ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_ACCEPT, nullptr, - [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "panGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - }); - auto pinchGesture = gestureApi->createPinchGesture(2, 5); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - pinchGesture, GESTURE_EVENT_ACTION_ACCEPT, node, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "pinchGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - }); - auto rotationGesture = gestureApi->createRotationGesture(2, 10); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - rotationGesture, GESTURE_EVENT_ACTION_ACCEPT, node, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "rotationGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - }); - auto swipeGesture = gestureApi->createSwipeGesture(1, ArkUI_GestureDirection::GESTURE_DIRECTION_HORIZONTAL, 100); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - swipeGesture, GESTURE_EVENT_ACTION_ACCEPT, node, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "swipeGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - }); - gestureApi->addChildGesture(group, tapGesture); - gestureApi->addChildGesture(group, longPressGesture); - gestureApi->addChildGesture(group, panGesture); - gestureApi->addChildGesture(group, pinchGesture); - gestureApi->addChildGesture(group, rotationGesture); - gestureApi->addChildGesture(group, swipeGesture); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(node, group, ArkUI_GesturePriority::NORMAL, ArkUI_GestureMask::NORMAL_GESTURE_MASK); - // 获取手势类型 - auto type = gestureApi->getGestureType(group); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "gesture type is %{public}d", type); -} - -// 绑定自定义手势判定回调 -void Manager::SetGestureJudgeBegin(ArkUI_NodeHandle node) -{ - SetMultiGesture(node); - auto onGestureJudgeBeginCallback = [](ArkUI_GestureInterruptInfo *info) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "onGestureJudgeBeginCallback triggered"); - // 获取自定义手势判定回调中的信息 - auto isSystem = OH_ArkUI_GestureInterruptInfo_GetSystemFlag(info); - auto event = OH_ArkUI_GestureInterruptInfo_GetGestureEvent(info); - auto offsetX = OH_ArkUI_PanGesture_GetOffsetX(event); - auto recognizer = OH_ArkUI_GestureInterruptInfo_GetRecognizer(info); - auto type = OH_ArkUI_GestureInterruptInfo_GetSystemRecognizerType(info); - int fingers = 0; - OH_ArkUI_GetGestureParam_FingerCount(recognizer, &fingers); - bool limitFingerCount = false; - OH_ArkUI_GetGestureParam_limitFingerCount(recognizer, &limitFingerCount); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "onGestureJudgeBeginCallback isSystem %{public}d offsetX %{public}f fingers %{public}d " - "limitFingerCount %{public}d", - isSystem, offsetX, fingers, limitFingerCount); - ArkUI_TouchRecognizerHandleArray recognizers; - int recognizerSize = 0; - // 获取本次手势响应链中的触摸事件数组 - OH_ArkUI_GestureInterruptInfo_GetTouchRecognizers(info, &recognizers, &recognizerSize); - if (recognizerSize > 0) { - auto current = recognizers[0]; - auto node = OH_ArkUI_TouchRecognizer_GetNodeHandle(current); - // 给对应的触摸识别器发送cancel,中断后续事件发送 - OH_ArkUI_TouchRecognizer_CancelTouch(current, info); - } - return ProcessDifferentGesture(type, recognizer); - }; - gestureApi->setGestureInterrupterToNode(node, onGestureJudgeBeginCallback); - nodeAPI->registerNodeEvent(node, NODE_TOUCH_EVENT, 0, nullptr); - nodeAPI->addNodeEventReceiver(node, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "node touch is called"); - }); -} - -// 设置移动手势的距离阈值表 -void Manager::SetPanGestureWithDistanceMap(ArkUI_NodeHandle &column) -{ - if (!gestureApi) { - return; - } - auto panGesture = gestureApi->createPanGesture(1, ArkUI_GestureDirection::GESTURE_DIRECTION_ALL, 1); - int toolTypes[2] = {UI_INPUT_EVENT_TOOL_TYPE_FINGER, UI_INPUT_EVENT_TOOL_TYPE_PEN}; - double distanceArray[2] = {1.0, 5}; - OH_ArkUI_PanGesture_SetDistanceMap(panGesture, NUM_2, toolTypes, distanceArray); - // 给手势绑定回调 - gestureApi->setGestureEventTarget(panGesture, ArkUI_GestureEventActionType::GESTURE_EVENT_ACTION_ACCEPT, nullptr, - [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "panGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "column2 panGesture is called"); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(column, panGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); - auto onGestureJudgeBeginCallback = [](ArkUI_GestureInterruptInfo *info) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "onGestureJudgeBeginCallback triggered"); - auto recognizer = OH_ArkUI_GestureInterruptInfo_GetRecognizer(info); - auto type = OH_ArkUI_GestureInterruptInfo_GetSystemRecognizerType(info); - switch (type) { - case ArkUI_GestureRecognizerType::PAN_GESTURE: { - ArkUI_GestureDirectionMask direction = ArkUI_GestureDirection::GESTURE_DIRECTION_NONE; - OH_ArkUI_GetGestureParam_DirectMask(recognizer, &direction); - double distanceByMap = 0.0; - // 根据输入设备类型获取移动阈值 - OH_ArkUI_PanGesture_GetDistanceByToolType(recognizer, UI_INPUT_EVENT_TOOL_TYPE_PEN, &distanceByMap); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", - "onGestureJudgeBeginCallback distance %{public}lf", distanceByMap); - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - } - default: - return ArkUI_GestureInterruptResult::GESTURE_INTERRUPT_RESULT_CONTINUE; - }; - }; - gestureApi->setGestureInterrupterToNode(column, onGestureJudgeBeginCallback); -} - -// 测试手势删除和销毁 -void Manager::TestGestureRemove(ArkUI_NodeHandle node) -{ - if (!gestureApi) { - return; - } - auto tapGesture = gestureApi->createTapGesture(1, 1); - // 给手势绑定回调 - gestureApi->setGestureEventTarget( - tapGesture, GESTURE_EVENT_ACTION_ACCEPT, node, [](ArkUI_GestureEvent *event, void *extraParams) { - ArkUI_AttributeItem valueItem = {.string = "tapGesture is called"}; - nodeAPI->setAttribute(manager_.textShow2_, NODE_TEXT_CONTENT, &valueItem); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "gestureTest", "column1 tapGesture is called"); - }); - // 将手势绑定到组件上 - gestureApi->addGestureToNode(node, tapGesture, ArkUI_GesturePriority::NORMAL, - ArkUI_GestureMask::NORMAL_GESTURE_MASK); - gestureApi->removeGestureFromNode(node, tapGesture); - gestureApi->dispose(tapGesture); -} - -void CreateSimpleGesture(ArkUI_NodeHandle list) -{ - auto childRow1 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow1); - auto text1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text1, "TapGesture"); - auto text2 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text2, "LongPressGesture"); - auto childRow2 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow2); - auto text3 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text3, "PanGesture"); - auto text4 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text4, "PinchGesture"); - auto childRow3 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow3); - auto text5 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text5, "RotationGesture"); - auto text6 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text6, "SwipeGesture"); - nodeAPI->addChild(childRow1, text1); - nodeAPI->addChild(childRow1, text2); - nodeAPI->addChild(list, childRow1); - nodeAPI->addChild(childRow2, text3); - nodeAPI->addChild(childRow2, text4); - nodeAPI->addChild(list, childRow2); - nodeAPI->addChild(childRow3, text5); - nodeAPI->addChild(childRow3, text6); - nodeAPI->addChild(list, childRow3); - Manager::SetTapGesture(text1); - Manager::SetLongPressGesture(text2); - Manager::SetPanGestureWithDirection(text3, ArkUI_GestureDirection::GESTURE_DIRECTION_ALL); - Manager::SetPinchGesture(text4); - Manager::SetRotationGesture(text5); - Manager::SetSwipeGesture(text6); -} - -void CreateDifferentDirectionPanGesture(ArkUI_NodeHandle list) -{ - auto childRow4 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow4); - auto text7 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text7, "TapGestureWithDistance"); - auto text8 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text8, "Pan-Horizontal"); - auto childRow5 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow5); - auto text9 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text9, "Pan-Vertical"); - auto text10 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text10, "Pan-Left"); - auto childRow6 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow6); - auto text11 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text11, "Pan-Right"); - auto text12 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text12, "Pan-Up"); - auto childRow7 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow7); - auto text13 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text13, "Pan-Down"); - auto text14 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text14, "Pan-None"); - nodeAPI->addChild(childRow4, text7); - nodeAPI->addChild(childRow4, text8); - nodeAPI->addChild(list, childRow4); - nodeAPI->addChild(childRow5, text9); - nodeAPI->addChild(childRow5, text10); - nodeAPI->addChild(list, childRow5); - nodeAPI->addChild(childRow6, text11); - nodeAPI->addChild(childRow6, text12); - nodeAPI->addChild(list, childRow6); - nodeAPI->addChild(childRow7, text13); - nodeAPI->addChild(childRow7, text14); - nodeAPI->addChild(list, childRow7); - Manager::SetTapGestureWithDistance(text7); - // 设置不同方向的移动手势 - Manager::SetPanGestureWithDirection(text8, ArkUI_GestureDirection::GESTURE_DIRECTION_HORIZONTAL); - Manager::SetPanGestureWithDirection(text9, ArkUI_GestureDirection::GESTURE_DIRECTION_VERTICAL); - Manager::SetPanGestureWithDirection(text10, ArkUI_GestureDirection::GESTURE_DIRECTION_LEFT); - Manager::SetPanGestureWithDirection(text11, ArkUI_GestureDirection::GESTURE_DIRECTION_RIGHT); - Manager::SetPanGestureWithDirection(text12, ArkUI_GestureDirection::GESTURE_DIRECTION_UP); - Manager::SetPanGestureWithDirection(text13, ArkUI_GestureDirection::GESTURE_DIRECTION_DOWN); - Manager::SetPanGestureWithDirection(text14, ArkUI_GestureDirection::GESTURE_DIRECTION_NONE); -} - -void CreateGestureGroupByMode(ArkUI_NodeHandle list) -{ - auto childRow8 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow8); - auto text15 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text15, "Group-Sequence"); - auto text16 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text16, "Group-Exclusive"); - auto childRow9 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow9); - auto text17 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text17, "Group-Parallel"); - auto text18 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text18, "NORMAL_GESTURE_MASK"); - auto childRow10 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow10); - auto text19 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text19, "IGNORE_INTERNAL_GESTURE_MASK"); - auto text20 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text20, "Priority-Normal"); - auto childRow11 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow11); - auto text21 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text21, "Priority-Parallel"); - auto text22 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text22, "Priority-Priority"); - nodeAPI->addChild(childRow8, text15); - nodeAPI->addChild(childRow8, text16); - nodeAPI->addChild(list, childRow8); - nodeAPI->addChild(childRow9, text17); - nodeAPI->addChild(childRow9, text18); - nodeAPI->addChild(list, childRow9); - nodeAPI->addChild(childRow10, text19); - nodeAPI->addChild(childRow10, text20); - nodeAPI->addChild(list, childRow10); - nodeAPI->addChild(childRow11, text21); - nodeAPI->addChild(childRow11, text22); - nodeAPI->addChild(list, childRow11); - // 绑定顺序手势组 - Manager::CreateGestureGroup(text15, ArkUI_GroupGestureMode::SEQUENTIAL_GROUP); - // 绑定互斥手势组 - Manager::CreateGestureGroup(text16, ArkUI_GroupGestureMode::EXCLUSIVE_GROUP); - // 绑定并行手势组 - Manager::CreateGestureGroup(text17, ArkUI_GroupGestureMode::PARALLEL_GROUP); - // 设置普通响应的手势 - Manager::CreateGestureWithMask(text18, ArkUI_GestureMask::NORMAL_GESTURE_MASK); - // 设置忽略子组件响应的手势 - Manager::CreateGestureWithMask(text19, ArkUI_GestureMask::IGNORE_INTERNAL_GESTURE_MASK); - // 绑定普通优先级的手势 - Manager::CreateGestureWithPriority(text20, ArkUI_GesturePriority::NORMAL); - // 绑定并行优先级的手势 - Manager::CreateGestureWithPriority(text21, ArkUI_GesturePriority::PARALLEL); - // 绑定高优先级的手势 - Manager::CreateGestureWithPriority(text22, ArkUI_GesturePriority::PRIORITY); -} - -// 给每个Text绑定对应的手势和回调,通过日志观测行为 -void BindingGesture(napi_env env, napi_value arg, OH_NativeXComponent *component) -{ - float columnWidth = 400; - float columnHeight = 800; - unsigned int columnColor = 0xFEF5F5F5; - auto column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnAttribute(column, columnWidth, columnHeight, columnColor); - auto textShow2 = nodeAPI->createNode(ARKUI_NODE_TEXT); - Manager::CreateNode(textShow2); - nodeAPI->addChild(column, textShow2); - auto list = nodeAPI->createNode(ARKUI_NODE_LIST); - columnHeight = COLUMN_SIZE; - SetColumnAttribute(list, columnWidth, columnHeight, columnColor); - nodeAPI->addChild(column, list); - CreateSimpleGesture(list); - CreateDifferentDirectionPanGesture(list); - CreateGestureGroupByMode(list); - auto childRow12 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAttribute(childRow12); - auto text23 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text23, "JudgeBeginTest"); - auto text24 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text24, "PanGestureWithDistanceMap"); - auto text25 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(text25, "TestGestureRemove"); - nodeAPI->addChild(childRow12, text23); - nodeAPI->addChild(childRow12, text24); - nodeAPI->addChild(list, childRow12); - nodeAPI->addChild(list, text25); - OH_NativeXComponent_AttachNativeRootNode(component, column); - Manager::SetGestureJudgeBegin(text23); - Manager::SetPanGestureWithDistanceMap(text24); - Manager::TestGestureRemove(text25); -} - -napi_value Manager::CreateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - if (argCnt < 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_GESTURE, ArkUI_NativeGestureAPI_1, gestureApi); - - if (nodeAPI != nullptr) { - if (nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { - BindingGesture(env, args[1], component); - } - } - return nullptr; -} - -napi_value Manager::UpdateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode env or info is null"); - return nullptr; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "UpdateNativeNode 1111"); - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "CreateNativeNode %{public}s", idStr); - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - - if ((env == nullptr) || (info == nullptr || component == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - return nullptr; -} - -napi_value Manager::GetContext(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_number) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - int64_t value; - if (napi_get_value_int64(env, args[0], &value) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_create_object failed"); - return nullptr; - } - - return exports; -} - -void Manager::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", - "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto manager = Manager::GetInstance(); - if ((manager != nullptr) && (nativeXComponent != nullptr)) { - manager->SetNativeXComponent(id, nativeXComponent); - } -} - -void Manager::SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent) -{ - if (nativeXComponent == nullptr) { - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent *tmp = nativeXComponentMap_[id]; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -OH_NativeXComponent *Manager::GetNativeXComponent(const std::string &id) { return nativeXComponentMap_[id]; } -} // namespace NativeXComponentSample \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/manager.h b/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/manager.h deleted file mode 100644 index a828f00258508d53fd26e0ff3ae75c4fd327d1d0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "container.h" -namespace NativeXComponentSample { -const int MAX_SIZE = 11; -class Manager { -public: - ~Manager(); - - static Manager *GetInstance() { return &Manager::manager_; } - - static napi_value GetContext(napi_env env, napi_callback_info info); - static napi_value CreateNativeNode(napi_env env, napi_callback_info info); - static napi_value UpdateNativeNode(napi_env env, napi_callback_info info); - - void SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent); - OH_NativeXComponent *GetNativeXComponent(const std::string &id); - - void Export(napi_env env, napi_value exports); - static void CreateNode(ArkUI_NodeHandle& textShow2); - static void SetTapGesture(ArkUI_NodeHandle &column); - static void SetPanGestureWithDirection(ArkUI_NodeHandle &column, ArkUI_GestureDirection direction); - static void SetLongPressGesture(ArkUI_NodeHandle &column); - static void SetPinchGesture(ArkUI_NodeHandle &column); - static void SetRotationGesture(ArkUI_NodeHandle &column); - static void SetSwipeGesture(ArkUI_NodeHandle &column); - static void SetTapGestureWithDistance(ArkUI_NodeHandle &column); - static void CreateGestureGroup(ArkUI_NodeHandle &column, ArkUI_GroupGestureMode mode); - static void CreateGestureWithMask(ArkUI_NodeHandle &column, ArkUI_GestureMask mask); - static void CreateGestureWithPriority(ArkUI_NodeHandle &column, ArkUI_GesturePriority priority); - static void SetMultiGesture(ArkUI_NodeHandle &column); - static void SetGestureJudgeBegin(ArkUI_NodeHandle node); - static void SetPanGestureWithDistanceMap(ArkUI_NodeHandle &column); - static void TestGestureRemove(ArkUI_NodeHandle node); - -private: - static Manager manager_; - - std::unordered_map nativeXComponentMap_; - std::unordered_map containerMap_; - ArkUI_NodeHandle button_; - ArkUI_NodeHandle textShow_; - ArkUI_NodeHandle textShow2_; - ArkUI_GestureRecognizerType list_[3] = {TAP_GESTURE, LONG_PRESS_GESTURE, PAN_GESTURE}; - int32_t index_ = 0; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index f4fb7fabbc60dffb99d41d578848f7fb0b50c5a6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index e44f3615a4767c36b4fdc841b781af96bf1971a8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index ea410725a8826704d061021d98cf02aa76cd8016..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NdkGestureSetting/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index c5539bddd7a772710f55da0ddd7b5676305469de..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureSetting/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NdkGestureSetting/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureSetting/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NdkGestureSetting/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 6560719a55939151721c0479faf9e3e2f0c51906..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libnativeNode.so'; -import image from '@ohos.multimedia.image'; - -@Entry -@Component -struct Xcomponent { - build() { - Column() { - XComponent({ - id: 'dragStart', - type: XComponentType.NODE, - libraryname: 'nativeNode' - }) - .onAppear(() => { - nativeNode.createNativeNode("dragStart", this.getUIContext()); - }) - .width('100%') - .height(700) - .backgroundColor('#FFFAFA') - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/module.json5 b/ArkUIKit/NdkGestureSetting/entry/src/main/module.json5 deleted file mode 100644 index f09d09a7bc661e848418aaf40ba4506a86649bb1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/element/color.json b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/element/string.json b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e768d0e6629106145080e316afa02eb4a696c1a0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkGestureBlocking" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/background.png b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index e768d0e6629106145080e316afa02eb4a696c1a0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkGestureBlocking" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NdkGestureSetting/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 721b0bf9e9932d28e6a5eb61ade0ebd4372ff379..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkGestureBlocking" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/mock/Libentry.mock.ets b/ArkUIKit/NdkGestureSetting/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index eebf1ed910f6a8f2a9e7e565aa71b179b7b8b537..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/mock/mock-config.json5 b/ArkUIKit/NdkGestureSetting/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 7c16bc08c6fb53175fcdc9d628a4d6a9b34bef4c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import IndexTest from './index.test'; - -export default function testsuite() { - abilityTest(); - IndexTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/ets/test/index.test.ets b/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/ets/test/index.test.ets deleted file mode 100644 index ad5c1cdd2ff15a1cc9045c1167061a7f97221c3d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/ets/test/index.test.ets +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect, beforeAll } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON, MouseButton, Component, MatchPattern } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -export default function IndexTest() { - - describe('IndexTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - /** - * @tc.number UiTest_001 - * @tc.name testTapGesture - * @tc.desc 测试点击手势示例 - */ - it('testTapGesture', 0, async (done: Function) => { - console.info('uitest: testTapGesture begin'); - let driver = Driver.create(); - let button = await driver.findComponent(ON.text('TapGesture', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('tapGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testTapGesture end'); - done(); - }) - - /** - * @tc.number UiTest_002 - * @tc.name testLongPressGesture - * @tc.desc 测试长按手势示例 - */ - it('testLongPressGesture', 0, async (done: Function) => { - console.info('uitest: testLongPressGesture begin'); - let driver = Driver.create(); - let button = await driver.findComponent(ON.text('LongPressGesture', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.longClick(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('longPressGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testLongPressGesture end'); - done(); - }) - - /** - * @tc.number UiTest_003 - * @tc.name testPanGesture - * @tc.desc 测试滑动手势示例 - */ - it('testPanGesture', 0, async (done: Function) => { - console.info('uitest: testPanGesture begin'); - let driver = Driver.create(); - let button = await driver.findComponent(ON.text('PanGesture', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await driver.swipe(200, 600, 250, 600, 1000); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('panGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testPanGesture end'); - done(); - }) - - /** - * @tc.number UiTest_004 - * @tc.name testPinchGesture - * @tc.desc 测试捏合手势示例 - */ - it('testPinchGesture', 0, async (done: Function) => { - console.info('uitest: testPinchGesture begin'); - let driver = Driver.create(); - let button = await driver.findComponent(ON.text('PinchGesture', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.pinchIn(0.5); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('pinchGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testPinchGesture end'); - done(); - }) - - /** - * @tc.number UiTest_005 - * @tc.name testSwipeGesture - * @tc.desc 测试快滑手势示例 - */ - it('testSwipeGesture', 0, async (done: Function) => { - console.info('uitest: testSwipeGesture begin'); - let driver = Driver.create(); - let button = await driver.findComponent(ON.text('SwipeGesture', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await driver.swipe(500, 800, 650, 800, 2000); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('swipeGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testSwipeGesture end'); - done(); - }) - - /** - * @tc.number UiTest_006 - * @tc.name testTapGestureWithDistance - * @tc.desc 测试带距离阈值的点击手势示例 - */ - it('testTapGestureWithDistance', 0, async (done: Function) => { - console.info('uitest: testTapGestureWithDistance begin'); - let driver = Driver.create(); - let button = await driver.findComponent(ON.text('TapGestureWithDistance', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('createTapGestureWithDistanceThreshold is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testTapGestureWithDistance end'); - done(); - }) - - /** - * @tc.number UiTest_007 - * @tc.name testHorizontalPanGesture - * @tc.desc 测试水平方向的滑动手势示例 - */ - it('testHorizontalPanGesture', 0, async (done: Function) => { - console.info('uitest: testHorizontalPanGesture begin'); - let driver = Driver.create(); - let button = await driver.findComponent(ON.text('Pan-Horizontal', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await driver.swipe(500, 1000, 650, 1000, 2000); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('panGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testHorizontalPanGesture end'); - done(); - }) - - /** - * @tc.number UiTest_008 - * @tc.name testVerticalPanGesture - * @tc.desc 测试垂直方向的滑动手势示例 - */ - it('testVerticalPanGesture', 0, async (done: Function) => { - console.info('uitest: testVerticalPanGesture begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Pan-Vertical', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await driver.swipe(200, 400, 200, 450, 1000); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('panGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testVerticalPanGesture end'); - done(); - }) - - /** - * @tc.number UiTest_009 - * @tc.name testLeftPanGesture - * @tc.desc 测试左方向的滑动手势示例 - */ - it('testLeftPanGesture', 0, async (done: Function) => { - console.info('uitest: testLeftPanGesture begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Pan-Left', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await driver.swipe(600, 400, 500, 450, 1000); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('panGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testLeftPanGesture end'); - done(); - }) - - /** - * @tc.number UiTest_010 - * @tc.name testRightPanGesture - * @tc.desc 测试右方向的滑动手势示例 - */ - it('testRightPanGesture', 0, async (done: Function) => { - console.info('uitest: testRightPanGesture begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Pan-Right', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await driver.swipe(200, 600, 250, 600, 1000); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('panGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testRightPanGesture end'); - done(); - }) - - /** - * @tc.number UiTest_011 - * @tc.name testUpPanGesture - * @tc.desc 测试上方向的滑动手势示例 - */ - it('testUpPanGesture', 0, async (done: Function) => { - console.info('uitest: testUpPanGesture begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Pan-Up', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await driver.swipe(600, 600, 600, 550, 1000); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('panGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testUpPanGesture end'); - done(); - }) - - /** - * @tc.number UiTest_012 - * @tc.name testDownPanGesture - * @tc.desc 测试下方向的滑动手势示例 - */ - it('testDownPanGesture', 0, async (done: Function) => { - console.info('uitest: testDownPanGesture begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Pan-Down', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await driver.swipe(200, 800, 200, 850, 1000); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('panGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testDownPanGesture end'); - done(); - }) - - /** - * @tc.number UiTest_013 - * @tc.name testVerticalPanGesture - * @tc.desc 测试互斥手势组示例 - */ - it('testExclusiveGroup', 0, async (done: Function) => { - console.info('uitest: testExclusiveGroup begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Group-Exclusive', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.longClick(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('longPressGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testExclusiveGroup end'); - done(); - }) - - /** - * @tc.number UiTest_014 - * @tc.name testParallelGroup - * @tc.desc 测试并行手势组示例 - */ - it('testParallelGroup', 0, async (done: Function) => { - console.info('uitest: testParallelGroup begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Group-Parallel', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.longClick(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('longPressGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testParallelGroup end'); - done(); - }) - - /** - * @tc.number UiTest_015 - * @tc.name testNormalMask - * @tc.desc 测试普通响应方式示例 - */ - it('testNormalMask', 0, async (done: Function) => { - console.info('uitest: testNormalMask begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('NORMAL_GESTURE_MASK', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('tapGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testNormalMask end'); - done(); - }) - - /** - * @tc.number UiTest_016 - * @tc.name testIgnoreInternalMask - * @tc.desc 测试忽略子组件响应方式示例 - */ - it('testIgnoreInternalMask', 0, async (done: Function) => { - console.info('uitest: testIgnoreInternalMask begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('IGNORE_INTERNAL_GESTURE_MASK', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('tapGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testIgnoreInternalMask end'); - done(); - }) - - /** - * @tc.number UiTest_017 - * @tc.name testNormalPriority - * @tc.desc 测试普通优先级手势示例 - */ - it('testNormalPriority', 0, async (done: Function) => { - console.info('uitest: testNormalPriority begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Priority-Normal', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('tapGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testNormalPriority end'); - done(); - }) - - /** - * @tc.number UiTest_018 - * @tc.name testParallelPriority - * @tc.desc 测试并行优先级手势示例 - */ - it('testParallelPriority', 0, async (done: Function) => { - console.info('uitest: testParallelPriority begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Priority-Parallel', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('tapGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testParallelPriority end'); - done(); - }) - - /** - * @tc.number UiTest_019 - * @tc.name testHighPriority - * @tc.desc 测试高优先级手势示例 - */ - it('testHighPriority', 0, async (done: Function) => { - console.info('uitest: testHighPriority begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('Priority-Priority', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('tapGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testHighPriority end'); - done(); - }) - - /** - * @tc.number UiTest_020 - * @tc.name testJudgeBegin - * @tc.desc 测试自定义手势判断示例 - */ - it('testJudgeBegin', 0, async (done: Function) => { - console.info('uitest: testJudgeBegin begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 500, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('JudgeBeginTest', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await button.click(); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('tapGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testJudgeBegin end'); - done(); - }) - - /** - * @tc.number UiTest_021 - * @tc.name testPanGestureWithDistanceMap - * @tc.desc 测试滑动手势设置滑动阈值表示例 - */ - it('testPanGestureWithDistanceMap', 0, async (done: Function) => { - console.info('uitest: testPanGestureWithDistanceMap begin'); - let driver = Driver.create(); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 350, 2000); - await driver.delayMs(1000); - await driver.swipe(200, 1000, 250, 500, 2000); - await driver.delayMs(1000); - let button = await driver.findComponent(ON.text('PanGestureWithDistanceMap', MatchPattern.CONTAINS)); - expect(button === null).assertFalse(); - await driver.swipe(600, 800, 600, 850, 1000); - await driver.delayMs(1000); - let result = await driver.findComponent(ON.text('panGesture is called', MatchPattern.CONTAINS)); - expect(result === null).assertFalse(); - await driver.delayMs(1000); - console.info('uitest: testPanGestureWithDistanceMap end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/module.json5 b/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NdkGestureSetting/entry/src/test/List.test.ets b/ArkUIKit/NdkGestureSetting/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NdkGestureSetting/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/hvigor/hvigor-config.json5 b/ArkUIKit/NdkGestureSetting/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureSetting/hvigorfile.ts b/ArkUIKit/NdkGestureSetting/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkGestureSetting/oh-package.json5 b/ArkUIKit/NdkGestureSetting/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/NdkGestureSetting/ohosTest.md b/ArkUIKit/NdkGestureSetting/ohosTest.md deleted file mode 100644 index 50cababf0214997b2f4ffc1cd29630451bc7957d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkGestureSetting/ohosTest.md +++ /dev/null @@ -1,27 +0,0 @@ -# NdkGestureSetting 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------------- | -------------- |---------------------------------------|----------| :------- | -------- | -| 测试点击手势示例 | 设备正常运行 | 进入首页,点击TapGesture文本 | 文本点击正常响应 | 是 | Pass | -| 测试长按手势示例 | 设备正常运行 | 进入首页,长按LongPressGesture文本 | 文本长按正常响应 | 是 | Pass | -| 测试滑动手势示例 | 设备正常运行 | 进入首页,滑动PanGesture文本 | 文本滑动正常响应 | 是 | Pass | -| 测试捏合手势示例 | 设备正常运行 | 进入首页,捏合PinchGesture文本 | 文本捏合正常响应 | 是 | Pass | -| 测试快滑手势示例 | 设备正常运行 | 进入首页,快滑SwipeGesture文本 | 文本快滑正常响应 | 是 | Pass | -| 测试带距离阈值的点击手势示例 | 设备正常运行 | 进入首页,点击TapGestureWithDistance文本 | 文本点击正常响应 | 是 | Pass | -| 测试水平方向的滑动手势示例 | 设备正常运行 | 进入首页,滑动Pan-Horizontal文本 | 文本滑动正常响应 | 是 | Pass | -| 测试垂直方向的滑动手势示例 | 设备正常运行 | 进入首页,滑动Pan-Vertical文本 | 文本滑动正常响应 | 是 | Pass | -| 测试左方向的滑动手势示例 | 设备正常运行 | 进入首页,滑动Pan-Left文本 | 文本滑动正常响应 | 是 | Pass | -| 测试右方向的滑动手势示例 | 设备正常运行 | 进入首页,滑动Pan-Right文本 | 文本滑动正常响应 | 是 | Pass | -| 测试上方向的滑动手势示例 | 设备正常运行 | 进入首页,滑动Pan-Up文本 | 文本滑动正常响应 | 是 | Pass | -| 测试下方向的滑动手势示例 | 设备正常运行 | 进入首页,滑动Pan-Down文本 | 文本滑动正常响应 | 是 | Pass | -| 测试互斥手势组示例 | 设备正常运行 | 进入首页,长按Group-Exclusive文本 | 文本长按正常响应 | 是 | Pass | -| 测试并行手势组示例 | 设备正常运行 | 进入首页,长按Group-Parallel文本 | 文本长按正常响应 | 是 | Pass | -| 测试普通响应方式示例 | 设备正常运行 | 进入首页,点击NORMAL_GESTURE_MASK文本 | 文本点击正常响应 | 是 | Pass | -| 测试忽略子组件响应方式示例 | 设备正常运行 | 进入首页,点击IGNORE_INTERNAL_GESTURE_MASK文本 | 文本点击正常响应 | 是 | Pass | -| 测试普通优先级手势示例 | 设备正常运行 | 进入首页,点击Priority-Normal文本 | 文本点击正常响应 | 是 | Pass | -| 测试并行优先级手势示例 | 设备正常运行 | 进入首页,点击Priority-Parallel文本 | 文本点击正常响应 | 是 | Pass | -| 测试高优先级手势示例 | 设备正常运行 | 进入首页,点击Priority-Priority文本 | 文本点击正常响应 | 是 | Pass | -| 测试自定义手势判断示例 | 设备正常运行 | 进入首页,点击JudgeBeginTest文本 | 文本点击正常响应 | 是 | Pass | -| 测试滑动手势设置滑动阈值表示例 | 设备正常运行 | 进入首页,滑动PanGestureWithDistanceMap文本 | 文本滑动正常响应 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/screenshots/device/image1.png b/ArkUIKit/NdkGestureSetting/screenshots/device/image1.png deleted file mode 100644 index db0e8e8deb39f3c9550ffb5b9de340c12a8acb5d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkGestureSetting/screenshots/device/image1.png and /dev/null differ diff --git a/ArkUIKit/NdkInputEvent/.gitignore b/ArkUIKit/NdkInputEvent/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NdkInputEvent/AppScope/app.json5 b/ArkUIKit/NdkInputEvent/AppScope/app.json5 deleted file mode 100644 index 732f1ea03e55488eed49d512371bd2e044068c63..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.sample.ndk_input_event", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NdkInputEvent/AppScope/resources/base/element/string.json b/ArkUIKit/NdkInputEvent/AppScope/resources/base/element/string.json deleted file mode 100644 index 1080233f01384411ec684b58955cb8808746fdd3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - } - ] -} diff --git a/ArkUIKit/NdkInputEvent/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NdkInputEvent/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkInputEvent/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NdkInputEvent/README_zh.md b/ArkUIKit/NdkInputEvent/README_zh.md deleted file mode 100644 index ace2aa3758fdae94343ee49eeaf3530686debd08..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/README_zh.md +++ /dev/null @@ -1,67 +0,0 @@ -# ArkUI指南文档示例 - -### 介绍 - -本示例通过使用[ArkUI指南文档](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/reference)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [输入事件C-API参考](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-ui-input-event-h.md)。 -### 效果预览 - -| 首页 | -|------------------------------------| -| ![](screenshots/device/image1.jpg) | - -### 使用说明 - -1. 在首页可以查看多种输入事件API的使用示例,包括单点或多点触摸事件、鼠标事件、轴事件、焦点轴事件的示例。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -entry/src/main/ets/ -|---cpp -| |---types -| |---CMakeLists.txt -| |---common.h -| |---container.cpp -| |---container.h -| |---function.h // 输入事件示例代码 -| |---init.cpp -| |---manager.cpp // 示例入口 -| |---manager.h // manager头文件 -| |---napi_init.cpp -|---ets -| |---pages -| | |---Index.ets // 应用主页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例支持仅标准系统上运行,支持设备:华为手机、华为平板。 - -2.HarmonyOS系统:HarmonyOS 6.0.0 Beta3版本及以上。 - -3.DevEco Studio版本:DevEco Studio 6.0.0 Beta3版本及以上。 - -4.HarmonyOS SDK版本:HarmonyOS 6.0.0 Beta3 SDK版本及以上。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo ArkUIKit/NdkInputEvent > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -```` \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/build-profile.json5 b/ArkUIKit/NdkInputEvent/build-profile.json5 deleted file mode 100644 index 1a4efe780afd7fdb22c76ae2f927496b12c2cf07..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/code-linter.json5 b/ArkUIKit/NdkInputEvent/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/.gitignore b/ArkUIKit/NdkInputEvent/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/build-profile.json5 b/ArkUIKit/NdkInputEvent/entry/build-profile.json5 deleted file mode 100644 index fea31f4580540c7c560b62bf531292c471c410f1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/hvigorfile.ts b/ArkUIKit/NdkInputEvent/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkInputEvent/entry/obfuscation-rules.txt b/ArkUIKit/NdkInputEvent/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NdkInputEvent/entry/oh-package.json5 b/ArkUIKit/NdkInputEvent/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 3a47dad1bd66b4a46b8a39b4deb3e554f78243e6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(MyApplication) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(nativeNode SHARED init.cpp manager.cpp container.cpp) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libnative_drawing.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so libpixelmap.so) -target_link_libraries(nativeNode PUBLIC libudmf.so) \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/common.h b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/common.h deleted file mode 100644 index 8dc603fe057c31515105088f23e7a450b7811fa4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/common.h +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef DRAGANDDROP_COMMON_H -#define DRAGANDDROP_COMMON_H - -#include "container.h" -#include -#include -#include -#include - -#define DEFAULT_WIDTH 200.0 -#define DEFAULT_HEIGHT 200.0 -#define DEFAULT_BG_COLOR 0xFFFFFFFF -#define DEFAULT_BORDER_WIDTH 0.0 -#define BORDER_WIDTH_1 1.0 -#define DEFAULT_MARGIN 5.0 -#define DEFAULT_BORDER_COLOR 0xFF000000 -#define DEFAULT_RADIUS 10.0 - -#define SIZE_200 200 -#define SIZE_300 300 -#define BLANK_10 10.0 - -#define DEFAULT_TEXT_FONT_SIZE 12 -#define TEXT_FONT_SIZE_15 15 -#define TEXT_FONT_SIZE_20 20 - -#define BUTTON_LENGTH 10 -#define MAX_LENGTH 128 - -namespace NativeXComponentSample { - -ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; -ArkUI_ContextHandle context; -enum ArkUIModifierKeyName { - ARKUI_MODIFIER_KEY_CTRL = 1 << 0, // Ctrl 键 - ARKUI_MODIFIER_KEY_SHIFT = 1 << 1, // Shift 键 - ARKUI_MODIFIER_KEY_ALT = 1 << 2, // Alt 键 - ARKUI_MODIFIER_KEY_FN = 1 << 3 // Fn 键(如适用) -}; - -std::stringstream g_ss; - -void SetWidth(ArkUI_NodeHandle &node, float width = DEFAULT_WIDTH) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue widthValue[] = {width}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - nodeAPI->setAttribute(node, NODE_WIDTH, &widthItem); -} - -void SetWidthPercent(ArkUI_NodeHandle &node, float width = 1) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue widthValue[] = {width}; - ArkUI_AttributeItem widthItem = {widthValue, 1}; - nodeAPI->setAttribute(node, NODE_WIDTH_PERCENT, &widthItem); -} - -void SetHeight(ArkUI_NodeHandle &node, float height = DEFAULT_HEIGHT) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue heightValue[] = {height}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - nodeAPI->setAttribute(node, NODE_HEIGHT, &heightItem); -} - -void SetHeightPercent(ArkUI_NodeHandle &node, float height = 1) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue heightValue[] = {height}; - ArkUI_AttributeItem heightItem = {heightValue, 1}; - nodeAPI->setAttribute(node, NODE_HEIGHT_PERCENT, &heightItem); -} - -void SetBackgroundColor(ArkUI_NodeHandle &node, uint32_t color = DEFAULT_BG_COLOR) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue colorValue[] = {{.u32 = color}}; - ArkUI_AttributeItem colorItem = {colorValue, 1}; - nodeAPI->setAttribute(node, NODE_BACKGROUND_COLOR, &colorItem); -} - -void SetMargin(ArkUI_NodeHandle &node, float margin = DEFAULT_MARGIN) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue marginValue[] = {margin}; - ArkUI_AttributeItem marginItem = {marginValue, 1}; - nodeAPI->setAttribute(node, NODE_MARGIN, &marginItem); -} - -void SetPadding(ArkUI_NodeHandle &node, float padding) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue paddingValue[] = {padding}; - ArkUI_AttributeItem paddingItem = {paddingValue, 1}; - nodeAPI->setAttribute(node, NODE_PADDING, &paddingItem); -} - -void SetBorderWidth(ArkUI_NodeHandle &node, float width = DEFAULT_BORDER_WIDTH) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue borderWidthValue[] = {width}; - ArkUI_AttributeItem borderWidthItem = {borderWidthValue, 1}; - nodeAPI->setAttribute(node, NODE_BORDER_WIDTH, &borderWidthItem); -} - -void SetBorderColor(ArkUI_NodeHandle &node, uint32_t color = DEFAULT_BORDER_COLOR) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue borderColorValue[] = {{.u32 = color}}; - ArkUI_AttributeItem borderColorItem = {borderColorValue, 1}; - nodeAPI->setAttribute(node, NODE_BORDER_COLOR, &borderColorItem); -} - -void SetBorderStyle(ArkUI_NodeHandle &node, int32_t style = ARKUI_BORDER_STYLE_DASHED, float radius = 10.0) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue borderStyleValue[] = {{.i32 = style}}; - ArkUI_AttributeItem borderStyleItem = {borderStyleValue, 1}; - nodeAPI->setAttribute(node, NODE_BORDER_STYLE, &borderStyleItem); - - ArkUI_NumberValue borderRadiusValue[] = {{.f32 = radius}}; - ArkUI_AttributeItem borderRadiusItem = {borderRadiusValue, 1}; - nodeAPI->setAttribute(node, NODE_BORDER_RADIUS, &borderRadiusItem); -} - -void SetText(ArkUI_NodeHandle &node, const char *str, float size = DEFAULT_TEXT_FONT_SIZE) -{ - if (!nodeAPI) { - return; - } - ArkUI_AttributeItem textValueItem = {.string = str}; - ArkUI_NumberValue fontSize[] = {size}; - ArkUI_AttributeItem fontItem = {fontSize, 1}; - nodeAPI->setAttribute(node, NODE_TEXT_CONTENT, &textValueItem); - nodeAPI->setAttribute(node, NODE_TEXT_FONT, &fontItem); -} - -void SetImageSrc(ArkUI_NodeHandle &node, const char *src) -{ - if (!nodeAPI) { - return; - } - ArkUI_AttributeItem imageSrcItem = {.string = src}; - nodeAPI->setAttribute(node, NODE_IMAGE_SRC, &imageSrcItem); -} - -void SetCommonAttribute(ArkUI_NodeHandle &node, float width = DEFAULT_WIDTH, float height = DEFAULT_HEIGHT, - unsigned int color = DEFAULT_BG_COLOR, float margin = DEFAULT_MARGIN) -{ - SetWidth(node, width); - SetHeight(node, height); - SetBackgroundColor(node, color); - SetMargin(node, margin); - SetBorderWidth(node, DEFAULT_BORDER_WIDTH); - SetBorderColor(node); -} - -void SetCommonPercentAttribute(ArkUI_NodeHandle &node, float width = 1, float height = 1, - unsigned int color = DEFAULT_BG_COLOR, float margin = DEFAULT_MARGIN) -{ - SetWidthPercent(node, width); - SetHeightPercent(node, height); - SetBackgroundColor(node, color); - SetMargin(node, margin); - SetBorderWidth(node, DEFAULT_BORDER_WIDTH); - SetBorderColor(node); -} - -void SetTextAttribute(ArkUI_NodeHandle &node, const char *str, float size = DEFAULT_TEXT_FONT_SIZE, - float width = DEFAULT_WIDTH, float height = DEFAULT_HEIGHT) -{ - SetCommonAttribute(node, width, height, 0); - SetText(node, str, size); -} - -void SetColumnJustifyContent(ArkUI_NodeHandle &node, int32_t alignment) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue justifyValue[] = {{.i32 = alignment}}; - ArkUI_AttributeItem justifyItem = {justifyValue, 1}; - nodeAPI->setAttribute(node, NODE_COLUMN_JUSTIFY_CONTENT, &justifyItem); -} - -void SetColumnAlignItem(ArkUI_NodeHandle &node, int32_t alignment) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue alignValue[] = {{.i32 = alignment}}; - ArkUI_AttributeItem alignItem = {alignValue, 1}; - nodeAPI->setAttribute(node, NODE_COLUMN_ALIGN_ITEMS, &alignItem); -} - -void SetRowJustifyContent(ArkUI_NodeHandle &node, int32_t alignment) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue justifyValue[] = {{.i32 = alignment}}; - ArkUI_AttributeItem justifyItem = {justifyValue, 1}; - nodeAPI->setAttribute(node, NODE_ROW_JUSTIFY_CONTENT, &justifyItem); -} - -void SetRowAlignItem(ArkUI_NodeHandle &node, int32_t alignment) -{ - if (!nodeAPI) { - return; - } - ArkUI_NumberValue alignValue[] = {{.i32 = alignment}}; - ArkUI_AttributeItem alignItem = {alignValue, 1}; - nodeAPI->setAttribute(node, NODE_ROW_ALIGN_ITEMS, &alignItem); -} - -void SetButtonLabel(ArkUI_NodeHandle &node, const char *label) -{ - if (!nodeAPI) { - return; - } - ArkUI_AttributeItem NODE_Button_SRC_Item = {.string = label}; - nodeAPI->setAttribute(node, NODE_BUTTON_LABEL, &NODE_Button_SRC_Item); -} - -void SetId(ArkUI_NodeHandle &node, const char *id) -{ - if (!nodeAPI) { - return; - } - ArkUI_AttributeItem idItem = {.string = id}; - nodeAPI->setAttribute(node, NODE_ID, &idItem); -} - -} // namespace NativeXComponentSample - -#endif // DRAGANDDROP_COMMON_H \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/container.cpp b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/container.cpp deleted file mode 100644 index 080da8a0be18ae16434b854e5ee0995d3a17c528..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/container.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include - -#include -#include -#include - -#include "container.h" - -namespace NativeXComponentSample { - namespace { - void OnSurfaceCreatedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - } - - void OnSurfaceChangedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChangedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "surface changed"); - } - } - - void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container::Release(id); - } - - void DispatchTouchEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container *render = Container::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } - } - - void DispatchMouseEventCB(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchMouseEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = Container::GetInstance(id); - if (render != nullptr) { - render->OnMouseEvent(component, window); - } - } - - - void DispatchHoverEventCB(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchHoverEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnHoverEvent(component, isHover); - } - } - } // namespace - - std::unordered_map Container::instance_; - - Container::Container(const std::string &id) - { - this->id_ = id; - } - - Container *Container::GetInstance(const std::string &id) - { - if (instance_.find(id) == instance_.end()) { - Container *instance = new Container(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } - } - - void Container::Release(const std::string &id) - { - Container *render = Container::GetInstance(id); - if (render != nullptr) { - } - } - - void Container::OnSurfaceChanged(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "OnSurfaceChanged: Unable to get XComponent id"); - return; - } - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OH_NativeXComponent_GetXComponentOffset", - "offsetX = %{public}lf, offsetY = %{public}lf", offsetX, offsetY); - uint64_t width; - uint64_t height; - OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - } - - void Container::OnTouchEvent(OH_NativeXComponent *component, void *window) - { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", - "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - std::string id(idStr); - Container *container = Container::GetInstance(id); - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, - tiltY); - } - - void Container::RegisterCallback(OH_NativeXComponent *nativeXComponent) - { - containerCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - containerCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - containerCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - containerCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &containerCallback_); - - mouseCallback_.DispatchMouseEvent = DispatchMouseEventCB; - mouseCallback_.DispatchHoverEvent = DispatchHoverEventCB; - OH_NativeXComponent_RegisterMouseEventCallback(nativeXComponent, &mouseCallback_); - OH_NativeXComponent_RegisterOnTouchInterceptCallback( - nativeXComponent, [](OH_NativeXComponent *, ArkUI_UIInputEvent *) -> HitTestMode { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "callback", - "OH_NativeXComponent_RegisterOnTouchInterceptCallback"); - return HitTestMode::HTM_TRANSPARENT; - }); - } - - void Container::OnMouseEvent(OH_NativeXComponent *component, void *window) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnMouseEvent"); - OH_NativeXComponent_MouseEvent mouseEvent; - int32_t ret = OH_NativeXComponent_GetMouseEvent(component, window, &mouseEvent); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", - "MouseEvent Info: x = %{public}f, y = %{public}f, action = %{public}d, button = %{public}d", - mouseEvent.x, mouseEvent.y, mouseEvent.action, mouseEvent.button); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Container", "GetMouseEvent error"); - } - } - - void Container::OnHoverEvent(OH_NativeXComponent *component, bool isHover) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnHoverEvent isHover_ = %{public}d", isHover); - } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/container.h b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/container.h deleted file mode 100644 index 4d2c090ad0ef3632520a3097ff79ee722bf88662..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/container.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MY_APPLICATION_CONTAINER_H -#define MY_APPLICATION_CONTAINER_H - -#include -#include - -#include -#include - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -namespace NativeXComponentSample { - - class Container { - public: - explicit Container(const std::string &id); - ~Container() = default; - static Container *GetInstance(const std::string &id); - static void Release(const std::string &id); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent *component, void *window); - void OnTouchEvent(OH_NativeXComponent *component, void *window); - void OnMouseEvent(OH_NativeXComponent *component, void *window); - void OnHoverEvent(OH_NativeXComponent *component, bool isHover); - void OnKeyEvent(OH_NativeXComponent *component, void *window); - void RegisterCallback(OH_NativeXComponent *nativeXComponent); - - public: - static std::unordered_map instance_; - std::string id_; - - private: - OH_NativeXComponent_Callback containerCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; - }; - -} // namespace NativeXComponentSample -#endif // MY_APPLICATION_CONTAINER_H diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/function.h b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/function.h deleted file mode 100644 index 137c8db9310141eaba8220fbce924ea7cdaf9563..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/function.h +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NDKINPUTEVENT_FUNCTION_H -#define NDKINPUTEVENT_FUNCTION_H - -#include "common.h" -#include "container.h" -#include -#include -#include -#include -#include - -namespace NativeXComponentSample { - -ArkUI_NodeHandle column1; -ArkUI_NodeHandle infoText = nullptr; -ArkUI_NodeHandle titleText = nullptr; - -void PrintMultiHistoryInfos(ArkUI_UIInputEvent* inputEvent, uint32_t pointerIndex) -{ - auto size = OH_ArkUI_PointerEvent_GetHistorySize(inputEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "%{public}d: historySize = %{public}d", pointerIndex, size); - for (int historyIndex = 0; historyIndex < size; historyIndex++) { - auto time = OH_ArkUI_PointerEvent_GetHistoryEventTime(inputEvent, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyEventTime = %{public}ld", time); - auto pointerCount = OH_ArkUI_PointerEvent_GetHistoryPointerCount(inputEvent, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyPointerCount = %{public}d", pointerCount); - auto pointerId = OH_ArkUI_PointerEvent_GetHistoryPointerId(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyPointerId = %{public}d", pointerId); - auto historyX = OH_ArkUI_PointerEvent_GetHistoryX(inputEvent, pointerIndex, historyIndex); - auto historyY = OH_ArkUI_PointerEvent_GetHistoryY(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyX/Y = %{public}f/%{public}f", historyX, historyY); - auto historyWindowX = OH_ArkUI_PointerEvent_GetHistoryWindowX(inputEvent, pointerIndex, historyIndex); - auto historyWindowY = OH_ArkUI_PointerEvent_GetHistoryWindowY(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyWindowX/Y = %{public}f/%{public}f", historyWindowX, historyWindowY); - auto historyDisplayX = OH_ArkUI_PointerEvent_GetHistoryDisplayX(inputEvent, pointerIndex, historyIndex); - auto historyDisplayY = OH_ArkUI_PointerEvent_GetHistoryDisplayY(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyDisplayX/Y = %{public}f/%{public}f", historyDisplayX, historyDisplayY); - auto historyGlobalDisplayX = OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayX(inputEvent, - pointerIndex, historyIndex); - auto historyGlobalDisplayY = OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayY(inputEvent, - pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyGlobalDisplayX/Y = %{public}f/%{public}f", historyGlobalDisplayX, historyGlobalDisplayY); - auto historyPressure = OH_ArkUI_PointerEvent_GetHistoryPressure(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyPressure = %{public}f", historyPressure); - auto historyTiltX = OH_ArkUI_PointerEvent_GetHistoryTiltX(inputEvent, pointerIndex, historyIndex); - auto historyTiltY = OH_ArkUI_PointerEvent_GetHistoryTiltY(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyTiltX/Y = %{public}f/%{public}f", historyTiltX, historyTiltY); - auto historyTouchAreaWidth = OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth(inputEvent, - pointerIndex, historyIndex); - auto historyTouchAreaHeight = OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight(inputEvent, - pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyTouchAreaWidth/Height = %{public}f/%{public}f", historyTouchAreaWidth, historyTouchAreaHeight); - } -} - -void ShowMultiInfos(ArkUI_UIInputEvent* inputEvent) -{ - g_ss.str(""); - uint32_t pointerIndex = 0; - OH_ArkUI_PointerEvent_GetChangedPointerId(inputEvent, &pointerIndex); - g_ss << "pointerIndex: " << pointerIndex << std::endl; - auto id = OH_ArkUI_PointerEvent_GetPointerId(inputEvent, pointerIndex); - g_ss << "pointerId: " << id << std::endl; - auto pressedTime = OH_ArkUI_PointerEvent_GetPressedTimeByIndex(inputEvent, pointerIndex); - g_ss << "pressedTime: " << pressedTime << std::endl; - auto x = OH_ArkUI_PointerEvent_GetXByIndex(inputEvent, pointerIndex); - auto y = OH_ArkUI_PointerEvent_GetYByIndex(inputEvent, pointerIndex); - g_ss << "x/y: " << x << "/" << y << std::endl; - auto windowX = OH_ArkUI_PointerEvent_GetWindowXByIndex(inputEvent, pointerIndex); - auto windowY = OH_ArkUI_PointerEvent_GetWindowYByIndex(inputEvent, pointerIndex); - g_ss << "windowX/Y: " << windowX << "/" << windowY << std::endl; - auto displayX = OH_ArkUI_PointerEvent_GetDisplayXByIndex(inputEvent, pointerIndex); - auto displayY = OH_ArkUI_PointerEvent_GetDisplayYByIndex(inputEvent, pointerIndex); - g_ss << "displayX/Y: " << displayX << "/" << displayY << std::endl; - auto globalDisplayX = OH_ArkUI_PointerEvent_GetGlobalDisplayXByIndex(inputEvent, pointerIndex); - auto globalDisplayY = OH_ArkUI_PointerEvent_GetGlobalDisplayYByIndex(inputEvent, pointerIndex); - g_ss << "globalDisplayX/Y: " << globalDisplayX << "/" << globalDisplayY << std::endl; - auto pressure = OH_ArkUI_PointerEvent_GetPressure(inputEvent, pointerIndex); - g_ss << "pressure: " << pressure << std::endl; - auto tiltX = OH_ArkUI_PointerEvent_GetTiltX(inputEvent, pointerIndex); - auto tiltY = OH_ArkUI_PointerEvent_GetTiltY(inputEvent, pointerIndex); - g_ss << "tiltX/Y: " << tiltX << "/" << tiltY << std::endl; - ArkUI_InteractionHand hand; - OH_ArkUI_PointerEvent_GetInteractionHandByIndex(inputEvent, pointerIndex, &hand); - if (hand == ARKUI_EVENT_HAND_LEFT) { - g_ss << "hand: LEFT" << std::endl; - } else if (hand == ARKUI_EVENT_HAND_RIGHT) { - g_ss << "hand: RIGHT" << std::endl; - } else { - g_ss << "hand: NONE" << std::endl; - } - auto touchAreaWidth = OH_ArkUI_PointerEvent_GetTouchAreaWidth(inputEvent, pointerIndex); - auto touchAreaHeight = OH_ArkUI_PointerEvent_GetTouchAreaHeight(inputEvent, pointerIndex); - g_ss << "touchAreaWidth/Height: " << touchAreaWidth << "/" << touchAreaHeight << std::endl; - SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_15); - PrintMultiHistoryInfos(inputEvent, pointerIndex); -} - -void ShowSimplePosInfo(ArkUI_UIInputEvent *inputEvent) -{ - auto x = OH_ArkUI_PointerEvent_GetX(inputEvent); - auto y = OH_ArkUI_PointerEvent_GetY(inputEvent); - g_ss << "x/y: " << x << "/" << y << std::endl; - auto windowX = OH_ArkUI_PointerEvent_GetWindowX(inputEvent); - auto windowY = OH_ArkUI_PointerEvent_GetWindowY(inputEvent); - g_ss << "windowX/Y: " << windowX << "/" << windowY << std::endl; - auto displayX = OH_ArkUI_PointerEvent_GetDisplayX(inputEvent); - auto displayY = OH_ArkUI_PointerEvent_GetDisplayY(inputEvent); - g_ss << "displayX/Y: " << displayX << "/" << displayY << std::endl; - auto globalDisplayX = OH_ArkUI_PointerEvent_GetGlobalDisplayX(inputEvent); - auto globalDisplayY = OH_ArkUI_PointerEvent_GetGlobalDisplayY(inputEvent); - g_ss << "globalDisplayX/Y: " << globalDisplayX << "/" << globalDisplayY << std::endl; -} - -void ShowSimpleTarInfo(ArkUI_UIInputEvent *inputEvent) -{ - auto targetWidth = OH_ArkUI_UIInputEvent_GetEventTargetWidth(inputEvent); - g_ss << "targetWidth: " << targetWidth << std::endl; - auto targetHeight = OH_ArkUI_UIInputEvent_GetEventTargetHeight(inputEvent); - g_ss << "targetHeight: " << targetHeight << std::endl; - auto positionX = OH_ArkUI_UIInputEvent_GetEventTargetPositionX(inputEvent); - auto positionY = OH_ArkUI_UIInputEvent_GetEventTargetPositionY(inputEvent); - g_ss << "targetPositionX/Y: " << positionX << "/" << positionY << std::endl; - auto globalPositionX = OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionX(inputEvent); - auto globalPositionY = OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionY(inputEvent); - g_ss << "targetGlobalPositionX/Y: " << globalPositionX << "/" << globalPositionY << std::endl; -} - -void ShowSimpleInfo(ArkUI_UIInputEvent* inputEvent) -{ - g_ss.str(""); - auto displayId = OH_ArkUI_UIInputEvent_GetTargetDisplayId(inputEvent); - g_ss << "displayId: " << displayId << std::endl; - auto eventTime = OH_ArkUI_UIInputEvent_GetEventTime(inputEvent); - g_ss << "eventTime: " << eventTime << std::endl; - // 触摸事件位置信息 - ShowSimplePosInfo(inputEvent); - // 手指触摸事件显示信息 - auto type = OH_ArkUI_UIInputEvent_GetToolType(inputEvent); - if (type == UI_INPUT_EVENT_TOOL_TYPE_FINGER) { - ArkUI_InteractionHand hand; - OH_ArkUI_PointerEvent_GetInteractionHand(inputEvent, &hand); - if (hand == ARKUI_EVENT_HAND_LEFT) { - g_ss << "hand: LEFT" << std::endl; - } else if (hand == ARKUI_EVENT_HAND_RIGHT) { - g_ss << "hand: RIGHT" << std::endl; - } else { - g_ss << "hand: NONE" << std::endl; - } - } else if (type == UI_INPUT_EVENT_TOOL_TYPE_PEN) { - double rollAngle = 0; - OH_ArkUI_PointerEvent_GetRollAngle(inputEvent, &rollAngle); - g_ss << "rollAngle: " << rollAngle << std::endl; - } - // 命中组件信息 - ShowSimpleTarInfo(inputEvent); - SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_15); -} - -void PrintClonedEventInfos(ArkUI_UIInputEvent* inputEvent, ArkUI_UIInputEvent* clonedEvent) -{ - float x = 0; - float y = 0; - OH_ArkUI_PointerEvent_SetClonedEventLocalPosition(clonedEvent, x, y); - OH_ArkUI_PointerEvent_SetClonedEventActionType(clonedEvent, UI_TOUCH_EVENT_ACTION_DOWN); - OH_ArkUI_PointerEvent_SetClonedEventChangedFingerId(clonedEvent, 0); - if (OH_ArkUI_UIInputEvent_GetLatestStatus() == ARKUI_ERROR_CODE_NO_ERROR) { - OH_ArkUI_PointerEvent_PostClonedEvent(column1, clonedEvent); - } -} - -void PrintMultiClonedEventInfos(ArkUI_UIInputEvent* clonedEvent) -{ - float x = 0; - float y = 0; - OH_ArkUI_PointerEvent_SetClonedEventLocalPositionByIndex(clonedEvent, x, y, 0); - OH_ArkUI_PointerEvent_SetClonedEventActionType(clonedEvent, UI_TOUCH_EVENT_ACTION_DOWN); - OH_ArkUI_PointerEvent_SetClonedEventFingerIdByIndex(clonedEvent, 0, 0); - if (OH_ArkUI_UIInputEvent_GetLatestStatus() == ARKUI_ERROR_CODE_NO_ERROR) { - OH_ArkUI_PointerEvent_PostClonedEvent(column1, clonedEvent); - } -} - -void BgEventReceiver(ArkUI_NodeHandle& node) -{ - nodeAPI->registerNodeEvent(node, NODE_TOUCH_EVENT, 1, &node); - nodeAPI->registerNodeEvent(node, NODE_ON_AXIS, 1, &node); - nodeAPI->addNodeEventReceiver(node, [](ArkUI_NodeEvent *event) { - ArkUI_NodeHandle *node = (ArkUI_NodeHandle *)OH_ArkUI_NodeEvent_GetUserData(event); - SetBackgroundColor(*node, 0xFFFFFF00); - }); -} - -void TouchEventOperator(ArkUI_UIInputEvent* inputEvent, ArkUI_NodeHandle* button) -{ - auto count = OH_ArkUI_PointerEvent_GetPointerCount(inputEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "pointerCount = %{public}d", count); - if (OH_ArkUI_UIInputEvent_GetSourceType(inputEvent) != UI_INPUT_EVENT_SOURCE_TYPE_TOUCH_SCREEN) { - return; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "ARKUI_UIINPUTEVENT_TYPE_TOUCH EventReceiver"); - OH_ArkUI_PointerEvent_SetStopPropagation(inputEvent, true); - ArkUI_UIInputEvent* clonedEvent = nullptr; - OH_ArkUI_PointerEvent_CreateClonedEvent(inputEvent, &clonedEvent); - switch (OH_ArkUI_UIInputEvent_GetAction(inputEvent)) { - case UI_TOUCH_EVENT_ACTION_DOWN: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_TOUCH_EVENT_ACTION_DOWN EventReceiver"); - SetText(titleText, ""); - if (count == 1) { - SetBackgroundColor(*button, 0xFFFF0000); - PrintClonedEventInfos(inputEvent, clonedEvent); - } else if (count > 1) { - SetBackgroundColor(*button, 0xFF932F60); - PrintMultiClonedEventInfos(clonedEvent); - } - break; - } - case UI_TOUCH_EVENT_ACTION_MOVE: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_TOUCH_EVENT_ACTION_MOVE EventReceiver"); - if (count == 1) { - ShowSimpleInfo(inputEvent); - } else if (count > 1) { - ShowMultiInfos(inputEvent); - } - break; - } - case UI_TOUCH_EVENT_ACTION_UP: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_TOUCH_EVENT_ACTION_UP EventReceiver"); - SetBackgroundColor(*button, 0xFF0000FF); - SetBackgroundColor(column1, 0xFFF6F6F6); - OH_ArkUI_PointerEvent_DestroyClonedEvent(clonedEvent); - break; - } - default: { - break; - } - } -} - -void ShowAxisInfos(ArkUI_UIInputEvent* inputEvent) -{ - g_ss.str(""); - auto verticalAxisValue = OH_ArkUI_AxisEvent_GetVerticalAxisValue(inputEvent); - g_ss << "verticalAxisValue: " << verticalAxisValue << std::endl; - auto horizontalAxisValue = OH_ArkUI_AxisEvent_GetHorizontalAxisValue(inputEvent); - g_ss << "horizontalAxisValue: " << horizontalAxisValue << std::endl; - auto pinchAxisScaleValue = OH_ArkUI_AxisEvent_GetPinchAxisScaleValue(inputEvent); - g_ss << "pinchAxisScaleValue: " << pinchAxisScaleValue << std::endl; - auto scrollStep = OH_ArkUI_AxisEvent_GetScrollStep(inputEvent); - g_ss << "scrollStep: " << scrollStep << std::endl; - SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_20); -} - -void AxisEventOperator(ArkUI_UIInputEvent* inputEvent) -{ - auto toolType = OH_ArkUI_UIInputEvent_GetToolType(inputEvent); - if (toolType == UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "ARKUI_UIINPUTEVENT_TYPE_AXIS EventReceiver"); - OH_ArkUI_AxisEvent_SetPropagation(inputEvent, false); - auto action = OH_ArkUI_AxisEvent_GetAxisAction(inputEvent); - switch (action) { - case UI_AXIS_EVENT_ACTION_BEGIN: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_AXIS_EVENT_ACTION_BEGIN EventReceiver"); - break; - } - case UI_AXIS_EVENT_ACTION_UPDATE: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_AXIS_EVENT_ACTION_UPDATE EventReceiver"); - ShowAxisInfos(inputEvent); - break; - } - case UI_AXIS_EVENT_ACTION_END: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_AXIS_EVENT_ACTION_END EventReceiver"); - SetBackgroundColor(column1, 0xFFF6F6F6); - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_AXIS_EVENT_ACTION_UNKNOWN EventReceiver"); - break; - } - } - } -} - -void MouseEventOperator(ArkUI_UIInputEvent* inputEvent, ArkUI_NodeHandle *button) -{ - OH_ArkUI_PointerEvent_SetInterceptHitTestMode(inputEvent, HTM_DEFAULT); - auto toolType = OH_ArkUI_UIInputEvent_GetToolType(inputEvent); - if (toolType == UI_INPUT_EVENT_TOOL_TYPE_MOUSE) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "ARKUI_UIINPUTEVENT_TYPE_MOUSE EventReceiver"); - auto action = OH_ArkUI_MouseEvent_GetMouseAction(inputEvent); - auto mouseButton = OH_ArkUI_MouseEvent_GetMouseButton(inputEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "MOUSE BUTTON %{public}d", mouseButton); - if (action == UI_MOUSE_EVENT_ACTION_PRESS && mouseButton == UI_MOUSE_EVENT_BUTTON_MIDDLE) { - return; - } - switch (action) { - case UI_MOUSE_EVENT_ACTION_PRESS: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_MOUSE_EVENT_ACTION_PRESS EventReceiver"); - SetBackgroundColor(*button, 0xFFFF0000); - break; - } - case UI_MOUSE_EVENT_ACTION_MOVE: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_MOUSE_EVENT_ACTION_MOVE EventReceiver"); - g_ss.str(""); - auto rawDeltaX = OH_ArkUI_MouseEvent_GetRawDeltaX(inputEvent); - auto rawDeltaY = OH_ArkUI_MouseEvent_GetRawDeltaY(inputEvent); - g_ss << "rawDeltaX: " << rawDeltaX << std::endl << "rawDeltaY: " << rawDeltaY << std::endl; - SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_20); - break; - } - case UI_MOUSE_EVENT_ACTION_RELEASE: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_MOUSE_EVENT_ACTION_RELEASE EventReceiver"); - SetBackgroundColor(*button, 0xFF0000FF); - SetBackgroundColor(column1, 0xFFF6F6F6); - break; - } - default: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_MOUSE_EVENT_ACTION_UNKNOWN EventReceiver"); - break; - } - } - } -} - -void KeyEventOperator(ArkUI_UIInputEvent* inputEvent) -{ - auto type = OH_ArkUI_KeyEvent_GetType(inputEvent); - if (type == ARKUI_KEY_EVENT_DOWN) { - int32_t pressedKeyCodes[BUTTON_LENGTH] = {}; - int32_t length = BUTTON_LENGTH; - OH_ArkUI_UIInputEvent_GetPressedKeys(inputEvent, pressedKeyCodes, &length); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "pressedKeyCodes = %{public}d", pressedKeyCodes[0]); - auto deviceId = OH_ArkUI_UIInputEvent_GetDeviceId(inputEvent); - uint64_t keys = 0; - OH_ArkUI_UIInputEvent_GetModifierKeyStates(inputEvent, &keys); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "deviceId = %{public}d, keys = %{public}lu", deviceId, keys); - } -} - -void BtEventReceiver(ArkUI_NodeHandle& button) -{ - nodeAPI->registerNodeEvent(button, NODE_TOUCH_EVENT, 1, &button); - nodeAPI->registerNodeEvent(button, NODE_ON_AXIS, 1, &button); - nodeAPI->registerNodeEvent(button, NODE_ON_MOUSE, 1, &button); - nodeAPI->registerNodeEvent(button, NODE_ON_HOVER_EVENT, 1, &button); - nodeAPI->registerNodeEvent(button, NODE_ON_KEY_EVENT, 1, &button); - nodeAPI->addNodeEventReceiver(button, [](ArkUI_NodeEvent *event) { - auto *inputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); - auto eventType = OH_ArkUI_UIInputEvent_GetType(inputEvent); - ArkUI_NodeHandle *button = (ArkUI_NodeHandle *)OH_ArkUI_NodeEvent_GetUserData(event); - if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_HOVER_EVENT) { - auto isHovered = OH_ArkUI_HoverEvent_IsHovered(inputEvent); - if (isHovered) { - SetBackgroundColor(*button, 0xFF009F40); - } else { - SetBackgroundColor(*button, 0xFF0000FF); - } - } else if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_FOCUS_AXIS) { - OH_ArkUI_FocusAxisEvent_SetStopPropagation(inputEvent, true); - auto abs_x = OH_ArkUI_FocusAxisEvent_GetAxisValue(inputEvent, UI_FOCUS_AXIS_EVENT_ABS_X); - auto abs_y = OH_ArkUI_FocusAxisEvent_GetAxisValue(inputEvent, UI_FOCUS_AXIS_EVENT_ABS_Y); - auto abs_z = OH_ArkUI_FocusAxisEvent_GetAxisValue(inputEvent, UI_FOCUS_AXIS_EVENT_ABS_Z); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "abs_x/abs_y/abs_z = %{public}f/%{public}f/%{public}f", abs_x, abs_y, abs_z); - } else if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_KEY_EVENT) { - KeyEventOperator(inputEvent); - } - if (eventType == ARKUI_UIINPUTEVENT_TYPE_TOUCH) { - TouchEventOperator(inputEvent, button); - } else if (eventType == ARKUI_UIINPUTEVENT_TYPE_AXIS) { - AxisEventOperator(inputEvent); - } else if (eventType == ARKUI_UIINPUTEVENT_TYPE_MOUSE) { - // 鼠标按键数 - int32_t pressedButtons[BUTTON_LENGTH] = {}; - int32_t length; - OH_ArkUI_MouseEvent_GetPressedButtons(inputEvent, pressedButtons, &length); - g_ss.str(""); - g_ss << "PressedButtonCount: " << length << std::endl; - SetText(titleText, g_ss.str().c_str(), TEXT_FONT_SIZE_20); - MouseEventOperator(inputEvent, button); - } - }); -} - -void FirstModule(ArkUI_NodeHandle &root) -{ - column1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetId(column1, "bg"); - SetWidthPercent(column1, 1); - SetHeightPercent(column1, 1); - SetColumnJustifyContent(column1, ARKUI_FLEX_ALIGNMENT_START); - SetColumnAlignItem(column1, ARKUI_HORIZONTAL_ALIGNMENT_CENTER); - SetPadding(column1, BLANK_10); - BgEventReceiver(column1); - - static auto button = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(button, "bt"); - SetButtonLabel(button, "输入事件测试按键"); - SetWidthPercent(button, 1); - SetHeight(button, SIZE_200); - SetBackgroundColor(button, 0xFF0000FF); - ArkUI_NumberValue enable[] = {1}; - ArkUI_AttributeItem focusableItem = {enable, 1}; - nodeAPI->setAttribute(button, NODE_FOCUSABLE, &focusableItem); - BtEventReceiver(button); - nodeAPI->addChild(column1, button); - - auto blank = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetHeight(blank, BLANK_10); - nodeAPI->addChild(column1, blank); - - titleText = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetId(titleText, "title"); - nodeAPI->addChild(column1, titleText); - - infoText = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetId(infoText, "info"); - nodeAPI->addChild(column1, infoText); - - nodeAPI->addChild(root, column1); -} - -} // namespace NativeXComponentSample - -#endif // NDKINPUTEVENT_FUNCTION_H \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/init.cpp b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/init.cpp deleted file mode 100644 index c0a59c6e508ef0e7e7babfe349fce391e8591e7a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/init.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include "manager.h" - -namespace NativeXComponentSample { - EXTERN_C_START - static napi_value Init(napi_env env, napi_value exports) - { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"getContext", nullptr, Manager::GetContext, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"createNativeNode", nullptr, Manager::CreateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"upDateNativeNode", nullptr, Manager::UpdateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr}}; - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - - Manager::GetInstance()->Export(env, exports); - return exports; - } - EXTERN_C_END - - static napi_module nativeNodeModule = {.nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativeNode", - .nm_priv = ((void *)0), - .reserved = {0}}; - - extern "C" __attribute__((constructor)) void RegisterModule(void) { napi_module_register(&nativeNodeModule); } -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/manager.cpp b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/manager.cpp deleted file mode 100644 index 0f0d5936d890807cd83c4863c58aa15e30abb9bb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "common.h" -#include "function.h" -#include "napi/native_api.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "manager.h" - -namespace NativeXComponentSample { -Manager Manager::manager_; - -Manager::~Manager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "~Manager"); - for (auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for (auto iter = containerMap_.begin(); iter != containerMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - containerMap_.clear(); -} - -void SampleEntry(napi_env env, napi_value arg, OH_NativeXComponent *component) -{ - // 根节点 - auto column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetWidthPercent(column, 1); - SetHeightPercent(column, 1); - SetColumnJustifyContent(column, ARKUI_FLEX_ALIGNMENT_START); - SetColumnAlignItem(column, ARKUI_HORIZONTAL_ALIGNMENT_START); - - FirstModule(column); - - OH_NativeXComponent_AttachNativeRootNode(component, column); -} - -napi_value Manager::CreateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - if (argCnt < 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - - if (nodeAPI != nullptr) { - if (nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { - SampleEntry(env, args[1], component); - } - } - - return nullptr; -} - -napi_value Manager::UpdateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode env or info is null"); - return nullptr; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "UpdateNativeNode 1111"); - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "CreateNativeNode %{public}s", idStr); - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent *component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - - if ((env == nullptr) || (info == nullptr || component == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - return nullptr; -} - -napi_value Manager::GetContext(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = {nullptr}; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_number) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - int64_t value; - if (napi_get_value_int64(env, args[0], &value) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_create_object failed"); - return nullptr; - } - - return exports; -} - -void Manager::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", - "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto manager = Manager::GetInstance(); - if ((manager != nullptr) && (nativeXComponent != nullptr)) { - manager->SetNativeXComponent(id, nativeXComponent); - } -} - -void Manager::SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent) -{ - if (nativeXComponent == nullptr) { - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent *tmp = nativeXComponentMap_[id]; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -OH_NativeXComponent *Manager::GetNativeXComponent(const std::string &id) { return nativeXComponentMap_[id]; } -} // namespace NativeXComponentSample \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/manager.h b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/manager.h deleted file mode 100644 index c4da32804a827832b285ee0bc9e1dfcf4ad8ec31..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "container.h" -namespace NativeXComponentSample { -const int MAX_SIZE = 11; -class Manager { -public: - ~Manager(); - - static Manager *GetInstance() { return &Manager::manager_; } - - static napi_value GetContext(napi_env env, napi_callback_info info); - static napi_value CreateNativeNode(napi_env env, napi_callback_info info); - static napi_value UpdateNativeNode(napi_env env, napi_callback_info info); - - void SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent); - OH_NativeXComponent *GetNativeXComponent(const std::string &id); - - void Export(napi_env env, napi_value exports); - -private: - static Manager manager_; - - std::unordered_map nativeXComponentMap_; - std::unordered_map containerMap_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index f4fb7fabbc60dffb99d41d578848f7fb0b50c5a6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NdkInputEvent/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index c5539bddd7a772710f55da0ddd7b5676305469de..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkInputEvent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NdkInputEvent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkInputEvent/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NdkInputEvent/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 1e2e6c769c75234fa6b6dbccb2c364626750689a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,77 +0,0 @@ -/* - -Copyright (c) 2025 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 nativeNode from 'libnativeNode.so'; - -@Builder -function title() { - Column() { - Text('输入事件C-API功能示例') - .fontSize(24) - .fontWeight(FontWeight.Bold) - .margin({ top: 15, bottom: 15 }) - .fontColor(Color.White) - .textAlign(TextAlign.Center) - .width('100%') - } - .width('100%') - .backgroundColor('#0000FF') - .linearGradient({ - angle: 90, - colors: [ - [0x0000FF, 0.0], - [0x4169E1, 1.0] - ] - }) -} - -@Component -struct NativeDragDropExample { - build() { - Column() { - XComponent({ - id: 'dragAndDrop', - type: XComponentType.NODE, - libraryname: 'nativeNode' - }) - .height(700) - .onAppear(() => { - nativeNode.createNativeNode('dragAndDrop', this.getUIContext()); - }) - } - .backgroundColor('#ffeff5f5') - } -} - -@Entry -@Component -struct Index { - - build() { - Column() { - title() - Scroll() { - Column() { - NativeDragDropExample() - } - .alignItems(HorizontalAlign.Start) - } - .layoutWeight(1) - } - .width('100%') - .height('100%') - - } - -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/ets/resources/seagull.png b/ArkUIKit/NdkInputEvent/entry/src/main/ets/resources/seagull.png deleted file mode 100644 index b635c67bc98be553dc2ff2de88f480a6c20f20b1..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkInputEvent/entry/src/main/ets/resources/seagull.png and /dev/null differ diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/module.json5 b/ArkUIKit/NdkInputEvent/entry/src/main/module.json5 deleted file mode 100644 index f09d09a7bc661e848418aaf40ba4506a86649bb1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/element/color.json b/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/element/string.json b/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/element/string.json deleted file mode 100644 index ac2ae50f9a935878fe3faf6625901af32e8295cc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "InputEventDemo" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/background.png b/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NdkInputEvent/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index ac2ae50f9a935878fe3faf6625901af32e8295cc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "InputEventDemo" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NdkInputEvent/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 80021fac0d5ad0e0f3298ec21d8e87ed0c8f2ba8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "InputEventDemo" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/mock/mock-config.json5 b/ArkUIKit/NdkInputEvent/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/InputEventTest.test.ets b/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/InputEventTest.test.ets deleted file mode 100644 index 53e93fa90f9c23e070e9bc32ae21eda59c133306..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/InputEventTest.test.ets +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestType } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON, MouseButton, UiDirection } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -export default function InputEventTest() { - describe('InputEventTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - beforeEach(async () => { - }) - - afterEach(() => { - hilog.info(0x0000, 'InputEventTest', 'InputEvent interface test case completed'); - }) - - afterAll(() => { - hilog.info(0x0000, 'InputEventTest', 'All inputEvent interface tests completed'); - }) - - /** - * @tc.number InputEventTest_001 - * @tc.name testTouchInput - * @tc.desc 测试默认输入事件接口 - 监听触摸事件监听,及克隆事件接口 - */ - it('testTouchInput', TestType.FUNCTION, async (done: Function) => { - hilog.info(0x0000, 'InputEventTest', 'testTouchInput begin'); - try { - let driver = Driver.create(); - await driver.delayMs(1000); - // 点击按钮触发事件 - const button = await driver.findComponent(ON.id('bt')); - await button.longClick(); - await driver.delayMs(1000); - } catch (error) { - hilog.error(0x0000, 'InputEventTest', 'testTouchInput failed: %{public}s', error.message); - expect().assertFail(); - } - done(); - hilog.info(0x0000, 'InputEventTest', 'testTouchInput end'); - }) - - /** - * @tc.number InputEventTest_002 - * @tc.name testMouseInput - * @tc.desc 测试鼠标输入事件接口 - 测试鼠标悬停事件及点击事件监听 - */ - it('testMouseInput', TestType.FUNCTION, async (done: Function) => { - hilog.info(0x0000, 'InputEventTest', 'testMouseInput begin'); - try { - let driver = Driver.create(); - await driver.delayMs(1000); - // 移动鼠标,触发悬停事件 - await driver.mouseMoveWithTrack({x:300, y:600}, {x:300, y:400}); - let btObj: ESObject = JSON.parse(getInspectorByKey('bt')); - hilog.info(0x0000, 'InputEventTest', 'testMouseInput buttonColor: %{public}s', JSON.stringify(btObj.$attrs.backgroundColor)); - expect(btObj.$attrs.backgroundColor).assertEqual('#FF009F40'); - await driver.delayMs(1000); - // 鼠标左键单击,触发鼠标按下/释放事件 - await driver.mouseLongClick({x:300, y:400}, MouseButton.MOUSE_BUTTON_LEFT); - await driver.delayMs(1000); - } catch (error) { - hilog.error(0x0000, 'InputEventTest', 'testMouseInput failed: %{public}s', error.message); - expect().assertFail(); - } - done(); - hilog.info(0x0000, 'InputEventTest', 'testMouseInput end'); - }) - - /** - * @tc.number InputEventTest_003 - * @tc.name testKeyInput - * @tc.desc 测试按键输入事件接口 - 测试按键事件监听 - */ - it('testKeyInput', TestType.FUNCTION, async (done: Function) => { - hilog.info(0x0000, 'InputEventTest', 'testKeyInput begin'); - try { - let driver = Driver.create(); - await driver.delayMs(1000); - // 按Tab键,验证按钮获焦 - await driver.triggerKey(2049); - const button = await driver.findComponent(ON.id('bt')); - const flag = await button.isFocused(); - await driver.delayMs(1000); - expect(flag).assertTrue(); - } catch (error) { - hilog.error(0x0000, 'InputEventTest', 'testKeyInput failed: %{public}s', error.message); - expect().assertFail(); - } - done(); - hilog.info(0x0000, 'InputEventTest', 'testKeyInput end'); - }) - - }) -} diff --git a/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index a8f010783a9bf3b4f81137bd9e52e60ac785673f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 InputEventTest from './InputEventTest.test'; - -export default function testsuite() { - InputEventTest(); -} diff --git a/ArkUIKit/NdkInputEvent/entry/src/ohosTest/module.json5 b/ArkUIKit/NdkInputEvent/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NdkInputEvent/entry/src/test/List.test.ets b/ArkUIKit/NdkInputEvent/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NdkInputEvent/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/hvigor/hvigor-config.json5 b/ArkUIKit/NdkInputEvent/hvigor/hvigor-config.json5 deleted file mode 100644 index bbefea7a134e2f917ca278c2d7c094385972786d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.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*/ - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/hvigorfile.ts b/ArkUIKit/NdkInputEvent/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkInputEvent/oh-package.json5 b/ArkUIKit/NdkInputEvent/oh-package.json5 deleted file mode 100644 index c4a0b97e2e32a745a7841d489da3a9f0739daa93..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/ohTest.md b/ArkUIKit/NdkInputEvent/ohTest.md deleted file mode 100644 index c68af965c3bbb2cb0ad38682cb2ffe3dfb9c8f9b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkInputEvent/ohTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# NativeDragDrop 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|------------------------------------------| -------------- |-------------------------------|-------------------------------------------------------| :------- | -------- | -| 触摸事件示例验证 | 设备正常运行 | 进入首页,点击按钮 | 按钮和背景改变颜色,并打印事件相关信息日志 | 是 | Pass | -| 鼠标事件示例验证 | 设备正常运行 | 进入首页,鼠标移入按钮中并点击左键 | 按钮和背景改变颜色,并打印事件相关信息日志 | 是 | Pass | -| 按键事件示例验证 | 设备正常运行 | 进入首页,按下键盘按键 | 按钮获焦,并打印事件相关信息日志 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/NdkInputEvent/screenshots/device/image1.jpg b/ArkUIKit/NdkInputEvent/screenshots/device/image1.jpg deleted file mode 100644 index c98087bc2833a4913cb2f256f9bb5aaa2f1d5cfa..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkInputEvent/screenshots/device/image1.jpg and /dev/null differ diff --git a/ArkUIKit/NdkKeyEvent/.gitignore b/ArkUIKit/NdkKeyEvent/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/NdkKeyEvent/AppScope/app.json5 b/ArkUIKit/NdkKeyEvent/AppScope/app.json5 deleted file mode 100644 index 41737beb8789543a52f54841c9a0414327c7fd4d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.sample.ndkkeyevent", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NdkKeyEvent/AppScope/resources/base/element/string.json b/ArkUIKit/NdkKeyEvent/AppScope/resources/base/element/string.json deleted file mode 100644 index d71e5ead1ce20b4ac3384d18e6d104f1ea4d83b4..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - } - ] -} diff --git a/ArkUIKit/NdkKeyEvent/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NdkKeyEvent/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkKeyEvent/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NdkKeyEvent/README_zh.md b/ArkUIKit/NdkKeyEvent/README_zh.md deleted file mode 100644 index cbbaa9521b2630918ddfb4787fd8548bbfc11cd7..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/README_zh.md +++ /dev/null @@ -1,70 +0,0 @@ -# ArkUI指南文档示例 - -### 介绍 - -本示例通过使用[ArkUI指南文档](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/reference)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [按键事件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-key-event-h.md)。 -### 效果预览 - -| 首页 | -|------------------------------------| -| ![](screenshots/device/image1.jpg) | - -### 使用说明 - -1. 在首页可以查看通过按键事件CAPI接口实现监听按键事件示例。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -entry/src/main/ets/ -|---cpp -| |---types -| |---CMakeLists.txt -| |---container.cpp -| |---container.h -| |---init.cpp -| |---manager.cpp // native创建与对接 -| |---manager.h // manager头文件 -| |---key_event_handler.cpp // 通过按键事件CAPI接口实现相关示例代码 -| |---key_event_handler.h -| |---napi_init.cpp -|---ets -| |---pages -| | |---Index.ets // 应用主页面 -entry/src/ohosTest/ -|---ets -| |---index.test.ets // 示例代码测试代码 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例支持仅标准系统上运行,支持设备:华为手机、华为平板。 - -2.HarmonyOS系统:HarmonyOS 6.0.0 Beta3版本及以上。 - -3.DevEco Studio版本:DevEco Studio 6.0.0 Beta3版本及以上。 - -4.HarmonyOS SDK版本:HarmonyOS 6.0.0 Beta3 SDK版本及以上。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/NdkKeyEvent > .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/ArkUIKit/NdkKeyEvent/build-profile.json5 b/ArkUIKit/NdkKeyEvent/build-profile.json5 deleted file mode 100644 index 1a4efe780afd7fdb22c76ae2f927496b12c2cf07..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/code-linter.json5 b/ArkUIKit/NdkKeyEvent/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/.gitignore b/ArkUIKit/NdkKeyEvent/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/build-profile.json5 b/ArkUIKit/NdkKeyEvent/entry/build-profile.json5 deleted file mode 100644 index d27072efd782a98fdc3b4456f19249ba19c31bbb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/hvigorfile.ts b/ArkUIKit/NdkKeyEvent/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkKeyEvent/entry/obfuscation-rules.txt b/ArkUIKit/NdkKeyEvent/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/NdkKeyEvent/entry/oh-package.json5 b/ArkUIKit/NdkKeyEvent/entry/oh-package.json5 deleted file mode 100644 index 5d993e5251fd56950970aa593aefef1b8d71e976..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 2f4c2d326ddc8784490d522dbfd0791b0831794e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(MyApplication) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(nativeNode SHARED init.cpp manager.cpp container.cpp key_event_handler.cpp) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_napi.z.so) -target_link_libraries(nativeNode PUBLIC libace_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libnative_drawing.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so) -target_link_libraries(nativeNode PUBLIC libhilog_ndk.z.so libpixelmap.so) diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/container.cpp b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/container.cpp deleted file mode 100644 index f7f4b15dc54c259a62b0ec1ce7411ff21c4e7bbc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/container.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "container.h" - -#include -#include -#include -#include -#include - - -namespace NativeXComponentSample { -namespace { -void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } -} - -void OnSurfaceChangedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB: Unable to get XComponent id"); - return; - } - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "surface changed"); - } -} - -void OnSurfaceDestroyedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container::Release(id); -} - -void DispatchTouchEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - Container* render = Container::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } -} - -void DispatchMouseEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchMouseEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto render = Container::GetInstance(id); - if (render != nullptr) { - render->OnMouseEvent(component, window); - } -} - -void DispatchHoverEventCB(OH_NativeXComponent* component, bool isHover) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchHoverEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - auto container = Container::GetInstance(id); - if (container != nullptr) { - container->OnHoverEvent(component, isHover); - } -} -} // namespace - -std::unordered_map Container::instance_; - -Container::Container(const std::string& id) -{ - this->id_ = id; -} - -Container* Container::GetInstance(const std::string& id) -{ - if (instance_.find(id) == instance_.end()) { - Container* instance = new Container(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } -} - -void Container::Release(const std::string& id) -{ - if (instance_.find(id) != instance_.end()) { - instance_[id] = nullptr; - } -} - -void Container::OnSurfaceChanged(OH_NativeXComponent* component, void* window) -{ - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChanged: Unable to get XComponent id"); - return; - } - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OH_NativeXComponent_GetXComponentOffset", - "offsetX = %{public}lf, offsetY = %{public}lf", offsetX, offsetY); - uint64_t width; - uint64_t height; - OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); -} - -void Container::OnTouchEvent(OH_NativeXComponent* component, void* window) -{ - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - std::string id(idStr); - Container* container = Container::GetInstance(id); - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, tiltY); -} - -void Container::RegisterCallback(OH_NativeXComponent* nativeXComponent) -{ - containerCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - containerCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - containerCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - containerCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &containerCallback_); - - mouseCallback_.DispatchMouseEvent = DispatchMouseEventCB; - mouseCallback_.DispatchHoverEvent = DispatchHoverEventCB; - OH_NativeXComponent_RegisterMouseEventCallback(nativeXComponent, &mouseCallback_); - OH_NativeXComponent_RegisterOnTouchInterceptCallback( - nativeXComponent, [](OH_NativeXComponent*, ArkUI_UIInputEvent*) -> HitTestMode { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "callback", - "OH_NativeXComponent_RegisterOnTouchInterceptCallback"); - return HitTestMode::HTM_TRANSPARENT; - }); -} - -void Container::OnMouseEvent(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnMouseEvent"); - OH_NativeXComponent_MouseEvent mouseEvent; - int32_t ret = OH_NativeXComponent_GetMouseEvent(component, window, &mouseEvent); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", - "MouseEvent Info: x = %{public}f, y = %{public}f, action = %{public}d, button = %{public}d", mouseEvent.x, - mouseEvent.y, mouseEvent.action, mouseEvent.button); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Container", "GetMouseEvent error"); - } -} - -void Container::OnHoverEvent(OH_NativeXComponent* component, bool isHover) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Container", "OnHoverEvent isHover_ = %{public}d", isHover); -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/container.h b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/container.h deleted file mode 100644 index 8290fa3d85fe4c58fe153e981337456dfdf03c54..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/container.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef MY_APPLICATION_CONTAINER_H -#define MY_APPLICATION_CONTAINER_H - -#include -#include -#include -#include - - -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; - -namespace NativeXComponentSample { - -class Container { -public: - explicit Container(const std::string& id); - ~Container() = default; - static Container* GetInstance(const std::string& id); - static void Release(const std::string& id); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent* component, void* window); - void OnTouchEvent(OH_NativeXComponent* component, void* window); - void OnMouseEvent(OH_NativeXComponent* component, void* window); - void OnHoverEvent(OH_NativeXComponent* component, bool isHover); - void OnKeyEvent(OH_NativeXComponent* component, void* window); - void RegisterCallback(OH_NativeXComponent* nativeXComponent); - -public: - static std::unordered_map instance_; - std::string id_; - -private: - OH_NativeXComponent_Callback containerCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; -}; - -} // namespace NativeXComponentSample -#endif // MY_APPLICATION_CONTAINER_H diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/init.cpp b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/init.cpp deleted file mode 100644 index 3c9615ef6a7c3a19cb21ca0e1eac5d324247c116..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/init.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include - -#include "manager.h" - -namespace NativeXComponentSample { -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - { "getContext", nullptr, Manager::GetContext, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "createNativeNode", nullptr, Manager::CreateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "upDateNativeNode", nullptr, Manager::UpdateNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr } }; - - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - - Manager::GetInstance()->Export(env, exports); - return exports; -} -EXTERN_C_END - -static napi_module nativeNodeModule = { .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativeNode", - .nm_priv = ((void*)0), - .reserved = { 0 } }; - -extern "C" __attribute__((constructor)) void RegisterModule(void) -{ - napi_module_register(&nativeNodeModule); -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/key_event_handler.cpp b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/key_event_handler.cpp deleted file mode 100644 index 0ffdb5fb670eb9f855f113130f9f5d3ab6d6502a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/key_event_handler.cpp +++ /dev/null @@ -1,995 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "key_event_handler.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "container.h" - -namespace KeyEventSample { -const int32_t NUMBER_ZERO = 0; -const int32_t NUMBER_ONE = 1; -const int32_t NUMBER_TWO = 2; -const int32_t NUMBER_THREE = 3; -const int32_t NUMBER_FOUR = 4; -const int32_t NUMBER_FIVE = 5; -const int32_t NUMBER_TEN = 10; - -static ArkUI_NativeNodeAPI_1* g_nodeAPI = nullptr; - -KeyEventHandler* KeyEventHandler::instance_ = nullptr; - -KeyEventHandler* KeyEventHandler::GetInstance() -{ - if (instance_ == nullptr) { - instance_ = new KeyEventHandler(); - } - return instance_; -} - -ArkUI_NativeNodeAPI_1* OH_ArkUI_NodeAPI_GetAPI() -{ - if (g_nodeAPI) { - return g_nodeAPI; - } else { - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, g_nodeAPI); - return g_nodeAPI; - } -} - -// 通用UI属性设置工具函数 -namespace UIUtils { -void SetNodeSize(ArkUI_NodeHandle node, float width, float height) -{ - ArkUI_NumberValue widthValue = { .f32 = width }; - ArkUI_AttributeItem widthItem = { .value = &widthValue, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(node, NODE_WIDTH, &widthItem); - - ArkUI_NumberValue heightValue = { .f32 = height }; - ArkUI_AttributeItem heightItem = { .value = &heightValue, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(node, NODE_HEIGHT, &heightItem); -} - -void SetNodeBackgroundColor(ArkUI_NodeHandle node, uint32_t color) -{ - ArkUI_NumberValue bgColorValue = { .u32 = color }; - ArkUI_AttributeItem bgColorItem = { .value = &bgColorValue, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(node, NODE_BACKGROUND_COLOR, &bgColorItem); -} - -void SetNodeBorderRadius(ArkUI_NodeHandle node, float radius) -{ - ArkUI_NumberValue borderRadius = { .f32 = radius }; - ArkUI_AttributeItem radiusItem = { .value = &borderRadius, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(node, NODE_BORDER_RADIUS, &radiusItem); -} - -void SetNodePadding(ArkUI_NodeHandle node, float padding) -{ - ArkUI_NumberValue paddingValue = { .f32 = padding }; - ArkUI_AttributeItem paddingItem = { .value = &paddingValue, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(node, NODE_PADDING, &paddingItem); -} - -void SetNodeBorder(ArkUI_NodeHandle node, float width, uint32_t color) -{ - ArkUI_NumberValue borderWidth = { .f32 = width }; - ArkUI_AttributeItem borderWidthItem = { .value = &borderWidth, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(node, NODE_BORDER_WIDTH, &borderWidthItem); - - ArkUI_NumberValue borderColorValue = { .u32 = color }; - ArkUI_AttributeItem borderColorItem = { .value = &borderColorValue, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(node, NODE_BORDER_COLOR, &borderColorItem); -} - -void SetNodeFocusable(ArkUI_NodeHandle node, bool focusable) -{ - ArkUI_NumberValue focusableValue = { .i32 = focusable ? 1 : 0 }; - ArkUI_AttributeItem focusableItem = { .value = &focusableValue, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(node, NODE_FOCUSABLE, &focusableItem); -} - -ArkUI_NodeHandle CreateSpacer(float height) -{ - ArkUI_NodeHandle spacer = OH_ArkUI_NodeAPI_GetAPI()->createNode(ARKUI_NODE_STACK); - if (spacer) { - ArkUI_NumberValue spacerHeight = { .f32 = height }; - ArkUI_AttributeItem spacerHeightItem = { .value = &spacerHeight, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(spacer, NODE_HEIGHT, &spacerHeightItem); - } - return spacer; -} - -ArkUI_NodeHandle CreateTextNode(const std::string& text, float fontSize, uint32_t color) -{ - ArkUI_NodeHandle textNode = OH_ArkUI_NodeAPI_GetAPI()->createNode(ARKUI_NODE_TEXT); - if (textNode) { - ArkUI_AttributeItem textItem = { .string = text.c_str() }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(textNode, NODE_TEXT_CONTENT, &textItem); - - ArkUI_NumberValue fontSizeValue = { .f32 = fontSize }; - ArkUI_AttributeItem fontSizeItem = { .value = &fontSizeValue, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(textNode, NODE_FONT_SIZE, &fontSizeItem); - - ArkUI_NumberValue colorValue = { .u32 = color }; - ArkUI_AttributeItem colorItem = { .value = &colorValue, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(textNode, NODE_FONT_COLOR, &colorItem); - } - return textNode; -} -} // namespace UIUtils - -ArkUI_NodeHandle CreateTitleText() -{ - return UIUtils::CreateTextNode("Key Event Sample", 22.0f, 0xFF2E5BBA); -} - -void SetRootColumnAttribute(ArkUI_NodeHandle& columnNode) -{ - // 设置Column的基本样式 - UIUtils::SetNodeSize(columnNode, 350.0f, 500.0f); - UIUtils::SetNodeBackgroundColor(columnNode, 0xFFF8F9FA); - UIUtils::SetNodeBorderRadius(columnNode, 16.0f); - UIUtils::SetNodePadding(columnNode, 20.0f); - - // 创建并添加标题文本 - ArkUI_NodeHandle titleNode = CreateTitleText(); - if (titleNode) { - OH_ArkUI_NodeAPI_GetAPI()->addChild(columnNode, titleNode); - } - - // 添加间距 - ArkUI_NodeHandle spacer = UIUtils::CreateSpacer(20.0f); - if (spacer) { - OH_ArkUI_NodeAPI_GetAPI()->addChild(columnNode, spacer); - } -} - -ArkUI_NodeHandle CreateOuterColumnTitle() -{ - return UIUtils::CreateTextNode("Event Propagation Demo", 16.0f, 0xFF2E7D32); -} - -void SetOuterColumnAttribute(ArkUI_NodeHandle& outerColumn) -{ - // 设置外层Column基本样式 - UIUtils::SetNodeSize(outerColumn, 300.0f, 120.0f); - UIUtils::SetNodeBackgroundColor(outerColumn, 0xFFE8F5E8); - UIUtils::SetNodeBorderRadius(outerColumn, 8.0f); - UIUtils::SetNodeBorder(outerColumn, 2.0f, 0xFF4CAF50); - UIUtils::SetNodePadding(outerColumn, 10.0f); - UIUtils::SetNodeFocusable(outerColumn, true); - - // 设置ID - ArkUI_AttributeItem idItem = { .string = "parentColumn" }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(outerColumn, NODE_ID, &idItem); - - // 创建并添加标题文本 - ArkUI_NodeHandle titleNode = CreateOuterColumnTitle(); - if (titleNode) { - OH_ArkUI_NodeAPI_GetAPI()->addChild(outerColumn, titleNode); - } -} - -void KeyEventHandler::Initialize() -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Initialize begins"); - - // 创建显示节点 - displayNode_ = UIUtils::CreateTextNode("Click buttons below to test key events...", 14.0f, 0xFF666666); -} - -ArkUI_NodeHandle CreateButtonsContainer() -{ - ArkUI_NodeHandle columnNode = OH_ArkUI_NodeAPI_GetAPI()->createNode(ARKUI_NODE_COLUMN); - if (!columnNode) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "Failed to create column node"); - return nullptr; - } - - SetRootColumnAttribute(columnNode); - return columnNode; -} - -void AddButtonWithSpacer(ArkUI_NodeHandle container, ArkUI_NodeHandle button, const std::string& buttonId) -{ - if (button) { - ArkUI_AttributeItem idItem = { .string = buttonId.c_str() }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(button, NODE_ID, &idItem); - OH_ArkUI_NodeAPI_GetAPI()->addChild(container, button); - - // 添加间距 - ArkUI_NodeHandle spacer = UIUtils::CreateSpacer(12.0f); - if (spacer) { - OH_ArkUI_NodeAPI_GetAPI()->addChild(container, spacer); - } - } -} - -ArkUI_NodeHandle KeyEventHandler::CreateKeyEventNode() -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Creating key event node"); - - // 创建主容器 - ArkUI_NodeHandle columnNode = CreateButtonsContainer(); - if (!columnNode) { - return nullptr; - } - - // 创建三个Button,分别对应三个事件类型 - ArkUI_NodeHandle keyEventButton = CreateKeyEventButton("Key Event (Click to Focus)", NODE_ON_KEY_EVENT); - AddButtonWithSpacer(columnNode, keyEventButton, "Button1"); - - ArkUI_NodeHandle preIMEButton = CreateKeyEventButton("Pre-IME Event (Click to Focus)", NODE_ON_KEY_PRE_IME); - AddButtonWithSpacer(columnNode, preIMEButton, "Button2"); - - ArkUI_NodeHandle dispatchButton = CreateKeyEventButton("Dispatch Event (Click to Focus)", NODE_DISPATCH_KEY_EVENT); - AddButtonWithSpacer(columnNode, dispatchButton, "Button3"); - - // 添加事件冒泡和消费演示场景 - ArkUI_NodeHandle propagationDemo = CreateEventPropagationDemo(); - if (propagationDemo) { - OH_ArkUI_NodeAPI_GetAPI()->addChild(columnNode, propagationDemo); - } - - // 添加最终间距和显示节点 - ArkUI_NodeHandle finalSpacer = UIUtils::CreateSpacer(20.0f); - if (finalSpacer) { - OH_ArkUI_NodeAPI_GetAPI()->addChild(columnNode, finalSpacer); - } - - if (displayNode_) { - OH_ArkUI_NodeAPI_GetAPI()->addChild(columnNode, displayNode_); - } - - return columnNode; -} - -void SetButtonStyle(ArkUI_NodeHandle buttonNode, const std::string& label) -{ - UIUtils::SetNodeSize(buttonNode, 300.0f, 48.0f); - UIUtils::SetNodeBackgroundColor(buttonNode, 0xFF4A90E2); - UIUtils::SetNodeBorderRadius(buttonNode, 8.0f); - UIUtils::SetNodeFocusable(buttonNode, true); - - // 设置Button文本 - ArkUI_AttributeItem labelItem = { .string = label.c_str() }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(buttonNode, NODE_BUTTON_LABEL, &labelItem); -} - -KeyEventCallbackData* CreateCallbackData( - ArkUI_NodeHandle buttonNode, const std::string& label, ArkUI_NodeEventType eventType) -{ - KeyEventCallbackData* callbackData = new KeyEventCallbackData(); - callbackData->buttonNode = buttonNode; - callbackData->originalLabel = label; - callbackData->currentLabel = label; - callbackData->eventCount = 0; - callbackData->eventType = eventType; - return callbackData; -} - -void RegisterButtonEvents( - ArkUI_NodeHandle buttonNode, KeyEventCallbackData* callbackData, ArkUI_NodeEventType eventType) -{ - // 注册全局事件接收器(只需要注册一次) - static bool receiverRegistered = false; - if (!receiverRegistered) { - OH_ArkUI_NodeAPI_GetAPI()->registerNodeEventReceiver(KeyEventHandler::GlobalEventReceiver); - receiverRegistered = true; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Global event receiver registered"); - } - - // 注册各种事件 - int32_t result1 = OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(buttonNode, eventType, 0, callbackData); - int32_t result2 = OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(buttonNode, NODE_ON_CLICK, 1, callbackData); - int32_t result3 = OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(buttonNode, NODE_ON_FOCUS, 2, callbackData); - int32_t result4 = OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(buttonNode, NODE_ON_BLUR, 3, callbackData); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Event registration results - Key:%{public}d, Click:%{public}d, Focus:%{public}d, Blur:%{public}d", result1, - result2, result3, result4); -} - -ArkUI_NodeHandle KeyEventHandler::CreateKeyEventButton(const std::string& label, ArkUI_NodeEventType eventType) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Creating button with label: %{public}s", - label.c_str()); - - // 创建Button节点 - ArkUI_NodeHandle buttonNode = OH_ArkUI_NodeAPI_GetAPI()->createNode(ARKUI_NODE_BUTTON); - if (!buttonNode) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "Failed to create button node"); - return nullptr; - } - - // 设置按钮样式 - SetButtonStyle(buttonNode, label); - - // 创建回调数据 - KeyEventCallbackData* callbackData = CreateCallbackData(buttonNode, label, eventType); - - // 注册事件 - RegisterButtonEvents(buttonNode, callbackData, eventType); - - return buttonNode; -} - -ArkUI_NodeHandle CreateChildButton() -{ - ArkUI_NodeHandle childButton = OH_ArkUI_NodeAPI_GetAPI()->createNode(ARKUI_NODE_BUTTON); - if (childButton) { - UIUtils::SetNodeSize(childButton, 250.0f, 40.0f); - UIUtils::SetNodeBackgroundColor(childButton, 0xFFFF9800); - UIUtils::SetNodeBorderRadius(childButton, 6.0f); - UIUtils::SetNodeFocusable(childButton, true); - - ArkUI_AttributeItem btnLabelItem = { .string = "Child Button (ESC=Consume, F1=StopProp)" }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(childButton, NODE_BUTTON_LABEL, &btnLabelItem); - - ArkUI_AttributeItem idItem = { .string = "Button4" }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(childButton, NODE_ID, &idItem); - } - return childButton; -} - -void RegisterChildButtonEvents(ArkUI_NodeHandle childButton) -{ - KeyEventCallbackData* childCallbackData = - CreateCallbackData(childButton, "Child Button (ESC=Consume, F1=StopProp)", NODE_ON_KEY_EVENT); - - OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(childButton, NODE_ON_KEY_EVENT, NUMBER_ZERO, childCallbackData); - OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(childButton, NODE_ON_CLICK, NUMBER_ONE, childCallbackData); - OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(childButton, NODE_ON_FOCUS, NUMBER_TWO, childCallbackData); - OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(childButton, NODE_ON_BLUR, NUMBER_THREE, childCallbackData); -} - -void RegisterParentContainerEvents(ArkUI_NodeHandle outerColumn) -{ - KeyEventCallbackData* parentCallbackData = - CreateCallbackData(outerColumn, "Parent Column Container", NODE_ON_KEY_EVENT); - - OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(outerColumn, NODE_ON_KEY_EVENT, NUMBER_ZERO, parentCallbackData); - OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(outerColumn, NODE_ON_FOCUS, NUMBER_TWO, parentCallbackData); - OH_ArkUI_NodeAPI_GetAPI()->registerNodeEvent(outerColumn, NODE_ON_BLUR, NUMBER_THREE, parentCallbackData); -} - -ArkUI_NodeHandle KeyEventHandler::CreateEventPropagationDemo() -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Creating event propagation demo"); - - // 创建外层Column容器 - ArkUI_NodeHandle outerColumn = OH_ArkUI_NodeAPI_GetAPI()->createNode(ARKUI_NODE_COLUMN); - if (!outerColumn) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "Failed to create outer column node"); - return nullptr; - } - - SetOuterColumnAttribute(outerColumn); - - // 创建并配置子Button - ArkUI_NodeHandle childButton = CreateChildButton(); - if (childButton) { - RegisterChildButtonEvents(childButton); - OH_ArkUI_NodeAPI_GetAPI()->addChild(outerColumn, childButton); - } - - // 注册父容器事件 - RegisterParentContainerEvents(outerColumn); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Event propagation demo created successfully"); - - return outerColumn; -} - -void KeyEventHandler::GlobalEventReceiver(ArkUI_NodeEvent* event) -{ - if (!event) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "GlobalEventReceiver: Event is null"); - return; - } - - ArkUI_NodeEventType eventType = OH_ArkUI_NodeEvent_GetEventType(event); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "GlobalEventReceiver: eventType=%{public}d, targetId=%{public}d", eventType, - OH_ArkUI_NodeEvent_GetTargetId(event)); - - void* userData = OH_ArkUI_NodeEvent_GetUserData(event); - if (!userData) { - OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_PRINT_DOMAIN, "KeyEventHandler", "No user data found"); - return; - } - - KeyEventCallbackData* callbackData = static_cast(userData); - - // 根据事件类型分发处理 - switch (eventType) { - case NODE_ON_CLICK: - OnButtonClick(event); - break; - case NODE_ON_FOCUS: - UpdateButtonFocusState(callbackData->buttonNode, true); - break; - case NODE_ON_BLUR: - UpdateButtonFocusState(callbackData->buttonNode, false); - break; - default: - // 处理按键事件 - if (eventType == callbackData->eventType) { - HandleKeyEventWithUserData(event); - } - break; - } -} - -bool ProcessChildButtonKeyEvent(KeyEventCallbackData* callbackData, const ArkUI_UIInputEvent* inputEvent) -{ - int32_t keyCode = OH_ArkUI_KeyEvent_GetKeyCode(inputEvent); - if (keyCode == ArkUI_KeyCode::ARKUI_KEYCODE_ESCAPE) { // ESC键 - 演示SetConsumed - KeyEventHandler::DemoKeyEventSetConsumed(inputEvent); - OH_LOG_Print( - LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Child Button: ESC key pressed - Event CONSUMED"); - return true; // 事件已消费,停止后续处理 - } else if (keyCode == ArkUI_KeyCode::ARKUI_KEYCODE_F1) { // F1键 - 演示StopPropagation - KeyEventHandler::DemoKeyEventStopPropagation(inputEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Child Button: F1 key pressed - Event propagation STOPPED"); - return true; // 事件传播已停止,停止后续处理 - } else { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Child Button: Normal key pressed - Event will propagate to parent"); - return false; // 继续正常处理 - } -} - -void ProcessParentContainerKeyEvent(KeyEventCallbackData* callbackData) -{ - // 父容器的按键事件处理 - 更改颜色以显示收到事件 - KeyEventHandler::UpdateParentContainerEventFeedback(callbackData->buttonNode, true); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Parent Container received key event - child did not consume/stop it"); - - // 延迟恢复原始颜色 - static int resetCounter = 0; - resetCounter++; - if (resetCounter > NUMBER_TEN) { - resetCounter = 0; - } -} - -std::string GetEventTypeDisplayName(ArkUI_NodeEventType eventType) -{ - switch (eventType) { - case NODE_ON_KEY_EVENT: - return "KEY EVENT"; - case NODE_ON_KEY_PRE_IME: - return "PRE-IME EVENT"; - case NODE_DISPATCH_KEY_EVENT: - return "DISPATCH EVENT"; - default: - return "UNKNOWN EVENT"; - } -} - -std::string CreateEventInfo(KeyEventCallbackData* callbackData, const ArkUI_UIInputEvent* inputEvent) -{ - KeyEventHandler* instance = KeyEventHandler::GetInstance(); - if (!instance) { - return "Instance not available"; - } - - std::string eventTypeName = GetEventTypeDisplayName(callbackData->eventType); - std::string info = instance->GetKeyEventInfo(inputEvent); - - // 如果是事件冒泡演示,添加额外信息 - if (callbackData->originalLabel.find("Child Button") != std::string::npos || - callbackData->originalLabel.find("Parent Column") != std::string::npos) { - int32_t keyCode = OH_ArkUI_KeyEvent_GetKeyCode(inputEvent); - std::string componentType = - callbackData->originalLabel.find("Child Button") != std::string::npos ? "Child" : "Parent"; - - if (keyCode == ArkUI_KeyCode::ARKUI_KEYCODE_ESCAPE) { - info += " ESC键被" + componentType + "处理-SetConsumed(true)"; - } else if (keyCode == ArkUI_KeyCode::ARKUI_KEYCODE_F1) { - info += " F1键被" + componentType + "处理-StopPropagation(true)"; - } else { - info += " 普通按键被" + componentType + "处理-正常传播"; - } - } - - return eventTypeName + ": " + info + " API调用完成-查看日志详情!"; -} - -void KeyEventHandler::HandleKeyEventWithUserData(ArkUI_NodeEvent* event) -{ - if (!event) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "HandleKeyEventWithUserData: Event is null"); - return; - } - - void* userData = OH_ArkUI_NodeEvent_GetUserData(event); - if (!userData) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "User data is null"); - return; - } - - KeyEventCallbackData* callbackData = static_cast(userData); - const ArkUI_UIInputEvent* inputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); - - if (inputEvent) { - // 检查是否是事件冒泡演示组件 - if (callbackData->originalLabel.find("Child Button") != std::string::npos) { - bool shouldStop = ProcessChildButtonKeyEvent(callbackData, inputEvent); - // 无论事件是否被消费/阻止传播,都要更新Child Button的标签和颜色以显示收到事件 - UpdateButtonLabel(callbackData, inputEvent); - if (shouldStop) { - // 如果事件被消费或阻止传播,在更新标签后返回,不传播到父容器 - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Child button key event consumed/stopped - updated button but stopping propagation"); - return; - } - } else if (callbackData->originalLabel.find("Parent Column") != std::string::npos) { - ProcessParentContainerKeyEvent(callbackData); - // 更新Button标签 - UpdateButtonLabel(callbackData, inputEvent); - } else { - // 普通按钮的处理 - UpdateButtonLabel(callbackData, inputEvent); - } - - // 同时更新全局显示 - KeyEventHandler* instance = GetInstance(); - if (instance) { - std::string displayText = CreateEventInfo(callbackData, inputEvent); - instance->UpdateKeyEventDisplay(displayText); - } - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Key event handled with user data and API demos completed"); -} - -std::string CreateButtonLabelText(KeyEventCallbackData* callbackData, const ArkUI_UIInputEvent* inputEvent) -{ - std::ostringstream oss; - oss << callbackData->originalLabel; - oss << " [" << callbackData->eventCount << "]"; - - KeyEventHandler* instance = KeyEventHandler::GetInstance(); - if (instance) { - int32_t keyCode = OH_ArkUI_KeyEvent_GetKeyCode(inputEvent); - ArkUI_KeyEventType eventType = OH_ArkUI_KeyEvent_GetType(inputEvent); - - std::string keyName = instance->GetKeyCodeName(keyCode); - std::string typeName = instance->GetKeyEventTypeName(static_cast(eventType)); - oss << " " << keyName << "(" << typeName << ")"; - } - - return oss.str(); -} - -void UpdateButtonVisualFeedback(ArkUI_NodeHandle buttonNode, const std::string& originalLabel) -{ - // 所有按钮收到按键事件时都变色,以便用户清楚看到事件传播现象 - if (originalLabel.find("Child Button") != std::string::npos) { - // Child Button - UIUtils::SetNodeBackgroundColor(buttonNode, 0xFFFFEBEE); // 浅红色背景 - UIUtils::SetNodeBorder(buttonNode, 3.0f, 0xFFE57373); // 红色边框 - } else if (originalLabel.find("Parent Column") != std::string::npos) { - // Parent Column 通过专门的函数处理,这里不处理 - // UpdateParentContainerEventFeedback 函数会处理父容器的变色 - } else { - // 普通按钮变为浅红色 - UIUtils::SetNodeBackgroundColor(buttonNode, 0xFFFFEBEE); // 浅红色背景 - UIUtils::SetNodeBorder(buttonNode, 3.0f, 0xFFE57373); // 红色边框 - } -} - -void KeyEventHandler::UpdateButtonLabel(KeyEventCallbackData* callbackData, const ArkUI_UIInputEvent* inputEvent) -{ - if (!callbackData || !inputEvent) { - return; - } - - // 增加事件计数 - callbackData->eventCount++; - - // 创建新的标签文本 - callbackData->currentLabel = CreateButtonLabelText(callbackData, inputEvent); - - // 更新Button的标签 - ArkUI_AttributeItem labelItem = { .string = callbackData->currentLabel.c_str() }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(callbackData->buttonNode, NODE_BUTTON_LABEL, &labelItem); - - // 更新Button颜色 - UpdateButtonVisualFeedback(callbackData->buttonNode, callbackData->originalLabel); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Button label updated: %{public}s", - callbackData->currentLabel.c_str()); -} - -std::string GetBasicKeyEventInfo(const ArkUI_UIInputEvent* event) -{ - std::ostringstream oss; - - int32_t keyCode = OH_ArkUI_KeyEvent_GetKeyCode(event); - ArkUI_KeyEventType eventType = OH_ArkUI_KeyEvent_GetType(event); - - KeyEventHandler* instance = KeyEventHandler::GetInstance(); - if (instance) { - std::string keyName = instance->GetKeyCodeName(keyCode); - std::string typeName = instance->GetKeyEventTypeName(static_cast(eventType)); - - oss << "Key:" << keyName << "(" << keyCode << ") "; - oss << "\nType:" << typeName << " "; - } - - return oss.str(); -} - -std::string GetKeySourceInfo(const ArkUI_UIInputEvent* event) -{ - ArkUI_KeySourceType sourceType = OH_ArkUI_KeyEvent_GetKeySource(event); - std::string sourceName; - switch (sourceType) { - case ARKUI_KEY_SOURCE_TYPE_KEYBOARD: - sourceName = "KEYBOARD"; - break; - case ARKUI_KEY_SOURCE_TYPE_MOUSE: - sourceName = "MOUSE"; - break; - case ARKUI_KEY_SOURCE_TYPE_JOYSTICK: - sourceName = "JOYSTICK"; - break; - default: - sourceName = "UNK"; - break; - } - return "/Source:" + sourceName + "\n"; -} - -std::string GetKeyTextAndUnicodeInfo(const ArkUI_UIInputEvent* event) -{ - std::ostringstream oss; - - // 获取按键文本 - const char* keyText = OH_ArkUI_KeyEvent_GetKeyText(event); - if (keyText && strlen(keyText) > 0) { - oss << "KeyText:" << keyText << " "; - } - oss << "\n"; - - // 获取Unicode值 - uint32_t unicode = OH_ArkUI_KeyEvent_GetUnicode(event); - oss << "Unicode:" << std::hex << unicode << std::dec << " "; - oss << "\n"; - - return oss.str(); -} - -std::string GetKeyIntentionInfo(const ArkUI_UIInputEvent* event) -{ - std::ostringstream oss; - - ArkUI_KeyIntension intention = OH_ArkUI_KeyEvent_GetKeyIntensionCode(event); - if (intention != ARKUI_KEY_INTENSION_UNKNOWN) { - oss << "意图:" << static_cast(intention) << " "; - } - oss << "\n"; - - return oss.str(); -} - -std::string GetLockKeysInfo(const ArkUI_UIInputEvent* event) -{ - std::ostringstream oss; - - bool numLock = false; - bool capsLock = false; - bool scrollLock = false; - ArkUI_ErrorCode result1 = OH_ArkUI_KeyEvent_IsNumLockOn(event, &numLock); - ArkUI_ErrorCode result2 = OH_ArkUI_KeyEvent_IsCapsLockOn(event, &capsLock); - ArkUI_ErrorCode result3 = OH_ArkUI_KeyEvent_IsScrollLockOn(event, &scrollLock); - - oss << "Locks: "; - if (result1 == ARKUI_ERROR_CODE_NO_ERROR) { - oss << "Num" << (numLock ? "✓" : "✗") << " "; - } - if (result2 == ARKUI_ERROR_CODE_NO_ERROR) { - oss << "Caps" << (capsLock ? "✓" : "✗") << " "; - } - if (result3 == ARKUI_ERROR_CODE_NO_ERROR) { - oss << "Scroll" << (scrollLock ? "✓" : "✗"); - } - oss << "\n"; - - return oss.str(); -} - -std::string KeyEventHandler::GetKeyEventInfo(const ArkUI_UIInputEvent* event) -{ - if (!event) { - return "Invalid event"; - } - - std::ostringstream oss; - - // 使用Native Key Event API获取按键信息 - try { - oss << GetBasicKeyEventInfo(event); - oss << GetKeySourceInfo(event); - oss << GetKeyTextAndUnicodeInfo(event); - oss << GetKeyIntentionInfo(event); - oss << GetLockKeysInfo(event); - } catch (...) { - // 如果API调用失败,返回基本信息 - oss << "Key Event Detected\n"; - } - - return oss.str(); -} - -std::string KeyEventHandler::GetKeyCodeName(int32_t keyCode) -{ - // 简化版本的按键码名称映射 - switch (keyCode) { - case ArkUI_KeyCode::ARKUI_KEYCODE_0: - return "KEY_0"; - case ArkUI_KeyCode::ARKUI_KEYCODE_1: - return "KEY_1"; - case ArkUI_KeyCode::ARKUI_KEYCODE_2: - return "KEY_2"; - case ArkUI_KeyCode::ARKUI_KEYCODE_3: - return "KEY_3"; - case ArkUI_KeyCode::ARKUI_KEYCODE_4: - return "KEY_4"; - case ArkUI_KeyCode::ARKUI_KEYCODE_5: - return "KEY_5"; - case ArkUI_KeyCode::ARKUI_KEYCODE_6: - return "KEY_6"; - case ArkUI_KeyCode::ARKUI_KEYCODE_7: - return "KEY_7"; - case ArkUI_KeyCode::ARKUI_KEYCODE_8: - return "KEY_8"; - case ArkUI_KeyCode::ARKUI_KEYCODE_9: - return "KEY_9"; - case ArkUI_KeyCode::ARKUI_KEYCODE_A: - return "KEY_A"; - case ArkUI_KeyCode::ARKUI_KEYCODE_B: - return "KEY_B"; - case ArkUI_KeyCode::ARKUI_KEYCODE_C: - return "KEY_C"; - case ArkUI_KeyCode::ARKUI_KEYCODE_D: - return "KEY_D"; - case ArkUI_KeyCode::ARKUI_KEYCODE_SPACE: - return "SPACE"; - case ArkUI_KeyCode::ARKUI_KEYCODE_ENTER: - return "ENTER"; - case ArkUI_KeyCode::ARKUI_KEYCODE_DEL: - return "BACKSPACE"; - case ArkUI_KeyCode::ARKUI_KEYCODE_ESCAPE: - return "ESCAPE"; - default: - return "OTHER(" + std::to_string(keyCode) + ")"; - } -} - -std::string KeyEventHandler::GetKeyEventTypeName(int32_t eventType) -{ - switch (eventType) { - case ArkUI_KeyEventType::ARKUI_KEY_EVENT_DOWN: - return "KEY_DOWN"; - case ArkUI_KeyEventType::ARKUI_KEY_EVENT_UP: - return "KEY_UP"; - case ArkUI_KeyEventType::ARKUI_KEY_EVENT_LONG_PRESS: - return "KEY_LONG_PRESS"; - case ArkUI_KeyEventType::ARKUI_KEY_EVENT_CLICK: - return "KEY_CLICK"; - default: - return "UNKNOWN_TYPE"; - } -} - -void KeyEventHandler::UpdateKeyEventDisplay(const std::string& info) -{ - if (!displayNode_) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "Display node is null"); - return; - } - - lastKeyEventInfo_ = info; - - // 更新文本内容 - ArkUI_AttributeItem item = { .string = info.c_str() }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(displayNode_, NODE_TEXT_CONTENT, &item); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Display updated: %{public}s", info.c_str()); -} - -std::string GetClickDisplayText(KeyEventCallbackData* callbackData) -{ - if (callbackData->originalLabel.find("Child Button") != std::string::npos) { - return "Event Propagation Demo Focused!\n\n" - "按键事件测试:\n" - "• 按ESC键:调用SetConsumed(true)消费事件\n" - "• 按F1键:调用StopPropagation(true)阻止冒泡\n" - "• 按其他键:正常事件传播\n" - "查看日志了解详细API调用信息"; - } else if (callbackData->originalLabel.find("Parent Column") != std::string::npos) { - return "Parent Container Focused!\n\n" - "父容器接收到按键事件时会显示:\n" - "• 事件是否被子组件消费\n" - "• 事件是否被阻止冒泡\n" - "• 完整的按键信息"; - } else { - // 普通事件按钮的显示信息 - std::string eventTypeName = GetEventTypeDisplayName(callbackData->eventType); - return eventTypeName + " Button Focused!\n\nPress any key to test the event..."; - } -} - -void KeyEventHandler::OnButtonClick(ArkUI_NodeEvent* event) -{ - if (!event) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "OnButtonClick: Event is null"); - return; - } - - void* userData = OH_ArkUI_NodeEvent_GetUserData(event); - if (!userData) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "OnButtonClick: User data is null"); - return; - } - - KeyEventCallbackData* callbackData = static_cast(userData); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Button clicked, requesting focus"); - - // 主动请求焦点 - ArkUI_NumberValue focusValue = { .i32 = 1 }; - ArkUI_AttributeItem focusItem = { .value = &focusValue, .size = 1 }; - OH_ArkUI_NodeAPI_GetAPI()->setAttribute(callbackData->buttonNode, NODE_FOCUS_STATUS, &focusItem); - - // 更新显示信息 - KeyEventHandler* instance = GetInstance(); - if (instance) { - std::string displayText = GetClickDisplayText(callbackData); - instance->UpdateKeyEventDisplay(displayText); - } -} - -void KeyEventHandler::UpdateButtonFocusState(ArkUI_NodeHandle buttonNode, bool hasFocus) -{ - if (!buttonNode) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "UpdateButtonFocusState: Button node is null"); - return; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Button focus state changed: %{public}s", - hasFocus ? "focused" : "blurred"); - - // 根据焦点状态更新Button的视觉效果 - if (hasFocus) { - // 获得焦点时的样式 - 更亮的蓝色和边框 - UIUtils::SetNodeBackgroundColor(buttonNode, 0xFF2E86DE); - UIUtils::SetNodeBorder(buttonNode, 2.0f, 0xFF1B4F9C); - } else { - // 失去焦点时的样式 - 恢复原始颜色 - UIUtils::SetNodeBackgroundColor(buttonNode, 0xFF4A90E2); - UIUtils::SetNodeBorder(buttonNode, 0.0f, 0x00000000); // 移除边框 - } -} - -void KeyEventHandler::DemoKeyEventSetConsumed(const ArkUI_UIInputEvent* event) -{ - if (!event) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "DemoKeyEventSetConsumed: Event is null"); - return; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Demo: OH_ArkUI_KeyEvent_SetConsumed"); - - // 演示OH_ArkUI_KeyEvent_SetConsumed API的使用 - try { - int32_t keyCode = OH_ArkUI_KeyEvent_GetKeyCode(event); - ArkUI_KeyEventType eventType = OH_ArkUI_KeyEvent_GetType(event); - - // 设置事件为已消费状态 - ESC键触发此演示 - OH_ArkUI_KeyEvent_SetConsumed(event, true); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Key event consumed - KeyCode: %{public}d (ESC)", keyCode); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Event marked as consumed, preventing further propagation"); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Event consumption status set for Type: %{public}d", eventType); - } catch (...) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "Failed to set event consumed status"); - } -} - -void KeyEventHandler::DemoKeyEventStopPropagation(const ArkUI_UIInputEvent* event) -{ - if (!event) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "DemoKeyEventStopPropagation: Event is null"); - return; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Demo: OH_ArkUI_KeyEvent_StopPropagation"); - - // 演示OH_ArkUI_KeyEvent_StopPropagation API的使用 - try { - int32_t keyCode = OH_ArkUI_KeyEvent_GetKeyCode(event); - ArkUI_KeyEventType eventType = OH_ArkUI_KeyEvent_GetType(event); - - // 阻止事件冒泡 - F1键触发此演示 - OH_ArkUI_KeyEvent_StopPropagation(event, true); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Event propagation stopped for F1 Key - KeyCode: %{public}d", keyCode); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "F1 key event blocked from bubbling up to parent components"); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Propagation control applied for event Type: %{public}d", eventType); - } catch (...) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", "Failed to control event propagation"); - } -} - -void KeyEventHandler::UpdateParentContainerEventFeedback(ArkUI_NodeHandle containerNode, bool eventReceived) -{ - if (!containerNode) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "KeyEventHandler", - "UpdateParentContainerEventFeedback: Container node is null"); - return; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Updating parent container visual feedback: %{public}s", eventReceived ? "event received" : "reset"); - - if (eventReceived) { - // 父容器收到按键事件时 - 变为红色表示事件传播到了父级 - UIUtils::SetNodeBackgroundColor(containerNode, 0xFFFFEBEE); // 浅红色背景 - UIUtils::SetNodeBorder(containerNode, 3.0f, 0xFFE57373); // 红色边框 - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", - "Parent container highlighted - key event propagated!"); - } else { - // 恢复原始样式 - 浅绿色表示正常状态 - UIUtils::SetNodeBackgroundColor(containerNode, 0xFFE8F5E8); - UIUtils::SetNodeBorder(containerNode, 2.0f, 0xFF4CAF50); // 绿色边框 - - OH_LOG_Print( - LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "KeyEventHandler", "Parent container restored to normal state"); - } -} - -} // namespace KeyEventSample diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/key_event_handler.h b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/key_event_handler.h deleted file mode 100644 index f505b8937484d29881482501875042455ee66db8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/key_event_handler.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef KEY_EVENT_HANDLER_H -#define KEY_EVENT_HANDLER_H - -#include -#include -#include -#include -#include - - -namespace KeyEventSample { - -// 按键事件回调数据结构 -struct KeyEventCallbackData { - ArkUI_NodeHandle buttonNode; // Button节点引用 - std::string originalLabel; // 原始标签文本 - std::string currentLabel; // 当前标签文本 - int eventCount; // 事件计数 - ArkUI_NodeEventType eventType; // 事件类型 -}; - -class KeyEventHandler { -public: - static KeyEventHandler* GetInstance(); - - // 初始化按键事件处理器 - void Initialize(); - - // 创建带有按键事件的UI组件 - ArkUI_NodeHandle CreateKeyEventNode(); - - // 创建Button组件并设置按键事件 - ArkUI_NodeHandle CreateKeyEventButton(const std::string& label, ArkUI_NodeEventType eventType); - - // 创建事件冒泡和消费演示场景 - ArkUI_NodeHandle CreateEventPropagationDemo(); - - // 全局事件接收器 - static void GlobalEventReceiver(ArkUI_NodeEvent* event); - - // 按键事件处理函数(通过userdata获取回调信息) - static void HandleKeyEventWithUserData(ArkUI_NodeEvent* event); - - // 更新Button标签 - static void UpdateButtonLabel(KeyEventCallbackData* callbackData, const ArkUI_UIInputEvent* inputEvent); - - // 处理Button点击事件(请求焦点) - static void OnButtonClick(ArkUI_NodeEvent* event); - - // 更新Button的焦点状态显示 - static void UpdateButtonFocusState(ArkUI_NodeHandle buttonNode, bool hasFocus); - - // API示例函数 - static void DemoKeyEventSetConsumed(const ArkUI_UIInputEvent* event); - static void DemoKeyEventStopPropagation(const ArkUI_UIInputEvent* event); - - // 更新父容器事件反馈 - static void UpdateParentContainerEventFeedback(ArkUI_NodeHandle containerNode, bool eventReceived); - - // 获取按键信息的字符串表示 - std::string GetKeyEventInfo(const ArkUI_UIInputEvent* event); - std::string GetKeyCodeName(int32_t keyCode); - std::string GetKeyEventTypeName(int32_t eventType); - - // 更新UI显示 - void UpdateKeyEventDisplay(const std::string& info); - - // 获取显示节点 - ArkUI_NodeHandle GetDisplayNode() - { - return displayNode_; - } - -private: - KeyEventHandler() = default; - ~KeyEventHandler() = default; - - static KeyEventHandler* instance_; - ArkUI_NodeHandle displayNode_; - std::string lastKeyEventInfo_; -}; - -} // namespace KeyEventSample - -#endif // KEY_EVENT_HANDLER_H diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/manager.cpp b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/manager.cpp deleted file mode 100644 index 42d0e55662210072c6be2fd3cee3be58618fb3e5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "manager.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "napi/native_api.h" - -namespace NativeXComponentSample { -Manager Manager::manager_; - -Manager::~Manager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "~Manager"); - for (auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for (auto iter = containerMap_.begin(); iter != containerMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - containerMap_.clear(); -} - -static ArkUI_NativeNodeAPI_1* nodeAPI = nullptr; - -void CreateKeyEventSample(napi_env env, napi_value arg, OH_NativeXComponent* component) -{ - // 初始化按键事件处理器 - KeyEventSample::KeyEventHandler* keyHandler = KeyEventSample::KeyEventHandler::GetInstance(); - keyHandler->Initialize(); - - // 创建按键事件的UI组件 - ArkUI_NodeHandle keyEventNode = keyHandler->CreateKeyEventNode(); - if (keyEventNode) { - OH_NativeXComponent_AttachNativeRootNode(component, keyEventNode); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Manager", "Key event sample UI created successfully"); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Failed to create key event sample UI"); - } -} - -napi_value Manager::CreateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode env or info is null"); - return nullptr; - } - - size_t argCnt = 2; - napi_value args[2] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "CreateNativeNode napi_get_cb_info failed"); - } - - if (argCnt < 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent* component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); - - if (nodeAPI != nullptr) { - if (nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { - CreateKeyEventSample(env, args[1], component); - } - } - return nullptr; -} - -napi_value Manager::UpdateNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode env or info is null"); - return nullptr; - } - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "UpdateNativeNode"); - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "UpdateNativeNode napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_string) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - constexpr uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - size_t length; - if (napi_get_value_string_utf8(env, args[0], idStr, idSize, &length) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "UpdateNativeNode %{public}s", idStr); - - auto manager = Manager::GetInstance(); - if (manager == nullptr) { - return nullptr; - } - - OH_NativeXComponent* component = manager->GetNativeXComponent(idStr); - if (component == nullptr) { - return nullptr; - } - - return nullptr; -} - -napi_value Manager::GetContext(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "GetContext napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_number) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - int64_t value; - if (napi_get_value_int64(env, args[0], &value) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_create_object failed"); - return nullptr; - } - - return exports; -} - -void Manager::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent* nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Manager", "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto manager = Manager::GetInstance(); - if ((manager != nullptr) && (nativeXComponent != nullptr)) { - manager->SetNativeXComponent(id, nativeXComponent); - } -} - -void Manager::SetNativeXComponent(std::string& id, OH_NativeXComponent* nativeXComponent) -{ - if (nativeXComponent == nullptr) { - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent* tmp = nativeXComponentMap_[id]; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -OH_NativeXComponent* Manager::GetNativeXComponent(const std::string& id) -{ - return nativeXComponentMap_[id]; -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/manager.h b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/manager.h deleted file mode 100644 index 41f74bafab8683d0c7c9cd5d4e9e6ad831b444cb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "container.h" -#include "key_event_handler.h" - -namespace NativeXComponentSample { -const int MAX_SIZE = 11; -class Manager { -public: - ~Manager(); - - static Manager* GetInstance() - { - return &Manager::manager_; - } - - static napi_value GetContext(napi_env env, napi_callback_info info); - static napi_value CreateNativeNode(napi_env env, napi_callback_info info); - static napi_value UpdateNativeNode(napi_env env, napi_callback_info info); - - void SetNativeXComponent(std::string& id, OH_NativeXComponent* nativeXComponent); - OH_NativeXComponent* GetNativeXComponent(const std::string& id); - - void Export(napi_env env, napi_value exports); - -private: - static Manager manager_; - - std::unordered_map nativeXComponentMap_; - std::unordered_map containerMap_; - ArkUI_NodeHandle button_; - ArkUI_NodeHandle textShow_; - ArkUI_NodeHandle textShow2_; - ArkUI_GestureRecognizer* currentRecognizer_ = nullptr; - ArkUI_GestureRecognizer* childRecognizer_ = nullptr; - ArkUI_GestureRecognizerType list_[3] = { TAP_GESTURE, LONG_PRESS_GESTURE, PAN_GESTURE }; - int32_t index_ = 0; - float lastOffset_ = 0.0f; - int customData_ = 2; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 1ebee157faa8ccf9c15a7cd9ab28e356f824a7a6..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = { nullptr }; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 846e4c7e13ead48abe6019bd40f3a13bf8f9c083..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/NdkKeyEvent/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 252b7dad746191e35c874f2fc83685e3c8ae115b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkKeyEvent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/NdkKeyEvent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1504a74f09dfdcfae408be979f99369a2c5affab..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkKeyEvent/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NdkKeyEvent/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index c761abdc7538364c9957bb9066482f979715f02b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2025 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 nativeNode from 'libnativeNode.so'; - -@Entry -@Component -struct KeyEventSample { - @State eventInfo: string = '🎹 按任意键查看按键事件信息...'; - @State lastKeyEvent: string = ''; - @State keyEventCount: number = 0; - - build() { - Column() { - // 标题区域 - Row() { - Text('🎹 按键事件示例') - .fontSize(24) - .fontWeight(FontWeight.Bold) - .fontColor(Color.White) - .textAlign(TextAlign.Center) - } - .width('100%') - .height(80) - .backgroundColor('#4A90E2') - .justifyContent(FlexAlign.Center) - .alignItems(VerticalAlign.Center) - - Scroll() { - Column({ space: 20 }) { - // 说明区域 - Column({ space: 10 }) { - Text('本示例展示了Native API (CAPI) 中的按键事件处理功能,包括:') - .fontSize(14) - .fontColor('#666666') - .textAlign(TextAlign.Start) - - Column({ space: 5 }) { - Text('• NODE_ON_KEY_EVENT - 标准按键事件处理') - .fontSize(12) - .fontColor('#888888') - .textAlign(TextAlign.Start) - Text('• NODE_ON_KEY_PRE_IME - 输入法前置按键事件') - .fontSize(12) - .fontColor('#888888') - .textAlign(TextAlign.Start) - Text('• NODE_DISPATCH_KEY_EVENT - 按键事件分发处理') - .fontSize(12) - .fontColor('#888888') - .textAlign(TextAlign.Start) - Text('• 事件冒泡与消费机制演示 (Column+Button层级结构)') - .fontSize(12) - .fontColor('#FF6B6B') - .textAlign(TextAlign.Start) - .fontWeight(FontWeight.Medium) - } - .alignItems(HorizontalAlign.Start) - .width('100%') - } - .width('95%') - .padding(15) - .backgroundColor('#F8F9FA') - .borderRadius(12) - .alignItems(HorizontalAlign.Start) - - // 统计信息 - Row() { - Column() { - Text(this.keyEventCount.toString()) - .fontSize(20) - .fontWeight(FontWeight.Bold) - .fontColor('#4A90E2') - Text('按键次数') - .fontSize(12) - .fontColor('#666666') - } - .justifyContent(FlexAlign.Center) - - Divider() - .vertical(true) - .height(40) - .color('#E0E0E0') - - Column() { - Text(this.lastKeyEvent || 'None') - .fontSize(16) - .fontWeight(FontWeight.Medium) - .fontColor('#FF6B6B') - .maxLines(1) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - Text('最后按键') - .fontSize(12) - .fontColor('#666666') - } - .justifyContent(FlexAlign.Center) - .layoutWeight(1) - } - .width('95%') - .height(70) - .padding(15) - .backgroundColor(Color.White) - .borderRadius(12) - .shadow({ radius: 5, color: '#E0E0E0', offsetX: 2, offsetY: 2 }) - .justifyContent(FlexAlign.SpaceEvenly) - - // Native组件区域 - Column() { - Text('🎯 Native 按键事件组件') - .fontSize(16) - .fontWeight(FontWeight.Medium) - .fontColor('#333333') - .margin({ bottom: 10 }) - - XComponent({ - id: 'keyEventSample', - type: XComponentType.NODE, - libraryname: 'nativeNode' - }) - .onAppear(() => { - nativeNode.createNativeNode("keyEventSample", this.getUIContext()); - }) - .width('100%') - .height(600) - .backgroundColor('#FFFFFF') - .borderRadius(12) - .border({ - width: 2, - color: '#4A90E2', - style: BorderStyle.Dashed - }) - .focusable(true) - .onKeyEvent((event) => { - this.handleKeyEvent(event); - }) - } - .id('testKeyEvent') - .width('95%') - .padding(15) - .backgroundColor('#F0F8FF') - .borderRadius(12) - .alignItems(HorizontalAlign.Start) - - // 使用说明 - Column({ space: 8 }) { - Text('💡 使用说明') - .fontSize(16) - .fontWeight(FontWeight.Medium) - .fontColor('#333333') - - Text('📌 基础功能测试:') - .fontSize(13) - .fontColor('#4A90E2') - .fontWeight(FontWeight.Medium) - Text('1. 点击上方Native组件区域使其获得焦点') - .fontSize(12) - .fontColor('#666666') - Text('2. 点击三个按钮测试不同的按键事件处理类型') - .fontSize(12) - .fontColor('#666666') - Text('3. 使用键盘输入按键,观察事件信息的实时更新') - .fontSize(12) - .fontColor('#666666') - - Text('🔄 事件冒泡与消费测试:') - .fontSize(13) - .fontColor('#FF6B6B') - .fontWeight(FontWeight.Medium) - Text('4. 在事件冒泡演示区域的子按钮上:') - .fontSize(12) - .fontColor('#666666') - Text(' • 按 ESC 键 - 演示事件消费 (SetConsumed)') - .fontSize(12) - .fontColor('#666666') - Text(' • 按 F1 键 - 演示阻止事件冒泡 (StopPropagation)') - .fontSize(12) - .fontColor('#666666') - Text(' • 按其他键 - 事件正常冒泡到父容器') - .fontSize(12) - .fontColor('#666666') - Text('5. 支持常用按键:字母、数字、方向键、功能键等') - .fontSize(12) - .fontColor('#666666') - } - .width('95%') - .padding(15) - .backgroundColor('#FFF9E6') - .borderRadius(12) - .alignItems(HorizontalAlign.Start) - - } - } - .id('testScroll') - .layoutWeight(1) - .width('100%') - .padding({ top: 20, bottom: 20 }) - - } - .width('100%') - .height('100%') - .backgroundColor('#F5F5F5') - } - - private handleKeyEvent(event: KeyEvent) { - this.keyEventCount++; - - // 获取按键名称 - let keyName = this.getKeyName(event.keyCode); - this.lastKeyEvent = keyName; - - // 更新事件信息 - let eventType = this.getEventTypeName(event.type); - let timestamp = new Date().toLocaleTimeString(); - - this.eventInfo = `🔍 ETS 按键事件详情:\n` + - `🔑 按键: ${keyName} (${event.keyCode})\n` + - `📝 事件类型: ${eventType}\n` + - `📈 总计次数: ${this.keyEventCount}`; - } - - private getKeyName(keyCode: number): string { - const keyMap: Record = { - 2000: 'KEY_0', 2001: 'KEY_1', 2002: 'KEY_2', 2003: 'KEY_3', 2004: 'KEY_4', - 2005: 'KEY_5', 2006: 'KEY_6', 2007: 'KEY_7', 2008: 'KEY_8', 2009: 'KEY_9', - 2017: 'KEY_A', 2018: 'KEY_B', 2019: 'KEY_C', 2020: 'KEY_D', 2021: 'KEY_E', - 2022: 'KEY_F', 2023: 'KEY_G', 2024: 'KEY_H', 2025: 'KEY_I', 2026: 'KEY_J', - 2027: 'KEY_K', 2028: 'KEY_L', 2029: 'KEY_M', 2030: 'KEY_N', 2031: 'KEY_O', - 2032: 'KEY_P', 2033: 'KEY_Q', 2034: 'KEY_R', 2035: 'KEY_S', 2036: 'KEY_T', - 2037: 'KEY_U', 2038: 'KEY_V', 2039: 'KEY_W', 2040: 'KEY_X', 2041: 'KEY_Y', - 2042: 'KEY_Z', 2050: 'SPACE', 2054: 'ENTER', 2055: 'BACKSPACE', 2070: 'ESCAPE', - 2012: 'DPAD_UP', 2013: 'DPAD_DOWN', 2014: 'DPAD_LEFT', 2015: 'DPAD_RIGHT', - 2090: 'F1', 2091: 'F2', 2092: 'F3', 2093: 'F4', 2094: 'F5', 2095: 'F6', - 2096: 'F7', 2097: 'F8', 2098: 'F9', 2099: 'F10', 2100: 'F11', 2101: 'F12' - }; - - return keyMap[keyCode] || `UNKNOWN(${keyCode})`; - } - - private getEventTypeName(type: KeyType): string { - switch (type) { - case KeyType.Down: - return 'KEY_DOWN'; - case KeyType.Up: - return 'KEY_UP'; - default: - return 'UNKNOWN_TYPE'; - } - } -} diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/module.json5 b/ArkUIKit/NdkKeyEvent/entry/src/main/module.json5 deleted file mode 100644 index 1d783f389c78a73c75e6c782d07d3433877a671f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/element/color.json b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/element/string.json b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 5e22b758e6fccae8588590862649655f49372295..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkKeyEvent" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/background.png b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 5e22b758e6fccae8588590862649655f49372295..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkKeyEvent" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NdkKeyEvent/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 75ee7bc52256e716f142bbd79eefe8b6fcb29fa8..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NdkKeyEvent" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/mock/Libentry.mock.ets b/ArkUIKit/NdkKeyEvent/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index eebf1ed910f6a8f2a9e7e565aa71b179b7b8b537..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/mock/mock-config.json5 b/ArkUIKit/NdkKeyEvent/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/ets/test/KeyEventTest.test.ets b/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/ets/test/KeyEventTest.test.ets deleted file mode 100644 index a37bcde611aafd00456ce865f389bed028097d6b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/ets/test/KeyEventTest.test.ets +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; -import { abilityDelegatorRegistry, BY, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let want: Want; - -export default function KeyEventTest() { - describe('KeyEventTest', () => { - - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - beforeEach(async () => { - let driver = Driver.create(); - await driver.delayMs(1000); - }) - - afterEach(() => { - hilog.info(0x0000, 'KeyEventTest', 'Key event test case completed'); - }) - - afterAll(() => { - hilog.info(0x0000, 'KeyEventTest', 'All key event tests completed'); - }) - - /** - * @tc.number KeyEvent_001 - * @tc.name testButton1KeyEvent - * @tc.desc 测试Button1按键事件 - 滑动到Button1,点击获焦,按键A,验证颜色变化 - */ - it('testButton1KeyEvent', 0, async (done: Function) => { - hilog.info(0x0000, 'KeyEventTest', 'testButton1KeyEvent begin'); - let driver = Driver.create(); - await driver.delayMs(1000); - - try { - // 滑动到Button1的位置 - const scroll = await driver.findComponent(ON.id('testScroll')); - await scroll.scrollSearch(ON.id('testKeyEvent')); - await driver.delayMs(500); - - // 点击Button1获取焦点 - const button1 = await driver.findComponent(ON.id('Button1')); - await button1.click(); - await driver.delayMs(1000); - - // 验证Button1获得焦点后的颜色变化(焦点状态下的颜色) - let strJson = getInspectorByKey('Button1'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button1 focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - // 焦点状态下应该是更亮的蓝色 0xFF2E86DE - expect(obj.$attrs.backgroundColor).assertEqual('#FF2E86DE'); - - // 按键A,验证按键事件处理 - await driver.triggerKey(2017); // KEY_A - await driver.delayMs(1000); - - // 验证按键事件处理后Button1变浅红色 - strJson = getInspectorByKey('Button1'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button1 after key A backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFFEBEE'); - - } catch (error) { - hilog.error(0x0000, 'KeyEventTest', 'testButton1KeyEvent failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'KeyEventTest', 'testButton1KeyEvent end'); - done(); - }) - - /** - * @tc.number KeyEvent_002 - * @tc.name testButton2PreIME - * @tc.desc 测试Button2预输入法按键事件 - Button2获焦,测试PreIme事件类型 - */ - it('testButton2PreIME', 0, async (done: Function) => { - hilog.info(0x0000, 'KeyEventTest', 'testButton2PreIME begin'); - let driver = Driver.create(); - await driver.delayMs(1000); - - try { - // 滑动到测试区域 - const scroll = await driver.findComponent(ON.id('testScroll')); - await scroll.scrollSearch(ON.id('testKeyEvent')); - await driver.delayMs(1500); - - // 点击Button2获取焦点 - const button2 = await driver.findComponent(ON.id('Button2')); - await button2.click(); - await driver.delayMs(1000); - - // 验证Button2获得焦点后的颜色变化 - let strJson = getInspectorByKey('Button2'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button2 focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FF2E86DE'); - - // 按键B测试PreIME事件 - await driver.triggerKey(2018); // KEY_B - await driver.delayMs(1000); - - // 验证PreIME事件处理后Button2变浅红色 - strJson = getInspectorByKey('Button2'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button2 after key B backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFFEBEE'); - - } catch (error) { - hilog.error(0x0000, 'KeyEventTest', 'testButton2PreIME failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'KeyEventTest', 'testButton2PreIME end'); - done(); - }) - - /** - * @tc.number KeyEvent_003 - * @tc.name testButton3Dispatch - * @tc.desc 测试Button3分发按键事件 - Button3获焦,测试Dispatch事件类型 - */ - it('testButton3Dispatch', 0, async (done: Function) => { - hilog.info(0x0000, 'KeyEventTest', 'testButton3Dispatch begin'); - let driver = Driver.create(); - await driver.delayMs(1000); - - try { - // 滑动到测试区域 - const scroll = await driver.findComponent(ON.id('testScroll')); - await scroll.scrollSearch(ON.id('testKeyEvent')); - await driver.delayMs(500); - - // 点击Button3获取焦点 - const button3 = await driver.findComponent(ON.id('Button3')); - await button3.click(); - await driver.delayMs(1000); - - // 验证Button3获得焦点后的颜色变化 - let strJson = getInspectorByKey('Button3'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button3 focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FF2E86DE'); - - // 按键C测试Dispatch事件 - await driver.triggerKey(2019); // KEY_C - await driver.delayMs(1000); - - // 验证Dispatch事件处理后Button3变浅红色 - strJson = getInspectorByKey('Button3'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button3 after key C backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFFEBEE'); - - } catch (error) { - hilog.error(0x0000, 'KeyEventTest', 'testButton3Dispatch failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'KeyEventTest', 'testButton3Dispatch end'); - done(); - }) - - /** - * @tc.number KeyEvent_004 - * @tc.name testButton4EventControl - * @tc.desc 测试Button4事件控制 - Button4获焦,测试ESC、F1和A键,验证父组件颜色变化 - */ - it('testButton4EventControl', 0, async (done: Function) => { - hilog.info(0x0000, 'KeyEventTest', 'testButton4EventControl begin'); - let driver = Driver.create(); - await driver.delayMs(1000); - - try { - // 滑动到测试区域 - const scroll = await driver.findComponent(ON.id('testScroll')); - await scroll.scrollSearch(ON.id('testKeyEvent')); - await driver.delayMs(500); - - // 点击Button4获取焦点 - const button4 = await driver.findComponent(ON.id('Button4')); - await button4.click(); - await driver.delayMs(1000); - - // 验证Button4获得焦点后的颜色变化 - let strJson = getInspectorByKey('Button4'); - let obj: ESObject = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button4 focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FF2E86DE'); - - // 测试ESC键 - 应该被消费,父组件不变色 - await driver.triggerKey(2070); // ESC键 - await driver.delayMs(1000); - - // 父组件背景色应该保持正常状态 0xFFE8F5E8 - strJson = getInspectorByKey('parentColumn'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button4 focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FF2E86DE'); - hilog.info(0x0000, 'KeyEventTest', 'After ESC key - parent should not change color'); - - // 测试F1键 - 应该阻止传播,父组件不变色 - await driver.triggerKey(2090); // F1键 - await driver.delayMs(1000); - // 父组件背景色应该保持正常状态 0xFFE8F5E8 - strJson = getInspectorByKey('parentColumn'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button4 focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FF2E86DE'); - - hilog.info(0x0000, 'KeyEventTest', 'After F1 key - parent should not change color'); - - // 测试A键 - 应该正常传播,父组件变色 - await driver.triggerKey(2017); // KEY_A - await driver.delayMs(1000); - - strJson = getInspectorByKey('parentColumn'); - obj = JSON.parse(strJson); - hilog.info(0x0000, 'KeyEventTest', 'Button4 focus backgroundColor: %{public}s', obj.$attrs.backgroundColor); - expect(obj.$attrs.backgroundColor).assertEqual('#FFFFEBEE'); - - hilog.info(0x0000, 'KeyEventTest', 'After A key - parent should change color'); - } catch (error) { - hilog.error(0x0000, 'KeyEventTest', 'testButton4EventControl failed: %{public}s', error.message); - expect().assertFail(); - } - - hilog.info(0x0000, 'KeyEventTest', 'testButton4EventControl end'); - done(); - }) - - }) -} diff --git a/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 0d78b68acd1bc68f8352687c19845d4e1617eedc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import KeyEventTest from './KeyEventTest.test'; - -export default function testsuite() { - abilityTest(); - KeyEventTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/module.json5 b/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/module.json5 deleted file mode 100644 index 9983b2ba4e55e31a172f0328c82c9a75bfa00ded..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/NdkKeyEvent/entry/src/test/List.test.ets b/ArkUIKit/NdkKeyEvent/entry/src/test/List.test.ets deleted file mode 100644 index f1389499715f1bfeece9c0807dc40d216534623b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 KeyEventTest from '../ohosTest/ets/test/KeyEventTest.test'; -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/entry/src/test/LocalUnit.test.ets b/ArkUIKit/NdkKeyEvent/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/hvigor/hvigor-config.json5 b/ArkUIKit/NdkKeyEvent/hvigor/hvigor-config.json5 deleted file mode 100644 index 06cd7b9ed2566b9c4676235fbf6252399ecbe651..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.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*/ - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/hvigorfile.ts b/ArkUIKit/NdkKeyEvent/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/NdkKeyEvent/oh-package-lock.json5 b/ArkUIKit/NdkKeyEvent/oh-package-lock.json5 deleted file mode 100644 index 567c6d3a3c3bab23db56374ef33ac4aa4f58f45f..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/oh-package-lock.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.19": { - "name": "", - "version": "1.0.19", - "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.19.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/oh-package.json5 b/ArkUIKit/NdkKeyEvent/oh-package.json5 deleted file mode 100644 index f53e8a0a7a1ece7beea30f4f258eb44a2ebcbdc5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/ohosTest.md b/ArkUIKit/NdkKeyEvent/ohosTest.md deleted file mode 100644 index b9d3d9c0c2839403b28cd1630c78f8d459d63335..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkKeyEvent/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# NdkKeyEvent 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|------------------------------------------| -------------- |-------------------------------|-------------------------------------------------------| :------- | -------- | -| NODE_ON_KEY_EVENT示例验证 | 设备正常运行 | 进入首页,点击第一个Button后按下A | Button变成浅红色 | 是 | Pass | -| NODE_ON_KEY_PRE_IME示例代码验证 | 设备正常运行 | 进入首页,点击第二个Button后按下A | Button变成浅红色 | 是 | Pass | -| NODE_DISPATCH_KEY_EVENT示例代码验证 | 设备正常运行 | 进入首页,点击第三个Button后按下A | Button变成浅红色 | 是 | Pass | -| OH_ArkUI_KeyEvent_SetConsumed和OH_ArkUI_KeyEvent_StopPropagation事件冒泡示例代码验证 | 设备正常运行 | 进入首页,点击第四个Button后分别按下ESC、F1、A | Button均变浅红色,ESC和F1拦截事件冒泡,外层Column不变色,按下A后外层Column变浅红色 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/NdkKeyEvent/screenshots/device/image1.jpg b/ArkUIKit/NdkKeyEvent/screenshots/device/image1.jpg deleted file mode 100644 index 2092635211e3ebf38e3637ba709ad59413522fc5..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkKeyEvent/screenshots/device/image1.jpg and /dev/null differ diff --git a/ArkUIKit/NdkXComponent/.gitignore b/ArkUIKit/NdkXComponent/.gitignore deleted file mode 100644 index fbabf771011fe78f9919db0b1195ab6cadffc2b0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/AppScope/app.json5 b/ArkUIKit/NdkXComponent/AppScope/app.json5 deleted file mode 100644 index 3179b1bfb4bb746f13ee7d4dd0fa58c3f66171cf..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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.samples.ndkxcomponent", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/NdkXComponent/AppScope/resources/base/element/string.json b/ArkUIKit/NdkXComponent/AppScope/resources/base/element/string.json deleted file mode 100644 index 561383fbdef0dc2443f0cba3b1169289cb7a9ca0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "NdkXComponent" - } - ] -} diff --git a/ArkUIKit/NdkXComponent/AppScope/resources/base/media/app_icon.png b/ArkUIKit/NdkXComponent/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkXComponent/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/NdkXComponent/README_zh.md b/ArkUIKit/NdkXComponent/README_zh.md deleted file mode 100644 index 76648fe8cca0c26988c6b654bc11f7fd9e455e88..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/README_zh.md +++ /dev/null @@ -1,117 +0,0 @@ -# Native XComponent - -### 简介 - -本示例展示了如何在native侧使用ArkUI NDK API创建XComponent组件进行自定义绘制。具体步骤包括:创建组件,获取NativeXComponent实例,注册XComponent生命周期和事件回调,通过回调获取NativeWindow后使用OpenGL ES/EGL接口在XComponent组件上进行图形绘制,最后在ArkTS层使用ContentSlot站位组件进行挂载显示。功能主要包括点击按钮绘制一个五角星,并可以通过点击XComponent区域改变五角星的颜色。 - -### 效果预览 - -| 主页 | 绘制五角星 | 改变颜色 | -| ------------------------------------ | --------------------------------------------- | --------------------------------------------------- | -| ![main](screenshots/device/main.png) | ![draw star](screenshots/device/drawStar.png) | ![change color](screenshots/device/changeColor.png) | - -使用说明 - -1. 安装编译生成的hap包,并打开应用。 - -2. 点击页面底部“Draw Star”按钮,页面将绘制一个五角星。 - -3. 点击XComponent组件区域(页面中灰色区域)改变五角星颜色。 - - -### 工程目录 - -``` -├──entry/src/main -│ ├──cpp // C++代码区 -│ │ ├──CMakeLists.txt // CMake配置文件 -│ │ ├──napi_init.cpp // Napi模块注册 -│ │ ├──common -│ │ │ └──common.h // 常量定义文件 -│ │ ├──manager // 生命周期管理模块 -│ │ │ ├──plugin_manager.cpp -│ │ │ └──plugin_manager.h -│ │ ├──render // 渲染模块 -│ │ │ ├──egl_core.cpp -│ │ │ ├──egl_core.h -| | ├──types //定义接口文件 -│ │ │ ├──libnativenode -│ │ │ │ ├──Index.d.ts -│ │ │ │ ├──oh-package.json5 -│ ├──ets // ets代码区 -│ │ ├──entryability -│ │ │ └──EntryAbility.ts // 程序入口类 -│ │ └──pages // 页面文件 -│ │ └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -通过在IDE中创建Native c++ 工程,在c++代码中定义对外接口为drawPattern,在js侧调用该接口可在页面上绘制出一个三角形。 - -在XComponent的OnSurfaceCreated回调中获取NativeWindow实例并初始化EGL环境。调用OH_NativeXComponent_GetXComponentSize接口获取XComponent的宽高,并以此为输入调用EGL相关的绘制接口在NativeWindow上绘制出一个五角星。在DispatchTouchEvent回调中再次调用EGL相关的绘制接口在NativeWindow上绘制出一个大小相同、颜色不同的五角星,以达到点击后改变颜色的目的。 - -源码参考:[render目录](entry/src/main/cpp/render)下的文件。 - -涉及到的相关接口: - -| 接口名 | 描述 | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| OH_NativeXComponent_GetXComponentId(OH_NativeXComponent* component, char* id, uint64_t* size) | 获取XComponent的id。 | -| OH_NativeXComponent_GetXComponentSize(OH_NativeXComponent* component, const void* window, uint64_t* width, uint64_t* height) | 获取XComponent持有的surface的大小。 | -| OH_NativeXComponent_GetXComponentOffset(OH_NativeXComponent* component, const void* window, double* x, double* y) | 获取XComponent持有的surface相对窗口左上角的偏移量。 | -| OH_NativeXComponent_GetTouchEvent(OH_NativeXComponent* component, const void* window, OH_NativeXComponent_TouchEvent* touchEvent) | 获取由XComponent触发的触摸事件。 | -| OH_NativeXComponent_GetTouchPointToolType(OH_NativeXComponent* component, uint32_t pointIndex, OH_NativeXComponent_TouchPointToolType* toolType) | 获取XComponent触摸点的工具类型。 | -| OH_NativeXComponent_GetTouchPointTiltX(OH_NativeXComponent* component, uint32_t pointIndex, float* tiltX) | 获取XComponent触摸点处相对X轴的倾斜角度。 | -| OH_NativeXComponent_GetTouchPointTiltY(OH_NativeXComponent* component, uint32_t pointIndex, float* tiltY) | 获取XComponent触摸点处相对Y轴的倾斜角度。 | -| OH_NativeXComponent_GetMouseEvent(OH_NativeXComponent* component, const void* window, OH_NativeXComponent_MouseEvent* mouseEvent) | 获取由XComponent触发的鼠标事件。 | -| OH_NativeXComponent_RegisterCallback(OH_NativeXComponent* component, OH_NativeXComponent_Callback* callback) | 为此OH_NativeXComponent实例注册生命周期和触摸事件回调。 | -| OH_NativeXComponent_RegisterMouseEventCallback(OH_NativeXComponent* component, OH_NativeXComponent_MouseEvent_Callback* callback) | 为此OH_NativeXComponent实例注册鼠标事件回调。 | -| OH_NativeXComponent_RegisterFocusEventCallback(OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)) | 为此OH_NativeXComponent实例注册获得焦点事件回调。 | -| OH_NativeXComponent_RegisterKeyEventCallback(OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)) | 为此OH_NativeXComponent实例注册按键事件回调。 | -| OH_NativeXComponent_RegisterBlurEventCallback(OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)) | 为此OH_NativeXComponent实例注册失去焦点事件回调。 | -| OH_NativeXComponent_GetKeyEvent(OH_NativeXComponent* component, OH_NativeXComponent_KeyEvent** keyEvent) | 获取由XComponent触发的按键事件。 | -| OH_NativeXComponent_GetKeyEventAction(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyAction* action) | 获取按键事件的动作。 | -| OH_NativeXComponent_GetKeyEventCode(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyCode* code) | 获取按键事件的键码值。 | -| OH_NativeXComponent_GetKeyEventSourceType(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_EventSourceType* sourceType) | 获取按键事件的输入源类型。 | -| OH_NativeXComponent_GetKeyEventDeviceId(OH_NativeXComponent_KeyEvent* keyEvent, int64_t* deviceId) | 获取按键事件的设备ID。 | -| OH_NativeXComponent_GetKeyEventTimestamp(OH_NativeXComponent_KeyEvent* keyEvent, int64_t* timestamp) | 获取按键事件的时间戳。 | -| OH_ArkUI_QueryModuleInterfaceByName(ArkUI_NativeAPIVariantKind type, const char* structName) | 获取指定类型的Native模块接口集合。 | -| OH_ArkUI_GetNodeContentFromNapiValue(napi_env env, napi_value value, ArkUI_NodeContentHandle* content) | 获取ArkTS侧创建的NodeContent对象映射到native侧的ArkUI_NodeContentHandle。 | -| OH_ArkUI_NodeContent_SetUserData(ArkUI_NodeContentHandle content, void* userData) | 在NodeContent对象上保存自定义数据。 | -| OH_ArkUI_NodeContentEvent_GetNodeContentHandle(ArkUI_NodeContentEvent* event) | 获取触发事件的NodeContent对象。 | -| OH_ArkUI_NodeContent_GetUserData(ArkUI_NodeContentHandle content) | 获取在NodeContent对象上保存的自定义数据。 | -| OH_ArkUI_NodeContentEvent_GetEventType(ArkUI_NodeContentEvent* event) | 获取触发NodeContent事件的事件类型。 | -| OH_ArkUI_NodeContent_AddNode(ArkUI_NodeContentHandle content, ArkUI_NodeHandle node) | 将一个ArkUI组件节点添加到对应的NodeContent对象下。 | -| OH_ArkUI_NodeContent_RegisterCallback(ArkUI_NodeContentHandle content, ArkUI_NodeContentCallback callback) | 注册NodeContent事件函数。 | -| OH_NativeXComponent_GetNativeXComponent(ArkUI_NodeHandle node) | 基于Native接口创建的组件实例获取OH_NativeXComponent类型的指针。 | - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机 - -2. 本示例为Stage模型,支持API12版本SDK,SDK版本号(API Version 12Release),镜像版本号(5.0 Release) - -3. 本示例需要使用DevEco Studio 版本号(5.0 Release)及以上版本才可编译运行 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo ArkUIKit/NdkXComponent/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` - diff --git a/ArkUIKit/NdkXComponent/build-profile.json5 b/ArkUIKit/NdkXComponent/build-profile.json5 deleted file mode 100644 index 90ae14d97a40a1aa4788181816d740d771abf9e0..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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": "5.0.0(12)", - "runtimeOS": "HarmonyOS" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/.gitignore b/ArkUIKit/NdkXComponent/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/build-profile.json5 b/ArkUIKit/NdkXComponent/entry/build-profile.json5 deleted file mode 100644 index 9432c50088f120b83eb0acef14e76327b8b30e29..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/build-profile.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "targets": [ - { - "name": "default", - "runtimeOS": "HarmonyOS" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/hvigorfile.ts b/ArkUIKit/NdkXComponent/entry/hvigorfile.ts deleted file mode 100644 index 80e4ec5b81689f238c34614b167a0b9e9c83e8d9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/ArkUIKit/NdkXComponent/entry/oh-package.json5 b/ArkUIKit/NdkXComponent/entry/oh-package.json5 deleted file mode 100644 index a9801d3de62a442d58cb309ab82d06c7b6c1557d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/oh-package.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "license": "", - "devDependencies": {}, - "author": "", - "name": "entry", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": { - "libnativenode.so": "file:./src/main/cpp/types/libnativenode" - } -} diff --git a/ArkUIKit/NdkXComponent/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NdkXComponent/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 7ce33599c512418862134501426894afcc20ac4b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.4.1) -project(XComponent) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -add_definitions(-DOHOS_PLATFORM) - -include_directories( - ${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include -) - -add_library(nativenode SHARED - render/egl_core.cpp - manager/plugin_manager.cpp - napi_init.cpp -) - -find_library( - # Sets the name of the path variable. - EGL-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - EGL -) - -find_library( - # Sets the name of the path variable. - GLES-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - GLESv3 -) - -find_library( - # Sets the name of the path variable. - hilog-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - hilog_ndk.z -) - -find_library( - # Sets the name of the path variable. - libace-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_ndk.z -) - -find_library( - # Sets the name of the path variable. - libnapi-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - ace_napi.z -) - -find_library( - # Sets the name of the path variable. - libuv-lib - # Specifies the name of the NDK library that - # you want CMake to locate. - uv -) - -target_link_libraries(nativenode PUBLIC - ${EGL-lib} ${GLES-lib} ${hilog-lib} ${libace-lib} ${libnapi-lib} ${libuv-lib}) \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/main/cpp/common/common.h b/ArkUIKit/NdkXComponent/entry/src/main/cpp/common/common.h deleted file mode 100644 index c7760109da75f11204bd359ac3a65900b6749872..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/cpp/common/common.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -#ifndef NATIVE_XCOMPONENT_COMMON_H -#define NATIVE_XCOMPONENT_COMMON_H - -#include -#include -#include -#include -#include - -namespace NativeXComponentSample { -/** - * Log print domain. - */ -const unsigned int LOG_PRINT_DOMAIN = 0xFF00; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_COMMON_H diff --git a/ArkUIKit/NdkXComponent/entry/src/main/cpp/manager/plugin_manager.cpp b/ArkUIKit/NdkXComponent/entry/src/main/cpp/manager/plugin_manager.cpp deleted file mode 100644 index e108a8c85195d7044c0bce006e8e3e67301f3352..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/cpp/manager/plugin_manager.cpp +++ /dev/null @@ -1,353 +0,0 @@ -/* - * 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. - */ - -#include "plugin_manager.h" - -#include -#include -#include -#include -#include -#include "arkui/native_node.h" -#include "arkui/native_node_napi.h" -#include "arkui/native_interface.h" -#include "../common/common.h" - -#define COLUMN_MARGIN 10 -#define XC_WIDTH 300 -#define XC_HEIGHT 300 -#define ARG_CNT 2 - -namespace NativeXComponentSample { -PluginManager PluginManager::pluginManager_; -OH_NativeXComponent_Callback PluginManager::callback_; -static ArkUI_NativeNodeAPI_1* nodeAPI; -ArkUI_NodeHandle xc; -int32_t PluginManager::hasDraw_ = 0; -int32_t PluginManager::hasChangeColor_ = 0; - -static std::string value2String(napi_env env, napi_value value) -{ - size_t stringSize = 0; - napi_get_value_string_utf8(env, value, nullptr, 0, &stringSize); - std::string valueString; - valueString.resize(stringSize); - napi_get_value_string_utf8(env, value, &valueString[0], stringSize+1, &stringSize); - return valueString; -} -napi_value PluginManager::GetXComponentStatus(napi_env env, napi_callback_info info) -{ - napi_value hasDraw; - napi_value hasChangeColor; - - napi_status ret = napi_create_int32(env, hasDraw_, &(hasDraw)); - if (ret != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", "napi_create_int32 hasDraw_ error"); - return nullptr; - } - ret = napi_create_int32(env, hasChangeColor_, &(hasChangeColor)); - if (ret != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", "napi_create_int32 hasChangeColor_ error"); - return nullptr; - } - - napi_value obj; - ret = napi_create_object(env, &obj); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", "napi_create_object error"); - return nullptr; - } - ret = napi_set_named_property(env, obj, "hasDraw", hasDraw); - if (ret != napi_ok) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", "napi_set_named_property hasDraw error"); - return nullptr; - } - ret = napi_set_named_property(env, obj, "hasChangeColor", hasChangeColor); - if (ret != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "GetXComponentStatus", - "napi_set_named_property hasChangeColor error"); - return nullptr; - } - return obj; -} - -napi_value PluginManager::NapiDrawPattern(napi_env env, napi_callback_info info) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginManager", "NapiDrawPattern"); - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "NapiDrawPattern: env or info is null"); - return nullptr; - } - napi_value thisArg; - if (napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "NapiDrawPattern: napi_get_cb_info fail"); - return nullptr; - } - - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->eglcore_->Draw(hasDraw_); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginManager", "render->eglCore_->Draw() executed"); - - return nullptr; -} - -void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "OnSurfaceCreatedCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - - std::string id(idStr); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "OnSurfaceCreatedCB id=%{public}s", - id.c_str()); - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->OnSurfaceCreated(component, window); -} -void OnSurfaceChangedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "OnSurfaceChangedCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - std::string id(idStr); - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->OnSurfaceChanged(component, window); -} -void OnSurfaceDestroyedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - std::string id(idStr); - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->OnSurfaceDestroyed(component, window); -} -void DispatchTouchEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - if (ret != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - return; - } - std::string id(idStr); - auto *pluginManger = PluginManager::GetInstance(); - pluginManger->DispatchTouchEvent(component, window); -} -PluginManager::PluginManager() -{ - eglcore_ = new EGLCore(); - callback_.OnSurfaceCreated = OnSurfaceCreatedCB; - callback_.OnSurfaceChanged = OnSurfaceChangedCB; - callback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - callback_.DispatchTouchEvent = DispatchTouchEventCB; -} - -PluginManager::~PluginManager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "~PluginManager"); - nativeXComponentMap_.clear(); - if (eglcore_ != nullptr) { - delete eglcore_; - eglcore_ = nullptr; - } - - for (auto iter = pluginManagerMap_.begin(); iter != pluginManagerMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - pluginManagerMap_.clear(); -} - -ArkUI_NodeHandle CreateNodeHandle(const std::string &tag) -{ - ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue value[] = {480}; - ArkUI_NumberValue value1[] = {{.u32 = 15}, {.f32 = 15}}; - ArkUI_AttributeItem item = {value, 1, "changeSize"}; - ArkUI_AttributeItem item1 = {value1, 2}; - nodeAPI->setAttribute(column, NODE_WIDTH, &item); - value[0].f32 = COLUMN_MARGIN; - nodeAPI->setAttribute(column, NODE_MARGIN, &item); - xc = nodeAPI->createNode(ARKUI_NODE_XCOMPONENT); - value[0].u32 = ARKUI_XCOMPONENT_TYPE_SURFACE; - nodeAPI->setAttribute(xc, NODE_XCOMPONENT_TYPE, &item); - nodeAPI->setAttribute(xc, NODE_XCOMPONENT_ID, &item); - nodeAPI->setAttribute(xc, NODE_XCOMPONENT_SURFACE_SIZE, &item1); - ArkUI_NumberValue focusable[] = {1}; - focusable[0].i32 = 1; - ArkUI_AttributeItem focusableItem = {focusable, 1}; - nodeAPI->setAttribute(xc, NODE_FOCUSABLE, &focusableItem); - ArkUI_NumberValue valueSize[] = {480}; - ArkUI_AttributeItem itemSize = {valueSize, 1}; - valueSize[0].f32 = XC_WIDTH; - nodeAPI->setAttribute(xc, NODE_WIDTH, &itemSize); - valueSize[0].f32 = XC_HEIGHT; - nodeAPI->setAttribute(xc, NODE_HEIGHT, &itemSize); - ArkUI_AttributeItem item2 = {value, 1, "ndkxcomponent"}; - nodeAPI->setAttribute(xc, NODE_ID, &item2); - - auto *nativeXComponent = OH_NativeXComponent_GetNativeXComponent(xc); - if (!nativeXComponent) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "GetNativeXComponent error"); - return column; - } - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "GetNativeXComponent success"); - OH_NativeXComponent_RegisterCallback(nativeXComponent, &PluginManager::callback_); - auto typeRet = nodeAPI->getAttribute(xc, NODE_XCOMPONENT_TYPE); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "xcomponent type: %{public}d", - typeRet->value[0].i32); - auto idRet = nodeAPI->getAttribute(xc, NODE_XCOMPONENT_ID); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "xcomponent id: %{public}s", - idRet->string); - nodeAPI->addChild(column, xc); - return column; -} - -napi_value PluginManager::createNativeNode(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "CreateNativeNode env or info is null"); - return nullptr; - } - size_t argCnt = 2; - napi_value args[2] = { nullptr, nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "CreateNativeNode napi_get_cb_info failed"); - } - if (argCnt != ARG_CNT) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - ArkUI_NodeContentHandle nodeContentHandle_ = nullptr; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &nodeContentHandle_); - nodeAPI = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1") - ); - std::string tag = value2String(env, args[1]); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "tag=%{public}s", tag.c_str()); - int32_t ret = OH_ArkUI_NodeContent_SetUserData(nodeContentHandle_, new std::string(tag)); - if (ret != ARKUI_ERROR_CODE_NO_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "setUserData failed error=%{public}d", ret); - } - if (nodeAPI != nullptr && nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", - "CreateNativeNode tag=%{public}s", tag.c_str()); - auto nodeContentEvent = [](ArkUI_NodeContentEvent *event) { - ArkUI_NodeContentHandle handle = OH_ArkUI_NodeContentEvent_GetNodeContentHandle(event); - std::string *userDate = reinterpret_cast(OH_ArkUI_NodeContent_GetUserData(handle)); - if (OH_ArkUI_NodeContentEvent_GetEventType(event) == NODE_CONTENT_EVENT_ON_ATTACH_TO_WINDOW) { - ArkUI_NodeHandle testNode; - if (userDate) { - testNode = CreateNodeHandle(*userDate); - delete userDate; - userDate = nullptr; - } else { - testNode = CreateNodeHandle("noUserData"); - } - OH_ArkUI_NodeContent_AddNode(handle, testNode); - } - }; - OH_ArkUI_NodeContent_RegisterCallback(nodeContentHandle_, nodeContentEvent); - } - return nullptr; -} - -void PluginManager::OnSurfaceCreated(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "PluginManager::OnSurfaceCreated"); - int32_t ret; - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - ret = OH_NativeXComponent_GetXComponentId(component, idStr, &idSize); - ret = OH_NativeXComponent_GetXComponentSize(component, window, &width_, &height_); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - eglcore_->EglContextInit(window, width_, height_); - eglcore_->Background(); - } -} - -void PluginManager::OnSurfaceDestroyed(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "PluginManager::OnSurfaceDestroyed"); -} - -void PluginManager::DispatchTouchEvent(OH_NativeXComponent* component, void* window) -{ - int32_t ret = OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent_); - if (ret == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - float tiltX = 2.2; - float tiltY = 2.2; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", - "Touch Info : x=%{public}f, y=%{public}f screenx=%{public}f, screeny=%{public}f," - "type=%{public}d, force=%{public}f, tiltX=%{public}f, tiltY=%{public}f, toolType=%{public}d", - touchEvent_.x, touchEvent_.y, touchEvent_.screenX, - touchEvent_.screenY, touchEvent_.type, touchEvent_.force, tiltX, tiltY, toolType); - if (touchEvent_.type == OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UP) - eglcore_->ChangeColor(hasChangeColor_); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "touch fail"); - } - - int32_t size = 0; - OH_NativeXComponent_HistoricalPoint *points = nullptr; - - if (OH_NativeXComponent_GetHistoricalPoints(component, window, &size, &points) == - OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "XComponent_Native", "HistoricalPoints size=%{public}d", - size); - for (auto i = 0; i < size; i++) { - auto point = points[i]; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "XComponent_Native", - "HistoricalPoint %{public}d Info : id=%{public}d, x=%{public}f, y=%{public}f, " - "type=%{public}d, timeStamp=%{public}lld, sourceTool=%{public}d", - i, point.id, point.x, point.y, point.type, point.timeStamp, point.sourceTool); - } - } -} -void PluginManager::OnSurfaceChanged(OH_NativeXComponent* component, void* window) -{ - int32_t ret = OH_NativeXComponent_GetXComponentSize(component, window, &width_, &height_); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", - "OnSurfaceChanged ret=%{public}d width=%{public}lu, height=%{public}lu", ret, width_, height_); -} - -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkXComponent/entry/src/main/cpp/manager/plugin_manager.h b/ArkUIKit/NdkXComponent/entry/src/main/cpp/manager/plugin_manager.h deleted file mode 100644 index 7bf51da76a22d2ef00a750a46e8b751469c2fffb..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/cpp/manager/plugin_manager.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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. - */ -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include -#include "render/egl_core.h" - -namespace NativeXComponentSample { -class PluginManager { -public: - - static OH_NativeXComponent_Callback callback_; - PluginManager(); - ~PluginManager(); - static PluginManager* GetInstance() - { - return &PluginManager::pluginManager_; - } - - static napi_value createNativeNode(napi_env env, napi_callback_info info); - static napi_value GetXComponentStatus(napi_env env, napi_callback_info info); - static napi_value NapiDrawPattern(napi_env env, napi_callback_info info); - - // CApi XComponent - void OnSurfaceChanged(OH_NativeXComponent* component, void* window); - void OnSurfaceDestroyed(OH_NativeXComponent* component, void* window); - void DispatchTouchEvent(OH_NativeXComponent* component, void* window); - void OnSurfaceCreated(OH_NativeXComponent* component, void* window); - -private: - static PluginManager pluginManager_; - std::unordered_map nativeXComponentMap_; - std::unordered_map pluginManagerMap_; - -public: - EGLCore *eglcore_; - uint64_t width_; - uint64_t height_; - OH_NativeXComponent_TouchEvent touchEvent_; - static int32_t hasDraw_; - static int32_t hasChangeColor_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NdkXComponent/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NdkXComponent/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 14df4224b95ffd042c9b36d55261c7fc91269f66..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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. - */ - -#include - -#include "common/common.h" -#include "manager/plugin_manager.h" - -namespace NativeXComponentSample { -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); - return nullptr; - } - - napi_property_descriptor desc[] = { - {"createNativeNode", nullptr, PluginManager::createNativeNode, nullptr, nullptr, nullptr, - napi_default, nullptr }, - {"getStatus", nullptr, PluginManager::GetXComponentStatus, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"drawPattern", nullptr, PluginManager::NapiDrawPattern, nullptr, nullptr, - nullptr, napi_default, nullptr} - }; - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); - return nullptr; - } - - return exports; -} -EXTERN_C_END - -static napi_module nativenodeModule = { .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativenode", - .nm_priv = ((void*)0), - .reserved = { 0 } }; - -extern "C" __attribute__((constructor)) void RegisterModule(void) -{ - napi_module_register(&nativenodeModule); -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkXComponent/entry/src/main/cpp/render/egl_core.cpp b/ArkUIKit/NdkXComponent/entry/src/main/cpp/render/egl_core.cpp deleted file mode 100644 index 967d22ba58b7ebf7d3c8ca6ae994aeaf69bce28d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/cpp/render/egl_core.cpp +++ /dev/null @@ -1,611 +0,0 @@ -/* - * 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. - */ - -#include "egl_core.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "../common/common.h" - -namespace NativeXComponentSample { -namespace { -constexpr int32_t NUM_4 = 4; -/** - * Vertex shader. - */ -const char VERTEX_SHADER[] = "#version 300 es\n" - "layout(location = 0) in vec4 a_position;\n" - "layout(location = 1) in vec4 a_color; \n" - "out vec4 v_color; \n" - "void main() \n" - "{ \n" - " gl_Position = a_position; \n" - " v_color = a_color; \n" - "} \n"; - -/** - * Fragment shader. - */ -const char FRAGMENT_SHADER[] = "#version 300 es\n" - "precision mediump float; \n" - "in vec4 v_color; \n" - "out vec4 fragColor; \n" - "void main() \n" - "{ \n" - " fragColor = v_color; \n" - "} \n"; - -/** - * Background color #f4f4f4. - */ -const GLfloat BACKGROUND_COLOR[] = {244.0f / 255, 244.0f / 255, 244.0f / 255, 1.0f}; - -/** - * Draw color #7E8FFB. - */ -const GLfloat DRAW_COLOR[] = {126.0f / 255, 143.0f / 255, 251.0f / 255, 1.0f}; - -/** - * Change color #92D6CC. - */ -const GLfloat CHANGE_COLOR[] = {146.0f / 255, 214.0f / 255, 204.0f / 255, 1.0f}; - -/** - * Background area. - */ -const GLfloat BACKGROUND_RECTANGLE_VERTICES[] = { - -1.0f, 1.0f, - 1.0f, 1.0f, - 1.0f, -1.0f, - -1.0f, -1.0f}; - -/** - * Get context parameter count. - */ -const size_t GET_CONTEXT_PARAM_CNT = 1; - -/** - * Fifty percent. - */ -const float FIFTY_PERCENT = 0.5; - -/** - * Pointer size. - */ -const GLint POINTER_SIZE = 2; - -/** - * Triangle fan size. - */ -const GLsizei TRIANGLE_FAN_SIZE = 4; - -/** - * Egl red size default. - */ -const int EGL_RED_SIZE_DEFAULT = 8; - -/** - * Egl green size default. - */ -const int EGL_GREEN_SIZE_DEFAULT = 8; - -/** - * Egl blue size default. - */ -const int EGL_BLUE_SIZE_DEFAULT = 8; - -/** - * Egl alpha size default. - */ -const int EGL_ALPHA_SIZE_DEFAULT = 8; - -/** - * Default x position. - */ -const int DEFAULT_X_POSITION = 0; - -/** - * Default y position. - */ -const int DEFAULT_Y_POSITION = 0; - -/** - * Gl red default. - */ -const GLfloat GL_RED_DEFAULT = 0.0; - -/** - * Gl green default. - */ -const GLfloat GL_GREEN_DEFAULT = 0.0; - -/** - * Gl blue default. - */ -const GLfloat GL_BLUE_DEFAULT = 0.0; - -/** - * Gl alpha default. - */ -const GLfloat GL_ALPHA_DEFAULT = 1.0; - -/** - * Program error. - */ -const GLuint PROGRAM_ERROR = 0; - -/** - * Shape vertices size. - */ -const int SHAPE_VERTICES_SIZE = 8; - -/** - * Position handle name. - */ -const char POSITION_NAME[] = "a_position"; - -/** - * Position error. - */ -const GLint POSITION_ERROR = -1; - -/** - * Config attribute list. - */ -const EGLint ATTRIB_LIST[] = { - // Key,value. - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RED_SIZE, EGL_RED_SIZE_DEFAULT, - EGL_GREEN_SIZE, EGL_GREEN_SIZE_DEFAULT, - EGL_BLUE_SIZE, EGL_BLUE_SIZE_DEFAULT, - EGL_ALPHA_SIZE, EGL_ALPHA_SIZE_DEFAULT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - // End. - EGL_NONE}; - -/** - * Context attributes. - */ -const EGLint CONTEXT_ATTRIBS[] = { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE}; -} // namespace -bool EGLCore::EglContextInit(void* window, int width, int height) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "EglContextInit execute"); - if ((window == nullptr) || (width <= 0) || (height <= 0)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "EglContextInit: param error"); - return false; - } - - UpdateSize(width, height); - eglWindow_ = static_cast(window); - - // Init display. - eglDisplay_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (eglDisplay_ == EGL_NO_DISPLAY) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglGetDisplay: unable to get EGL display"); - return false; - } - - EGLint majorVersion; - EGLint minorVersion; - if (!eglInitialize(eglDisplay_, &majorVersion, &minorVersion)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglInitialize: unable to get initialize EGL display"); - return false; - } - - // Select configuration. - const EGLint maxConfigSize = 1; - EGLint numConfigs; - if (!eglChooseConfig(eglDisplay_, ATTRIB_LIST, &eglConfig_, maxConfigSize, &numConfigs)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglChooseConfig: unable to choose configs"); - return false; - } - return CreateEnvironment(); -} - -bool EGLCore::CreateEnvironment() -{ - // Create surface. - if (eglWindow_ == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglWindow_ is null"); - return false; - } - eglSurface_ = eglCreateWindowSurface(eglDisplay_, eglConfig_, eglWindow_, NULL); - if (eglSurface_ == nullptr) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglCreateWindowSurface: unable to create surface"); - return false; - } - // Create context. - eglContext_ = eglCreateContext(eglDisplay_, eglConfig_, EGL_NO_CONTEXT, CONTEXT_ATTRIBS); - if (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglMakeCurrent failed"); - return false; - } - // Create program. - program_ = CreateProgram(VERTEX_SHADER, FRAGMENT_SHADER); - if (program_ == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "CreateProgram: unable to create program"); - return false; - } - return true; -} - -void EGLCore::Background() -{ - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Background get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, - BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Background execute draw failed"); - return; - } - - if (!FinishDraw()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Background FinishDraw failed"); - return; - } -} - -void EGLCore::Draw(int& hasDraw) -{ - flag_ = false; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "Draw"); - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, - BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw background failed"); - return; - } - - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices - GLfloat rotateX = 0; - GLfloat rotateY = FIFTY_PERCENT * height_; - GLfloat centerX = 0; - // Convert DEG(54° & 18°) to RAD - GLfloat centerY = -rotateY * (M_PI / 180 * 54) * (M_PI / 180 * 18); - // Convert DEG(18°) to RAD - GLfloat leftX = -rotateY * (M_PI / 180 * 18); - GLfloat leftY = 0; - // Convert DEG(18°) to RAD - GLfloat rightX = rotateY * (M_PI / 180 * 18); - GLfloat rightY = 0; - - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawStar(position, DRAW_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - - // Convert DEG(72°) to RAD - GLfloat rad = M_PI / 180 * 72; - // Rotate four times - for (int i = 0; i < NUM_4; ++i) { - Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); - Rotate2d(centerX, centerY, &leftX, &leftY, rad); - Rotate2d(centerX, centerY, &rightX, &rightY, rad); - - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawStar(position, DRAW_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - } - - if (!FinishDraw()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw FinishDraw failed"); - return; - } - hasDraw = 1; - - flag_ = true; -} - -void EGLCore::ChangeColor(int& hasChangeColor) -{ - if (!flag_) { - return; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor"); - GLint position = PrepareDraw(); - if (position == POSITION_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor get position failed"); - return; - } - - if (!ExecuteDraw(position, BACKGROUND_COLOR, - BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor execute draw background failed"); - return; - } - - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices - GLfloat rotateX = 0; - GLfloat rotateY = FIFTY_PERCENT * height_; - GLfloat centerX = 0; - // Convert DEG(54° & 18°) to RAD - GLfloat centerY = -rotateY * (M_PI / 180 * 54) * (M_PI / 180 * 18); - // Convert DEG(18°) to RAD - GLfloat leftX = -rotateY * (M_PI / 180 * 18); - GLfloat leftY = 0; - // Convert DEG(18°) to RAD - GLfloat rightX = rotateY * (M_PI / 180 * 18); - GLfloat rightY = 0; - - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawNewStar(0, CHANGE_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - - // Convert DEG(72°) to RAD - GLfloat rad = M_PI / 180 * 72; - // Rotate four times - for (int i = 0; i < NUM_4; ++i) { - Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); - Rotate2d(centerX, centerY, &leftX, &leftY, rad); - Rotate2d(centerX, centerY, &rightX, &rightY, rad); - const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, - rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; - - if (!ExecuteDrawNewStar(position, CHANGE_COLOR, shapeVertices, sizeof(shapeVertices))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); - return; - } - } - - if (!FinishDraw()) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor FinishDraw failed"); - } - hasChangeColor = 1; -} - -GLint EGLCore::PrepareDraw() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (eglContext_ == nullptr) || - (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "PrepareDraw: param error"); - return POSITION_ERROR; - } - - // The gl function has no return value. - glViewport(DEFAULT_X_POSITION, DEFAULT_Y_POSITION, width_, height_); - glClearColor(GL_RED_DEFAULT, GL_GREEN_DEFAULT, GL_BLUE_DEFAULT, GL_ALPHA_DEFAULT); - glClear(GL_COLOR_BUFFER_BIT); - glUseProgram(program_); - - return glGetAttribLocation(program_, POSITION_NAME); -} - -bool EGLCore::ExecuteDraw(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) -{ - if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glEnableVertexAttribArray(position); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - - return true; -} - -bool EGLCore::ExecuteDrawStar( - GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) -{ - if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glVertexAttribPointer(1, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, color); - glEnableVertexAttribArray(position); - glEnableVertexAttribArray(1); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - glDisableVertexAttribArray(1); - - return true; -} - -bool EGLCore::ExecuteDrawNewStar( - GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) -{ - if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ExecuteDraw: param error"); - return false; - } - - // The gl function has no return value. - glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); - glEnableVertexAttribArray(position); - glVertexAttrib4fv(1, color); - glDrawArrays(GL_TRIANGLE_FAN, 0, TRIANGLE_FAN_SIZE); - glDisableVertexAttribArray(position); - - return true; -} - -void EGLCore::Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat* rotateX, GLfloat* rotateY, GLfloat theta) -{ - GLfloat tempX = cos(theta) * (*rotateX - centerX) - sin(theta) * (*rotateY - centerY); - GLfloat tempY = sin(theta) * (*rotateX - centerX) + cos(theta) * (*rotateY - centerY); - *rotateX = tempX + centerX; - *rotateY = tempY + centerY; -} - -bool EGLCore::FinishDraw() -{ - // The gl function has no return value. - glFlush(); - glFinish(); - return eglSwapBuffers(eglDisplay_, eglSurface_); -} - -GLuint EGLCore::LoadShader(GLenum type, const char* shaderSrc) -{ - if ((type <= 0) || (shaderSrc == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCreateShader type or shaderSrc error"); - return PROGRAM_ERROR; - } - - GLuint shader = glCreateShader(type); - if (shader == 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCreateShader unable to load shader"); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glShaderSource(shader, 1, &shaderSrc, nullptr); - glCompileShader(shader); - - GLint compiled; - glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); - if (compiled != 0) { - return shader; - } - - GLint infoLen = 0; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen <= 1) { - glDeleteShader(shader); - return PROGRAM_ERROR; - } - - char* infoLog = (char*)malloc(sizeof(char) * (infoLen + 1)); - if (infoLog != nullptr) { - memset(infoLog, 0, infoLen + 1); - glGetShaderInfoLog(shader, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCompileShader error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(shader); - return PROGRAM_ERROR; -} - -GLuint EGLCore::CreateProgram(const char* vertexShader, const char* fragShader) -{ - if ((vertexShader == nullptr) || (fragShader == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram: vertexShader or fragShader is null"); - return PROGRAM_ERROR; - } - - GLuint vertex = LoadShader(GL_VERTEX_SHADER, vertexShader); - if (vertex == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram vertex error"); - return PROGRAM_ERROR; - } - - GLuint fragment = LoadShader(GL_FRAGMENT_SHADER, fragShader); - if (fragment == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram fragment error"); - return PROGRAM_ERROR; - } - - GLuint program = glCreateProgram(); - if (program == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram program error"); - glDeleteShader(vertex); - glDeleteShader(fragment); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glAttachShader(program, vertex); - glAttachShader(program, fragment); - glLinkProgram(program); - - GLint linked; - glGetProgramiv(program, GL_LINK_STATUS, &linked); - if (linked != 0) { - glDeleteShader(vertex); - glDeleteShader(fragment); - return program; - } - - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram linked error"); - GLint infoLen = 0; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen > 1) { - char* infoLog = (char*)malloc(sizeof(char) * (infoLen + 1)); - memset(infoLog, 0, infoLen + 1); - glGetProgramInfoLog(program, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glLinkProgram error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(vertex); - glDeleteShader(fragment); - glDeleteProgram(program); - return PROGRAM_ERROR; -} - -void EGLCore::UpdateSize(int width, int height) -{ - width_ = width; - height_ = height; - if (width_ > 0) { - widthPercent_ = FIFTY_PERCENT * height_ / width_; - } -} - -void EGLCore::Release() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (!eglDestroySurface(eglDisplay_, eglSurface_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroySurface failed"); - } - - if ((eglDisplay_ == nullptr) || (eglContext_ == nullptr) || (!eglDestroyContext(eglDisplay_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroyContext failed"); - } - - if ((eglDisplay_ == nullptr) || (!eglTerminate(eglDisplay_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglTerminate failed"); - } -} -} // namespace NativeXComponentSample diff --git a/ArkUIKit/NdkXComponent/entry/src/main/cpp/render/egl_core.h b/ArkUIKit/NdkXComponent/entry/src/main/cpp/render/egl_core.h deleted file mode 100644 index 2bdc12a841056168ba4906a09d07246c495e860d..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/cpp/render/egl_core.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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. - */ -#ifndef NATIVE_XCOMPONENT_EGL_CORE_H -#define NATIVE_XCOMPONENT_EGL_CORE_H - -#include -#include -#include -#include "string" - -namespace NativeXComponentSample { -class EGLCore { -public: - explicit EGLCore() {} - ~EGLCore() {} - bool EglContextInit(void* window, int width, int height); - bool CreateEnvironment(); - void Draw(int& hasDraw); - void Background(); - void ChangeColor(int& hasChangeColor); - void Release(); - void UpdateSize(int width, int height); - -private: - GLuint LoadShader(GLenum type, const char* shaderSrc); - GLuint CreateProgram(const char* vertexShader, const char* fragShader); - GLint PrepareDraw(); - bool ExecuteDraw(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize); - bool ExecuteDrawStar(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize); - bool ExecuteDrawNewStar(GLint position, const GLfloat* color, - const GLfloat shapeVertices[], unsigned long vertSize); - void Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat* rotateX, GLfloat* rotateY, GLfloat theta); - bool FinishDraw(); - -private: - EGLNativeWindowType eglWindow_; - EGLDisplay eglDisplay_ = EGL_NO_DISPLAY; - EGLConfig eglConfig_ = EGL_NO_CONFIG_KHR; - EGLSurface eglSurface_ = EGL_NO_SURFACE; - EGLContext eglContext_ = EGL_NO_CONTEXT; - GLuint program_; - bool flag_ = false; - int width_; - int height_; - GLfloat widthPercent_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_EGL_CORE_H diff --git a/ArkUIKit/NdkXComponent/entry/src/main/cpp/types/libnativenode/Index.d.ts b/ArkUIKit/NdkXComponent/entry/src/main/cpp/types/libnativenode/Index.d.ts deleted file mode 100644 index 8678295f391b4e7ef6159f95f5a2ee1d5cfb5d98..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/cpp/types/libnativenode/Index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 { NodeContent } from '@ohos.arkui.node'; -type XComponentContextStatus = { - hasDraw: boolean, - hasChangeColor: boolean -}; -export const createNativeNode: (content: NodeContent, tag: string) => void; -export const getStatus: () => XComponentContextStatus; -export const drawPattern: () => void; \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/main/cpp/types/libnativenode/oh-package.json5 b/ArkUIKit/NdkXComponent/entry/src/main/cpp/types/libnativenode/oh-package.json5 deleted file mode 100644 index d6c80337d1f0f9e37fd29bb98d74fd4260e1f467..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/cpp/types/libnativenode/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libnativenode.so", - "types": "./Index.d.ts", - "version": " ", - "description": "Please describe the basic infomation" -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/main/ets/entryability/EntryAbility.ts b/ArkUIKit/NdkXComponent/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index aefdd5b7b8cf82af003c29651f07d7c7412d6060..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 UIAbility from '@ohos.app.ability.UIAbility'; -import hilog from '@ohos.hilog'; -import window from '@ohos.window'; - -export default class EntryAbility extends UIAbility { - onCreate(want, launchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - // Main window is created, set main page for this ability - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - 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. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground() { - // Ability has back to background - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -}; diff --git a/ArkUIKit/NdkXComponent/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NdkXComponent/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 4b1dfca47f5b09bb64510edb856801974991bd87..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 nativeNode from 'libnativenode.so'; -import {NodeContent} from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - @State currentStatus: string = "init"; - private nodeContent: NodeContent = new NodeContent(); - aboutToAppear():void{ - nativeNode.createNativeNode(this.nodeContent,"ygb"); - } - - build() { - Column() { - Row() { - Text('Native XComponent Sample') - .fontSize('24fp') - .fontWeight(500) - .margin({ - left: 24, - top: 12 - }) - } - .margin({ top: 24 }) - .width('100%') - .height(56) - - Column({ space: 10 }) { - ContentSlot(this.nodeContent); - - Text(this.currentStatus) - .fontSize('24fp') - .fontWeight(500) - } - .onClick(() => { - let hasChangeColor: boolean = false; - if (nativeNode.getStatus()) { - hasChangeColor = nativeNode.getStatus().hasChangeColor; - } - if (hasChangeColor) { - this.currentStatus = "change color"; - } - }) - .margin({ - top: 27, - left: 12, - right: 12 - }) - .height('40%') - .width('90%') - - Row() { - Button('Draw Star') - .fontSize('16fp') - .fontWeight(500) - .margin({ bottom: 24 }) - .onClick(() => { - nativeNode.drawPattern(); - let hasDraw: boolean = false; - if (nativeNode.getStatus()) { - hasDraw = nativeNode.getStatus().hasDraw; - } - if (hasDraw) { - this.currentStatus = "draw star"; - } - }) - .width('53.6%') - .height(40) - } - .width('100%') - .justifyContent(FlexAlign.Center) - .alignItems(VerticalAlign.Bottom) - .layoutWeight(1) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/main/module.json5 b/ArkUIKit/NdkXComponent/entry/src/main/module.json5 deleted file mode 100644 index 8046ec1921e25a173d951bae53df64898a5c7edc..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/module.json5 +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/main/resources/base/element/color.json b/ArkUIKit/NdkXComponent/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/main/resources/base/element/string.json b/ArkUIKit/NdkXComponent/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/main/resources/base/media/icon.png b/ArkUIKit/NdkXComponent/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkXComponent/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ArkUIKit/NdkXComponent/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NdkXComponent/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/NdkXComponent/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NdkXComponent/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NdkXComponent/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 585a000d65aaf0cc128e3e9edde5d7bbd9cb7d88..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 '@ohos.hilog'; -import TestRunner from '@ohos.application.testRunner'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -let abilityDelegator = undefined; -let abilityDelegatorArguments = undefined; - -async function onAbilityCreateCallback() { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); - let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; - let debug = abilityDelegatorArguments.parameters['-D']; - if (debug == 'true') { - cmd += ' -D'; - } - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }); - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index e790e436bfe740d121e5b33d150ef2ab22da6158..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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 abilityTest from './XComponentAbility.test' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/test/XComponentAbility.test.ets b/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/test/XComponentAbility.test.ets deleted file mode 100644 index 948bfdc6020efdf89bf70e2e453fe1afa8ceb52e..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/test/XComponentAbility.test.ets +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { describe, it, expect } from '@ohos/hypium'; -import { Driver, ON } from '@ohos.UiTest'; - -const TAG = '[Sample_NDK_XComponent]'; - -export default function abilityTest() { - - describe('ActsAbilityTest', () => { - /** - * 打开应用 - */ - it('StartAbility_001', 0, async (done: Function) => { - console.info(TAG, 'StartAbility_001 begin'); - let driver = Driver.create(); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - try { - await abilityDelegator.startAbility({ - bundleName: 'com.samples.ndkxcomponent', - abilityName: 'EntryAbility' - }); - } catch (exception) { - console.info(TAG, `StartAbility_001 exception = ${JSON.stringify(exception)}`); - expect().assertFail(); - } - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('Draw Star')); - done(); - console.info(TAG, 'StartAbility_001 end'); - }) - - /** - * 点击按钮,绘制图形,之后点击XComponent改变颜色 - */ - it('DrawShape_001', 2, async () => { - console.info(TAG, 'CreateFiles_001 begin'); - let driver = Driver.create(); - // 判断是否有按键 - await driver.assertComponentExist(ON.text('Draw Star')); - let drawStarBtn = await driver.findComponent(ON.text('Draw Star')); - // 点击'Draw Star'按钮 - await drawStarBtn.click(); - await driver.delayMs(1000); - // 判断drawPattern方法已执行 - await driver.assertComponentExist(ON.text('draw star')); - - // 判断是否有XComponent组件 - let xcomponent = await driver.findComponent(ON.id('ndkxcomponent')); - // 点击XComponent组件 - await xcomponent.click(); - await driver.delayMs(1000); - // 判断touch回调已执行 - await driver.assertComponentExist(ON.text('change color')); - console.info(TAG, 'DrawShape_001 end'); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/testability/TestAbility.ets b/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index 5c0bdcdd07892b4af702bfe2855869f5afcfc3f1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 UIAbility from '@ohos.app.ability.UIAbility'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import hilog from '@ohos.hilog'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; -import window from '@ohos.window'; -import Want from '@ohos.app.ability.Want'; -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; - -export default class TestAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam){ - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs = AbilityDelegatorRegistry.getArguments(); - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage : window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - 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. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/testability/pages/Index.ets b/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index e1281d11efc7780af10fc8cb11917d45447a4a9a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 '@ohos.hilog'; - -@Entry -@Component -struct Index { - aboutToAppear(){ - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); - } - @State message: string = 'Hello World'; - build(){ - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - } - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(() => { - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/module.json5 b/ArkUIKit/NdkXComponent/entry/src/ohosTest/module.json5 deleted file mode 100644 index a7685a59ea27672ae8074c984c4699bd73f36a5b..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/element/color.json b/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/element/string.json b/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/media/icon.png b/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/profile/test_pages.json b/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/ArkUIKit/NdkXComponent/hvigor/hvigor-config.json5 b/ArkUIKit/NdkXComponent/hvigor/hvigor-config.json5 deleted file mode 100644 index f70ecd4112d94f9aa555adf898d53f18bf58f3e9..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "modelVersion": "5.0.0", - "dependencies": { - } -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/hvigorfile.ts b/ArkUIKit/NdkXComponent/hvigorfile.ts deleted file mode 100644 index 6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/oh-package.json5 b/ArkUIKit/NdkXComponent/oh-package.json5 deleted file mode 100644 index 1dfe27c7da2c2f6b41bef993a3688bf5fbcb4d4a..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/oh-package.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "modelVersion": "5.0.0", - "license": "", - "devDependencies": { - "@ohos/hypium": "1.0.6" - }, - "author": "", - "name": "ndkxcomponent", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/ohosTest.md b/ArkUIKit/NdkXComponent/ohosTest.md deleted file mode 100644 index 5469eacbec87545aec4cfaa42c141af8859124e1..0000000000000000000000000000000000000000 --- a/ArkUIKit/NdkXComponent/ohosTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# NdkXComponent 测试用例归档 - -## 用例表 - -|测试功能|预置条件|输入|预期输出|是否自动|测试结果| -|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------| -| 拉起应用 | 设备正常运行 | |成功拉起应用|是| Pass | -| 绘制图形 | 位于首页 | 1、点击**Draw Star** | 1、页面显示出一个五角星 | 是 | Pass | -| 响应触摸事件 | 位于首页,且已经显示了五角星 | 1、点击XComponent区域(灰色背景部分) | 1、页面中的五角星改变颜色 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/NdkXComponent/screenshots/device/changeColor.png b/ArkUIKit/NdkXComponent/screenshots/device/changeColor.png deleted file mode 100644 index 07586fceb2d038482dd984b921a7c80871824bb8..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkXComponent/screenshots/device/changeColor.png and /dev/null differ diff --git a/ArkUIKit/NdkXComponent/screenshots/device/drawStar.png b/ArkUIKit/NdkXComponent/screenshots/device/drawStar.png deleted file mode 100644 index e8be339ee8a16dae2c1ce350747f8e1f09782692..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkXComponent/screenshots/device/drawStar.png and /dev/null differ diff --git a/ArkUIKit/NdkXComponent/screenshots/device/main.png b/ArkUIKit/NdkXComponent/screenshots/device/main.png deleted file mode 100644 index a51df8c9cf759098882721219d5c9f4b5acfb0c8..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NdkXComponent/screenshots/device/main.png and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/.gitignore b/ArkUIKit/ScrollableComponent/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/ScrollableComponent/AppScope/app.json5 b/ArkUIKit/ScrollableComponent/AppScope/app.json5 deleted file mode 100644 index 92ed3a36e833607bc64578b181c20330a75dafe2..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.scrollablecomponent", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/ScrollableComponent/AppScope/resources/base/element/string.json b/ArkUIKit/ScrollableComponent/AppScope/resources/base/element/string.json deleted file mode 100644 index 0f965de3af08def5019fc97d5107ecd98928fd97..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ScrollableComponent" - } - ] -} diff --git a/ArkUIKit/ScrollableComponent/AppScope/resources/base/media/app_icon.png b/ArkUIKit/ScrollableComponent/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/README_zh.md b/ArkUIKit/ScrollableComponent/README_zh.md deleted file mode 100644 index 5b7104c0f73d6d420c9e319f290a47ec33725a75..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/README_zh.md +++ /dev/null @@ -1,151 +0,0 @@ -# ArkUI使用滚动类指南文档示例 - -### 介绍 - -本示例通过使用[ArkUI指南文档](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-ui-development)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [创建列表 (List)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-list)。 -2. [创建弧形列表 (ArcList)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-arclist)(圆形屏幕推荐使用) -3. [创建网格 (Grid/GridItem)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-grid)。 -4. [创建瀑布流 (WaterFlow)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-waterflow) -5. [创建轮播 (Swiper)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-looping)。 -6. [创建弧形轮播 (ArcSwiper)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-arcswiper)(圆形屏幕推荐使用) -7. [选项卡 (Tabs)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-navigation-tabs) -### 效果预览 - -| 首页 | 列表类组件目录 | 列表中显示数据示例 | -|------------------------------------|------------------------------------|------------------------------------| -| ![](screenshots/device/image1.png) | ![](screenshots/device/image2.png) | ![](screenshots/device/image3.png) | - -### 使用说明 - -1. 在主界面,可以点击对应卡片,选择需要参考的组件示例。 - -2. 在组件目录选择详细的示例参考。 - -3. 进入示例界面,查看参考示例。 - -4. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -entry/src/main/ets/ -|---entryability -|---pages -| |---arcList //弧形列表 -| | |---ArcListAcrScrollBar.ets -| | |---ArcListArcIndexerBar.ets -| | |---arcListBuiltInScrollerBar.ets -| | |---ArcListContents.ets -| | |---ArcListCrown.ets -| | |---ArcListShow.ets -| | |---ArcListSideSlip.ets -| | |---ArcListStyles.ets -| | |---ArcLongList.ets -| | |---index.ets -| |---arcSwiper //弧形轮播 -| | |---ArcSwiperAction.ets -| | |---ArcSwiperHorizontal.ets -| | |---ArcSwiperSideSlip.ets -| | |---ArcSwiperStyles.ets -| | |---ArcSwiperToggle.ets -| | |---ArcSwiperVertical.ets -| | |---index.ets -| |---grid //网格 -| | |---DataInGrid.ets -| | |---GridCalculator.ets -| | |---GridDataSource.ets -| | |---GridLayout.ets -| | |---GridScrollbar.ets -| | |---GridSideToSide.ets -| | |---index.ets -| | |---LongGrid.ets -| | |---ScrollableGrid.ets -| | |---ScrollPosition.ets -| |---list //列表 -| | |---AddListItem.ets -| | |---CollapseAndExpand.ets -| | |---ControlledScrollPositionList.ets -| | |---CustomListStyle.ets -| | |---DataInList.ets -| | |---DeleteListItem.ets -| | |---GroupedList.ets -| | |---index.ets -| | |---ListChatRoom.ets -| | |---ListDataSource.ets -| | |---ListIteration.ets -| | |---ListLayout.ets -| | |---LongList.ets -| | |---ResponsiveScrollPositionList.ets -| | |---StickyHeaderList.ets -| | |---SwipeListItem.ets -| | |---TaggedListItems.ets -| |---swiper //轮播 -| | |---index.ets -| | |---SwiperAndTabsLinkage.ets -| | |---SwiperAutoPlay.ets -| | |---SwiperCustomAnimation.ets -| | |---SwiperDirection.ets -| | |---SwiperIgnoreComponentSize.ets -| | |---SwiperIndicatorStyle.ets -| | |---SwiperLoop.ets -| | |---SwiperMultiPage.ets -| | |---SwiperPageSwitchMethod.ets -| |---tabs //选项卡 -| | |---AgeFriendlyTabs.ets -| | |---BottomTabBar.ets -| | |---ContentWillChange.ets -| | |---CustomTabBar.ets -| | |---FixedTabBar.ets -| | |---index.ets -| | |---ScrollableTabBar.ets -| | |---SideTabBar.ets -| | |---SwipeLockedTabBar.ets -| | |---TabsLayout.ets -| | |---TopTabBar.ets -| |---waterFlow //瀑布流 -| | |---AgeFriendlyTabs.ets -| | |---BottomTabBar.ets -| | |---ContentWillChange.ets -| | |---CustomTabBar.ets -| | |---FixedTabBar.ets -| | |---index.ets -| | |---WaterFlowDataSource.ets -| | |---WaterFlowDynamicSwitchover.ets -| | |---WaterFlowGroupingMixing.ets -| | |---WaterFlowInfiniteScrolling.ets -| | |---WaterFlowInfiniteScrollingEarly.ets -|---pages -| |---Index.ets // 应用主页面 -entry/src/ohosTest/ -|---ets -| |---index.test.ets // 示例代码测试代码 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API18版本full-SDK,版本号:5.1.0.107,镜像版本号:OpenHarmony_5.1.0 Release。 - -3.本示例需要使用DevEco Studio 5.0.5 Release (Build Version: 5.0.13.200, built on May 13, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUIDocSample/ScrollableComponent > .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/ArkUIKit/ScrollableComponent/build-profile.json5 b/ArkUIKit/ScrollableComponent/build-profile.json5 deleted file mode 100644 index f9ba3cae329bdbab95968a96997164db427c9f41..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.0(18)", - "compatibleSdkVersion": "5.1.0(18)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/code-linter.json5 b/ArkUIKit/ScrollableComponent/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/.gitignore b/ArkUIKit/ScrollableComponent/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/build-profile.json5 b/ArkUIKit/ScrollableComponent/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/hvigorfile.ts b/ArkUIKit/ScrollableComponent/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/ScrollableComponent/entry/obfuscation-rules.txt b/ArkUIKit/ScrollableComponent/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/ScrollableComponent/entry/oh-package.json5 b/ArkUIKit/ScrollableComponent/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/ScrollableComponent/entry/src/main/ets/common/Card.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/common/Card.ets deleted file mode 100644 index 8eef9a0fc9b2138668c3048c8076d9db3e453c85..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/common/Card.ets +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Component -export struct CompletedRoutableCard { - @Prop - symbol: Resource = $r('sys.symbol.label'); - @Prop - @Require - title: string; - @Prop - @Require - description: ResourceStr; - - build() { - Card({ verticalAlign: VerticalAlign.Top }) { - Button({ type: ButtonType.Circle }) { - SymbolGlyph(this.symbol) - .fontColor(['#fff']) - .fontSize(16) - } - .borderRadius(14) - - Column({ space: 8 }) { - Text(this.title) - .fontColor($r('sys.color.font_primary')) - - Text(this.description) - .fontColor($r('sys.color.font_secondary')) - .fontSize($r('sys.float.Body_S')) - } - .alignItems(HorizontalAlign.Start) - .layoutWeight(1) - } - } -} - -@Component -export struct Card { - @Prop - verticalAlign: VerticalAlign = VerticalAlign.Center; - @BuilderParam - content: () => void; - - build() { - Row({ space: 12 }) { - this.content() - } - .alignItems(this.verticalAlign) - .backgroundColor('#fff') - .borderRadius(12) - .padding(12) - .width('100%') - } -} - -@Component -export struct RoutableCard { - @Prop - icon: Resource = $r('sys.symbol.label'); - @Prop - @Require - title: ResourceStr; - - build() { - Card() { - Button({ type: ButtonType.Circle }) { - SymbolGlyph(this.icon) - .fontColor(['#fff']) - .fontSize(16) - } - .borderRadius(14) - - Text(this.title) - .fontColor($r('sys.color.font_primary')) - .minFontSize(12) - .maxFontSize(16) - .maxLines(1) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - - Blank() - - Button({ type: ButtonType.Normal, buttonStyle: ButtonStyleMode.TEXTUAL }) { - SymbolGlyph($r('sys.symbol.chevron_right')) - .fontSize(18) - .fontColor([$r('sys.color.font_secondary')]) - } - } - } -} - -@Component -export struct ComponentCard { - @Prop - @Require - title: ResourceStr; - @BuilderParam content: () => void; - @Prop - description?: ResourceStr; - - build() { - Column({ space: 8 }) { - Text(this.title) - .fontSize(14) - .fontColor('#666') - Row({ space: 12}) { - this.content(); - } - if (this.description) { - Text(this.description) - .backgroundColor('#eee') - .borderRadius(4) - .padding(4) - .fontSize(12) - .fontColor('#999') - .width('100%') - } - } - .alignItems(HorizontalAlign.Start) - .backgroundColor('#fff') - .borderRadius(12) - .padding(12) - .width('100%') - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/common/Route.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/common/Route.ets deleted file mode 100644 index da3d2cc3284d5cba7d3b667a3c1c61f5c6b5a9dc..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/common/Route.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export interface Route { - title: string ; - name: string; - items?: Route[]; - description?: ResourceStr; -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/common/resource.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/common/resource.ets deleted file mode 100644 index e240a1079ad09a0f19080b49b57a6a0720416e6c..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/common/resource.ets +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export class ResourceManager { - public resourceToString(resource: Resource): string { - return getContext(this).resourceManager.getStringSync(resource); - } -} - -// 默认导出let -let resourceToStringManager = new ResourceManager(); - -export default resourceToStringManager as ResourceManager; \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index edc2839f203ba057c186e19b0cbbbf80c8faa8b3..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/Index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index be9cdd168523a39eec9f2753548c165d168b2da0..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2025 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 { gridDestination, GRID_ROUTE_PREFIX } from './grid'; -import { List_ROUTE_PREFIX, listDestination } from './list/Index'; -import { LengthMetrics } from '@kit.ArkUI'; -import { Route } from '../common/Route'; -import { RoutableCard } from '../common/Card'; -import { swiperDestination, SWIPER_ROUTE_PREFIX } from './swiper'; -import { waterFlowDestination, WATERFLOW_ROUTE_PREFIX } from './waterFlow'; -import { tabsDestination, TABS_ROUTE_PREFIX } from './tabs'; -import { arcSwiperDestination, ARCSWIPER_ROUTE_PREFIX } from './arcSwiper'; -import { arcListDestination, ARCLIST_ROUTE_PREFIX } from './arcList'; -import resource from '../common/resource'; - -const routes: Route[] = [ - { - title: resource.resourceToString($r('app.string.pageIndex_List')), - name: List_ROUTE_PREFIX - }, - { - title: resource.resourceToString($r('app.string.pageIndex_ArcList')), - name: ARCLIST_ROUTE_PREFIX - }, - { - title: resource.resourceToString($r('app.string.pageIndex_Grid')), - name: GRID_ROUTE_PREFIX - }, - { - title: resource.resourceToString($r('app.string.pageIndex_WaterFlow')), - name: WATERFLOW_ROUTE_PREFIX - }, - { - title: resource.resourceToString($r('app.string.pageIndex_Swiper')), - name: SWIPER_ROUTE_PREFIX - }, - { - title: resource.resourceToString($r('app.string.pageIndex_ArcSwiper')), - name: ARCSWIPER_ROUTE_PREFIX - }, - { - title: resource.resourceToString($r('app.string.pageIndex_Tabs')), - name: TABS_ROUTE_PREFIX - } -]; - -@Builder -function destination(name: string) { - if (name.startsWith(List_ROUTE_PREFIX)) { - listDestination(name); - } else if (name.startsWith(GRID_ROUTE_PREFIX)) { - gridDestination(name); - } else if (name.startsWith(SWIPER_ROUTE_PREFIX)) { - swiperDestination(name); - } else if (name.startsWith(ARCSWIPER_ROUTE_PREFIX)) { - arcSwiperDestination(name); - } else if (name.startsWith(TABS_ROUTE_PREFIX)) { - tabsDestination(name); - } else if (name.startsWith(WATERFLOW_ROUTE_PREFIX)) { - waterFlowDestination(name); - } else if (name.startsWith(ARCLIST_ROUTE_PREFIX)) { - arcListDestination(name); - } -} - -@Entry -@Component -struct Index { - @State condition: string = ''; - @Provide pathStack: NavPathStack = new NavPathStack(); - - getFilteredRoutes(): Route[] { - if (!this.condition) { - return routes; - } - return routes.filter((route: Route) => { - return route.title.includes(this.condition); - }) - } - - @LocalBuilder - Title() { - Column() { - Search({ value: this.condition }) - .onChange(value => { - this.condition = value; - }) - .margin({ start: LengthMetrics.vp(16), end: LengthMetrics.vp(16) }) - } - .justifyContent(FlexAlign.Center) - .height('100%') - } - - build() { - Navigation(this.pathStack) { - List({ space: 12 }) { - ForEach(this.getFilteredRoutes(), (route: Route) => { - ListItem() { - RoutableCard({ title: route.title }) - } - .width('100%') - .onClick(() => { - this.pathStack.pushPath({ name: route.name }); - }) - }) - } - .padding({ start: LengthMetrics.vp(16), end: LengthMetrics.vp(16) }) - .contentStartOffset(56) - .height('100%') - .width('100%') - } - .backgroundColor('#f1f3f5') - .title({ builder: this.Title, height: 56 }, { - backgroundBlurStyle: BlurStyle.COMPONENT_THICK, - barStyle: BarStyle.STACK - }) - .navDestination(destination) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListAcrScrollBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListAcrScrollBar.ets deleted file mode 100644 index 6cb9df1e993b96d6c2dd6864df78c656fad4c23d..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListAcrScrollBar.ets +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2025 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 { - ArcList, - ArcListItem, - ArcListAttribute, - ArcListItemAttribute, - LengthMetrics, - ArcScrollBar, -} from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ArcListAcrScrollBar { - private arcListScroller: Scroller = new Scroller(); - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcListAcrScrollBar_title') }) { - ArcList({ scroller: this.arcListScroller }) { - ArcListItem() { - Row() { - Image($r('app.media.wlan')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_waln')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.blueTooth')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_blue')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.mobileData')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_net')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.ic_settings_more_connections')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_connect')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.displayAndBrightness')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_light')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - } - .width('466px') - .height('466px') - .space(LengthMetrics.px(10)) - .borderRadius('233px') - .backgroundColor(Color.Black) - - ArcScrollBar({ scroller: this.arcListScroller }) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcListAcrScrollBar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListArcIndexerBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListArcIndexerBar.ets deleted file mode 100644 index ca16ea3554d04747c3e6b5d323ab0bb5f56d9442..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListArcIndexerBar.ets +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2025 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 { ArcList, ArcListAttribute, ArcListItemAttribute, ArcListItem, LengthMetrics } from '@kit.ArkUI'; -import { ColorMetrics, ComponentContent } from '@ohos.arkui.node'; -import { util } from '@kit.ArkTS'; -import { ArcAlphabetIndexer, ArcAlphabetIndexerAttribute } from '@ohos.arkui.ArcAlphabetIndexer'; -import { ComponentCard } from '../../common/Card'; - -class Contact { - key: string = util.generateRandomUUID(true); - name: string; - firstChar: string; - - constructor(name: string, firstChar: string) { - this.name = name; - this.firstChar = firstChar; - } -} -@Builder -function buildText() { - Column() { - Text('Contacts') - .fontColor('#FFFFFF') - .fontSize('19fp') - - } -} - -@Entry -@Component -export struct ArcListArcIndexerBar { - - @State contacts: Array = [ - new Contact('阿哈', 'A'), - new Contact('贝贝', 'B'), - new Contact('彩彩', 'C'), - new Contact('东东', 'D'), - new Contact('嗯嗯', 'E'), - new Contact('芳芳', 'F'), - new Contact('哥哥', 'G'), - new Contact('哈哈', 'H'), - new Contact('吉吉', 'J'), - new Contact('可可', 'K'), - new Contact('乐乐', 'L'), - new Contact('妹妹', 'M'), - new Contact('妮妮', 'N'), - new Contact('哦豁', 'O'), - new Contact('胖胖', 'P'), - new Contact('琪琪', 'Q'), - new Contact('然然', 'R'), - new Contact('叔叔', 'S'), - new Contact('天天', 'T'), - ]; - private scrollerForList: Scroller = new Scroller(); - private watchSize: string = '600px'; // 手表默认宽高:233*233 - private fullValue: string[] = [ - '#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', - 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' - ]; - @State indexerIndex: number = 0; - - context: UIContext = this.getUIContext(); - tabBar1: ComponentContent = new ComponentContent(this.context, wrapBuilder(buildText)); - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcListArcIndexerBar_title') }) { - Stack() { - ArcList({ initialIndex: 0, header:this.tabBar1, scroller:this.scrollerForList }) { - ForEach(this.contacts, (item: Contact) => { - ArcListItem() { - Row() { - Text(item.firstChar) - .textAlign(TextAlign.Center) - .width(30) - .height(30) - .margin(10) - .backgroundColor('#FF9CC998') - .borderRadius(20) - Text(item.name).fontSize('38px').fontColor('#FFFFFFFF') - } - .width('100%') - .justifyContent(FlexAlign.Start) - } - .borderRadius('65px') - .width('370px') - .height('130px') - .backgroundColor('#26FFFFFF') - }, (item: Contact) => JSON.stringify(item)) - } - .space(LengthMetrics.px(10)) - .scrollBar(BarState.Off) - .width(this.watchSize) - .height(this.watchSize) - .borderRadius(this.watchSize) - .backgroundColor(Color.Black) - .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { - this.indexerIndex = centerIndex + 1; - }) - - ArcAlphabetIndexer({ arrayValue: this.fullValue, selected: this.indexerIndex}) - .autoCollapse(true) - .width(this.watchSize) - .height(this.watchSize) - .usePopup(false) - .selected(this.indexerIndex!!) - .onSelect((index: number) => { - this.indexerIndex = index - this.scrollerForList.scrollToIndex(this.indexerIndex - 1) - }) - .hitTestBehavior(HitTestMode.Transparent) - .selectedColor(ColorMetrics.resourceColor(0xFFFFFF)) - .selectedBackgroundColor(ColorMetrics.resourceColor(0x1F71FF)) - .color(ColorMetrics.resourceColor(0xFFFFFF)) - .popupColor(ColorMetrics.resourceColor(0xFFFFFF)) - .popupBackground(ColorMetrics.resourceColor(0xD8404040)) - .itemSize(LengthMetrics.px(12)) - .selectedFont({ - size: '11.0fp', - style: FontStyle.Normal, - weight: 500, - family: 'HarmonyOS Sans' - }) - .font({ - size: '11.0fp', - style: FontStyle.Normal, - weight: 500, - family: 'HarmonyOS Sans' - }) - - }.width('600px') - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcListArcIndexerBar_title')) - } -} diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListContents.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListContents.ets deleted file mode 100644 index 007f3911dd50fe7ca9eaa42f51c2be455f09b0ad..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListContents.ets +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2025 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 { ArcList, ArcListAttribute, ArcListItemAttribute, ArcListItem, LengthMetrics } from '@kit.ArkUI'; -import { util } from '@kit.ArkTS'; -import { ComponentCard } from '../../common/Card'; - -class Contact { - key: string = util.generateRandomUUID(true); - name: string; - icon: Resource; - - constructor(name: string, icon: Resource) { - this.name = name; - this.icon = icon; - } -} - -@Entry -@Component -export struct ArcListContents { - private contacts: Array = [ - new Contact('小红', $r('app.media.ic_contact')), - new Contact('小兰', $r('app.media.ic_contact')), - new Contact('小王', $r('app.media.ic_contact')), - new Contact('小李', $r('app.media.ic_contact')), - new Contact('小明', $r('app.media.ic_contact')) - ]; - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcListContents_title') }) { - ArcList({ initialIndex: 2 }) { - ForEach(this.contacts, (item: Contact) => { - ArcListItem() { - Row() { - Image(item.icon) - .width(40) - .height(40) - .margin(10) - .backgroundColor('#FF9CC998') - .borderRadius(20) - Text(item.name).fontSize('38px').fontColor('#FFFFFFFF') - } - .width('100%') - .justifyContent(FlexAlign.Start) - } - .borderRadius('65px') - .width('410px') - .height('130px') - .backgroundColor('#26FFFFFF') - }, (item: Contact) => JSON.stringify(item)) - } - .space(LengthMetrics.px(10)) - .width('466px') - .height('466px') - .borderRadius('233px') - .backgroundColor(Color.Black) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcListContents_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCrown.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCrown.ets deleted file mode 100644 index cc76cdd3cb9dcb943ca881973e60b9eb965a8712..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCrown.ets +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2025 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 { ColorMetrics, LengthMetrics } from '@kit.ArkUI'; -import { ArcList, ArcListItem, ArcListAttribute, ArcListItemAttribute } from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Builder -function buildText() { - Column() { - Text($r('app.string.ArcListCrown_set')) - .fontColor('#FFFFFF') - .fontSize('19fp') - - }.height(10) -} - -@Entry -@Component -export struct ArcListCrown { - private watchSize: string = '466px'; // 手表默认宽高:466*466 - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcListCrown_title') }) { - Stack() { - ArcList({ - initialIndex: 2, - }) { - ArcListItem() { - Text('Network').fontSize('38px').fontColor('#FFFFFFFF') - } - .borderRadius('65px') - .width('414px') - .height('50px') - .autoScale(false) - - ArcListItem() { - Row() { - Image($r('app.media.wlan')).width('80px').height('80px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text('WLAN').fontSize('38px').fontColor('#FFFFFFFF') - Text('On').fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('80px').height('80px') - .borderRadius('50px') - } - - } - .borderRadius('65px') - .width('414px') - .height('100px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.mobileData')).width('80px').height('80px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text('Bluetooth').fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('80px').height('80px') - .borderRadius('50px') - } - - } - .borderRadius('65px') - .width('414px') - .height('100px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Text('Display').fontSize('38px').fontColor('#FFFFFFFF') - } - .borderRadius('65px') - .width('414px') - .height('50px') - .autoScale(false) - - ArcListItem() { - Row() { - Image($r('app.media.displayAndBrightness')).width('80px').height('80px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text('Display & brightness').fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('80px').height('80px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('100px') - .backgroundColor('#26FFFFFF') - } - .space(LengthMetrics.px(10)) - .scrollBarWidth(LengthMetrics.px(10)) - .scrollBarColor(ColorMetrics.resourceColor(Color.White)) - .borderRadius(this.watchSize) - .focusable(true) - .focusOnTouch(true) - .defaultFocus(true) - } - .align(Alignment.Center) - .width(this.watchSize) - .height(this.watchSize) - .borderRadius(this.watchSize) - .backgroundColor(Color.Black) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcListCrown_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListShow.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListShow.ets deleted file mode 100644 index 932600a062460483ac317ddba7abce9249dbe6bc..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListShow.ets +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2025 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 { ArcList, ArcListItem, ArcListAttribute, ArcListItemAttribute, LengthMetrics, } from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ArcListShow { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcListShow_title') }) { - ArcList({ initialIndex: 2 }) { - ArcListItem() { - Row() { - Image($r('app.media.wlan')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_waln')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.blueTooth')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_blue')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.mobileData')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_net')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.ic_settings_more_connections')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_connect')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.displayAndBrightness')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_light')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - } - .width('466px') - .height('466px') - .space(LengthMetrics.px(10)) - .borderRadius('233px') - .backgroundColor(Color.Black) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcListShow_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListSideSlip.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListSideSlip.ets deleted file mode 100644 index ce364a1d3495111550eda7d0bca4206abf81f1f9..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListSideSlip.ets +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2025 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 { ArcList, ArcListAttribute, ArcListItemAttribute, ArcListItem } from '@kit.ArkUI'; -import { ComponentContent, LengthMetrics } from '@ohos.arkui.node'; -import { util } from '@kit.ArkTS'; -import { ComponentCard } from '../../common/Card'; - -class Contact { - key: string = util.generateRandomUUID(true); - name: string; - firstChar: string; - - constructor(name: string, firstChar: string) { - this.name = name; - this.firstChar = firstChar; - } -} -@Builder -function buildText() { - Column() { - Text('Contacts ') - .fontColor('#FFFFFF') - .fontSize('19fp') - - } -} - -@Entry -@Component -export struct ArcListSideSlip { - @State contacts: Array = [ - new Contact('Alice', 'A'), - new Contact('Bob', 'B'), - new Contact('Charlie', 'C'), - new Contact('Diana', 'D'), - new Contact('Eve', 'E'), - new Contact('阿哈', 'A'), - new Contact('贝贝', 'B'), - new Contact('彩彩', 'C'), - new Contact('东东', 'D'), - new Contact('嗯嗯', 'E'), - new Contact('芳芳', 'F'), - new Contact('哥哥', 'G'), - new Contact('哈哈', 'H'), - new Contact('吉吉', 'J'), - new Contact('可可', 'K'), - new Contact('乐乐', 'L'), - new Contact('妹妹', 'M'), - new Contact('妮妮', 'N'), - new Contact('哦豁', 'O'), - new Contact('胖胖', 'P'), - new Contact('琪琪', 'Q'), - new Contact('然然', 'R'), - new Contact('叔叔', 'S'), - new Contact('天天', 'T'), - ]; - - private scrollerForList: Scroller = new Scroller(); - - @State indexerIndex: number = 0; - context: UIContext = this.getUIContext(); - tabBar1: ComponentContent = new ComponentContent(this.context, wrapBuilder(buildText)); - - @Builder - itemEnd(item: Contact) { - // 构建尾端滑出组件 - Button({ type: ButtonType.Circle }) { - Image($r('app.media.MaterialSymbolsDelete')) - .width(20) - .height(20) - } - .width(20) - .height(20) - .backgroundColor(Color.Black) - .onClick(() => { - this.getUIContext()?.animateTo({ - duration: 1000, - curve: Curve.Smooth, - iterations: 1, - playMode: PlayMode.Normal, - }, () => { - let index = this.contacts.indexOf(item); - this.contacts.splice(index, 1); - }) - - }) - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcListSideSlip_title') }) { - Stack() { - ArcList({ initialIndex: 0, header: this.tabBar1, scroller: this.scrollerForList }) { - ForEach(this.contacts, (item: Contact) => { - ArcListItem() { - Row() { - Text(item.firstChar) - .textAlign(TextAlign.Center) - .width(30) - .height(30) - .margin(10) - .backgroundColor('#FF9CC998') - .borderRadius(20) - Text(item.name).fontSize('38px').fontColor('#FFFFFFFF') - } - .backgroundColor('#26FFFFFF') - .borderRadius('65px') - .width('90%') - .justifyContent(FlexAlign.Start) - } - .swipeAction({ - end: { - // index为该ArcListItem在ArcList中的索引值。 - builder: () => { - this.itemEnd(item); - }, - } - }) // 设置侧滑属性. - .borderRadius('65px') - .width('400px') - .height('130px') - - }, (item: Contact) => JSON.stringify(item)) - } - .space(LengthMetrics.px(10)) - .scrollBar(BarState.Auto) - .width('466px') - .height('466px') - .borderRadius('233px') - .backgroundColor(Color.Black) - .margin(50) - .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { - this.indexerIndex = centerIndex + 1; - }) - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcListSideSlip_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListStyles.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListStyles.ets deleted file mode 100644 index d3452e6ba7f8f05c5df4a15dee0d94cab2ff54b7..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListStyles.ets +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Copyright (c) 2025 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 { - ArcList, - ArcListItem, - ArcListAttribute, - ArcListItemAttribute, - LengthMetrics, - ComponentContent -} from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Builder -function customHeader() { - Column() { - Text($r('app.string.ArcListCrown_set')) - .fontColor('#FFFFFFFF') - .fontSize('19fp') - } -} - - -@Entry -@Component -export struct ArcListStyles { - context: UIContext = this.getUIContext(); - arcListHeader: ComponentContent = new ComponentContent(this.context, wrapBuilder(customHeader)); - - build() { - NavDestination() { - Column({ space: 12 }) { - List(){ - ListItem(){ - ComponentCard({ title: $r('app.string.ArcListStyles_head') }) { - ArcList({ header: this.arcListHeader }) { - ArcListItem() { - Row() { - Image($r('app.media.wlan')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_waln')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.blueTooth')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_blue')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.mobileData')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_net')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.ic_settings_more_connections')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_connect')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.displayAndBrightness')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_light')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - } - .width('466px') - .height('466px') - .space(LengthMetrics.px(10)) - .borderRadius('233px') - .backgroundColor(Color.Black) - } - } - - ListItem(){ - ComponentCard({ title: $r('app.string.ArcListStyles_titleSpacing') }) { - ArcList({ initialIndex: 2 }) { - ArcListItem() { - Row() { - Image($r('app.media.wlan')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_waln')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.blueTooth')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_blue')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.mobileData')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_net')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.ic_settings_more_connections')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_connect')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.displayAndBrightness')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_light')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - } - .width('466px') - .height('466px') - .space(LengthMetrics.px(30)) - .borderRadius('233px') - .backgroundColor(Color.Black) - - } - } - - ListItem(){ - ComponentCard({ title: $r('app.string.ArcListStyles_titleScale') }) { - ArcList({ initialIndex: 2 }) { - ArcListItem() { - Row() { - Image($r('app.media.wlan')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_waln')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.blueTooth')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_blue')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.mobileData')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_net')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - .autoScale(false) - - ArcListItem() { - Row() { - Image($r('app.media.ic_settings_more_connections')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_connect')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.displayAndBrightness')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_light')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - .autoScale(false) - } - .width('466px') - .height('466px') - .space(LengthMetrics.px(30)) - .borderRadius('233px') - .backgroundColor(Color.Black) - } - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcListStyles_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcLongList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcLongList.ets deleted file mode 100644 index 6ddd21ef91d42add85eb674413d50693f0df0a36..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcLongList.ets +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2025 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 { ArcList, ArcListAttribute, ArcListItemAttribute, ArcListItem } from '@kit.ArkUI'; -import { LengthMetrics } from '@ohos.arkui.node'; -import { ComponentCard } from '../../common/Card'; - -class BasicDataSource implements IDataSource { - private listeners: DataChangeListener[] = []; - private originDataArray: StringData[] = []; - - public totalCount(): number { - return 0; - } - - public getData(index: number): StringData { - return this.originDataArray[index]; - } - - registerDataChangeListener(listener: DataChangeListener): void { - if (this.listeners.indexOf(listener) < 0) { - console.info('add listener'); - this.listeners.push(listener); - } - } - - unregisterDataChangeListener(listener: DataChangeListener): void { - const pos = this.listeners.indexOf(listener); - if (pos >= 0) { - console.info('remove listener'); - this.listeners.splice(pos, 1); - } - } - - notifyDataReload(): void { - this.listeners.forEach(listener => { - listener.onDataReloaded(); - }); - } - - notifyDataAdd(index: number): void { - this.listeners.forEach(listener => { - listener.onDataAdd(index); - }); - } - - notifyDataChange(index: number): void { - this.listeners.forEach(listener => { - listener.onDataChange(index); - }); - } - - notifyDataDelete(index: number): void { - this.listeners.forEach(listener => { - listener.onDataDelete(index); - }); - } - - notifyDataMove(from: number, to: number): void { - this.listeners.forEach(listener => { - listener.onDataMove(from, to); - }); - } - - notifyDatasetChange(operations: DataOperation[]): void { - this.listeners.forEach(listener => { - listener.onDatasetChange(operations); - }); - } -} - -class MyDataSource extends BasicDataSource { - private dataArray: StringData[] = []; - - public totalCount(): number { - return this.dataArray.length; - } - - public getData(index: number): StringData { - return this.dataArray[index]; - } - - public pushData(data: StringData): void { - this.dataArray.push(data); - this.notifyDataAdd(this.dataArray.length - 1); - } -} - -@Observed -class StringData { - message: string; - - constructor(message: string) { - this.message = message; - } -} - -@Entry -@Component -export struct ArcLongList { - private data: MyDataSource = new MyDataSource(); - - aboutToAppear() { - for (let i = 0; i <= 100; i++) { - this.data.pushData(new StringData(`Hello ${i}`)); - } - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcLongList_title') }) { - ArcList() { - LazyForEach(this.data, (item: StringData, index: number) => { - ArcListItem() { - Text(item.message).fontSize(30).fontColor(Color.White) - } - .onClick(() => { - item.message += '0'; - }) - }, (item: StringData, index: number) => JSON.stringify(item) + index.toString()) - }.cachedCount(3) - .space(LengthMetrics.px(10)) - .scrollBar(BarState.Auto) - .width('466px') - .height('466px') - .borderRadius('233px') - .backgroundColor(Color.Black) - .margin(50) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcLongList_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/arcListBuiltInScrollerBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/arcListBuiltInScrollerBar.ets deleted file mode 100644 index f38604db4abcad1d3eb7fe6d91386fcb1c9d411f..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/arcListBuiltInScrollerBar.ets +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2025 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 { ArcList, ArcListItem, ArcListAttribute, ArcListItemAttribute, LengthMetrics, ColorMetrics } from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct arcListBuiltInScrollerBar { - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.arcListBuiltInScrollerBar_title') }) { - ArcList() { - ArcListItem() { - Row() { - Image($r('app.media.wlan')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_waln')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.blueTooth')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_blue')).fontSize('38px').fontColor('#FFFFFFFF') - Text($r('app.string.ArcListStyles_open')).fontSize('20px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.mobileData')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_net')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.ic_settings_more_connections')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_connect')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - - ArcListItem() { - Row() { - Image($r('app.media.displayAndBrightness')).width('99px').height('99px') - .borderRadius('50px').margin({ left: 7 }) - Column() { - Text($r('app.string.ArcListStyles_light')).fontSize('38px').fontColor('#FFFFFFFF') - }.width('190px') - - Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') - .borderRadius('50px') - } - } - .borderRadius('65px') - .width('414px') - .height('129px') - .backgroundColor('#26FFFFFF') - } - .width('466px') - .height('466px') - .space(LengthMetrics.px(10)) - .borderRadius('233px') - .backgroundColor(Color.Black) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.arcListBuiltInScrollerBar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/index.ets deleted file mode 100644 index b2b874b86cf2ef6da31a8d4aa1a8d3ac845e95fd..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/index.ets +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2025 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 { CompletedRoutableCard } from '../../common/Card'; -import { Route } from '../../common/Route'; -import { ArcListAcrScrollBar } from './ArcListAcrScrollBar'; -import { ArcListArcIndexerBar } from './ArcListArcIndexerBar'; -import { arcListBuiltInScrollerBar } from './arcListBuiltInScrollerBar'; -import { ArcListContents } from './ArcListContents'; -import { ArcListCrown } from './ArcListCrown'; -import { ArcListShow } from './ArcListShow'; -import { ArcListSideSlip } from './ArcListSideSlip'; -import { ArcListStyles } from './ArcListStyles'; -import { ArcLongList } from './ArcLongList'; - -import resource from '../../common/resource'; - -export const ARCLIST_ROUTE_PREFIX: string = 'arcList'; - -const routes: Route[] = [ - { - name: `${ARCLIST_ROUTE_PREFIX}/ArcListShow`, - title: resource.resourceToString($r('app.string.ArcListShow_title')), - description: $r('app.string.ArcListShow_description') - }, - { - name: `${ARCLIST_ROUTE_PREFIX}/ArcListContents`, - title: resource.resourceToString($r('app.string.ArcListContents_title')), - description: $r('app.string.ArcListContents_description') - }, - { - name: `${ARCLIST_ROUTE_PREFIX}/ArcListStyles`, - title: resource.resourceToString($r('app.string.ArcListStyles_title')), - description: $r('app.string.ArcListStyles_description') - }, - { - name: `${ARCLIST_ROUTE_PREFIX}/arcListBuiltInScrollerBar`, - title: resource.resourceToString($r('app.string.arcListBuiltInScrollerBar_title')), - description: $r('app.string.arcListBuiltInScrollerBar_description') - }, - { - name: `${ARCLIST_ROUTE_PREFIX}/ArcListAcrScrollBar`, - title: resource.resourceToString($r('app.string.ArcListAcrScrollBar_title')), - description: $r('app.string.ArcListAcrScrollBar_description') - }, - { - name: `${ARCLIST_ROUTE_PREFIX}/ArcListArcIndexerBar`, - title: resource.resourceToString($r('app.string.ArcListArcIndexerBar_title')), - description: $r('app.string.ArcListArcIndexerBar_description') - }, - { - name: `${ARCLIST_ROUTE_PREFIX}/ArcListSideSlip`, - title: resource.resourceToString($r('app.string.ArcListSideSlip_title')), - description: $r('app.string.ArcListSideSlip_description') - }, - { - name: `${ARCLIST_ROUTE_PREFIX}/ArcLongList`, - title: resource.resourceToString($r('app.string.ArcLongList_title')), - description: $r('app.string.ArcLongList_description') - }, - { - name: `${ARCLIST_ROUTE_PREFIX}/ArcListCrown`, - title: resource.resourceToString($r('app.string.ArcListCrown_title')), - description: $r('app.string.ArcListCrown_description') - } -]; - -@Builder -export function arcListDestination(name: string) { - if (name === ARCLIST_ROUTE_PREFIX) { - ArcListExample(); - } else if (name === routes[0].name) { - ArcListShow(); - } else if (name === routes[1].name) { - ArcListContents(); - } else if (name === routes[2].name) { - ArcListStyles(); - } else if (name === routes[3].name) { - arcListBuiltInScrollerBar(); - } else if (name === routes[4].name) { - ArcListAcrScrollBar(); - } else if (name === routes[5].name) { - ArcListArcIndexerBar(); - } else if (name === routes[6].name) { - ArcListSideSlip(); - } else if (name === routes[7].name) { - ArcLongList(); - } else if (name === routes[8].name) { - ArcListCrown(); - } -} - -@Entry -@Component -struct ArcListExample { - @Consume pathStack: NavPathStack; - - build() { - NavDestination() { - List({ space: 12 }) { - ForEach(routes, (route: Route) => { - ListItem() { - CompletedRoutableCard({ title: route.title, description: route.description }) - } - .width('100%') - .onClick(() => { - this.pathStack.pushPath({ name: route.name }); - }) - }) - } - .contentStartOffset(56) - .padding({ left: 16, right: 16 }) - } - .backgroundColor('#f1f3f5') - .title('ArcList', { - backgroundBlurStyle: BlurStyle.COMPONENT_THICK, - barStyle: BarStyle.STACK - }) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperAction.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperAction.ets deleted file mode 100644 index d7f1f0af987e314896998fd453ee0d0905692d02..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperAction.ets +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2025 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 { Decimal } from '@kit.ArkTS'; -import { - ArcSwiper, - ArcSwiperAttribute, -} from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ArcSwiperAction { - private MIN_SCALE: number = 0.1; - @State backgroundColors: Color[] = [Color.Green, Color.Blue, Color.Yellow, Color.Pink, Color.Gray, Color.Orange]; - @State opacityList: number[] = []; - @State scaleList: number[] = []; - - aboutToAppear(): void { - for (let i = 0; i < this.backgroundColors.length; i++) { - this.opacityList.push(1.0); - this.scaleList.push(1.0); - } - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcSwiperAction_title') }) { - ArcSwiper() { - ForEach(this.backgroundColors, (backgroundColor: Color, index: number) => { - Text(index.toString()) - .width(233) - .height(233) - .fontSize(50) - .textAlign(TextAlign.Center) - .backgroundColor(backgroundColor) - .opacity(this.opacityList[index]) - .scale({ x: this.scaleList[index], y: this.scaleList[index] }) - }) - } - .customContentTransition({ - timeout: 1000, - transition: (proxy: SwiperContentTransitionProxy) => { - if (proxy.position <= -1 || proxy.position >= 1) { - // 页面完全滑出视窗外时,重置属性值 - this.opacityList[proxy.index] = 1.0; - this.scaleList[proxy.index] = 1.0; - } else { - let position: number = Decimal.abs(proxy.position).toNumber(); - this.opacityList[proxy.index] = 1 - position; - this.scaleList[proxy.index] = - this.MIN_SCALE + (1 - this.MIN_SCALE) * (1 - position); - } - } - }) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcSwiperAction_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperHorizontal.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperHorizontal.ets deleted file mode 100644 index 47d538edcbc3bac7bba2cea7f8e10c588061d6b0..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperHorizontal.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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 { - ArcSwiper, - ArcSwiperAttribute, -} from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ArcSwiperHorizontal { - @State message: string = 'Hello World'; - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcSwiperHorizontal_title') }) { - ArcSwiper() { - Text('0') - .width(233) - .height(233) - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width(233) - .height(233) - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width(233) - .height(233) - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - } - .indicator(true) - .vertical(false) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcSwiperHorizontal_title')) - } -} diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperSideSlip.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperSideSlip.ets deleted file mode 100644 index af64879aee82cd2758e3bab79a60b911c54b904e..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperSideSlip.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 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 { - ArcSwiper, - ArcSwiperAttribute, - ArcDotIndicator, - ArcDirection, - ArcSwiperController -} from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ArcSwiperSideSlip { - @State backgroundColors: Color[] = [Color.Green, Color.Blue, Color.Yellow, Color.Pink, Color.Gray, Color.Orange]; - innerSelectedIndex: number = 0; - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcSwiperSideSlip_title') }) { - ArcSwiper() { - ForEach(this.backgroundColors, (backgroundColor: Color, index: number) => { - Text(index.toString()) - .width(233) - .height(233) - .fontSize(50) - .textAlign(TextAlign.Center) - .backgroundColor(backgroundColor) - }) - } - .onAnimationStart((index: number, targetIndex: number) => { - this.innerSelectedIndex = targetIndex; - }) - .onGestureRecognizerJudgeBegin((event: BaseGestureEvent, current: GestureRecognizer, - others: Array): GestureJudgeResult => { // 在识别器即将要成功时,根据当前组件状态,设置识别器使能状态 - if (current) { - let target = current.getEventTargetInfo(); - if (target && current.isBuiltIn() && current.getType() == GestureControl.GestureType.PAN_GESTURE) { - let swiperTarget = target as ScrollableTargetInfo; - if (swiperTarget instanceof ScrollableTargetInfo && - (swiperTarget.isBegin() || this.innerSelectedIndex === 0)) { // 此处判断swiperTarget.isBegin()或innerSelectedIndex === 0,表明ArcSwiper滑动到开头 - let panEvent = event as PanGestureEvent; - if (panEvent && panEvent.offsetX > 0 && (swiperTarget.isBegin() || this.innerSelectedIndex === 0)) { - return GestureJudgeResult.REJECT; - } - } - } - } - return GestureJudgeResult.CONTINUE; - }) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcSwiperSideSlip_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperStyles.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperStyles.ets deleted file mode 100644 index 11bf5dd57c629e5e812e2d555e3e8d07c1f51a1a..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperStyles.ets +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2025 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 { - ArcSwiper, - ArcSwiperAttribute, - ArcDotIndicator, - ArcDirection, - ArcSwiperController -} from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ArcSwiperStyles { - @State message: string = 'Hello World'; - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcSwiperStyles_titleDefault') }) { - ArcSwiper() { - Text('0') - .width(233) - .height(233) - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width(233) - .height(233) - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width(233) - .height(233) - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - } - } - - ComponentCard({ title: $r('app.string.ArcSwiperStyles_titleCustomize') }) { - ArcSwiper() { - Text('0') - .width(233) - .height(233) - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width(233) - .height(233) - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width(233) - .height(233) - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - } - .indicator( - new ArcDotIndicator() - .arcDirection(ArcDirection.SIX_CLOCK_DIRECTION) // 设置导航点位于6点钟方向 - .itemColor(Color.Red) // 设置导航点颜色为红色 - .selectedItemColor(Color.Blue) // 设置选中导航点颜色为蓝色 - ) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcSwiperStyles_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperToggle.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperToggle.ets deleted file mode 100644 index 143dab03e084c9835a635891065543a62626a1f9..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperToggle.ets +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2025 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 { - ArcButton, - ArcButtonOptions, - ArcButtonStatus, - ArcButtonStyleMode, - ArcButtonPosition, - ArcSwiper, - ArcSwiperAttribute, - ArcDotIndicator, - ArcDirection, - ArcSwiperController -} from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ArcSwiperToggle { - private wearableSwiperController: ArcSwiperController = new ArcSwiperController(); - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcSwiperToggle_title') }) { - Stack() { - ArcSwiper(this.wearableSwiperController) { - Text('0') - .width(233) - .height(233) - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width(233) - .height(233) - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width(233) - .height(233) - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - } - .vertical(true) - .indicator(false) - - Column() { - ArcButton({ - options: new ArcButtonOptions({ - label: 'previous', - position: ArcButtonPosition.TOP_EDGE, - styleMode: ArcButtonStyleMode.EMPHASIZED_LIGHT, - onClick: () => { - this.wearableSwiperController.showPrevious(); // 通过controller切换到前一页 - } - }) - }) - - Blank() - - ArcButton({ - options: new ArcButtonOptions({ - label: 'next', - position: ArcButtonPosition.BOTTOM_EDGE, - styleMode: ArcButtonStyleMode.EMPHASIZED_LIGHT, - onClick: () => { - this.wearableSwiperController.showNext(); // 通过controller切换到后一页 - } - }) - }) - }.width('100%').height('100%') - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcSwiperToggle_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperVertical.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperVertical.ets deleted file mode 100644 index 4e27070ed8f885ad6ff9a12113450e85ffa0c8cd..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperVertical.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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 { - ArcSwiper, - ArcSwiperAttribute, - ArcDotIndicator, - ArcDirection, - ArcSwiperController -} from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ArcSwiperVertical { - @State message: string = 'Hello World'; - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ArcSwiperVertical_title') }) { - ArcSwiper() { - Text('0') - .width(233) - .height(233) - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width(233) - .height(233) - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width(233) - .height(233) - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - } - .indicator(new ArcDotIndicator() - .arcDirection(ArcDirection.THREE_CLOCK_DIRECTION)) - .vertical(true) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ArcSwiperVertical_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/index.ets deleted file mode 100644 index 98f58400da894b77fff2a7d89bdfb7767f2b6d0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/index.ets +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2025 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 { CompletedRoutableCard } from '../../common/Card'; -import { Route } from '../../common/Route'; -import { ArcSwiperAction } from './ArcSwiperAction'; -import { ArcSwiperHorizontal } from './ArcSwiperHorizontal'; -import { ArcSwiperSideSlip } from './ArcSwiperSideSlip'; -import { ArcSwiperStyles } from './ArcSwiperStyles'; -import { ArcSwiperToggle } from './ArcSwiperToggle'; -import { ArcSwiperVertical } from './ArcSwiperVertical'; -import resource from '../../common/resource'; - -export const ARCSWIPER_ROUTE_PREFIX: string = 'arcSwiper'; - -const routes: Route[] = [ - { - name: `${ARCSWIPER_ROUTE_PREFIX}/ArcSwiperStyles`, - title: resource.resourceToString($r('app.string.ArcSwiperStyles_title')), - description: $r('app.string.ArcSwiperStyles_description') - }, - { - name: `${ARCSWIPER_ROUTE_PREFIX}/ArcSwiperToggle`, - title: resource.resourceToString($r('app.string.ArcSwiperToggle_title')), - description: $r('app.string.ArcSwiperToggle_description') - }, - { - name: `${ARCSWIPER_ROUTE_PREFIX}/ArcSwiperHorizontal`, - title: resource.resourceToString($r('app.string.ArcSwiperHorizontal_title')), - description: $r('app.string.ArcSwiperHorizontal_description') - }, - { - name: `${ARCSWIPER_ROUTE_PREFIX}/ArcSwiperVertical`, - title: resource.resourceToString($r('app.string.ArcSwiperVertical_title')), - description: $r('app.string.ArcSwiperVertical_description') - }, - { - name: `${ARCSWIPER_ROUTE_PREFIX}/ArcSwiperAction`, - title: resource.resourceToString($r('app.string.ArcSwiperAction_title')), - description: $r('app.string.ArcSwiperAction_description') - }, - { - name: `${ARCSWIPER_ROUTE_PREFIX}/ArcSwiperSideSlip`, - title: resource.resourceToString($r('app.string.ArcSwiperSideSlip_title')), - description: $r('app.string.ArcSwiperSideSlip_description') - } -]; - -@Builder -export function arcSwiperDestination(name: string) { - if (name === ARCSWIPER_ROUTE_PREFIX) { - ArcSwiperExample(); - } else if (name === routes[0].name) { - ArcSwiperStyles(); - } else if (name === routes[1].name) { - ArcSwiperToggle(); - } else if (name === routes[2].name) { - ArcSwiperHorizontal(); - } else if (name === routes[3].name) { - ArcSwiperVertical(); - } else if (name === routes[4].name) { - ArcSwiperAction(); - } else if (name === routes[5].name) { - ArcSwiperSideSlip(); - } -} - -@Entry -@Component -struct ArcSwiperExample { - @Consume pathStack: NavPathStack; - - build() { - NavDestination() { - List({ space: 12 }) { - ForEach(routes, (route: Route) => { - ListItem() { - CompletedRoutableCard({ title: route.title, description: route.description }) - } - .width('100%') - .onClick(() => { - this.pathStack.pushPath({ name: route.name }); - }) - }) - } - .contentStartOffset(56) - .padding({ left: 16, right: 16 }) - } - .backgroundColor('#f1f3f5') - .title('ArcSwiper', { - backgroundBlurStyle: BlurStyle.COMPONENT_THICK, - barStyle: BarStyle.STACK - }) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/DataInGrid.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/DataInGrid.ets deleted file mode 100644 index 998e35a9c3588b59688047ef09b801272c69d287..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/DataInGrid.ets +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -// [Start build_a_office_services_grid_of_foreach] -@Entry -@Component -export struct DataInGrid { - @State services: Array = ['Meeting', 'Voting', 'Check-in', 'Printing']; - - build() { - // [StartExclude build_a_office_services_grid_of_foreach] - NavDestination() { - // [EndExclude build_a_office_services_grid_of_foreach] - Column({ space: 12 }) { - // [StartExclude build_a_office_services_grid_of_foreach] - ComponentCard({ title: $r('app.string.DataInGrid_titleOfficeServices') }) { - // [EndExclude build_a_office_services_grid_of_foreach] - // [Start build_a_office_services_grid] - Grid() { - GridItem() { - Text('Meeting') - .fontSize(24) - }.backgroundColor('#FFF1F3F5') - - GridItem() { - Text('Check-in') - .fontSize(24) - }.backgroundColor('#FFF1F3F5') - - GridItem() { - Text('Voting') - .fontSize(24) - }.backgroundColor('#FFF1F3F5') - - GridItem() { - Text('Printing') - .fontSize(24) - }.backgroundColor('#FFF1F3F5') - } - // [StartExclude build_a_office_services_grid] - .height(200) - // [EndExclude build_a_office_services_grid] - .columnsGap(6) - .rowsGap(6) - .rowsTemplate('1fr 1fr') - .columnsTemplate('1fr 1fr') - // [End build_a_office_services_grid] - } - - // [StartExclude build_a_office_services_grid_of_foreach] - ComponentCard({ title: $r('app.string.DataInGrid_titleForEach') }) { - // [EndExclude build_a_office_services_grid_of_foreach] - Grid() { - ForEach(this.services, (service: string) => { - GridItem() { - Text(service) - }.backgroundColor('#FFF1F3F5') - }, (service: string): string => service) - } - // [StartExclude build_a_office_services_grid_of_foreach] - .height(200) - .columnsGap(6) - .rowsGap(6) - // [EndExclude build_a_office_services_grid_of_foreach] - .rowsTemplate(('1fr 1fr') as string) - .columnsTemplate(('1fr 1fr') as string) - } - } - // [End build_a_office_services_grid_of_foreach] - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.DataInGrid_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridCalculator.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridCalculator.ets deleted file mode 100644 index bb1fe49ef5bb281a53c80353f9aaf1dd3324ff19..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridCalculator.ets +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct GridCalculator { - private buttonArray: string[] = - ['CE', 'C', '/', 'X', '7', '8', '9', '-', '4', '5', '6', '+', '1', '2', '3', '=', '0', '.']; - @State res: string = '0'; - layoutOptions: GridLayoutOptions = { - regularSize: [1, 1], - onGetRectByIndex: (index: number) => { - if (index == 0) { - return [2, 0, 1, 1]; - } else if (index == 1) { - return [2, 1, 1, 1]; - } else if (index == 2) { - return [2, 2, 1, 1]; - } else if (index == 3) { - return [2, 3, 1, 1]; - } else if (index == 4) { - return [3, 0, 1, 1]; - } else if (index == 5) { - return [3, 1, 1, 1]; - } else if (index == 6) { - return [3, 2, 1, 1]; - } else if (index == 7) { - return [3, 3, 1, 1]; - } else if (index == 8) { - return [4, 0, 1, 1]; - } else if (index == 9) { - return [4, 1, 1, 1]; - } else if (index == 10) { - return [4, 2, 1, 1]; - } else if (index == 11) { - return [4, 3, 1, 1]; - } else if (index == 12) { - return [5, 0, 1, 1]; - } else if (index == 13) { - return [5, 1, 1, 1]; - } else if (index == 14) { - return [5, 2, 1, 1]; - } else if (index == 15) { - return [5, 3, 2, 1]; - } else if (index == 16) { - return [6, 0, 1, 2]; - } else if (index == 17) { - return [6, 2, 1, 1]; - } - return [0, 0, 2, 4]; - } - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.GridCalculator_title') }) { - Grid(undefined, this.layoutOptions) { - ForEach(this.buttonArray, (item: string) => { - GridItem() { - Button(item) - .width('100%') - .height('100%') - .borderRadius(10) - .backgroundColor(0x55555555) - .fontWeight(FontWeight.Bold) - .onClick(() => { - // 按钮功能实现 - // ... - }) - } - }) - GridItem() { - Text(this.res).width('100%').height('100%').textAlign(TextAlign.End).fontSize(30) - }.backgroundColor(0x55555555).borderRadius(10) - } - .columnsTemplate('1fr 1fr 1fr 1fr') - .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr') - .rowsGap(8) - .columnsGap(5) - .width('100%') - .height('80%') - } - } - } - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridDataSource.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridDataSource.ets deleted file mode 100644 index f0d9e9bb8052f2cd52e3d4623f0aa6b9166707ae..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridDataSource.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export class GridDataSource implements IDataSource { - private list: string[] = []; - private listeners: DataChangeListener[] = []; - - constructor(list: string[]) { - this.list = list; - } - - totalCount(): number { - return this.list.length; - } - - getData(index: number): string { - return this.list[index]; - } - - registerDataChangeListener(listener: DataChangeListener): void { - if (this.listeners.indexOf(listener) < 0) { - this.listeners.push(listener); - } - } - - unregisterDataChangeListener(listener: DataChangeListener): void { - const pos = this.listeners.indexOf(listener); - if (pos >= 0) { - this.listeners.splice(pos, 1); - } - } - - // 通知控制器数据位置变化 - notifyDataMove(from: number, to: number): void { - this.listeners.forEach(listener => { - listener.onDataMove(from, to); - }) - } - - // 交换元素位置 - public swapItem(from: number, to: number): void { - let temp: string = this.list[from]; - this.list[from] = this.list[to]; - this.list[to] = temp; - this.notifyDataMove(from, to); - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridLayout.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridLayout.ets deleted file mode 100644 index 464b10d7282f3dc3b451609145686325b01240cf..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridLayout.ets +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct GridLayout { - @State numbers: String[] = ['0', '1', '2', '3', '4', '5', '6', '7']; - scroller: Scroller = new Scroller(); - // [Start set_rows_and_columns_occupied] - layoutOptions: GridLayoutOptions = { - regularSize: [1, 1], - irregularIndexes: [1, 3, 4], // 索引为0和7的GridItem占用的列数由onGetIrregularSizeByIndex指定 - onGetIrregularSizeByIndex: (index: number) => { - if (index === 0) { - return [1, 5]; - } - return [1, index % 6 + 1]; - } - } - - // [StartExclude set_rows_and_columns_occupied] - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.GridLayout_titleRowSpacing') }) { - // [EndExclude set_rows_and_columns_occupied] - // [Start build_a_grid] - Grid() { - // [StartExclude build_a_grid] - GridItem() { - }.backgroundColor('#ffe0e2e4') - - GridItem() { - }.backgroundColor('#ffe0e2e4') - - GridItem() { - }.backgroundColor('#ffe0e2e4') - - GridItem() { - }.backgroundColor('#ffe0e2e4') - - GridItem() { - }.backgroundColor('#ffe0e2e4') - - GridItem() { - }.backgroundColor('#ffe0e2e4') - - GridItem() { - }.backgroundColor('#ffe0e2e4') - - GridItem() { - }.backgroundColor('#ffe0e2e4') - - GridItem() { - }.backgroundColor('#ffe0e2e4') - // [EndExclude build_a_grid] - } - //设置行列间距 - // [StartExclude build_a_grid] - .columnsGap(10) - .rowsGap(15) - .height(150) - // [EndExclude build_a_grid] - //设置行列数量与占比 - .rowsTemplate('1fr 1fr 1fr') - .columnsTemplate('1fr 2fr 1fr') - // [End build_a_grid] - // [End set_rows_and_columns_occupied] - } - - ComponentCard({ title: $r('app.string.GridLayout_titleChildSpan') }) { - Grid(undefined, this.layoutOptions) { - ForEach(this.numbers, (day: string) => { - GridItem() { - Text(day) - .fontSize(16) - .backgroundColor('#ffe0e2e4') - .width('100%') - .height(60) - .textAlign(TextAlign.Center) - } - }, (day: string) => day) - } - .columnsTemplate('1fr 1fr 1fr') - .columnsGap(10) - .rowsGap(10) - .scrollBar(BarState.Off) - .width('80%') - .height(210) - } - - ComponentCard({ title: $r('app.string.GridLayout_titleMainAxis') }) { - // [Start Set_the_direction_of_the_main_axis_of_the_grid] - Grid() { - // [StartExclude Set_the_direction_of_the_main_axis_of_the_grid] - GridItem() { - Text('1') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('2') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('3') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('4') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('5') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('6') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('7') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('8') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('9') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - // [EndExclude Set_the_direction_of_the_main_axis_of_the_grid] - } - .maxCount(3) - // [StartExclude Set_the_direction_of_the_main_axis_of_the_grid] - .columnsGap(4) - .rowsGap(4) - // [EndExclude Set_the_direction_of_the_main_axis_of_the_grid] - .layoutDirection(GridDirection.Row) - // [End Set_the_direction_of_the_main_axis_of_the_grid] - - Grid() { - GridItem() { - Text('1') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('2') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('3') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('4') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('5') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('6') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('7') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('8') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - - GridItem() { - Text('9') - }.backgroundColor('#ffe0e2e4').width(30).height(30) - } - .maxCount(3) - .columnsGap(4) - .rowsGap(4) - .layoutDirection(GridDirection.Column) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.GridLayout_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridScrollbar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridScrollbar.ets deleted file mode 100644 index 74443ede7231b3c0ef3b7f976a730a51cb05e45c..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridScrollbar.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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 { GridDataSource } from './GridDataSource'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct GridScrollbar { - numbers: GridDataSource = new GridDataSource([]); - scroller: Scroller = new Scroller(); - @State gridPosition: number = 0; //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 - - aboutToAppear() { - let list: string[] = []; - for (let i = 0; i < 5; i++) { - for (let j = 0; j < 5; j++) { - list.push(j.toString()); - } - } - this.numbers = new GridDataSource(list); - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.GridScrollbar_title') }) { - Row({ space: 5 }) { - Grid(this.scroller) { - LazyForEach(this.numbers, (day: string) => { - GridItem() { - Text() - .fontSize(16) - .backgroundColor(0xF9CF93) - .width('100%') - .height(80) - .textAlign(TextAlign.Center) - } - }, (index: number) => index.toString()) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr') - .columnsGap(10) - .rowsGap(10) - .friction(0.6) - .enableScrollInteraction(true) - .supportAnimation(false) - .multiSelectable(false) - .edgeEffect(EdgeEffect.Spring) - .scrollBar(BarState.Off) - .scrollBarColor(Color.Grey) - .scrollBarWidth(4) - .width('90%') - .backgroundColor(0xFAEEE0) - .height(300) - .margin({left:10}) - ScrollBar({ scroller: this.scroller }).height(300) - - }.width('100%').margin({ top: 5 }) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.GridScrollbar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridSideToSide.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridSideToSide.ets deleted file mode 100644 index fd30401da34682d2b17f44b8411c2cb5d81de55a..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridSideToSide.ets +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2025 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 { GridDataSource } from './GridDataSource'; -import { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct GridSideToSide { - numbers: GridDataSource = new GridDataSource([]); - scroller: Scroller = new Scroller(); - @State gridPosition: number = 0; //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 - @State data: number = 1; - - aboutToAppear() { - let list: string[] = []; - for (let i = 0; i < 7; i++) { - for (let j = 0; j < 10; j++) { - list.push(this.data.toString()); - this.data += 1; - if(this.data == 32) { - this.data = 0; - } - } - } - this.numbers = new GridDataSource(list); - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.GridSideToSide_title') }) { - Column(){ - Grid(this.scroller) { - LazyForEach(this.numbers, (day: string) => { - GridItem() { - Text(day) - .fontSize(16) - .backgroundColor(0xF9CF93) - .width('100%') - .height(50) - .textAlign(TextAlign.Center) - } - }, (index: number) => index.toString()) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr') - .columnsGap(10) - .rowsGap(10) - .width('90%') - .height(300) - .scrollBar(BarState.Off) - - Row({ space: 20 }) { - Button('上一页') - .onClick(() => { - this.scroller.scrollPage({ - next: false - }); - }) - - Button('下一页') - .onClick(() => { - this.scroller.scrollPage({ - next: true - }); - }) - } - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.GridSideToSide_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/LongGrid.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/LongGrid.ets deleted file mode 100644 index 073655c3e3024bba52fa4496f8f9ece2e03c2774..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/LongGrid.ets +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; -import { GridDataSource } from './GridDataSource'; - -@Entry -@Component -export struct LongGrid { - numbers: GridDataSource = new GridDataSource([]); - scroller: Scroller = new Scroller(); - - aboutToAppear() { - let list: string[] = []; - for (let i = 0; i <= 10; i++) { - for (let j = 0; j < 5; j++) { - list.push(j.toString()); - } - } - this.numbers = new GridDataSource(list); - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.LongGrid_title') }) { - Column({ space: 5 }) { - Grid(this.scroller) { - LazyForEach(this.numbers, (day: string) => { - GridItem() { - Text(day) - .fontSize(16) - .backgroundColor(0xF9CF93) - .width('100%') - .height(80) - .textAlign(TextAlign.Center) - } - }, (index: number) => index.toString()) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr') - .columnsGap(10) - .rowsGap(20) - .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true, effectEdge: EffectEdge.START }) - .width('90%') - .backgroundColor(0xDCDCDC) - .height('80%') - - }.width('100%').margin({ top: 5 }) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.LongGrid_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollPositionGrid.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollPositionGrid.ets deleted file mode 100644 index da773f1c37ed27e85c02d98ec3db72585f7fa335..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollPositionGrid.ets +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ScrollPosition { - @State services: Array = ['Live Streaming', 'Imported', 'Categories', 'Recharge', - 'Membership', 'Claim Coupon', 'Lottery', 'Favorites', 'Points', 'More']; - // [Start build_a_private_scrolling_object] - private scroller: Scroller = new Scroller(); - // [End build_a_private_scrolling_object] - - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ScrollPosition_titleExample') }) { - // [Start control_the_grid_scroll] - Column({ space: 12 }) { - Grid(this.scroller) { - // [StartExclude control_the_grid_scroll] - ForEach(this.services, (service: string) => { - GridItem() { - Text(service) - }.backgroundColor('#FFF1F3F5').width('25%') - }, (service: string): string => service) - // [EndExclude control_the_grid_scroll] - } - // [StartExclude control_the_grid_scroll] - .height(100) - .columnsGap(10) - // [EndExclude control_the_grid_scroll] - .rowsTemplate('1fr') - - Row({ space: 20 }) { - Button('Previous') - .onClick(() => { - this.scroller.scrollPage({ next: false }); - }) - - Button('Next') - .onClick(() => { - this.scroller.scrollPage({ next: true }); - }) - } - } - // [End control_the_grid_scroll] - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ScrollPosition_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollableGrid.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollableGrid.ets deleted file mode 100644 index 288ed72065440598d7edf5a99e8c68c7e4bfde69..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollableGrid.ets +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -// [Start build_scrollable_horizontally_grid_layouts] -@Entry -@Component -export struct ScrollableGrid { - @State services: Array = ['Live Streaming', 'Imported', 'Categories', 'Recharge', - 'Membership', 'Claim Coupon', 'Lottery', 'Favorites', 'Points', 'More']; - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ScrollableGrid_titleHorizontal') }) { - Grid() { - ForEach(this.services, (service: string) => { - GridItem() { - Text(service) - }.backgroundColor('#FFF1F3F5').width('25%') - }, (service: string): string => service) - } - // [StartExclude build_scrollable_horizontally_grid_layouts] - .height(200) - .columnsGap(10) - // [EndExclude build_scrollable_horizontally_grid_layouts] - .rowsGap(15) - .rowsTemplate('1fr 1fr') // 只设置rowsTemplate属性,当内容超出Grid区域时,可水平滚动。 - } - } - // [End build_scrollable_horizontally_grid_layouts] - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ScrollableGrid_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/index.ets deleted file mode 100644 index cc39def6cb82479ef34d99f0ffd76a7c741732d6..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/index.ets +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2025 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 { CompletedRoutableCard } from '../../common/Card'; -import { DataInGrid } from './DataInGrid'; -import { GridLayout } from './GridLayout'; -import { Route } from '../../common/Route'; -import { ScrollableGrid } from './ScrollableGrid'; -import { ScrollPosition } from './ScrollPositionGrid'; -import { GridSideToSide } from './GridSideToSide'; -import { GridScrollbar } from './GridScrollbar'; -import { LongGrid } from './LongGrid'; -import { GridCalculator } from './GridCalculator'; -import resource from '../../common/resource'; - -export const GRID_ROUTE_PREFIX: string = 'grid'; - -const routes: Route[] = [ - { - name: `${GRID_ROUTE_PREFIX}/GridLayout`, - title: resource.resourceToString($r('app.string.GridLayout_title')), - description: $r('app.string.GridLayout_description') - }, - { - name: `${GRID_ROUTE_PREFIX}/DataInGrid`, - title: resource.resourceToString($r('app.string.DataInGrid_title')), - description: $r('app.string.DataInGrid_description') - }, - { - name: `${GRID_ROUTE_PREFIX}/ScrollableGrid`, - title: resource.resourceToString($r('app.string.ScrollableGrid_title')), - description: $r('app.string.ScrollableGrid_description') - }, - { - name: `${GRID_ROUTE_PREFIX}/ScrollPosition`, - title: resource.resourceToString($r('app.string.ScrollPosition_title')), - description: $r('app.string.ScrollPosition_description') - }, - { - name: `${GRID_ROUTE_PREFIX}/GridSideToSide`, - title: resource.resourceToString($r('app.string.GridSideToSide_title')), - description: $r('app.string.GridSideToSide_description') - }, - { - name: `${GRID_ROUTE_PREFIX}/GridScrollbar`, - title: resource.resourceToString($r('app.string.GridScrollbar_title')), - description: $r('app.string.GridScrollbar_description') - }, - { - name: `${GRID_ROUTE_PREFIX}/LongGrid`, - title: resource.resourceToString($r('app.string.LongGrid_title')), - description: $r('app.string.LongGrid_description') - }, - { - name: `${GRID_ROUTE_PREFIX}/GridCalculator`, - title: resource.resourceToString($r('app.string.GridCalculator_title')), - description: $r('app.string.GridCalculator_description') - } -]; - -@Builder -export function gridDestination(name: string) { - if (name === GRID_ROUTE_PREFIX) { - GridExample(); - } else if (name === routes[0].name) { - GridLayout(); - } else if (name === routes[1].name) { - DataInGrid(); - } else if (name === routes[2].name) { - ScrollableGrid(); - } else if (name === routes[3].name) { - ScrollPosition(); - } else if (name === routes[4].name) { - GridSideToSide(); - } else if (name === routes[5].name) { - GridScrollbar(); - } else if (name === routes[6].name) { - LongGrid(); - } else if (name === routes[7].name) { - GridCalculator(); - } -} - -@Entry -@Component -struct GridExample { - @Consume pathStack: NavPathStack; - - build() { - NavDestination() { - List({ space: 12 }) { - ForEach(routes, (route: Route) => { - ListItem() { - CompletedRoutableCard({ title: route.title, description: route.description }) - } - .width('100%') - .onClick(() => { - this.pathStack.pushPath({ name: route.name }); - }) - }) - } - .contentStartOffset(56) - .padding({ left: 16, right: 16 }) - } - .backgroundColor('#f1f3f5') - .title('Grid', { - backgroundBlurStyle: BlurStyle.COMPONENT_THICK, - barStyle: BarStyle.STACK - }) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/AddListItem.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/AddListItem.ets deleted file mode 100644 index befa4ca236b5c617a222d87786323ebb9fbb7cd9..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/AddListItem.ets +++ /dev/null @@ -1,154 +0,0 @@ - /* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; -// [Start define_the_data_to_be_done] -import { util } from '@kit.ArkTS'; - - -export class ToDo { - public key: string = util.generateRandomUUID(true); - public name: string; - - constructor(name: string) { - this.name = name; - } -} -// [End define_the_data_to_be_done] - -// [Start build_the_overall_list_layout_and_list_items] -@Component -export struct ToDoListItem { - @Link isEditMode: boolean; - @Link selectedItems: ToDo[]; - private toDoItem: ToDo = new ToDo(''); - - build() { - Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - // [StartExclude build_the_overall_list_layout_and_list_items] - Text(this.toDoItem.name) - .fontSize(16) - .width('80%') - .margin({ left: 20 }) - // [EndExclude build_the_overall_list_layout_and_list_items] - } - .backgroundColor('#FFF1F3F5') - .width('100%') - .height(40) - // .padding() 根据具体使用场景设置 - .borderRadius(12) - // .linearGradient() 根据具体使用场景设置 - .gesture( - // [StartExclude build_the_overall_list_layout_and_list_items] - GestureGroup(GestureMode.Exclusive, - LongPressGesture() - // [EndExclude build_the_overall_list_layout_and_list_items] - .onAction(() => { - }) - ) - ) - } -} -// [End build_the_overall_list_layout_and_list_items] - -// [Start build_list_layouts_and_list_items] -@Entry -@Component -export struct AddListItem { - private l1 = 0; - private l2 = 0; - // [StartExclude build_list_layouts_and_list_items] - @State arr: number[] = [0, 1, 2, 3] - @State toDoData: ToDo[] = [] - // [EndExclude build_list_layouts_and_list_items] - @Watch('onEditModeChange') @State isEditMode: boolean = false - @State selectedItems: ToDo[] = [] - private availableThings: string[] = ['Reading', 'Exercise', 'Travel', 'Listening Music', 'Watching Films', 'Singing']; - - onEditModeChange() { - if (!this.isEditMode) { - this.selectedItems = []; - } - } - - build() { - // [StartExclude build_list_layouts_and_list_items] - NavDestination() { - // [EndExclude build_list_layouts_and_list_items] - Column({ space: 12 }) { - // [StartExclude build_list_layouts_and_list_items] - ComponentCard({ title: $r('app.string.AddListItem_titleExample') }) { - // [EndExclude build_list_layouts_and_list_items] - Column({ space: 12 }) { - Row() { - if (this.isEditMode) { - Text('X') - .fontSize(20) - .onClick(() => { - this.isEditMode = false; - }) - .margin({ left: 20, right: 20 }) - } else { - Text($r('app.string.TodoItem')) - .fontSize(30) - .margin({ left: 20 }) - Blank() - Text('+')// 提供新增列表项入口,即给新增按钮添加点击事件 - .fontSize(36) - .margin({ right: 20 }) - .onClick(() => { - this.getUIContext().showTextPickerDialog({ - range: this.availableThings, - onAccept: (value: TextPickerResult) => { - let arr = Array.isArray(value.index) ? value.index : [value.index]; - for (let i = 0; i < arr.length; i++) { - this.toDoData.push(new ToDo(this.availableThings[arr[i]])); // 新增列表项数据toDoData(可选事项) - } - }, - }) - }) - } - } - // [StartExclude build_list_layouts_and_list_items] - .width('100%') - .backgroundColor('#FFF1F3F5') - .borderRadius(12) - .height(45) - // [EndExclude build_list_layouts_and_list_items] - - List({ space: 12 }) { - ForEach(this.toDoData, (toDoItem: ToDo) => { - ListItem() { - // 将toDoData的每个数据放入到以model的形式放进ListItem里 - ToDoListItem({ - isEditMode: this.isEditMode, - toDoItem: toDoItem, - selectedItems: this.selectedItems - }) - } - }, (toDoItem: ToDo) => toDoItem.name.toString()) - } - } - } - } - // [End build_list_layouts_and_list_items] - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.AddListItem_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CollapseAndExpand.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CollapseAndExpand.ets deleted file mode 100644 index 52fd69387c7086e8b86b6aff6b4e075f119a6f3b..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CollapseAndExpand.ets +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2025 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 { curves } from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - -interface ItemInfo { - index: number, - name: string, - label: ResourceStr, - type?: string, -} - -interface ItemGroupInfo extends ItemInfo { - children: ItemInfo[] -} - - -@Entry -@Component -export struct CollapseAndExpand { - @State routes: ItemGroupInfo[] = [ - { - index: 0, - name: 'basicInfo', - label: '个人基本资料', - children: [ - { - index: 0, - name: '昵称', - label: 'xxxx', - type: 'Text' - }, - { - index: 1, - name: '头像', - label: $r('sys.media.ohos_user_auth_icon_face'), - type: 'Image' - }, - { - index: 2, - name: '年龄', - label: 'xxxx', - type: 'Text' - }, - { - index: 3, - name: '生日', - label: 'xxxxxxxxx', - type: 'Text' - }, - { - index: 4, - name: '性别', - label: 'xxxxxxxx', - type: 'Text' - }, - ] - }, - { - index: 1, - name: 'equipInfo', - label: '设备信息', - children: [] - }, - { - index: 2, - name: 'appInfo', - label: '应用使用信息', - children: [] - }, - { - index: 3, - name: 'uploadInfo', - label: '您主动上传的数据', - children: [] - }, - { - index: 4, - name: 'tradeInfo', - label: '交易与资产信息', - children: [] - }, - { - index: 5, - name: 'otherInfo', - label: '其他资料', - children: [] - }, - ]; - - @State expandedItems: boolean[] = Array(this.routes.length).fill(false); - @State selection: string | null = null; - - @Builder - ListItemGroupHeader(itemGroup: ItemGroupInfo) { - Row() { - Text(itemGroup.label) - Blank() - Image($r('sys.media.ohos_ic_public_arrow_down')) - .fillColor($r('sys.color.ohos_id_color_fourth')) - .height(30) - .width(30) - .rotate({ angle: !!itemGroup.children.length ? (this.expandedItems[itemGroup.index] ? 180 : 0) : 180 }) - .animation({ curve: curves.interpolatingSpring(0, 1, 228, 22) }) - } - .width("100%") - .padding(10) - .animation({ curve: curves.interpolatingSpring(0, 1, 528, 39) }) - .onClick(() => { - if (itemGroup.children.length) { - this.getUIContext()?.animateTo({ curve: curves.interpolatingSpring(0, 1, 528, 39) }, () => { - this.expandedItems[itemGroup.index] = !this.expandedItems[itemGroup.index]; - }) - } - }) - } - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.CollapseAndExpand_title') }) { - Column() { - List({ space: 10 }) { - ForEach(this.routes, (itemGroup: ItemGroupInfo) => { - ListItemGroup({ - header: this.ListItemGroupHeader(itemGroup), - style: ListItemGroupStyle.CARD, - }) { - if (this.expandedItems[itemGroup.index] && itemGroup.children) { - ForEach(itemGroup.children, (item: ItemInfo) => { - ListItem({ style: ListItemStyle.CARD }) { - Row() { - Text(item.name) - Blank() - if (item.type === 'Image') { - Image(item.label) - .height(20) - .width(20) - } else { - Text(item.label) - } - Image($r('sys.media.ohos_ic_public_arrow_right')) - .fillColor($r('sys.color.ohos_id_color_fourth')) - .height(30) - .width(30) - } - .width("100%") - } - .width("100%") - .animation({ curve: curves.interpolatingSpring(0, 1, 528, 39) }) - }) - } - }.clip(true) - }) - } - .width("100%") - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Start) - .backgroundColor($r('sys.color.ohos_id_color_sub_background')) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.CollapseAndExpand_title')) - } - -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ControlledScrollPositionList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ControlledScrollPositionList.ets deleted file mode 100644 index fe9700cfd7503197f185a9d8299472e3644df987..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ControlledScrollPositionList.ets +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ControlledScrollPositionList { - // [Start create_private_list_scroller] - private listScroller: Scroller = new Scroller(); - // [End create_private_list_scroller] - private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ControlledScrollPositionList_titleExample') }) { - // [Start control_scrolling] - Stack({ alignContent: Alignment.Bottom }) { - // 控制滚动位置示例List容器 - // 将listScroller用于初始化List组件的scroller参数,完成listScroller与列表的绑定。 - List({ space: 20, scroller: this.listScroller }) { - // ... - // [StartExclude control_scrolling] - ForEach(this.arr, (item: number) => { - ListItem() { - Text('新闻' + item) - .width('100%') - .height(100) - .fontSize(16) - .textAlign(TextAlign.Center) - .borderRadius(10) - .backgroundColor('#FFF1F3F5') - } - }, (item: number) => item.toString()) - // [EndExclude control_scrolling] - } - - Button() { - // [StartExclude control_scrolling] - // ... - Image($r('sys.media.ohos_ic_public_arrow_up')).width(40).height(40) - // [EndExclude control_scrolling] - } - // [StartExclude control_scrolling] - .backgroundColor('#FFE0E2E4') - .position({ x: '80%', y: '90%' }) - // [EndExclude control_scrolling] - .onClick(() => { - // 点击按钮时,指定跳转位置,返回列表顶部 - this.listScroller.scrollToIndex(0); - // [End control_scrolling] - }) - }.height('90%') - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ControlledScrollPositionList_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CustomListStyle.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CustomListStyle.ets deleted file mode 100644 index b61ca2a29c1f41a54f6638615764c5f3f50ec91b..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CustomListStyle.ets +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -// [Start set_the_divider] -class DividerTmp { - public strokeWidth: Length = 1; - public startMargin: Length = 60; - public endMargin: Length = 10; - public color: ResourceColor = '#ffe9f0f0'; - - constructor(strokeWidth: Length, startMargin: Length, endMargin: Length, color: ResourceColor) { - this.strokeWidth = strokeWidth; - this.startMargin = startMargin; - this.endMargin = endMargin; - this.color = color; - } -} - -@Entry -@Component -export struct CustomListStyle { - @State egDivider: DividerTmp = new DividerTmp(1, 60, 10, '#ffe9f0f0'); - - build() { - // [StartExclude set_the_divider] - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.CustomListStyle_titleContentSpacing') }) { - List({ space: 10 }) { - ListItem() { - Text('ListItem One') - } - - ListItem() { - Text('ListItem Two') - } - } - .backgroundColor('#FFF1F3F5') - .alignListItem(ListItemAlign.Center) - } - - ComponentCard({ title: $r('app.string.CustomListStyle_titleDividerLines') }) { - // [EndExclude set_the_divider] - List({ space: 10 }) { - ListItem() { - Text('ListItem One') - } - - ListItem() { - Text('ListItem Two') - } - } - .divider(this.egDivider) - .alignListItem(ListItemAlign.Center) - } - // [End set_the_divider] - - ComponentCard({ title: $r('app.string.CustomListStyle_titleScrollbars') }) { - // [Start add_a_scrollbar] - List({ space: 10 }) { - // [StartExclude add_a_scrollbar] - ListItem() { - Text('ListItem One') - }.height(30) - - ListItem() { - Text('ListItem Two') - }.height(30) - - ListItem() { - Text('ListItem Three') - }.height(30) - // [EndExclude add_a_scrollbar] - } - // [StartExclude add_a_scrollbar] - .height(60) - // [EndExclude add_a_scrollbar] - .scrollBar(BarState.Auto) - // [End add_a_scrollbar] - .backgroundColor('#FFF1F3F5') - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.CustomListStyle_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DataInList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DataInList.ets deleted file mode 100644 index 1a4832087e576b0a12b577a4543e482469b5dde2..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DataInList.ets +++ /dev/null @@ -1,87 +0,0 @@ - -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -// [Start list_statically_creates_the_contents_of_list_item] -@Entry -@Component -export struct DataInList { - build() { - // [StartExclude list_statically_creates_the_contents_of_list_item] - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.DataInList_titleCityList') }) { - // [EndExclude list_statically_creates_the_contents_of_list_item] - List() { - ListItem() { - Text($r('app.string.city_beijing')) - .fontSize(24) - } - - ListItem() { - Text($r('app.string.city_hangzhou')) - .fontSize(24) - } - - ListItem() { - Text($r('app.string.city_shanghai')) - .fontSize(24) - } - } - .backgroundColor('#FFF1F3F5') - .alignListItem(ListItemAlign.Center) - } - // [End list_statically_creates_the_contents_of_list_item] - - ComponentCard({ title: $r('app.string.DataInList_titleContactsList') }) { - // [Start encapsulate_the_image_and_text_into_a_row] - List() { - ListItem() { - Row() { - Image($r('sys.media.ohos_ic_public_phone')) - .width(40) - .height(40) - .margin(10) - - Text($r('app.string.peopleOne')) - .fontSize(20) - } - } - - ListItem() { - Row() { - Image($r('sys.media.ohos_ic_public_phone')) - .width(40) - .height(40) - .margin(10) - - Text($r('app.string.peopleTwo')) - .fontSize(20) - } - } - } - } - } - // [End encapsulate_the_image_and_text_into_a_row] - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.DataInList_titlePage')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DeleteListItem.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DeleteListItem.ets deleted file mode 100644 index 6948f3a13eb5a1a4fe63646227f8f51bf42ac8fa..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DeleteListItem.ets +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2025 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 { util } from '@kit.ArkTS'; - -// [Start structural_references] -export class ToDo { - public key: string = util.generateRandomUUID(true); - public name: string; - - constructor(name: string) { - this.name = name; - } -} -// [End structural_references] - -@Component -export struct ToDoListItem { - @Link isEditMode: boolean; - @Link selectedItems: ToDo[]; - private toDoItem: ToDo = new ToDo(''); - - build() { - // [Start enter_edit_mode] - Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - // [StartExclude enter_edit_mode] - Text(this.toDoItem.name) - .fontSize(16) - .width('80%') - .margin({ left: 20 }) - if (this.isEditMode) { - Checkbox() - .onChange((value: boolean) => { - if (value) { - this.selectedItems.push(new ToDo(this.toDoItem.name)); - this.isEditMode = true; - } - }) - } - } - .backgroundColor('#FFF1F3F5') - .width('100%') - .height(40) - .borderRadius(12) - // [EndExclude enter_edit_mode] - .gesture( - GestureGroup(GestureMode.Exclusive, - LongPressGesture() - .onAction(() => { - this.isEditMode = true; - }) - ) - ) - } -} -// [End enter_edit_mode] - -@Entry -@Component -export struct DeleteListItem { - @State arr: number[] = [0, 1, 2, 3]; - @State toDoData: ToDo[] = []; - @Watch('onEditModeChange') @State isEditMode: boolean = false; - @State selectedItems: ToDo[] = []; - private availableThings: string[] = ['Reading', 'Exercise', 'Travel', 'Listening Music', 'Watching Films', 'Singing']; - - public deleteToDoData() { - this.toDoData = []; - } - - onEditModeChange() { - if (!this.isEditMode) { - this.selectedItems = []; - } - } - - build() { - NavDestination() { - Column({ space: 12 }) { - Column({ space: 8 }) { - Text($r('app.string.DeleteListItem_titleExample')) - .fontSize(14) - .fontColor('#666') - Column({ space: 10 }) { - Row() { - if (this.isEditMode) { - Text('X') - .fontSize(20) - .onClick(() => { - this.isEditMode = false; - }) - .margin({ left: 20, right: 20 }) - } else { - Text($r('app.string.TodoItem')) - .fontSize(30) - .margin({ left: 20 }) - Blank() - Text('+')// 提供新增列表项入口,即给新增按钮添加点击事件 - .fontSize(36) - .margin({ right: 20 }) - .onClick(() => { - this.getUIContext().showTextPickerDialog({ - range: this.availableThings, - onAccept: (value: TextPickerResult) => { - let arr = Array.isArray(value.index) ? value.index : [value.index]; - for (let i = 0; i < arr.length; i++) { - this.toDoData.push(new ToDo(this.availableThings[arr[i]])); // 新增列表项数据toDoData(可选事项) - } - }, - }) - }) - } - } - .width('100%') - .backgroundColor('#FFF1F3F5') - .borderRadius(12) - .height(45) - - List({ space: 12 }) { - ForEach(this.toDoData, (toDoItem: ToDo) => { - ListItem() { - // 将toDoData的每个数据放入到以model的形式放进ListItem里 - ToDoListItem({ - isEditMode: this.isEditMode, - toDoItem: toDoItem, - selectedItems: this.selectedItems - }) - } - }, (toDoItem: ToDo) => toDoItem.name.toString()) - } - } - } - .alignItems(HorizontalAlign.Start) - .backgroundColor('#fff') - .borderRadius(12) - .padding(12) - .width('100%') - - if (this.isEditMode) { - Column({ space: 8 }) { - // [Start implement_deletion] - Button('delete') - .width('90%') - .backgroundColor(Color.Red) - .onClick(() => { - this.toDoData = this.toDoData.filter(toDoItem => - !this.selectedItems.some(selectedItem => selectedItem.name === toDoItem.name)); - this.isEditMode = false; - }) - } - } - } - // [End implement_deletion] - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.DeleteListItem_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/GroupedList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/GroupedList.ets deleted file mode 100644 index 8bae8f53c90c81997957585aca9c3aefca5119f0..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/GroupedList.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -// [Start set_the_head_component_of_the_list_grouping_by_header] -@Entry -@Component -export struct GroupedList { - @Builder - itemHead(text: string) { - // 列表分组的头部组件,对应联系人分组A、B等位置的组件 - Text(text) - .fontSize(20) - .backgroundColor('#fff1f3f5') - .width('100%') - .padding(5) - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.GroupedList_titleExample') }) { - List({ space: 12 }) { - ListItemGroup({ header: this.itemHead('A') }) { - // 循环渲染分组A的ListItem - // [StartExclude set_the_head_component_of_the_list_grouping_by_header] - ListItem() { - Text('ListItem A One') - } - - ListItem() { - Text('ListItem A Two') - } - // [EndExclude set_the_head_component_of_the_list_grouping_by_header] - } - - ListItemGroup({ header: this.itemHead('B') }) { - // 循环渲染分组B的ListItem - // [StartExclude set_the_head_component_of_the_list_grouping_by_header] - ListItem() { - Text('ListItem B One') - } - - ListItem() { - Text('ListItem B Two') - } - // [EndExclude set_the_head_component_of_the_list_grouping_by_header] - } - } - } - } - // [End set_the_head_component_of_the_list_grouping_by_header] - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.GroupedList_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/Index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/Index.ets deleted file mode 100644 index fbc9b904b59bc686e7158a4b6355c0c8091880cd..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/Index.ets +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2025 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 { AddListItem } from './AddListItem'; -import { CompletedRoutableCard } from '../../common/Card'; -import { ControlledScrollPositionList } from './ControlledScrollPositionList'; -import { CustomListStyle } from './CustomListStyle'; -import { DataInList } from './DataInList'; -import { DeleteListItem } from './DeleteListItem'; -import { GroupedList } from './GroupedList'; -import { ListIteration } from './ListIteration'; -import { ListLayout } from './ListLayout'; -import { ResponsiveScrollPositionList } from './ResponsiveScrollPositionList'; -import { Route } from '../../common/Route'; -import { StickyHeaderList } from './StickyHeaderList'; -import { SwipeListItem } from './SwipeableListItem'; -import { TaggedListItems } from './TaggedListItems'; -import { CollapseAndExpand } from './CollapseAndExpand'; -import { LongList } from './LongList'; -import { ListChatRoom } from './ListChatRoom'; -import resource from '../../common/resource'; - -export const List_ROUTE_PREFIX: string = 'list'; - -const routes: Route[] = [ - { - name: `${List_ROUTE_PREFIX}/ListLayout`, - title: resource.resourceToString($r('app.string.ListLayout_title')), - description: $r('app.string.ListLayout_description') - }, - { - name: `${List_ROUTE_PREFIX}/DataInList`, - title: resource.resourceToString($r('app.string.DataInList_title')), - description: $r('app.string.DataInList_description') - }, - { - name: `${List_ROUTE_PREFIX}/ListIteration`, - title: resource.resourceToString($r('app.string.ListIteration_title')), - description: $r('app.string.ListIteration_description') - }, - { - name: `${List_ROUTE_PREFIX}/CustomListStyle`, - title: resource.resourceToString($r('app.string.CustomListStyle_title')), - description: $r('app.string.CustomListStyle_description') - }, - { - name: `${List_ROUTE_PREFIX}/GroupedList`, - title: resource.resourceToString($r('app.string.GroupedList_title')), - description: $r('app.string.GroupedList_description') - }, - { - name: `${List_ROUTE_PREFIX}/StickyHeaderList`, - title: resource.resourceToString($r('app.string.StickyHeaderList_title')), - description: $r('app.string.StickyHeaderList_description') - }, - { - name: `${List_ROUTE_PREFIX}/ControlledScrollPositionList`, - title: resource.resourceToString($r('app.string.ControlledScrollPositionList_title')), - description: $r('app.string.ControlledScrollPositionList_description') - }, - { - name: `${List_ROUTE_PREFIX}/ResponsiveScrollPositionList`, - title: resource.resourceToString($r('app.string.ResponsiveScrollPositionList_title')), - description: $r('app.string.ResponsiveScrollPositionList_description') - }, - { - name: `${List_ROUTE_PREFIX}/SwipeListItem`, - title: resource.resourceToString($r('app.string.SwipeListItem_title')), - description: $r('app.string.SwipeListItem_description') - }, - { - name: `${List_ROUTE_PREFIX}/TaggedListItems`, - title: resource.resourceToString($r('app.string.TaggedListItems_title')), - description: $r('app.string.TaggedListItems_description') - }, - { - name: `${List_ROUTE_PREFIX}/AddListItem`, - title: resource.resourceToString($r('app.string.AddListItem_title')), - description: $r('app.string.AddListItem_description') - }, - { - name: `${List_ROUTE_PREFIX}/DeleteListItem`, - title: resource.resourceToString($r('app.string.DeleteListItem_title')), - description: $r('app.string.DeleteListItem_description') - }, - { - name: `${List_ROUTE_PREFIX}/LongList`, - title: resource.resourceToString($r('app.string.LongList_title')), - description: $r('app.string.LongList_description') - }, - { - name: `${List_ROUTE_PREFIX}/CollapseAndExpand`, - title: resource.resourceToString($r('app.string.CollapseAndExpand_title')), - description: $r('app.string.CollapseAndExpand_description') - }, - { - name: `${List_ROUTE_PREFIX}/ListChatRoom`, - title: resource.resourceToString($r('app.string.ListChatRoom_title')), - description: $r('app.string.ListChatRoom_description') - } -]; - -@Builder -export function listDestination(name: string) { - if (name === List_ROUTE_PREFIX) { - ListExample(); - } else if (name === routes[0].name) { - ListLayout(); - } else if (name === routes[1].name) { - DataInList(); - } else if (name === routes[2].name) { - ListIteration(); - } else if (name === routes[3].name) { - CustomListStyle(); - } else if (name === routes[4].name) { - GroupedList(); - } else if (name === routes[5].name) { - StickyHeaderList(); - } else if (name === routes[6].name) { - ControlledScrollPositionList(); - } else if (name === routes[7].name) { - ResponsiveScrollPositionList(); - } else if (name === routes[8].name) { - SwipeListItem(); - } else if (name === routes[9].name) { - TaggedListItems(); - } else if (name === routes[10].name) { - AddListItem(); - } else if (name === routes[11].name) { - DeleteListItem(); - } else if (name === routes[12].name) { - LongList(); - } else if (name === routes[13].name) { - CollapseAndExpand(); - } else if (name === routes[14].name) { - ListChatRoom(); - } -} - -@Entry -@Component -struct ListExample { - @Consume pathStack: NavPathStack; - - build() { - NavDestination() { - List({ space: 12 }) { - ForEach(routes, (route: Route) => { - ListItem() { - CompletedRoutableCard({ title: route.title, description: route.description }) - } - .width('100%') - .onClick(() => { - this.pathStack.pushPath({ name: route.name }); - }) - }) - } - .contentStartOffset(56) - .padding({ left: 16, right: 16 }) - } - .backgroundColor('#f1f3f5') - .title('List', { - backgroundBlurStyle: BlurStyle.COMPONENT_THICK, - barStyle: BarStyle.STACK - }) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListChatRoom.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListChatRoom.ets deleted file mode 100644 index f71e5b69ea6f1359b877688bee7de8f97092fe9f..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListChatRoom.ets +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card' -// 消息类型定义 -interface Message { - id: number - content: string - sender: string -} - -@Entry -@Component -export struct ListChatRoom { - // 自定义消息组件 - @Builder - MessageItem(message: Message) { - Column() { - Text(`${message.sender}: ${message.content}`) - .fontSize(16) - .textAlign(TextAlign.Start) - .padding(10) - .backgroundColor(message.sender === '系统' ? '#F0F0F0' : '#E6F3FF') - .borderRadius(8) - } - .width('100%') - .alignItems(HorizontalAlign.Start) - .margin({ bottom: 8 }) - } - - // 发送消息方法 - sendMessage() { - if (this.inputText.trim()) { - this.messages = [...this.messages, { - id: Date.now(), - content: this.inputText, - sender: '观众' - }] - this.inputText = '' - } - } - // 消息列表数据 - @State messages: Message[] = [ - { id: 1, content: '欢迎来到直播间!', sender: '系统' }, - { id: 2, content: '大家好啊~', sender: '主播' } - ] - - // 输入框内容 - @State inputText: string = '' - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ListChatRoom_title') }) { - Column() { - // 聊天消息区域 - List({ space: 10 }) { - ForEach(this.messages, (item: Message) => { - ListItem() { - this.MessageItem(item) - } - }, (item: Message) => item.id.toString()) - } - .layoutWeight(1) // 占据剩余空间 - .alignListItem(ListItemAlign.Center) - - // 输入区域 - Row({ space: 10 }) { - TextInput({ text: this.inputText, placeholder: '说点什么...' }) - .layoutWeight(1) - .onChange((value: string) => { - this.inputText = value - }) - .onSubmit(() => { // 回车发送 - this.sendMessage() - }) - - Button('发送', { type: ButtonType.Capsule }) - .backgroundColor('#007AFF') - .onClick(() => { - this.sendMessage() - }) - } - .padding(10) - .backgroundColor('#F5F5F5') - } - .width('100%') - .height('100%') - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ListChatRoom_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListDataSource.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListDataSource.ets deleted file mode 100644 index 07e4de1fe56f77093f568dca498e66235f0e6191..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListDataSource.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export class ListDataSource implements IDataSource { - private list: number[] = []; - private listeners: DataChangeListener[] = []; - - constructor(list: number[]) { - this.list = list; - } - - totalCount(): number { - return this.list.length; - } - - getData(index: number): number { - return this.list[index]; - } - - registerDataChangeListener(listener: DataChangeListener): void { - if (this.listeners.indexOf(listener) < 0) { - this.listeners.push(listener); - } - } - - unregisterDataChangeListener(listener: DataChangeListener): void { - const pos = this.listeners.indexOf(listener); - if (pos >= 0) { - this.listeners.splice(pos, 1); - } - } - - // 通知控制器数据删除 - notifyDataDelete(index: number): void { - this.listeners.forEach(listener => { - listener.onDataDelete(index); - }); - } - - // 在指定索引位置删除一个元素 - public deleteItem(index: number): void { - this.list.splice(index, 1); - this.notifyDataDelete(index); - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListIteration.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListIteration.ets deleted file mode 100644 index 9d307842428c8c410f7804c7769f4bcac1c02b2e..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListIteration.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start use_foreach_to_replace_similar_list_items] -import { util } from '@kit.ArkTS'; -// [StartExclude import_component_card] -import { ComponentCard } from '../../common/Card'; -// [EndExclude import_component_card] - -class Contact { - public key: string = util.generateRandomUUID(true); - public name: ResourceStr; - public icon: Resource; - - constructor(name: ResourceStr, icon: Resource) { - this.name = name; - this.icon = icon; - } -} - -@Entry -@Component -export struct ListIteration { - private contacts: Array = [ - new Contact($r('app.string.peopleOne'), $r('sys.media.clone_app_badge_1')), - new Contact($r('app.string.peopleTwo'), $r('sys.media.clone_app_badge_2')) - ]; - - build() { - // [StartExclude use_the_nav_destination] - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ListIteration_titleExample') }) { - // [EndExclude use_the_nav_destination] - List() { - ForEach(this.contacts, (item: Contact) => { - ListItem() { - Row() { - Image(item.icon) - .width(40) - .height(40) - .margin(10) - Text(item.name).fontSize(20) - } - .width('100%') - .justifyContent(FlexAlign.Start) - } - }, (item: Contact) => JSON.stringify(item)) - } - .width('100%') - } - } - // [End use_foreach_to_replace_similar_list_items] - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ListIteration_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListLayout.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListLayout.ets deleted file mode 100644 index 742098ded73f871f74bbee3487d4c3d87cb93fdf..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListLayout.ets +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ListLayout { - @State egLanes: LengthConstrain = { minLength: 200, maxLength: 300 }; - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ListLayout_titleMainAxis') }) { - // [Start build_a_horizontal_scrolling_list] - List({ space: 8 }) { - // [StartExclude build_a_horizontal_scrolling_list] - ListItem() { - Text('ListItem one') - } - - ListItem() { - Text('ListItem two') - } - // [EndExclude build_a_horizontal_scrolling_list] - } - .listDirection(Axis.Horizontal) - // [End build_a_horizontal_scrolling_list] - .height(30) - } - - ComponentCard({ title: $r('app.string.ListLayout_titleCrossAxisLanes') }) { - // [Start build_list_by_size] - List({ space: 8 }) { - ListItem() { - // [StartExclude build_list_by_size] - Text('ListItem one') - } - - ListItem() { - Text('ListItem two') - } - - ListItem() { - Text('ListItem tree') - } - // [EndExclude build_list_by_size] - } - // 此处lanes设置主轴方向 - .lanes(this.egLanes) - // [End build_list_by_size] - } - - ComponentCard({ title: $r('app.string.ListLayout_titleCrossAxisAlignment') }) { - // [Start build_list_with_align_horizontally_in_the_center] - List({ space: 8 }) { - // [StartExclude build_list_with_align_horizontally_in_the_center] - ListItem() { - Text('ListItem one') - } - - ListItem() { - Text('ListItem two') - } - - ListItem() { - Text('ListItem tree') - } - // [EndExclude build_list_with_align_horizontally_in_the_center] - } - // 此处alignListItem设置水平方向对齐 - .alignListItem(ListItemAlign.Center) - // [End build_list_with_align_horizontally_in_the_center] - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ListLayout_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/LongList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/LongList.ets deleted file mode 100644 index 6c5fd86c5de5d90eab101c5a74fe607903e1b9ee..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/LongList.ets +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; -import { ListDataSource } from './ListDataSource'; - -@Entry -@Component -export struct LongList { - private arr: ListDataSource = new ListDataSource([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.LongList_title') }) { - List({ space: 20, initialIndex: 0 }) { - LazyForEach(this.arr, (item: number) => { - ListItem() { - Text('' + item) - .width('100%').height(100).fontSize(16) - .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) - } - }, (item: string) => item) - } - .listDirection(Axis.Vertical) // 排列方向 - .scrollBar(BarState.Off) - .friction(0.6) - .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 - .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring - .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { - console.info('first' + firstIndex); - console.info('last' + lastIndex); - console.info('center' + centerIndex); - }) - .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { - console.log(' start index: ' + start.index + - ' start item group area: ' + start.itemGroupArea + - ' start index in group: ' + start.itemIndexInGroup); - console.log(' end index: ' + end.index + - ' end item group area: ' + end.itemGroupArea + - ' end index in group: ' + end.itemIndexInGroup); - }) - .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { - console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset); - }) - .width('90%') - } - } - .backgroundColor(0xDCDCDC) - .width('100%') - .height('100%') - } - .title($r('app.string.LongList_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ResponsiveScrollPositionList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ResponsiveScrollPositionList.ets deleted file mode 100644 index 06c536cdbd230d39acab2ff89c16e21b37debfbb..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ResponsiveScrollPositionList.ets +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2025 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 { util } from '@kit.ArkTS'; -import { ComponentCard } from '../../common/Card'; - -// [Start respond_to_scroll_position] -const alphabets = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', - 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; - -// [StartExclude respond_to_scroll_position] -class Contact { - public key: string = util.generateRandomUUID(true); - public name: string | Resource; - public icon: Resource; - - constructor(name: string | Resource, icon: Resource) { - this.name = name; - this.icon = icon; - } -} - -class ContactsGroup { - public title: string = ''; - public contacts: Array | null = null; - public key: string = ''; -} - -export let contactsGroups: object[] = [ - { - title: 'A', - contacts: [ - new Contact($r('app.string.contacts_A_one'), $r('sys.media.clone_app_badge_1')), - new Contact($r('app.string.contacts_A_two'), $r('sys.media.clone_app_badge_2')) - ], - key: util.generateRandomUUID(true) - } as ContactsGroup, - { - title: 'B', - contacts: [ - new Contact($r('app.string.contacts_B_one'), $r('sys.media.clone_app_badge_3')), - new Contact($r('app.string.contacts_B_two'), $r('sys.media.clone_app_badge_4')), - new Contact($r('app.string.contacts_B_three'), $r('sys.media.clone_app_badge_5')) - ], - key: util.generateRandomUUID(true) - } as ContactsGroup, - { - title: 'D', - contacts: [ - new Contact($r('app.string.contacts_D_one'), $r('sys.media.clone_app_badge_3')), - new Contact($r('app.string.contacts_D_two'), $r('sys.media.clone_app_badge_4')), - new Contact($r('app.string.contacts_D_three'), $r('sys.media.clone_app_badge_5')) - ], - key: util.generateRandomUUID(true) - } as ContactsGroup, - { - title: 'F', - contacts: [ - new Contact($r('app.string.contacts_F_one'), $r('sys.media.clone_app_badge_3')), - new Contact($r('app.string.contacts_F_two'), $r('sys.media.clone_app_badge_4')) - ], - key: util.generateRandomUUID(true) - } as ContactsGroup, - { - title: 'G', - contacts: [ - new Contact($r('app.string.contacts_G_one'), $r('sys.media.clone_app_badge_3')), - new Contact($r('app.string.contacts_G_two'), $r('sys.media.clone_app_badge_4')) - ], - key: util.generateRandomUUID(true) - } as ContactsGroup, - { - title: 'H', - contacts: [ - new Contact($r('app.string.contacts_H_one'), $r('sys.media.clone_app_badge_3')), - new Contact($r('app.string.contacts_H_two'), $r('sys.media.clone_app_badge_4')), - new Contact($r('app.string.contacts_H_three'), $r('sys.media.clone_app_badge_5')) - ], - key: util.generateRandomUUID(true) - } as ContactsGroup, - { - title: 'X', - contacts: [ - new Contact($r('app.string.contacts_X_one'), $r('sys.media.clone_app_badge_3')), - new Contact($r('app.string.contacts_X_two'), $r('sys.media.clone_app_badge_4')), - new Contact($r('app.string.contacts_X_three'), $r('sys.media.clone_app_badge_5')) - ], - key: util.generateRandomUUID(true) - } as ContactsGroup -]; -// [EndExclude respond_to_scroll_position] - -@Entry -@Component -export struct ResponsiveScrollPositionList { - @State selectedIndex: number = 0; - private listScroller: Scroller = new Scroller(); - private currentGroupTitle: string = ''; // 用于跟踪当前显示的分组标题 - - // [StartExclude respond_to_scroll_position] - @Builder - itemHead(text: string) { - // 列表分组的头部组件,对应联系人分组A、B等位置的组件 - Text(text) - .fontSize(20) - .backgroundColor('#fff1f3f5') - .width('100%') - .padding(5) - } - // [EndExclude respond_to_scroll_position] - - build() { - // [StartExclude respond_to_scroll_position] - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ResponsiveScrollPositionList_titleExample') }) { - // [EndExclude use_stack] - Stack({ alignContent: Alignment.End }) { - // 此为响应滚动位置示例List容器 - List({ scroller: this.listScroller }) { - // [StartExclude use_foreach] - ForEach(contactsGroups, (itemGroup: ContactsGroup) => { - ListItemGroup({ header: this.itemHead(itemGroup.title) }) { - // 循环渲染ListItem - if (itemGroup.contacts) { - ForEach(itemGroup.contacts, (item: Contact) => { - ListItem() { - Row() { - Image(item.icon).width(40).height(40).margin(10) - Text(item.name).fontSize(20) - }.width('100%').justifyContent(FlexAlign.Start) - // [EndExclude respond_to_scroll_position] - } - // [StartExclude respond_to_scroll_position] - }, (item: Contact) => JSON.stringify(item)) - } - } - }, (itemGroup: ContactsGroup) => JSON.stringify(itemGroup)) - } - // [EndExclude respond_to_scroll_position] - .onScrollIndex((firstIndex: number) => { - // [StartExclude respond_to_scroll_position] - // 根据列表滚动到的索引值,重新计算对应联系人索引栏的位置this.selectedIndex - let group = contactsGroups[firstIndex] as ContactsGroup; - this.currentGroupTitle = group.title; - this.selectedIndex = alphabets.indexOf(this.currentGroupTitle); - // [EndExclude respond_to_scroll_position] - }) - - // 字母表索引组件 - AlphabetIndexer({ arrayValue: alphabets, selected: 0 }) - .selected(this.selectedIndex) - // [End respond_to_scroll_position] - }.height('90%') - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ResponsiveScrollPositionList_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/StickyHeaderList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/StickyHeaderList.ets deleted file mode 100644 index 4c2194578b28197f2c27a07dedb2a094ceb44908..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/StickyHeaderList.ets +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; -// [Start Add_sticky_titles] -import { util } from '@kit.ArkTS'; - -class Contact { - public key: string = util.generateRandomUUID(true); - public name: string | Resource; - public icon: Resource; - - constructor(name: string | Resource, icon: Resource) { - this.name = name; - this.icon = icon; - } -} - -class ContactsGroup { - public title: string = ''; - public contacts: Array | null = null; - public key: string = ''; -} - -export let contactsGroups: object[] = [ - { - title: 'A', - contacts: [ - new Contact($r('app.string.contacts_A_one'), $r('sys.media.clone_app_badge_1')), - new Contact($r('app.string.contacts_A_two'), $r('sys.media.clone_app_badge_2')) - ], - key: util.generateRandomUUID(true) - } as ContactsGroup, - { - title: 'B', - contacts: [ - new Contact($r('app.string.contacts_B_one'), $r('sys.media.clone_app_badge_3')), - new Contact($r('app.string.contacts_B_two'), $r('sys.media.clone_app_badge_4')), - new Contact($r('app.string.contacts_B_three'), $r('sys.media.clone_app_badge_5')) - ], - key: util.generateRandomUUID(true) - } as ContactsGroup -]; - -@Entry -@Component -export struct StickyHeaderList { - // 定义分组联系人数据集合contactsGroups数组 - @Builder - itemHead(text: string) { - // 列表分组的头部组件,对应联系人分组A、B等位置的组件 - Text(text) - .fontSize(20) - .backgroundColor('#fff1f3f5') - .width('100%') - .padding(5) - } - - build() { - // [StartExclude add_sticky_titles] - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.StickyHeaderList_titleExample') }) { - // [EndExclude add_sticky_titles] - List() { - // 循环渲染ListItemGroup,contactsGroups为多个分组联系人contacts和标题title的数据集合 - ForEach(contactsGroups, (itemGroup: ContactsGroup) => { - ListItemGroup({ header: this.itemHead(itemGroup.title) }) { - // 循环渲染ListItem - if (itemGroup.contacts) { - ForEach(itemGroup.contacts, (item: Contact) => { - ListItem() { - // [StartExclude add_sticky_titles] - Row() { - Image(item.icon).width(40).height(40).margin(10) - Text(item.name).fontSize(20) - }.width('100%').justifyContent(FlexAlign.Start) - // [EndExclude add_sticky_titles] - } - }, (item: Contact) => JSON.stringify(item)) - } - } - }, (itemGroup: ContactsGroup) => JSON.stringify(itemGroup)) - } - // [StartExclude add_sticky_titles] - .height(230) - // [EndExclude add_sticky_titles] - .sticky(StickyStyle.Header) // 设置吸顶,实现粘性标题效果 - } - // [End add_sticky_titles] - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.StickyHeaderList_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/SwipeableListItem.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/SwipeableListItem.ets deleted file mode 100644 index 7f6454c43ba480fbeadaa8a56232f3f3edc202b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/SwipeableListItem.ets +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct SwipeListItem { - private index: number = 0; - @State arr: number[] = [0, 1, 2, 3]; - - // [Start build_the_tail_slide_out_component] - @Builder - itemEnd(index: number) { - // 构建尾端滑出组件 - Button({ type: ButtonType.Circle }) { - Image($r('sys.media.ohos_ic_bottomsheet_close')) - .width(40) - .height(40) - } - // [StartExclude build_the_tail_slide_out_component] - .backgroundColor('#FFE1E2E3') - // [EndExclude build_the_tail_slide_out_component] - .onClick(() => { - // this.messages为列表数据源,可根据实际场景构造。点击后从数据源删除指定数据项。 - this.arr.splice(index, 1); - }) - } - // [End build_the_tail_slide_out_component] - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SwipeListItem_titleExample') }) { - List({ space: 12 }) { - ForEach(this.arr, (item: number) => { - // [Start bind_the_swipeAction_property_to_left_swipe_list_item] - ListItem() { - // [StartExclude bind_the_swipeAction_property_to_left_swipe_list_item] - Text('Message ' + item) - .width('100%') - .height(50) - .fontSize(16) - .textAlign(TextAlign.Center) - .borderRadius(10) - .backgroundColor('#FFF1F3F5') - // [EndExclude bind_the_swipeAction_property_to_left_swipe_list_item] - }.swipeAction({ - end: { - // index为该ListItem在List中的索引值。 - builder: () => { - this.index = this.arr.indexOf(item); - this.itemEnd(this.index); - }, - } - // [End bind_the_swipeAction_property_to_left_swipe_list_item] - }) - }, (item: number) => item.toString()) - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwipeListItem_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/TaggedListItems.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/TaggedListItems.ets deleted file mode 100644 index bee859a3324828758ef49b72468a59988752ed16..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/TaggedListItems.ets +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct TaggedListItems { - @State arr: number[] = [0, 1, 2, 3]; - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.TaggedListItems_titleExample') }) { - List() { - ForEach(this.arr, (item: number) => { - // [Start add_tags_to_list_items] - ListItem() { - // Badge组件实现消息右上角添加标记功能 - Badge({ - count: 1, - position: BadgePosition.RightTop, - style: { badgeSize: 16, badgeColor: '#FA2A2D' } - }) { - // [StartExclude add_tags_to_list_items] - Text('消息' + item) - .width('95%') - .height(50) - .fontSize(16) - .textAlign(TextAlign.Center) - .borderRadius(10) - .backgroundColor('#FFF1F3F5') - // [EndExclude add_tags_to_list_items] - } - // [End add_tags_to_list_items] - }.margin({ top: 12 }) - }, (item: number) => item.toString()) - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.TaggedListItems_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAndTabsLinkage.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAndTabsLinkage.ets deleted file mode 100644 index 4b6320ccd976e470890217dae13cd3d61caa0ce2..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAndTabsLinkage.ets +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from "../../common/Card"; - -// xxx.ets -class MyDataSource implements IDataSource { - private list: number[] = []; - - constructor(list: number[]) { - this.list = list; - } - - totalCount(): number { - return this.list.length; - } - - getData(index: number): number { - return this.list[index]; - } - - registerDataChangeListener(listener: DataChangeListener): void { - } - - unregisterDataChangeListener() { - } -} - -@Entry -@Component -export struct SwiperAndTabsLinkage { - @State fontColor: string = '#182431'; - @State selectedFontColor: string = '#007DFF'; - @State currentIndex: number = 0; - private list: number[] = []; - private tabsController: TabsController = new TabsController(); - private swiperController: SwiperController = new SwiperController(); - private swiperData: MyDataSource = new MyDataSource([]); - - aboutToAppear(): void { - for (let i = 0; i <= 9; i++) { - this.list.push(i); - } - this.swiperData = new MyDataSource(this.list); - } - - @Builder tabBuilder(index: number, name: string) { - Column() { - Text(name) - .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) - .fontSize(16) - .fontWeight(this.currentIndex === index ? 500 : 400) - .lineHeight(22) - .margin({ top: 17, bottom: 7 }) - Divider() - .strokeWidth(2) - .color('#007DFF') - .opacity(this.currentIndex === index ? 1 : 0) - }.width('20%') - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SwiperAndTabsLinkage_title') }) { - Column() { - Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { - ForEach(this.list, (index: number) =>{ - TabContent().tabBar(this.tabBuilder(index, '页签 ' + this.list[index])) - }) - } - .onTabBarClick((index: number) => { - this.currentIndex = index; - this.swiperController.changeIndex(index, true); - }) - .barMode(BarMode.Scrollable) - .backgroundColor('#F1F3F5') - .height(56) - .width('100%') - - Swiper(this.swiperController) { - LazyForEach(this.swiperData, (item: string) => { - Text(item.toString()) - .onAppear(()=>{ - console.info('onAppear ' + item.toString()); - }) - .onDisAppear(()=>{ - console.info('onDisAppear ' + item.toString()); - }) - .width('100%') - .height('40%') - .backgroundColor(0xAFEEEE) - .textAlign(TextAlign.Center) - .fontSize(30) - }, (item: string) => item) - } - .loop(false) - .onSelected((index: number) => { - console.info("onSelected:" + index); - this.currentIndex = index; - this.tabsController.changeIndex(index); - }) - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwiperAndTabsLinkage_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAutoPlay.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAutoPlay.ets deleted file mode 100644 index 9900409f00f30ae6fb66be820cfe3e89faf4eb21..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAutoPlay.ets +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct SwiperAutoPlay { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SwiperAutoPlay_title') }) { - // [Start autoplay_loop_true] - Swiper() { - // [StartExclude autoplay_loop_true] - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - // [EndExclude autoplay_loop_true] - } - // [StartExclude autoplay_loop_true] - .height(200) - // [EndExclude autoplay_loop_true] - .loop(true) - .autoPlay(true) - .interval(1000) - // [End autoplay_loop_true] - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwiperAutoPlay_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperCustomAnimation.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperCustomAnimation.ets deleted file mode 100644 index 43bab941cd801286eb7f8f6afd7c01304e384702..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperCustomAnimation.ets +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -// [Start customize_transition_animations] -@Entry -@Component -export struct SwiperCustomAnimation { - private DISPLAY_COUNT: number = 2; - private MIN_SCALE: number = 0.75; - @State backgroundColors: Color[] = [Color.Green, Color.Blue, Color.Yellow, Color.Pink, Color.Gray, Color.Orange]; - @State opacityList: number[] = []; - @State scaleList: number[] = []; - @State translateList: number[] = []; - @State zIndexList: number[] = []; - - aboutToAppear(): void { - for (let i = 0; i < this.backgroundColors.length; i++) { - this.opacityList.push(1.0); - this.scaleList.push(1.0); - this.translateList.push(0.0); - this.zIndexList.push(0); - } - } - - build() { - // [StartExclude customize_transition_animations] - NavDestination() { - // [EndExclude customize_transition_animations] - Column({ space: 12 }) { - // [StartExclude customize_transition_animations] - ComponentCard({ title: $r('app.string.SwiperCustomAnimation_titleExample') }) { - // [EndExclude customize_transition_animations] - Swiper() { - ForEach(this.backgroundColors, (backgroundColor: Color, index: number) => { - Text(index.toString()) - .width('100%') - .height('100%') - .fontSize(50) - .textAlign(TextAlign.Center) - .backgroundColor(backgroundColor) - .opacity(this.opacityList[index]) - .scale({ x: this.scaleList[index], y: this.scaleList[index] }) - .translate({ x: this.translateList[index] }) - .zIndex(this.zIndexList[index]) - }) - } - .height(200) - .indicator(false) - .displayCount(this.DISPLAY_COUNT, true) - .customContentTransition({ - timeout: 1000, - transition: (proxy: SwiperContentTransitionProxy) => { - if (proxy.position <= proxy.index % this.DISPLAY_COUNT || - proxy.position >= this.DISPLAY_COUNT + proxy.index % this.DISPLAY_COUNT) { - // 同组页面完全滑出视窗外时,重置属性值 - this.opacityList[proxy.index] = 1.0; - this.scaleList[proxy.index] = 1.0; - this.translateList[proxy.index] = 0.0; - this.zIndexList[proxy.index] = 0; - } else { - // 同组页面未滑出视窗外时,对同组中左右两个页面,逐帧根据position修改属性值 - if (proxy.index % this.DISPLAY_COUNT === 0) { - this.opacityList[proxy.index] = 1 - proxy.position / this.DISPLAY_COUNT; - this.scaleList[proxy.index] = - this.MIN_SCALE + (1 - this.MIN_SCALE) * (1 - proxy.position / this.DISPLAY_COUNT); - this.translateList[proxy.index] = -proxy.position * proxy.mainAxisLength + - (1 - this.scaleList[proxy.index]) * proxy.mainAxisLength / 2.0; - } else { - this.opacityList[proxy.index] = 1 - (proxy.position - 1) / this.DISPLAY_COUNT; - this.scaleList[proxy.index] = - this.MIN_SCALE + (1 - this.MIN_SCALE) * (1 - (proxy.position - 1) / this.DISPLAY_COUNT); - this.translateList[proxy.index] = -(proxy.position - 1) * proxy.mainAxisLength - - (1 - this.scaleList[proxy.index]) * proxy.mainAxisLength / 2.0; - } - this.zIndexList[proxy.index] = -1; - } - } - }) - } - } - .width('100%') - // [End customize_transition_animations] - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwiperCustomAnimation_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperDirection.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperDirection.ets deleted file mode 100644 index e8c8e2d9cdb23d69cce3cb5a9b826e56110c1bd3..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperDirection.ets +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct SwiperDirection { - private swiperHorizontalController: SwiperController = new SwiperController(); - private swiperVerticalController: SwiperController = new SwiperController(); - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SwiperPageSwitchMethod_titleHorizontal') }) { - Column({ space: 8 }) { - // [Start rotate_horizontally] - Swiper(this.swiperHorizontalController) { - // [StartExclude rotate_horizontally] - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - // [EndExclude rotate_horizontally] - } - // [StartExclude rotate_horizontally] - .height(200) - // [EndExclude rotate_horizontally] - .indicator(true) - .vertical(false) - // [End rotate_horizontally] - - Row({ space: 12 }) { - Button('showNext') - .onClick(() => { - this.swiperHorizontalController.showNext(); // 通过controller切换到后一页 - }) - Button('showPrevious') - .onClick(() => { - this.swiperHorizontalController.showPrevious(); // 通过controller切换到前一页 - }) - }.margin(5) - } - } - - ComponentCard({ title: $r('app.string.SwiperPageSwitchMethod_titleVertical') }) { - Column({ space: 8 }) { - // [Start rotate_vertically] - Swiper(this.swiperVerticalController) { - // [StartExclude rotate_vertically] - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - // [EndExclude rotate_vertically] - } - // [StartExclude rotate_vertically] - .height(200) - // [EndExclude rotate_vertically] - .indicator(true) - .vertical(true) - // [End rotate_vertically] - - Row({ space: 12 }) { - Button('showNext') - .onClick(() => { - this.swiperVerticalController.showNext(); // 通过controller切换到后一页 - }) - Button('showPrevious') - .onClick(() => { - this.swiperVerticalController.showPrevious(); // 通过controller切换到前一页 - }) - }.margin(5) - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwiperDirection_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIgnoreComponentSize.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIgnoreComponentSize.ets deleted file mode 100644 index 420343eb510941dde4c0e9565b2d06c0df0124ef..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIgnoreComponentSize.ets +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2025 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 { LengthMetrics } from '@kit.ArkUI'; -import { ComponentCard } from '../../common/Card'; - - -class MyDataSource implements IDataSource { - private list: number[] = []; - - constructor(list: number[]) { - this.list = list; - } - - totalCount(): number { - return this.list.length; - } - - getData(index: number): number { - return this.list[index]; - } - - registerDataChangeListener(listener: DataChangeListener): void { - } - - unregisterDataChangeListener() { - } -} - -@Entry -@Component -export struct SwiperIgnoreComponentSize { - - @State space: LengthMetrics = LengthMetrics.vp(0); - @State spacePool: LengthMetrics[] = [LengthMetrics.vp(0), LengthMetrics.px(3), LengthMetrics.vp(10)]; - @State spaceIndex: number = 0; - - @State ignoreSize: boolean = false; - @State ignoreSizePool: boolean[] = [false, true]; - @State ignoreSizeIndex: number = 0; - - private swiperController1: SwiperController = new SwiperController(); - private data1: MyDataSource = new MyDataSource([]); - - aboutToAppear(): void { - let list1: number[] = []; - for (let i = 1; i <= 10; i++) { - list1.push(i); - } - this.data1 = new MyDataSource(list1); - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SwiperIgnoreComponentSize_title') }) { - Scroll() { - Column({ space: 20 }) { - Swiper(this.swiperController1) { - LazyForEach(this.data1, (item: string) => { - Text(item.toString()) - .width('90%') - .height(120) - .backgroundColor(0xAFEEEE) - .textAlign(TextAlign.Center) - .fontSize(30) - }, (item: string) => item) - } - .indicator(new DotIndicator() - .space(this.space) - .bottom(LengthMetrics.vp(0), this.ignoreSize) - .itemWidth(15) - .itemHeight(15) - .selectedItemWidth(15) - .selectedItemHeight(15) - .color(Color.Gray) - .selectedColor(Color.Blue)) - .displayArrow({ - showBackground: true, - isSidebarMiddle: true, - backgroundSize: 24, - backgroundColor: Color.White, - arrowSize: 18, - arrowColor: Color.Blue - }, false) - - Column({ space: 4 }) { - Button('spaceIndex:' + this.spaceIndex).onClick(() => { - this.spaceIndex = (this.spaceIndex + 1) % this.spacePool.length; - this.space = this.spacePool[this.spaceIndex]; - }).margin(10) - - Button('ignoreSizeIndex:' + this.ignoreSizeIndex).onClick(() => { - this.ignoreSizeIndex = (this.ignoreSizeIndex + 1) % this.ignoreSizePool.length; - this.ignoreSize = this.ignoreSizePool[this.ignoreSizeIndex]; - }).margin(10) - }.margin(2) - }.width('100%') - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwiperIgnoreComponentSize_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIndicatorStyle.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIndicatorStyle.ets deleted file mode 100644 index b38d27d167c886bc92ed0d5dc59418bb7604991b..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIndicatorStyle.ets +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct SwiperIndicatorStyle { - build() { - NavDestination() { - Column({ space: 12 }) { - - ComponentCard({ title: $r('app.string.SwiperIndicatorStyle_titleDefault') }) { - // [Start default_navigation_point_style] - Swiper() { - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - } - // [End default_navigation_point_style] - .height(100) - } - - ComponentCard({ title: $r('app.string.SwiperIndicatorStyle_titleCustom') }) { - // [Start customize_navigation_point_styles] - Swiper() { - // [StartExclude customize_navigation_point_styles] - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - // [EndExclude customize_navigation_point_styles] - } - .height(100) - .indicator( - Indicator.dot() - .left(0) - .itemWidth(15) - .itemHeight(15) - .selectedItemWidth(30) - .selectedItemHeight(15) - .color(Color.Red) - .selectedColor(Color.Blue) - ) - } - // [End customize_navigation_point_styles] - - ComponentCard({ title: $r('app.string.SwiperIndicatorStyle_titleDefaultArrows') }) { - // [Start default_arrow_style] - Swiper() { - // [StartExclude default_arrow_style] - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - // [EndExclude default_arrow_style] - } - // [StartExclude default_arrow_style] - .height(100) - // [EndExclude default_arrow_style] - .displayArrow(true, false) - // [End default_arrow_style] - } - - ComponentCard({ title: $r('app.string.SwiperIndicatorStyle_titleCustomArrows') }) { - // [Start customize_the_arrow_style] - Swiper() { - // [StartExclude customize_the_arrow_style] - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - // [EndExclude customize_the_arrow_style] - } - // [StartExclude customize_the_arrow_style] - .height(100) - // [EndExclude customize_the_arrow_style] - .displayArrow({ - showBackground: true, - isSidebarMiddle: true, - backgroundSize: 24, - backgroundColor: Color.White, - arrowSize: 18, - arrowColor: Color.Blue - }, false) - // [End customize_the_arrow_style] - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwiperIndicatorStyle_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperLoop.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperLoop.ets deleted file mode 100644 index 10c4945f09b7966c2b10ed4abfed524fdef03f9c..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperLoop.ets +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct SwiperLoop { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SwiperLoop_titleTrue') }) { - // [Start loop_with_true] - Swiper() { - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - } - // [StartExclude loop_with_true] - .height(200) - // [EndExclude loop_with_true] - .loop(true) - // [End loop_with_true] - } - - ComponentCard({ title: $r('app.string.SwiperLoop_titleFalse') }) { - // [Start loop_with_false] - Swiper() { - // [StartExclude loop_with_false] - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - // [EndExclude loop_with_false] - } - // [StartExclude loop_with_false] - .height(200) - // [EndExclude loop_with_false] - .loop(false) - // [End loop_with_false] - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwiperLoop_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperMultiPage.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperMultiPage.ets deleted file mode 100644 index e534dd9f1002254fcb9f1ea0edc4455ac892f2c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperMultiPage.ets +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct SwiperMultiPage { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SwiperMultiPage_titleExample') }) { - // [Start each_page_displays_multiple_subpages] - Swiper() { - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - Text('3') - .width('90%') - .height('100%') - .backgroundColor(Color.Yellow) - .textAlign(TextAlign.Center) - .fontSize(30) - } - // [StartExclude each_page_displays_multiple_subpages] - .height(200) - // [EndExclude each_page_displays_multiple_subpages] - .indicator(true) - .displayCount(2) - } - // [End each_page_displays_multiple_subpages] - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwiperMultiPage_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperPageSwitchMethod.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperPageSwitchMethod.ets deleted file mode 100644 index 64ae9a299941977d3e3bdf1ffbff1f994838cfde..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperPageSwitchMethod.ets +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -// [Start switch_pages] -@Entry -@Component -export struct SwiperPageSwitchMethod { - private swiperController: SwiperController = new SwiperController(); - - build() { - // [StartExclude switch_pages] - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SwiperPageSwitchMethod_title') }) { - // [EndExclude switch_pages] - Column({ space: 8 }) { - Swiper(this.swiperController) { - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) - } - // [StartExclude switch_pages] - .height(200) - // [EndExclude switch_pages] - .indicator(true) - - Row({ space: 12 }) { - Button('showNext') - .onClick(() => { - this.swiperController.showNext(); // 通过controller切换到后一页 - }) - Button('showPrevious') - .onClick(() => { - this.swiperController.showPrevious(); // 通过controller切换到前一页 - }) - }.margin(5) - } - } - } - // [End switch_pages] - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwiperPageSwitchMethod_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/index.ets deleted file mode 100644 index 37aa2ea07443fc9bb7f149c03d90906f217a4379..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/index.ets +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2025 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 { CompletedRoutableCard } from '../../common/Card'; -import { Route } from '../../common/Route'; -import { SwiperAutoPlay } from './SwiperAutoPlay'; -import { SwiperCustomAnimation } from './SwiperCustomAnimation'; -import { SwiperDirection } from './SwiperDirection'; -import { SwiperIndicatorStyle } from './SwiperIndicatorStyle'; -import { SwiperLoop } from './SwiperLoop'; -import { SwiperMultiPage } from './SwiperMultiPage'; -import { SwiperPageSwitchMethod } from './SwiperPageSwitchMethod'; -import { SwiperAndTabsLinkage } from './SwiperAndTabsLinkage'; -import resource from '../../common/resource'; - -export const SWIPER_ROUTE_PREFIX: string = 'swiper'; - -const routes: Route[] = [ - { - name: `${SWIPER_ROUTE_PREFIX}/SwiperLoop`, - title: resource.resourceToString($r('app.string.SwiperLoop_title')), - description: $r('app.string.SwiperLoop_description') - }, - { - name: `${SWIPER_ROUTE_PREFIX}/SwiperAutoPlay`, - title: resource.resourceToString($r('app.string.SwiperAutoPlay_title')), - description: $r('app.string.SwiperAutoPlay_description') - }, - { - name: `${SWIPER_ROUTE_PREFIX}/SwiperIndicatorStyle`, - title: resource.resourceToString($r('app.string.SwiperIndicatorStyle_title')), - description: $r('app.string.SwiperIndicatorStyle_description') - }, - { - name: `${SWIPER_ROUTE_PREFIX}/SwiperPageSwitchMethod`, - title: resource.resourceToString($r('app.string.SwiperPageSwitchMethod_title')), - description: $r('app.string.SwiperPageSwitchMethod_description') - }, - { - name: `${SWIPER_ROUTE_PREFIX}/SwiperDirection`, - title: resource.resourceToString($r('app.string.SwiperDirection_title')), - description: $r('app.string.SwiperDirection_description') - }, - { - name: `${SWIPER_ROUTE_PREFIX}/SwiperMultiPage`, - title: resource.resourceToString($r('app.string.SwiperMultiPage_title')), - description: $r('app.string.SwiperMultiPage_description') - }, - { - name: `${SWIPER_ROUTE_PREFIX}/SwiperCustomAnimation`, - title: resource.resourceToString($r('app.string.SwiperCustomAnimation_title')), - description: $r('app.string.SwiperCustomAnimation_description') - }, - { - name: `${SWIPER_ROUTE_PREFIX}/SwiperAndTabsLinkage`, - title: resource.resourceToString($r('app.string.SwiperAndTabsLinkage_title')), - description: $r('app.string.SwiperAndTabsLinkage_description') - } -]; - -@Builder -export function swiperDestination(name: string) { - if (name === SWIPER_ROUTE_PREFIX) { - SwiperExample(); - } else if (name === routes[0].name) { - SwiperLoop(); - } else if (name === routes[1].name) { - SwiperAutoPlay(); - } else if (name === routes[2].name) { - SwiperIndicatorStyle(); - } else if (name === routes[3].name) { - SwiperPageSwitchMethod(); - } else if (name === routes[4].name) { - SwiperDirection(); - } else if (name === routes[5].name) { - SwiperMultiPage(); - } else if (name === routes[6].name) { - SwiperCustomAnimation(); - } else if (name === routes[7].name) { - SwiperAndTabsLinkage(); - } -} - -@Entry -@Component -struct SwiperExample { - @Consume pathStack: NavPathStack; - - build() { - NavDestination() { - List({ space: 12 }) { - ForEach(routes, (route: Route) => { - ListItem() { - CompletedRoutableCard({ title: route.title, description: route.description }) - } - .width('100%') - .onClick(() => { - this.pathStack.pushPath({ name: route.name }); - }) - }) - } - .contentStartOffset(56) - .padding({ left: 16, right: 16 }) - } - .backgroundColor('#f1f3f5') - .title('Swiper', { - backgroundBlurStyle: BlurStyle.COMPONENT_THICK, - barStyle: BarStyle.STACK - }) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/AgeFriendlyTabs.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/AgeFriendlyTabs.ets deleted file mode 100644 index 74d7a869758a332660676805b3cd1b699fd5035f..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/AgeFriendlyTabs.ets +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start age_friendly_tab] -import { abilityManager, Configuration } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { promptAction, uiAppearance } from '@kit.ArkUI'; - -@Entry -@Component -export struct AgeFriendlyTabs { - @State fontColor: string = '#182431'; - @State selectedFontColor: string = '#007DFF'; - @State currentIndex: number = 0; - @State currentFontSizeScale: string = ''; - @State showBuilderTab: boolean = false; - @State fontSize: number = 15; - private darkModeKey: string[] = Object.keys(uiAppearance.DarkMode).filter( - key => typeof uiAppearance.DarkMode[key] === 'number'); - - async setFontScale(scale: number): Promise { - let configInit: Configuration = { - fontSizeScale: scale, - }; - abilityManager.updateConfiguration(configInit, (err: BusinessError) => { - if (err) { - console.error(`updateConfiguration fail, err: ${JSON.stringify(err)}`); - promptAction.showToast({ message: `scale:${scale}, err:${JSON.stringify(err)}` }); - } else { - this.currentFontSizeScale = String(scale); - if (scale > 1) { - this.fontSize = 8; - } else { - this.fontSize = 15; - } - console.log('updateConfiguration success.'); - promptAction.showToast({ message: `scale:${scale}, updateConfiguration success.` }); - } - }); - } - - darkMode(isDarkMode: boolean): void { - let mode: uiAppearance.DarkMode = uiAppearance.DarkMode.ALWAYS_LIGHT; - if (isDarkMode) { - mode = uiAppearance.DarkMode.ALWAYS_DARK; - } - if (mode == uiAppearance.getDarkMode()) { - console.info(`TitleDarkMode Set ${this.darkModeKey[mode]} successfully.`); - return; - } - try { - uiAppearance.setDarkMode(mode).then(() => { - console.info(`TitleDarkMode Set ${this.darkModeKey[mode]} successfully.`); - }).catch((error: Error) => { - console.error(`TitleDarkMode Set ${this.darkModeKey[mode]} failed, ${error.message}`); - }); - } catch (error) { - let message = (error as BusinessError).message; - console.error(`TitleDarkMode Set dark-mode failed, ${message}`); - } - } - - build() { - // [StartExclude age_friendly_tab] - NavDestination() { - // [EndExclude age_friendly_tab] - Column() { - Column() { - Row() { - Text(`current fontSizeScale:${this.currentFontSizeScale}`) - .margin({ top: 5, bottom: 5 }) - .fontSize(this.fontSize) - } - - Row() { - Button('1.75') - .margin({ top: 5, bottom: 5 }) - .fontSize(this.fontSize) - .width('40%') - .onClick(async () => { - await this.setFontScale(1.75); - }) - Button('2') - .margin({ top: 5, bottom: 5 }) - .fontSize(this.fontSize) - .width('40%') - .onClick(async () => { - await this.setFontScale(2); - }) - }.margin({ top: 25 }) - - Row() { - Button('3.2') - .margin({ top: 5, bottom: 5 }) - .fontSize(this.fontSize) - .width('40%') - .onClick(async () => { - await this.setFontScale(3.2); - }) - Button('1') - .margin({ top: 5, bottom: 5 }) - .fontSize(this.fontSize) - .width('40%') - .onClick(async () => { - await this.setFontScale(1); - }) - } - - Row() { - Button('深色模式') - .margin({ top: 5, bottom: 5 }) - .fontSize(this.fontSize) - .width('40%') - .onClick(async () => { - this.darkMode(true); - }) - Button('浅色模式') - .margin({ top: 5, bottom: 5 }) - .fontSize(this.fontSize) - .width('40%') - .onClick(async () => { - this.darkMode(false); - }) - } - }.alignItems(HorizontalAlign.Start) - - Column() { - Tabs({ barPosition: BarPosition.End }) { - TabContent() { - Column() - .width('100%') - .height('100%') - .backgroundColor(Color.Pink) - }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'OverLength')) - - TabContent() { - Column() - .width('100%') - .height('100%') - .backgroundColor(Color.Yellow) - }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'SixLine')) - - TabContent() { - Column() - .width('100%') - .height('100%') - .backgroundColor(Color.Blue) - }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) - - TabContent() { - Column() - .width('100%') - .height('100%') - .backgroundColor(Color.Green) - }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) - } - .vertical(false) - .scrollable(true) - .barMode(BarMode.Fixed) - .onChange((index: number) => { - console.info(index.toString()); - }) - .width('100%') - .backgroundColor(0xF1F3F5) - }.width('80%').height(200) - .margin({ top: 200 }) - }.width('100%') - } - // [End age_friendly_tab] - .backgroundColor('#f1f2f3') - .title($r('app.string.AgeFriendlyTabs_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/BottomTabBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/BottomTabBar.ets deleted file mode 100644 index 9a3a5b4215532191af05cdcf796c450451076814..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/BottomTabBar.ets +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct BottomTabBar { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.BottomTabBar_titleExample') }) { - // [Start bottom_navigation] - Tabs({ barPosition: BarPosition.End }) { - // [StartExclude bottom_navigation] - TabContent() { - Text($r('app.string.homepage_content')) - .fontSize(30) - - } - .backgroundColor(Color.Blue) - .tabBar($r('app.string.homepage')) - - TabContent() { - Text($r('app.string.recommend_content')) - .fontSize(30) - } - .backgroundColor(Color.Green) - .tabBar($r('app.string.recommend')) - - TabContent() { - Text($r('app.string.discover_content')) - .fontSize(30) - } - .backgroundColor(Color.Yellow) - .tabBar($r('app.string.discover')) - - TabContent() { - Text($r('app.string.mine_content')) - .fontSize(30) - } - .backgroundColor(Color.Orange) - .tabBar($r('app.string.mine')) - // [EndExclude bottom_navigation] - } - // [End bottom_navigation] - .height(500) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.BottomTabBar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/ContentWillChange.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/ContentWillChange.ets deleted file mode 100644 index a414fd27b1237f0e2c65060567d6c0802ceabf1c..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/ContentWillChange.ets +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -// [Start switch_the_tab_to_a_specific_tab] -@Entry -@Component -export struct ContentWillChange { - scroller: Scroller = new Scroller(); - @State currentIndex: number = 2; - // [StartExclude switch_the_tab_to_a_specific_tab] - @State currentIndexTwo: number = 2; - @State currentIndexThree: number = 2; - private controller: TabsController = new TabsController(); - private controllerTwo: TabsController = new TabsController(); - // [EndExclude switch_the_tab_to_a_specific_tab] - - @Builder - tabBuilder(title: ResourceStr, targetIndex: number) { - Column() { - Text(title) - .fontColor(this.currentIndex === targetIndex ? '#F111C1' : '#6B6B6B') - } - } - - // [StartExclude switch_the_tab_to_a_specific_tab] - @Builder - tabBuilderTwo(title: ResourceStr, targetIndex: number) { - Column() { - Text(title) - .fontColor(this.currentIndexTwo === targetIndex ? '#F111C1' : '#6B6B6B') - } - } - - @Builder - tabBuilderThree(title: ResourceStr, targetIndex: number) { - Column() { - Text(title) - .fontColor(this.currentIndexThree === targetIndex ? '#F111C1' : '#6B6B6B') - } - } - // [EndExclude switch_the_tab_to_a_specific_tab] - - build() { - // [StartExclude switch_the_tab_to_a_specific_tab] - NavDestination() { - Scroll(this.scroller) { - // [EndExclude switch_the_tab_to_a_specific_tab] - Column({ space: 12 }) { - // [StartExclude switch_the_tab_to_a_specific_tab] - ComponentCard({ title: $r('app.string.ContentWillChange_titleContentAndTabSync') }) { - // [EndExclude switch_the_tab_to_a_specific_tab] - Tabs({ barPosition: BarPosition.End }) { - TabContent() { - // [StartExclude switch_the_tab_to_a_specific_tab] - Text($r('app.string.homepage_content')) - .fontSize(30) - // [EndExclude switch_the_tab_to_a_specific_tab] - } - .backgroundColor(Color.Blue) - .tabBar(this.tabBuilder($r('app.string.homepage'), 0)) - - TabContent() { - // [StartExclude switch_the_tab_to_a_specific_tab] - Text($r('app.string.discover_content')) - .fontSize(30) - // [EndExclude switch_the_tab_to_a_specific_tab] - } - .backgroundColor(Color.Green) - .tabBar(this.tabBuilder($r('app.string.discover'), 1)) - - TabContent() { - // [StartExclude switch_the_tab_to_a_specific_tab] - Text($r('app.string.recommend_content')) - .fontSize(30) - // [EndExclude switch_the_tab_to_a_specific_tab] - } - .backgroundColor(Color.Yellow) - .tabBar(this.tabBuilder($r('app.string.recommend'), 2)) - - TabContent() { - // [StartExclude switch_the_tab_to_a_specific_tab] - Text($r('app.string.mine_content')) - .fontSize(30) - // [EndExclude switch_the_tab_to_a_specific_tab] - } - .backgroundColor(Color.Orange) - .tabBar(this.tabBuilder($r('app.string.mine'), 3)) - } - .animationDuration(0) - .height(300) - .onChange((index: number) => { - this.currentIndex = index; - }) - } - - ComponentCard({ title: $r('app.string.ContentWillChange_titleSpecifiedTab') }) { - Column({ space: 8 }) { - // [Start content_associated_with_tab] - Tabs({ barPosition: BarPosition.End, index: this.currentIndexTwo, controller: this.controller }) { - // [StartExclude content_associated_with_tab] - TabContent() { - Text($r('app.string.homepage_content')) - .fontSize(30) - } - .backgroundColor(Color.Blue) - .tabBar(this.tabBuilderTwo($r('app.string.homepage'), 0)) - - TabContent() { - Text($r('app.string.discover_content')) - .fontSize(30) - } - .backgroundColor(Color.Green) - .tabBar(this.tabBuilderTwo($r('app.string.discover'), 1)) - - TabContent() { - Text($r('app.string.recommend_content')) - .fontSize(30) - } - .backgroundColor(Color.Yellow) - .tabBar(this.tabBuilderTwo($r('app.string.recommend'), 2)) - - TabContent() { - Text($r('app.string.mine_content')) - .fontSize(30) - } - .backgroundColor(Color.Orange) - .tabBar(this.tabBuilderTwo($r('app.string.mine'), 3)) - // [EndExclude content_associated_with_tab] - } - .animationDuration(0) - .height(300) - .onChange((index: number) => { - this.currentIndexTwo = index; - }) - - Button($r('app.string.ContentWillChange_changeIndex')).width('50%') - .onClick(() => { - this.currentIndexTwo = (this.currentIndexTwo + 1) % 4; - }) - - Button('changeIndex').width('50%') - .onClick(() => { - let index = (this.currentIndexTwo + 1) % 4; - this.controller.changeIndex(index); - }) - // [End content_associated_with_tab] - } - } - - ComponentCard({ title: $r('app.string.ContentWillChange_titleInterception') }) { - Column({ space: 8 }) { - // [Start custom_page_toggle_interception_events] - Tabs({ barPosition: BarPosition.End, index: this.currentIndexThree, controller: this.controllerTwo }) { - // [StartExclude custom_page_toggle_interception_events] - TabContent() { - Text($r('app.string.homepage_content')) - .fontSize(30) - } - .backgroundColor(Color.Blue) - .tabBar(this.tabBuilderThree($r('app.string.homepage'), 0)) - - TabContent() { - Text($r('app.string.discover_content')) - .fontSize(30) - } - .backgroundColor(Color.Green) - .tabBar(this.tabBuilderThree($r('app.string.discover'), 1)) - - TabContent() { - Text($r('app.string.recommend_content')) - .fontSize(30) - } - .backgroundColor(Color.Yellow) - .tabBar(this.tabBuilderThree($r('app.string.recommend'), 2)) - - TabContent() { - Text($r('app.string.mine_content')) - .fontSize(30) - } - .backgroundColor(Color.Orange) - .tabBar(this.tabBuilderThree($r('app.string.mine'), 3)) - // [EndExclude custom_page_toggle_interception_events] - } - // [StartExclude custom_page_toggle_interception_events] - .animationDuration(0) - .height(300) - // [EndExclude custom_page_toggle_interception_events] - .onChange((index: number) => { - this.currentIndexThree = index; - }) - .onContentWillChange((currentIndex, comingIndex) => { - if (comingIndex == 2) { - return false; - } - return true; - }) - // [End custom_page_toggle_interception_events] - - Button($r('app.string.ContentWillChange_changeIndex')).width('50%') - .onClick(() => { - this.currentIndexThree = (this.currentIndexThree + 1) % 4; - }) - - Button('changeIndex').width('50%') - .onClick(() => { - let index = (this.currentIndexThree + 1) % 4; - this.controllerTwo.changeIndex(index); - }) - } - } - } - .width('100%') - .padding({ left: 12, right: 12 }) - } - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ContentWillChange_title')) - } -} -// [End switch_the_tab_to_a_specific_tab] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/CustomTabBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/CustomTabBar.ets deleted file mode 100644 index de0d4c16d7d5f6af6b3eb05f724c3e9b1c2809c7..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/CustomTabBar.ets +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct CustomTabBar { - // [Start custom_tab_bar_style] - @State currentIndex: number = 0; - - @Builder - tabBuilder(title: ResourceStr, targetIndex: number, selectedImg: Resource, normalImg: Resource) { - Column() { - Image(this.currentIndex === targetIndex ? selectedImg : normalImg) - .size({ width: 25, height: 25 }) - Text(title) - .fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') - } - .width('100%') - .height(50) - .justifyContent(FlexAlign.Center) - } - // [End custom_tab_bar_style] - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.CustomTabBar_titleExample') }) { - Tabs({ barPosition: BarPosition.End }) { - TabContent() { - Text($r('app.string.internet_content')) - .fontSize(30) - } - .backgroundColor(Color.Blue) - .tabBar(this.tabBuilder($r('app.string.internet'), - 0, - $r('sys.media.ohos_ic_public_web'), - $r('sys.media.ohos_ic_public_web'))) - - TabContent() { - Text($r('app.string.album_content')) - .fontSize(30) - } - .backgroundColor(Color.Green) - .tabBar(this.tabBuilder($r('app.string.album'), - 1, - $r('sys.media.ohos_ic_public_albums'), - $r('sys.media.ohos_ic_public_albums'))) - - TabContent() { - Text($r('app.string.video_content')) - .fontSize(30) - } - .backgroundColor(Color.Yellow) - .tabBar(this.tabBuilder($r('app.string.video'), - 2, - $r('sys.media.ohos_ic_public_video'), - $r('sys.media.ohos_ic_public_video'))) - - // [Start set_custom_tab_bar_style] - TabContent() { - Text($r('app.string.more_content')) - .fontSize(30) - } - .backgroundColor(Color.Orange) - .tabBar(this.tabBuilder($r('app.string.more'), - 3, - $r('sys.media.ohos_ic_public_drawer_open'), - $r('sys.media.ohos_ic_public_drawer_open'))) - // [End set_custom_tab_bar_style] - }.height(500) - .onChange((index: number) => { - this.currentIndex = index; // 监听索引index的变化,实现页签内容的切换。 - }) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.CustomTabBar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/FixedTabBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/FixedTabBar.ets deleted file mode 100644 index a786d084a857b391180a9d90a75183ba0414f435..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/FixedTabBar.ets +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct FixedTabBar { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.FixedTabBar_titleExample') }) { - // [Start fixed_tab_bar] - Tabs({ barPosition: BarPosition.End }) { - // [StartExclude fixed_tab_bar] - TabContent() { - Text($r('app.string.homepage_content')) - .fontSize(30) - } - .backgroundColor(Color.Blue) - .tabBar($r('app.string.homepage')) - - TabContent() { - Text($r('app.string.recommend_content')) - .fontSize(30) - } - .backgroundColor(Color.Green) - .tabBar($r('app.string.recommend')) - - TabContent() { - Text($r('app.string.discover_content')) - .fontSize(30) - } - .backgroundColor(Color.Yellow) - .tabBar($r('app.string.discover')) - - TabContent() { - Text($r('app.string.mine_content')) - .fontSize(30) - } - .backgroundColor(Color.Orange) - .tabBar($r('app.string.mine')) - // [EndExclude fixed_tab_bar] - } - // [StartExclude fixed_tab_bar] - .height(500) - // [EndExclude fixed_tab_bar] - .barMode(BarMode.Fixed) - // [End fixed_tab_bar] - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.FixedTabBar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/ScrollableTabBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/ScrollableTabBar.ets deleted file mode 100644 index ef93f632f6f18c893105e7fb735219eddd5f55cb..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/ScrollableTabBar.ets +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct ScrollableTabBar { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.ScrollableTabBar_titleExample') }) { - // [Start scrollable_tab_bar] - Tabs({ barPosition: BarPosition.Start }) { - // [StartExclude scrollable_tab_bar] - TabContent() { - Text($r('app.string.FocusOn_content')) - .fontSize(30) - } - .backgroundColor(Color.Blue) - .tabBar($r('app.string.FocusOn')) - - TabContent() { - Text($r('app.string.video_content')) - .fontSize(30) - } - .backgroundColor(Color.Green) - .tabBar($r('app.string.video')) - - TabContent() { - Text($r('app.string.game_content')) - .fontSize(30) - } - .backgroundColor(Color.Yellow) - .tabBar($r('app.string.game')) - - TabContent() { - Text($r('app.string.digit_content')) - .fontSize(30) - } - .backgroundColor(Color.Orange) - .tabBar($r('app.string.digit')) - - TabContent() { - Text($r('app.string.technology_content')) - .fontSize(30) - } - .backgroundColor(Color.Pink) - .tabBar($r('app.string.technology')) - - TabContent() { - Text($r('app.string.sport_content')) - .fontSize(30) - } - .backgroundColor(Color.Gray) - .tabBar($r('app.string.sport')) - - TabContent() { - Text($r('app.string.film_content')) - .fontSize(30) - } - .backgroundColor(Color.Brown) - .tabBar($r('app.string.film')) - - TabContent() { - Text($r('app.string.humanities_content')) - .fontSize(30) - } - .backgroundColor(Color.Red) - .tabBar($r('app.string.humanities')) - // [EndExclude scrollable_tab_bar] - } - // [StartExclude scrollable_tab_bar] - .barWidth(250) - .height(500) - // [EndExclude scrollable_tab_bar] - .barMode(BarMode.Scrollable) - // [End scrollable_tab_bar] - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.ScrollableTabBar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/SideTabBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/SideTabBar.ets deleted file mode 100644 index 70f2bedb836d1787b542c25a3a40a207943121c7..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/SideTabBar.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct SideTabBar { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SideTabBar_titleExample') }) { - // [Start side_navigation] - Tabs({ barPosition: BarPosition.Start }) { - // [StartExclude side_navigation] - TabContent() { - Text($r('app.string.homepage_content')) - .fontSize(30) - } - .backgroundColor(Color.Blue) - .tabBar($r('app.string.homepage')) - - TabContent() { - Text($r('app.string.recommend_content')) - .fontSize(30) - } - .backgroundColor(Color.Green) - .tabBar($r('app.string.recommend')) - - TabContent() { - Text($r('app.string.discover_content')) - .fontSize(30) - } - .backgroundColor(Color.Yellow) - .tabBar($r('app.string.discover')) - - TabContent() { - Text($r('app.string.mine_content')) - .fontSize(30) - } - .backgroundColor(Color.Orange) - .tabBar($r('app.string.mine')) - // [EndExclude side_navigation] - } - // [StartExclude side_navigation] - .height(200) - // [EndExclude side_navigation] - .vertical(true) - .barWidth(100) - .barHeight(200) - // [End side_navigation] - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SideTabBar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/SwipeLockedTabBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/SwipeLockedTabBar.ets deleted file mode 100644 index abb21c01b947663fde1ec16839c73dd40b0912c0..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/SwipeLockedTabBar.ets +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct SwipeLockedTabBar { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SwipeLockedTabBar_titleExample') }) { - // [Start swipe_locked_tab_bar] - Tabs({ barPosition: BarPosition.End }) { - TabContent() { - Column() { - Tabs() { - // 顶部导航栏内容 - // [StartExclude swipe_locked_tab_bar] - TabContent() { - Text($r('app.string.FocusOn_content')) - .fontSize(30) - } - .tabBar($r('app.string.FocusOn')) - - TabContent() { - Text($r('app.string.video_content')) - .fontSize(30) - } - .tabBar($r('app.string.video')) - - TabContent() { - Text($r('app.string.game_content')) - .fontSize(30) - } - .tabBar($r('app.string.game')) - - TabContent() { - Text($r('app.string.digit_content')) - .fontSize(30) - } - .tabBar($r('app.string.digit')) - - TabContent() { - Text($r('app.string.technology_content')) - .fontSize(30) - } - .tabBar($r('app.string.technology')) - } - } - .backgroundColor('#ffffc6d1') - .width('100%') - } - .tabBar($r('app.string.homepage')) - - TabContent() { - Text($r('app.string.recommend_content')) - .fontSize(30) - } - .backgroundColor(Color.Green) - .tabBar($r('app.string.recommend')) - - TabContent() { - Text($r('app.string.discover_content')) - .fontSize(30) - } - .backgroundColor(Color.Yellow) - .tabBar($r('app.string.discover')) - - TabContent() { - Text($r('app.string.mine_content')) - .fontSize(30) - } - .backgroundColor(Color.Orange) - .tabBar($r('app.string.mine')) - // [EndExclude swipe_locked_tab_bar] - } - // [StartExclude swipe_locked_tab_bar] - .height(500) - // [EndExclude swipe_locked_tab_bar] - .scrollable(false) - // [End swipe_locked_tab_bar] - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.SwipeLockedTabBar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/TabsLayout.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/TabsLayout.ets deleted file mode 100644 index 2ab0bde038280cc905ab9ff1b135dbf3d21deae8..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/TabsLayout.ets +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct TabsLayout { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.TabsLayout_titleExample') }) { - // [Start basic_layout_displays_many_contents] - Tabs() { - // [Start basic_layout_displays_one_content] - TabContent() { - Text($r('app.string.homepage_content')) - .fontSize(30) - } - .tabBar($r('app.string.homepage')) - // [End basic_layout_displays_one_content] - - TabContent() { - Text($r('app.string.recommend_content')) - .fontSize(30) - } - .tabBar($r('app.string.recommend')) - - TabContent() { - Text($r('app.string.discover_content')) - .fontSize(30) - } - .tabBar($r('app.string.discover')) - - TabContent() { - Text($r('app.string.mine_content')) - .fontSize(30) - } - .tabBar($r('app.string.mine')) - // [StartExclude basic_layout_displays_many_contents] - }.height(300) - // [EndExclude basic_layout_displays_many_contents] - } - // [End basic_layout_displays_many_contents] - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.TabsLayout_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/TopTabBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/TopTabBar.ets deleted file mode 100644 index ac40d162d18cf06d0ecfae41db5afd64839dd0b2..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/TopTabBar.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; - -@Entry -@Component -export struct TopTabBar { - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.TopTabBar_titleExample') }) { - // [Start top_navigation] - Tabs({ barPosition: BarPosition.Start }) { - // [StartExclude top_navigation] - TabContent() { - Text($r('app.string.FocusOn_content')) - .fontSize(30) - } - .backgroundColor(Color.Blue) - .tabBar($r('app.string.FocusOn')) - - TabContent() { - Text($r('app.string.video_content')) - .fontSize(30) - } - .backgroundColor(Color.Green) - .tabBar($r('app.string.video')) - - TabContent() { - Text($r('app.string.game_content')) - .fontSize(30) - } - .backgroundColor(Color.Yellow) - .tabBar($r('app.string.game')) - - TabContent() { - Text($r('app.string.digit_content')) - .fontSize(30) - } - .backgroundColor(Color.Orange) - .tabBar($r('app.string.digit')) - - TabContent() { - Text($r('app.string.technology_content')) - .fontSize(30) - } - .backgroundColor(Color.Pink) - .tabBar($r('app.string.technology')) - }.height(500) - // [EndExclude top_navigation] - } - // [End top_navigation] - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.TopTabBar_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/index.ets deleted file mode 100644 index b601f6080cca995f0b2a9c9f1acdb62245de2a22..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/index.ets +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2025 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 { AgeFriendlyTabs } from './AgeFriendlyTabs'; -import { BottomTabBar } from './BottomTabBar'; -import { CompletedRoutableCard } from '../../common/Card'; -import { ContentWillChange } from './ContentWillChange'; -import { CustomTabBar } from './CustomTabBar'; -import { FixedTabBar } from './FixedTabBar'; -import { Route } from '../../common/Route'; -import { ScrollableTabBar } from './ScrollableTabBar'; -import { SideTabBar } from './SideTabBar'; -import { SwipeLockedTabBar } from './SwipeLockedTabBar'; -import { TabsLayout } from './TabsLayout'; -import { TopTabBar } from './TopTabBar'; -import resource from '../../common/resource'; - -export const TABS_ROUTE_PREFIX: string = 'tabs'; - -const routes: Route[] = [ - { - name: `${TABS_ROUTE_PREFIX}/TabsLayout`, - title: resource.resourceToString($r('app.string.TabsLayout_title')), - description: $r('app.string.TabsLayout_description') - }, - { - name: `${TABS_ROUTE_PREFIX}/BottomTabBar`, - title: resource.resourceToString($r('app.string.BottomTabBar_title')), - description: $r('app.string.BottomTabBar_description') - }, - { - name: `${TABS_ROUTE_PREFIX}/TopTabBar`, - title: resource.resourceToString($r('app.string.TopTabBar_title')), - description: $r('app.string.TopTabBar_description') - }, - { - name: `${TABS_ROUTE_PREFIX}/SideTabBar`, - title: resource.resourceToString($r('app.string.SideTabBar_title')), - description: $r('app.string.SideTabBar_description') - }, - { - name: `${TABS_ROUTE_PREFIX}/SwipeLockedTabBar`, - title: resource.resourceToString($r('app.string.SwipeLockedTabBar_title')), - description: $r('app.string.SwipeLockedTabBar_description') - }, - { - name: `${TABS_ROUTE_PREFIX}/FixedTabBar`, - title: resource.resourceToString($r('app.string.FixedTabBar_title')), - description: $r('app.string.FixedTabBar_description') - }, - { - name: `${TABS_ROUTE_PREFIX}/ScrollableTabBar`, - title: resource.resourceToString($r('app.string.ScrollableTabBar_title')), - description: $r('app.string.ScrollableTabBar_description') - }, - { - name: `${TABS_ROUTE_PREFIX}/CustomTabBar`, - title: resource.resourceToString($r('app.string.CustomTabBar_title')), - description: $r('app.string.CustomTabBar_description') - }, - { - name: `${TABS_ROUTE_PREFIX}/ContentWillChange`, - title: resource.resourceToString($r('app.string.ContentWillChange_title')), - description: $r('app.string.ContentWillChange_description') - }, - { - name: `${TABS_ROUTE_PREFIX}/AgeFriendlyTabs`, - title: resource.resourceToString($r('app.string.AgeFriendlyTabs_title')), - description: $r('app.string.AgeFriendlyTabs_description') - } -]; - -@Builder -export function tabsDestination(name: string) { - if (name === TABS_ROUTE_PREFIX) { - TabsExample(); - } else if (name === routes[0].name) { - TabsLayout(); - } else if (name === routes[1].name) { - BottomTabBar(); - } else if (name === routes[2].name) { - TopTabBar(); - } else if (name === routes[3].name) { - SideTabBar(); - } else if (name === routes[4].name) { - SwipeLockedTabBar(); - } else if (name === routes[5].name) { - FixedTabBar(); - } else if (name === routes[6].name) { - ScrollableTabBar(); - } else if (name === routes[7].name) { - CustomTabBar(); - } else if (name === routes[8].name) { - ContentWillChange(); - } else if (name === routes[9].name) { - AgeFriendlyTabs(); - } -} - -@Entry -@Component -struct TabsExample { - @Consume pathStack: NavPathStack; - - build() { - NavDestination() { - List({ space: 12 }) { - ForEach(routes, (route: Route) => { - ListItem() { - CompletedRoutableCard({ title: route.title, description: route.description }) - } - .width('100%') - .onClick(() => { - this.pathStack.pushPath({ name: route.name }); - }) - }) - } - .contentStartOffset(56) - .padding({ left: 16, right: 16 }) - } - .backgroundColor('#f1f3f5') - .title('Tabs', { - backgroundBlurStyle: BlurStyle.COMPONENT_THICK, - barStyle: BarStyle.STACK - }) - } -} diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets deleted file mode 100644 index 3dfc468dab8a710c503ab4537d43e56fb5ce2bd0..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// 实现IDataSource接口的对象,用于瀑布流组件加载数据 -export class WaterFlowDataSource implements IDataSource { - private dataArray: number[] = []; - private listeners: DataChangeListener[] = []; - - constructor(count: number) { - for (let i = 0; i < count; i++) { - this.dataArray.push(i); - } - } - - // 获取索引对应的数据 - public getData(index: number): number { - return this.dataArray[index]; - } - - // 通知控制器数据重新加载 - notifyDataReload(): void { - this.listeners.forEach(listener => { - listener.onDataReloaded(); - }) - } - - // 通知控制器数据增加 - notifyDataAdd(index: number): void { - this.listeners.forEach(listener => { - listener.onDataAdd(index); - }) - } - - // 通知控制器数据变化 - notifyDataChange(index: number): void { - this.listeners.forEach(listener => { - listener.onDataChange(index); - }) - } - - // 通知控制器数据删除 - notifyDataDelete(index: number): void { - this.listeners.forEach(listener => { - listener.onDataDelete(index); - }) - } - - // 通知控制器数据位置变化 - notifyDataMove(from: number, to: number): void { - this.listeners.forEach(listener => { - listener.onDataMove(from, to); - }) - } - - // 获取数据总数 - public totalCount(): number { - return this.dataArray.length; - } - - // 注册改变数据的控制器 - registerDataChangeListener(listener: DataChangeListener): void { - if (this.listeners.indexOf(listener) < 0) { - this.listeners.push(listener); - } - } - - // 注销改变数据的控制器 - unregisterDataChangeListener(listener: DataChangeListener): void { - const pos = this.listeners.indexOf(listener) - if (pos >= 0) { - this.listeners.splice(pos, 1); - } - } - - // 增加数据 - public add1stItem(): void { - this.dataArray.splice(0, 0, this.dataArray.length); - this.notifyDataAdd(0); - } - - // 在数据尾部增加一个元素 - public addLastItem(): void { - this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length); - this.notifyDataAdd(this.dataArray.length - 1); - } - - public addNewItems(count: number): void { - for (let i = 0; i < count; i++) { - this.dataArray.push(this.dataArray.length); - this.notifyDataAdd(this.dataArray.length - 1); - } - } - - // 在指定索引位置增加一个元素 - public addItem(index: number): void { - this.dataArray.splice(index, 0, this.dataArray.length); - this.notifyDataAdd(index); - } - - // 删除第一个元素 - public delete1stItem(): void { - this.dataArray.splice(0, 1); - this.notifyDataDelete(0); - } - - // 删除第二个元素 - public delete2ndItem(): void { - this.dataArray.splice(1, 1); - this.notifyDataDelete(1); - } - - // 删除最后一个元素 - public deleteLastItem(): void { - this.dataArray.splice(-1, 1); - this.notifyDataDelete(this.dataArray.length); - } - - // 在指定索引位置增加一个元素 - public deleteItem(index: number): void { - this.dataArray.splice(index, 1); - this.notifyDataDelete(index); - } - - // 重新加载数据 - public reload(): void { - this.dataArray.splice(1, 1); - this.dataArray.splice(3, 2); - this.notifyDataReload(); - } -} diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDynamicSwitchover.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDynamicSwitchover.ets deleted file mode 100644 index 6c7ccb83c5a000e1af44dc02091fbe3b1475b9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDynamicSwitchover.ets +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; -import { WaterFlowDataSource } from './WaterFlowDataSource' -import { image } from '@kit.ImageKit'; - -@Reusable -@Component -struct ReusableFlowItem { - @State item: number = 0; - - // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 - aboutToReuse(params: Record) { - this.item = params.item; - } - - build() { - Column() { - Text('FlowItem' + this.item).fontSize(16).height('16') - Image('res/waterFlow(' + this.item % 5 + ').JPG') - .objectFit(ImageFit.Fill) - .width('100%') - .layoutWeight(1) - } - } -} - -@Reusable -@Component -struct ReusableListItem { - @State item: number = 0; - - aboutToReuse(params: Record) { - this.item = params.item; - } - - build() { - Row() { - Image('res/waterFlow(' + this.item % 5 + ').JPG') - .objectFit(ImageFit.Fill) - .height(100) - .aspectRatio(1) - Text('N' + this.item).fontSize(12).height('16').layoutWeight(1).textAlign(TextAlign.Center) - } - } -} - -@Entry -@Component -export struct WaterFlowDynamicSwitchover { - minSize: number = 80; - maxSize: number = 180; - colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; - dataSource: WaterFlowDataSource = new WaterFlowDataSource(100); - private itemWidthArray: number[] = []; - private itemHeightArray: number[] = []; - @State columns: number = 2; - @State waterflowScale: number = 1; - @State imageScale: number = 1; - @State waterFlowOpacity: number = 1; - @State waterflowSnapshot: image.PixelMap | undefined = undefined; - private columnChanged: boolean = false; - private oldColumn: number = this.columns; - private pinchTime: number = 0; - private gridItems: number[] = []; - - // 计算FlowItem宽/高 - getSize() { - let ret = Math.floor(Math.random() * this.maxSize); - return (ret > this.minSize ? ret : this.minSize); - } - - // 设置FlowItem的宽/高数组 - setItemSizeArray() { - for (let i = 0; i < 100; i++) { - this.itemWidthArray.push(this.getSize()); - this.itemHeightArray.push(this.getSize()); - } - } - - aboutToAppear() { - // 读取上次最后切换到到列数 - let lastCount = AppStorage.get('columnsCount'); - if (typeof lastCount != 'undefined') { - this.columns = lastCount; - } - this.setItemSizeArray(); - for (let i = 0; i < 15; ++i) { - this.gridItems.push(i); - } - } - - // 根据缩放阈值改变列数,触发WaterFlow重新布局 - changeColumns(scale: number) { - if (scale > (this.columns / (this.columns - 0.5)) && this.columns > 1) { - this.columns--; - this.columnChanged = true; - } else if (scale < 1 && this.columns < 4) { - this.columns++; - this.columnChanged = true; - } - } - - @Builder - itemFoot() { - Row() { - LoadingProgress() - .color(Color.Blue).height(50).aspectRatio(1).width('20%') - Text(`正在加载`) - .fontSize(20) - .width('30%') - .height(50) - .align(Alignment.Center) - .margin({ top: 2 }) - }.width('100%').justifyContent(FlexAlign.Center) - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.WaterFlowDynamicSwitchover_title') }) { - Column({ space: 2 }) { - Button('切换列数').fontSize(20).onClick(() => { - if (this.columns === 2) { - this.columns = 1; - } else { - this.columns = 2; - } - }) - WaterFlow({ layoutMode: WaterFlowLayoutMode.SLIDING_WINDOW }) { - LazyForEach(this.dataSource, (item: number) => { - FlowItem() { - if (this.columns === 1) { - ReusableListItem({ item: item }) - } else { - ReusableFlowItem({ item: item }) - } - } - .width('100%') - .aspectRatio(this.columns === 2 ? this.itemHeightArray[item % 100] / this.itemWidthArray[item % 100] : 0) - .backgroundColor(this.colors[item % 5]) - }, (item: string) => item) - } - .columnsTemplate('1fr '.repeat(this.columns)) - .backgroundColor(0xFAEEE0) - .width('100%') - .height('100%') - .layoutWeight(1) - // 即将触底时提前增加数据 - .onScrollIndex((first: number, last: number) => { - if (last + 20 >= this.dataSource.totalCount()) { - setTimeout(() => { - this.dataSource.addNewItems(100); - }, 1000); - } - }) - } - } - } - .width('100%') - .height('100%') - } - .backgroundColor('#f1f2f3') - .title($r('app.string.WaterFlowDynamicSwitchover_title')) - } -} diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowGroupingMixing.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowGroupingMixing.ets deleted file mode 100644 index 0f5fcc388c75a2ff187f8ffa7f5d49b1fd8b1488..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowGroupingMixing.ets +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; -import { WaterFlowDataSource } from './WaterFlowDataSource' -import { image } from '@kit.ImageKit'; - -@Reusable -@Component -struct ReusableFlowItem { - @State item: number = 0; - - // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 - aboutToReuse(params: Record) { - this.item = params.item; - } - - build() { - Stack({ alignContent: Alignment.Center }) { - Text('FlowItem' + this.item).fontSize(14).height('16') - Image('res/waterFlow (' + this.item % 5 + ').JPG') - .objectFit(ImageFit.Fill) - .width('100%') - .layoutWeight(1) - } - } -} - -@Entry -@Component -export struct WaterFlowGroupingMixing { - minSize: number = 80; - maxSize: number = 180; - colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; - dataSource: WaterFlowDataSource = new WaterFlowDataSource(100); - private itemWidthArray: number[] = []; - private itemHeightArray: number[] = []; - @State columns: number = 2; - @State waterflowScale: number = 1; - @State imageScale: number = 1; - @State waterFlowOpacity: number = 1; - @State waterflowSnapshot: image.PixelMap | undefined = undefined; - private columnChanged: boolean = false; - private oldColumn: number = this.columns; - private pinchTime: number = 0; - private gridItems: number[] = []; - - // 计算FlowItem宽/高 - getSize() { - let ret = Math.floor(Math.random() * this.maxSize); - return (ret > this.minSize ? ret : this.minSize); - } - - // 设置FlowItem的宽/高数组 - setItemSizeArray() { - for (let i = 0; i < 100; i++) { - this.itemWidthArray.push(this.getSize()); - this.itemHeightArray.push(this.getSize()); - } - } - - aboutToAppear() { - // 读取上次最后切换到到列数 - let lastCount = AppStorage.get('columnsCount'); - if (typeof lastCount != 'undefined') { - this.columns = lastCount; - } - this.setItemSizeArray(); - for (let i = 0; i < 15; ++i) { - this.gridItems.push(i); - } - } - - // 根据缩放阈值改变列数,触发WaterFlow重新布局 - changeColumns(scale: number) { - if (scale > (this.columns / (this.columns - 0.5)) && this.columns > 1) { - this.columns--; - this.columnChanged = true; - } else if (scale < 1 && this.columns < 4) { - this.columns++; - this.columnChanged = true; - } - } - - @Builder - itemFoot() { - Row() { - LoadingProgress() - .color(Color.Blue).height(50).aspectRatio(1).width('20%') - Text(`正在加载`) - .fontSize(20) - .width('30%') - .height(50) - .align(Alignment.Center) - .margin({ top: 2 }) - }.width('100%').justifyContent(FlexAlign.Center) - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.WaterFlowGroupingMixing_title') }) { - List({ space: 10 }) { - ListItem() { - Text('List').fontSize(14).height(16).margin(3) - } - - ListItem() { - Column() { - Text('Grid in ListItem').fontSize(12).height(16).margin(3) - - Grid() { - ForEach(this.gridItems, (day: number) => { - GridItem() { - Text('GridItem').fontSize(10).height(16) - }.backgroundColor(0xFFC0CB) - }, (day: number) => day.toString()) - } - .height('30%') - .rowsGap(5) - .columnsGap(5) - .columnsTemplate('1fr '.repeat(5)) - .rowsTemplate('1fr '.repeat(3)) - .width('95%') - }.borderWidth(3) - } - - ListItem() { - Column() { - Text('WaterFlow in ListItem').fontSize(14).height(16).margin(3) - WaterFlow({ layoutMode: WaterFlowLayoutMode.SLIDING_WINDOW }) { - LazyForEach(this.dataSource, (item: number) => { - FlowItem() { - ReusableFlowItem({ item: item }) - } - .width('100%') - .aspectRatio(this.columns === 2 ? this.itemHeightArray[item % 100] / this.itemWidthArray[item % 100] : 0) - .backgroundColor(this.colors[item % 5]) - }, (item: string) => item) - } - .columnsTemplate('1fr '.repeat(this.columns)) - .backgroundColor(0xFAEEE0) - .height('100%') - .layoutWeight(1) - // 即将触底时提前增加数据 - .onScrollIndex((first: number, last: number) => { - if (last + 20 >= this.dataSource.totalCount()) { - setTimeout(() => { - this.dataSource.addNewItems(100); - }, 1000) - } - }) - .width('95%') - }.borderWidth(3) - } - }.borderWidth(3) - .width('98%') - .alignListItem(ListItemAlign.Center).scrollBar(BarState.Off) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.WaterFlowGroupingMixing_title')) - } -} diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrolling.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrolling.ets deleted file mode 100644 index 090bdf39b81bc3ba995ca1617cc95492d8cdcb44..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrolling.ets +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; -import { WaterFlowDataSource } from './WaterFlowDataSource' -import { image } from '@kit.ImageKit'; - -@Reusable -@Component -struct ReusableFlowItem { - @State item: number = 0; - - // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 - aboutToReuse(params: Record) { - this.item = params.item; - } - - build() { - Column() { - Text('FlowItem' + this.item).fontSize(16).height('16') - Image('res/waterFlow(' + this.item % 5 + ').JPG') - .objectFit(ImageFit.Fill) - .width('100%') - .layoutWeight(1) - } - } -} - -@Entry -@Component -export struct WaterFlowInfiniteScrolling { - minSize: number = 80; - maxSize: number = 180; - colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; - dataSource: WaterFlowDataSource = new WaterFlowDataSource(100); - private itemWidthArray: number[] = []; - private itemHeightArray: number[] = []; - @State columns: number = 2; - @State waterflowScale: number = 1; - @State imageScale: number = 1; - @State waterFlowOpacity: number = 1; - @State waterflowSnapshot: image.PixelMap | undefined = undefined; - private columnChanged: boolean = false; - private oldColumn: number = this.columns; - private pinchTime: number = 0; - private gridItems: number[] = []; - - // 计算FlowItem宽/高 - getSize() { - let ret = Math.floor(Math.random() * this.maxSize); - return (ret > this.minSize ? ret : this.minSize); - } - - // 设置FlowItem的宽/高数组 - setItemSizeArray() { - for (let i = 0; i < 100; i++) { - this.itemWidthArray.push(this.getSize()); - this.itemHeightArray.push(this.getSize()); - } - } - - aboutToAppear() { - // 读取上次最后切换到到列数 - let lastCount = AppStorage.get('columnsCount'); - if (typeof lastCount != 'undefined') { - this.columns = lastCount; - } - this.setItemSizeArray(); - for (let i = 0; i < 15; ++i) { - this.gridItems.push(i); - } - } - - // 根据缩放阈值改变列数,触发WaterFlow重新布局 - changeColumns(scale: number) { - if (scale > (this.columns / (this.columns - 0.5)) && this.columns > 1) { - this.columns--; - this.columnChanged = true; - } else if (scale < 1 && this.columns < 4) { - this.columns++; - this.columnChanged = true; - } - } - - @Builder - itemFoot() { - Row() { - LoadingProgress() - .color(Color.Blue).height(50).aspectRatio(1).width('20%') - Text(`正在加载`) - .fontSize(20) - .width('30%') - .height(50) - .align(Alignment.Center) - .margin({ top: 2 }) - }.width('100%').justifyContent(FlexAlign.Center) - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.WaterFlowInfiniteScrolling_title') }) { - WaterFlow({ footer: this.itemFoot(), layoutMode: WaterFlowLayoutMode.SLIDING_WINDOW }) { - LazyForEach(this.dataSource, (item: number) => { - FlowItem() { - ReusableFlowItem({ item: item }) - } - .width('100%') - .aspectRatio(this.itemHeightArray[item % 100] / this.itemWidthArray[item%100]) - .backgroundColor(this.colors[item % 5]) - }, (item: string) => item) - } - .columnsTemplate('1fr '.repeat(this.columns)) - .backgroundColor(0xFAEEE0) - .width('100%') - .height('100%') - .layoutWeight(1) - // 触底加载数据 - .onReachEnd(() => { - setTimeout(() => { - for (let i = 0; i < 100; i++) { - this.dataSource.addLastItem(); - } - }, 1000) - }) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.WaterFlowInfiniteScrolling_title')) - } -} diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrollingEarly.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrollingEarly.ets deleted file mode 100644 index 162cb8e756fd1ce79512599c73e712d7ab1f0d1c..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrollingEarly.ets +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; -import { WaterFlowDataSource } from './WaterFlowDataSource' -import { image } from '@kit.ImageKit'; - -@Reusable -@Component -struct ReusableFlowItem { - @State item: number = 0; - - // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 - aboutToReuse(params: Record) { - this.item = params.item; - } - - build() { - Column() { - Text('FlowItem' + this.item).fontSize(16).height('16') - Image('res/waterFlow(' + this.item % 5 + ').JPG') - .objectFit(ImageFit.Fill) - .width('100%') - .layoutWeight(1) - } - } -} - -@Entry -@Component -export struct WaterFlowInfiniteScrollingEarly { - minSize: number = 80; - maxSize: number = 180; - colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; - dataSource: WaterFlowDataSource = new WaterFlowDataSource(100); - private itemWidthArray: number[] = []; - private itemHeightArray: number[] = []; - @State columns: number = 2; - @State waterflowScale: number = 1; - @State imageScale: number = 1; - @State waterFlowOpacity: number = 1; - @State waterflowSnapshot: image.PixelMap | undefined = undefined; - private columnChanged: boolean = false; - private oldColumn: number = this.columns; - private pinchTime: number = 0; - private gridItems: number[] = []; - - // 计算FlowItem宽/高 - getSize() { - let ret = Math.floor(Math.random() * this.maxSize); - return (ret > this.minSize ? ret : this.minSize); - } - - // 设置FlowItem的宽/高数组 - setItemSizeArray() { - for (let i = 0; i < 100; i++) { - this.itemWidthArray.push(this.getSize()); - this.itemHeightArray.push(this.getSize()); - } - } - - aboutToAppear() { - // 读取上次最后切换到到列数 - let lastCount = AppStorage.get('columnsCount'); - if (typeof lastCount != 'undefined') { - this.columns = lastCount; - } - this.setItemSizeArray(); - for (let i = 0; i < 15; ++i) { - this.gridItems.push(i); - } - } - - // 根据缩放阈值改变列数,触发WaterFlow重新布局 - changeColumns(scale: number) { - if (scale > (this.columns / (this.columns - 0.5)) && this.columns > 1) { - this.columns--; - this.columnChanged = true; - } else if (scale < 1 && this.columns < 4) { - this.columns++; - this.columnChanged = true; - } - } - - @Builder - itemFoot() { - Row() { - LoadingProgress() - .color(Color.Blue).height(50).aspectRatio(1).width('20%') - Text(`正在加载`) - .fontSize(20) - .width('30%') - .height(50) - .align(Alignment.Center) - .margin({ top: 2 }) - }.width('100%').justifyContent(FlexAlign.Center) - } - - build() { - NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.WaterFlowInfiniteScrollingEarly_title') }) { - WaterFlow({ layoutMode: WaterFlowLayoutMode.SLIDING_WINDOW }) { - LazyForEach(this.dataSource, (item: number) => { - FlowItem() { - ReusableFlowItem({ item: item }) - } - .width('100%') - .aspectRatio(this.itemHeightArray[item % 100] / this.itemWidthArray[item%100]) - .backgroundColor(this.colors[item % 5]) - }, (item: string) => item) - } - .columnsTemplate('1fr '.repeat(this.columns)) - .backgroundColor(0xFAEEE0) - .width('100%') - .height('100%') - .layoutWeight(1) - // 即将触底时提前增加数据 - .onScrollIndex((first: number, last: number) => { - if (last + 20 >= this.dataSource.totalCount()) { - setTimeout(() => { - this.dataSource.addNewItems(100); - }, 1000); - } - }) - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') - .title($r('app.string.WaterFlowInfiniteScrollingEarly_title')) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/index.ets deleted file mode 100644 index d7c2f53083ee3356cb30e453c41c0ed9b9b3bbfc..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/index.ets +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2025 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 { CompletedRoutableCard } from '../../common/Card'; -import { Route } from '../../common/Route'; -import { WaterFlowInfiniteScrolling } from './WaterFlowInfiniteScrolling'; -import { WaterFlowInfiniteScrollingEarly } from './WaterFlowInfiniteScrollingEarly'; -import { WaterFlowGroupingMixing } from './WaterFlowGroupingMixing'; -import { WaterFlowDynamicSwitchover } from './WaterFlowDynamicSwitchover'; -import resource from '../../common/resource'; - -export const WATERFLOW_ROUTE_PREFIX: string = 'waterFlow'; - -const routes: Route[] = [ - { - name: `${WATERFLOW_ROUTE_PREFIX}/WaterFlowInfiniteScrolling`, - title: resource.resourceToString($r('app.string.WaterFlowInfiniteScrolling_title')), - description: $r('app.string.WaterFlowInfiniteScrolling_description') - }, - { - name: `${WATERFLOW_ROUTE_PREFIX}/WaterFlowInfiniteScrollingEarly`, - title: resource.resourceToString($r('app.string.WaterFlowInfiniteScrollingEarly_title')), - description: $r('app.string.WaterFlowInfiniteScrollingEarly_description') - }, - { - name: `${WATERFLOW_ROUTE_PREFIX}/WaterFlowGroupingMixing`, - title: resource.resourceToString($r('app.string.WaterFlowGroupingMixing_title')), - description: $r('app.string.WaterFlowGroupingMixing_description') - }, - { - name: `${WATERFLOW_ROUTE_PREFIX}/WaterFlowDynamicSwitchover`, - title: resource.resourceToString($r('app.string.WaterFlowDynamicSwitchover_title')), - description: $r('app.string.WaterFlowDynamicSwitchover_description') - } - -]; - -@Builder -export function waterFlowDestination(name: string) { - if (name === WATERFLOW_ROUTE_PREFIX) { - WaterFlowExample(); - } else if (name === routes[0].name) { - WaterFlowInfiniteScrolling(); - } else if (name === routes[1].name) { - WaterFlowInfiniteScrollingEarly(); - } else if (name === routes[2].name) { - WaterFlowGroupingMixing(); - } else if (name === routes[3].name) { - WaterFlowDynamicSwitchover(); - } -} - -@Entry -@Component -struct WaterFlowExample { - @Consume pathStack: NavPathStack; - - build() { - NavDestination() { - List({ space: 12 }) { - ForEach(routes, (route: Route) => { - ListItem() { - CompletedRoutableCard({ title: route.title, description: route.description }) - } - .width('100%') - .onClick(() => { - this.pathStack.pushPath({ name: route.name }); - }) - }) - } - .contentStartOffset(56) - .padding({ left: 16, right: 16 }) - } - .backgroundColor('#f1f3f5') - .title('WaterFlow', { - backgroundBlurStyle: BlurStyle.COMPONENT_THICK, - barStyle: BarStyle.STACK - }) - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(0).JPG b/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(0).JPG deleted file mode 100644 index fc503bbffd260e135a6d1b8050ae8270b5b7b334..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(0).JPG and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(1).JPG b/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(1).JPG deleted file mode 100644 index 1085f839befca033a2687c554a47d535d589dc59..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(1).JPG and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(2).JPG b/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(2).JPG deleted file mode 100644 index 680348896f729a6b7d3860613403485a5a3090b7..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(2).JPG and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(3).JPG b/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(3).JPG deleted file mode 100644 index 0805dade041dc79b2dbc336f104fbaa8c86186e7..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(3).JPG and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(4).JPG b/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(4).JPG deleted file mode 100644 index 1ee3676323ab5637c00f5d486e72f5d6776e85a7..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(4).JPG and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(5).JPG b/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(5).JPG deleted file mode 100644 index f1488adf937caeaf3b70a6d43d5fb228e15e1d37..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/ets/res/waterFlow(5).JPG and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/module.json5 b/ArkUIKit/ScrollableComponent/entry/src/main/module.json5 deleted file mode 100644 index 4144486d1af4c03b0d767cce1cda86fc0d697f91..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/color.json b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/string.json b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f5f2e04b93c4c18a04876f8e02668d82e6862464..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,988 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "ScrollableComponent" - }, - { - "name": "pageIndex_List", - "value": "列表/List" - }, - { - "name": "pageIndex_ArcList", - "value": "弧形列表/ArcList" - }, - { - "name": "pageIndex_Grid", - "value": "网格/Grid" - }, - { - "name": "pageIndex_Swiper", - "value": "轮播/Swiper" - }, - { - "name": "pageIndex_ArcSwiper", - "value": "弧形轮播/ArcSwiper" - }, - { - "name": "pageIndex_Tabs", - "value": "选项卡/Tabs" - }, - { - "name": "GridLayout_title", - "value": "网格开发布局" - }, - { - "name": "GridLayout_titleRowSpacing", - "value": "设置行列数量占比和行间距示例" - }, - { - "name": "GridLayout_titleChildSpan", - "value": "设置子组件所占行列数示例" - }, - { - "name": "GridLayout_titleMainAxis", - "value": "设置主轴方向示例" - }, - { - "name": "GridLayout_description", - "value": "示例设置了网格中子组件行列数量占比、行列间距和主轴方向。" - }, - { - "name": "DataInGrid_title", - "value": "网格显示数据" - }, - { - "name": "DataInGrid_titleOfficeServices", - "value": "办公服务网格示例" - }, - { - "name": "DataInGrid_titleForEach", - "value": "办公服务网格ForEach语句示例" - }, - { - "name": "DataInGrid_description", - "value": "示例采用二维布局的方式组织其内部元素,显示通用办公服务网格。" - }, - { - "name": "ScrollableGrid_title", - "value": "可滚动的网格布局" - }, - { - "name": "ScrollableGrid_titleHorizontal", - "value": "横向可滚动网格布局示例" - }, - { - "name": "ScrollableGrid_description", - "value": "示例通过仅设置行、列数量与占比中的一个实现横向可滚动网格布局。" - }, - { - "name": "ScrollPosition_title", - "value": "控制滚动位置的网格布局" - }, - { - "name": "ScrollPosition_titleExample", - "value": "控制滚动位置示例" - }, - { - "name": "ScrollPosition_description", - "value": "示例通过添加Scroller对象的scrollPage方法,实现滚动网格布局翻页滚动的功能。" - }, - { - "name": "SwiperLoop_title", - "value": "循环播放" - }, - { - "name": "SwiperLoop_titleTrue", - "value": "循环播放loop为true的示例" - }, - { - "name": "SwiperLoop_titleFalse", - "value": "循环播放loop为false的示例" - }, - { - "name": "SwiperLoop_description", - "value": "通过设置loop属性控制是否循环播放。" - }, - { - "name": "SwiperAutoPlay_title", - "value": "自动轮播" - }, - { - "name": "SwiperAutoPlay_titleExample", - "value": "自动轮播示例" - }, - { - "name": "SwiperAutoPlay_description", - "value": "通过设置autoPlay属性控制是否自动轮播子组件。" - }, - { - "name": "SwiperIndicatorStyle_title", - "value": "自定义导航点样式" - }, - { - "name": "SwiperIndicatorStyle_titleDefault", - "value": "默认导航点样式示例" - }, - { - "name": "SwiperIndicatorStyle_titleCustom", - "value": "自定义导航点样式示例" - }, - { - "name": "SwiperIndicatorStyle_titleDefaultArrows", - "value": "默认箭头样式导航点样式示例" - }, - { - "name": "SwiperIndicatorStyle_titleCustomArrows", - "value": "自定义箭头样式导航点样式示例" - }, - { - "name": "SwiperIndicatorStyle_description", - "value": "通过indicator属性和displayArrow属性对导航点样式和导航点箭头样式进行设置。" - }, - { - "name": "SwiperPageSwitchMethod_title", - "value": "页面切换方式" - }, - { - "name": "SwiperPageSwitchMethod_titleHorizontal", - "value": "水平方向上轮播示例" - }, - { - "name": "SwiperPageSwitchMethod_titleVertical", - "value": "垂直方向上轮播示例" - }, - { - "name": "SwiperPageSwitchMethod_description", - "value": "Swiper支持手指滑动、点击导航点和通过控制器三种方式切换页面,示例展示通过控制器切换页面的方法。" - }, - { - "name": "SwiperDirection_title", - "value": "轮播方向" - }, - { - "name": "SwiperDirection_description", - "value": "Swiper支持水平和垂直方向上进行轮播,主要通过vertical属性控制。" - }, - { - "name": "SwiperMultiPage_title", - "value": "每页显示多个子页面" - }, - { - "name": "SwiperMultiPage_titleExample", - "value": "每页显示多个子页面示例" - }, - { - "name": "SwiperMultiPage_description", - "value": "Swiper支持在一个页面内同时显示多个子组件,通过displayCount属性设置。" - }, - { - "name": "SwiperCustomAnimation_title", - "value": "自定义切换动画" - }, - { - "name": "SwiperCustomAnimation_titleExample", - "value": "自定义切换动画示例" - }, - { - "name": "SwiperCustomAnimation_description", - "value": "Swiper支持通过customContentTransition设置自定义切换动画。" - }, - { - "name": "TabsLayout_title", - "value": "基本布局" - }, - { - "name": "TabsLayout_titleExample", - "value": "基本布局示例" - }, - { - "name": "TabsLayout_description", - "value": "示例展示Tabs组件页面组成的两个部分,分别是内容页TabContent和导航页签栏TabBar。" - }, - { - "name": "BottomTabBar_title", - "value": "底部导航" - }, - { - "name": "BottomTabBar_titleExample", - "value": "底部导航示例" - }, - { - "name": "homepage", - "value": "首页" - }, - { - "name": "homepage_content", - "value": "首页的内容" - }, - { - "name": "recommend", - "value": "推荐" - }, - { - "name": "recommend_content", - "value": "推荐的内容" - }, - { - "name": "discover", - "value": "发现" - }, - { - "name": "discover_content", - "value": "发现的内容" - }, - { - "name": "mine", - "value": "我的" - }, - { - "name": "mine_content", - "value": "我的内容" - }, - { - "name": "BottomTabBar_description", - "value": "示例展示导航页签栏TabBar在底部的情景。" - }, - { - "name": "TopTabBar_title", - "value": "顶部导航" - }, - { - "name": "TopTabBar_titleExample", - "value": "顶部导航示例" - }, - { - "name": "TopTabBar_description", - "value": "示例展示导航页签栏TabBar在顶部的情景。" - }, - { - "name": "SideTabBar_title", - "value": "侧边导航" - }, - { - "name": "SideTabBar_titleExample", - "value": "侧边导航示例" - }, - { - "name": "SideTabBar_description", - "value": "示例展示导航页签栏TabBar在侧边的情景。" - }, - { - "name": "SwipeLockedTabBar_title", - "value": "限制导航栏的滑动切换" - }, - { - "name": "SwipeLockedTabBar_titleExample", - "value": "限制导航栏的滑动切换示例" - }, - { - "name": "SwipeLockedTabBar_description", - "value": "示例展示在底部导航+顶部导航组合的情况下,限制底部导航栏滑动的情景。" - }, - { - "name": "FixedTabBar_title", - "value": "固定导航栏" - }, - { - "name": "FixedTabBar_titleExample", - "value": "固定导航栏示例" - }, - { - "name": "FixedTabBar_description", - "value": "示例展示底部导航内容分类一般固定,分类数量一般在3-5个,使用固定导航栏的情景。" - }, - { - "name": "ScrollableTabBar_title", - "value": "滚动导航栏" - }, - { - "name": "ScrollableTabBar_titleExample", - "value": "滚动导航栏示例" - }, - { - "name": "FocusOn_content", - "value": "关注的内容" - }, - { - "name": "game_content", - "value": "游戏的内容" - }, - { - "name": "digit_content", - "value": "数码的内容" - }, - { - "name": "technology_content", - "value": "科技的内容" - }, - { - "name": "sport_content", - "value": "体育的内容" - }, - { - "name": "film_content", - "value": "影视的内容" - }, - { - "name": "humanities_content", - "value": "人文的内容" - }, - { - "name": "FocusOn", - "value": "关注" - }, - { - "name": "game", - "value": "游戏" - }, - { - "name": "digit", - "value": "数码" - }, - { - "name": "technology", - "value": "科技" - }, - { - "name": "sport", - "value": "体育" - }, - { - "name": "film", - "value": "影视" - }, - { - "name": "humanities", - "value": "人文" - }, - { - "name": "ScrollableTabBar_description", - "value": "示例展示内容分类较多,屏幕宽度无法容纳所有分类页签的情况下,需要使用可滚动的导航栏的情景。" - }, - { - "name": "CustomTabBar_title", - "value": "自定义导航栏" - }, - { - "name": "CustomTabBar_titleExample", - "value": "自定义导航栏示例" - }, - { - "name": "internet_content", - "value": "网络的内容" - }, - { - "name": "album_content", - "value": "相册的内容" - }, - { - "name": "video_content", - "value": "视频的内容" - }, - { - "name": "more_content", - "value": "更多的内容" - }, - { - "name": "internet", - "value": "网络" - }, - { - "name": "album", - "value": "相册" - }, - { - "name": "video", - "value": "视频" - }, - { - "name": "more", - "value": "更多" - }, - { - "name": "CustomTabBar_description", - "value": "示例展示通过组合文字以及对应语义图标表示页签内容,自定义导航栏样式的情景。" - }, - { - "name": "ContentWillChange_title", - "value": "切换至指定页签" - }, - { - "name": "ContentWillChange_titleContentAndTabSync", - "value": "内容页和页签联动示例" - }, - { - "name": "ContentWillChange_titleSpecifiedTab", - "value": "切换指定页签示例" - }, - { - "name": "ContentWillChange_titleInterception", - "value": "支持开发者自定义页面切换拦截事件示例" - }, - { - "name": "ContentWillChange_changeIndex", - "value": "动态修改index" - }, - { - "name": "ContentWillChange_description", - "value": "示例展示使用了自定义导航栏后,自行实现页签切换逻辑。" - }, - { - "name": "AgeFriendlyTabs_title", - "value": "支持适老化" - }, - { - "name": "AgeFriendlyTabs_description", - "value": "示例展示在适老化大字体场景下,底部页签提供大字体弹窗显示内容。" - }, - { - "name": "ListLayout_title", - "value": "列表开发布局" - }, - { - "name": "ListLayout_titleMainAxis", - "value": "设置主轴方向布局" - }, - { - "name": "ListLayout_titleCrossAxisLanes", - "value": "设置交叉轴布局lanes属性" - }, - { - "name": "ListLayout_titleCrossAxisAlignment", - "value": "设置交叉轴布局alignListItem属性" - }, - { - "name": "ListLayout_description", - "value": "展示列表主轴和交叉轴布局的各种示例。" - }, - { - "name": "DataInList_title", - "value": "列表显示数据" - }, - { - "name": "DataInList_titlePage", - "value": "在列表中显示数据" - }, - { - "name": "DataInList_titleCityList", - "value": "城市列表示例" - }, - { - "name": "city_beijing", - "value": "北京" - }, - { - "name": "city_hangzhou", - "value": "杭州" - }, - { - "name": "city_shanghai", - "value": "上海" - }, - { - "name": "peopleOne", - "value": "小明" - }, - { - "name": "peopleTwo", - "value": "小红" - }, - { - "name": "DataInList_titleContactsList", - "value": "联系人列表示例" - }, - { - "name": "DataInList_description", - "value": "示例模拟显示城市列表,以及图片和文字一起显示的联系人列表。" - }, - { - "name": "ListIteration_title", - "value": "迭代列表内容" - }, - { - "name": "ListIteration_titleExample", - "value": "迭代列表内容示例" - }, - { - "name": "ListIteration_description", - "value": "示例通过数据集合动态地创建列表。" - }, - { - "name": "CustomListStyle_title", - "value": "自定义列表样式" - }, - { - "name": "CustomListStyle_titleContentSpacing", - "value": "设置内容间距" - }, - { - "name": "CustomListStyle_titleDividerLines", - "value": "添加分隔线" - }, - { - "name": "CustomListStyle_titleScrollbars", - "value": "添加滚动条" - }, - { - "name": "CustomListStyle_description", - "value": "示例通过属性自定义设置列表的内容间距、分隔线、滚动条等样式。" - }, - { - "name": "GroupedList_title", - "value": "支持分组列表" - }, - { - "name": "GroupedList_titleExample", - "value": "支持分组列表示例" - }, - { - "name": "GroupedList_description", - "value": "示例在列表中支持数据分组展示,可以使列表显示结构清晰,查找方便,从而提高使用效率。" - }, - { - "name": "StickyHeaderList_title", - "value": "添加粘性标题" - }, - { - "name": "StickyHeaderList_titleExample", - "value": "添加粘性标题示例" - }, - { - "name": "StickyHeaderList_description", - "value": "粘性标题常用于定位字母列表的头部元素,有助于阐明列表中数据的表示形式和用途,帮助用户进行数据定位。" - }, - { - "name": "ControlledScrollPositionList_title", - "value": "控制滚动位置" - }, - { - "name": "ControlledScrollPositionList_titleExample", - "value": "控制滚动位置示例" - }, - { - "name": "ControlledScrollPositionList_description", - "value": "当列表中新闻页列表项数量庞大时,可以快速滚动到列表底部或返回列表顶部。" - }, - { - "name": "ResponsiveScrollPositionList_title", - "value": "响应滚动位置" - }, - { - "name": "ResponsiveScrollPositionList_titleExample", - "value": "响应滚动位置示例" - }, - { - "name": "contacts_A_one", - "value": "艾佳" - }, - { - "name": "contacts_A_two", - "value": "安安" - }, - { - "name": "contacts_B_one", - "value": "白叶" - }, - { - "name": "contacts_B_two", - "value": "伯伯" - }, - { - "name": "contacts_B_three", - "value": "伯明" - }, - { - "name": "contacts_D_one", - "value": "大白" - }, - { - "name": "contacts_D_two", - "value": "大伯" - }, - { - "name": "contacts_D_three", - "value": "大明" - }, - { - "name": "contacts_F_one", - "value": "帆帆" - }, - { - "name": "contacts_F_two", - "value": "芳芳" - }, - { - "name": "contacts_G_one", - "value": "刚刚" - }, - { - "name": "contacts_G_two", - "value": "哥哥" - }, - { - "name": "contacts_H_one", - "value": "花花" - }, - { - "name": "contacts_H_two", - "value": "华华" - }, - { - "name": "contacts_H_three", - "value": "欢欢" - }, - { - "name": "contacts_X_one", - "value": "小李" - }, - { - "name": "contacts_X_two", - "value": "小王" - }, - { - "name": "contacts_X_three", - "value": "小张" - }, - { - "name": "ResponsiveScrollPositionList_description", - "value": "在联系人列表滚动时,如果跨越了不同字母开头的分组,则侧边字母索引栏也需要更新到对应的字母位置。" - }, - { - "name": "SwipeListItem_title", - "value": "响应列表项侧滑" - }, - { - "name": "SwipeListItem_titleExample", - "value": "响应列表项侧滑示例" - }, - { - "name": "SwipeListItem_description", - "value": "在消息列表中,给消息列表提供侧滑删除功能。" - }, - { - "name": "TaggedListItems_title", - "value": "给列表项添加标记" - }, - { - "name": "TaggedListItems_titleExample", - "value": "给列表项添加标记示例" - }, - { - "name": "TaggedListItems_description", - "value": "在消息列表中,给消息信息右上角添加标记。" - }, - { - "name": "AddListItem_title", - "value": "新增列表项" - }, - { - "name": "AddListItem_titleExample", - "value": "新增列表项示例" - }, - { - "name": "TodoItem", - "value": "待办" - }, - { - "name": "AddListItem_description", - "value": "在示例中击添加按钮,列表项内容选择或填写的交互界面,用户点击确定后,列表中新增对应的项目。" - }, - { - "name": "DeleteListItem_title", - "value": "删除列表项" - }, - { - "name": "DeleteListItem_titleExample", - "value": "删除列表项示例" - }, - { - "name": "DeleteListItem_description", - "value": "在示例中用户长按列表项进入删除模式,提供用户删除列表项选择的交互界面,勾选完成后点击删除按钮,列表中删除对应的项目。" - }, - { - "name": "pageIndex_WaterFlow", - "value": "创建瀑布流/WaterFlow" - }, - { - "name": "WaterFlowInfiniteScrolling_title", - "value": "无限滚动(到达末尾时新增数据)" - }, - { - "name": "WaterFlowInfiniteScrolling_description", - "value": "在瀑布流组件到达末尾位置时触发事件回调,增加新数据。" - }, - { - "name": "WaterFlowInfiniteScrollingEarly_title", - "value": "无限滚动(提前新增数据)" - }, - { - "name": "WaterFlowInfiniteScrollingEarly_description", - "value": "为了实现更加流畅的无限滑动,需要调整增加新数据的时机。可以在还剩余若干个数据未遍历的情况下提前加载新数据。" - }, - { - "name": "WaterFlowGroupingMixing_title", - "value": "分组混合布局" - }, - { - "name": "WaterFlowGroupingMixing_description", - "value": "许多应用界面在瀑布流上方包含其他内容,这类场景可通过在Scroll或List内部嵌套WaterFlow来实现。" - }, - { - "name": "WaterFlowDynamicSwitchover_title", - "value": "动态切换列数" - }, - { - "name": "WaterFlowDynamicSwitchover_description", - "value": "通过动态调整瀑布流的列数,应用能够实现在列表模式与瀑布流模式间的切换,或适应屏幕宽度的变化。" - }, - { - "name": "GridSideToSide_title", - "value": "控制滚动位置" - }, - { - "name": "GridSideToSide_description", - "value": "与新闻列表的返回顶部场景类似,控制滚动位置功能在网格布局中也很常用,例如下图所示日历的翻页功能。" - }, - { - "name": "GridScrollbar_title", - "value": "添加外置滚动条" - }, - { - "name": "GridScrollbar_description", - "value": "网格组件Grid可与ScrollBar组件配合使用,为网格添加外置滚动条。" - }, - { - "name": "ArcSwiperHorizontal_title", - "value": "水平方向轮播" - }, - { - "name": "ArcSwiperHorizontal_description", - "value": "设置水平方向上轮播。" - }, - { - "name": "ArcSwiperVertical_title", - "value": "垂直方向轮播" - }, - { - "name": "ArcSwiperVertical_description", - "value": "设置垂直方向轮播,导航点设为3点钟方向。。" - }, - { - "name": "ArcSwiperAction_title", - "value": "自定义切换动画" - }, - { - "name": "ArcSwiperAction_description", - "value": "ArcSwiper支持设置自定义切换动画,可以在回调中对视窗内所有页面逐帧设置透明度、缩放比例、位移、渲染层级等属性,从而实现自定义切换动画效果。" - }, - { - "name": "ArcSwiperSideSlip_title", - "value": "实现侧滑返回" - }, - { - "name": "ArcSwiperSideSlip_description", - "value": "ArcSwiper的滑动事件会与侧滑返回冲突,可以通过手势拦截去判断ArcSwiper是否滑动到开头去拦截ArcSwiper的滑动手势,实现再次左滑返回上一页的功能。" - }, - { - "name": "ArcSwiperStyles_title", - "value": "设置导航点样式" - }, - { - "name": "ArcSwiperStyles_titleDefault", - "value": "导航点使用默认样式" - }, - { - "name": "ArcSwiperStyles_titleCustomize", - "value": "自定义导航点样式" - }, - { - "name": "ArcSwiperStyles_description", - "value": "ArcSwiper提供了默认的弧形导航点样式,导航点默认显示在ArcSwiper下方居中位置,开发者也可以通过indicator属性自定义弧形导航点的样式。" - }, - { - "name": "ArcSwiperToggle_title", - "value": "控制页面切换方式" - }, - { - "name": "ArcSwiperToggle_description", - "value": "以下示例展示通过控制控制器和旋转表冠翻页的方法。" - }, - { - "name": "ArcListAcrScrollBar_title", - "value": "添加外置滚动条ArcScrollBar" - }, - { - "name": "ArcListAcrScrollBar_description", - "value": "弧形列表ArcList可与ArcScrollBar组件配合使用,为弧形列表添加外置滚动条。" - }, - { - "name": "ArcListArcIndexerBar_title", - "value": "与弧形索引条ArcAlphabetIndexer联动" - }, - { - "name": "ArcListArcIndexerBar_description", - "value": "许多应用需要监测列表的滚动位置变动并作出响应,或通过调整滚动位置实现列表的快速定位。为此,需使用弧形索引条组件ArcAlphabetIndexer。" - }, - { - "name": "arcListBuiltInScrollerBar_title", - "value": "添加内置滚动条" - }, - { - "name": "arcListBuiltInScrollerBar_description", - "value": "当列表项的高度超过屏幕高度时,弧形列表能够沿垂直方向滚动。" - }, - { - "name": "ArcListContents_title", - "value": "迭代弧形列表内容" - }, - { - "name": "ArcListContents_description", - "value": "通常,应用会通过数据集合动态创建列表。采用循环渲染的方式,可以从数据源中迭代获取数据,在每次迭代过程中创建相应的组件,从而降低代码的复杂度。" - }, - { - "name": "ArcListCrown_title", - "value": "响应旋转表冠" - }, - { - "name": "ArcListCrown_description", - "value": "手表设备上弧形列表在获焦的情况下可对旋转表冠做出响应,用户可通过旋转表冠的操作滑动列表,浏览列表项数据。" - }, - { - "name": "ArcListShow_title", - "value": "在弧形列表中显示数据" - }, - { - "name": "ArcListShow_description", - "value": "弧形列表视图垂直展示项目集合,当列表项超出屏幕范围时,提供滚动功能,这使得它非常适合展示大型数据集合。" - }, - { - "name": "ArcListSideSlip_title", - "value": "响应列表项侧滑" - }, - { - "name": "ArcListSideSlip_description", - "value": "ArcListItem的swipeAction属性可用于实现列表项的左右滑动功能。" - }, - { - "name": "ArcListStyles_head", - "value": "自定义弧形列表标题" - }, - { - "name": "ArcListStyles_title", - "value": "自定义弧形列表样式" - }, - { - "name": "ArcListStyles_titleSpacing", - "value": "自定义弧形列表项间距" - }, - { - "name": "ArcListStyles_titleScale", - "value": "列表项关闭自动缩放" - }, - { - "name": "ArcListStyles_description", - "value": "以下示例展示自定义弧形列表样式的方法。" - }, - { - "name": "LongList_title", - "value": "长列表的处理" - }, - { - "name": "LongList_description", - "value": "循环渲染适用于短列表,当构建具有大量列表项的长列表时,如果直接采用循环渲染方式,会一次性加载所有的列表元素,会导致页面启动时间过长,影响用户体验。因此,推荐使用数据懒加载(LazyForEach)方式实现按需迭代加载数据,从而提升列表性能。" - }, - { - "name": "CollapseAndExpand_title", - "value": "折叠与展开" - }, - { - "name": "CollapseAndExpand_description", - "value": "列表项的折叠与展开用途广泛,常用于信息清单的展示、填写等应用场景。" - }, - { - "name": "SwiperAndTabsLinkage_title", - "value": "Swiper与Tabs联动" - }, - { - "name": "SwiperAndTabsLinkage_description", - "value": "Swiper选中的元素改变时,会通过onSelected回调事件,将元素的索引值index返回。通过调用tabsController.changeIndex(index)方法来实现Tabs页签的切换。" - }, - { - "name": "SwiperIgnoreComponentSize_title", - "value": "设置圆点导航点间距和忽略导航点组件大小" - }, - { - "name": "SwiperIgnoreComponentSize_description", - "value": "针对圆点导航点,可以通过DotIndicator的space属性来设置圆点导航点的间距。当导航点的bottom设为0之后,导航点的底部与Swiper的底部还会有一定间距。如果希望消除该间距,可通过调用bottom(bottom, ignoreSize)属性来进行设置。" - }, - { - "name": "ArcLongList_title", - "value": "处理长列表" - }, - { - "name": "ArcLongList_description", - "value": "循环渲染适用于短列表,当构建具有大量列表项的长列表时,如果直接采用循环渲染方式,会一次性加载所有的列表元素,会导致页面启动时间过长,影响用户体验。因此,推荐使用数据懒加载(LazyForEach)方式实现按需迭代加载数据,从而提升列表性能。" - }, - { - "name": "ListChatRoom_title", - "value": "切换布局方向" - }, - { - "name": "ListChatRoom_description", - "value": "部分业务场景需要列表底部插入数据时,自动向上滚动,把新插入的节点展示出来。" - }, - { - "name": "LongGrid_title", - "value": "性能优化" - }, - { - "name": "LongGrid_description", - "value": "与长列表的处理类似,循环渲染适用于数据量较小的布局场景,当构建具有大量网格项的可滚动网格布局时,推荐使用数据懒加载方式实现按需迭代加载数据,从而提升列表性能。" - }, - { - "name": "GridCalculator_title", - "value": "计算器的按键布局" - }, - { - "name": "GridCalculator_description", - "value": "实现不同大小的网格组成不均匀分布的网格布局场景" - }, - { - "name": "ArcListCrown_set", - "value": "设置" - }, - { - "name": "ArcListStyles_waln", - "value": "WLAN" - }, - { - "name": "ArcListStyles_open", - "value": "已开启" - }, - { - "name": "ArcListStyles_blue", - "value": "蓝牙" - }, - { - "name": "ArcListStyles_net", - "value": "移动网络" - }, - { - "name": "ArcListStyles_connect", - "value": "更多连接" - }, - { - "name": "ArcListStyles_light", - "value": "显示和亮度" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/MaterialSymbolsDelete.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/MaterialSymbolsDelete.svg deleted file mode 100644 index 8f8348613dafc3fb1a1adbaa0f978bd3e9398fd7..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/MaterialSymbolsDelete.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/background.png b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/blueTooth.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/blueTooth.svg deleted file mode 100644 index 0fbcf2bd2720f8bc33ce34552ff07b0238523088..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/blueTooth.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - 编组 - - - - - - - - - - - - - \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/delete.png b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/delete.png deleted file mode 100644 index 1714478bde5bd46fa9856e0ebc06be459c4664f2..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/delete.png and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/displayAndBrightness.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/displayAndBrightness.svg deleted file mode 100644 index c19e018d71201ed17e239da5851bde5a9cfaf12a..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/displayAndBrightness.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - 编组 - - - - - - - - - - - - - \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_contact.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_contact.svg deleted file mode 100644 index 45128f1a45c7f70b96217f8a840eb6ca922f5e56..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_contact.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - 默认头像icon - - - - - - - - - - \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_settings_arrow.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_settings_arrow.svg deleted file mode 100644 index ff6293ce432d79ed6c50d61d430ee79fe2e2dad2..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_settings_arrow.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_settings_more_connections.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_settings_more_connections.svg deleted file mode 100644 index 7e654cf2401d3f4c5db1c971fcefb28af119ef2a..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_settings_more_connections.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - 更多连接 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_settings_wifi.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_settings_wifi.svg deleted file mode 100644 index 53dadba1d2dac8ca8b98697705edb004874404c5..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_settings_wifi.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - Artboard - - - - - - - - \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/mobileData.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/mobileData.svg deleted file mode 100644 index 3af781748dbcef004e85fc31d92da3175b21c6c1..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/mobileData.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - 编组 10 - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/wlan.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/wlan.svg deleted file mode 100644 index be12071bad8d8780bf172fb777cc7bf5c76e5a57..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/wlan.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - 编组 17 - - - - - - - - - - - - - \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/dark/element/color.json b/ArkUIKit/ScrollableComponent/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/mock/mock-config.json5 b/ArkUIKit/ScrollableComponent/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 7c16bc08c6fb53175fcdc9d628a4d6a9b34bef4c..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import IndexTest from './index.test'; - -export default function testsuite() { - abilityTest(); - IndexTest(); -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/index.test.ets b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/index.test.ets deleted file mode 100644 index 30b111830deafd1cbbb852db21fa483d02371daa..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/index.test.ets +++ /dev/null @@ -1,1324 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect, beforeAll } from '@ohos/hypium'; -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON, MouseButton,MatchPattern, UiDirection } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import { Point } from '@ohos.UiTest'; - - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -let want: Want; - -async function getResourceString(resource: Resource): Promise { - let manage = abilityDelegator.getAppContext().resourceManager; - let textString: string = await manage.getStringValue(resource); - return textString; -} - -export default function IndexTest() { - describe('IndexTest', () => { - beforeAll(async () => { - want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - }) - - /** - * @tc.number UiTest_001 - * @tc.name testControlledScrollPositionList - * @tc.desc 测试控制滚动位置示例 - */ - it('testControlledScrollPositionList', 0, async (done: Function) => { - console.info('uitest: testControlledScrollPositionList begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ControlledScrollPositionList_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let stackList = await driver.findComponent(ON.type('Stack')); - expect(stackList === null).assertFalse(); - let button = await driver.findComponent(ON.type('Button')); - expect(button === null).assertFalse(); - await stackList.scrollToBottom(2400); - await button.click(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testControlledScrollPositionList end'); - done(); - }) - - /** - * @tc.number UiTest_002 - * @tc.name testResponsiveScrollPositionList - * @tc.desc 测试响应滚动位置示例 - */ - it('testResponsiveScrollPositionList', 0, async (done: Function) => { - console.info('uitest: testResponsiveScrollPositionList begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ResponsiveScrollPositionList_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let stackList = await driver.findComponent(ON.type('Stack')); - expect(stackList === null).assertFalse(); - await stackList.scrollToBottom(2400); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testResponsiveScrollPositionList end'); - done(); - }) - - /** - * @tc.number UiTest_003 - * @tc.name testDataInList - * @tc.desc 测试列表显示数据示例 - */ - it('testDataInList', 0, async (done: Function) => { - console.info('uitest: testDataInList begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.DataInList_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - str = await getResourceString($r('app.string.peopleOne')); - let dataListText = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(dataListText === null).assertFalse(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testDataInList end'); - done(); - }) - - /** - * @tc.number UiTest_004 - * @tc.name testStickyHeaderList - * @tc.desc 测试添加粘性标题示例 - */ - it('testStickyHeaderList', 0, async (done: Function) => { - console.info('uitest: testStickyHeaderList begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.StickyHeaderList_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let stickyList = await driver.findComponent(ON.type('List')); - expect(stickyList === null).assertFalse(); - await stickyList.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testStickyHeaderList end'); - done(); - }) - - /** - * @tc.number UiTest_005 - * @tc.name testAddListItem - * @tc.desc 测试新增列表项示例 - */ - it('testAddListItem', 0, async (done: Function) => { - console.info('uitest: testAddListItem begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,17); - let str = await getResourceString($r('app.string.AddListItem_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let addButton = await driver.findComponent(ON.text('+', MatchPattern.CONTAINS)); - expect(addButton === null).assertFalse(); - await addButton.click(); - await driver.mouseClick({x: 580, y: 770}, MouseButton.MOUSE_BUTTON_LEFT, 0, 0); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testAddListItem end'); - done(); - }) - - /** - * @tc.number UiTest_006 - * @tc.name testDeleteListItem - * @tc.desc 测试删除列表项示例 - */ - it('testDeleteListItem', 0, async (done: Function) => { - console.info('uitest: testDeleteListItem begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,17); - let str = await getResourceString($r('app.string.DeleteListItem_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let addButton = await driver.findComponent(ON.text('+', MatchPattern.CONTAINS)); - expect(addButton === null).assertFalse(); - await addButton.click(); - await driver.mouseClick({x: 580, y: 770}, MouseButton.MOUSE_BUTTON_LEFT, 0, 0); - let listContent = await driver.findComponent(ON.text('Reading', MatchPattern.CONTAINS)); - expect(listContent === null).assertFalse(); - await listContent.longClick(); - let deleteButton = await driver.findComponent(ON.text('delete', MatchPattern.CONTAINS)); - expect(deleteButton === null).assertFalse(); - await deleteButton.click(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testDeleteListItem end'); - done(); - }) - - /** - * @tc.number UiTest_007 - * @tc.name testListLayout - * @tc.desc 测试列表开发布局示例 - */ - it('testListLayout', 0, async (done: Function) => { - console.info('uitest: testListLayout begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ListLayout_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let dataListText = await driver.findComponent(ON.text('ListItem one', MatchPattern.CONTAINS)); - expect(dataListText === null).assertFalse(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testListLayout end'); - done(); - }) - - /** - * @tc.number UiTest_008 - * @tc.name testGridScrollPosition - * @tc.desc 测试控制滚动位置的网格布局示例 - */ - it('testGridScrollPosition', 0, async (done: Function) => { - console.info('uitest: testGridScrollPosition begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ScrollPosition_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let buttonPrevious = await driver.findComponent(ON.text('Previous', MatchPattern.CONTAINS)); - let buttonNext = await driver.findComponent(ON.text('Next', MatchPattern.CONTAINS)); - expect(buttonPrevious === null).assertFalse(); - expect(buttonNext === null).assertFalse(); - await buttonNext.click(); - await buttonPrevious.click(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testGridScrollPosition end'); - done(); - }) - - /** - * @tc.number UiTest_009 - * @tc.name testGridScrollableGrid - * @tc.desc 测试可滚动的网格布局示例 - */ - it('testGridScrollableGrid', 0, async (done: Function) => { - console.info('uitest: testGridScrollableGrid begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ScrollableGrid_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let scrollableGrid = await driver.findComponent(ON.type('Grid')); - expect(scrollableGrid === null).assertFalse(); - await scrollableGrid.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testGridScrollableGrid end'); - done(); - }) - - /** - * @tc.number UiTest_010 - * @tc.name testSwiperAutoPlay - * @tc.desc 测试自动轮播示例 - */ - it('testSwiperAutoPlay', 0, async (done: Function) => { - console.info('uitest: testSwiperAutoPlay begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperAutoPlay_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testSwiperAutoPlay end'); - done(); - }) - - /** - * @tc.number UiTest_011 - * @tc.name testSwiperDirection - * @tc.desc 测试轮播方向示例 - */ - it('testSwiperDirection', 0, async (done: Function) => { - console.info('uitest: testSwiperCustomAnimation begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperDirection_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - let scrollPoint2:Point = {x:400,y:800}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.mouseScroll(scrollPoint2,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testSwiperCustomAnimation end'); - done(); - }) - - /** - * @tc.number UiTest_012 - * @tc.name testSwiperMultiPage - * @tc.desc 测试每页显示多个子页面示例 - */ - it('testSwiperMultiPage', 0, async (done: Function) => { - console.info('uitest: testSwiperMultiPage begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperMultiPage_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testSwiperMultiPage end'); - done(); - }) - - /** - * @tc.number UiTest_013 - * @tc.name testSwiperCustomAnimation - * @tc.desc 测试自定义切换动画示例 - */ - it('testSwiperCustomAnimation', 0, async (done: Function) => { - console.info('uitest: testSwiperCustomAnimation begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperCustomAnimation_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testSwiperCustomAnimation end'); - done(); - }) - - /** - * @tc.number UiTest_014 - * @tc.name testSwiperPageSwitchMethod - * @tc.desc 测试页面切换方式示例 - */ - it('testSwiperPageSwitchMethod', 0, async (done: Function) => { - console.info('uitest: testSwiperPageSwitchMethod begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperPageSwitchMethod_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let buttonPrevious = await driver.findComponent(ON.text('showPrevious', MatchPattern.CONTAINS)); - let buttonNext = await driver.findComponent(ON.text('showNext', MatchPattern.CONTAINS)); - expect(buttonPrevious === null).assertFalse(); - expect(buttonNext === null).assertFalse(); - await buttonNext.click(); - await buttonPrevious.click(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testSwiperPageSwitchMethod end'); - done(); - }) - - /** - * @tc.number UiTest_015 - * @tc.name testTabsLayout - * @tc.desc 测试基本布局示例 - */ - it('testTabsLayout', 0, async (done: Function) => { - console.info('uitest: testTabsLayout begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.TabsLayout_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testTabsLayout end'); - done(); - }) - - /** - * @tc.number UiTest_016 - * @tc.name testBottomTabBar - * @tc.desc 测试底部导航示例 - */ - it('testBottomTabBar', 0, async (done: Function) => { - console.info('uitest: testBottomTabBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.BottomTabBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testBottomTabBar end'); - done(); - }) - - /** - * @tc.number UiTest_017 - * @tc.name testTopTabBar - * @tc.desc 测试顶部导航示例 - */ - it('testTopTabBar', 0, async (done: Function) => { - console.info('uitest: testBottomTabBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.TopTabBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testBottomTabBar end'); - done(); - }) - - /** - * @tc.number UiTest_018 - * @tc.name testSideTabBar - * @tc.desc 测试侧边导航示例 - */ - it('testSideTabBar', 0, async (done: Function) => { - console.info('uitest: tesSideTabBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.SideTabBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,4); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: tesSideTabBar end'); - done(); - }) - - /** - * @tc.number UiTest_019 - * @tc.name testSwipeLockedTabBar - * @tc.desc 测试限制导航栏的滑动切换示例 - */ - it('testSwipeLockedTabBar', 0, async (done: Function) => { - console.info('uitest: testSwipeLockedTabBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.SwipeLockedTabBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,4); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testSwipeLockedTabBar end'); - done(); - }) - - /** - * @tc.number UiTest_020 - * @tc.name testFixedTabBar - * @tc.desc 测试固定导航栏示例 - */ - it('testFixedTabBar', 0, async (done: Function) => { - console.info('uitest: testFixedTabBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.FixedTabBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,4); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testFixedTabBar end'); - done(); - }) - - /** - * @tc.number UiTest_021 - * @tc.name testScrollableTabBar - * @tc.desc 测试滚动导航栏示例 - */ - it('testScrollableTabBar', 0, async (done: Function) => { - console.info('uitest: testScrollableTabBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ScrollableTabBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,12); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testScrollableTabBar end'); - done(); - }) - - /** - * @tc.number UiTest_022 - * @tc.name testCustomTabBar - * @tc.desc 测试自定义导航栏示例 - */ - it('testCustomTabBar', 0, async (done: Function) => { - console.info('uitest: testCustomTabBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.CustomTabBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,4); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testCustomTabBar end'); - done(); - }) - - /** - * @tc.number UiTest_023 - * @tc.name testArcSwiperAction - * @tc.desc 测试弧形轮播动画示例 - */ - it('ArcSwiperAction', 0, async (done: Function) => { - console.info('uitest: testSwiperCustomAnimation begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperAction_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcSwiperAction end'); - done(); - }) - - /** - * @tc.number UiTest_024 - * @tc.name testArcSwiperVertical - * @tc.desc 测试弧形轮播垂直方向示例 - */ - it('ArcSwiperVertical ', 0, async (done: Function) => { - console.info('uitest: testArcSwiperVertical begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperVertical_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcSwiperVertical end'); - done(); - }) - - /** - * @tc.number UiTest_025 - * @tc.name testArcSwiperHorizontal - * @tc.desc 测试弧形轮播水平方向示例 - */ - it('ArcSwiperHorizontal', 0, async (done: Function) => { - console.info('uitest: testArcSwiperHorizontal begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperHorizontal_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcSwiperHorizontal end'); - done(); - }) - - /** - * @tc.number UiTest_026 - * @tc.name testArcSwiperSideSlip - * @tc.desc 测试弧形轮播侧滑返回示例 - */ - it('ArcSwiperSideSlip', 0, async (done: Function) => { - console.info('uitest: testArcSwiperSideSlip begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperSideSlip_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.mouseScroll(scrollPoint,false,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcSwiperSideSlip end'); - done(); - }) - - /** - * @tc.number UiTest_027 - * @tc.name testArcSwiperToggle - * @tc.desc 测试弧形轮播页面切换方式示例 - */ - it('ArcSwiperToggle', 0, async (done: Function) => { - console.info('uitest: testArcSwiperToggle begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperToggle_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let preArcButton = await driver.findComponent(ON.text('previous', MatchPattern.CONTAINS)); - let nextArcButton = await driver.findComponent(ON.text('next', MatchPattern.CONTAINS)); - expect(preArcButton === null).assertFalse(); - expect(nextArcButton === null).assertFalse(); - await nextArcButton.click(); - await preArcButton.click(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcSwiperToggle end'); - done(); - }) - - /** - * @tc.number UiTest_028 - * @tc.name testArcSwiperStyles - * @tc.desc 测试弧形轮播设置导航点样式示例 - */ - it('ArcSwiperStyles', 0, async (done: Function) => { - console.info('uitest: testArcSwiperToggle begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperStyles_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - let scrollPoint2:Point = {x:300,y:600}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.mouseScroll(scrollPoint2,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcSwiperStyles end'); - done(); - }) - - /** - * @tc.number UiTest_029 - * @tc.name testSwiperAndTabsLinkage - * @tc.desc 测试轮播与选项卡联动示例 - */ - it('SwiperAndTabsLinkage', 0, async (done: Function) => { - console.info('uitest: testSwiperAndTabsLinkage begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperAndTabsLinkage_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:500}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testSwiperAndTabsLinkage end'); - done(); - }) - - /** - * @tc.number UiTest_030 - * @tc.name testLongGrid - * @tc.desc 测试网格性能优化示例 - */ - it('LongGrid', 0, async (done: Function) => { - console.info('uitest: testLongGrid begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.LongGrid_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let scrollableGrid = await driver.findComponent(ON.type('Grid')); - expect(scrollableGrid === null).assertFalse(); - await scrollableGrid.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testLongGrid end'); - done(); - }) - - /** - * @tc.number UiTest_031 - * @tc.name testGridScrollbar - * @tc.desc 测试网格添加外置滚动条示例 - */ - it('GridScrollbar', 0, async (done: Function) => { - console.info('uitest: testGridScrollbar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.GridScrollbar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let scrollableGrid = await driver.findComponent(ON.type('Grid')); - expect(scrollableGrid === null).assertFalse(); - await scrollableGrid.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testGridScrollbar end'); - done(); - }) - - /** - * @tc.number UiTest_032 - * @tc.name testGridSideToSide - * @tc.desc 测试网格控制滚动位置示例 - */ - it('GridSideToSide', 0, async (done: Function) => { - console.info('uitest: testGridSideToSide begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.GridSideToSide_description')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let preArcButton = await driver.findComponent(ON.text('上一页', MatchPattern.CONTAINS)); - let nextArcButton = await driver.findComponent(ON.text('下一页', MatchPattern.CONTAINS)); - expect(preArcButton === null).assertFalse(); - expect(nextArcButton === null).assertFalse(); - await nextArcButton.click(); - await preArcButton.click(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testGridSideToSide end'); - done(); - }) - - /** - * @tc.number UiTest_033 - * @tc.name testLongList - * @tc.desc 测试长列表示例 - */ - it('LongList', 0, async (done: Function) => { - console.info('uitest: testLongList begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let list = await driver.findComponent(ON.type('List')); - expect(list === null).assertFalse(); - await list.scrollToBottom(1000); - let str = await getResourceString($r('app.string.LongList_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let scrollableList = await driver.findComponent(ON.type('List')); - expect(scrollableList === null).assertFalse(); - await scrollableList.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testLongList end'); - done(); - }) - - /** - * @tc.number UiTest_033 - * @tc.name testCollapseAndExpand - * @tc.desc 测试列表折叠与展开示例 - */ - it('CollapseAndExpand', 0, async (done: Function) => { - console.info('uitest: testCollapseAndExpand begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let list = await driver.findComponent(ON.type('List')); - expect(list === null).assertFalse(); - await list.scrollToBottom(1000); - let str = await getResourceString($r('app.string.CollapseAndExpand_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let text = await driver.findComponent(ON.text('个人基本资料', MatchPattern.CONTAINS)); - expect(text === null).assertFalse(); - await text.click(); - let nameText = await driver.findComponent(ON.text('昵称', MatchPattern.CONTAINS)); - expect(nameText === null).assertFalse(); - await text.click(); - nameText = await driver.findComponent(ON.text('昵称', MatchPattern.CONTAINS)); - expect(nameText === null).assertTrue(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testCollapseAndExpand end'); - done(); - }) - - /** - * @tc.number UiTest_035 - * @tc.name testArcLongList - * @tc.desc 测试弧形长列表示例 - */ - it('ArcLongList', 0, async (done: Function) => { - console.info('uitest: testArcLongList begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcLongList_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(15000); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcLongList end'); - done(); - }) - - /** - * @tc.number UiTest_036 - * @tc.name testArcListAcrScrollBar - * @tc.desc 测试弧形列表外置滚动条示例 - */ - it('ArcListAcrScrollBar', 0, async (done: Function) => { - console.info('uitest: testArcListAcrScrollBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListAcrScrollBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcListAcrScrollBar end'); - done(); - }) - - /** - * @tc.number UiTest_037 - * @tc.name testArcListBuiltInScrollerBar - * @tc.desc 测试弧形列表内置滚动条示例 - */ - it('arcListBuiltInScrollerBar', 0, async (done: Function) => { - console.info('uitest: testArcListBuiltInScrollerBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.arcListBuiltInScrollerBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcListBuiltInScrollerBar end'); - done(); - }) - - /** - * @tc.number UiTest_038 - * @tc.name testArcListContents - * @tc.desc 测试弧形列表内置滚动条示例 - */ - it('ArcListContents', 0, async (done: Function) => { - console.info('uitest: testArcListContents begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListContents_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcListContents end'); - done(); - }) - - /** - * @tc.number UiTest_039 - * @tc.name testArcListShow - * @tc.desc 测试弧形列表展示数据示例 - */ - it('ArcListShow', 0, async (done: Function) => { - console.info('uitest: testArcListShow begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListShow_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcListShow end'); - done(); - }) - - /** - * @tc.number UiTest_040 - * @tc.name testArcListStyles - * @tc.desc 测试弧形列表设置样式示例 - */ - it('ArcListStyles', 0, async (done: Function) => { - console.info('uitest: testArcListStyles begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListStyles_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('List')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcListStyles end'); - done(); - }) - - /** - * @tc.number UiTest_041 - * @tc.name testArcListArcIndexerBar - * @tc.desc 测试弧形列表联动indexer示例 - */ - it('ArcListArcIndexerBar', 0, async (done: Function) => { - console.info('uitest: testArcListArcIndexerBar begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListArcIndexerBar_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let button = await driver.findComponent(ON.type('Button')); - expect(button === null).assertFalse(); - await button.click(); - let testText = await driver.findComponent(ON.text('F', MatchPattern.CONTAINS)); - expect(testText === null).assertFalse(); - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(5000); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcListArcIndexerBar end'); - done(); - }) - - /** - * @tc.number UiTest_042 - * @tc.name testArcListSideSlip - * @tc.desc 测试弧形列表侧滑示例 - */ - it('ArcListSideSlip', 0, async (done: Function) => { - console.info('uitest: testArcListSideSlip begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListSideSlip_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - let scrollPoint:Point = {x:200,y:500}; - let scrollPoint2:Point = {x:500,y:500}; - - await driver.fling(scrollPoint2,scrollPoint,1,600); - let button = await driver.findComponent(ON.type('Button')); - expect(button === null).assertFalse(); - await button.click(); - let testText = await driver.findComponent(ON.text('Alice', MatchPattern.CONTAINS)); - expect(testText === null).assertTrue(); - await arclist.scrollToBottom(5000); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testArcListSideSlip end'); - done(); - }) - - /** - * @tc.number UiTest_043 - * @tc.name testWaterFlowDynamicSwitchover - * @tc.desc 测试瀑布流动态切换列数示例 - */ - it('WaterFlowDynamicSwitchover', 0, async (done: Function) => { - console.info('uitest: testWaterFlowDynamicSwitchover begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.WaterFlowDynamicSwitchover_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('WaterFlow')); - expect(arclist === null).assertFalse(); - let flowItemText = await driver.findComponent(ON.text('FlowItem0', MatchPattern.CONTAINS)); - expect(flowItemText === null).assertFalse(); - let scrollPoint:Point = {x:350,y:1100}; - let scrollPoint2:Point = {x:350,y:550}; - await driver.fling(scrollPoint,scrollPoint2,1,1200); - let button = await driver.findComponent(ON.type('Button')); - expect(button === null).assertFalse(); - await button.click(); - let testText = await driver.findComponent(ON.text('N9', MatchPattern.CONTAINS)); - expect(testText === null).assertFalse(); - await driver.fling(scrollPoint,scrollPoint2,1,1200); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testWaterFlowDynamicSwitchover end'); - done(); - }) - - /** - * @tc.number UiTest_044 - * @tc.name testWaterFlowGroupingMixing - * @tc.desc 测试瀑布流混合布局示例 - */ - it('WaterFlowGroupingMixing', 0, async (done: Function) => { - console.info('uitest: testWaterFlowGroupingMixing begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.WaterFlowGroupingMixing_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('WaterFlow')); - expect(arclist === null).assertFalse(); - let scrollPoint:Point = {x:350,y:1100}; - let scrollPoint2:Point = {x:350,y:550}; - await driver.fling(scrollPoint,scrollPoint2,1,1200); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testWaterFlowGroupingMixing end'); - done(); - }) - - /** - * @tc.number UiTest_045 - * @tc.name testWaterFlowInfiniteScrolling - * @tc.desc 测试瀑布流无限滑动触底增加示例 - */ - it('WaterFlowInfiniteScrolling', 0, async (done: Function) => { - console.info('uitest: testWaterFlowInfiniteScrolling begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.WaterFlowInfiniteScrolling_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('WaterFlow')); - expect(arclist === null).assertFalse(); - let scrollPoint:Point = {x:350,y:1100}; - let scrollPoint2:Point = {x:350,y:550}; - await driver.fling(scrollPoint,scrollPoint2,1,1200); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testWaterFlowInfiniteScrolling end'); - done(); - }) - - /** - * @tc.number UiTest_046 - * @tc.name testWaterFlowInfiniteScrollingEarly - * @tc.desc 测试瀑布流无限滑动提前增加示例 - */ - it('WaterFlowInfiniteScrollingEarly', 0, async (done: Function) => { - console.info('uitest: testWaterFlowInfiniteScrollingEarly begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let str = await getResourceString($r('app.string.WaterFlowInfiniteScrollingEarly_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let arclist = await driver.findComponent(ON.type('WaterFlow')); - expect(arclist === null).assertFalse(); - let scrollPoint:Point = {x:350,y:1100}; - let scrollPoint2:Point = {x:350,y:550}; - await driver.fling(scrollPoint,scrollPoint2,1,1200); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testWaterFlowInfiniteScrollingEarly end'); - done(); - }) - - /** - * @tc.number UiTest_034 - * @tc.name testListChatRoom - * @tc.desc 测试列表切换布局方向示例 - */ - it('ListChatRoom', 0, async (done: Function) => { - console.info('uitest: testListChatRoom begin'); - let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); - expect(componentButton === null).assertFalse(); - await componentButton.click(); - let list = await driver.findComponent(ON.type('List')); - expect(list === null).assertFalse(); - await list.scrollToBottom(1000); - let str = await getResourceString($r('app.string.ListChatRoom_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); - - let textInput = await driver.findComponent(ON.type('TextInput')); - expect(textInput === null).assertFalse(); - await textInput.inputText("message test") - let testButton = await driver.findComponent(ON.text('发送', MatchPattern.CONTAINS)); - expect(testButton === null).assertFalse(); - await testButton.click(); - await driver.mouseClick({x: 670, y: 700}, MouseButton.MOUSE_BUTTON_LEFT, 0, 0); - let nameText = await driver.findComponent(ON.text('message test', MatchPattern.CONTAINS)); - expect(nameText === null).assertFalse(); - await driver.pressBack(); - await driver.pressBack(); - console.info('uitest: testListChatRoom end'); - done(); - }) - - }) -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/module.json5 b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/ScrollableComponent/entry/src/test/List.test.ets b/ArkUIKit/ScrollableComponent/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/test/LocalUnit.test.ets b/ArkUIKit/ScrollableComponent/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/hvigor/hvigor-config.json5 b/ArkUIKit/ScrollableComponent/hvigor/hvigor-config.json5 deleted file mode 100644 index d584c19c247db9a7caee4b606bb931aa9279c637..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/ArkUIKit/ScrollableComponent/hvigorfile.ts b/ArkUIKit/ScrollableComponent/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/ScrollableComponent/oh-package.json5 b/ArkUIKit/ScrollableComponent/oh-package.json5 deleted file mode 100644 index e41bae026aab3b50d0abb42fece08ba43b4a772b..0000000000000000000000000000000000000000 --- a/ArkUIKit/ScrollableComponent/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/ScrollableComponent/screenshots/device/image1.png b/ArkUIKit/ScrollableComponent/screenshots/device/image1.png deleted file mode 100644 index 405d7c9a85730a32a35eb1e90e09dfed55114733..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/screenshots/device/image1.png and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/screenshots/device/image2.png b/ArkUIKit/ScrollableComponent/screenshots/device/image2.png deleted file mode 100644 index 7bb783a24ecd950f7ba8e45d4b12d7905cff9e90..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/screenshots/device/image2.png and /dev/null differ diff --git a/ArkUIKit/ScrollableComponent/screenshots/device/image3.png b/ArkUIKit/ScrollableComponent/screenshots/device/image3.png deleted file mode 100644 index 29676689f850c442159c7371319a739a126bb945..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/ScrollableComponent/screenshots/device/image3.png and /dev/null differ diff --git a/ArkUIKit/StyledStringNDK/.gitignore b/ArkUIKit/StyledStringNDK/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/StyledStringNDK/AppScope/app.json5 b/ArkUIKit/StyledStringNDK/AppScope/app.json5 deleted file mode 100644 index 4c8b1e9ec79061d360249563d9a250548cc05c31..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.styledstringndk", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/StyledStringNDK/AppScope/resources/base/element/string.json b/ArkUIKit/StyledStringNDK/AppScope/resources/base/element/string.json deleted file mode 100644 index 0edf05d24f2ca0e69a966f00825600f3d9474df8..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "StyledStringNDK" - } - ] -} diff --git a/ArkUIKit/StyledStringNDK/AppScope/resources/base/media/background.png b/ArkUIKit/StyledStringNDK/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringNDK/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/StyledStringNDK/AppScope/resources/base/media/foreground.png b/ArkUIKit/StyledStringNDK/AppScope/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringNDK/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/StyledStringNDK/AppScope/resources/base/media/layered_image.json b/ArkUIKit/StyledStringNDK/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/README.md b/ArkUIKit/StyledStringNDK/README.md deleted file mode 100644 index 041551c62ba7d62271332313678678076ae0b5e6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# StyledStringNDK - -## 介绍 - -本示例为使用NDK接口构建UI->使用文本->[Text组件的文本绘制与显示](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/ndk-styled-string.md)的配套示例工程。 - -本示例展示了如何创建文本以及设置文本样式。 - -## 效果预览 - -| 预览 | -| -------------------------------------------- | - - -## 使用说明 -1. 安装编译生成的hap包,并打开应用; -2. 查看创建好的文本以及相应的文本样式; - - -## 工程目录 - -``` -StyledStringNDK -entry/src/main/ets/ -└── pages - └── Index.ets (获取文本界面) -entry/src/main/ -├── cpp -│ ├── types -│ │ └── libentry -│ │ └── Index.d.ts (NDK函数对应的js映射) -│ ├── CMakeLists.txt (CMake脚本) -| ├── manager.cpp (创建文本实现CPP文件) -| ├── manager.h -│ └── napi_init.cpp (NDK函数) -└── resources - ├── base - │ ├── element - │ │ ├── color.json - │ │ ├── float.json - │ │ └── string.json - │ └── media -``` - -## 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束和限制 - -1. 本示例支持仅标准系统上运行,支持设备:华为手机、华为平板。 - -2. HarmonyOS系统:HarmonyOS 6.0.0 Beta3版本及以上。 - -3. DevEco Studio版本:DevEco Studio 6.0.0 Beta3版本及以上。 - -4. HarmonyOS SDK版本:HarmonyOS 6.0.0 Beta3 SDK版本及以上。 - -## 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo ArkUIKit/StyledStringNDK > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/build-profile.json5 b/ArkUIKit/StyledStringNDK/build-profile.json5 deleted file mode 100644 index d4774ea1bd3391ce237ba9dcefe45f7061f99929..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/build-profile.json5 +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/code-linter.json5 b/ArkUIKit/StyledStringNDK/code-linter.json5 deleted file mode 100644 index 5c4682f8164874ec7e9cb8f99ff8b3228ffbc126..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/code-linter.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/.gitignore b/ArkUIKit/StyledStringNDK/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/build-profile.json5 b/ArkUIKit/StyledStringNDK/entry/build-profile.json5 deleted file mode 100644 index 9b5904523a7e5027acf6469ed9bb91003daf0237..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/build-profile.json5 +++ /dev/null @@ -1,40 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/hvigorfile.ts b/ArkUIKit/StyledStringNDK/entry/hvigorfile.ts deleted file mode 100644 index 8774588471ede4c1563f09d9a1d22f764bb1fd9e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/StyledStringNDK/entry/obfuscation-rules.txt b/ArkUIKit/StyledStringNDK/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/StyledStringNDK/entry/oh-package.json5 b/ArkUIKit/StyledStringNDK/entry/oh-package.json5 deleted file mode 100644 index 5b21e253af246edab8b6ef4f10938f4417e8bc25..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/StyledStringNDK/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 561706bbd6da1cc6e9f797531413d3588a04cac3..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(CApi2) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -find_library( - libace-lib - ace_ndk.z -) - -add_library(entry SHARED napi_init.cpp manager.cpp) -target_link_libraries(entry PUBLIC ${libace-lib} libace_napi.z.so libnative_drawing.so libhilog_ndk.z.so) \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/manager.cpp b/ArkUIKit/StyledStringNDK/entry/src/main/cpp/manager.cpp deleted file mode 100644 index e281e0537b4a68b48b5820f242b35ea450db2c4f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "manager.h" -#include -#include -#include -#include - -namespace NativeNode::Manager { -constexpr int32_t NUM_10 = 10; -constexpr int32_t NUM_28 = 28; -constexpr int32_t NUM_400 = 400; -NodeManager &NodeManager::GetInstance() -{ - static NodeManager instance; - return instance; -} - -void NodeManager::SetContentHandle(ArkUI_NodeContentHandle contentHandle) { contentHandle_ = contentHandle; } - -void NodeManager::CreateNativeNode() -{ - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - // 创建一个Column容器组件 - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = 300}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - // 创建Text组件 - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = 300}}; - ArkUI_AttributeItem textWidthItem = {.value = textWidth, .size = 1}; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = 100}}; - ArkUI_AttributeItem textHeightItem = {.value = textHeight, .size = 1}; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - ArkUI_NumberValue borderWidth[] = {{.f32 = 1}}; - ArkUI_AttributeItem borderWidthItem = {.value = borderWidth, .size = 1}; - nodeApi->setAttribute(text, NODE_BORDER_WIDTH, &borderWidthItem); - - // OH_Drawing_开头的API是字体引擎提供的,typographyStyle表示段落样式。 - OH_Drawing_TypographyStyle *typographyStyle = OH_Drawing_CreateTypographyStyle(); - OH_Drawing_SetTypographyTextAlign(typographyStyle, OH_Drawing_TextAlign::TEXT_ALIGN_CENTER); - OH_Drawing_SetTypographyTextMaxLines(typographyStyle, NUM_10); - // 创建 ArkUI_StyledString。 - ArkUI_StyledString *styledString = OH_ArkUI_StyledString_Create(typographyStyle, OH_Drawing_CreateFontCollection()); - // 创建文本样式,设置字体和颜色。 - OH_Drawing_TextStyle *textStyle = OH_Drawing_CreateTextStyle(); - OH_Drawing_SetTextStyleFontSize(textStyle, NUM_28); - OH_Drawing_SetTextStyleColor(textStyle, OH_Drawing_ColorSetArgb(0xFF, 0x70, 0x70, 0x70)); - // 文本样式的设置顺序push -> add -> pop. - OH_ArkUI_StyledString_PushTextStyle(styledString, textStyle); - OH_ArkUI_StyledString_AddText(styledString, "Hello"); - OH_ArkUI_StyledString_PopTextStyle(styledString); - // 添加占位,此区域内不会绘制文字,可以在此位置挂载Image组件实现图文混排。 - OH_Drawing_PlaceholderSpan placeHolder{.width = 100, .height = 100}; - OH_ArkUI_StyledString_AddPlaceholder(styledString, &placeHolder); - // 设置不同样式的文字 - OH_Drawing_TextStyle *worldTextStyle = OH_Drawing_CreateTextStyle(); - OH_Drawing_SetTextStyleFontSize(worldTextStyle, NUM_28); - OH_Drawing_SetTextStyleColor(worldTextStyle, OH_Drawing_ColorSetArgb(0xFF, 0x27, 0x87, 0xD9)); - OH_ArkUI_StyledString_PushTextStyle(styledString, worldTextStyle); - OH_ArkUI_StyledString_AddText(styledString, "World!"); - OH_ArkUI_StyledString_PopTextStyle(styledString); - // 依赖StyledString对象创建字体引擎的Typography,此时它已经包含了设置的文本及其样式。 - OH_Drawing_Typography *typography = OH_ArkUI_StyledString_CreateTypography(styledString); - // 字体引擎布局方法,需传入一个宽度,此宽度需与Text组件宽度匹配。 - // 布局宽度 = Text组件宽度 - (左padding + 右padding) - OH_Drawing_TypographyLayout(typography, NUM_400); - ArkUI_AttributeItem styledStringItem = {.object = styledString}; - // 布局完成后,通过NODE_TEXT_CONTENT_WITH_STYLED_STRING设置给Text组件。 - nodeApi->setAttribute(text, NODE_TEXT_CONTENT_WITH_STYLED_STRING, &styledStringItem); - - // 资源释放,应用侧可以自由决定何时释放。 - OH_ArkUI_StyledString_Destroy(styledString); - // Text作为Column子组件 - nodeApi->addChild(column, text); - // Column作为ContentSlot子组件 - OH_ArkUI_NodeContent_AddNode(contentHandle_, column); -} -} // namespace NativeNode::Manager diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/manager.h b/ArkUIKit/StyledStringNDK/entry/src/main/cpp/manager.h deleted file mode 100644 index 40d7565e58b7363d5d78d39301b6e699bb56f5e6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef CAPI_MANAGER_H -#define CAPI_MANAGER_H - -#include -#include -#include -#include - - -namespace NativeNode::Manager { -using EventCallback = std::function; - -class NodeManager { -public: - ~NodeManager() = default; - static NodeManager& GetInstance(); - void SetContentHandle(ArkUI_NodeContentHandle contentHandle); - void CreateNativeNode(); -private: - NodeManager() = default; - ArkUI_NodeContentHandle contentHandle_; - std::unordered_map callbackMap_; -}; -} - -#endif //CAPI_MANAGER_H diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/StyledStringNDK/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 8de3f3d6c4047f660641e603fe3dc3375cb99f61..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "manager.h" -#include -#include -#include -#include - -static napi_value createNativeNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "StyledStringNDK", "CreateNativeNode napi_get_cb_info failed"); - return nullptr; - } - // 获取NodeContent - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - NativeNode::Manager::NodeManager::GetInstance().SetContentHandle(contentHandle); - NativeNode::Manager::NodeManager::GetInstance().CreateNativeNode(); - return nullptr; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "createNativeNode", nullptr, createNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/StyledStringNDK/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index da6cd329155de245079074d62cd65bdb08919a65..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const createNativeNode: (content: object) => void; \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/StyledStringNDK/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 77052c679533e45a066030a9fc21cdbf9cbcf995..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/StyledStringNDK/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 843c7f0c1f7b9a460e3dbbd2689e5b34016027d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/StyledStringNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 4ce6449f0e91914e73d4502c9f2e8e9a395ea4b1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/ets/pages/Index.ets b/ArkUIKit/StyledStringNDK/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 4193211d18d31821f4c1a9a5e62a1faa0d462258..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent: Content = new NodeContent(); - - build() { - Row() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - } - .height('100%') - } - - aboutToAppear(): void { - testNapi.createNativeNode(this.nodeContent); - } -} diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/module.json5 b/ArkUIKit/StyledStringNDK/entry/src/main/module.json5 deleted file mode 100644 index 8b215df6b713ccad4e26b68cf4b5a491f71f90df..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone", - "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/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/element/color.json b/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/element/float.json b/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/element/string.json b/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 962ad62902d4b2b36e7111991d139c4f9f0a3574..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "StyledStringNDK" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/background.png b/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/dark/element/color.json b/ArkUIKit/StyledStringNDK/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/main/resources/rawfile/startIcon.png b/ArkUIKit/StyledStringNDK/entry/src/main/resources/rawfile/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringNDK/entry/src/main/resources/rawfile/startIcon.png and /dev/null differ diff --git a/ArkUIKit/StyledStringNDK/entry/src/mock/Libentry.mock.ets b/ArkUIKit/StyledStringNDK/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 82fa70b5693ddab96d237d2d17d943d866b61465..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/mock/mock-config.json5 b/ArkUIKit/StyledStringNDK/entry/src/mock/mock-config.json5 deleted file mode 100644 index 98b0ae79f0090e1fc381d54c959fb32c9f7563f4..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/StyledStringNDK/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 7f30942b81554a399e89aa253c7089eca4f8d8d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/StyledStringNDK/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index c64e0b06938d246ce044186d4b2d02b500a89e14..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/ohosTest/module.json5 b/ArkUIKit/StyledStringNDK/entry/src/ohosTest/module.json5 deleted file mode 100644 index f6bdce9946cb02c0385e5a8836c133c93945013d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/StyledStringNDK/entry/src/test/List.test.ets b/ArkUIKit/StyledStringNDK/entry/src/test/List.test.ets deleted file mode 100644 index a60c87c5cbb0badf7c3fd8975034590e6fafa992..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/entry/src/test/LocalUnit.test.ets b/ArkUIKit/StyledStringNDK/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 841bfd77e56060e50ec0924302a5ae624e76e3aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringNDK/hvigor/hvigor-config.json5 b/ArkUIKit/StyledStringNDK/hvigor/hvigor-config.json5 deleted file mode 100644 index 4d435603637cbbfe92ac9865537a0c1051810bb1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "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/ArkUIKit/StyledStringNDK/hvigorfile.ts b/ArkUIKit/StyledStringNDK/hvigorfile.ts deleted file mode 100644 index 6b365cacd0191d3b1178eb6b9807b1ae0add6271..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/StyledStringNDK/oh-package.json5 b/ArkUIKit/StyledStringNDK/oh-package.json5 deleted file mode 100644 index 4ffb5cd325f0fe70ac35599129f740cf059729d6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringNDK/oh-package.json5 +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21" - } -} diff --git a/ArkUIKit/StyledStringNDK/screenshots/text_styled_string.png b/ArkUIKit/StyledStringNDK/screenshots/text_styled_string.png deleted file mode 100644 index c44e2e231eeb089d0a658ba7cf9a4d54c18107b0..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringNDK/screenshots/text_styled_string.png and /dev/null differ diff --git a/ArkUIKit/StyledStringSample/.gitignore b/ArkUIKit/StyledStringSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/StyledStringSample/AppScope/app.json5 b/ArkUIKit/StyledStringSample/AppScope/app.json5 deleted file mode 100644 index 6ccaa10146c0a73ea73ab2f0b8e8c4d3fd4610fb..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.styledstringndk", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/StyledStringSample/AppScope/resources/base/element/string.json b/ArkUIKit/StyledStringSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 0edf05d24f2ca0e69a966f00825600f3d9474df8..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "StyledStringNDK" - } - ] -} diff --git a/ArkUIKit/StyledStringSample/AppScope/resources/base/media/background.png b/ArkUIKit/StyledStringSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/StyledStringSample/AppScope/resources/base/media/foreground.png b/ArkUIKit/StyledStringSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/StyledStringSample/AppScope/resources/base/media/layered_image.json b/ArkUIKit/StyledStringSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/README.md b/ArkUIKit/StyledStringSample/README.md deleted file mode 100644 index c399272dfec716e98a00dcffdf233b7ee32ac1cc..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# StyledStringSample - -## 介绍 - -本示例展示了如何创建文本、设置文本样式、序列化、反序列化、转换html。 - -## 效果预览 - -| 预览 | -|-----------------------------------------------------------| -| | - -## 使用说明 -1. 安装编译生成的hap包,并打开应用; -2. 查看创建好的文本以及相应的文本样式; -3. 查看log是否序列化成功; - - -## 工程目录 - -``` -StyledStringSample -entry/src/main/ets/ -└── pages - └── Index.ets (获取文本界面) -entry/src/main/ -├── cpp -│ ├── types -│ │ └── libentry -│ │ └── Index.d.ts (函数对应的js映射) -│ ├── CMakeLists.txt (CMake脚本) -| ├── manager.cpp (创建文本实现CPP文件) -| ├── manager.h -│ └── napi_init.cpp -└── resources - ├── base - │ ├── element - │ │ ├── color.json - │ │ ├── float.json - │ │ └── string.json - │ └── media -``` - -## 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束和限制 - -1. 本示例支持标准系统上运行,支持设备:RK3568; - -2. 本示例支持API20版本SDK,版本号:6.0.0.36; - -3. 本示例已支持使DevEco Studio 5.1.1 Release (构建版本:5.1.1.840,构建 2025年9月19日)编译运行 - -## 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/StyledStringSample > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/build-profile.json5 b/ArkUIKit/StyledStringSample/build-profile.json5 deleted file mode 100644 index f830bcee898a217f4f114cfe09170e749c8fce23..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -{ - "app": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/code-linter.json5 b/ArkUIKit/StyledStringSample/code-linter.json5 deleted file mode 100644 index 5c4682f8164874ec7e9cb8f99ff8b3228ffbc126..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/code-linter.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/.gitignore b/ArkUIKit/StyledStringSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/build-profile.json5 b/ArkUIKit/StyledStringSample/entry/build-profile.json5 deleted file mode 100644 index c78aac55b6117b88401e7ea957d3e427b1db2ca6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/build-profile.json5 +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "" - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default", - }, - { - "name": "ohosTest" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/hvigorfile.ts b/ArkUIKit/StyledStringSample/entry/hvigorfile.ts deleted file mode 100644 index f8b117a17af3b2d7cb87a7680e29e2bb8ccd5b46..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/obfuscation-rules.txt b/ArkUIKit/StyledStringSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/StyledStringSample/entry/oh-package-lock.json5 b/ArkUIKit/StyledStringSample/entry/oh-package-lock.json5 deleted file mode 100644 index 7c36300c3272430b97f5cda7cb1a835421298382..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/oh-package-lock.json5 +++ /dev/null @@ -1,19 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry" - }, - "packages": { - "libentry.so@src/main/cpp/types/libentry": { - "name": "libentry.so", - "version": "1.0.0", - "resolved": "src/main/cpp/types/libentry", - "registryType": "local" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/oh-package.json5 b/ArkUIKit/StyledStringSample/entry/oh-package.json5 deleted file mode 100644 index 5b21e253af246edab8b6ef4f10938f4417e8bc25..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/StyledStringSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 561706bbd6da1cc6e9f797531413d3588a04cac3..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(CApi2) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -find_library( - libace-lib - ace_ndk.z -) - -add_library(entry SHARED napi_init.cpp manager.cpp) -target_link_libraries(entry PUBLIC ${libace-lib} libace_napi.z.so libnative_drawing.so libhilog_ndk.z.so) \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/cpp/manager.cpp b/ArkUIKit/StyledStringSample/entry/src/main/cpp/manager.cpp deleted file mode 100644 index 412bc3e2b10ec4ab39ee7add97e37ea95ba313a8..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "manager.h" -#include -#include -#include -#include -#include -#include -#include - -#define LOG_TAG "zyx" -#define LOG_INFO(...) OH_LOG_Print(LOG_APP, LOG_INFO, 0xD001400, LOG_TAG, __VA_ARGS__) - -namespace NativeNode::Manager { -constexpr int32_t NUM_0 = 0; -constexpr int32_t MAX_LINES = 10; // 最大行数 -constexpr int32_t FONT_SIZE = 28; // 字体大小 -constexpr int32_t LAYOUT_MAX_WIDTH = 400; // 排版最大宽度 -constexpr int32_t CONTAINER_WIDTH = 300; // 容器宽度 -constexpr int32_t TEXT_HEIGHT = 100; // 文本组件高度 -constexpr float BORDER_WIDTH = 1.0f; // 边框宽度 -constexpr int32_t PLACEHOLDER_WIDTH = 100; // 占位符宽度 -constexpr int32_t PLACEHOLDER_HEIGHT = 100; // 占位符高度 -constexpr size_t SERIALIZE_BUFFER_SIZE = 1024; // 序列化缓冲区大小 -constexpr uint32_t TEXT_COLOR_GRAY = 0xFF707070; // 第一段文本颜色(灰色) -constexpr uint32_t TEXT_COLOR_BLUE = 0xFF2787D9; // 第二段文本颜色(蓝色) - -// 创建Column容器 -static ArkUI_NodeHandle CreateColumnContainer(ArkUI_NativeNodeAPI_1 *nodeApi) -{ - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = CONTAINER_WIDTH}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - return column; -} - -// 创建带样式的Text组件 -static ArkUI_NodeHandle CreateStyledText(ArkUI_NativeNodeAPI_1 *nodeApi) -{ - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - - // 设置文本宽度 - ArkUI_NumberValue textWidth[] = {{.f32 = CONTAINER_WIDTH}}; - ArkUI_AttributeItem textWidthItem = {.value = textWidth, .size = 1}; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - - // 设置文本高度 - ArkUI_NumberValue textHeight[] = {{.f32 = TEXT_HEIGHT}}; - ArkUI_AttributeItem textHeightItem = {.value = textHeight, .size = 1}; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - - // 设置边框宽度 - ArkUI_NumberValue borderWidth[] = {{.f32 = BORDER_WIDTH}}; - ArkUI_AttributeItem borderWidthItem = {.value = borderWidth, .size = 1}; - nodeApi->setAttribute(text, NODE_BORDER_WIDTH, &borderWidthItem); - - return text; -} - -static bool ParseInputData(napi_env env, napi_callback_info info, - uint8_t*& data_bytes, size_t& arraySize) { - size_t argc = 1; - napi_value args[1]; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < 1) { - napi_throw_type_error(env, nullptr, "Expected one argument"); - return false; - } - napi_typedarray_type type; - size_t length, byte_offset; - napi_value arraybuffer; - if (napi_get_typedarray_info(env, args[0], &type, &length, nullptr, &arraybuffer, &byte_offset) != napi_ok) { - napi_throw_type_error(env, nullptr, "Expected a TypedArray argument"); - return false; - } - if (type != napi_uint8_array) { - napi_throw_type_error(env, nullptr, "Expected a Uint8Array argument"); - return false; - } - void* data; - size_t byte_length; - if (napi_get_arraybuffer_info(env, arraybuffer, &data, &byte_length) != napi_ok) { - napi_throw_type_error(env, nullptr, "Failed to get ArrayBuffer info"); - return false; - } - data_bytes = static_cast(data) + byte_offset; - arraySize = length; - return true; -} - -static void CheckSerialization(uint8_t* data_bytes, size_t arraySize, - ArkUI_StyledString_Descriptor* describer) { - size_t resultSize; - size_t size = 10; - uint8_t* buffer = (uint8_t*)malloc(size * sizeof(uint8_t)); - - if (OH_ArkUI_MarshallStyledStringDescriptor(buffer, size, describer, &resultSize) != 0) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0XFF00, "zyx", "resultSize is :[%{public}zu]", resultSize); - uint8_t* buffer2 = (uint8_t*)malloc(resultSize * sizeof(uint8_t)); - size_t resultSize2; - - OH_ArkUI_MarshallStyledStringDescriptor(buffer2, resultSize, describer, &resultSize2); - OH_LOG_Print(LOG_APP, LOG_INFO, 0XFF00, "zyx", - "序列化前数组长度:[%{public}zu],序列化后数组长度:[%{public}zu]", arraySize, resultSize2); - - if (arraySize == resultSize2) { - bool isAllEqual = true; - for (size_t i = 0; i < arraySize; i++) { - if (data_bytes[i] != buffer2[i]) isAllEqual = false; - } - OH_LOG_Print(LOG_APP, LOG_INFO, 0XFF00, "zyx", - "序列化前后的数组是否完全一致:[%{public}d]", isAllEqual); - } - - free(buffer2); - } - free(buffer); -} - -void NodeManager::CreateUintNativeNode(napi_env env, napi_callback_info info) { - OH_LOG_Print(LOG_APP, LOG_INFO, 0XFF00, "zyx", "CreateNativeNode"); - uint8_t* data_bytes = nullptr; - size_t arraySize = 0; - if (!ParseInputData(env, info, data_bytes, arraySize)) { - return; - } - OH_LOG_Print(LOG_APP, LOG_INFO, 0XFF00, "zyx", "data_bytes size is %{public}lu", arraySize); - auto* styledStringDescriber = OH_ArkUI_StyledString_Descriptor_Create(); - CheckSerialization(data_bytes, arraySize, styledStringDescriber); - auto status = OH_ArkUI_UnmarshallStyledStringDescriptor(data_bytes, arraySize, styledStringDescriber); - OH_LOG_Print(LOG_APP, LOG_INFO, 0XFF00, "zyx", "Unmarshalling status is %{public}d", status); - auto html = OH_ArkUI_ConvertToHtml(styledStringDescriber); - OH_LOG_Print(LOG_APP, LOG_INFO, 0XFF00, "zyx", "html is :[%{public}s]", html); - OH_ArkUI_StyledString_Descriptor_Destroy(styledStringDescriber); -} - -NodeManager &NodeManager::GetInstance() -{ - static NodeManager instance; - return instance; -} - -void NodeManager::SetContentHandle(ArkUI_NodeContentHandle contentHandle) { contentHandle_ = contentHandle; } - -void NodeManager::CreateNativeNode() -{ - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - // 创建容器与文本组件 - ArkUI_NodeHandle column = CreateColumnContainer(nodeApi); - ArkUI_NodeHandle text = CreateStyledText(nodeApi); - - // 创建字体集合与段落样式 - OH_Drawing_FontCollection *fontCollection = OH_Drawing_CreateFontCollection(); - OH_Drawing_TypographyStyle *typographyStyle = OH_Drawing_CreateTypographyStyle(); - OH_Drawing_SetTypographyTextAlign(typographyStyle, OH_Drawing_TextAlign::TEXT_ALIGN_CENTER); - OH_Drawing_SetTypographyTextMaxLines(typographyStyle, MAX_LINES); - - // 创建StyledString并设置文本内容 - ArkUI_StyledString *styledString = OH_ArkUI_StyledString_Create(typographyStyle, fontCollection); - - // 第一段文本(灰色"Hello") - OH_Drawing_TextStyle *textStyle = OH_Drawing_CreateTextStyle(); - OH_Drawing_SetTextStyleFontSize(textStyle, FONT_SIZE); - OH_Drawing_SetTextStyleColor(textStyle, TEXT_COLOR_GRAY); - OH_ArkUI_StyledString_PushTextStyle(styledString, textStyle); - OH_ArkUI_StyledString_AddText(styledString, "Hello"); - OH_ArkUI_StyledString_PopTextStyle(styledString); - OH_Drawing_DestroyTextStyle(textStyle); - - // 添加占位符 - OH_Drawing_PlaceholderSpan placeHolder{.width = PLACEHOLDER_WIDTH, .height = PLACEHOLDER_HEIGHT}; - OH_ArkUI_StyledString_AddPlaceholder(styledString, &placeHolder); - - // 第二段文本(蓝色"World!") - OH_Drawing_TextStyle *worldTextStyle = OH_Drawing_CreateTextStyle(); - OH_Drawing_SetTextStyleFontSize(worldTextStyle, FONT_SIZE); - OH_Drawing_SetTextStyleColor(worldTextStyle, TEXT_COLOR_BLUE); - OH_ArkUI_StyledString_PushTextStyle(styledString, worldTextStyle); - OH_ArkUI_StyledString_AddText(styledString, "World!"); - OH_ArkUI_StyledString_PopTextStyle(styledString); - OH_Drawing_DestroyTextStyle(worldTextStyle); - - // 排版与设置属性 - OH_Drawing_Typography *typography = OH_ArkUI_StyledString_CreateTypography(styledString); - OH_Drawing_TypographyLayout(typography, LAYOUT_MAX_WIDTH); - ArkUI_AttributeItem styledStringItem = {.object = styledString}; - nodeApi->setAttribute(text, NODE_TEXT_CONTENT_WITH_STYLED_STRING, &styledStringItem); - - // 组装与释放资源 - nodeApi->addChild(column, text); - OH_ArkUI_StyledString_Destroy(styledString); - OH_Drawing_DestroyTypographyStyle(typographyStyle); - OH_Drawing_DestroyFontCollection(fontCollection); - // Column作为ContentSlot子组件 - OH_ArkUI_NodeContent_AddNode(contentHandle_, column); -} -} // namespace NativeNode::Manager diff --git a/ArkUIKit/StyledStringSample/entry/src/main/cpp/manager.h b/ArkUIKit/StyledStringSample/entry/src/main/cpp/manager.h deleted file mode 100644 index 64c7f195d4ba7a672bf23d6ce1d9abf3e9dd208d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#ifndef CAPI_MANAGER_H -#define CAPI_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include - - -namespace NativeNode::Manager { -using EventCallback = std::function; - -class NodeManager { -public: - ~NodeManager() = default; - static NodeManager& GetInstance(); - void SetContentHandle(ArkUI_NodeContentHandle contentHandle); - void CreateNativeNode(); - void CreateUintNativeNode(napi_env env, napi_callback_info info); -private: - NodeManager() = default; - ArkUI_NodeContentHandle contentHandle_; - std::unordered_map callbackMap_; -}; -} - -#endif //CAPI_MANAGER_H diff --git a/ArkUIKit/StyledStringSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/StyledStringSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index b0fdc30dd5505969d4c7c5b0c9a7ce6a062cf101..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "manager.h" -#include -#include -#include -#include - -static napi_value createNativeNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "StyledStringNDK", "CreateNativeNode napi_get_cb_info failed"); - return nullptr; - } - // 获取NodeContent - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - NativeNode::Manager::NodeManager::GetInstance().SetContentHandle(contentHandle); - NativeNode::Manager::NodeManager::GetInstance().CreateNativeNode(); - return nullptr; -} - -static napi_value createUintNativeNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "StyledStringNDK", "CreateNativeNode napi_get_cb_info failed"); - return nullptr; - } - NativeNode::Manager::NodeManager::GetInstance().CreateUintNativeNode(env, info); - return nullptr; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "createNativeNode", nullptr, createNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "createUintNativeNode", nullptr, createUintNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/StyledStringSample/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/StyledStringSample/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 6b06a1ed9344ad0963982e5217879f6757d64935..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const createNativeNode: (content: object) => void; -export const createUintNativeNode: (uint8Array: Uint8Array) => void; \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/StyledStringSample/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 77052c679533e45a066030a9fc21cdbf9cbcf995..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/StyledStringSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 843c7f0c1f7b9a460e3dbbd2689e5b34016027d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/StyledStringSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 4ce6449f0e91914e73d4502c9f2e8e9a395ea4b1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/StyledStringSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 918dfaa0916801fa9e03578bd431cea91be43500..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; -import { pasteboard } from '@kit.BasicServicesKit' - -@Entry -@Component -struct Index { - private nodeContent: Content = new NodeContent(); - controllers: RichEditorController = new RichEditorController(); - options: RichEditorOptions = { controller: this.controllers } - - build() { - Row() { - Column() { - ContentSlot(this.nodeContent) - Text("测试CAPI,测试前下面框中先粘贴一次").fontSize(8) - RichEditor(this.options) - .borderWidth(1) - .borderColor(Color.Red) - .width("100%") - .height(50) - .enableDataDetector(true) - // .backgroundColor(Color.Gray) - .selectedBackgroundColor(Color.Gray) - Button("点击测试CAPI").fontSize(8) - .onClick(() =>{ - let sysBoard = pasteboard.getSystemPasteboard() - pasteboard.MIMETYPE_TEXT_HTML - try { - let result: boolean = sysBoard.hasDataType("openharmony.styled-string"); - console.info(`zyx Succeeded in checking the DataType. Result: ${result}`); - } catch (err) { - console.error('zyx Failed to check the DataType. Cause:' + err.message); - }; - sysBoard.getData((err, data) => { // MulitTypeRecord. - let count = data.getRecordCount() // "1234[图]" , record1 : {plainText : "1234", openharmony.styled-string : arrayBuffer}, mimeType = "plainText" - // record2 {UriText : "/../../.png, openharmony.styled-string : arrayBuffer"}, mimeType = "UriText" - for (let i = 0; i < count; i++) { - const record = data.getRecord(i) - let mimeTypes = data.getMimeTypes(); // 获得 所有record 的mimeType 集合。 // text, uri, arraybuffer - let type = record.mimeType; - let types = new Array(pasteboard.MIMETYPE_TEXT_PLAIN,pasteboard.MIMETYPE_TEXT_URI,pasteboard.MIMETYPE_PIXELMAP,"openharmony.styled-string") - let validTypes = record.getValidTypes(types) // 获取record1 里的所有数据的样式集合。 - if (validTypes.includes("openharmony.styled-string")) { - let spanString = record.getData("openharmony.styled-string") // spanString instanseOf Promise, - // type ValueType = string | image.PixelMap | Want | ArrayBuffer; - spanString.then((value) => { - // value : type ValueType = string | image.PixelMap | Want | ArrayBuffer; - let buffer = value as ArrayBuffer; - // buffer : ArrayBuffer - let length = buffer.byteLength - let uint8Array = new Uint8Array(buffer); // 从剪切板中获取属性字符串的序列化的字节数组。 uint8Array -> 属性字符串 - console.info(`zyx Succeeded obtain buffer ` + length); - testNapi.createUintNativeNode(uint8Array); // napi ,将JS侧数据传到C侧. - }) - } - } - }) - }) - } - .width('100%') - } - .height('100%') - } - - aboutToAppear(): void { - testNapi.createNativeNode(this.nodeContent); - } -} diff --git a/ArkUIKit/StyledStringSample/entry/src/main/module.json5 b/ArkUIKit/StyledStringSample/entry/src/main/module.json5 deleted file mode 100644 index c00933eb7488794b498319cbba6ae595ee963a4a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/module.json5 +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/ArkUIKit/StyledStringSample/entry/src/main/resources/base/element/color.json b/ArkUIKit/StyledStringSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/element/float.json b/ArkUIKit/StyledStringSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/element/string.json b/ArkUIKit/StyledStringSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/background.png b/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/StyledStringSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/StyledStringSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/StyledStringSample/entry/src/main/resources/dark/element/color.json b/ArkUIKit/StyledStringSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/mock/Libentry.mock.ets b/ArkUIKit/StyledStringSample/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 82fa70b5693ddab96d237d2d17d943d866b61465..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/mock/mock-config.json5 b/ArkUIKit/StyledStringSample/entry/src/mock/mock-config.json5 deleted file mode 100644 index 98b0ae79f0090e1fc381d54c959fb32c9f7563f4..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/StyledStringSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 7f30942b81554a399e89aa253c7089eca4f8d8d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/StyledStringSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index c64e0b06938d246ce044186d4b2d02b500a89e14..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/ohosTest/module.json5 b/ArkUIKit/StyledStringSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index f6bdce9946cb02c0385e5a8836c133c93945013d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/StyledStringSample/entry/src/test/List.test.ets b/ArkUIKit/StyledStringSample/entry/src/test/List.test.ets deleted file mode 100644 index a60c87c5cbb0badf7c3fd8975034590e6fafa992..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/entry/src/test/LocalUnit.test.ets b/ArkUIKit/StyledStringSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 841bfd77e56060e50ec0924302a5ae624e76e3aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/hvigor/hvigor-config.json5 b/ArkUIKit/StyledStringSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 3434a2eb9f560b3c4a6f189a7e9fc1af4775c290..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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*/ - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/hvigorfile.ts b/ArkUIKit/StyledStringSample/hvigorfile.ts deleted file mode 100644 index 9b379cc20f0578063dc70e5da13ccf12414bf75c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/log.txt b/ArkUIKit/StyledStringSample/log.txt deleted file mode 100644 index 72c61348705dfd704c09bb4f0cf272aca8c0ce0f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/log.txt +++ /dev/null @@ -1,7 +0,0 @@ -20:30:54:396 log timer task size: 1 -18:53:05:857 log timer task size: 1 -19:42:06:905 log task queue not empty -19:42:06:905 log task size: 1 -19:42:06:906 log before pop task size: 1 -19:42:06:906 log after task size: 0 -19:42:07:421 log timer task size: 1 diff --git a/ArkUIKit/StyledStringSample/oh-package-lock.json5 b/ArkUIKit/StyledStringSample/oh-package-lock.json5 deleted file mode 100644 index a3925056904d5e0d6791438feddebc0014a84db0..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.21": "@ohos/hypium@1.0.21" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "@ohos/hamock", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.21": { - "name": "@ohos/hypium", - "version": "1.0.21", - "integrity": "sha512-iyKGMXxE+9PpCkqEwu0VykN/7hNpb+QOeIuHwkmZnxOpI+dFZt6yhPB7k89EgV1MiSK/ieV/hMjr5Z2mWwRfMQ==", - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.21.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/StyledStringSample/oh-package.json5 b/ArkUIKit/StyledStringSample/oh-package.json5 deleted file mode 100644 index 41ed05598470e02379db2b68e6cb9015c0847509..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkUIKit/StyledStringSample/ohosTest.md b/ArkUIKit/StyledStringSample/ohosTest.md deleted file mode 100644 index ac68aca8b8976cee7c7e13e5dbf226c1d0a05af9..0000000000000000000000000000000000000000 --- a/ArkUIKit/StyledStringSample/ohosTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期显示 | 是否自动 | 测试结果 | -|-----------------|--------|---------------------------------------------------|---------------------------------------------------| -------- | -------- | -| 启动应用 | 设备正常运行 | 1.开启开发板
2.编译hap包并将hap包及环境烧录进开发板,运行测试用例
| 成功拉起应用。 | 否 | 验证通过 | -| styledString布局 | 应用位于首页 | 1.无 | 1.布局排版"hello"灰色,位于左下角,“world!"蓝色,位于右下角,两串字符串中间占位符 | 否 | 验证通过 | -| 序列化、反序列化、转换html | log信息 | 1.无输入,本示例创建空,转换html为
| 1.log打印序列化、反序列化、转换html是否成功以及相对应返回码 | 否 | 验证通过 | diff --git a/ArkUIKit/StyledStringSample/screenshots/styledString.jpeg b/ArkUIKit/StyledStringSample/screenshots/styledString.jpeg deleted file mode 100644 index 740f1201bdb678bf0f3364fb5bbbc265c168a646..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StyledStringSample/screenshots/styledString.jpeg and /dev/null differ diff --git a/ArkUIKit/TextAreaEventNDK/.gitignore b/ArkUIKit/TextAreaEventNDK/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkUIKit/TextAreaEventNDK/AppScope/app.json5 b/ArkUIKit/TextAreaEventNDK/AppScope/app.json5 deleted file mode 100644 index 9f3da12b4f7412ceb28fad341a984ad96524d072..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.textareandk", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/element/string.json b/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/element/string.json deleted file mode 100644 index 7a9c6fdbf5c1b7eed2a023bdcab1837d973490a5..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "TextAreaEventNDK" - } - ] -} diff --git a/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/media/background.png b/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/media/foreground.png b/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/media/layered_image.json b/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/README.md b/ArkUIKit/TextAreaEventNDK/README.md deleted file mode 100644 index f5212c87535ddf741b789ab3868b37abc1ac037e..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# TextAreaEventNDK - -## 介绍 - -本示例为使用NDK接口构建UI->使用文本->[监听输入框事件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/ndk-textarea-event.md)的配套示例工程。 - -本示例展示了输入框输入、选中以及选中菜单。 - -## 效果预览 - -| 预览 | -| -------------------------------------------- | - - -## 使用说明 -1. 安装编译生成的hap包,并打开应用; -2. 在输入框内输入一段文字; -3. 长按文字进行选中; - - -## 工程目录 - -``` -TextAreaEventNDK -entry/src/main/ets/ -└── pages - └── Index.ets (获取输入框界面) -entry/src/main/ -├── cpp -│ ├── types -│ │ └── libentry -│ │ └── Index.d.ts (NDK函数对应的js映射) -│ ├── CMakeLists.txt (CMake脚本) -| ├── manager.cpp (创建输入框实现CPP文件) -| ├── manager.h -│ └── napi_init.cpp (NDK函数) -└── resources - ├── base - │ ├── element - │ │ ├── color.json - │ │ ├── float.json - │ │ └── string.json - │ └── media -``` - -## 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束和限制 - -1. 本示例支持仅标准系统上运行,支持设备:华为手机、华为平板。 - -2. HarmonyOS系统:HarmonyOS 6.0.0 Beta3版本及以上。 - -3. DevEco Studio版本:DevEco Studio 6.0.0 Beta3版本及以上。 - -4. HarmonyOS SDK版本:HarmonyOS 6.0.0 Beta3 SDK版本及以上。 - -## 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo ArkUIKit/TextAreaEventNDK > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/build-profile.json5 b/ArkUIKit/TextAreaEventNDK/build-profile.json5 deleted file mode 100644 index d4774ea1bd3391ce237ba9dcefe45f7061f99929..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/build-profile.json5 +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/code-linter.json5 b/ArkUIKit/TextAreaEventNDK/code-linter.json5 deleted file mode 100644 index 5c4682f8164874ec7e9cb8f99ff8b3228ffbc126..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/code-linter.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/.gitignore b/ArkUIKit/TextAreaEventNDK/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/build-profile.json5 b/ArkUIKit/TextAreaEventNDK/entry/build-profile.json5 deleted file mode 100644 index cff3c16ef337d5ed6b207c7e28be6aad4b0dfeeb..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/build-profile.json5 +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/hvigorfile.ts b/ArkUIKit/TextAreaEventNDK/entry/hvigorfile.ts deleted file mode 100644 index 8774588471ede4c1563f09d9a1d22f764bb1fd9e..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/TextAreaEventNDK/entry/obfuscation-rules.txt b/ArkUIKit/TextAreaEventNDK/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkUIKit/TextAreaEventNDK/entry/oh-package.json5 b/ArkUIKit/TextAreaEventNDK/entry/oh-package.json5 deleted file mode 100644 index 5b21e253af246edab8b6ef4f10938f4417e8bc25..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 561706bbd6da1cc6e9f797531413d3588a04cac3..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(CApi2) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -find_library( - libace-lib - ace_ndk.z -) - -add_library(entry SHARED napi_init.cpp manager.cpp) -target_link_libraries(entry PUBLIC ${libace-lib} libace_napi.z.so libnative_drawing.so libhilog_ndk.z.so) \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/manager.cpp b/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/manager.cpp deleted file mode 100644 index d704d77694e92bcc8274d209af18cecf6ebb7b77..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/manager.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "manager.h" -#include -#include -#include - -namespace NativeNode::Manager { -constexpr int32_t NUM_10 = 10; -constexpr int32_t NUM_28 = 28; -constexpr int32_t NUM_400 = 400; -NodeManager &NodeManager::GetInstance() -{ - static NodeManager instance; - return instance; -} - -void NodeManager::SetContentHandle(ArkUI_NodeContentHandle contentHandle) { contentHandle_ = contentHandle; } - -void NodeManager::CreateTextAreaNode() -{ - if (!contentHandle_) { - return; - } - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - if (nodeApi == nullptr) { - return; - } - ArkUI_NodeHandle column = nodeApi->createNode(ARKUI_NODE_COLUMN); - ArkUI_NumberValue colWidth[] = {{.f32 = 300}}; - ArkUI_AttributeItem widthItem = {.value = colWidth, .size = 1}; - nodeApi->setAttribute(column, NODE_WIDTH, &widthItem); - - ArkUI_NodeHandle text = nodeApi->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue textWidth[] = {{.f32 = 300}}; - ArkUI_AttributeItem textWidthItem = {.value = textWidth, .size = 1}; - nodeApi->setAttribute(text, NODE_WIDTH, &textWidthItem); - ArkUI_NumberValue textHeight[] = {{.f32 = 100}}; - ArkUI_AttributeItem textHeightItem = {.value = textHeight, .size = 1}; - nodeApi->setAttribute(text, NODE_HEIGHT, &textHeightItem); - - nodeApi->addChild(column, text); - - ArkUI_NodeHandle selectionText = nodeApi->createNode(ARKUI_NODE_TEXT); - ArkUI_NumberValue selectionTextWidth[] = {{.f32 = 300}}; - ArkUI_AttributeItem selectionTextWidthItem = {.value = selectionTextWidth, .size = 1}; - nodeApi->setAttribute(selectionText, NODE_WIDTH, &selectionTextWidthItem); - nodeApi->addChild(column, selectionText); - ArkUI_NodeHandle textArea = nodeApi->createNode(ARKUI_NODE_TEXT_AREA); - ArkUI_NumberValue textAreaWidth[] = {{.f32 = 300}}; - ArkUI_AttributeItem textAreaWidthItem = {.value = textAreaWidth, .size = 1}; - nodeApi->setAttribute(textArea, NODE_WIDTH, &textAreaWidthItem); - - ArkUI_NumberValue borderWidth[] = {{.f32 = 1}}; - ArkUI_AttributeItem borderWidthItem = {.value = borderWidth, .size = 1}; - nodeApi->setAttribute(textArea, NODE_BORDER_WIDTH, &borderWidthItem); - - const ArkUI_AttributeItem *attributeItem = nodeApi->getAttribute(textArea, NODE_UNIQUE_ID); - auto id = attributeItem->value[0].i32; - nodeApi->registerNodeEvent(textArea, NODE_TEXT_AREA_ON_CHANGE, id, text); - nodeApi->registerNodeEvent(textArea, NODE_TEXT_AREA_ON_PASTE, id, text); - nodeApi->registerNodeEvent(textArea, NODE_TEXT_AREA_ON_TEXT_SELECTION_CHANGE, id, selectionText); - TextAreaNodeEventReceiver(nodeApi); - nodeApi->addChild(column, textArea); - OH_ArkUI_NodeContent_AddNode(contentHandle_, column); -} - -void NodeManager::TextAreaNodeEventReceiver(ArkUI_NativeNodeAPI_1* nodeApi) -{ - nodeApi->registerNodeEventReceiver([](ArkUI_NodeEvent *event) { - ArkUI_NodeEventType eventType = OH_ArkUI_NodeEvent_GetEventType(event); - ArkUI_AttributeItem content; - if (eventType == NODE_TEXT_AREA_ON_CHANGE || eventType == NODE_TEXT_AREA_ON_PASTE) { - ArkUI_StringAsyncEvent *stringEvent = OH_ArkUI_NodeEvent_GetStringAsyncEvent(event); - content = {.string = stringEvent->pStr }; - } else if (eventType == NODE_TEXT_AREA_ON_TEXT_SELECTION_CHANGE) { - ArkUI_NodeComponentEvent *componentEvent = OH_ArkUI_NodeEvent_GetNodeComponentEvent(event); - std::stringstream selectContent; - selectContent << "start: " << componentEvent->data[0].i32 << " , end: " << componentEvent->data[1].i32; - content = {.string = selectContent.str().c_str() }; - } else { - return; - } - ArkUI_NodeHandle textNode = reinterpret_cast(OH_ArkUI_NodeEvent_GetUserData(event)); - if (textNode) { - ArkUI_NativeNodeAPI_1 *nodeApi = reinterpret_cast( - OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - nodeApi->setAttribute(textNode, NODE_TEXT_CONTENT, &content); - } - }); -} -} // namespace NativeNode::Manager diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/manager.h b/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/manager.h deleted file mode 100644 index d6c3b8258a83ecd21b4897aa17b77b3eaf327024..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/manager.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef CAPI_MANAGER_H -#define CAPI_MANAGER_H - -#include -#include -#include -#include - - -namespace NativeNode::Manager { -using EventCallback = std::function; - -class NodeManager { -public: - ~NodeManager() = default; - static NodeManager& GetInstance(); - void SetContentHandle(ArkUI_NodeContentHandle contentHandle); - void CreateTextAreaNode(); - -private: - NodeManager() = default; - void TextAreaNodeEventReceiver(ArkUI_NativeNodeAPI_1* nodeApi); - ArkUI_NodeContentHandle contentHandle_; - std::unordered_map callbackMap_; -}; -} - -#endif //CAPI_MANAGER_H diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 97b997cfa57bb0cf6e26af4b064c4a2da7bee34c..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -#include "manager.h" -#include -#include -#include -#include - - -static napi_value createNativeNode(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, 0xFF00, "TextAreaEventNDK", "CreateNativeNode napi_get_cb_info failed"); - return nullptr; - } - // 获取NodeContent - ArkUI_NodeContentHandle contentHandle; - OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); - NativeNode::Manager::NodeManager::GetInstance().SetContentHandle(contentHandle); - NativeNode::Manager::NodeManager::GetInstance().CreateTextAreaNode(); - return nullptr; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "createNativeNode", nullptr, createNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index da6cd329155de245079074d62cd65bdb08919a65..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const createNativeNode: (content: object) => void; \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 77052c679533e45a066030a9fc21cdbf9cbcf995..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/TextAreaEventNDK/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 843c7f0c1f7b9a460e3dbbd2689e5b34016027d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkUIKit/TextAreaEventNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 4ce6449f0e91914e73d4502c9f2e8e9a395ea4b1..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/ets/pages/Index.ets b/ArkUIKit/TextAreaEventNDK/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 9c6014f988ee166eb8b3bf64d20564e5622d3714..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - private nodeContent: Content = new NodeContent(); - - build() { - Row() { - Column() { - ContentSlot(this.nodeContent) - } - .width('100%') - } - .height('100%') - } - - aboutToAppear(): void { - testNapi.createNativeNode(this.nodeContent); - } -} diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/module.json5 b/ArkUIKit/TextAreaEventNDK/entry/src/main/module.json5 deleted file mode 100644 index 8b215df6b713ccad4e26b68cf4b5a491f71f90df..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone", - "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/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/element/color.json b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/element/float.json b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/element/string.json b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/element/string.json deleted file mode 100644 index a1c9357a7b20574f750f40423cc07ffaa0a453ec..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "TextAreaEventNDK" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/background.png b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/foreground.png b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/layered_image.json b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/startIcon.png b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/profile/backup_config.json b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/dark/element/color.json b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/rawfile/startIcon.png b/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/rawfile/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/TextAreaEventNDK/entry/src/main/resources/rawfile/startIcon.png and /dev/null differ diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/mock/Libentry.mock.ets b/ArkUIKit/TextAreaEventNDK/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 82fa70b5693ddab96d237d2d17d943d866b61465..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/mock/mock-config.json5 b/ArkUIKit/TextAreaEventNDK/entry/src/mock/mock-config.json5 deleted file mode 100644 index 98b0ae79f0090e1fc381d54c959fb32c9f7563f4..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/TextAreaEventNDK/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 7f30942b81554a399e89aa253c7089eca4f8d8d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/TextAreaEventNDK/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index c64e0b06938d246ce044186d4b2d02b500a89e14..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/ohosTest/module.json5 b/ArkUIKit/TextAreaEventNDK/entry/src/ohosTest/module.json5 deleted file mode 100644 index f6bdce9946cb02c0385e5a8836c133c93945013d..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/test/List.test.ets b/ArkUIKit/TextAreaEventNDK/entry/src/test/List.test.ets deleted file mode 100644 index a60c87c5cbb0badf7c3fd8975034590e6fafa992..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/entry/src/test/LocalUnit.test.ets b/ArkUIKit/TextAreaEventNDK/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 841bfd77e56060e50ec0924302a5ae624e76e3aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/TextAreaEventNDK/hvigor/hvigor-config.json5 b/ArkUIKit/TextAreaEventNDK/hvigor/hvigor-config.json5 deleted file mode 100644 index 4d435603637cbbfe92ac9865537a0c1051810bb1..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "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/ArkUIKit/TextAreaEventNDK/hvigorfile.ts b/ArkUIKit/TextAreaEventNDK/hvigorfile.ts deleted file mode 100644 index 6b365cacd0191d3b1178eb6b9807b1ae0add6271..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkUIKit/TextAreaEventNDK/oh-package.json5 b/ArkUIKit/TextAreaEventNDK/oh-package.json5 deleted file mode 100644 index 4ffb5cd325f0fe70ac35599129f740cf059729d6..0000000000000000000000000000000000000000 --- a/ArkUIKit/TextAreaEventNDK/oh-package.json5 +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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.5", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21" - } -} diff --git a/ArkUIKit/TextAreaEventNDK/screenshots/textarea_getstringevent.gif b/ArkUIKit/TextAreaEventNDK/screenshots/textarea_getstringevent.gif deleted file mode 100644 index 14b982202893aae0f10a32208dd9a520fcf81df0..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/TextAreaEventNDK/screenshots/textarea_getstringevent.gif and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/.gitignore b/ArkWebKit/ArkWebSchemeHandler/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/ArkWebKit/ArkWebSchemeHandler/AppScope/app.json5 b/ArkWebKit/ArkWebSchemeHandler/AppScope/app.json5 deleted file mode 100644 index 380216c4148a89ebb8eecf3cb191120fd624ceab..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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.samples.arkwebschemehandler", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/element/string.json b/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/element/string.json deleted file mode 100644 index 42a06f64bb1731e07c5b6a7aa98ea811ec09d3e9..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ArkWebSchemeHandler" - } - ] -} diff --git a/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/media/background.png b/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/media/foreground.png b/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/media/layered_image.json b/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/README.md b/ArkWebKit/ArkWebSchemeHandler/README.md deleted file mode 100644 index a5c8a4de4435a0c15d3d2d216b98012c1c9c954d..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/README.md +++ /dev/null @@ -1,215 +0,0 @@ -## 拦截Web组件发起的网络请求 - -### 介绍 - -1. 本示例通过使用SchemeHandler相关API实现对Web组件发出的请求进行拦截,并为被拦截的请求提供自定义的响应头以及响应体。 -2. 本工程主要实现了对以下指南文档中 https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/web/web-scheme-handler.md 示例代码片段的工程化,主要目标是实现指南中示例代码需要与sample工程文件同源。 - -### SchemeHandlerArkts - -#### 介绍 - -1. 本示例通过使用SchemeHandler的ArkTS相关API实现对Web组件发出的请求进行拦截,并为被拦截的请求提供自定义的响应头以及响应体。 - -#### 效果预览 - -| 拦截web组件加载 | -| ------------------------------------------------------------ | -| | - -##### 使用说明 - -1. 用户访问网页时,组件会拦截用户请求并记录信息,根据特定条件返回自定义的HTML页面。 - -### SchemeHandlerNdk - -#### 主页 - -1. 本示例通过使用SchemeHandler NDK API实现对Web组件发出的请求进行拦截,并为被拦截的请求提供自定义的响应头以及响应体。 - -##### 效果预览 - -| 主页 | -|:----------------------:| -| | - -##### 使用说明 - -1. 打开DEMO进入首页,展示html。 -2. 点击各链接进入不同属性的拦截结果页面或读取结果页面。 - -#### 拦截视频资源 - -##### 介绍 - -1. 此处模块主要介绍通过Web组件,拦截视频资源请求,读取本地mp4文件。 - -##### 效果预览 - -| 拦截视频资源 | -| ------------------------------------------------------------ | -| | - -##### 使用说明 - -1. 通过点击主页的“拦截视频资源请求,读取本地mp4文件”链接,拦截页面请求并跳转到此页面并展示本地的mp4文件。 - -#### 忽略csp检查并拦截 - -##### 介绍 - -1. 此处模块主要介绍通过Web组件,测试三方协议忽略csp检查,并成功拦截。 - -##### 效果预览 - -| 忽略csp检查并拦截 | -| ------------------------------------------------------------ | -| | - -##### 使用说明 - -1. 通过点击主页的“测试三方协议忽略csp检查,并成功拦截”链接,展示被拦截的自定义scheme请求,该scheme需要遵循标准的scheme规则,允许忽略CSP检查。 -2. 如果要拦截自定义scheme的请求,需要提前将自定义scheme注册到Web内核。需要在Web组件初始化之前进行注册,Web组件初始化后再注册会失败。 - -#### 拦截ISOLATED属性 - -##### 介绍 - -1. 此处模块主要介绍通过Web组件,测试拦截设置ISOLATED属性的三方协议。 - -##### 效果预览 - -| 拦截ISOLATED属性 | -| ------------------------------------------------------------ | -| | - -##### 使用说明 - -1. 通过点击主页的“测试拦截设置ISOLATED属性的三方协议”链接,展示被拦截的带有ISOLATED属性的自定义scheme请求,该scheme的请求必须从相同scheme加载的网页中发起。 -2. 如果要拦截自定义scheme的请求,需要提前将自定义scheme注册到Web内核。需要在Web组件初始化之前进行注册,Web组件初始化后再注册会失败。 - -#### 拦截LOCAL属性 - -##### 介绍 - -1. 此处模块主要介绍通过Web组件,测试拦截设置LOCAL属性的三方协议。 - -##### 效果预览 - -| 拦截LOCAL属性 | -| ------------------------------------------------------------ | -| | - -##### 使用说明 - -1. 通过点击主页的“测试拦截设置LOCAL属性的三方协议”链接,展示被拦截的带有LOCAL属性的自定义scheme请求,该scheme需要遵循与“file” scheme一样的规则。 -2. 如果要拦截自定义scheme的请求,需要提前将自定义scheme注册到Web内核。需要在Web组件初始化之前进行注册,Web组件初始化后再注册会失败。 - -#### 拦截service worker - -##### 介绍 - -1. 此处模块主要介绍通过Web组件,测试拦截service worker触发的请求。 - -##### 效果预览 - -| 拦截service worker | -| ------------------------------------------------------------ | -| | - -##### 使用说明 - -1. 通过点击主页的“测试拦截service worker触发的请求”链接,展示被拦截的Web组件发出的scheme为“custom”的请求。 -2. 如果要拦截自定义scheme的请求,需要提前将自定义scheme注册到Web内核。需要在Web组件初始化之前进行注册,Web组件初始化后再注册会失败。 - -#### 测试读取blob类型http body stream - -##### 介绍 - -1. 此处模块主要介绍通过Web组件,测试读取blob类型http body stream。 - -##### 效果预览 - -| 测试读取blob类型http body stream | -| ------------------------------------------------------------ | -| | - -##### 使用说明 - -1. 通过点击主页的“测试读取blob类型http body stream”链接,跳转至post_data.html,通过"test xhr post"或"test xhr put"按键,创建blob类型的对应请求,并发送至服务端,在设备日志中可查看发送结果。 - -#### 测试读取chunked类型http body stream - -##### 介绍 - -1. 此处模块主要介绍通过Web组件,测试读取chunked类型http body stream。 - -##### 效果预览 - -| 测试读取chunked类型http body stream | -| ------------------------------------------------------------ | -| | - -##### 使用说明 - -1. 通过点击主页的“测试读取chunked类型http body stream”链接,跳转至pchunked_post_stream.html,通过"test post chunked http body"按键,创建chunked类型的请求,并以POST方式发送至服务端,在设备日志中可查看发送结果。 - -### 工程目录 - -``` -├── entry -│ └── src -│ └── main -│ ├── cpp // C++代码区 -│ │ ├── CMakeLists.txt // CMAKE配置文件 -│ │ ├── hello.cpp // Native业务代码实现 -│ │ ├── rawfile_request.cpp // RawfileRequest实现 -│ │ ├── rawfile_request.h // RawfileRequest类 -│ │ └── types -│ │ └── libentry // C++接口导出 -│ │ ├── Index.d.ts -│ │ └── oh-package.json5 -│ ├── ets // ArkTS代码区 -│ │ ├── entryability -│ │ │ └── EntryAbility.ets // 入口类 -│ │ ├── entrybackupability -│ │ │ └── EntryBackupAbility.ets // 备份恢复框架 -│ │ └── pages -│ │ └── Index.ets // 主页 -| | |── SchemeHandlerArkts.ets -| | |── SchemeHandlerNdk.ets -│ └── resources // 应用资源文件 -``` - -### 具体实现 - -* 本示例通过使用SchemeHandler相关API实现对Web组件发出的请求进行拦截,并为被拦截的请求提供自定义的响应头以及响应体。 - * 为Web组件设置SchemeHandler:通过SchemeHandler拦截Web组件或者ServiceWorker发出的HTTP(s)或者自定义协议的请求。Ndk源码参考[hello.cpp](./entry/src/main/cpp/hello.cpp),ArkTS源码参考[SchemeHandlerArkts.ets](./entry/src/main/ets/pages/SchemeHandlerArkts.ets) - * 获取被拦截请求的信息:在请求开始的回调中,应用可以获取请求的基本信息。Ndk源码参考[rawfile_request.cpp](./entry/src/main/cpp/rawfile_request.cpp),ArkTS源码参考[SchemeHandlerArkts.ets](./entry/src/main/ets/pages/SchemeHandlerArkts.ets) - * 拦截Web内核的请求,并为被拦截的请求提供自定义的响应体:网络拦截支持在worker线程以流方式为被拦截的请求提供自定义的响应体。Ndk源码参考[rawfile_request.cpp](./entry/src/main/cpp/rawfile_request.cpp),ArkTS源码参考[SchemeHandlerArkts.ets](./entry/src/main/ets/pages/SchemeHandlerArkts.ets) - -### 相关权限 - -[ohos.permission.INTERNET](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissioninternet) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568。 -2. 本示例支持API14版本SDK,SDK版本号(API Version 14 Release)。 -3. 本示例需要使用DevEco Studio 版本号(5.0.1Release)才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkWeb/ArkWebSchemeHandler > .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/ArkWebKit/ArkWebSchemeHandler/build-profile.json5 b/ArkWebKit/ArkWebSchemeHandler/build-profile.json5 deleted file mode 100644 index 023caeeb56c41dc1ce697cbf21433d4fd6ee6543..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/build-profile.json5 +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2025 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": "5.0.2(14)", - "targetSdkVersion": "5.0.2(14)", - "runtimeOS": "HarmonyOS", - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} diff --git a/ArkWebKit/ArkWebSchemeHandler/code-linter.json5 b/ArkWebKit/ArkWebSchemeHandler/code-linter.json5 deleted file mode 100644 index 5c4682f8164874ec7e9cb8f99ff8b3228ffbc126..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/code-linter.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/build-profile.json5 b/ArkWebKit/ArkWebSchemeHandler/entry/build-profile.json5 deleted file mode 100644 index fea31f4580540c7c560b62bf531292c471c410f1..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/hvigorfile.ts b/ArkWebKit/ArkWebSchemeHandler/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkWebKit/ArkWebSchemeHandler/entry/obfuscation-rules.txt b/ArkWebKit/ArkWebSchemeHandler/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/ArkWebKit/ArkWebSchemeHandler/entry/oh-package.json5 b/ArkWebKit/ArkWebSchemeHandler/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/CMakeLists.txt b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 27bc12820c74e082ddcb3dbdb80db75951d72222..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.4.1) -project(schemehandler) - - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - - -if(DEFINED PACKAGE_INFO_FILE) - include(${PACKAGE_INFO_FILE}) -endif() - - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - - -add_library(entry SHARED rawfile_request.cpp hello.cpp) -target_link_libraries(entry PUBLIC librawfile.z.so libace_napi.z.so libohweb.so libhilog_ndk.z.so) \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/hello.cpp b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/hello.cpp deleted file mode 100644 index 21abcb034d99a7e50714ac63167f7b1d76ac20a2..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/hello.cpp +++ /dev/null @@ -1,139 +0,0 @@ -#include "hilog/log.h" -#include "napi/native_api.h" -#include "rawfile_request.h" -#include "rawfile/raw_file_manager.h" -#include "web/arkweb_scheme_handler.h" -#include "web/arkweb_net_error_list.h" - -#undef LOG_TAG -#define LOG_TAG "ss-handler" - -ArkWeb_SchemeHandler *g_schemeHandler; -ArkWeb_SchemeHandler *g_schemeHandlerForSW; -NativeResourceManager *g_resourceManager; - -// 注册三方协议的配置,需要在Web内核初始化之前调用,否则会注册失败。 -static napi_value RegisterCustomSchemes(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "register custom schemes"); - OH_ArkWeb_RegisterCustomSchemes("custom", ARKWEB_SCHEME_OPTION_STANDARD | ARKWEB_SCHEME_OPTION_CORS_ENABLED); - OH_ArkWeb_RegisterCustomSchemes("custom-local", ARKWEB_SCHEME_OPTION_LOCAL); - OH_ArkWeb_RegisterCustomSchemes("custom-csp-bypassing", ARKWEB_SCHEME_OPTION_CSP_BYPASSING | ARKWEB_SCHEME_OPTION_STANDARD); - OH_ArkWeb_RegisterCustomSchemes("custom-isolated", ARKWEB_SCHEME_OPTION_DISPLAY_ISOLATED); - return nullptr; -} - -// 请求开始的回调,在该函数中我们创建一个RawfileRequest来实现对Web内核请求的拦截。 -void OnURLRequestStart(const ArkWeb_SchemeHandler *schemeHandler, - ArkWeb_ResourceRequest *resourceRequest, - const ArkWeb_ResourceHandler *resourceHandler, - bool *intercept) -{ - *intercept = true; - RawfileRequest* request = new RawfileRequest(resourceRequest, resourceHandler, g_resourceManager); - OH_ArkWebResourceRequest_SetUserData(resourceRequest, request); - request->Start(); -} - -// 请求结束的回调,在该函数中我们需要标记RawfileRequest已经结束了,内部不应该再使用ResourceHandler。 -void OnURLRequestStop(const ArkWeb_SchemeHandler *schemeHandler, - const ArkWeb_ResourceRequest *request) -{ - if (!request) { - OH_LOG_ERROR(LOG_APP, "on request stop request is nullptr."); - return; - } - - RawfileRequest *rawfileRequest = (RawfileRequest *)OH_ArkWebResourceRequest_GetUserData(request); - if (rawfileRequest) { - rawfileRequest->Stop(); - delete rawfileRequest; - } -} - -void OnURLRequestStartForSW(const ArkWeb_SchemeHandler *schemeHandler, - ArkWeb_ResourceRequest *resourceRequest, - const ArkWeb_ResourceHandler *resourceHandler, - bool *intercept) -{ - *intercept = true; - RawfileRequest* request = new RawfileRequest(resourceRequest, resourceHandler, g_resourceManager); - OH_ArkWebResourceRequest_SetUserData(resourceRequest, request); - request->Start(); -} - -void OnURLRequestStopForSW(const ArkWeb_SchemeHandler *schemeHandler, - const ArkWeb_ResourceRequest *request) -{ - if (!request) { - OH_LOG_ERROR(LOG_APP, "on request stop request is nullptr."); - return; - } - - RawfileRequest *rawfileRequest = (RawfileRequest *)OH_ArkWebResourceRequest_GetUserData(request); - if (rawfileRequest) { - rawfileRequest->Stop(); - delete rawfileRequest; - } -} - -// 设置SchemeHandler。 -static napi_value SetSchemeHandler(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "set scheme handler"); - OH_ArkWeb_CreateSchemeHandler(&g_schemeHandler); - OH_ArkWeb_CreateSchemeHandler(&g_schemeHandlerForSW); - - OH_ArkWebSchemeHandler_SetOnRequestStart(g_schemeHandler, OnURLRequestStart); - OH_ArkWebSchemeHandler_SetOnRequestStop(g_schemeHandler, OnURLRequestStop); - - OH_ArkWebSchemeHandler_SetOnRequestStart(g_schemeHandlerForSW, OnURLRequestStart); - OH_ArkWebSchemeHandler_SetOnRequestStop(g_schemeHandlerForSW, OnURLRequestStop); - - OH_ArkWeb_SetSchemeHandler("custom", "scheme-handler", g_schemeHandler); - OH_ArkWeb_SetSchemeHandler("custom-csp-bypassing", "scheme-handler", g_schemeHandler); - OH_ArkWeb_SetSchemeHandler("custom-isolated", "scheme-handler", g_schemeHandler); - OH_ArkWeb_SetSchemeHandler("custom-local", "scheme-handler", g_schemeHandler); - OH_ArkWeb_SetSchemeHandler("https", "scheme-handler", g_schemeHandler); - OH_ArkWeb_SetSchemeHandler("http", "scheme-handler", g_schemeHandler); - - OH_ArkWebServiceWorker_SetSchemeHandler("https", g_schemeHandlerForSW); - return nullptr; -} - -static napi_value InitResourceManager(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value argv[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - g_resourceManager = OH_ResourceManager_InitNativeResourceManager(env, argv[0]); - return nullptr; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - {"setSchemeHandler", nullptr, SetSchemeHandler, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"initResourceManager", nullptr, InitResourceManager, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"registerCustomSchemes", nullptr, RegisterCustomSchemes, nullptr, nullptr, nullptr, napi_default, nullptr} - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/rawfile_request.cpp b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/rawfile_request.cpp deleted file mode 100644 index 669eb9724709765f8eec5e6a06992da154d5b4f3..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/rawfile_request.cpp +++ /dev/null @@ -1,261 +0,0 @@ -#include "rawfile_request.h" - - -#include "threads.h" - - -#include "hilog/log.h" -#include "rawfile/raw_file.h" -#include "rawfile/raw_file_manager.h" - - -#undef LOG_TAG -#define LOG_TAG "ss-handler" - - -namespace { - - -uint8_t buffer[1024]; -cnd_t http_body_cnd; -mtx_t http_body_mtx; - - -// HttpBodyStream的读回调。 -void ReadCallback(const ArkWeb_HttpBodyStream *httpBodyStream, uint8_t* buffer, int bytesRead) -{ - OH_LOG_INFO(LOG_APP, "read http body back."); - bool isEof = OH_ArkWebHttpBodyStream_IsEof(httpBodyStream); - if (!isEof && bytesRead != 0) { - memset(buffer, 0, 1000); - OH_ArkWebHttpBodyStream_Read(httpBodyStream, buffer, 1000); - } else { - RawfileRequest *rawfileRequest = (RawfileRequest *)OH_ArkWebHttpBodyStream_GetUserData(httpBodyStream); - if (rawfileRequest) { - rawfileRequest->ReadRawfileDataOnWorkerThread(); - cnd_signal(&http_body_cnd); - } - } -} - - -int ReadHttpBodyOnWorkerThread(void* userData) -{ - memset(buffer, 0, 1000); - ArkWeb_HttpBodyStream *httpBodyStream = (ArkWeb_HttpBodyStream *)userData; - OH_ArkWebHttpBodyStream_Read(httpBodyStream, buffer, 1000); - cnd_init(&http_body_cnd); - mtx_init(&http_body_mtx, mtx_plain); - cnd_wait(&http_body_cnd, &http_body_mtx); - return 0; -} - - -int ReadRawfileOnWorkerThread(void* userData) -{ - RawfileRequest * rawfileRequest = (RawfileRequest *)userData; - if (rawfileRequest) { - rawfileRequest->ReadRawfileDataOnWorkerThread(); - } - return 0; -} - - -// ArkWeb_HttpBodyStream的初始化回调。 -void InitCallback(const ArkWeb_HttpBodyStream *httpBodyStream, ArkWeb_NetError result) -{ - OH_LOG_INFO(LOG_APP, "init http body stream done %{public}d.", result); - bool isChunked = OH_ArkWebHttpBodyStream_IsChunked(httpBodyStream); - OH_LOG_INFO(LOG_APP, "http body stream is chunked %{public}d.", isChunked); - thrd_t th; - if (thrd_create(&th, ReadHttpBodyOnWorkerThread, (void *)httpBodyStream) != thrd_success) { - OH_LOG_ERROR(LOG_APP, "create thread failed."); - return; - } - - - if (thrd_detach(th) != thrd_success) { - OH_LOG_ERROR(LOG_APP, "detach thread failed."); - } -} - - -const int blockSize = 1024 * 8; - - -} // namespace - - -RawfileRequest::RawfileRequest(const ArkWeb_ResourceRequest *resourceRequest, - const ArkWeb_ResourceHandler *resourceHandler, - const NativeResourceManager* resourceManager) - : resourceRequest_(resourceRequest), - resourceHandler_(resourceHandler), - resourceManager_(resourceManager) {} - - -RawfileRequest::~RawfileRequest() { - if (stream_) { - OH_ArkWebResourceRequest_DestroyHttpBodyStream(stream_); - } -} - - -void RawfileRequest::Start() -{ - OH_LOG_INFO(LOG_APP, "start a rawfile request."); - char* url; - OH_ArkWebResourceRequest_GetUrl(resourceRequest_, &url); - std::string urlStr(url); - std::size_t position = urlStr.rfind('/'); - if (position != std::string::npos) { - rawfilePath_ = urlStr.substr(position + 1); - } - OH_ArkWeb_ReleaseString(url); - - - OH_ArkWeb_CreateResponse(&response_); - OH_ArkWebResourceRequest_GetHttpBodyStream(resourceRequest(), &stream_); - if (stream_) { - OH_LOG_ERROR(LOG_APP, "have http body stream"); - OH_ArkWebHttpBodyStream_SetUserData(stream_, this); - OH_ArkWebHttpBodyStream_SetReadCallback(stream_, ReadCallback); - OH_ArkWebHttpBodyStream_Init(stream_, InitCallback); - } else { - thrd_t th; - if (thrd_create(&th, ReadRawfileOnWorkerThread, (void *)this) != thrd_success) { - OH_LOG_ERROR(LOG_APP, "create thread failed."); - return; - } - - - if (thrd_detach(th) != thrd_success) { - OH_LOG_ERROR(LOG_APP, "detach thread failed."); - } - } -} - - -// 在worker线程中读取rawfile,并通过ResourceHandler返回给Web内核。 -void RawfileRequest::ReadRawfileDataOnWorkerThread() -{ - OH_LOG_INFO(LOG_APP, "read rawfile in worker thread."); - const struct UrlInfo { - std::string resource; - std::string mimeType; - } urlInfos[] = { - {"test.html", "text/html"}, - {"video.html", "text/html"}, - {"isolated.html", "text/html"}, - {"csp_bypassing.html", "text/html"}, - {"post_data.html", "text/html"}, - {"chunked_post_stream.html", "text/html"}, - {"local.html", "text/html"}, - {"service_worker.html", "text/html"}, - {"csp_script.js", "text/javascript"}, - {"sw.js", "text/javascript"}, - {"isolated_script.js", "text/javascript"}, - {"local_script.js", "text/javascript"}, - {"test.mp4", "video/mp4"}, - {"xhr", "application/json"} - }; - - - if (!resourceManager()) { - OH_LOG_ERROR(LOG_APP, "read rawfile error, resource manager is nullptr."); - return; - } - - - RawFile *rawfile = OH_ResourceManager_OpenRawFile(resourceManager(), rawfilePath().c_str()); - if (!rawfile) { - OH_ArkWebResponse_SetStatus(response(), 404); - } else { - OH_ArkWebResponse_SetStatus(response(), 200); - } - - - for (auto &urlInfo : urlInfos) { - if (urlInfo.resource == rawfilePath()) { - OH_ArkWebResponse_SetMimeType(response(), urlInfo.mimeType.c_str()); - break; - } - } - OH_ArkWebResponse_SetCharset(response(), "UTF-8"); - - - long len = OH_ResourceManager_GetRawFileSize(rawfile); - OH_ArkWebResponse_SetHeaderByName(response(), "content-length", std::to_string(len).c_str(), false); - DidReceiveResponse(); - - - long consumed = 0; - uint8_t buffer[blockSize]; - while (true) { - int ret = OH_ResourceManager_ReadRawFile(rawfile, buffer, blockSize); - OH_LOG_INFO(LOG_APP, "read rawfile %{public}d bytes.", ret); - if (ret == 0) { - break; - } - consumed += ret; - OH_ResourceManager_SeekRawFile(rawfile, consumed, 0); - DidReceiveData(buffer, ret); - memset(buffer, 0, blockSize); - } - - - OH_ResourceManager_CloseRawFile(rawfile); - DidFinish(); -} - - -void RawfileRequest::Stop() -{ - OH_LOG_INFO(LOG_APP, "stop the rawfile request."); - std::lock_guard guard(mutex_); - stopped_ = true; - if (response_) { - OH_ArkWeb_DestroyResponse(response_); - } - OH_ArkWebResourceRequest_Destroy(resourceRequest_); - OH_ArkWebResourceHandler_Destroy(resourceHandler_); -} - - -void RawfileRequest::DidReceiveResponse() -{ - OH_LOG_INFO(LOG_APP, "did receive response."); - std::lock_guard guard(mutex_); - if (!stopped_) { - OH_ArkWebResourceHandler_DidReceiveResponse(resourceHandler_, response_); - } -} - - -void RawfileRequest::DidReceiveData(const uint8_t *buffer, int64_t bufLen) -{ - OH_LOG_INFO(LOG_APP, "did receive data."); - std::lock_guard guard(mutex_); - if (!stopped_) { - OH_ArkWebResourceHandler_DidReceiveData(resourceHandler_, buffer, bufLen); - } -} - - -void RawfileRequest::DidFinish() -{ - OH_LOG_INFO(LOG_APP, "did finish."); - std::lock_guard guard(mutex_); - if (!stopped_) { - OH_ArkWebResourceHandler_DidFinish(resourceHandler_); - } -} - - -void RawfileRequest::DidFailWithError(ArkWeb_NetError errorCode) -{ - OH_LOG_INFO(LOG_APP, "did finish with error %{public}d.", errorCode); - if (!stopped_) { - OH_ArkWebResourceHandler_DidFailWithError(resourceHandler_, errorCode); - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/rawfile_request.h b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/rawfile_request.h deleted file mode 100644 index ce72bce77ab7fea89a360b6ab025c88c9b240b38..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/rawfile_request.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef RAWFILE_REQUEST_H -#define RAWFILE_REQUEST_H - - -#include -#include - - -#include -#include "web/arkweb_scheme_handler.h" -#include "web/arkweb_net_error_list.h" - - -class RawfileRequest { -public: - RawfileRequest(const ArkWeb_ResourceRequest *resourceRequest, - const ArkWeb_ResourceHandler *resourceHandler, - const NativeResourceManager* resourceManager); - ~RawfileRequest(); - - - void Start(); - void Stop(); - void ReadRawfileDataOnWorkerThread(); - - - const ArkWeb_ResourceHandler *resourceHandler() { return resourceHandler_; } - const ArkWeb_ResourceRequest *resourceRequest() { return resourceRequest_; } - const NativeResourceManager *resourceManager() { return resourceManager_; } - ArkWeb_Response *response() { return response_; } - ArkWeb_HttpBodyStream *stream() { return stream_; } - const std::string rawfilePath() { return rawfilePath_; } - - - void DidReceiveResponse(); - void DidReceiveData(const uint8_t *buffer, int64_t bufLen); - void DidFinish(); - void DidFailWithError(ArkWeb_NetError errorCode); - - -private: - const ArkWeb_ResourceRequest *resourceRequest_{nullptr}; - const ArkWeb_ResourceHandler *resourceHandler_{nullptr}; - const NativeResourceManager *resourceManager_{nullptr}; - ArkWeb_Response *response_; - bool stopped_{false}; - std::string rawfilePath_; - ArkWeb_HttpBodyStream *stream_{nullptr}; - std::mutex mutex_; -}; - - -#endif // RAWFILE_REQUEST_H \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/types/libentry/Index.d.ts b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index f34c7c5744d67baf13ba4e26d3cd786025f08b90..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const registerCustomSchemes: () => void; -export const setSchemeHandler: () => void; -export const initResourceManager: (resmgr: resourceManager.ResourceManager) => void; \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/types/libentry/oh-package.json5 b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index ea410725a8826704d061021d98cf02aa76cd8016..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/entryability/EntryAbility.ets b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index ecc7a5eb82402045f42ecd578d0b7335ba963a53..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2025 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'; -import testNapi from 'libentry.so'; -import { webview } from '@kit.ArkWeb'; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - // 注册三方协议的配置。 - testNapi.registerCustomSchemes(); - // 初始化Web组件内核,该操作会初始化Browser进程以及创建BrowserContext。 - webview.WebviewController.initializeWebEngine(); - // 设置SchemeHandler。 - testNapi.setSchemeHandler(); - } - - onDestroy(): void { - - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - return; - } - }); - } - - onWindowStageDestroy(): void { - - } - - onForeground(): void { - - } - - onBackground(): void { - - } -}; \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 48fcfc36922b540f93f6de56c15880c8db6bb2a5..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/pages/Index.ets b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 44e6604ad8594fc5020e7468f8f5478f633cf23c..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2025 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'; - -@Entry -@Component -struct Index { - build() { - Column({ space: 10 }) { - Button('SchemeHandlerArkts') - .onClick(() => { - this.getUIContext().getRouter().pushUrl({ - url: 'pages/SchemeHandlerArkts', - }) - .catch((error: BusinessError) => { - console.error(`pushUrl failed, code is ${error.code}, message is ${error.message}`); - }) - }) - Button('SchemeHandlerNdk') - .onClick(() => { - this.getUIContext().getRouter().pushUrl({ - url: 'pages/SchemeHandlerNdk', - }) - .catch((error: BusinessError) => { - console.error(`pushUrl failed, code is ${error.code}, message is ${error.message}`); - }) - }) - }.height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/pages/SchemeHandlerArkts.ets b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/pages/SchemeHandlerArkts.ets deleted file mode 100644 index 1dafcb92885dca9498570c96d1fb5e189cc630dc..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/pages/SchemeHandlerArkts.ets +++ /dev/null @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2025 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 { webview, WebNetErrorList } from '@kit.ArkWeb'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { buffer } from '@kit.ArkTS'; - -@Entry -@Component -struct WebComponent { - controller: webview.WebviewController = new webview.WebviewController(); - schemeHandler: webview.WebSchemeHandler = new webview.WebSchemeHandler(); - htmlData: string = 'Source:
source
'; - - build() { - Column() { - Web({ src: 'https://www.example.com', controller: this.controller }) - .onControllerAttached(() => { - try { - this.schemeHandler.onRequestStart - ((request: webview.WebSchemeHandlerRequest, resourceHandler: webview.WebResourceHandler) => { - console.info('[schemeHandler] onRequestStart'); - try { - console.info('[schemeHandler] onRequestStart url:' + request.getRequestUrl()); - console.info('[schemeHandler] onRequestStart method:' + request.getRequestMethod()); - console.info('[schemeHandler] onRequestStart referrer:' + request.getReferrer()); - console.info('[schemeHandler] onRequestStart isMainFrame:' + request.isMainFrame()); - console.info('[schemeHandler] onRequestStart hasGesture:' + request.hasGesture()); - console.info('[schemeHandler] onRequestStart header size:' + request.getHeader().length); - console.info('[schemeHandler] onRequestStart resource type:' + request.getRequestResourceType()); - console.info('[schemeHandler] onRequestStart frame url:' + request.getFrameUrl()); - let header = request.getHeader(); - for (let i = 0; i < header.length; i++) { - console.info('[schemeHandler] onRequestStart header:' + header[i].headerKey + ' ' + header[i].headerValue); - } - let stream = request.getHttpBodyStream(); - if (stream) { - console.info('[schemeHandler] onRequestStart has http body stream'); - } else { - console.info('[schemeHandler] onRequestStart has no http body stream'); - } - } catch (error) { - console.error(`ErrorCode: ${(error as BusinessError).code}, Message: ${(error as BusinessError).message}`); - } - - if (request.getRequestUrl().endsWith('example.com')) { - return false; - } - - let response = new webview.WebSchemeHandlerResponse(); - try { - response.setNetErrorCode(WebNetErrorList.NET_OK); - response.setStatus(200); - response.setStatusText('OK'); - response.setMimeType('text/html'); - response.setEncoding('utf-8'); - response.setHeaderByName('header1', 'value1', false); - } catch (error) { - console.error(`[schemeHandler] ErrorCode: ${(error as BusinessError).code}, Message: ${(error as BusinessError).message}`); - } - - // 调用didFinish/didFail前需要优先调用didReceiveResponse将构造的响应头传递给被拦截的请求。 - let buf = buffer.from(this.htmlData) - try { - if (buf.length === 0) { - console.info('[schemeHandler] length 0'); - resourceHandler.didReceiveResponse(response); - // 如果认为buf.length为0是正常情况,则调用resourceHandler.didFinish,否则调用resourceHandler.didFail。 - resourceHandler.didFail(WebNetErrorList.ERR_FAILED); - } else { - console.info('[schemeHandler] length 1'); - resourceHandler.didReceiveResponse(response); - resourceHandler.didReceiveResponseBody(buf.buffer); - resourceHandler.didFinish(); - } - } catch (error) { - console.error(`[schemeHandler] ErrorCode: ${(error as BusinessError).code}, Message: ${(error as BusinessError).message}`); - } - return true; - }) - - this.schemeHandler.onRequestStop((request: webview.WebSchemeHandlerRequest) => { - console.info('[schemeHandler] onRequestStop'); - }); - - this.controller.setWebSchemeHandler('https', this.schemeHandler); - } catch (error) { - console.error(`ErrorCode: ${(error as BusinessError).code}, Message: ${(error as BusinessError).message}`); - } - }) - .javaScriptAccess(true) - .domStorageAccess(true) - } - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/pages/SchemeHandlerNdk.ets b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/pages/SchemeHandlerNdk.ets deleted file mode 100644 index 5a1b037d740ace539a343891596f258012f51948..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/ets/pages/SchemeHandlerNdk.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2025 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 testNapi from 'libentry.so'; -import { webview } from '@kit.ArkWeb'; -import { resourceManager } from '@kit.LocalizationKit'; - -@Entry -@Component -struct Index { - myController: webview.WebviewController = new webview.WebviewController('scheme-handler'); - - build() { - Row() { - Column() { - Button('go_back').onClick( event => { - this.myController.backward(); - }) - - Web({ src: $rawfile('test.html'), controller: this.myController}) - .javaScriptAccess(true) - .width('100%') - .height('100%') - .databaseAccess(true) - .fileAccess(false) - .domStorageAccess(true) - .cacheMode(CacheMode.Default) - .onPageBegin( event => { - if (this.getUIContext().getHostContext()) { - testNapi.initResourceManager(this.getUIContext().getHostContext()!.resourceManager); - } - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/module.json5 b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/module.json5 deleted file mode 100644 index b2331c8946c4bc01c590af2e9304a18691020511..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/module.json5 +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2025 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" - } - ], - } - ], - "requestPermissions":[ - { - "name" : "ohos.permission.INTERNET" - } - ] - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/element/color.json b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/element/float.json b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/element/string.json b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f87c1e22bcded55626fbf8b4ebeace8f575a5d24..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "ArkWebSchemeHandler" - }, - { - "name": "go_back", - "value": "go back" - } - ] -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/background.png b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/foreground.png b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/layered_image.json b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/startIcon.png b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/profile/backup_config.json b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/profile/main_pages.json b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 9982b97846395554fb648d5a63392bf0d11c3a2c..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/SchemeHandlerArkts", - "pages/SchemeHandlerNdk" - ] -} diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/dark/element/color.json b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/cat.svg b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/cat.svg deleted file mode 100644 index e2abac4d22da57f6217cda27e2087d3863bb3fe2..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/cat.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/chunked_post_stream.html b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/chunked_post_stream.html deleted file mode 100644 index a4f7a11242619ba582c56c90bf0298a480da106d..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/chunked_post_stream.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/csp_bypassing.html b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/csp_bypassing.html deleted file mode 100644 index 616b8e984716579bfd189e96f2522ba9238e2c1d..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/csp_bypassing.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -

scheme: custom-csp-bypassing

-

options: ARKWEB_SCHEME_OPTION_CSP_BYPASSING | ARKWEB_SCHEME_OPTION_STANDARD

- - - \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/csp_script.js b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/csp_script.js deleted file mode 100644 index 07a301212fc48d7bc73d81f7e441c9aba461f07f..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/csp_script.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -const body = document.body; -const element = document.createElement('div'); -element.textContent = 'csp_script.js bypass the csp rules'; -body.appendChild(element); \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/isolated.html b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/isolated.html deleted file mode 100644 index 0ef20f02ff5c3ce6ca5094d78fd54cddabb476b5..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/isolated.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - -

scheme: custom-isolated

-

options: ARKWEB_SCHEME_OPTION_DISPLAY_ISOLATED

-
isolated_script.js 被拦截
- - - \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/isolated_script.js b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/isolated_script.js deleted file mode 100644 index e97a5f9602d358e549e099823560af002bd8c066..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/isolated_script.js +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -const element = document.getElementById('isolated_test'); -element.textContent = 'isolated_script.js not blocked'; \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/local.html b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/local.html deleted file mode 100644 index 5a90787ee61f981663b7111383db01908e5c68af..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/local.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - -

scheme: custom-local

-

options: ARKWEB_SCHEME_OPTION_LOCAL

-
local_script.js 被拦截
- - - \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/local_script.js b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/local_script.js deleted file mode 100644 index 94bcdac42f7805f45ee9266943f600a14dee71af..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/local_script.js +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -const element = document.getElementById('local_test'); -element.textContent = 'local_script.js not blocked.'; \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/post_data.html b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/post_data.html deleted file mode 100644 index fa62fceb7e45e2c134121a866944686c47f4dbfc..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/post_data.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/service_worker.html b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/service_worker.html deleted file mode 100644 index c9f84b397596073642f4d33c29731bdcdc766de0..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/service_worker.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/sw.js b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/sw.js deleted file mode 100644 index d1f18a5f0df928d07406d30bb45da0f23519a0cb..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/sw.js +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -self.addEventListener('install', event => { - console.log('v1 installing'); - event.waitUntil( - caches.open('static-v1').then(cache => cache.add('/cat.svg')) - ); -}); - - -self.addEventListener('activate', event => { - console.log("v1 now redy to handle fetches."); -}); \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/test.html b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/test.html deleted file mode 100644 index 430349d6993788f8f9b3110d9b07334b4bc60c5c..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/test.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - -

网络拦截测试demo

-拦截视频资源请求,读取本地mp4文件
-测试三方协议忽略csp检查,并成功拦截
-测试拦截设置ISOLATED属性的三方协议
-测试拦截设置LOCAL属性的三方协议
-测试拦截service worker触发的请求
-测试读取blob类型http body stream
-测试读取chunked类型http body stream - - \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/test.mp4 b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/test.mp4 deleted file mode 100644 index 9b0cc327db31d79a3fee73803deebe0762afe156..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/test.mp4 and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/video.html b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/video.html deleted file mode 100644 index d036984efd0b1633a80a5ca92808fbf6e5e201e9..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/video.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/xhr b/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/xhr deleted file mode 100644 index 9e26dfeeb6e641a33dae4961196235bdb965b21b..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/main/resources/rawfile/xhr +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/mock/mock-config.json5 b/ArkWebKit/ArkWebSchemeHandler/entry/src/mock/mock-config.json5 deleted file mode 100755 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkWebKit/ArkWebSchemeHandler/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkWebKit/ArkWebSchemeHandler/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100755 index 41690369f23925308b89af9c618e0dbc994d7cd8..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - - /* - * 打开应用,点击 SchemeHandlerArkts 按钮 - * 拦截Web组件发出的请求,并为被拦截的请求提供自定义的响应头以及响应体。 - */ - it('SchemeHandlerArkts', 0, async (done: Function) => { - console.info('uitest: SchemeHandlerArkts begin'); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - const driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - await driver.delayMs(1000); - - const button1 = await driver.findComponent(ON.text('SchemeHandlerArkts')); - await button1.click(); - await driver.delayMs(1000); - - const web1 = await driver.findComponent(ON.type('Web')); - let src: string = await web1.getText(); - expect(src).assertContain('www.example.com'); - - await driver.pressBack(); - await driver.delayMs(1000); - console.info('uitest: SchemeHandlerArkts end'); - done(); - }); - - /* - * 打开应用,点击 SchemeHandlerNdk 按钮 - */ - it('SchemeHandlerNdk', 0, async (done: Function) => { - console.info('uitest: SchemeHandlerNdk begin'); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - const driver = Driver.create(); - await driver.delayMs(1000); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - await driver.delayMs(1000); - - const button1 = await driver.findComponent(ON.text('SchemeHandlerNdk')); - await button1.click(); - await driver.delayMs(1000); - - const web1 = await driver.findComponent(ON.type('Web')); - let src: string = await web1.getText(); - expect(src).assertContain('test.html'); - - await driver.pressBack(); - await driver.delayMs(1000); - await driver.pressBack(); - await driver.delayMs(1000); - console.info('uitest: SchemeHandlerNdk end'); - done(); - }); - }) -} - diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/ohosTest/ets/test/List.test.ets b/ArkWebKit/ArkWebSchemeHandler/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100755 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/ohosTest/module.json5 b/ArkWebKit/ArkWebSchemeHandler/entry/src/ohosTest/module.json5 deleted file mode 100755 index 9983b2ba4e55e31a172f0328c82c9a75bfa00ded..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/test/List.test.ets b/ArkWebKit/ArkWebSchemeHandler/entry/src/test/List.test.ets deleted file mode 100755 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/entry/src/test/LocalUnit.test.ets b/ArkWebKit/ArkWebSchemeHandler/entry/src/test/LocalUnit.test.ets deleted file mode 100755 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/ArkWebKit/ArkWebSchemeHandler/hvigor/hvigor-config.json5 b/ArkWebKit/ArkWebSchemeHandler/hvigor/hvigor-config.json5 deleted file mode 100644 index 65dd6e421ed1979c8ab9b0f138616e0cd46889d9..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2025 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.1", - "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/ArkWebKit/ArkWebSchemeHandler/hvigorfile.ts b/ArkWebKit/ArkWebSchemeHandler/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/ArkWebKit/ArkWebSchemeHandler/oh-package.json5 b/ArkWebKit/ArkWebSchemeHandler/oh-package.json5 deleted file mode 100644 index 14655ea1c07e1b7b8b8eb3d9f6813577b90f6a0f..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/ArkWebKit/ArkWebSchemeHandler/ohosTest.md b/ArkWebKit/ArkWebSchemeHandler/ohosTest.md deleted file mode 100755 index 88994d792661e8887b6cf44965397d588c640a50..0000000000000000000000000000000000000000 --- a/ArkWebKit/ArkWebSchemeHandler/ohosTest.md +++ /dev/null @@ -1,11 +0,0 @@ -## SchemeHandlerArkts - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ----------------- | ------------ | ------------ | ---------------- | -------- | -------- | -| Web组件的加载Arkts页面html | 设备运转正常 | 应用启动成功 | 加载首Arkts页面html成功 | Yes | Pass | - -## SchemeHandlerNdk - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ----------------- | ------------ | ------------ | ---------------- | -------- | -------- | -| Web组件的加载Ndk页面html | 设备运转正常 | 应用启动成功 | 加载Ndk页面html成功 | Yes | Pass | diff --git a/ArkWebKit/ArkWebSchemeHandler/screenshots/ISOLATED.png b/ArkWebKit/ArkWebSchemeHandler/screenshots/ISOLATED.png deleted file mode 100644 index 10d394603912fa37f1dd3ce0275522f9ca17288c..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/screenshots/ISOLATED.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/screenshots/LOCAL.png b/ArkWebKit/ArkWebSchemeHandler/screenshots/LOCAL.png deleted file mode 100644 index 25fae824d4bac60d69fe8a08ee0f7ed98922a3bc..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/screenshots/LOCAL.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/screenshots/blob.png b/ArkWebKit/ArkWebSchemeHandler/screenshots/blob.png deleted file mode 100644 index ac0859746d2abfb5dfd1035f40c6524236bf13db..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/screenshots/blob.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/screenshots/chunked.png b/ArkWebKit/ArkWebSchemeHandler/screenshots/chunked.png deleted file mode 100644 index 49d7fe3ddbaa43a6ca2c0669460a7c8d82470623..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/screenshots/chunked.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/screenshots/csp.png b/ArkWebKit/ArkWebSchemeHandler/screenshots/csp.png deleted file mode 100644 index b6fb15b8f0f2f09392d9c002f514c8327ed03448..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/screenshots/csp.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/screenshots/home.png b/ArkWebKit/ArkWebSchemeHandler/screenshots/home.png deleted file mode 100644 index 4547549ea37b6a939048c312a67bb46ff5e3d082..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/screenshots/home.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/screenshots/image.png b/ArkWebKit/ArkWebSchemeHandler/screenshots/image.png deleted file mode 100644 index 30360c773219c30fc3b1e888dda3d89db98e668e..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/screenshots/image.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/screenshots/mp4.png b/ArkWebKit/ArkWebSchemeHandler/screenshots/mp4.png deleted file mode 100644 index f3fe7b90f038b140ab2a71e61b60d2119bab4d8b..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/screenshots/mp4.png and /dev/null differ diff --git a/ArkWebKit/ArkWebSchemeHandler/screenshots/service_worker.png b/ArkWebKit/ArkWebSchemeHandler/screenshots/service_worker.png deleted file mode 100644 index 88d73100decc1b314f63d78680464fa9d297cbea..0000000000000000000000000000000000000000 Binary files a/ArkWebKit/ArkWebSchemeHandler/screenshots/service_worker.png and /dev/null differ diff --git a/BmsSample/AppClone/.gitignore b/BmsSample/AppClone/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/AppClone/AppScope/app.json5 b/BmsSample/AppClone/AppScope/app.json5 deleted file mode 100644 index 42bc8ea7411b7ac3fb91161a0333a71deae8bb21..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/AppScope/app.json5 +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start app_clone] -{ - "app": { - // [StartExclude app_clone] - "bundleName": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name", - // [EndExclude app_clone] - "multiAppMode": { - "multiAppModeType": "appClone", - "maxCount": 2 - } - } -} -// [End app_clone] diff --git a/BmsSample/AppClone/AppScope/resources/base/element/string.json b/BmsSample/AppClone/AppScope/resources/base/element/string.json deleted file mode 100644 index 1b7880df82f5d62fe8a9334af673088d0913a5b9..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple005_app_clone" - } - ] -} diff --git a/BmsSample/AppClone/AppScope/resources/base/media/background.png b/BmsSample/AppClone/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppClone/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/AppClone/AppScope/resources/base/media/foreground.png b/BmsSample/AppClone/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppClone/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/AppClone/AppScope/resources/base/media/layered_image.json b/BmsSample/AppClone/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/AppClone/README_zh.md b/BmsSample/AppClone/README_zh.md deleted file mode 100644 index 6404552f093de71c164557cabd20fb107b451cf8..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/README_zh.md +++ /dev/null @@ -1,61 +0,0 @@ -# 创建应用分身指南文档示例 - -### 介绍 - -本示例通过配置app.json5配置文件multiAppMode字段,配置应用分身。 - -### 效果预览 - -| 桌面 | -|---------------------------------| -|![img.png](screenshots/img.png) | - -### 使用说明 - -1. 使用IDE自动签名,编译,安装。 - -2. 设置 -> 系统 -> 应用分身 -> 点击应用 创建分身。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息,multiAppMode字段配置应用分身 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/AppClone > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/AppClone/build-profile.json5 b/BmsSample/AppClone/build-profile.json5 deleted file mode 100644 index f76aea68fc1809964ab900bfb93c5970c228c47d..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppClone/code-linter.json5 b/BmsSample/AppClone/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/.gitignore b/BmsSample/AppClone/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/AppClone/entry/build-profile.json5 b/BmsSample/AppClone/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/hvigorfile.ts b/BmsSample/AppClone/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/obfuscation-rules.txt b/BmsSample/AppClone/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/AppClone/entry/oh-package.json5 b/BmsSample/AppClone/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/AppClone/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/AppClone/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/AppClone/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/src/main/ets/pages/Index.ets b/BmsSample/AppClone/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/src/main/module.json5 b/BmsSample/AppClone/entry/src/main/module.json5 deleted file mode 100644 index e4226557b12a7322c888516a211fcf6c981c7122..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/BmsSample/AppClone/entry/src/main/resources/base/element/color.json b/BmsSample/AppClone/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/src/main/resources/base/element/float.json b/BmsSample/AppClone/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/AppClone/entry/src/main/resources/base/element/string.json b/BmsSample/AppClone/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/src/main/resources/base/media/background.png b/BmsSample/AppClone/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppClone/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/AppClone/entry/src/main/resources/base/media/foreground.png b/BmsSample/AppClone/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppClone/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/AppClone/entry/src/main/resources/base/media/layered_image.json b/BmsSample/AppClone/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/src/main/resources/base/media/startIcon.png b/BmsSample/AppClone/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppClone/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/AppClone/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/AppClone/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/AppClone/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/AppClone/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/AppClone/entry/src/main/resources/dark/element/color.json b/BmsSample/AppClone/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppClone/hvigor/hvigor-config.json5 b/BmsSample/AppClone/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/AppClone/hvigorfile.ts b/BmsSample/AppClone/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/AppClone/oh-package.json5 b/BmsSample/AppClone/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/AppClone/ohosTest.md b/BmsSample/AppClone/ohosTest.md deleted file mode 100644 index bfacd086f0d2c20e344afbb1e544a8a2079e884d..0000000000000000000000000000000000000000 --- a/BmsSample/AppClone/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 创建应用分身 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-----------|-----------|-------------|--------------|--------------------------------| -| 工程编译安装 | 编译正常正常安装 | 无 | 成功拉起应用 |Pass| -| 设置中开启应用分身 | 应用安装 | 设置,系统,应用分身 | 桌面展示多个分身应用图标 |Pass| \ No newline at end of file diff --git a/BmsSample/AppClone/screenshots/img.png b/BmsSample/AppClone/screenshots/img.png deleted file mode 100644 index 33d1283ecd61e6c423bb280d8e33954399b057f4..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppClone/screenshots/img.png and /dev/null differ diff --git a/BmsSample/AppConfigurationFile/.gitignore b/BmsSample/AppConfigurationFile/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/AppConfigurationFile/AppScope/app.json5 b/BmsSample/AppConfigurationFile/AppScope/app.json5 deleted file mode 100644 index 1f82db9dfb79404f9ec5dcfe6a1a07d339b341c8..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/AppScope/app.json5 +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start app_json5] -{ - "app": { - "bundleName": "com.application.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name", - "description": "$string:description_application", - "minAPIVersion": 9, - "targetAPIVersion": 9, - "debug": false, - "car": { - "minAPIVersion": 8 - }, - // [Start app_json5_appEnvironments] - "appEnvironments": [ - { - "name":"name1", - "value": "value1" - } - ], - // [End app_json5_appEnvironments] - "maxChildProcess": 5, - // [Start app_json5_multiAppMode] - "multiAppMode": { - "multiAppModeType": "appClone", - "maxCount": 5 - }, - // [End app_json5_multiAppMode] - "hwasanEnabled": false, - "ubsanEnabled": false, - "cloudFileSyncEnabled": false, - "cloudStructuredDataSyncEnabled": false, - // [Start app_json5_configuration] - "configuration": "$profile:configuration", - // [End app_json5_configuration] - "assetAccessGroups": [ - "com.ohos.photos", - "com.ohos.screenshot", - "com.ohos.note" - ], - "startMode": "mainTask" - } -} -// [End app_json5] \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/AppScope/resources/base/element/string.json b/BmsSample/AppConfigurationFile/AppScope/resources/base/element/string.json deleted file mode 100644 index 07978a027fe7c6c882e49dbcdfa222298bdabe62..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple012_app_configuration_file" - }, - { - "name": "description_application", - "value": "description_application" - } - ] -} diff --git a/BmsSample/AppConfigurationFile/AppScope/resources/base/media/background.png b/BmsSample/AppConfigurationFile/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppConfigurationFile/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/AppConfigurationFile/AppScope/resources/base/media/foreground.png b/BmsSample/AppConfigurationFile/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppConfigurationFile/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/AppConfigurationFile/AppScope/resources/base/media/layered_image.json b/BmsSample/AppConfigurationFile/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/AppScope/resources/base/profile/configuration.json b/BmsSample/AppConfigurationFile/AppScope/resources/base/profile/configuration.json deleted file mode 100644 index 4bc20f7d54229e91d71040dfec679f71c095d012..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/AppScope/resources/base/profile/configuration.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "configuration": { - "fontSizeScale": "followSystem", - "fontSizeMaxScale": "3.2" - } -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/README_zh.md b/BmsSample/AppConfigurationFile/README_zh.md deleted file mode 100644 index 8adc086e5344521a92064fb0cbd7ccc1b1076ee9..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/README_zh.md +++ /dev/null @@ -1,59 +0,0 @@ -# app.json5配置文件文档示例 - -### 介绍 - -本示例通过配置app.json5配置文件,构建一个项目。 - -### 效果预览 - -| 桌面 | -|---------------------------------| -|![img.png](screenshots/img.png) | - -### 使用说明 - -1. 编译,安装。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/AppConfigurationFile > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/build-profile.json5 b/BmsSample/AppConfigurationFile/build-profile.json5 deleted file mode 100644 index f76aea68fc1809964ab900bfb93c5970c228c47d..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/code-linter.json5 b/BmsSample/AppConfigurationFile/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/.gitignore b/BmsSample/AppConfigurationFile/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/build-profile.json5 b/BmsSample/AppConfigurationFile/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/hvigorfile.ts b/BmsSample/AppConfigurationFile/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/obfuscation-rules.txt b/BmsSample/AppConfigurationFile/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/AppConfigurationFile/entry/oh-package.json5 b/BmsSample/AppConfigurationFile/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/AppConfigurationFile/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/AppConfigurationFile/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/AppConfigurationFile/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/src/main/ets/pages/Index.ets b/BmsSample/AppConfigurationFile/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/src/main/module.json5 b/BmsSample/AppConfigurationFile/entry/src/main/module.json5 deleted file mode 100644 index e4226557b12a7322c888516a211fcf6c981c7122..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/BmsSample/AppConfigurationFile/entry/src/main/resources/base/element/color.json b/BmsSample/AppConfigurationFile/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/element/float.json b/BmsSample/AppConfigurationFile/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/element/string.json b/BmsSample/AppConfigurationFile/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/background.png b/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/foreground.png b/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/layered_image.json b/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/startIcon.png b/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/AppConfigurationFile/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/AppConfigurationFile/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/AppConfigurationFile/entry/src/main/resources/dark/element/color.json b/BmsSample/AppConfigurationFile/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/hvigor/hvigor-config.json5 b/BmsSample/AppConfigurationFile/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/AppConfigurationFile/hvigorfile.ts b/BmsSample/AppConfigurationFile/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/oh-package.json5 b/BmsSample/AppConfigurationFile/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/AppConfigurationFile/ohosTest.md b/BmsSample/AppConfigurationFile/ohosTest.md deleted file mode 100644 index 96c8467669e99efc67af50eadf01c37a064019c1..0000000000000000000000000000000000000000 --- a/BmsSample/AppConfigurationFile/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# app.json5配置文件 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------|------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| \ No newline at end of file diff --git a/BmsSample/AppConfigurationFile/screenshots/img.png b/BmsSample/AppConfigurationFile/screenshots/img.png deleted file mode 100644 index b306df1b2aea2a7c41ec6549bef3a94b034064b6..0000000000000000000000000000000000000000 Binary files a/BmsSample/AppConfigurationFile/screenshots/img.png and /dev/null differ diff --git a/BmsSample/CommonProblemOfApplication/.gitignore b/BmsSample/CommonProblemOfApplication/.gitignore deleted file mode 100644 index 64a92e049c70536316198207466689d6395f9b16..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -log.txt \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/AppScope/app.json5 b/BmsSample/CommonProblemOfApplication/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/CommonProblemOfApplication/AppScope/resources/base/element/string.json b/BmsSample/CommonProblemOfApplication/AppScope/resources/base/element/string.json deleted file mode 100644 index e17677300ea31639be9b28b47005c27d34ecc796..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple001" - } - ] -} diff --git a/BmsSample/CommonProblemOfApplication/AppScope/resources/base/media/background.png b/BmsSample/CommonProblemOfApplication/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/CommonProblemOfApplication/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/CommonProblemOfApplication/AppScope/resources/base/media/foreground.png b/BmsSample/CommonProblemOfApplication/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/CommonProblemOfApplication/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/CommonProblemOfApplication/AppScope/resources/base/media/layered_image.json b/BmsSample/CommonProblemOfApplication/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/README_zh.md b/BmsSample/CommonProblemOfApplication/README_zh.md deleted file mode 100644 index be1c36e4bb45d275b389ac140237b4438582f01a..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/README_zh.md +++ /dev/null @@ -1,59 +0,0 @@ -# 应用程序包常见问题指南文档示例 - -### 介绍 - -本示例通过调用[bundleManager.getBundleInfoForSelf](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-bundleManager.md#bundlemanagergetbundleinfoforself)接口,获取应用的签名字段信息。 - -### 效果预览 - -| 首页 | -|---------------------------------| -| ![img.png](screenshots/img.png) | - -### 使用说明 - -1. 使用IDE自动签名,编译运行,在Log中过滤`getBundleInfoForSelf`信息,查看日志打印。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/GetAppId.ets // 获取应用唯一标识appId -| |---pages/GetAppIdentifier.ets // 获取应用唯一标识appIdentifier -| |---pages/GetFingerprint.ets // 获取应用签名指纹信息 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/CommonProblemOfApplication > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/build-profile.json5 b/BmsSample/CommonProblemOfApplication/build-profile.json5 deleted file mode 100644 index 84ff4de03fd02768cf4c5d379639ef2481a7f0ac..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/code-linter.json5 b/BmsSample/CommonProblemOfApplication/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/.gitignore b/BmsSample/CommonProblemOfApplication/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/build-profile.json5 b/BmsSample/CommonProblemOfApplication/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/hvigorfile.ts b/BmsSample/CommonProblemOfApplication/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/obfuscation-rules.txt b/BmsSample/CommonProblemOfApplication/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/CommonProblemOfApplication/entry/oh-package.json5 b/BmsSample/CommonProblemOfApplication/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/CommonProblemOfApplication/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/CommonProblemOfApplication/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/CommonProblemOfApplication/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/GetAppId.ets b/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/GetAppId.ets deleted file mode 100644 index f61c6b8f88bc1ce9b888aae785641d98502190bc..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/GetAppId.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start get_app_id] -// 获取应用签名的唯一标识appId -import { bundleManager } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | - bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO; -try { - bundleManager.getBundleInfoForSelf(bundleFlags).then((bundleInfo:bundleManager.BundleInfo) => { - console.info('testTag', 'getBundleInfoForSelf successfully. appId:', bundleInfo.signatureInfo.appId); - }).catch((err: BusinessError) => { - console.error('testTag', 'getBundleInfoForSelf failed. Cause:', err.message); - }); -} catch (err) { - let message = (err as BusinessError).message; - console.error('testTag', 'getBundleInfoForSelf failed:', message); -} -// [End get_app_id] - -@Component -export struct GetAppId { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('GetAppIdHelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/GetAppIdentifier.ets b/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/GetAppIdentifier.ets deleted file mode 100644 index 91f440abb86ebb53e2f50a4b194fe94de609b9bc..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/GetAppIdentifier.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start get_app_identifier] -// 获取应用签名的唯一标识appIdentifier -import { bundleManager } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | - bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO; -try { - bundleManager.getBundleInfoForSelf(bundleFlags).then((bundleInfo:bundleManager.BundleInfo) => { - console.info('testTag', 'getBundleInfoForSelf successfully. appIdentifier:', bundleInfo.signatureInfo.appIdentifier); - }).catch((err: BusinessError) => { - console.error('testTag', 'getBundleInfoForSelf failed. Cause:', err.message); - }); -} catch (err) { - let message = (err as BusinessError).message; - console.error('testTag', 'getBundleInfoForSelf failed:', message); -} -// [End get_app_identifier] - -@Component -export struct GetAppIdentifier { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('GetAppIdentifierHelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/GetFingerprint.ets b/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/GetFingerprint.ets deleted file mode 100644 index f1bf885217e0c9e51367a6f84e4f154745f3815b..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/GetFingerprint.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start get_fingerprint] -// 获取应用签名的指纹信息 -import { bundleManager } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | - bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO; -try { - bundleManager.getBundleInfoForSelf(bundleFlags).then((bundleInfo:bundleManager.BundleInfo) => { - console.info('testTag', 'getBundleInfoForSelf successfully. fingerprint: ', bundleInfo.signatureInfo.fingerprint); - }).catch((err: BusinessError) => { - console.error('testTag', 'getBundleInfoForSelf failed. Cause: ', err.message); - }); -} catch (err) { - let message = (err as BusinessError).message; - console.error('testTag', 'getBundleInfoForSelf failed: %{public}s', message); -} -// [End get_fingerprint] - -@Component -export struct GetFingerprint { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('GetFingerprintHelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/Index.ets b/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0bda734663089844f3172e66e3de4eb41c84ae80..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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 {GetAppId} from './GetAppId'; -import {GetAppIdentifier} from './GetAppIdentifier'; -import {GetFingerprint} from './GetFingerprint'; - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - GetAppId(); - GetAppIdentifier(); - GetFingerprint(); - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/module.json5 b/BmsSample/CommonProblemOfApplication/entry/src/main/module.json5 deleted file mode 100644 index 8780abab7ef4f3b9a877a91ea853a37381bd93b6..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/module.json5 +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 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", - "2in1" - ], - "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": [ - "ohos.want.action.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/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/element/color.json b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/element/float.json b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a0a93dd91fd48f08f3a9532c76e9b26e68d4c034..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/element/string.json b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/background.png b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/foreground.png b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/layered_image.json b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/startIcon.png b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 55c3f007f87b7ce5206d325f968cc56f2f79441f..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/dark/element/color.json b/BmsSample/CommonProblemOfApplication/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/hvigor/hvigor-config.json5 b/BmsSample/CommonProblemOfApplication/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/CommonProblemOfApplication/hvigorfile.ts b/BmsSample/CommonProblemOfApplication/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/oh-package.json5 b/BmsSample/CommonProblemOfApplication/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/CommonProblemOfApplication/ohosTest.md b/BmsSample/CommonProblemOfApplication/ohosTest.md deleted file mode 100644 index 78badb3ace455e6b5970a495225678b36b975cee..0000000000000000000000000000000000000000 --- a/BmsSample/CommonProblemOfApplication/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 应用程序包常见问题 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------------------------|----------------|-------|-------------------------|--------------------------------| -| 工程编译安装 | 无 | 编译 | 成功拉起应用 |Pass| -| IDE中Log过滤'getBundleInfoForSelf' | 正常安装运行 | 进入应用主页 | 日志打印应用信息字段 |Pass| \ No newline at end of file diff --git a/BmsSample/CommonProblemOfApplication/screenshots/img.png b/BmsSample/CommonProblemOfApplication/screenshots/img.png deleted file mode 100644 index 81e85f8681fd9f2494c32d21e0807c4fa442d5ad..0000000000000000000000000000000000000000 Binary files a/BmsSample/CommonProblemOfApplication/screenshots/img.png and /dev/null differ diff --git a/BmsSample/DeflateAndInflate/.gitignore b/BmsSample/DeflateAndInflate/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/DeflateAndInflate/AppScope/app.json5 b/BmsSample/DeflateAndInflate/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/DeflateAndInflate/AppScope/resources/base/element/string.json b/BmsSample/DeflateAndInflate/AppScope/resources/base/element/string.json deleted file mode 100644 index 1a059d5c5e84f3f42cc276620037317418d4eb69..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "deflateAndInflate" - } - ] -} diff --git a/BmsSample/DeflateAndInflate/AppScope/resources/base/media/background.png b/BmsSample/DeflateAndInflate/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/DeflateAndInflate/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/DeflateAndInflate/AppScope/resources/base/media/foreground.png b/BmsSample/DeflateAndInflate/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/DeflateAndInflate/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/DeflateAndInflate/AppScope/resources/base/media/layered_image.json b/BmsSample/DeflateAndInflate/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/README_zh.md b/BmsSample/DeflateAndInflate/README_zh.md deleted file mode 100644 index 780ce9367c594b5668fc887978b7df504622d647..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/README_zh.md +++ /dev/null @@ -1,63 +0,0 @@ -# 压缩与解压文档示例 - -### 介绍 - -本示例通过调用zlib的api接口,测试压缩功能。 - -### 效果预览 - -| 桌面 | -|---------------------------------| -|![img.png](screenshots/img.png) | - -### 使用说明 - -1. 编译,安装。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // 创建一个测试文件data.txt,并写入测试数据 -| |---pages1/index.ets // 采用接口zlib.compressFile()将文件data.txt压缩并归档到data.zip中,采用接口zlib.decompressFile()将data.zip解压到应用沙箱目录下 -| |---pages2/index.ets // 针对一个已知大小的缓冲区中的数据,使用接口compress()将其压缩到一个目的缓冲区中,使用接口compressBound()计算压缩目的缓冲区大小的上限值,使用接口uncompress()对存储压缩数据的缓冲区进行解压。由于解压时无法获取解压后原始数据的大小,为了确认解压后目的缓冲区的大小,需要在压缩前获取原始数据的大小并保存 -| |---pages3/index.ets // 针对一个未知大小的缓冲区中的数据,使用接口deflate()将从一个原始输入流中读取的数据进行压缩,使用接口inflate()将从一个压缩输入流中读取的数据进行解压 -| |---pages4/index.ets // 采用gzip格式,针对一个未知大小的缓冲区中的数据,使用接口deflate()将从一个原始输入流中读取的数据进行压缩,使用接口inflate()将从一个压缩输入流中读取的数据进行解压 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/DeflateAndInflate > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/build-profile.json5 b/BmsSample/DeflateAndInflate/build-profile.json5 deleted file mode 100644 index f76aea68fc1809964ab900bfb93c5970c228c47d..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/code-linter.json5 b/BmsSample/DeflateAndInflate/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/.gitignore b/BmsSample/DeflateAndInflate/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/build-profile.json5 b/BmsSample/DeflateAndInflate/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/hvigorfile.ts b/BmsSample/DeflateAndInflate/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/obfuscation-rules.txt b/BmsSample/DeflateAndInflate/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/DeflateAndInflate/entry/oh-package.json5 b/BmsSample/DeflateAndInflate/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/DeflateAndInflate/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/DeflateAndInflate/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/DeflateAndInflate/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages/Index.ets b/BmsSample/DeflateAndInflate/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 6046f867141a8b7c546abd1a57e676f6753340a6..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start deflate_and_inflate_001] -import { fileIo as fs} from '@kit.CoreFileKit'; - -@Entry -@Component -struct Index { - @State dataSize: number = 0; - - build() { - Row() { - Column() { - // 在应用沙箱目录下创建文件data.txt,并写入测试数据 - Button('创建测试文件data.txt').onClick(() => { - let path = this.getUIContext()?.getHostContext()?.filesDir; - // 创建文件data.txt - let inFile = fs.openSync(path + '/data.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - // 写入测试数据 - for (let index = 0; index < 100; index++) { - fs.writeSync(inFile.fd, index + ': hello world, hello world, hello world, hello world, hello world.\n'); - } - // 获取测试数据原始大小,并保存到dataSize中 - let stat = fs.statSync(inFile.path); - this.dataSize = stat.size; - console.info('dataSize: ' + this.dataSize); - // 关闭文件 - fs.closeSync(inFile); - }) - } - } - .height('100%') - .width('100%') - } -} -// [End deflate_and_inflate_001] \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages1/Index.ets b/BmsSample/DeflateAndInflate/entry/src/main/ets/pages1/Index.ets deleted file mode 100644 index d6be8ddfa6b86cf00bd6de670161c09fc3bf5855..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages1/Index.ets +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start deflate_and_inflate_002] -import { BusinessError, zlib } from '@kit.BasicServicesKit'; - -@Entry -@Component -struct Index { - build() { - Row() { - // 示例一:将测试文件data.txt压缩并归档到data.zip中。 - Button('compressFile').onClick(() => { - let path = this.getUIContext()?.getHostContext()?.filesDir; - let inFile = path + '/data.txt'; - let outFile = path + '/data.zip'; - let options: zlib.Options = {}; - zlib.compressFile(inFile, outFile, options).then((data: void) => { - console.info('compressFile success, data: ' + JSON.stringify(data)); - }).catch((errData: BusinessError) => { - console.error(`compressFile errCode: ${errData.code}, message: ${errData.message}`); - }) - }) - - // 示例二:将data.zip文件解压到应用沙箱目录下。 - Button('decompressFile').onClick(() => { - let path = this.getUIContext()?.getHostContext()?.filesDir; - let inFile = path + '/data.zip'; - let outFile = path; - let options: zlib.Options = {}; - zlib.decompressFile(inFile, outFile, options).then((data: void) => { - console.info('decompressFile success, data: ' + JSON.stringify(data)); - }).catch((errData: BusinessError) => { - console.error(`decompressFile errCode: ${errData.code}, message: ${errData.message}`); - }) - }) - } - .height('100%') - .width('100%') - } -} -// [End deflate_and_inflate_002] \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages2/Index.ets b/BmsSample/DeflateAndInflate/entry/src/main/ets/pages2/Index.ets deleted file mode 100644 index 307930e124041591cbce8b5388e294e19d8d77fc..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages2/Index.ets +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start deflate_and_inflate_003] -import { fileIo as fs} from '@kit.CoreFileKit'; -import { BusinessError, zlib } from '@kit.BasicServicesKit'; - -@Entry -@Component -struct Index { - @State dataSize: number = 0; //用于保存原始数据的大小 - - build() { - Row() { - // 示例一:读取data.txt文件内容并存入一个缓冲区,调用compress接口压缩缓冲区中的数据到目标缓冲区,并将目标缓冲区的内容写入文件data.bin - Button('compress buffer').onClick(() => { - let path = this.getUIContext()?.getHostContext()?.filesDir; - let inFile = fs.openSync(path + '/data.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - let outFile = fs.openSync(path + '/data.bin', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - // 读取data.txt文件的内容,并存入缓冲区inBuf - let stat = fs.statSync(inFile.path); - let inBuf = new ArrayBuffer(stat.size); - let readLen = fs.readSync(inFile.fd, inBuf); - console.info(`original size: ${stat.size}, read len: ${readLen}`); - // 获取原始数据的大小,并保存 - this.dataSize = stat.size; - // 创建一个压缩对象实例 - let zip = zlib.createZipSync(); - // 获取一个目标缓冲区的上限 - zip.compressBound(stat.size).then((data) => { - console.info(`the max dest buf len is ${data}`); - // 目标缓冲区outBuf - let outBuf = new ArrayBuffer(data); - // 将inBuf中的数据压缩到outBuf中 - zip.compress(outBuf, inBuf, readLen).then((zipOutInfo) => { - console.info(`compress success, status ${zipOutInfo.status}, destLen ${zipOutInfo.destLen}`); - // 将outBuf中的数据写入到data.bin文件 - let writeLen = fs.writeSync(outFile.fd, outBuf, { length: zipOutInfo.destLen }); - console.info(`write destBuf to data.bin, writeLen ${writeLen}`); - // 关闭文件 - fs.closeSync(inFile.fd); - fs.closeSync(outFile.fd); - }).catch((errData: BusinessError) => { - console.error(`errData is errCode:${errData.code} message:${errData.message}`); - }) - }).catch((errData: BusinessError) => { - console.error(`errData is errCode:${errData.code} message:${errData.message}`); - }) - }) - - // 示例二:读取data.bin文件中的压缩数据并存入一个缓冲区,调用uncompress接口将缓冲区中的数据解压到目标缓冲区,并将目标缓冲区的内容写入文件data.txt - Button('uncompress buffer').onClick(() => { - let path = this.getUIContext()?.getHostContext()?.filesDir; - let inFile = fs.openSync(path + '/data.bin', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - let outFile = fs.openSync(path + '/data.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - // 读取data.bin文件中的压缩数据,并存入缓冲区inBuf - let stat = fs.statSync(inFile.path); - let inBuf = new ArrayBuffer(stat.size); - let readLen = fs.readSync(inFile.fd, inBuf); - console.info(`compressed data size: ${stat.size}, read len: ${readLen}`); - // 创建一个目标缓冲区,此处的dataSize是我们进行数据压缩前保存的数据的原始大小 - let outBuf = new ArrayBuffer(this.dataSize); - console.info(`the dest buf size is ${this.dataSize}`); - // 创建一个压缩对象实例 - let zip = zlib.createZipSync(); - // 将inBuf中的数据解压缩outBuf中 - zip.uncompress(outBuf, inBuf, readLen).then((zipOutInfo) => { - console.info(`uncompress success, status ${zipOutInfo.status}, destLen ${zipOutInfo.destLen}`); - // 将outBuf中的数据写入到data.txt文件 - let writeLen = fs.writeSync(outFile.fd, outBuf, { length: zipOutInfo.destLen }); - console.info(`write destBuf to data.txt, writeLen ${writeLen}`); - // 关闭文件 - fs.closeSync(inFile.fd); - fs.closeSync(outFile.fd); - }).catch((errData: BusinessError) => { - console.error(`errData is errCode:${errData.code} message:${errData.message}`); - }) - }) - } - .height('100%') - .width('100%') - } -} -// [End deflate_and_inflate_003] \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages3/Index.ets b/BmsSample/DeflateAndInflate/entry/src/main/ets/pages3/Index.ets deleted file mode 100644 index 1eb1d1203648c3a45e496d5673ff38c0d9f6d1ef..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages3/Index.ets +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start deflate_and_inflate_004] -import { fileIo as fs} from '@kit.CoreFileKit'; -import { zlib } from '@kit.BasicServicesKit'; - -@Entry -@Component -struct Index { - build() { - Row() { - // 示例一:从文件中不断读取数据进行压缩 - Button('deflateFile').onClick(() => { - let path = this.getUIContext()?.getHostContext()?.filesDir; - let inFile = fs.openSync(path + '/data.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - let outFile = fs.openSync(path + '/data.bin', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - deflateFile(inFile, outFile).then(() => { - console.info('deflateFile success'); - fs.closeSync(inFile.fd); - fs.closeSync(outFile.fd); - }) - }) - - // 示例二:从文件中不断读取压缩数据进行解压 - Button('inflateFile').onClick(() => { - let path = this.getUIContext()?.getHostContext()?.filesDir; - let inFile = fs.openSync(path + '/data.bin', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - let outFile = fs.openSync(path + '/data.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - inflateFile(inFile, outFile).then(() => { - console.info('deflateFile success'); - fs.closeSync(inFile.fd); - fs.closeSync(outFile.fd); - }) - }) - } - .height('100%') - .width('100%') - } -} - -// 从一个文件中,不断的读入数据,进行压缩,并写入到另一个文件中 -async function deflateFile(src: fs.File, dest: fs.File) { - let flush = zlib.CompressFlushMode.NO_FLUSH; - let strm: zlib.ZStream = {}; //初始化一个压缩流 - const BUFLEN = 4096; - let inBuf = new ArrayBuffer(BUFLEN); // 初始化一个输入缓冲区 - let outBuf = new ArrayBuffer(BUFLEN); // 初始化一个输出缓冲区 - // 创建一个压缩对象实例 - let zip = zlib.createZipSync(); - // 初始化流的状态 - let initStatus = zip.deflateInit(strm, zlib.CompressLevel.COMPRESS_LEVEL_BEST_SPEED); - console.info('deflateInit ret: ' + (await initStatus).valueOf()); - do { - // 从文件中读取数据到缓冲区 - let readLen = fs.readSync(src.fd, inBuf); - console.info('readSync readLen: ' + readLen); - flush = readLen == 0 ? zlib.CompressFlushMode.FINISH : zlib.CompressFlushMode.NO_FLUSH; - // 设置输入缓冲区 - strm.availableIn = readLen; - strm.nextIn = inBuf; - do { - // 设置输出缓冲区 - strm.availableOut = BUFLEN; - strm.nextOut = outBuf; - try { - // 压缩输入缓冲区中数据到输出缓冲区 - let deflateStatus = zip.deflate(strm, flush); - console.info('deflate ret: ' + (await deflateStatus).valueOf()); - // 更新流的状态 - let innerStrm = zip.getZStream(); - strm.availableIn = (await innerStrm).availableIn; - strm.nextIn = (await innerStrm).nextIn; - strm.availableOut = (await innerStrm).availableOut; - strm.nextOut = (await innerStrm).nextOut; - strm.totalIn = (await innerStrm).totalIn; - strm.totalOut = (await innerStrm).totalOut; - - if (strm.availableOut != undefined) { - // 将已完成压缩的数据,写入到输出文件中 - let have = BUFLEN - strm.availableOut; - let writeLen = fs.writeSync(dest.fd, outBuf, { length: have }); - console.info(`writeSync writeLen: ${writeLen}`); - } - } catch (err) { - console.error('deflate err: ' + JSON.stringify(err)); - } - } while (strm.availableOut == 0); // 循环压缩输入缓冲区中剩余的数据,直到全部完成压缩 - } while (flush != zlib.CompressFlushMode.FINISH); // 循环从文件中读取数据,直到数据全部读取 - // 释放资源 - zip.deflateEnd(strm); -} - -// 从一个文件中,不断的读入已压缩的数据,进行解压,并写入到另一个文件中 -async function inflateFile(src: fs.File, dest: fs.File) { - let status: zlib.ReturnStatus = zlib.ReturnStatus.OK; - let strm: zlib.ZStream = {}; //初始化一个压缩流 - const BUFLEN = 4096; - let inBuf = new ArrayBuffer(BUFLEN); // 初始化一个输入缓冲区 - let outBuf = new ArrayBuffer(BUFLEN); // 初始化一个输出缓冲区 - // 创建一个压缩对象实例 - let zip = zlib.createZipSync(); - // 初始化流的状态 - let initStatus = zip.inflateInit(strm); - console.info('inflateInit ret: ' + (await initStatus).valueOf()); - do { - // 从文件中读取已压缩的数据到缓冲区 - let readLen = fs.readSync(src.fd, inBuf); - console.info('readSync readLen: ' + readLen); - if (readLen == 0) { - break; - } - // 设置输入缓冲区 - strm.availableIn = readLen; - strm.nextIn = inBuf; - do { - // 设置输出缓冲区 - strm.availableOut = BUFLEN; - strm.nextOut = outBuf; - try { - // 解压输入缓冲区中数据到输出缓冲区 - let inflateStatus = zip.inflate(strm, zlib.CompressFlushMode.NO_FLUSH); - console.info('inflate ret: ' + (await inflateStatus).valueOf()); - status = await inflateStatus; - // 更新流的状态 - let innerStrm = zip.getZStream(); - strm.availableIn = (await innerStrm).availableIn; - strm.nextIn = (await innerStrm).nextIn; - strm.availableOut = (await innerStrm).availableOut; - strm.nextOut = (await innerStrm).nextOut; - strm.totalIn = (await innerStrm).totalIn; - strm.totalOut = (await innerStrm).totalOut; - - if (strm.availableOut != undefined) { - // 将已完成解压的数据,写入到输出文件中 - let have = BUFLEN - strm.availableOut; - let writeLen = fs.writeSync(dest.fd, outBuf, { length: have }); - console.info(`writeSync writeLen: ${writeLen}`); - } - } catch (err) { - console.error('inflate err: ' + JSON.stringify(err)); - } - } while (strm.availableOut == 0) // 循环解压输入缓冲区中剩余的数据,直到全部完成解压 - } while (status != zlib.ReturnStatus.STREAM_END.valueOf()) // 循环从文件中读取数据,直到数据全部读取 - // 释放资源 - zip.inflateEnd(strm); -} -// [End deflate_and_inflate_004] \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages4/Index.ets b/BmsSample/DeflateAndInflate/entry/src/main/ets/pages4/Index.ets deleted file mode 100644 index f836566a3ee25cc058258195c0a85163c3afc671..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/ets/pages4/Index.ets +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start deflate_and_inflate_005] -import { fileIo as fs} from '@kit.CoreFileKit'; -import { zlib } from '@kit.BasicServicesKit'; - -@Entry -@Component -struct Index { - build() { - Row() { - // 示例一:从文件中不断读取数据进行压缩 - Button('deflateGzipFile').onClick(() => { - let path = this.getUIContext()?.getHostContext()?.filesDir; - let inFile = fs.openSync(path + '/data.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - let outFile = fs.openSync(path + '/data.gz', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - deflateGzipFile(inFile, outFile).then(() => { - console.info('deflateGzipFile success'); - fs.closeSync(inFile.fd); - fs.closeSync(outFile.fd); - }) - }) - - // 示例二:从文件中不断读取压缩数据进行解压 - Button('inflateGzipFile').onClick(() => { - let path = this.getUIContext()?.getHostContext()?.filesDir; - let inFile = fs.openSync(path + '/data.gz', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - let outFile = fs.openSync(path + '/data.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - inflateGzipFile(inFile, outFile).then(() => { - console.info('inflateGzipFile success'); - fs.closeSync(inFile.fd); - fs.closeSync(outFile.fd); - }) - }) - } - .height('100%') - .width('100%') - } -} - -// 从一个文件中,不断的读入数据,进行压缩,并写入到另一个文件中 -async function deflateGzipFile(src: fs.File, dest: fs.File) { - let flush = zlib.CompressFlushMode.NO_FLUSH; - let strm: zlib.ZStream = {}; //初始化一个压缩流 - const BUFLEN = 4096; - let inBuf = new ArrayBuffer(BUFLEN); // 初始化一个输入缓冲区 - let outBuf = new ArrayBuffer(BUFLEN); // 初始化一个输出缓冲区 - // 创建一个压缩对象实例 - let zip = zlib.createZipSync(); - // 初始化流的状态,windowBits > 15时,启用gzip格式 - let windowBits = 15 + 16; - let initStatus = zip.deflateInit2(strm, zlib.CompressLevel.COMPRESS_LEVEL_BEST_SPEED, - zlib.CompressMethod.DEFLATED, windowBits, zlib.MemLevel.MEM_LEVEL_DEFAULT, - zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY); - console.info('deflateInit2 ret: ' + (await initStatus).valueOf()); - do { - // 从文件中读取数据到缓冲区 - let readLen = fs.readSync(src.fd, inBuf); - console.info('readSync readLen: ' + readLen); - flush = readLen == 0 ? zlib.CompressFlushMode.FINISH : zlib.CompressFlushMode.NO_FLUSH; - // 设置输入缓冲区 - strm.availableIn = readLen; - strm.nextIn = inBuf; - do { - // 设置输出缓冲区 - strm.availableOut = BUFLEN; - strm.nextOut = outBuf; - try { - // 压缩输入缓冲区中数据到输出缓冲区 - let deflateStatus = zip.deflate(strm, flush); - console.info('deflate ret: ' + (await deflateStatus).valueOf()); - // 更新流的状态 - let innerStrm = zip.getZStream(); - strm.availableIn = (await innerStrm).availableIn; - strm.nextIn = (await innerStrm).nextIn; - strm.availableOut = (await innerStrm).availableOut; - strm.nextOut = (await innerStrm).nextOut; - strm.totalIn = (await innerStrm).totalIn; - strm.totalOut = (await innerStrm).totalOut; - - if (strm.availableOut != undefined) { - // 将已完成压缩的数据,写入到输出文件中 - let have = BUFLEN - strm.availableOut; - let writeLen = fs.writeSync(dest.fd, outBuf, { length: have }); - console.info(`writeSync writeLen: ${writeLen}`); - } - } catch (err) { - console.error('deflate err: ' + JSON.stringify(err)); - } - } while (strm.availableOut == 0); // 循环压缩输入缓冲区中剩余的数据,直到全部完成压缩 - } while (flush != zlib.CompressFlushMode.FINISH); // 循环从文件中读取数据,直到数据全部读取 - // 释放资源 - zip.deflateEnd(strm); -} - -// 从一个文件中,不断的读入已压缩的数据,进行解压,并写入到另一个文件中 -async function inflateGzipFile(src: fs.File, dest: fs.File) { - let status: zlib.ReturnStatus = zlib.ReturnStatus.OK; - let strm: zlib.ZStream = {}; //初始化一个压缩流 - const BUFLEN = 4096; - let inBuf = new ArrayBuffer(BUFLEN); // 初始化一个输入缓冲区 - let outBuf = new ArrayBuffer(BUFLEN); // 初始化一个输出缓冲区 - // 创建一个压缩对象实例 - let zip = zlib.createZipSync(); - // 初始化流的状态,windowBits > 15时,启用gzip格式 - let windowBits = 15 + 16; - let initStatus = zip.inflateInit2(strm, windowBits); - console.info('inflateInit2 ret: ' + (await initStatus).valueOf()); - do { - // 从文件中读取已压缩的数据到缓冲区 - let readLen = fs.readSync(src.fd, inBuf); - console.info('readSync readLen: ' + readLen); - if (readLen == 0) { - break; - } - // 设置输入缓冲区 - strm.availableIn = readLen; - strm.nextIn = inBuf; - do { - // 设置输出缓冲区 - strm.availableOut = BUFLEN; - strm.nextOut = outBuf; - try { - // 解压输入缓冲区中数据到输出缓冲区 - let inflateStatus = zip.inflate(strm, zlib.CompressFlushMode.NO_FLUSH); - console.info('inflate ret: ' + (await inflateStatus).valueOf()); - status = await inflateStatus; - // 更新流的状态 - let innerStrm = zip.getZStream(); - strm.availableIn = (await innerStrm).availableIn; - strm.nextIn = (await innerStrm).nextIn; - strm.availableOut = (await innerStrm).availableOut; - strm.nextOut = (await innerStrm).nextOut; - strm.totalIn = (await innerStrm).totalIn; - strm.totalOut = (await innerStrm).totalOut; - - if (strm.availableOut != undefined) { - // 将已完成解压的数据,写入到输出文件中 - let have = BUFLEN - strm.availableOut; - let writeLen = fs.writeSync(dest.fd, outBuf, { length: have }); - console.info(`writeSync writeLen: ${writeLen}`); - } - } catch (err) { - console.error('inflate err: ' + JSON.stringify(err)); - } - } while (strm.availableOut == 0) // 循环解压输入缓冲区中剩余的数据,直到全部完成解压 - } while (status != zlib.ReturnStatus.STREAM_END.valueOf()) // 循环从文件中读取数据,直到数据全部读取 - // 释放资源 - zip.inflateEnd(strm); -} -// [End deflate_and_inflate_005] \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/module.json5 b/BmsSample/DeflateAndInflate/entry/src/main/module.json5 deleted file mode 100644 index e4226557b12a7322c888516a211fcf6c981c7122..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/BmsSample/DeflateAndInflate/entry/src/main/resources/base/element/color.json b/BmsSample/DeflateAndInflate/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/element/float.json b/BmsSample/DeflateAndInflate/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/element/string.json b/BmsSample/DeflateAndInflate/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/background.png b/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/foreground.png b/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/layered_image.json b/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/startIcon.png b/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/DeflateAndInflate/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/DeflateAndInflate/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 7a80843f3b167ab9f2899371bd794432fe9517f1..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages1/Index", - "pages2/Index", - "pages3/Index", - "pages4/Index" - ] -} diff --git a/BmsSample/DeflateAndInflate/entry/src/main/resources/dark/element/color.json b/BmsSample/DeflateAndInflate/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/hvigor/hvigor-config.json5 b/BmsSample/DeflateAndInflate/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/DeflateAndInflate/hvigorfile.ts b/BmsSample/DeflateAndInflate/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/oh-package.json5 b/BmsSample/DeflateAndInflate/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/DeflateAndInflate/ohosTest.md b/BmsSample/DeflateAndInflate/ohosTest.md deleted file mode 100644 index 70dfd8ab90f1600f1a22403f747084e6be605eac..0000000000000000000000000000000000000000 --- a/BmsSample/DeflateAndInflate/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# 压缩与解压 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------|------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| \ No newline at end of file diff --git a/BmsSample/DeflateAndInflate/screenshots/img.png b/BmsSample/DeflateAndInflate/screenshots/img.png deleted file mode 100644 index f2765973036e1ee78ce09a82e902b84aad2ac4b6..0000000000000000000000000000000000000000 Binary files a/BmsSample/DeflateAndInflate/screenshots/img.png and /dev/null differ diff --git a/BmsSample/HapToHar/.gitignore b/BmsSample/HapToHar/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/HapToHar/AppScope/app.json5 b/BmsSample/HapToHar/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/HapToHar/AppScope/resources/base/element/string.json b/BmsSample/HapToHar/AppScope/resources/base/element/string.json deleted file mode 100644 index 4fb596a3aa72e81b3d0a6c2d9c232e974f0c412a..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple007_hap_to_har" - } - ] -} diff --git a/BmsSample/HapToHar/AppScope/resources/base/media/background.png b/BmsSample/HapToHar/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HapToHar/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/HapToHar/AppScope/resources/base/media/foreground.png b/BmsSample/HapToHar/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/HapToHar/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/HapToHar/AppScope/resources/base/media/layered_image.json b/BmsSample/HapToHar/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/HapToHar/README_zh.md b/BmsSample/HapToHar/README_zh.md deleted file mode 100644 index 3b78d7ba416604190a1029a422b342b9933ceb8f..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/README_zh.md +++ /dev/null @@ -1,56 +0,0 @@ -# HAP转HAR指导指南文档示例 - -### 介绍 - -本示例通过相关设置配置变更,将HAP转化成HAR包 - -### 效果预览 -不涉及。 - -### 使用说明 - -1. 选择entry模块,编译,构建,产物中生成只有.har包文件。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置文件 -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/HapToHar > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/HapToHar/build-profile.json5 b/BmsSample/HapToHar/build-profile.json5 deleted file mode 100644 index 59d4ab1d2dcdaf07d98ba3af728d246d4a140599..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/build-profile.json5 +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "har", - "srcPath": "./entry", - } - ] -} \ No newline at end of file diff --git a/BmsSample/HapToHar/code-linter.json5 b/BmsSample/HapToHar/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/.gitignore b/BmsSample/HapToHar/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/BuildProfile.ets b/BmsSample/HapToHar/entry/BuildProfile.ets deleted file mode 100644 index 3a501e5ddee8ea6d28961648fc7dd314a5304bd4..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/BuildProfile.ets +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Use these variables when you tailor your ArkTS code. They must be of the const type. - */ -export const HAR_VERSION = '1.0.0'; -export const BUILD_MODE_NAME = 'debug'; -export const DEBUG = true; -export const TARGET_NAME = 'default'; - -/** - * BuildProfile Class is used only for compatibility purposes. - */ -export default class BuildProfile { - static readonly HAR_VERSION = HAR_VERSION; - static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; - static readonly DEBUG = DEBUG; - static readonly TARGET_NAME = TARGET_NAME; -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/Index.ets b/BmsSample/HapToHar/entry/Index.ets deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/BmsSample/HapToHar/entry/build-profile.json5 b/BmsSample/HapToHar/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/hvigorfile.ts b/BmsSample/HapToHar/entry/hvigorfile.ts deleted file mode 100644 index f75bb0e3ca2c8551e617652e1f72c08a2e2c1a2a..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/hvigorfile.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hap_to_har_003] -import { harTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} -// [End hap_to_har_003] \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/obfuscation-rules.txt b/BmsSample/HapToHar/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/HapToHar/entry/oh-package.json5 b/BmsSample/HapToHar/entry/oh-package.json5 deleted file mode 100644 index 0fa5d336c4d25c379178368811858d12d503989c..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/oh-package.json5 +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hap_to_har_002] -{ - // [StartExclude hap_to_har_002] - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - // [EndExclude hap_to_har_002] - "main": "Index.ets", - // [StartExclude hap_to_har_002] - "author": "", - "license": "", - "dependencies": {}, - // [EndExclude hap_to_har_002] -} -// [End hap_to_har_002] diff --git a/BmsSample/HapToHar/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/HapToHar/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/HapToHar/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/src/main/ets/pages/Index.ets b/BmsSample/HapToHar/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/src/main/module.json5 b/BmsSample/HapToHar/entry/src/main/module.json5 deleted file mode 100644 index e9c4a9f57663c2c64486c18ba01ecd46937a66dc..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/module.json5 +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hap_to_har_001] -{ - "module": { - "name": "har", - "type": "har", - "deviceTypes": [ - "default", - "tablet", - "2in1" - ] - } -} -// [End hap_to_har_001] \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/src/main/resources/base/element/color.json b/BmsSample/HapToHar/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/src/main/resources/base/element/float.json b/BmsSample/HapToHar/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/HapToHar/entry/src/main/resources/base/element/string.json b/BmsSample/HapToHar/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/src/main/resources/base/media/background.png b/BmsSample/HapToHar/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HapToHar/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/HapToHar/entry/src/main/resources/base/media/foreground.png b/BmsSample/HapToHar/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HapToHar/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/HapToHar/entry/src/main/resources/base/media/layered_image.json b/BmsSample/HapToHar/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/src/main/resources/base/media/startIcon.png b/BmsSample/HapToHar/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/HapToHar/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/HapToHar/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/HapToHar/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/HapToHar/entry/src/main/resources/dark/element/color.json b/BmsSample/HapToHar/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HapToHar/hvigor/hvigor-config.json5 b/BmsSample/HapToHar/hvigor/hvigor-config.json5 deleted file mode 100644 index c63e910373e5ead86612270e605a391acdc32ec9..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "5.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/HapToHar/hvigorfile.ts b/BmsSample/HapToHar/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/HapToHar/oh-package.json5 b/BmsSample/HapToHar/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/HapToHar/ohosTest.md b/BmsSample/HapToHar/ohosTest.md deleted file mode 100644 index db29bd5d0b006dd9f2447bb74fa893d7a92c4b9e..0000000000000000000000000000000000000000 --- a/BmsSample/HapToHar/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# HAP转HAR指导 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|--------|------------|-------|-----------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功编译出har包 |Pass| \ No newline at end of file diff --git a/BmsSample/HarPackage/.gitignore b/BmsSample/HarPackage/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/HarPackage/AppScope/app.json5 b/BmsSample/HarPackage/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/HarPackage/AppScope/resources/base/element/string.json b/BmsSample/HarPackage/AppScope/resources/base/element/string.json deleted file mode 100644 index 93cea74e7e2017397bf376d477e5adac27a02025..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple013_har_package" - } - ] -} diff --git a/BmsSample/HarPackage/AppScope/resources/base/media/background.png b/BmsSample/HarPackage/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/HarPackage/AppScope/resources/base/media/foreground.png b/BmsSample/HarPackage/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/HarPackage/AppScope/resources/base/media/layered_image.json b/BmsSample/HarPackage/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/HarPackage/README_zh.md b/BmsSample/HarPackage/README_zh.md deleted file mode 100644 index 1043628df995fe82a8148b49f99d756680b28d4e..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/README_zh.md +++ /dev/null @@ -1,65 +0,0 @@ -# HAR指南文档示例 - -### 介绍 - -本示例介绍HAR中使用说明,介绍HAR定义的功能,组件,native方法,以及被集成使用说明。 - -### 效果预览 -![img.png](screenshots/img.png) -![img_1.png](screenshots/img_1.png) -![img_2.png](screenshots/img_2.png) - -### 使用说明 - -1. 编译dayjs模块,编译lottie模块,在编译library模块,最后编译安装entry模块。 - -1. 进入首页,点击button调用HAR中的func()方法。点击native_add按钮调用native方法。 - -1. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -dayjs // 资源名称与lottie冲突模块 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置文件 -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -library/src/ -| |--- main/ -| |--- module.json5 // library模块配置文件 -lottie // 资源名称与dayjs冲突模块 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/HarPackage > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/HarPackage/build-profile.json5 b/BmsSample/HarPackage/build-profile.json5 deleted file mode 100644 index 58d815a7b1d172554c6d9226261d2cad670c96b8..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/build-profile.json5 +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "externalNativeOptions": { - "abiFilters": [ - "x86_64" - ] - }, - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - }, - { - "name": "library", - "srcPath": "./library", - }, - { - "name": "dayjs", - "srcPath": "./dayjs", - }, - { - "name": "lottie", - "srcPath": "./lottie", - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarPackage/code-linter.json5 b/BmsSample/HarPackage/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/HarPackage/dayjs/.gitignore b/BmsSample/HarPackage/dayjs/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/HarPackage/dayjs/Index.ets b/BmsSample/HarPackage/dayjs/Index.ets deleted file mode 100644 index e5366a9d163962a9c1f933ab95195b5c909baf51..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/Index.ets +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export { MainPage } from './src/main/ets/components/MainPage'; diff --git a/BmsSample/HarPackage/dayjs/build-profile.json5 b/BmsSample/HarPackage/dayjs/build-profile.json5 deleted file mode 100644 index aefa5f6959f0e65b9347a5182401ee9f4873007a..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/build-profile.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} diff --git a/BmsSample/HarPackage/dayjs/consumer-rules.txt b/BmsSample/HarPackage/dayjs/consumer-rules.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/BmsSample/HarPackage/dayjs/hvigorfile.ts b/BmsSample/HarPackage/dayjs/hvigorfile.ts deleted file mode 100644 index 8b916a32c526d654b0110abdb28f04e0bc874769..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 { harTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ -} \ No newline at end of file diff --git a/BmsSample/HarPackage/dayjs/obfuscation-rules.txt b/BmsSample/HarPackage/dayjs/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/HarPackage/dayjs/oh-package.json5 b/BmsSample/HarPackage/dayjs/oh-package.json5 deleted file mode 100644 index 0d847aba65a97b71a6d7d7f90a285602b892cf5d..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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": "dayjs", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "Index.ets", - "author": "", - "license": "Apache-2.0", - "dependencies": {} -} diff --git a/BmsSample/HarPackage/dayjs/src/main/ets/components/MainPage.ets b/BmsSample/HarPackage/dayjs/src/main/ets/components/MainPage.ets deleted file mode 100644 index e3178f9bd990100be5e8c360e9a01901fb2de048..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/src/main/ets/components/MainPage.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Component -export struct MainPage { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .width('100%') - } - .height('100%') - } -} diff --git a/BmsSample/HarPackage/dayjs/src/main/module.json5 b/BmsSample/HarPackage/dayjs/src/main/module.json5 deleted file mode 100644 index b957d273d6901ca1a2023a28b642db9581152c6b..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/src/main/module.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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": "dayjs", - "type": "har", - "deviceTypes": [ - "default" - ] - } -} diff --git a/BmsSample/HarPackage/dayjs/src/main/resources/base/element/float.json b/BmsSample/HarPackage/dayjs/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/HarPackage/dayjs/src/main/resources/base/element/string.json b/BmsSample/HarPackage/dayjs/src/main/resources/base/element/string.json deleted file mode 100644 index f51a9c8461a55f6312ef950344e3145b7f82d607..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/dayjs/src/main/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "page_show", - "value": "page from package" - } - ] -} diff --git a/BmsSample/HarPackage/entry/.gitignore b/BmsSample/HarPackage/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/build-profile.json5 b/BmsSample/HarPackage/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/hvigorfile.ts b/BmsSample/HarPackage/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/obfuscation-rules.txt b/BmsSample/HarPackage/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/HarPackage/entry/oh-package.json5 b/BmsSample/HarPackage/entry/oh-package.json5 deleted file mode 100644 index 7632322a7b1f71d90eb8eb914324933699534724..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/oh-package.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "library": "file:../library" - } -} - diff --git a/BmsSample/HarPackage/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/HarPackage/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/HarPackage/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/src/main/ets/pages/Index.ets b/BmsSample/HarPackage/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 70b627cdaf026ff947667a1368b30081772d949e..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_package_010] -// [Start har_package_011] -// [Start har_package_012] -import { Log, func } from 'library'; -import { nativeAdd } from 'library'; - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Column() { - Text(this.message) - .fontFamily('HarmonyHeiTi') - .fontWeight(FontWeight.Bold) - .fontSize(32) - - // [StartExclude har_package_011] - // [StartExclude har_package_012] - //引用HAR的ets类和方法 - Button($r('app.string.button')) - .id('button') - .height(48) - .width('624px') - .margin({ top: '4%' }) - .type(ButtonType.Capsule) - .onClick(() => { - // 引用HAR的类和方法 - Log.info('har msg'); - this.message = 'func return: ' + func(); - }) - // [EndExclude har_package_011] - // [EndExclude har_package_012] - - // [StartExclude har_package_010] - // [StartExclude har_package_012] - //引用HAR的native方法 - Button($r('app.string.native_add')) - .id('nativeAdd') - .height(48) - .width('624px') - .margin({ top: '4%', bottom: '6%' }) - .type(ButtonType.Capsule) - .onClick(() => { - this.message = 'result: ' + nativeAdd(1, 2); - }) - // [EndExclude har_package_010] - // [EndExclude har_package_012] - - // [StartExclude har_package_010] - // [StartExclude har_package_011] - // 引用HAR的字符串资源 - Text($r('app.string.hello_har')) - .id('stringHar') - .fontFamily('HarmonyHeiTi') - .fontColor($r('app.color.text_color')) - .fontSize(24) - .fontWeight(500) - .margin({ top: '40%' }) - - List() { - ListItem() { - // 引用HAR的图片资源 - Image($r('app.media.icon_har')) - .id('iconHar') - .borderRadius('48px') - } - .margin({ top: '5%' }) - .width('312px') - } - .alignListItem(ListItemAlign.Center) - // [EndExclude har_package_010] - // [EndExclude har_package_011] - } - .width('100%') - .backgroundColor($r('app.color.page_background')) - .height('100%') - } -} -// [End har_package_012] -// [End har_package_011] -// [End har_package_010] diff --git a/BmsSample/HarPackage/entry/src/main/ets/pages/IndexSec.ets b/BmsSample/HarPackage/entry/src/main/ets/pages/IndexSec.ets deleted file mode 100644 index 03e815a2435a8ecbce091f1e67e4dc55e985155d..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/ets/pages/IndexSec.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_package_009] -import { MainPage } from 'library'; - -@Entry -@Component -struct IndexSec { - build() { - Row() { - // 引用HAR的ArkUI组件 - MainPage() - } - .height('100%') - } -} -// [End har_package_009] \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/src/main/module.json5 b/BmsSample/HarPackage/entry/src/main/module.json5 deleted file mode 100644 index e4226557b12a7322c888516a211fcf6c981c7122..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/BmsSample/HarPackage/entry/src/main/resources/base/element/color.json b/BmsSample/HarPackage/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 2730eb40602ac71b35b0cd7ba9a220c4e7b30f8e..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "page_background", - "value": "#FFFFFF" - }, - { - "name": "text_color", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/src/main/resources/base/element/float.json b/BmsSample/HarPackage/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/HarPackage/entry/src/main/resources/base/element/string.json b/BmsSample/HarPackage/entry/src/main/resources/base/element/string.json deleted file mode 100644 index fae64a5dd975b214bc5816886f6d48047326f6e4..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "button", - "value": "button" - }, - { - "name": "native_add", - "value": "native_add" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/src/main/resources/base/media/background.png b/BmsSample/HarPackage/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/HarPackage/entry/src/main/resources/base/media/foreground.png b/BmsSample/HarPackage/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/HarPackage/entry/src/main/resources/base/media/layered_image.json b/BmsSample/HarPackage/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/src/main/resources/base/media/startIcon.png b/BmsSample/HarPackage/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/HarPackage/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/HarPackage/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/HarPackage/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/HarPackage/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/HarPackage/entry/src/main/resources/dark/element/color.json b/BmsSample/HarPackage/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarPackage/hvigor/hvigor-config.json5 b/BmsSample/HarPackage/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/HarPackage/hvigorfile.ts b/BmsSample/HarPackage/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/HarPackage/library/.gitignore b/BmsSample/HarPackage/library/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/HarPackage/library/Index.ets b/BmsSample/HarPackage/library/Index.ets deleted file mode 100644 index 5dca55ff79bcbab3441866d00fb3de98a4973a36..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/Index.ets +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_package_003] -export { MainPage } from './src/main/ets/components/mainpage/MainPage'; -// [End har_package_003] -// [Start har_package_005] -export { Log, func, func2 } from './src/main/ets/test'; -// [End har_package_005] -// [Start har_package_006] -export { nativeAdd } from './src/main/ets/utils/nativeTest'; -// [End har_package_006] \ No newline at end of file diff --git a/BmsSample/HarPackage/library/build-profile.json5 b/BmsSample/HarPackage/library/build-profile.json5 deleted file mode 100644 index 4148dbf7fa917a32bca3137742b410f19453d3a3..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "" - }, - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - // [Start har_package_013] - "enable": true, - // [End har_package_013] - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} diff --git a/BmsSample/HarPackage/library/consumer-rules.txt b/BmsSample/HarPackage/library/consumer-rules.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/BmsSample/HarPackage/library/hvigorfile.ts b/BmsSample/HarPackage/library/hvigorfile.ts deleted file mode 100644 index 8b916a32c526d654b0110abdb28f04e0bc874769..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 { harTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ -} \ No newline at end of file diff --git a/BmsSample/HarPackage/library/obfuscation-rules.txt b/BmsSample/HarPackage/library/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/HarPackage/library/oh-package.json5 b/BmsSample/HarPackage/library/oh-package.json5 deleted file mode 100644 index f0e8be55b62f2be7c2299f9ce4f3041b14a501f9..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/oh-package.json5 +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 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": "library", - "version": "1.0.0", - "description": "Please describe the basic information.", - // [Start har_package_001] - "main": "Index.ets", - // [end har_package_001] - "author": "", - "license": "Apache-2.0", - "dependencies": { - "liblibrary.so": "file:./src/main/cpp/types/liblibrary", - // [Start har_package_008] - "dayjs": "file:../dayjs", - "lottie": "file:../lottie", - // [End har_package_008] - } -} \ No newline at end of file diff --git a/BmsSample/HarPackage/library/src/main/cpp/CMakeLists.txt b/BmsSample/HarPackage/library/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 6c1b8ef3083e18c0f62374df513064489a4ccbae..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(myNpmLib) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(library SHARED napi_init.cpp) -target_link_libraries(library PUBLIC libace_napi.z.so) diff --git a/BmsSample/HarPackage/library/src/main/cpp/napi_init.cpp b/BmsSample/HarPackage/library/src/main/cpp/napi_init.cpp deleted file mode 100644 index 25dfb45b49723b959d3a602f4ccc519b565cd216..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "library", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterLibraryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/BmsSample/HarPackage/library/src/main/cpp/types/liblibrary/Index.d.ts b/BmsSample/HarPackage/library/src/main/cpp/types/liblibrary/Index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/cpp/types/liblibrary/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/BmsSample/HarPackage/library/src/main/cpp/types/liblibrary/oh-package.json5 b/BmsSample/HarPackage/library/src/main/cpp/types/liblibrary/oh-package.json5 deleted file mode 100644 index 85119c2ff569a89209c6dd4dede4d10684dbd4ee..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/cpp/types/liblibrary/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "liblibrary.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/BmsSample/HarPackage/library/src/main/ets/components/MainPage.ets b/BmsSample/HarPackage/library/src/main/ets/components/MainPage.ets deleted file mode 100644 index a0846270d300190efdfa2a0754fd27057e3fa10a..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/ets/components/MainPage.ets +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'liblibrary.so'; - -const DOMAIN = 0x0000; - -@Component -export struct MainPage { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - hilog.info(DOMAIN, 'testTag', 'Test NAPI 2 + 3 = %{public}d', testNapi.add(2, 3)); - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/BmsSample/HarPackage/library/src/main/ets/components/mainpage/MainPage.ets b/BmsSample/HarPackage/library/src/main/ets/components/mainpage/MainPage.ets deleted file mode 100644 index 25bf70decf79d0eec0064010b61224d089f885ff..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/ets/components/mainpage/MainPage.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_package_002] -@Component -export struct MainPage { - @State message: string = 'HAR MainPage'; - - build() { - Column() { - Row() { - Text(this.message) - .fontSize(32) - .fontWeight(FontWeight.Bold) - } - .margin({ top: '32px' }) - .height(56) - .width('624px') - - Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center, alignContent: FlexAlign.Center }) { - Column() { - Image($r('app.media.pic_empty')).width('33%') - Text($r('app.string.empty')) - .fontSize(14) - .fontColor($r('app.color.text_color')) - } - }.width('100%') - .height('90%') - } - .width('100%') - .height('100%') - .backgroundColor($r('app.color.page_background')) - } -} -// [End har_package_002] \ No newline at end of file diff --git a/BmsSample/HarPackage/library/src/main/ets/test.ets b/BmsSample/HarPackage/library/src/main/ets/test.ets deleted file mode 100644 index fd0b96d50fb2e383bc22e52261318d094d953d7a..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/ets/test.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_package_004] -export class Log { - static info(msg: string) { - console.info(msg); - } -} - -export function func() { - return 'har func'; -} - -export function func2() { - return 'har func2'; -} -// [End har_package_004] \ No newline at end of file diff --git a/BmsSample/HarPackage/library/src/main/ets/utils/nativeTest.ets b/BmsSample/HarPackage/library/src/main/ets/utils/nativeTest.ets deleted file mode 100644 index 12c4d252ff89ec1a8fccb7582b95dae94d22c5a3..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/ets/utils/nativeTest.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_package_007] -import native from 'liblibrary.so'; - -export function nativeAdd(a: number, b: number): number { - let result: number = native.add(a, b); - return result; -} -// [End har_package_007] \ No newline at end of file diff --git a/BmsSample/HarPackage/library/src/main/module.json5 b/BmsSample/HarPackage/library/src/main/module.json5 deleted file mode 100644 index 3cb155550ebfb6454f9245a5fb2325bdc5f4fd46..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/module.json5 +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 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": "library", - "type": "har", - "deviceTypes": [ - "default" - ], - // [Start har_package_013] - "metadata": [ - { - "name": "UseTsHar", - "value": "true" - } - ] - // [End har_package_013] - } -} diff --git a/BmsSample/HarPackage/library/src/main/resources/base/element/color.json b/BmsSample/HarPackage/library/src/main/resources/base/element/color.json deleted file mode 100644 index 11daa1e104dbb1019871738541687441dc7529c4..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/resources/base/element/color.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - },{ - "name": "text_color", - "value": "#000000" - },{ - "name": "page_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarPackage/library/src/main/resources/base/element/float.json b/BmsSample/HarPackage/library/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/HarPackage/library/src/main/resources/base/element/string.json b/BmsSample/HarPackage/library/src/main/resources/base/element/string.json deleted file mode 100644 index 17e01cb01d0d47e68d52a37b3e12ae3c07d45535..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/library/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "page_show", - "value": "page from package" - }, - { - "name": "empty", - "value": "" - }, - { - "name": "hello_har", - "value": "" - } - ] -} diff --git a/BmsSample/HarPackage/library/src/main/resources/base/media/icon_har.png b/BmsSample/HarPackage/library/src/main/resources/base/media/icon_har.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/library/src/main/resources/base/media/icon_har.png and /dev/null differ diff --git a/BmsSample/HarPackage/library/src/main/resources/base/media/pic_empty.png b/BmsSample/HarPackage/library/src/main/resources/base/media/pic_empty.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/library/src/main/resources/base/media/pic_empty.png and /dev/null differ diff --git a/BmsSample/HarPackage/lottie/.gitignore b/BmsSample/HarPackage/lottie/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/HarPackage/lottie/Index.ets b/BmsSample/HarPackage/lottie/Index.ets deleted file mode 100644 index e5366a9d163962a9c1f933ab95195b5c909baf51..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/Index.ets +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export { MainPage } from './src/main/ets/components/MainPage'; diff --git a/BmsSample/HarPackage/lottie/build-profile.json5 b/BmsSample/HarPackage/lottie/build-profile.json5 deleted file mode 100644 index aefa5f6959f0e65b9347a5182401ee9f4873007a..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/build-profile.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} diff --git a/BmsSample/HarPackage/lottie/consumer-rules.txt b/BmsSample/HarPackage/lottie/consumer-rules.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/BmsSample/HarPackage/lottie/hvigorfile.ts b/BmsSample/HarPackage/lottie/hvigorfile.ts deleted file mode 100644 index 8b916a32c526d654b0110abdb28f04e0bc874769..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 { harTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ -} \ No newline at end of file diff --git a/BmsSample/HarPackage/lottie/obfuscation-rules.txt b/BmsSample/HarPackage/lottie/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/HarPackage/lottie/oh-package.json5 b/BmsSample/HarPackage/lottie/oh-package.json5 deleted file mode 100644 index bed6d8c564428457dcaae6f979f3446d0186bb52..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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": "lottie", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "Index.ets", - "author": "", - "license": "Apache-2.0", - "dependencies": {} -} diff --git a/BmsSample/HarPackage/lottie/src/main/ets/components/MainPage.ets b/BmsSample/HarPackage/lottie/src/main/ets/components/MainPage.ets deleted file mode 100644 index e3178f9bd990100be5e8c360e9a01901fb2de048..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/src/main/ets/components/MainPage.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Component -export struct MainPage { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .width('100%') - } - .height('100%') - } -} diff --git a/BmsSample/HarPackage/lottie/src/main/module.json5 b/BmsSample/HarPackage/lottie/src/main/module.json5 deleted file mode 100644 index 3b96592c0eaefd6f35c0f66ae6f2aba20a4219c3..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/src/main/module.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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": "lottie", - "type": "har", - "deviceTypes": [ - "default" - ] - } -} diff --git a/BmsSample/HarPackage/lottie/src/main/resources/base/element/float.json b/BmsSample/HarPackage/lottie/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/HarPackage/lottie/src/main/resources/base/element/string.json b/BmsSample/HarPackage/lottie/src/main/resources/base/element/string.json deleted file mode 100644 index f51a9c8461a55f6312ef950344e3145b7f82d607..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/lottie/src/main/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "page_show", - "value": "page from package" - } - ] -} diff --git a/BmsSample/HarPackage/oh-package.json5 b/BmsSample/HarPackage/oh-package.json5 deleted file mode 100644 index e64e2688a58408e0c041a1a0c3dfd07f0744769f..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0", - } -} diff --git a/BmsSample/HarPackage/ohosTest.md b/BmsSample/HarPackage/ohosTest.md deleted file mode 100644 index 2540e7564a4f52d68997d10613f912f99bcd6dc4..0000000000000000000000000000000000000000 --- a/BmsSample/HarPackage/ohosTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# HAR 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|------------|------------|-------|---------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| -| 点击按钮button | 安装运行 | 点击按钮button | 文本信息有变化 |Pass| -| 点击按钮native_add | 安装运行 | 点击按钮native_add | 文本信息有变化 |Pass| \ No newline at end of file diff --git a/BmsSample/HarPackage/screenshots/img.png b/BmsSample/HarPackage/screenshots/img.png deleted file mode 100644 index 9e788acbfb34348d26e320629ab3fb026a28e497..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/screenshots/img.png and /dev/null differ diff --git a/BmsSample/HarPackage/screenshots/img_1.png b/BmsSample/HarPackage/screenshots/img_1.png deleted file mode 100644 index ec5d439d33a875cc4af18a29754e48beb99290f8..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/screenshots/img_1.png and /dev/null differ diff --git a/BmsSample/HarPackage/screenshots/img_2.png b/BmsSample/HarPackage/screenshots/img_2.png deleted file mode 100644 index 0940a57875ee3a0538fce6678b0a5974b80744c6..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarPackage/screenshots/img_2.png and /dev/null differ diff --git a/BmsSample/HarToHsp/.gitignore b/BmsSample/HarToHsp/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/HarToHsp/AppScope/app.json5 b/BmsSample/HarToHsp/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/HarToHsp/AppScope/resources/base/element/string.json b/BmsSample/HarToHsp/AppScope/resources/base/element/string.json deleted file mode 100644 index a15a5f14962aa506f6beb70d309def2ad93cb83e..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple009_har_to_hsp" - } - ] -} diff --git a/BmsSample/HarToHsp/AppScope/resources/base/media/background.png b/BmsSample/HarToHsp/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarToHsp/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/HarToHsp/AppScope/resources/base/media/foreground.png b/BmsSample/HarToHsp/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarToHsp/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/HarToHsp/AppScope/resources/base/media/layered_image.json b/BmsSample/HarToHsp/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/README_zh.md b/BmsSample/HarToHsp/README_zh.md deleted file mode 100644 index 3470ef460cad6361b654cc710618b05c478a49f5..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/README_zh.md +++ /dev/null @@ -1,59 +0,0 @@ -# HAR转HSP指导指南文档示例 - -### 介绍 - -本示例通过相关设置配置变更,将HAR转化成HSP包 - -### 效果预览 -不涉及。 - -### 使用说明 - -1. 选择library模块,编译,构建,产物中生成只有.hsp包文件。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置文件 -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -library/src/ -| |--- main/ -| |--- module.json5 // library模块配置文件 有HAR转化成HSP -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/HarToHsp > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/HarToHsp/build-profile.json5 b/BmsSample/HarToHsp/build-profile.json5 deleted file mode 100644 index 57c6f6402f5a4e7081d105c693aee3ce7ad12fb6..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/build-profile.json5 +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - // [Start har_to_hsp_005] - "modules": [ - // [StartExclude har_to_hsp_005] - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - }, - // [EndExclude har_to_hsp_005] - { - "name": "library", - "srcPath": "./library", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ], - // [End har_to_hsp_005] -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/code-linter.json5 b/BmsSample/HarToHsp/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/.gitignore b/BmsSample/HarToHsp/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/build-profile.json5 b/BmsSample/HarToHsp/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/hvigorfile.ts b/BmsSample/HarToHsp/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/obfuscation-rules.txt b/BmsSample/HarToHsp/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/HarToHsp/entry/oh-package.json5 b/BmsSample/HarToHsp/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/HarToHsp/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/HarToHsp/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/HarToHsp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/src/main/ets/pages/Index.ets b/BmsSample/HarToHsp/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/src/main/module.json5 b/BmsSample/HarToHsp/entry/src/main/module.json5 deleted file mode 100644 index e4226557b12a7322c888516a211fcf6c981c7122..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/BmsSample/HarToHsp/entry/src/main/resources/base/element/color.json b/BmsSample/HarToHsp/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/src/main/resources/base/element/float.json b/BmsSample/HarToHsp/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/HarToHsp/entry/src/main/resources/base/element/string.json b/BmsSample/HarToHsp/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/src/main/resources/base/media/background.png b/BmsSample/HarToHsp/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarToHsp/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/HarToHsp/entry/src/main/resources/base/media/foreground.png b/BmsSample/HarToHsp/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarToHsp/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/HarToHsp/entry/src/main/resources/base/media/layered_image.json b/BmsSample/HarToHsp/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/src/main/resources/base/media/startIcon.png b/BmsSample/HarToHsp/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/HarToHsp/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/HarToHsp/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/HarToHsp/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/HarToHsp/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/HarToHsp/entry/src/main/resources/dark/element/color.json b/BmsSample/HarToHsp/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/hvigor/hvigor-config.json5 b/BmsSample/HarToHsp/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/HarToHsp/hvigorfile.ts b/BmsSample/HarToHsp/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/library/.gitignore b/BmsSample/HarToHsp/library/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/HarToHsp/library/Index.ets b/BmsSample/HarToHsp/library/Index.ets deleted file mode 100644 index e5366a9d163962a9c1f933ab95195b5c909baf51..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/Index.ets +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export { MainPage } from './src/main/ets/components/MainPage'; diff --git a/BmsSample/HarToHsp/library/build-profile.json5 b/BmsSample/HarToHsp/library/build-profile.json5 deleted file mode 100644 index 21af2b5a0a66ad544072f6f8a78a619bb04c50dd..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} diff --git a/BmsSample/HarToHsp/library/consumer-rules.txt b/BmsSample/HarToHsp/library/consumer-rules.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/BmsSample/HarToHsp/library/hvigorfile.ts b/BmsSample/HarToHsp/library/hvigorfile.ts deleted file mode 100644 index 9a9b9fa6e563535ab26319a28f574ac0d7a43af8..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/hvigorfile.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_to_hsp_003] -// library\hvigorfile.ts -import { hspTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: hspTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} -// [End har_to_hsp_003] \ No newline at end of file diff --git a/BmsSample/HarToHsp/library/obfuscation-rules.txt b/BmsSample/HarToHsp/library/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/HarToHsp/library/oh-package.json5 b/BmsSample/HarToHsp/library/oh-package.json5 deleted file mode 100644 index 7e138bf5d37535874c168f4b8342922fd2428397..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/oh-package.json5 +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_to_hsp_004] -{ - // [StartExclude har_to_hsp_004] - "name": "library", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "Index.ets", - "author": "", - "license": "Apache-2.0", - "dependencies": {}, - // [EndExclude har_to_hsp_004] - "packageType": "InterfaceHar" -} -// [End har_to_hsp_004] \ No newline at end of file diff --git a/BmsSample/HarToHsp/library/src/main/ets/components/MainPage.ets b/BmsSample/HarToHsp/library/src/main/ets/components/MainPage.ets deleted file mode 100644 index e3178f9bd990100be5e8c360e9a01901fb2de048..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/src/main/ets/components/MainPage.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Component -export struct MainPage { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .width('100%') - } - .height('100%') - } -} diff --git a/BmsSample/HarToHsp/library/src/main/ets/pages/PageIndex.ets b/BmsSample/HarToHsp/library/src/main/ets/pages/PageIndex.ets deleted file mode 100644 index 640e590c901b3606b05b92d3f624eb17b2112ae8..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/src/main/ets/pages/PageIndex.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_to_hsp_002] -@Entry -@Component -struct PageIndex { - @State message: string = 'hello world'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} -// [End har_to_hsp_002] \ No newline at end of file diff --git a/BmsSample/HarToHsp/library/src/main/module.json5 b/BmsSample/HarToHsp/library/src/main/module.json5 deleted file mode 100644 index d001bba31f1bd3d6fc0a3463e9aab3a3df5f3267..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/src/main/module.json5 +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start har_to_hsp_001] -{ - "module": { - // [StartExclude har_to_hsp_001] - "name": "library", - // [EndExclude har_to_hsp_001] - "type": "shared", - "deliveryWithInstall": true, - "pages": "$profile:main_pages", - // [StartExclude har_to_hsp_001] - "deviceTypes": [ - "default" - ], - // [EndExclude har_to_hsp_001] - } -} -// [End har_to_hsp_001] diff --git a/BmsSample/HarToHsp/library/src/main/resources/base/element/float.json b/BmsSample/HarToHsp/library/src/main/resources/base/element/float.json deleted file mode 100644 index a0a93dd91fd48f08f3a9532c76e9b26e68d4c034..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/library/src/main/resources/base/element/string.json b/BmsSample/HarToHsp/library/src/main/resources/base/element/string.json deleted file mode 100644 index f51a9c8461a55f6312ef950344e3145b7f82d607..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/src/main/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "page_show", - "value": "page from package" - } - ] -} diff --git a/BmsSample/HarToHsp/library/src/main/resources/base/profile/main_pages.json b/BmsSample/HarToHsp/library/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 24bbeb642f9bab10d0114647b9dadeb113f813d1..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/library/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/PageIndex" - ] -} \ No newline at end of file diff --git a/BmsSample/HarToHsp/oh-package.json5 b/BmsSample/HarToHsp/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/HarToHsp/ohosTest.md b/BmsSample/HarToHsp/ohosTest.md deleted file mode 100644 index 8a75893aee90228b43cdb4c801cbd5a8a8684347..0000000000000000000000000000000000000000 --- a/BmsSample/HarToHsp/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# HAR转HSP指导 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|--------|------------|-------|-----------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功编译出hsp包 |Pass| \ No newline at end of file diff --git a/BmsSample/HspToHar/.gitignore b/BmsSample/HspToHar/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/HspToHar/AppScope/app.json5 b/BmsSample/HspToHar/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/HspToHar/AppScope/resources/base/element/string.json b/BmsSample/HspToHar/AppScope/resources/base/element/string.json deleted file mode 100644 index 8e0db8681e3d1d66e60f5796a1adb4c488aa25ff..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple008_hsp_to_har" - } - ] -} diff --git a/BmsSample/HspToHar/AppScope/resources/base/media/background.png b/BmsSample/HspToHar/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HspToHar/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/HspToHar/AppScope/resources/base/media/foreground.png b/BmsSample/HspToHar/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/HspToHar/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/HspToHar/AppScope/resources/base/media/layered_image.json b/BmsSample/HspToHar/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/HspToHar/README_zh.md b/BmsSample/HspToHar/README_zh.md deleted file mode 100644 index 4eb6768f8d07267770feb9ae5c3e5ee41ddda6f2..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/README_zh.md +++ /dev/null @@ -1,59 +0,0 @@ -# HSP转HAR指导指南文档示例 - -### 介绍 - -本示例通过相关设置配置变更,将HSP转化成HAR包 - -### 效果预览 -不涉及。 - -### 使用说明 - -1. 选择library模块,编译,构建,产物中生成只有.har包文件。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置文件 -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -library/src/ -| |--- main/ -| |--- module.json5 // library模块配置文件 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/HspToHar > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/HspToHar/build-profile.json5 b/BmsSample/HspToHar/build-profile.json5 deleted file mode 100644 index ba8a07aecb0d71a2f7ec9628aa6e5c8b2682c285..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/build-profile.json5 +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - }, - { - "name": "har", - "srcPath": "./library" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HspToHar/code-linter.json5 b/BmsSample/HspToHar/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/.gitignore b/BmsSample/HspToHar/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/build-profile.json5 b/BmsSample/HspToHar/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/hvigorfile.ts b/BmsSample/HspToHar/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/obfuscation-rules.txt b/BmsSample/HspToHar/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/HspToHar/entry/oh-package.json5 b/BmsSample/HspToHar/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/HspToHar/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/HspToHar/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/HspToHar/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/src/main/ets/pages/Index.ets b/BmsSample/HspToHar/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/src/main/module.json5 b/BmsSample/HspToHar/entry/src/main/module.json5 deleted file mode 100644 index e4226557b12a7322c888516a211fcf6c981c7122..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/BmsSample/HspToHar/entry/src/main/resources/base/element/color.json b/BmsSample/HspToHar/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/src/main/resources/base/element/float.json b/BmsSample/HspToHar/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/HspToHar/entry/src/main/resources/base/element/string.json b/BmsSample/HspToHar/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/src/main/resources/base/media/background.png b/BmsSample/HspToHar/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HspToHar/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/HspToHar/entry/src/main/resources/base/media/foreground.png b/BmsSample/HspToHar/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/HspToHar/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/HspToHar/entry/src/main/resources/base/media/layered_image.json b/BmsSample/HspToHar/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/src/main/resources/base/media/startIcon.png b/BmsSample/HspToHar/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/HspToHar/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/HspToHar/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/HspToHar/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/HspToHar/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/HspToHar/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/HspToHar/entry/src/main/resources/dark/element/color.json b/BmsSample/HspToHar/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HspToHar/hvigor/hvigor-config.json5 b/BmsSample/HspToHar/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/HspToHar/hvigorfile.ts b/BmsSample/HspToHar/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/HspToHar/library/.gitignore b/BmsSample/HspToHar/library/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/HspToHar/library/BuildProfile.ets b/BmsSample/HspToHar/library/BuildProfile.ets deleted file mode 100644 index 3a501e5ddee8ea6d28961648fc7dd314a5304bd4..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/BuildProfile.ets +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Use these variables when you tailor your ArkTS code. They must be of the const type. - */ -export const HAR_VERSION = '1.0.0'; -export const BUILD_MODE_NAME = 'debug'; -export const DEBUG = true; -export const TARGET_NAME = 'default'; - -/** - * BuildProfile Class is used only for compatibility purposes. - */ -export default class BuildProfile { - static readonly HAR_VERSION = HAR_VERSION; - static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; - static readonly DEBUG = DEBUG; - static readonly TARGET_NAME = TARGET_NAME; -} \ No newline at end of file diff --git a/BmsSample/HspToHar/library/Index.ets b/BmsSample/HspToHar/library/Index.ets deleted file mode 100644 index 97828a9e38f3aeb80c88f1e0e7ee0ec9162f4c0b..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/Index.ets +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export { add } from './src/main/ets/utils/Calc'; \ No newline at end of file diff --git a/BmsSample/HspToHar/library/build-profile.json5 b/BmsSample/HspToHar/library/build-profile.json5 deleted file mode 100644 index e00b14c6476da2342f19cdfacf4176968251fbfc..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/build-profile.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HspToHar/library/consumer-rules.txt b/BmsSample/HspToHar/library/consumer-rules.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/BmsSample/HspToHar/library/hvigorfile.ts b/BmsSample/HspToHar/library/hvigorfile.ts deleted file mode 100644 index a5edef8da453227ae9f4fe8d1a4f3268f7f347b6..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/hvigorfile.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hsp_to_har_002] -// MyApplication\library\hvigorfile.ts -import { harTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} -// [End hsp_to_har_002] \ No newline at end of file diff --git a/BmsSample/HspToHar/library/obfuscation-rules.txt b/BmsSample/HspToHar/library/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/HspToHar/library/oh-package.json5 b/BmsSample/HspToHar/library/oh-package.json5 deleted file mode 100644 index c5e7176d36f148d48e1f562a3352e2469cd6f91a..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": "library", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "Index.ets", - "author": "", - "license": "Apache-2.0", - "packageType": "InterfaceHar", - "dependencies": { - } -} \ No newline at end of file diff --git a/BmsSample/HspToHar/library/src/main/ets/pages/Index.ets b/BmsSample/HspToHar/library/src/main/ets/pages/Index.ets deleted file mode 100644 index f8e5c76fa7d81910414170814b6d141dc0cc4212..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/BmsSample/HspToHar/library/src/main/ets/utils/Calc.ets b/BmsSample/HspToHar/library/src/main/ets/utils/Calc.ets deleted file mode 100644 index 8c5be7ec1c31240bcdc7fcdaae04ad9950dbf376..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/src/main/ets/utils/Calc.ets +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export function add(a: number, b: number) { - return a + b; -} \ No newline at end of file diff --git a/BmsSample/HspToHar/library/src/main/module.json5 b/BmsSample/HspToHar/library/src/main/module.json5 deleted file mode 100644 index 7deec18c399dc58fc25281cbfe0d6ca1ca09a31e..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/src/main/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hsp_to_har_001] -{ - "module": { - "name": "har", - "type": "har", - "deviceTypes": [ - "tablet", - "2in1" - ] - } -} -// [End hsp_to_har_001] \ No newline at end of file diff --git a/BmsSample/HspToHar/library/src/main/resources/base/element/float.json b/BmsSample/HspToHar/library/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/HspToHar/library/src/main/resources/base/element/string.json b/BmsSample/HspToHar/library/src/main/resources/base/element/string.json deleted file mode 100644 index 98e1d8a84b3d8539ea33e79fe2ac593a05d23bb4..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/library/src/main/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "shared_desc", - "value": "description" - } - ] -} \ No newline at end of file diff --git a/BmsSample/HspToHar/oh-package.json5 b/BmsSample/HspToHar/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/HspToHar/ohosTest.md b/BmsSample/HspToHar/ohosTest.md deleted file mode 100644 index 49364b979f5a6e439b6f7f5e24db2f1f31b65041..0000000000000000000000000000000000000000 --- a/BmsSample/HspToHar/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# HSP转HAR指导 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|--------|------------|-------|-----------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功编译出har包 |Pass| \ No newline at end of file diff --git a/BmsSample/InAppHsp1/.gitignore b/BmsSample/InAppHsp1/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/InAppHsp1/AppScope/app.json5 b/BmsSample/InAppHsp1/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/InAppHsp1/AppScope/resources/base/element/string.json b/BmsSample/InAppHsp1/AppScope/resources/base/element/string.json deleted file mode 100644 index 5e1f312059b802c9b8a39e35f2bf4c06bf4cc275..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple014_in_app_hsp" - } - ] -} diff --git a/BmsSample/InAppHsp1/AppScope/resources/base/media/background.png b/BmsSample/InAppHsp1/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/InAppHsp1/AppScope/resources/base/media/foreground.png b/BmsSample/InAppHsp1/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/InAppHsp1/AppScope/resources/base/media/layered_image.json b/BmsSample/InAppHsp1/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/README_zh.md b/BmsSample/InAppHsp1/README_zh.md deleted file mode 100644 index f357d0ffdd9e43d83da157a5cbd9bbd96cf7cd8e..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/README_zh.md +++ /dev/null @@ -1,69 +0,0 @@ -# HSP指南文档示例 - -### 介绍 - -本示例介绍HSP中使用说明,介绍HSP定义的功能,组件,native方法,以及被集成使用说明。 - -### 效果预览 -![img.png](screenshots/img.png) -![img_1.png](screenshots/img_1.png) -![img_2.png](screenshots/img_2.png) -### 使用说明 - -1. 编译library模块,最后编译安装entry模块。 - -1. 进入首页,点击add,description,native_multi按钮。 - -1. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置文件 -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -library/src/ -| |--- main/ -| |--- module.json5 // library模块配置文件 -| |--- cpp/ // native模块 -| |--- ets/ -| |--- components/MyTitleBar.ets // 组件定义 -| |--- utils/ -| |--- nativeTest.ets // native方法 -| |--- test.ets // 自定义方法 -| |--- ResManager.ets // 资源类 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/InAppHsp1 > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/InAppHsp1/build-profile.json5 b/BmsSample/InAppHsp1/build-profile.json5 deleted file mode 100644 index 55f7f5da96f95f531a186d7996b5d71f0ddefb97..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/build-profile.json5 +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "externalNativeOptions": { - "abiFilters": [ - "x86_64" - ] - }, - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - }, - { - "name": "library", - "srcPath": "./library", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/code-linter.json5 b/BmsSample/InAppHsp1/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/.gitignore b/BmsSample/InAppHsp1/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/build-profile.json5 b/BmsSample/InAppHsp1/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/hvigorfile.ts b/BmsSample/InAppHsp1/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/obfuscation-rules.txt b/BmsSample/InAppHsp1/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/InAppHsp1/entry/oh-package.json5 b/BmsSample/InAppHsp1/entry/oh-package.json5 deleted file mode 100644 index 7632322a7b1f71d90eb8eb914324933699534724..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/oh-package.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "library": "file:../library" - } -} - diff --git a/BmsSample/InAppHsp1/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/InAppHsp1/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/InAppHsp1/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/src/main/ets/pages/Index.ets b/BmsSample/InAppHsp1/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 86be89bba0a53a925347433ec9d42950c60de11f..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start in_app_hsp_011] -import { Log, add, MyTitleBar, ResManager, nativeMulti } from 'library'; -import { BusinessError } from "@kit.BasicServicesKit"; -import { application} from '@kit.AbilityKit'; - -const TAG = 'Index'; - -@Entry -@Component -struct Index { - @State message: string = ''; - - build() { - Column() { - List() { - ListItem() { - MyTitleBar() - } - .margin({ left: '35px', top: '32px' }) - - ListItem() { - Text(this.message) - .fontFamily('HarmonyHeiTi') - .fontSize(18) - .textAlign(TextAlign.Start) - .width('100%') - .fontWeight(FontWeight.Bold) - } - .width('685px') - .margin({ top: 30, bottom: 10 }) - - ListItem() { - // ResManager返回的Resource对象,可以传给组件直接使用,也可以从中取出资源来使用 - Image(ResManager.getPic()) - .id('image') - .borderRadius('48px') - } - .width('685px') - .margin({ top: 10, bottom: 10 }) - .padding({ left: 12, right: 12, top: 4, bottom: 4 }) - - ListItem() { - Text($r('app.string.add')) - .fontSize(18) - .textAlign(TextAlign.Start) - .width('100%') - .fontWeight(500) - .height('100%') - } - .id('add') - .borderRadius(24) - .width('685px') - .height('84px') - .backgroundColor($r('sys.color.ohos_id_color_foreground_contrary')) - .margin({ top: 10, bottom: 10 }) - .padding({ left: 12, right: 12, top: 4, bottom: 4 }) - .onClick(() => { - Log.info('add button click!'); - this.message = 'result: ' + add(1, 2); - }) - - ListItem() { - Text(ResManager.getDesc()) - .fontSize(18) - .textAlign(TextAlign.Start) - .width('100%') - .fontWeight(500) - .height('100%') - } - .id('getStringValue') - .borderRadius(24) - .width('685px') - .height('84px') - .backgroundColor($r('sys.color.ohos_id_color_foreground_contrary')) - .margin({ top: 10, bottom: 10 }) - .padding({ left: 12, right: 12, top: 4, bottom: 4 }) - .onClick(() => { - // 先通过当前application.createModuleContext获取hsp模块的上下文,再获取hsp模块的resourceManager,然后再调用resourceManager的接口获取资源 - application.createModuleContext(this.getUIContext()?.getHostContext(), "library").then((context:Context)=>{ - context.resourceManager.getStringValue(ResManager.getDesc().id) - .then(value => { - console.info('getStringValue is ' + value); - this.message = 'getStringValue is ' + value; - }) - .catch((err: BusinessError) => { - console.error('getStringValue promise error is ' + err); - }); - }).catch((err: BusinessError) => { - console.error('createModuleContext promise error is ' + err); - }); - }) - - ListItem() { - Text($r('app.string.native_multi')) - .fontSize(18) - .textAlign(TextAlign.Start) - .width('100%') - .fontWeight(500) - .height('100%') - } - .id('nativeMulti') - .borderRadius(24) - .width('685px') - .height('84px') - .backgroundColor($r('sys.color.ohos_id_color_foreground_contrary')) - .margin({ top: 10, bottom: 10 }) - .padding({ left: 12, right: 12, top: 4, bottom: 4 }) - .onClick(() => { - Log.info('nativeMulti button click!'); - this.message = 'result: ' + nativeMulti(3, 4); - }) - } - .alignListItem(ListItemAlign.Center) - } - .width('100%') - .backgroundColor($r('app.color.page_background')) - .height('100%') - } -} -// [End in_app_hsp_011] \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/src/main/module.json5 b/BmsSample/InAppHsp1/entry/src/main/module.json5 deleted file mode 100644 index e4226557b12a7322c888516a211fcf6c981c7122..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/BmsSample/InAppHsp1/entry/src/main/resources/base/element/color.json b/BmsSample/InAppHsp1/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 7cabdf677a608061b5063296f2495220148430eb..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "page_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/src/main/resources/base/element/float.json b/BmsSample/InAppHsp1/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/InAppHsp1/entry/src/main/resources/base/element/string.json b/BmsSample/InAppHsp1/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 22f84eca37ea470c8f110cb25c34d0e05bd505b0..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "native_multi", - "value": "native_multi" - }, - { - "name": "add", - "value": "add" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/src/main/resources/base/media/background.png b/BmsSample/InAppHsp1/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/InAppHsp1/entry/src/main/resources/base/media/foreground.png b/BmsSample/InAppHsp1/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/InAppHsp1/entry/src/main/resources/base/media/layered_image.json b/BmsSample/InAppHsp1/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/src/main/resources/base/media/startIcon.png b/BmsSample/InAppHsp1/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/InAppHsp1/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/InAppHsp1/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/InAppHsp1/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/InAppHsp1/entry/src/main/resources/dark/element/color.json b/BmsSample/InAppHsp1/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/hvigor/hvigor-config.json5 b/BmsSample/InAppHsp1/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/InAppHsp1/hvigorfile.ts b/BmsSample/InAppHsp1/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/.gitignore b/BmsSample/InAppHsp1/library/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/Index.ets b/BmsSample/InAppHsp1/library/Index.ets deleted file mode 100644 index 03522d31a1d831c5c4290e0d016eae843ba39535..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/Index.ets +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start in_app_hsp_010] -// [Start in_app_hsp_004] -export { Log, add, minus } from './src/main/ets/utils/test'; -// [End in_app_hsp_004] -// [Start in_app_hsp_002] -export { MyTitleBar } from './src/main/ets/components/MyTitleBar'; -// [End in_app_hsp_002] -// [Start in_app_hsp_009] -export { ResManager } from './src/main/ets/ResManager'; -// [End in_app_hsp_009] -// [Start in_app_hsp_006] -export { nativeMulti } from './src/main/ets/utils/nativeTest'; -// [End in_app_hsp_006] -// [End in_app_hsp_010] \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/build-profile.json5 b/BmsSample/InAppHsp1/library/build-profile.json5 deleted file mode 100644 index 0ee97cbf80b623af55e2e79869bdab0f05778dc1..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "" - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/consumer-rules.txt b/BmsSample/InAppHsp1/library/consumer-rules.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/BmsSample/InAppHsp1/library/hvigorfile.ts b/BmsSample/InAppHsp1/library/hvigorfile.ts deleted file mode 100644 index 0819544cab18b33264760ed49fd296f94ad676a6..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 { hspTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: hspTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/obfuscation-rules.txt b/BmsSample/InAppHsp1/library/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/InAppHsp1/library/oh-package.json5 b/BmsSample/InAppHsp1/library/oh-package.json5 deleted file mode 100644 index 80deed39f247de89c74d67a48e7a78bc5604e62f..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/oh-package.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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": "library", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "Index.ets", - "author": "", - "license": "Apache-2.0", - "packageType": "InterfaceHar", - "dependencies": { - "liblibrary.so": "file:./src/main/cpp/types/liblibrary" - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/cpp/CMakeLists.txt b/BmsSample/InAppHsp1/library/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 84288be7430c8d7b310a5b26ca1b65c5d86fb6a3..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(myNpmLib) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(library SHARED napi_init.cpp) -target_link_libraries(library PUBLIC libace_napi.z.so) \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/cpp/napi_init.cpp b/BmsSample/InAppHsp1/library/src/main/cpp/napi_init.cpp deleted file mode 100644 index 78929a734a9a0a521c05df3c229d1c06451ee836..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - - return sum; -} - -static napi_value Multi(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 * value1, &sum); - - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "multi", nullptr, Multi, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "library", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterLibraryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/BmsSample/InAppHsp1/library/src/main/cpp/types/liblibrary/Index.d.ts b/BmsSample/InAppHsp1/library/src/main/cpp/types/liblibrary/Index.d.ts deleted file mode 100644 index b9e3094ea88f3effbb4a5de617cbfaefcd793a65..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/cpp/types/liblibrary/Index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; -export const multi: (a: number, b: number) => number; \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/cpp/types/liblibrary/oh-package.json5 b/BmsSample/InAppHsp1/library/src/main/cpp/types/liblibrary/oh-package.json5 deleted file mode 100644 index 85119c2ff569a89209c6dd4dede4d10684dbd4ee..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/cpp/types/liblibrary/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "liblibrary.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/ets/ResManager.ets b/BmsSample/InAppHsp1/library/src/main/ets/ResManager.ets deleted file mode 100644 index 61951037390709a3704a1311cd51708178b1ca53..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/ets/ResManager.ets +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start in_app_hsp_008] -export class ResManager{ - static getPic(): Resource{ - return $r('app.media.pic'); - } - static getDesc(): Resource{ - return $r('app.string.shared_desc'); - } -} -// [End in_app_hsp_008] \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/ets/components/MyTitleBar.ets b/BmsSample/InAppHsp1/library/src/main/ets/components/MyTitleBar.ets deleted file mode 100644 index 383db4e0f771ab61b364f059358b72fdaa70b17a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/ets/components/MyTitleBar.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start in_app_hsp_001] -@Component -export struct MyTitleBar { - build() { - Row() { - Text($r('app.string.library_title')) - .id('library') - .fontFamily('HarmonyHeiTi') - .fontWeight(FontWeight.Bold) - .fontSize(32) - .fontColor($r('app.color.text_color')) - } - .width('100%') - } -} -// [End in_app_hsp_001] \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/ets/pages/Index.ets b/BmsSample/InAppHsp1/library/src/main/ets/pages/Index.ets deleted file mode 100644 index 8f088ca1657b90f4f732fa33fd1630f2dec23189..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'liblibrary.so'; - -const DOMAIN = 0x0000; - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - hilog.info(DOMAIN, 'testTag', 'Test NAPI 2 + 3 = %{public}d', testNapi.add(2, 3)); - }) - // [Start in_app_hsp_007] - // 正确用例 - Image($r('app.media.example')) - .id('example') - .borderRadius('48px') - // // 错误用例 - Image("../../resources/base/media/example.png") - .id('example') - .borderRadius('48px') - // [End in_app_hsp_007] - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/ets/utils/Calc.ets b/BmsSample/InAppHsp1/library/src/main/ets/utils/Calc.ets deleted file mode 100644 index 8c5be7ec1c31240bcdc7fcdaae04ad9950dbf376..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/ets/utils/Calc.ets +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export function add(a: number, b: number) { - return a + b; -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/ets/utils/nativeTest.ets b/BmsSample/InAppHsp1/library/src/main/ets/utils/nativeTest.ets deleted file mode 100644 index be8b104b8d6846a90600189aa99a4f6cfd9dba46..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/ets/utils/nativeTest.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start in_app_hsp_005] -import native from 'liblibrary.so'; - -export function nativeMulti(a: number, b: number): number { - let result: number = native.multi(a, b); - return result; -} -// [End in_app_hsp_005] \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/ets/utils/test.ets b/BmsSample/InAppHsp1/library/src/main/ets/utils/test.ets deleted file mode 100644 index 137577fd9d2bd92892214633c48b64f08876b00d..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/ets/utils/test.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start in_app_hsp_003] -export class Log { - static info(msg: string): void { - console.info(msg); - } -} - -export function add(a: number, b: number): number { - return a + b; -} - -export function minus(a: number, b: number): number { - return a - b; -} -// [End in_app_hsp_003] \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/module.json5 b/BmsSample/InAppHsp1/library/src/main/module.json5 deleted file mode 100644 index 014bd366df28ed9abc0ac10ef99ffd4c60c10c3d..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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": "library", - "type": "shared", - "description": "$string:shared_desc", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "pages": "$profile:main_pages" - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/resources/base/element/color.json b/BmsSample/InAppHsp1/library/src/main/resources/base/element/color.json deleted file mode 100644 index 48547400c4c7f71d0afff25ce9e541ab2ef94436..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/resources/base/element/color.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "text_color", - "value": "#000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/resources/base/element/float.json b/BmsSample/InAppHsp1/library/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/InAppHsp1/library/src/main/resources/base/element/string.json b/BmsSample/InAppHsp1/library/src/main/resources/base/element/string.json deleted file mode 100644 index e04ccc632b8cb0f3ee7a1dfd2a9b6b18ba4bccd5..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "shared_desc", - "value": "description" - }, - { - "name": "library_title", - "value": "library_title" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp1/library/src/main/resources/base/media/example.png b/BmsSample/InAppHsp1/library/src/main/resources/base/media/example.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/library/src/main/resources/base/media/example.png and /dev/null differ diff --git a/BmsSample/InAppHsp1/library/src/main/resources/base/media/pic.png b/BmsSample/InAppHsp1/library/src/main/resources/base/media/pic.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/library/src/main/resources/base/media/pic.png and /dev/null differ diff --git a/BmsSample/InAppHsp1/library/src/main/resources/base/profile/main_pages.json b/BmsSample/InAppHsp1/library/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/library/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/InAppHsp1/oh-package.json5 b/BmsSample/InAppHsp1/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/InAppHsp1/ohosTest.md b/BmsSample/InAppHsp1/ohosTest.md deleted file mode 100644 index 8d73d7ff7cfcb4d0146935fca713828d9daa5279..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp1/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# HSP 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|----------------|------------|-------|---------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| -| 点击按钮add | 安装运行 | 点击按钮add | 文本信息有变化 |Pass| -| 点击按钮description | 安装运行 | 点击按钮description | 文本信息有变化 |Pass| -| 点击按钮native_add | 安装运行 | 点击按钮native_add | 文本信息有变化 |Pass| \ No newline at end of file diff --git a/BmsSample/InAppHsp1/screenshots/img.png b/BmsSample/InAppHsp1/screenshots/img.png deleted file mode 100644 index 3b78576a6c110d850464f5a58789169ddcd3741f..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/screenshots/img.png and /dev/null differ diff --git a/BmsSample/InAppHsp1/screenshots/img_1.png b/BmsSample/InAppHsp1/screenshots/img_1.png deleted file mode 100644 index ef438c42c70b414b6ca46a24960fb5e4703054e1..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/screenshots/img_1.png and /dev/null differ diff --git a/BmsSample/InAppHsp1/screenshots/img_2.png b/BmsSample/InAppHsp1/screenshots/img_2.png deleted file mode 100644 index 4daff0d45acdb5417f552e427bd17537bc734b26..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp1/screenshots/img_2.png and /dev/null differ diff --git a/BmsSample/InAppHsp2/.gitignore b/BmsSample/InAppHsp2/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/InAppHsp2/AppScope/app.json5 b/BmsSample/InAppHsp2/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/InAppHsp2/AppScope/resources/base/element/string.json b/BmsSample/InAppHsp2/AppScope/resources/base/element/string.json deleted file mode 100644 index 398ab7871fb4c7f998758a7abd6ddf869ddbb72e..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple014_in_app_hsp02" - } - ] -} diff --git a/BmsSample/InAppHsp2/AppScope/resources/base/media/background.png b/BmsSample/InAppHsp2/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp2/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/InAppHsp2/AppScope/resources/base/media/foreground.png b/BmsSample/InAppHsp2/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp2/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/InAppHsp2/AppScope/resources/base/media/layered_image.json b/BmsSample/InAppHsp2/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/README_zh.md b/BmsSample/InAppHsp2/README_zh.md deleted file mode 100644 index 92f240820a05e02e1b01c7322aff71f8152786af..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/README_zh.md +++ /dev/null @@ -1,65 +0,0 @@ -# HSP指南文档示例 - -### 介绍 - -本示例介绍HSP中使用说明,介绍利用Navigation跳转,从entry模块跳转到library,在返回到entry模块。 - -### 效果预览 - - -### 使用说明 - -1. 编译library模块,最后编译安装entry模块。 - -1. 进入首页,点击click_to_menu文本跳转到library模块的页面,点击back_to_index按钮返回entry模块。 - -1. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置文件 -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -library/src/ -| |--- main/ -| |--- module.json5 // library模块配置文件 -| |--- cpp/ // native模块 -| |--- ets/ -| |--- pages/library_menu.ets // HSP的页面 -| |--- utils/ // 工具 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/InAppHsp2 > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/InAppHsp2/build-profile.json5 b/BmsSample/InAppHsp2/build-profile.json5 deleted file mode 100644 index a215b102d9aba75d92a97a42acf9963ad70abf76..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/build-profile.json5 +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.0.1(13)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - }, - { - "name": "library", - "srcPath": "./library", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/code-linter.json5 b/BmsSample/InAppHsp2/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/.gitignore b/BmsSample/InAppHsp2/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/build-profile.json5 b/BmsSample/InAppHsp2/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/hvigorfile.ts b/BmsSample/InAppHsp2/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/obfuscation-rules.txt b/BmsSample/InAppHsp2/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/InAppHsp2/entry/oh-package.json5 b/BmsSample/InAppHsp2/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/InAppHsp2/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/InAppHsp2/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/InAppHsp2/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/src/main/ets/pages/Index.ets b/BmsSample/InAppHsp2/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 67c99fdd074a4e36d8f131bfaeecc6303ed59c40..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start in_app_hsp_012] -@Entry -@Component -struct Index { - @State message: string = ''; - pathStack: NavPathStack = new NavPathStack(); - - build() { - Navigation(this.pathStack) { - Column() { - List() { - ListItem() { - Text($r('app.string.click_to_menu')) - .fontSize(18) - .textAlign(TextAlign.Start) - .width('100%') - .fontWeight(500) - .height('100%') - } - .id('clickToMenu') - .borderRadius(24) - .width('685px') - .height('84px') - .backgroundColor($r('sys.color.ohos_id_color_foreground_contrary')) - .margin({ top: 10, bottom: 10 }) - .padding({ - left: 12, - right: 12, - top: 4, - bottom: 4 - }) - .onClick(() => { - this.pathStack.pushPathByName('library_menu', null) - }) - } - .alignListItem(ListItemAlign.Center) - } - .width('100%') - .backgroundColor($r('app.color.page_background')) - .height('100%') - }.title("Navigation_Index") - .mode(NavigationMode.Stack) - } -} -// [End in_app_hsp_012] \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/src/main/module.json5 b/BmsSample/InAppHsp2/entry/src/main/module.json5 deleted file mode 100644 index e4226557b12a7322c888516a211fcf6c981c7122..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/BmsSample/InAppHsp2/entry/src/main/resources/base/element/color.json b/BmsSample/InAppHsp2/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 7cabdf677a608061b5063296f2495220148430eb..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "page_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/src/main/resources/base/element/float.json b/BmsSample/InAppHsp2/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/InAppHsp2/entry/src/main/resources/base/element/string.json b/BmsSample/InAppHsp2/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e8588fee4b245e21f88e5b1dd7044628db59b8d7..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "click_to_menu", - "value": "click_to_menu" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/src/main/resources/base/media/background.png b/BmsSample/InAppHsp2/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp2/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/InAppHsp2/entry/src/main/resources/base/media/foreground.png b/BmsSample/InAppHsp2/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp2/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/InAppHsp2/entry/src/main/resources/base/media/layered_image.json b/BmsSample/InAppHsp2/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/src/main/resources/base/media/startIcon.png b/BmsSample/InAppHsp2/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/InAppHsp2/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/InAppHsp2/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/InAppHsp2/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/InAppHsp2/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/InAppHsp2/entry/src/main/resources/dark/element/color.json b/BmsSample/InAppHsp2/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/hvigor/hvigor-config.json5 b/BmsSample/InAppHsp2/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/InAppHsp2/hvigorfile.ts b/BmsSample/InAppHsp2/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/.gitignore b/BmsSample/InAppHsp2/library/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/Index.ets b/BmsSample/InAppHsp2/library/Index.ets deleted file mode 100644 index 97828a9e38f3aeb80c88f1e0e7ee0ec9162f4c0b..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/Index.ets +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export { add } from './src/main/ets/utils/Calc'; \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/build-profile.json5 b/BmsSample/InAppHsp2/library/build-profile.json5 deleted file mode 100644 index e00b14c6476da2342f19cdfacf4176968251fbfc..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/build-profile.json5 +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/consumer-rules.txt b/BmsSample/InAppHsp2/library/consumer-rules.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/BmsSample/InAppHsp2/library/hvigorfile.ts b/BmsSample/InAppHsp2/library/hvigorfile.ts deleted file mode 100644 index 0819544cab18b33264760ed49fd296f94ad676a6..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 { hspTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: hspTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/obfuscation-rules.txt b/BmsSample/InAppHsp2/library/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/InAppHsp2/library/oh-package.json5 b/BmsSample/InAppHsp2/library/oh-package.json5 deleted file mode 100644 index c5e7176d36f148d48e1f562a3352e2469cd6f91a..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": "library", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "Index.ets", - "author": "", - "license": "Apache-2.0", - "packageType": "InterfaceHar", - "dependencies": { - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/src/main/ets/pages/Index.ets b/BmsSample/InAppHsp2/library/src/main/ets/pages/Index.ets deleted file mode 100644 index f8e5c76fa7d81910414170814b6d141dc0cc4212..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/src/main/ets/pages/library_menu.ets b/BmsSample/InAppHsp2/library/src/main/ets/pages/library_menu.ets deleted file mode 100644 index b9864b85685185311c111cdc152f8f33356eeeeb..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/src/main/ets/pages/library_menu.ets +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start in_app_hsp_014] -@Builder -export function PageOneBuilder() { - Library_Menu() -} - -@Entry -@Component -export struct Library_Menu { - @State message: string = 'Hello World'; - pathStack: NavPathStack = new NavPathStack(); - - build() { - NavDestination() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - }) - Button('back_to_index').fontSize(50).onClick(() => { - this.pathStack.pop(); - }) - } - .width('100%') - } - .height('100%') - }.title('Library_Menu') - .onReady((context: NavDestinationContext) => { - this.pathStack = context.pathStack; - }) - } -} -// [End in_app_hsp_014] \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/src/main/ets/utils/Calc.ets b/BmsSample/InAppHsp2/library/src/main/ets/utils/Calc.ets deleted file mode 100644 index 8c5be7ec1c31240bcdc7fcdaae04ad9950dbf376..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/src/main/ets/utils/Calc.ets +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export function add(a: number, b: number) { - return a + b; -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/src/main/module.json5 b/BmsSample/InAppHsp2/library/src/main/module.json5 deleted file mode 100644 index 058386554cfadb72ee1cae625f2bf948582456ea..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/src/main/module.json5 +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start in_app_hsp_013] -{ - "module": { - "name": "library", - "type": "shared", - "description": "$string:shared_desc", - "deviceTypes": [ - "default", - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "pages": "$profile:main_pages", - "routerMap": "$profile:route_map" //新增配置,指向route_map.json文件 - } -} -// [End in_app_hsp_013] \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/src/main/resources/base/element/float.json b/BmsSample/InAppHsp2/library/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/InAppHsp2/library/src/main/resources/base/element/string.json b/BmsSample/InAppHsp2/library/src/main/resources/base/element/string.json deleted file mode 100644 index 98e1d8a84b3d8539ea33e79fe2ac593a05d23bb4..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/src/main/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "shared_desc", - "value": "description" - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/library/src/main/resources/base/profile/main_pages.json b/BmsSample/InAppHsp2/library/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/InAppHsp2/library/src/main/resources/base/profile/route_map.json b/BmsSample/InAppHsp2/library/src/main/resources/base/profile/route_map.json deleted file mode 100644 index bf698b691b4af658303f71e428dd6efa758daff3..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/library/src/main/resources/base/profile/route_map.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "routerMap": [ - { - "name": "library_menu", - "pageSourceFile": "src/main/ets/pages/library_menu.ets", - "buildFunction": "PageOneBuilder", - "data": { - "description": "this is library_menu" - } - } - ] -} \ No newline at end of file diff --git a/BmsSample/InAppHsp2/oh-package.json5 b/BmsSample/InAppHsp2/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/InAppHsp2/ohosTest.md b/BmsSample/InAppHsp2/ohosTest.md deleted file mode 100644 index d4ad5daa111196fac421cc3c30f7e56ca998d7df..0000000000000000000000000000000000000000 --- a/BmsSample/InAppHsp2/ohosTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# HSP 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------------|------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| -| 点击文本click_to_menu | 安装运行 | 点击文本click_to_menu | 页面跳转到hsp模块 |Pass| -| 点击按钮back_to_index | 安装运行 | 点击按钮back_to_index | 页面返回到entry模块 |Pass| \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/.gitignore b/BmsSample/IntegratedHsp/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/IntegratedHsp/AppScope/app.json5 b/BmsSample/IntegratedHsp/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/IntegratedHsp/AppScope/resources/base/element/string.json b/BmsSample/IntegratedHsp/AppScope/resources/base/element/string.json deleted file mode 100644 index 631e63d71dfb584feec33c5075d4343c6c9e50d2..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple010_integrated_hsp" - } - ] -} diff --git a/BmsSample/IntegratedHsp/AppScope/resources/base/media/background.png b/BmsSample/IntegratedHsp/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/IntegratedHsp/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/IntegratedHsp/AppScope/resources/base/media/foreground.png b/BmsSample/IntegratedHsp/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/IntegratedHsp/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/IntegratedHsp/AppScope/resources/base/media/layered_image.json b/BmsSample/IntegratedHsp/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/README_zh.md b/BmsSample/IntegratedHsp/README_zh.md deleted file mode 100644 index 3bc2d20fbb815e221d8cdff59256e7e0b60180ea..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/README_zh.md +++ /dev/null @@ -1,61 +0,0 @@ -# 集成态HSP文档示例 - -### 介绍 - -本示例通过相关配置调整,将HSP转化成集成态HSP,编译产物tgz包,提供给entry集成使用。 - -### 效果预览 -![img.png](img.png) - -### 使用说明 - -1. IDE配置自动签名,选择library模块,编译,构建成tgz产物,给entry模块集成。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/ -| |--- src/ -| |--- main/ -| |--- module.json5 // entry模块配置文件 -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -| |--- libs/library-default.tgz // library编译出来的集成态HSP产物 -library/src/ -| |--- main/ -| |--- module.json5 // library模块配置文件 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/IntegratedHsp > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/build-profile.json5 b/BmsSample/IntegratedHsp/build-profile.json5 deleted file mode 100644 index 4e083d79b3071e7fef2d805528628579c8570ae9..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/build-profile.json5 +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - // [Start integrated_hsp_002] - "useNormalizedOHMUrl": true, - // [End integrated_hsp_002] - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - }, - { - "name": "library", - "srcPath": "./library", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/code-linter.json5 b/BmsSample/IntegratedHsp/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/.gitignore b/BmsSample/IntegratedHsp/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/build-profile.json5 b/BmsSample/IntegratedHsp/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/hvigorfile.ts b/BmsSample/IntegratedHsp/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/libs/library-default.tgz b/BmsSample/IntegratedHsp/entry/libs/library-default.tgz deleted file mode 100644 index fa21ba3044bc4a9eb2cca38d42486443e58ba462..0000000000000000000000000000000000000000 Binary files a/BmsSample/IntegratedHsp/entry/libs/library-default.tgz and /dev/null differ diff --git a/BmsSample/IntegratedHsp/entry/obfuscation-rules.txt b/BmsSample/IntegratedHsp/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/IntegratedHsp/entry/oh-package.json5 b/BmsSample/IntegratedHsp/entry/oh-package.json5 deleted file mode 100644 index 011b13118222ba4cdcfad2c7de356c5732d4b175..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/oh-package.json5 +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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": "", - // [Start integrated_hsp_003] - "dependencies": { - "library": "file:./libs/library-default.tgz" - }, - // [End integrated_hsp_003] -} - diff --git a/BmsSample/IntegratedHsp/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/IntegratedHsp/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/IntegratedHsp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/src/main/ets/pages/Index.ets b/BmsSample/IntegratedHsp/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/src/main/module.json5 b/BmsSample/IntegratedHsp/entry/src/main/module.json5 deleted file mode 100644 index e4226557b12a7322c888516a211fcf6c981c7122..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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": [ - "ohos.want.action.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/BmsSample/IntegratedHsp/entry/src/main/resources/base/element/color.json b/BmsSample/IntegratedHsp/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/src/main/resources/base/element/float.json b/BmsSample/IntegratedHsp/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/IntegratedHsp/entry/src/main/resources/base/element/string.json b/BmsSample/IntegratedHsp/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/background.png b/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/foreground.png b/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/layered_image.json b/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/startIcon.png b/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/IntegratedHsp/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/IntegratedHsp/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/IntegratedHsp/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/IntegratedHsp/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/IntegratedHsp/entry/src/main/resources/dark/element/color.json b/BmsSample/IntegratedHsp/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/hvigor/hvigor-config.json5 b/BmsSample/IntegratedHsp/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/IntegratedHsp/hvigorfile.ts b/BmsSample/IntegratedHsp/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/img.png b/BmsSample/IntegratedHsp/img.png deleted file mode 100644 index f467c0604d9a32f826d3ab67d7d41863e31141d9..0000000000000000000000000000000000000000 Binary files a/BmsSample/IntegratedHsp/img.png and /dev/null differ diff --git a/BmsSample/IntegratedHsp/library/.gitignore b/BmsSample/IntegratedHsp/library/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/library/Index.ets b/BmsSample/IntegratedHsp/library/Index.ets deleted file mode 100644 index 97828a9e38f3aeb80c88f1e0e7ee0ec9162f4c0b..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/Index.ets +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export { add } from './src/main/ets/utils/Calc'; \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/library/build-profile.json5 b/BmsSample/IntegratedHsp/library/build-profile.json5 deleted file mode 100644 index 429dbcf9378ba49f11a5b9b8d70a5bb3437b037f..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/build-profile.json5 +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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": { - // [Start integrated_hsp_001] - "integratedHsp": true, - // [End integrated_hsp_001] - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/library/consumer-rules.txt b/BmsSample/IntegratedHsp/library/consumer-rules.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/BmsSample/IntegratedHsp/library/hvigorfile.ts b/BmsSample/IntegratedHsp/library/hvigorfile.ts deleted file mode 100644 index 0819544cab18b33264760ed49fd296f94ad676a6..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 { hspTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: hspTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/library/obfuscation-rules.txt b/BmsSample/IntegratedHsp/library/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/IntegratedHsp/library/oh-package.json5 b/BmsSample/IntegratedHsp/library/oh-package.json5 deleted file mode 100644 index c5e7176d36f148d48e1f562a3352e2469cd6f91a..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": "library", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "Index.ets", - "author": "", - "license": "Apache-2.0", - "packageType": "InterfaceHar", - "dependencies": { - } -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/library/src/main/ets/pages/Index.ets b/BmsSample/IntegratedHsp/library/src/main/ets/pages/Index.ets deleted file mode 100644 index f8e5c76fa7d81910414170814b6d141dc0cc4212..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/library/src/main/ets/utils/Calc.ets b/BmsSample/IntegratedHsp/library/src/main/ets/utils/Calc.ets deleted file mode 100644 index 8c5be7ec1c31240bcdc7fcdaae04ad9950dbf376..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/src/main/ets/utils/Calc.ets +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export function add(a: number, b: number) { - return a + b; -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/library/src/main/module.json5 b/BmsSample/IntegratedHsp/library/src/main/module.json5 deleted file mode 100644 index 014bd366df28ed9abc0ac10ef99ffd4c60c10c3d..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/src/main/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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": "library", - "type": "shared", - "description": "$string:shared_desc", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "pages": "$profile:main_pages" - } -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/library/src/main/resources/base/element/float.json b/BmsSample/IntegratedHsp/library/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/IntegratedHsp/library/src/main/resources/base/element/string.json b/BmsSample/IntegratedHsp/library/src/main/resources/base/element/string.json deleted file mode 100644 index 98e1d8a84b3d8539ea33e79fe2ac593a05d23bb4..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/src/main/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "shared_desc", - "value": "description" - } - ] -} \ No newline at end of file diff --git a/BmsSample/IntegratedHsp/library/src/main/resources/base/profile/main_pages.json b/BmsSample/IntegratedHsp/library/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/library/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/IntegratedHsp/oh-package.json5 b/BmsSample/IntegratedHsp/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/IntegratedHsp/ohosTest.md b/BmsSample/IntegratedHsp/ohosTest.md deleted file mode 100644 index b5078692eec83e7f1e9bf360518b8049062ad0a8..0000000000000000000000000000000000000000 --- a/BmsSample/IntegratedHsp/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 集成态HSP 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------|--------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功编译出tgz包 |Pass| -| 集成使用安装entry | entry依赖tgz包 | 无 | 生成安装hsp和hap包 |Pass| \ No newline at end of file diff --git a/BmsSample/LayeredImage1/.gitignore b/BmsSample/LayeredImage1/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/LayeredImage1/AppScope/app.json5 b/BmsSample/LayeredImage1/AppScope/app.json5 deleted file mode 100644 index dbd96d1ec4bf22b6a37d875be81820a916b627ec..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/AppScope/app.json5 +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start layered_image_001] -{ - "app": { - // [StartExclude layered_image_001] - "bundleName": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - // [EndExclude layered_image_001] - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} -// [End layered_image_001] diff --git a/BmsSample/LayeredImage1/AppScope/resources/base/element/string.json b/BmsSample/LayeredImage1/AppScope/resources/base/element/string.json deleted file mode 100644 index 48349852d8972d0d5cfda48f8284b47f2f832655..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple002_layered_image" - } - ] -} diff --git a/BmsSample/LayeredImage1/AppScope/resources/base/media/app_icon.png b/BmsSample/LayeredImage1/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage1/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/BmsSample/LayeredImage1/AppScope/resources/base/media/background.png b/BmsSample/LayeredImage1/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage1/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/LayeredImage1/AppScope/resources/base/media/foreground.png b/BmsSample/LayeredImage1/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage1/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/LayeredImage1/AppScope/resources/base/media/layered_image.json b/BmsSample/LayeredImage1/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/README_zh.md b/BmsSample/LayeredImage1/README_zh.md deleted file mode 100644 index 42a443a328acefe5c5f8bec0b88fbf0bd467cd65..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/README_zh.md +++ /dev/null @@ -1,59 +0,0 @@ -# 配置应用图标和名称指南文档示例 - -### 介绍 - -本示例通过配置app.json5和module.json5配置文件,配置单层图标和应用名称。 - -### 效果预览 - -| 桌面 |首页 | -|---------------------------------|---------------------------------| -| ![img.png](screenshots/img.png) |![img_1.png](screenshots/img_1.png)| - -### 使用说明 - -1. 使用IDE自动签名,编译,安装,运行。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/LayeredImage1 > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/LayeredImage1/build-profile.json5 b/BmsSample/LayeredImage1/build-profile.json5 deleted file mode 100644 index f76aea68fc1809964ab900bfb93c5970c228c47d..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/code-linter.json5 b/BmsSample/LayeredImage1/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/.gitignore b/BmsSample/LayeredImage1/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/build-profile.json5 b/BmsSample/LayeredImage1/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/hvigorfile.ts b/BmsSample/LayeredImage1/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/obfuscation-rules.txt b/BmsSample/LayeredImage1/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/LayeredImage1/entry/oh-package.json5 b/BmsSample/LayeredImage1/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/LayeredImage1/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/LayeredImage1/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/LayeredImage1/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/src/main/ets/pages/Index.ets b/BmsSample/LayeredImage1/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/src/main/module.json5 b/BmsSample/LayeredImage1/entry/src/main/module.json5 deleted file mode 100644 index c55273f64680e457f7a460daa93db64a838d9bb8..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/module.json5 +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start layered_image_002] -{ - "module": { - // [StartExclude layered_image_002] - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - // [EndExclude layered_image_002] - "abilities": [ - { - // [StartExclude layered_image_002] - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - // [EndExclude layered_image_002] - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ], - // [StartExclude layered_image_002] - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ], - // [EndExclude layered_image_002] - } -} -// [End layered_image_002] \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/base/element/color.json b/BmsSample/LayeredImage1/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/base/element/float.json b/BmsSample/LayeredImage1/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/base/element/string.json b/BmsSample/LayeredImage1/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/base/media/background.png b/BmsSample/LayeredImage1/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage1/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/base/media/foreground.png b/BmsSample/LayeredImage1/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage1/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/base/media/icon.png b/BmsSample/LayeredImage1/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage1/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/base/media/layered_image.json b/BmsSample/LayeredImage1/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/LayeredImage1/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/LayeredImage1/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/LayeredImage1/entry/src/main/resources/dark/element/color.json b/BmsSample/LayeredImage1/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/hvigor/hvigor-config.json5 b/BmsSample/LayeredImage1/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/LayeredImage1/hvigorfile.ts b/BmsSample/LayeredImage1/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/LayeredImage1/oh-package.json5 b/BmsSample/LayeredImage1/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/LayeredImage1/ohosTest.md b/BmsSample/LayeredImage1/ohosTest.md deleted file mode 100644 index e8b1ca5eedb9a94729224fa14e83217d5b89afa7..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage1/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 配置应用图标和名称 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|--------|-----------|------|-------------|--------------------------------| -| 工程编译安装 | 无 | 编译 | 成功拉起应用 |Pass| -| 桌面图标展示 | 应用安装 | 进入桌面 | 桌面图标和名称正常展示 |Pass| \ No newline at end of file diff --git a/BmsSample/LayeredImage1/screenshots/img.png b/BmsSample/LayeredImage1/screenshots/img.png deleted file mode 100644 index 1040a29865714c5969df566aa7cb05e1973aa0f8..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage1/screenshots/img.png and /dev/null differ diff --git a/BmsSample/LayeredImage1/screenshots/img_1.png b/BmsSample/LayeredImage1/screenshots/img_1.png deleted file mode 100644 index 2ab5727543d0759a16d125557e95ed0bbb7dd259..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage1/screenshots/img_1.png and /dev/null differ diff --git a/BmsSample/LayeredImage2/.gitignore b/BmsSample/LayeredImage2/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/LayeredImage2/AppScope/app.json5 b/BmsSample/LayeredImage2/AppScope/app.json5 deleted file mode 100644 index 42797af6f6ed87afbdd19f8b0ce6d0a870033822..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/AppScope/app.json5 +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start layered_image_003] -{ - "app": { - // [StartExclude layered_image_003] - "bundleName": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - // [EndExclude layered_image_003] - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} -// [End layered_image_003] diff --git a/BmsSample/LayeredImage2/AppScope/resources/base/element/string.json b/BmsSample/LayeredImage2/AppScope/resources/base/element/string.json deleted file mode 100644 index ff019176ce538564d502c6f49da3f80168ccbe64..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple003_layered_image" - } - ] -} diff --git a/BmsSample/LayeredImage2/AppScope/resources/base/media/background.png b/BmsSample/LayeredImage2/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage2/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/LayeredImage2/AppScope/resources/base/media/foreground.png b/BmsSample/LayeredImage2/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage2/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/LayeredImage2/AppScope/resources/base/media/layered_image.json b/BmsSample/LayeredImage2/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/README_zh.md b/BmsSample/LayeredImage2/README_zh.md deleted file mode 100644 index aa0f30f1f8929b890928a89005f1eee2e18db885..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/README_zh.md +++ /dev/null @@ -1,60 +0,0 @@ -# 配置应用图标和名称指南文档示例 - -### 介绍 - -本示例通过配置app.json5和module.json5配置文件,配置多层图标和应用名称。 - -### 效果预览 - -| 桌面 |首页 | -|---------------------------------|---------------------------------| -|![img.png](screenshots/img.png) |![img_1.png](screenshots/img_1.png)| - -### 使用说明 - -1. 使用IDE自动签名,编译,安装,运行。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- layered_image.json // 多层图标配置文件 -| |--- app.json5 // 应用的全局配置信息,icon字段配置多层图标 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/LayeredImage2 > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/LayeredImage2/build-profile.json5 b/BmsSample/LayeredImage2/build-profile.json5 deleted file mode 100644 index f76aea68fc1809964ab900bfb93c5970c228c47d..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/code-linter.json5 b/BmsSample/LayeredImage2/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/.gitignore b/BmsSample/LayeredImage2/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/build-profile.json5 b/BmsSample/LayeredImage2/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/hvigorfile.ts b/BmsSample/LayeredImage2/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/obfuscation-rules.txt b/BmsSample/LayeredImage2/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/LayeredImage2/entry/oh-package.json5 b/BmsSample/LayeredImage2/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/LayeredImage2/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/LayeredImage2/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/LayeredImage2/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/src/main/ets/pages/Index.ets b/BmsSample/LayeredImage2/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/src/main/module.json5 b/BmsSample/LayeredImage2/entry/src/main/module.json5 deleted file mode 100644 index d3c788ee555e8d3a0dae1abf35121a0207b7d75c..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/module.json5 +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start layered_image_004] -{ - "module": { - // [StartExclude layered_image_004] - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - // [EndExclude layered_image_004] - "abilities": [ - { - // [StartExclude layered_image_004] - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - // [StartExclude layered_image_004] - "icon": "$media:layered_image", - "label": "$string:EntryAbility_label", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ], - // [StartExclude layered_image_004] - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ], - // [StartExclude layered_image_004] - } -} -// [End layered_image_004] \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/base/element/color.json b/BmsSample/LayeredImage2/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/base/element/float.json b/BmsSample/LayeredImage2/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/base/element/string.json b/BmsSample/LayeredImage2/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/base/media/background.png b/BmsSample/LayeredImage2/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage2/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/base/media/foreground.png b/BmsSample/LayeredImage2/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage2/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/base/media/layered_image.json b/BmsSample/LayeredImage2/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/base/media/startIcon.png b/BmsSample/LayeredImage2/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage2/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/LayeredImage2/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/LayeredImage2/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/LayeredImage2/entry/src/main/resources/dark/element/color.json b/BmsSample/LayeredImage2/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/hvigor/hvigor-config.json5 b/BmsSample/LayeredImage2/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/LayeredImage2/hvigorfile.ts b/BmsSample/LayeredImage2/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/LayeredImage2/oh-package.json5 b/BmsSample/LayeredImage2/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/LayeredImage2/ohosTest.md b/BmsSample/LayeredImage2/ohosTest.md deleted file mode 100644 index e8b1ca5eedb9a94729224fa14e83217d5b89afa7..0000000000000000000000000000000000000000 --- a/BmsSample/LayeredImage2/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 配置应用图标和名称 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|--------|-----------|------|-------------|--------------------------------| -| 工程编译安装 | 无 | 编译 | 成功拉起应用 |Pass| -| 桌面图标展示 | 应用安装 | 进入桌面 | 桌面图标和名称正常展示 |Pass| \ No newline at end of file diff --git a/BmsSample/LayeredImage2/screenshots/img.png b/BmsSample/LayeredImage2/screenshots/img.png deleted file mode 100644 index 041b83846dd46e0a5bf0744d16db9c9c3f13d93a..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage2/screenshots/img.png and /dev/null differ diff --git a/BmsSample/LayeredImage2/screenshots/img_1.png b/BmsSample/LayeredImage2/screenshots/img_1.png deleted file mode 100644 index 92ff3947609654b5af27fc0210063ddc85f40486..0000000000000000000000000000000000000000 Binary files a/BmsSample/LayeredImage2/screenshots/img_1.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/.gitignore b/BmsSample/ModuleConfigurationFile01/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/ModuleConfigurationFile01/AppScope/app.json5 b/BmsSample/ModuleConfigurationFile01/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/element/string.json deleted file mode 100644 index 1b8ac7a863df2f51ed8b88d444068f6760c7f5a0..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple011_module_configuration_file_001" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/README_zh.md b/BmsSample/ModuleConfigurationFile01/README_zh.md deleted file mode 100644 index e27f5e3af8e7246db19c7defe970177ef903773c..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/README_zh.md +++ /dev/null @@ -1,62 +0,0 @@ -# app.json5配置文件文档示例 - -### 介绍 - -本示例通过配置module.json5配置文件,构建一个项目。 - -### 效果预览 -无 - -### 使用说明 - -1. 编译,安装。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -myHapName/src/ -| |--- main/ -| |--- module.json5 // myHapName模块配置hap类型:"type": "feature" -| |---ets/ -| |---form/MyForm.ets // form处理 -| |---test/TestRunner.ts // 测试代码 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/ModuleConfigurationFile01 > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/build-profile.json5 b/BmsSample/ModuleConfigurationFile01/build-profile.json5 deleted file mode 100644 index 6dd13a23f94f9434ac8715ace027dc71c4d2642e..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/build-profile.json5 +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.0.5(17)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - }, - { - "name": "myHapName", - "srcPath": "./myHapName", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/code-linter.json5 b/BmsSample/ModuleConfigurationFile01/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/.gitignore b/BmsSample/ModuleConfigurationFile01/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/build-profile.json5 b/BmsSample/ModuleConfigurationFile01/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/hvigorfile.ts b/BmsSample/ModuleConfigurationFile01/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/obfuscation-rules.txt b/BmsSample/ModuleConfigurationFile01/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/ModuleConfigurationFile01/entry/oh-package.json5 b/BmsSample/ModuleConfigurationFile01/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/pages/Index.ets b/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index bbedc05edcd8bf25d75d408fbeb8459407fe2d8b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Builder -export function PageOneBuilder() { -} - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/pages/pageOne.ets b/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/pages/pageOne.ets deleted file mode 100644 index 473bf566a6443e4aa980c25d3c6a1be3d5d6e0e3..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/pages/pageOne.ets +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Builder -export function myBuilder() { -} -@Entry -@Component -struct PageOne { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('PageOneHelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/pages/pageTwo.ets b/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/pages/pageTwo.ets deleted file mode 100644 index f84ff215e1484e6b611dbbac8ec5f87ea55ce786..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/ets/pages/pageTwo.ets +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Builder -export function myBuilder() { -} -@Entry -@Component -struct PageTwo { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('PageTwoHelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/module.json5 b/BmsSample/ModuleConfigurationFile01/entry/src/main/module.json5 deleted file mode 100644 index 98f9f4a6bdbb70973048973f6c921e74a920dda8..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/module.json5 +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start module_all] -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "tv", - "tablet" - ], - - "deliveryWithInstall": true, - // [Start module_pages] - "pages": "$profile:main_pages", - // [End module_pages] - "appStartup": "$profile:app_startup_config", - // [Start module_metadata] - "metadata": [ - // [StartExclude module_metadata] - { - "name": "string", - "value": "string", - "resource": "$profile:distributionFilter_config" - }, - // [EndExclude module_metadata] - // [StartExclude module_all] - { - "name": "module_metadata", - "value": "a test demo for module metadata", - "resource": "$profile:shortcuts_config" - } - // [EndExclude module_all] - ], - // [End module_metadata] - // [Start module_abilities_metadata] - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - // [StartExclude module_abilities_metadata] - "description": "$string:EntryAbility_desc", - "icon": "$media:layered_image", - "label": "$string:EntryAbility_label", - "startWindow": "$profile:start_window", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - // [Start module_abilities_skills] - // [StartExclude module_all] - { - "actions": [ - "ohos.want.action.home" - ], - "entities": [ - "entity.system.home" - ], - "uris": [ - { - "scheme":"http", - "host":"example.com", - "port":"80", - "path":"path", - "type": "text/*", - "linkFeature": "Login" - } - ], - "permissions": [], - "domainVerify": false - }, - // [EndExclude module_all] - // [End module_abilities_skills] - // [EndExclude module_abilities_metadata] - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ], - // [StartExclude module_all] - "metadata": [ - { - "name": "ohos.ability.shortcuts", - "resource": "$profile:shortcuts_config" - } - ], - // [StartExclude module_abilities_metadata] - // [EndExclude module_all] - "continueType": [ - "continueType1" - ], - "continueBundleName": [ - "com.example.myapplication1", - "com.example.myapplication2" - ], - // [EndExclude module_abilities_metadata] - } - ], - // [End module_abilities_metadata] - "requestPermissions": [ - { - "name": "ohos.permission.ACCESS_BLUETOOTH", - "reason": "$string:reason", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - } - ], - "querySchemes": [ - "app1Scheme", - "app2Scheme" - ], - "routerMap": "$profile:router_map", - // [Start module_appEnvironments] - "appEnvironments": [ - { - "name": "name1", - "value": "value1" - } - ], - // [End module_appEnvironments] - // [Start module_fileContextMenu] - "fileContextMenu": "$profile:menu", - // [End module_fileContextMenu] - "crossAppSharedConfig": "$profile:shared_config", - // [StartExclude module_all] - // [Start module_systemTheme] - "systemTheme": "$profile:theme_config", - // [End module_systemTheme] - // [EndExclude module_all] - } -} -// [End module_all] \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/element/color.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/element/float.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a0a93dd91fd48f08f3a9532c76e9b26e68d4c034..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 2dd5eb9a48a114d4ed608d3bec7121fa7999f5c0..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "reason", - "value": "label" - }, - { - "name": "shortcut", - "value": "shortcut" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/aa_icon.png b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/aa_icon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/aa_icon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/icon.png b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/startIcon.png b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/app_startup_config.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/app_startup_config.json deleted file mode 100644 index 334f4de5756ed31f9f618ea8e3ca9bdfd3112bc9..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/app_startup_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "startupTasks": [ - ], - "appPreloadHintStartupTasks": [ - ], - "configEntry": "./ets/entryability/EntryAbility.ets" -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/distributionFilter_config.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/distributionFilter_config.json deleted file mode 100644 index d4e67f3e3d99fbbb9486e29daab4e277f126a2ee..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/distributionFilter_config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "distributionFilter": { - "screenShape": { - "policy": "include", - "value": [ - "circle", - "rect" - ] - }, - "screenWindow": { - "policy": "include", - "value": [ - "454*454", - "466*466" - ] - }, - "screenDensity": { - "policy": "exclude", - "value": [ - "ldpi", - "xldpi" - ] - }, - "countryCode": { - "policy": "include", - "value": [ - "CN" - ] - } - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index bf2fc0f036a50f4a783bd8c5512564bd533de83f..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/pageTwo", - "pages/pageOne" - ], - "window": { - "designWidth": 720, - "autoDesignWidth": false - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/menu.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/menu.json deleted file mode 100644 index 5cfa5f14962840f42047a61f79accf8f158d3378..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/menu.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "fileContextMenu": [ - { - "abilityName": "EntryAbility", - "menuItem": "$string:module_desc", - "menuHandler": "openCompress", - "menuContext": [ - { - "menuKind": 0 - }, - { - "menuKind": 1, - "menuRule": "both", - "fileSupportType": [ - ".rar", - ".zip" - ] - }, - { - "menuKind": 2, - "menuRule": "single" - }, - { - "menuKind": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/router_map.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/router_map.json deleted file mode 100644 index ce4889aae8f9fbeae5e8307b9ea19821aabff6ba..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/router_map.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "routerMap": [ - { - "name": "DynamicPage1", - "pageSourceFile": "src/main/ets/pages/Index.ets", - "buildFunction": "PageOneBuilder", - "customData": { - "stringKey": "data1", - "numberKey": 123, - "booleanKey": true, - "objectKey": { - "name": "test" - }, - "arrayKey": [ - { - "id": 123 - } - ] - } - }, - { - "name": "DynamicPage2", - "pageSourceFile": "src/main/ets/pages/pageTwo.ets", - "buildFunction": "myBuilder", - "data": { - "key1": "data1", - "key2": "data2" - } - }, - { - "name": "DynamicPage", - "pageSourceFile": "src/main/ets/pages/pageOne.ets", - "buildFunction": "myBuilder", - "data": { - "key1": "data1", - "key2": "data2" - }, - "customData": { - "stringKey": "data1", - "numberKey": 123, - "booleanKey": true, - "objectKey": { - "name": "test" - }, - "arrayKey": [ - { - "id": 123 - } - ] - } - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/shared_config.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/shared_config.json deleted file mode 100644 index 02ec33404c8fe435793a1ec022c6222c896c51de..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/shared_config.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "crossAppSharedConfig": [ - { - "uri": "datashareproxy://com.example.example/key1", - "value": "SHARED_CONFIG_DEMO1", - "allowList": [ - "6917573629901742292" - ] - }, - { - "uri": "datashareproxy://com.example.example/key2", - "value": "SHARED_CONFIG_DEMO2", - "allowList": [ - "6917573298752100864", - "6917573298752100864" - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/shortcuts_config.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/shortcuts_config.json deleted file mode 100644 index d1c699206b7b86d2349b41fb0e9fa4c59a6efc55..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/shortcuts_config.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "shortcuts": [ - { - "shortcutId": "id_test1", - "label": "$string:shortcut", - "icon": "$media:aa_icon", - "wants": [ - { - "bundleName": "com.ohos.hello", - "moduleName": "entry", - "abilityName": "EntryAbility", - "parameters": { - "testKey": "testValue" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/start_window.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/start_window.json deleted file mode 100644 index e134a6778e5795e12da34c9fda83f1796ce2e348..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/start_window.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "startWindowAppIcon": "$media:background", - "startWindowIllustration": "$media:background", - "startWindowBrandingImage": "$media:background", - "startWindowBackgroundColor": "$color:start_window_background", - "startWindowBackgroundImage": "$media:background", - "startWindowBackgroundImageFit": "Cover" -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/theme_config.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/theme_config.json deleted file mode 100644 index 6bb4d8e63f83acf221e299ac18be39440c9d4e29..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/base/profile/theme_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "systemTheme": "$ohos:theme:ohos_theme" -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/dark/element/color.json b/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/hvigor/hvigor-config.json5 b/BmsSample/ModuleConfigurationFile01/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/ModuleConfigurationFile01/hvigorfile.ts b/BmsSample/ModuleConfigurationFile01/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/.gitignore b/BmsSample/ModuleConfigurationFile01/myHapName/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/build-profile.json5 b/BmsSample/ModuleConfigurationFile01/myHapName/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/hvigorfile.ts b/BmsSample/ModuleConfigurationFile01/myHapName/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/obfuscation-rules.txt b/BmsSample/ModuleConfigurationFile01/myHapName/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/ModuleConfigurationFile01/myHapName/oh-package.json5 b/BmsSample/ModuleConfigurationFile01/myHapName/oh-package.json5 deleted file mode 100644 index 854d22d25ee3280b2b954218dcff87e07581dd66..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "myhapname", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/entryability/EntryAbility.ets b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 9ee2719627f0162c968a10dddc1cadf950605116..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/form/MyForm.ets b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/form/MyForm.ets deleted file mode 100644 index 0174d485148fc7ebb5f71cd5f4378dbeff795e9b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/form/MyForm.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; -import { FormExtensionAbility } from '@kit.FormKit'; - -const DOMAIN = 0x0000; - -export default class MyForm extends FormExtensionAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/myhapnameembeddeduiextability/pages/MyHapNameEmbeddedUIExtAbilityPage.ets b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/myhapnameembeddeduiextability/pages/MyHapNameEmbeddedUIExtAbilityPage.ets deleted file mode 100644 index 079724727e22d0a718e3f77a7316a659a6faf83e..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/myhapnameembeddeduiextability/pages/MyHapNameEmbeddedUIExtAbilityPage.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct MyHapNameEmbeddedUIExtAbilityPage { - @State message: string = 'EmbeddedUIExtAbility'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/pages/Index.ets b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/test/TestRunner.ts b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/test/TestRunner.ts deleted file mode 100644 index 8c309778ddbde7c539ca8c2534d1b4a5e76f3335..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/ets/test/TestRunner.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export default function TestRunner() { - -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/module.json5 b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/module.json5 deleted file mode 100644 index 06a5d88d7dae274b6a358663cbff889fc852ac1b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/module.json5 +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2025 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": "myHapName", - "type": "feature", - // [Start module_deviceTypes] - "deviceTypes": [ - "tv", - "tablet" - ], - // [End module_deviceTypes] - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - // [Start module_testRunner] - "testRunner": { - "name": "myTestRunnerName", - "srcPath": "etc/test/TestRunner.ts" - }, - // [End module_testRunner] - // [Start module_dependencies] - "dependencies": [ - { - "bundleName":"com.share.library", - "moduleName": "library", - "versionCode": 10001 - } - ], - // [End module_dependencies] - // [Start module_proxyData] - "proxyData": [ - { - "uri":"datashareproxy://ohos.app.hap.myapplication/event/Meeting", - "requiredReadPermission": "ohos.permission.SYSTEM_FLOAT_WINDOW", - "requiredWritePermission": "ohos.permission.SYSTEM_FLOAT_WINDOW", - "metadata": { - "name": "datashare_metadata", - "resource": "$profile:datashare" - } - } - ], - // [Start module_proxyData] - // [Start module_abilities] - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "launchType": "singleton", - "description": "$string:description_main_ability", - "icon": "$media:layered_image", - "label": "$string:EntryAbility_label", - "permissions": [], - "metadata": [], - "exported": true, - "continuable": true, - "skills": [ - { - "actions": [ - "ohos.want.action.home" - ], - "entities": [ - "entity.system.home" - ], - "uris": [] - } - ], - "backgroundModes": [ - "dataTransfer" - ], - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:red", - "removeMissionAfterTerminate": true, - "orientation": "$string:orientation", - "supportWindowMode": [ - "fullscreen", - "split", - "floating" - ], - "maxWindowRatio": 3.5, - "minWindowRatio": 0.5, - "maxWindowWidth": 2560, - "minWindowWidth": 1400, - "maxWindowHeight": 300, - "minWindowHeight": 200, - "excludeFromMissions": false, - "preferMultiWindowOrientation": "default", - "isolationProcess": false, - "continueType": [ - "continueType1", - "continueType2" - ], - "continueBundleName": [ - "com.example.myapplication1", - "com.example.myapplication2" - ], - "process": ":processTag" - } - ], - // [End module_abilities] - // [Start module_extensionAbilities] - "extensionAbilities": [ - { - "name": "FormName", - "srcEntry": "./ets/form/MyForm.ets", - "icon": "$media:icon", - "label" : "$string:extension_name", - "description": "$string:form_description", - "type": "form", - "permissions": ["ohos.permission.ACCESS_BLUETOOTH"], - "exported": true, - "uri":"scheme://authority/path/query", - "skills": [{ - "actions": [], - "entities": [], - "uris": [], - "permissions": [] - }], - "metadata": [ - { - "name": "ohos.extension.form", - "resource": "$profile:form_config", - } - ], - "extensionProcessMode": "instance", - "dataGroupIds": [ - "testGroupId1" - ] - } - ], - // [End module_extensionAbilities] - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/element/color.json b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/element/color.json deleted file mode 100644 index 089f2f889e6ed033bae254721de8a42b905d7e04..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/element/color.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - },{ - "name": "red", - "value": "#FFDE3838" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/element/float.json b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/element/float.json deleted file mode 100644 index a0a93dd91fd48f08f3a9532c76e9b26e68d4c034..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/element/string.json deleted file mode 100644 index 5f3d8b8e944a9b60233b029e0520f20e41664e92..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "description_main_ability", - "value": "description_main_ability" - }, - { - "name": "orientation", - "value": "landscape" - }, - { - "name": "form_description", - "value": "form_description" - }, - { - "name": "extension_name", - "value": "extension_name" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/icon.png b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/icon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/startIcon.png b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/profile/datashare.json b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/profile/datashare.json deleted file mode 100644 index ea7025f5b77c9b1ae25acc779590154752d2ec43..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/profile/datashare.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "datashare": { - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/profile/form_config.json b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/profile/form_config.json deleted file mode 100644 index f552f39b84da9362a0906fb7570daa3959f837ea..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/profile/form_config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "forms": [ - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/profile/main_pages.json b/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 7072ba069d65fa54308b849168c18abb5bba9872..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/myHapName/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/Index", - "myhapnameembeddeduiextability/pages/MyHapNameEmbeddedUIExtAbilityPage" - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile01/oh-package.json5 b/BmsSample/ModuleConfigurationFile01/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/ModuleConfigurationFile01/ohosTest.md b/BmsSample/ModuleConfigurationFile01/ohosTest.md deleted file mode 100644 index 96c8467669e99efc67af50eadf01c37a064019c1..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile01/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# app.json5配置文件 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------|------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/.gitignore b/BmsSample/ModuleConfigurationFile02/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/ModuleConfigurationFile02/AppScope/app.json5 b/BmsSample/ModuleConfigurationFile02/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/element/string.json deleted file mode 100644 index f52ef23a7d75fd78c3da54f7a75648ee1d56b962..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ModuleConfigurationFile02" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/README_zh.md b/BmsSample/ModuleConfigurationFile02/README_zh.md deleted file mode 100644 index 964dfca5aa54339477a70f244e1b7885f44714c9..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/README_zh.md +++ /dev/null @@ -1,56 +0,0 @@ -# app.json5配置文件文档示例 - -### 介绍 - -本示例通过配置module.json5配置文件,构建一个项目。 - -### 效果预览 -无 - -### 使用说明 - -1. 编译,安装。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/ModuleConfigurationFile02 > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/build-profile.json5 b/BmsSample/ModuleConfigurationFile02/build-profile.json5 deleted file mode 100644 index aada088f9955bec7aa3d7b03cda34da47f87dd85..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry2", - "srcPath": "./entry2", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/code-linter.json5 b/BmsSample/ModuleConfigurationFile02/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/.gitignore b/BmsSample/ModuleConfigurationFile02/entry2/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/build-profile.json5 b/BmsSample/ModuleConfigurationFile02/entry2/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/hvigorfile.ts b/BmsSample/ModuleConfigurationFile02/entry2/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/obfuscation-rules.txt b/BmsSample/ModuleConfigurationFile02/entry2/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/ModuleConfigurationFile02/entry2/oh-package.json5 b/BmsSample/ModuleConfigurationFile02/entry2/oh-package.json5 deleted file mode 100644 index 6f8ebfffe80a99a9743e76a638cdd63c2b6ec72f..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "entry2", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/ets/entry2ability/Entry2Ability.ets b/BmsSample/ModuleConfigurationFile02/entry2/src/main/ets/entry2ability/Entry2Ability.ets deleted file mode 100644 index 06a08f8e406e2bcac6965e798dc5402deab84353..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/ets/entry2ability/Entry2Ability.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class Entry2Ability extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/ets/entry2backupability/Entry2BackupAbility.ets b/BmsSample/ModuleConfigurationFile02/entry2/src/main/ets/entry2backupability/Entry2BackupAbility.ets deleted file mode 100644 index d9165ed62d90193fd8dcf0dfcb3c54a5a40bd8b8..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/ets/entry2backupability/Entry2BackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class Entry2BackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/ets/pages/Index.ets b/BmsSample/ModuleConfigurationFile02/entry2/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/module.json5 b/BmsSample/ModuleConfigurationFile02/entry2/src/main/module.json5 deleted file mode 100644 index aa0a8ce3c0fa8ecf2b5286709be59751d88b3a62..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/module.json5 +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start module_distributionFilter_02] -{ - "module": { - "name": "entry2", - "type": "entry", - "deviceTypes": [ - "tv", - "tablet" - ], - // [StartExclude module_distributionFilter_02] - "description": "$string:module_desc", - "mainElement": "Entry2Ability", - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "Entry2Ability", - "srcEntry": "./ets/entry2ability/Entry2Ability.ets", - "description": "$string:Entry2Ability_desc", - "icon": "$media:layered_image", - "label": "$string:Entry2Ability_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "Entry2BackupAbility", - "srcEntry": "./ets/entry2backupability/Entry2BackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ] - }, - // [EndExclude module_distributionFilter_02] -} -// [End module_distributionFilter_02] \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/element/color.json b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/element/float.json b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/element/string.json deleted file mode 100644 index b5d6bb35a6a060543c4f14bd39037a5a5041599e..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "Entry2Ability_desc", - "value": "description" - }, - { - "name": "Entry2Ability_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/startIcon.png b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/profile/backup_config.json b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/profile/main_pages.json b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/dark/element/color.json b/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/entry2/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/hvigor/hvigor-config.json5 b/BmsSample/ModuleConfigurationFile02/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/ModuleConfigurationFile02/hvigorfile.ts b/BmsSample/ModuleConfigurationFile02/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile02/oh-package.json5 b/BmsSample/ModuleConfigurationFile02/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/ModuleConfigurationFile02/ohosTest.md b/BmsSample/ModuleConfigurationFile02/ohosTest.md deleted file mode 100644 index 96c8467669e99efc67af50eadf01c37a064019c1..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile02/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# app.json5配置文件 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------|------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/.gitignore b/BmsSample/ModuleConfigurationFile03/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/ModuleConfigurationFile03/AppScope/app.json5 b/BmsSample/ModuleConfigurationFile03/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/element/string.json deleted file mode 100644 index 9dd26dcfb092a7d6225f522bcfe4adcd0e1c59ef..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ModuleConfigurationFile01" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/README_zh.md b/BmsSample/ModuleConfigurationFile03/README_zh.md deleted file mode 100644 index 72c22c4c81252d89f3d0dd94fcf0d0cac37990cb..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/README_zh.md +++ /dev/null @@ -1,56 +0,0 @@ -# app.json5配置文件文档示例 - -### 介绍 - -本示例通过配置module.json5配置文件,构建一个项目。 - -### 效果预览 -无 - -### 使用说明 - -1. 编译,安装。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/ModuleConfigurationFile03 > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/build-profile.json5 b/BmsSample/ModuleConfigurationFile03/build-profile.json5 deleted file mode 100644 index b2bd520d567073f119077a09dfa076297ff95677..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.0.5(17)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry1", - "srcPath": "./entry1", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/code-linter.json5 b/BmsSample/ModuleConfigurationFile03/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/.gitignore b/BmsSample/ModuleConfigurationFile03/entry1/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/build-profile.json5 b/BmsSample/ModuleConfigurationFile03/entry1/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/hvigorfile.ts b/BmsSample/ModuleConfigurationFile03/entry1/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/obfuscation-rules.txt b/BmsSample/ModuleConfigurationFile03/entry1/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/ModuleConfigurationFile03/entry1/oh-package.json5 b/BmsSample/ModuleConfigurationFile03/entry1/oh-package.json5 deleted file mode 100644 index c4e8768835e5e869bbd19dfb80d2e323afaa6f2d..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "entry1", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/ets/entry1ability/Entry1Ability.ets b/BmsSample/ModuleConfigurationFile03/entry1/src/main/ets/entry1ability/Entry1Ability.ets deleted file mode 100644 index 21d1f8efd15a54ad067417d77a72e9c7d7e0df6a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/ets/entry1ability/Entry1Ability.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class Entry1Ability extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/ets/entry1backupability/Entry1BackupAbility.ets b/BmsSample/ModuleConfigurationFile03/entry1/src/main/ets/entry1backupability/Entry1BackupAbility.ets deleted file mode 100644 index 95ff1026616ef66e920c1f911f70be1c773527e7..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/ets/entry1backupability/Entry1BackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class Entry1BackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/ets/pages/Index.ets b/BmsSample/ModuleConfigurationFile03/entry1/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/module.json5 b/BmsSample/ModuleConfigurationFile03/entry1/src/main/module.json5 deleted file mode 100644 index 39c0268a0a6b873705ee2984c4ebe412f5c3e0ac..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/module.json5 +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start module_distributionFilter_01] -{ - "module": { - "name": "entry1", - "type": "entry", - "deviceTypes": [ - "tv", - "tablet" - ], - // [StartExclude module_distributionFilter_01] - // [Start module_distributionFilter_metadata] - "metadata": [ - { - "name": "ohos.module.distribution", - "resource": "$profile:distributionFilter_config", - } - ], - // [End module_distributionFilter_metadata] - "description": "$string:module_desc", - "mainElement": "Entry1Ability", - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "Entry1Ability", - "srcEntry": "./ets/entry1ability/Entry1Ability.ets", - "description": "$string:Entry1Ability_desc", - "icon": "$media:layered_image", - "label": "$string:Entry1Ability_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "Entry1BackupAbility", - "srcEntry": "./ets/entry1backupability/Entry1BackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ] - }, - // [EndExclude module_distributionFilter_01] -} -// [End module_distributionFilter_01] \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/element/color.json b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/element/float.json b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/element/string.json deleted file mode 100644 index 4d2a1cd5ec94874a58da7de5b299437ea29d1465..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "Entry1Ability_desc", - "value": "description" - }, - { - "name": "Entry1Ability_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/startIcon.png b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/profile/backup_config.json b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/profile/distributionFilter_config.json b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/profile/distributionFilter_config.json deleted file mode 100644 index c06f79114b58678c6317eec97fade75d5a17524d..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/profile/distributionFilter_config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "distributionFilter": { - "screenShape": { - "policy": "include", - "value": [ - "circle", - "rect" - ] - }, - "screenWindow": { - "policy": "include", - "value": [ - "454*454", - "466*466" - ] - }, - "screenDensity": { - "policy": "exclude", - "value": [ - "ldpi", - "xldpi" - ] - }, - "countryCode": { - "policy": "include", - "value": [ - "CN" - ] - } - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/profile/main_pages.json b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/dark/element/color.json b/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/entry1/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/hvigor/hvigor-config.json5 b/BmsSample/ModuleConfigurationFile03/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/ModuleConfigurationFile03/hvigorfile.ts b/BmsSample/ModuleConfigurationFile03/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile03/oh-package.json5 b/BmsSample/ModuleConfigurationFile03/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/ModuleConfigurationFile03/ohosTest.md b/BmsSample/ModuleConfigurationFile03/ohosTest.md deleted file mode 100644 index 96c8467669e99efc67af50eadf01c37a064019c1..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile03/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# app.json5配置文件 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------|------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/.gitignore b/BmsSample/ModuleConfigurationFile04/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/ModuleConfigurationFile04/AppScope/app.json5 b/BmsSample/ModuleConfigurationFile04/AppScope/app.json5 deleted file mode 100644 index 81e8dc60d1c36989d311a1378e2a3b712453a469..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/AppScope/app.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name", - "bundleType": "atomicService" - } -} diff --git a/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/element/string.json deleted file mode 100644 index 6bf99024b318fe8aff77eefd326976a49c6bc3d7..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ModuleConfigurationFile03" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/README_zh.md b/BmsSample/ModuleConfigurationFile04/README_zh.md deleted file mode 100644 index 0fdf9b71445a280299ecc4d71cf8ba878151b6b4..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/README_zh.md +++ /dev/null @@ -1,59 +0,0 @@ -# app.json5配置文件文档示例 - -### 介绍 - -本示例通过配置module.json5配置文件的atomicService标签,构建一个项目。 - -### 效果预览 -无 - -### 使用说明 - -1. 编译,安装。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -feature/src/ -| |--- main/ -| |--- module.json5 // feature模块配置hap类型:"type": "feature" -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/ModuleConfigurationFile04 > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/build-profile.json5 b/BmsSample/ModuleConfigurationFile04/build-profile.json5 deleted file mode 100644 index cae56e42ccc96c65b3689c3eec9e7633b4562a20..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/build-profile.json5 +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - }, - { - "name": "feature", - "srcPath": "./feature", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/code-linter.json5 b/BmsSample/ModuleConfigurationFile04/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/.gitignore b/BmsSample/ModuleConfigurationFile04/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/build-profile.json5 b/BmsSample/ModuleConfigurationFile04/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/hvigorfile.ts b/BmsSample/ModuleConfigurationFile04/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/obfuscation-rules.txt b/BmsSample/ModuleConfigurationFile04/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/ModuleConfigurationFile04/entry/oh-package.json5 b/BmsSample/ModuleConfigurationFile04/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/ModuleConfigurationFile04/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/ModuleConfigurationFile04/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/ets/pages/Index.ets b/BmsSample/ModuleConfigurationFile04/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/module.json5 b/BmsSample/ModuleConfigurationFile04/entry/src/main/module.json5 deleted file mode 100644 index b9ed19861257530e365182792b28fb4def135bd8..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/module.json5 +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [start module_atomicService] -{ - "module": { - // [StartExclude module_atomicService] - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "tablet" - ], - // [EndExclude module_atomicService] - "atomicService": { - "preloads":[ - { - "moduleName":"feature" - } - ], - "resizeable": true - }, - // [StartExclude module_atomicService] - "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": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - ] - }, - // [EndExclude module_atomicService] -} -// [End module_atomicService] \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/element/color.json b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/element/float.json b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/startIcon.png b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/dark/element/color.json b/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/feature/.gitignore b/BmsSample/ModuleConfigurationFile04/feature/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/feature/build-profile.json5 b/BmsSample/ModuleConfigurationFile04/feature/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/feature/hvigorfile.ts b/BmsSample/ModuleConfigurationFile04/feature/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/feature/obfuscation-rules.txt b/BmsSample/ModuleConfigurationFile04/feature/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/ModuleConfigurationFile04/feature/oh-package.json5 b/BmsSample/ModuleConfigurationFile04/feature/oh-package.json5 deleted file mode 100644 index 41956f78cd2723db47b077d0ad28590666553b7f..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "feature", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/BmsSample/ModuleConfigurationFile04/feature/src/main/ets/featureability/FeatureAbility.ets b/BmsSample/ModuleConfigurationFile04/feature/src/main/ets/featureability/FeatureAbility.ets deleted file mode 100644 index 9c74e67e654d6763d17bbac85116b30f436e6bf8..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/src/main/ets/featureability/FeatureAbility.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class FeatureAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/BmsSample/ModuleConfigurationFile04/feature/src/main/ets/pages/Index.ets b/BmsSample/ModuleConfigurationFile04/feature/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/feature/src/main/module.json5 b/BmsSample/ModuleConfigurationFile04/feature/src/main/module.json5 deleted file mode 100644 index e053c9a648e4497da41f9de7727a1c7de3e1ad1c..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/src/main/module.json5 +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2025 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": "feature", - "type": "feature", - "description": "$string:module_desc", - "mainElement": "FeatureAbility", - "deviceTypes": [ - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "FeatureAbility", - "srcEntry": "./ets/featureability/FeatureAbility.ets", - "description": "$string:FeatureAbility_desc", - "icon": "$media:icon", - "label": "$string:FeatureAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/element/color.json b/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/element/float.json b/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/element/string.json deleted file mode 100644 index 01a21433fd9b713f8e23c5168d556447263eaca9..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "FeatureAbility_desc", - "value": "description" - }, - { - "name": "FeatureAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/media/icon.png b/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/media/icon.png deleted file mode 100644 index 514fd9577eff00bd72c2a6a0fab27064feb94f3b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/media/startIcon.png b/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 514fd9577eff00bd72c2a6a0fab27064feb94f3b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/profile/main_pages.json b/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/feature/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/ModuleConfigurationFile04/hvigor/hvigor-config.json5 b/BmsSample/ModuleConfigurationFile04/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/ModuleConfigurationFile04/hvigorfile.ts b/BmsSample/ModuleConfigurationFile04/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile04/oh-package.json5 b/BmsSample/ModuleConfigurationFile04/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/ModuleConfigurationFile04/ohosTest.md b/BmsSample/ModuleConfigurationFile04/ohosTest.md deleted file mode 100644 index 96c8467669e99efc67af50eadf01c37a064019c1..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile04/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# app.json5配置文件 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------|------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/.gitignore b/BmsSample/ModuleConfigurationFile05/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/ModuleConfigurationFile05/AppScope/app.json5 b/BmsSample/ModuleConfigurationFile05/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/element/string.json deleted file mode 100644 index c6db898c2c5070756bbf744c6ae6cf22cf59a22a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ModuleConfigurationFile05" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/README_zh.md b/BmsSample/ModuleConfigurationFile05/README_zh.md deleted file mode 100644 index 3b175572de13628eb71e7f6bc0c99be2fa602d96..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/README_zh.md +++ /dev/null @@ -1,56 +0,0 @@ -# app.json5配置文件文档示例 - -### 介绍 - -本示例通过配置module.json5配置文件的hnpPackages字段和definePermissions,构建一个项目。 - -### 效果预览 -无 - -### 使用说明 - -1. 编译,安装。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/ModuleConfigurationFile05 > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/build-profile.json5 b/BmsSample/ModuleConfigurationFile05/build-profile.json5 deleted file mode 100644 index a056241274ca4a394adb0703811e0af80fe27105..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.0.5(17)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/code-linter.json5 b/BmsSample/ModuleConfigurationFile05/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/.gitignore b/BmsSample/ModuleConfigurationFile05/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/build-profile.json5 b/BmsSample/ModuleConfigurationFile05/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/hvigorfile.ts b/BmsSample/ModuleConfigurationFile05/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/obfuscation-rules.txt b/BmsSample/ModuleConfigurationFile05/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/ModuleConfigurationFile05/entry/oh-package.json5 b/BmsSample/ModuleConfigurationFile05/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/ModuleConfigurationFile05/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/ModuleConfigurationFile05/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/ModuleConfigurationFile05/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/ets/pages/Index.ets b/BmsSample/ModuleConfigurationFile05/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/module.json5 b/BmsSample/ModuleConfigurationFile05/entry/src/main/module.json5 deleted file mode 100644 index 5408a62d898f5ad9034dafad4e996d256416113d..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/module.json5 +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start module_hnpPackages] -{ - "module": { - // [StartExclude module_hnpPackages] - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "tablet" - ], - //这里配置保证编译通过,实际开发过程请参考:https://gitcode.com/openharmony/startup_appspawn/blob/master/service/hnp/README_zh.md - // [EndExclude module_hnpPackages] - "hnpPackages": [ - { - "package": "hnpsample.hnp", - "type": "public" - } - ], - // [StartExclude module_hnpPackages] - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - // [Start module_definePermissions] - "definePermissions": [ - { - "name": "ohos.permission.ACCESS_BLUETOOTH", - "grantMode": "system_grant", - "availableLevel": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:EntryAbility_label" - } - ], - // [End module_definePermissions] - "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": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ] - }, - // [EndExclude module_hnpPackages] -} -// [End module_hnpPackages] \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/element/color.json b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/element/float.json b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/element/string.json b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/background.png b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/foreground.png b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/layered_image.json b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/startIcon.png b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/dark/element/color.json b/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/hvigor/hvigor-config.json5 b/BmsSample/ModuleConfigurationFile05/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/ModuleConfigurationFile05/hvigorfile.ts b/BmsSample/ModuleConfigurationFile05/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/ModuleConfigurationFile05/oh-package.json5 b/BmsSample/ModuleConfigurationFile05/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/ModuleConfigurationFile05/ohosTest.md b/BmsSample/ModuleConfigurationFile05/ohosTest.md deleted file mode 100644 index 96c8467669e99efc67af50eadf01c37a064019c1..0000000000000000000000000000000000000000 --- a/BmsSample/ModuleConfigurationFile05/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# app.json5配置文件 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------|------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| \ No newline at end of file diff --git a/BmsSample/Multiinstance/.gitignore b/BmsSample/Multiinstance/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/Multiinstance/AppScope/app.json5 b/BmsSample/Multiinstance/AppScope/app.json5 deleted file mode 100644 index 09930c8635c963d98f1ee90e08eae922d613848a..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/AppScope/app.json5 +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start multi_instance] -{ - "app": { - // [StartExclude multi_instance] - "bundleName": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name", - // [EndExclude multi_instance] - "multiAppMode": { - "multiAppModeType": "multiInstance", - "maxCount": 5 - } - } -} -// [End multi_instance] \ No newline at end of file diff --git a/BmsSample/Multiinstance/AppScope/resources/base/element/string.json b/BmsSample/Multiinstance/AppScope/resources/base/element/string.json deleted file mode 100644 index 6e3fccbce26a8c0bf18e0dcb1f55635b819c1e07..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple004_multiinstance" - } - ] -} diff --git a/BmsSample/Multiinstance/AppScope/resources/base/media/background.png b/BmsSample/Multiinstance/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/Multiinstance/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/Multiinstance/AppScope/resources/base/media/foreground.png b/BmsSample/Multiinstance/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/Multiinstance/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/Multiinstance/AppScope/resources/base/media/layered_image.json b/BmsSample/Multiinstance/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/README_zh.md b/BmsSample/Multiinstance/README_zh.md deleted file mode 100644 index 03582e81c8fc25955c5a264a948741c86b780c33..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/README_zh.md +++ /dev/null @@ -1,61 +0,0 @@ -# 创建应用多实例指南文档示例 - -### 介绍 - -本示例通过配置app.json5配置文件multiAppMode字段,配置多实例的应用,多实例模式。该标签仅支持2in1设备。 - -### 效果预览 - -| 桌面 | -|---------------------------------| -|![img.png](screenshots/img.png)| - -### 使用说明 - -1. 使用IDE自动签名,编译,安装,运行。 - -2. 右击桌面应用图标启动一个应用进程,然后再次右击该应用图标,选择“打开”。 - -3. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息,multiAppMode字段配置多实例的应用 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API17版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/Multiinstance > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/Multiinstance/build-profile.json5 b/BmsSample/Multiinstance/build-profile.json5 deleted file mode 100644 index a056241274ca4a394adb0703811e0af80fe27105..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.0.5(17)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/code-linter.json5 b/BmsSample/Multiinstance/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/.gitignore b/BmsSample/Multiinstance/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/build-profile.json5 b/BmsSample/Multiinstance/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/hvigorfile.ts b/BmsSample/Multiinstance/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/obfuscation-rules.txt b/BmsSample/Multiinstance/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/Multiinstance/entry/oh-package.json5 b/BmsSample/Multiinstance/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/Multiinstance/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/Multiinstance/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/Multiinstance/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/src/main/ets/pages/Index.ets b/BmsSample/Multiinstance/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/src/main/module.json5 b/BmsSample/Multiinstance/entry/src/main/module.json5 deleted file mode 100644 index e7b97706fc3892b66ff98ad95fe7d618fdb42554..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "ohos.want.action.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/BmsSample/Multiinstance/entry/src/main/resources/base/element/color.json b/BmsSample/Multiinstance/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/src/main/resources/base/element/float.json b/BmsSample/Multiinstance/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/Multiinstance/entry/src/main/resources/base/element/string.json b/BmsSample/Multiinstance/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/src/main/resources/base/media/background.png b/BmsSample/Multiinstance/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/Multiinstance/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/Multiinstance/entry/src/main/resources/base/media/foreground.png b/BmsSample/Multiinstance/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/Multiinstance/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/Multiinstance/entry/src/main/resources/base/media/layered_image.json b/BmsSample/Multiinstance/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/src/main/resources/base/media/startIcon.png b/BmsSample/Multiinstance/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/Multiinstance/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/Multiinstance/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/Multiinstance/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/Multiinstance/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/Multiinstance/entry/src/main/resources/dark/element/color.json b/BmsSample/Multiinstance/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/hvigor/hvigor-config.json5 b/BmsSample/Multiinstance/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/Multiinstance/hvigorfile.ts b/BmsSample/Multiinstance/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/Multiinstance/oh-package.json5 b/BmsSample/Multiinstance/oh-package.json5 deleted file mode 100644 index 60c65d04588cb2bf05d575e43ec25fa7eb3ebd80..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/Multiinstance/ohosTest.md b/BmsSample/Multiinstance/ohosTest.md deleted file mode 100644 index ac56e22fbbe8082d5bb570effc13d684406d8205..0000000000000000000000000000000000000000 --- a/BmsSample/Multiinstance/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 创建应用多实例 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|--------|-----------|-------|-------------|--------------------------------| -| 工程编译安装 | 编译正常正常安装 | 无 | 成功拉起应用 |Pass| -| 桌面展示 | 应用安装,进入桌面 | 右击桌面应用图标启动一个应用进程,然后再次右击该应用图标,选择“打开” |桌面上会显示同一个应用的两个进程页面 |Pass| \ No newline at end of file diff --git a/BmsSample/Multiinstance/screenshots/img.png b/BmsSample/Multiinstance/screenshots/img.png deleted file mode 100644 index 37ab5b7849cf4a67e79b3051529c1b84ee0fc573..0000000000000000000000000000000000000000 Binary files a/BmsSample/Multiinstance/screenshots/img.png and /dev/null differ diff --git a/BmsSample/NativeBundleGuidelines/.gitignore b/BmsSample/NativeBundleGuidelines/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/NativeBundleGuidelines/AppScope/app.json5 b/BmsSample/NativeBundleGuidelines/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/NativeBundleGuidelines/AppScope/resources/base/element/string.json b/BmsSample/NativeBundleGuidelines/AppScope/resources/base/element/string.json deleted file mode 100644 index 755f715e0c72234981fd36cac8b861e5f9e7c4a1..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "native_bundle_guidelines" - } - ] -} diff --git a/BmsSample/NativeBundleGuidelines/AppScope/resources/base/media/background.png b/BmsSample/NativeBundleGuidelines/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/NativeBundleGuidelines/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/NativeBundleGuidelines/AppScope/resources/base/media/foreground.png b/BmsSample/NativeBundleGuidelines/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/NativeBundleGuidelines/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/NativeBundleGuidelines/AppScope/resources/base/media/layered_image.json b/BmsSample/NativeBundleGuidelines/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/README_zh.md b/BmsSample/NativeBundleGuidelines/README_zh.md deleted file mode 100644 index cfcd60b022ed57b55a783943ac56a57cfc09f3ad..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/README_zh.md +++ /dev/null @@ -1,60 +0,0 @@ -# NativeBundle开发指导文档示例 - -### 介绍 - -本示例通过调用包管理提供的native的接口,获取应用信息。 - -### 效果预览 -无 - -### 使用说明 - -1. 编译,安装。 - -2. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置hap类型:"type": "entry" -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility -| |---pages/index.ets // 调用so暴露的接口能力,并打印获取内容 -| |---cpp/ // native接口调用逻辑,和暴露so的接口能力 -| |---/types -| |---/libentry/Index.d.ts // native接口暴露的能力接口 -| |---napi_init.cpp // 调用native的接口实现和定义 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API21版本SDK,版本号:6.0.2.54,镜像版本号:OpenHarmony_6.0.2.54。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/NativeBundleGuidelines > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/build-profile.json5 b/BmsSample/NativeBundleGuidelines/build-profile.json5 deleted file mode 100644 index c9289d800f6f23f49509b1fb0586c66c9c522a4a..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/build-profile.json5 +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "externalNativeOptions": { - "abiFilters": [ - "x86_64","arm64-v8a" - ] - }, - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/code-linter.json5 b/BmsSample/NativeBundleGuidelines/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/.gitignore b/BmsSample/NativeBundleGuidelines/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/build-profile.json5 b/BmsSample/NativeBundleGuidelines/entry/build-profile.json5 deleted file mode 100644 index 01bed8940ff6f2d5843f8d1d7e184725f59be699..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/build-profile.json5 +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/hvigorfile.ts b/BmsSample/NativeBundleGuidelines/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/obfuscation-rules.txt b/BmsSample/NativeBundleGuidelines/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/NativeBundleGuidelines/entry/oh-package.json5 b/BmsSample/NativeBundleGuidelines/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/CMakeLists.txt b/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index a3beeacb84dd1d415f739707b9ebeef180a407f6..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(native_bundle_guidelines) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libbundle_ndk.z.so) diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/napi_init.cpp b/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 68af6f23d88ed35759b667e8abb81bbc61e9fe8c..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start native-bundle-guidelines_002] -//napi依赖头文件 -#include "napi/native_api.h" -//native接口依赖头文件 -#include "bundle/ability_resource_info.h" -#include "bundle/native_interface_bundle.h" -//free()函数依赖的基础库 -#include -// [End native-bundle-guidelines_002] - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args , nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - - return sum; -} - -// [Start native-bundle-guidelines_003] -static napi_value GetCurrentApplicationInfo(napi_env env, napi_callback_info info) -{ - // 调用Native接口获取应用信息 - OH_NativeBundle_ApplicationInfo nativeApplicationInfo = OH_NativeBundle_GetCurrentApplicationInfo(); - napi_value result = nullptr; - napi_create_object(env, &result); - // Native接口获取的应用包名转为js对象里的bundleName属性 - napi_value bundleName; - napi_create_string_utf8(env, nativeApplicationInfo.bundleName, NAPI_AUTO_LENGTH, &bundleName); - napi_set_named_property(env, result, "bundleName", bundleName); - // Native接口获取的指纹信息转为js对象里的fingerprint属性 - napi_value fingerprint; - napi_create_string_utf8(env, nativeApplicationInfo.fingerprint, NAPI_AUTO_LENGTH, &fingerprint); - napi_set_named_property(env, result, "fingerprint", fingerprint); - // 最后为了防止内存泄漏,手动释放 - free(nativeApplicationInfo.bundleName); - free(nativeApplicationInfo.fingerprint); - return result; -} - -static napi_value GetAppId(napi_env env, napi_callback_info info) -{ - // 调用Native接口获取应用appId - char* appId = OH_NativeBundle_GetAppId(); - // Native接口转成nAppId返回 - napi_value nAppId; - napi_create_string_utf8(env, appId, NAPI_AUTO_LENGTH, &nAppId); - // 最后为了防止内存泄漏,手动释放 - free(appId); - return nAppId; -} - -static napi_value GetAppIdentifier(napi_env env, napi_callback_info info) -{ - // 调用Native接口获取应用appIdentifier - char* appIdentifier = OH_NativeBundle_GetAppIdentifier(); - // Native接口转成nAppIdentifier返回 - napi_value nAppIdentifier; - napi_create_string_utf8(env, appIdentifier, NAPI_AUTO_LENGTH, &nAppIdentifier); - // 最后为了防止内存泄漏,手动释放 - free(appIdentifier); - return nAppIdentifier; -} - -static napi_value GetMainElementName(napi_env env, napi_callback_info info) -{ - // 调用Native接口获取应用入口的信息 - OH_NativeBundle_ElementName elementName = OH_NativeBundle_GetMainElementName(); - napi_value result = nullptr; - napi_create_object(env, &result); - // Native接口获取的应用包名转为js对象里的bundleName属性 - napi_value bundleName; - napi_create_string_utf8(env, elementName.bundleName, NAPI_AUTO_LENGTH, &bundleName); - napi_set_named_property(env, result, "bundleName", bundleName); - // Native接口获取的模块名称转为js对象里的moduleName属性 - napi_value moduleName; - napi_create_string_utf8(env, elementName.moduleName, NAPI_AUTO_LENGTH, &moduleName); - napi_set_named_property(env, result, "moduleName", moduleName); - // Native接口获取的ability名称转为js对象里的abilityName属性 - napi_value abilityName; - napi_create_string_utf8(env, elementName.abilityName, NAPI_AUTO_LENGTH, &abilityName); - napi_set_named_property(env, result, "abilityName", abilityName); - // 最后为了防止内存泄漏,手动释放 - free(elementName.bundleName); - free(elementName.moduleName); - free(elementName.abilityName); - return result; -} - -static napi_value GetCompatibleDeviceType(napi_env env, napi_callback_info info) -{ - // 调用Native接口获取应用deviceType - char* deviceType = OH_NativeBundle_GetCompatibleDeviceType(); - // Native接口转成nDeviceType返回 - napi_value nDeviceType; - napi_create_string_utf8(env, deviceType, NAPI_AUTO_LENGTH, &nDeviceType); - // 最后为了防止内存泄漏,手动释放 - free(deviceType); - return nDeviceType; -} - -static napi_value IsDebugMode(napi_env env, napi_callback_info info) -{ - bool isDebug = false; - // 调用Native接口获取应用DebugMode的信息 该接口从API version 20开始支持 - bool isSuccess = OH_NativeBundle_IsDebugMode(&isDebug); - // 调用Native接口失败抛出异常 - if (isSuccess == false) { - napi_throw_error(env, nullptr, "call failed"); - return nullptr; - } - // Native接口转成debug返回 - napi_value debug; - napi_get_boolean(env, isDebug, &debug); - return debug; -} - -static napi_value GetModuleMetadata(napi_env env, napi_callback_info info) -{ - size_t moduleCount = 0; - // 调用Native接口获取应用元数据的信息 该接口从API version 20开始支持 - OH_NativeBundle_ModuleMetadata* modules = OH_NativeBundle_GetModuleMetadata(&moduleCount); - if (modules == nullptr || moduleCount == 0) { - napi_throw_error(env, nullptr, "no metadata found"); - return nullptr; - } - napi_value result; - napi_create_array(env, &result); - for (size_t i = 0; i < moduleCount; i++) { - napi_value moduleObj; - napi_create_object(env, &moduleObj); - // Native接口获取的模块名转为js对象里的moduleName属性 - napi_value moduleName; - napi_create_string_utf8(env, modules[i].moduleName, NAPI_AUTO_LENGTH, &moduleName); - napi_set_named_property(env, moduleObj, "moduleName", moduleName); - napi_value metadataArray; - napi_create_array(env, &metadataArray); - for (size_t j = 0; j < modules[i].metadataArraySize; j++) { - napi_value metadataObj; - napi_create_object(env, &metadataObj); - napi_value name; - napi_value value; - napi_value resource; - napi_create_string_utf8(env, modules[i].metadataArray[j].name, NAPI_AUTO_LENGTH, &name); - napi_create_string_utf8(env, modules[i].metadataArray[j].value, NAPI_AUTO_LENGTH, &value); - napi_create_string_utf8(env, modules[i].metadataArray[j].resource, NAPI_AUTO_LENGTH, &resource); - // Native接口获取的元数据名称转为js对象里的name属性 - napi_set_named_property(env, metadataObj, "name", name); - // Native接口获取的元数据值名称转为js对象里的value属性 - napi_set_named_property(env, metadataObj, "value", value); - // Native接口获取的元数据资源转为js对象里的resource属性 - napi_set_named_property(env, metadataObj, "resource", resource); - napi_set_element(env, metadataArray, j, metadataObj); - } - napi_set_named_property(env, moduleObj, "metadata", metadataArray); - napi_set_element(env, result, i, moduleObj); - } - // 最后为了防止内存泄漏,手动释放 - for (size_t i = 0; i < moduleCount; i++) { - free(modules[i].moduleName); - for (size_t j = 0; j < modules[i].metadataArraySize; j++) { - free(modules[i].metadataArray[j].name); - free(modules[i].metadataArray[j].value); - free(modules[i].metadataArray[j].resource); - } - free(modules[i].metadataArray); - } - free(modules); - return result; -} - -static void AddDefaultApp(napi_env env, - napi_value &infoObj, - OH_NativeBundle_AbilityResourceInfo* temp) -{ - bool isDefaultApp = true; - // 该接口从API version 21开始支持 - OH_NativeBundle_CheckDefaultApp(temp, &isDefaultApp); - napi_value defaultAppValue; - napi_get_boolean(env, isDefaultApp, &defaultAppValue); - napi_set_named_property(env, infoObj, "isDefaultApp", defaultAppValue); -} - -static void AddAppIndex(napi_env env, - napi_value &infoObj, - OH_NativeBundle_AbilityResourceInfo* temp) -{ - int appIndex = -1; - // 该接口从API version 21开始支持 - OH_NativeBundle_GetAppIndex(temp, &appIndex); - napi_value appIndexValue; - napi_create_int32(env, appIndex, &appIndexValue); - napi_set_named_property(env, infoObj, "appIndex", appIndexValue); -} - -static void AddLabel(napi_env env, - napi_value &infoObj, - OH_NativeBundle_AbilityResourceInfo* temp) -{ - char *label = nullptr; - // 该接口从API version 21开始支持 - OH_NativeBundle_GetLabel(temp, &label); - napi_value labelValue; - if (label) { - napi_create_string_utf8(env, label, NAPI_AUTO_LENGTH, &labelValue); - free(label); - } else { - napi_get_null(env, &labelValue); - } - napi_set_named_property(env, infoObj, "label", labelValue); -} - -static void AddBundleName(napi_env env, - napi_value &infoObj, - OH_NativeBundle_AbilityResourceInfo* temp) -{ - char *bundleName = nullptr; - // 该接口从API version 21开始支持 - OH_NativeBundle_GetBundleName(temp, &bundleName); - napi_value bundleNameValue; - if (bundleName) { - napi_create_string_utf8(env, bundleName, NAPI_AUTO_LENGTH, &bundleNameValue); - free(bundleName); - } else { - napi_get_null(env, &bundleNameValue); - } - napi_set_named_property(env, infoObj, "bundleName", bundleNameValue); -} - -static void AddModuleName(napi_env env, - napi_value &infoObj, - OH_NativeBundle_AbilityResourceInfo* temp) -{ - char *moduleName = nullptr; - // 该接口从API version 21开始支持 - OH_NativeBundle_GetModuleName(temp, &moduleName); - napi_value moduleNameValue; - if (moduleName) { - napi_create_string_utf8(env, moduleName, NAPI_AUTO_LENGTH, &moduleNameValue); - free(moduleName); - } else { - napi_get_null(env, &moduleNameValue); - } - napi_set_named_property(env, infoObj, "moduleName", moduleNameValue); -} - -static void AddAbilityName(napi_env env, - napi_value &infoObj, - OH_NativeBundle_AbilityResourceInfo* temp) -{ - char *abilityName = nullptr; - // 该接口从API version 21开始支持 - OH_NativeBundle_GetAbilityName(temp, &abilityName); - napi_value abilityNameValue; - if (abilityName) { - napi_create_string_utf8(env, abilityName, NAPI_AUTO_LENGTH, &abilityNameValue); - free(abilityName); - } else { - napi_get_null(env, &abilityNameValue); - } - napi_set_named_property(env, infoObj, "abilityName", abilityNameValue); -} - -static void GetDrawableDescriptor( - OH_NativeBundle_AbilityResourceInfo* temp) -{ - ArkUI_DrawableDescriptor *rawDrawable = nullptr; - // 该接口从API version 21开始支持 - OH_NativeBundle_GetDrawableDescriptor(temp, &rawDrawable); - if (rawDrawable) { - //使用ArkUI_DrawableDescriptor对象绘制图标 - } -} - -static void AssemblyAbilityResourceInfo(napi_env env, - napi_value &infoObj, - OH_NativeBundle_AbilityResourceInfo* temp) -{ - // 1. 添加Default App - AddDefaultApp(env, infoObj, temp); - // 2. 添加App Index - AddAppIndex(env, infoObj, temp); - // 3. 添加Label - AddLabel(env, infoObj, temp); - // 4. 添加Bundle Name - AddBundleName(env, infoObj, temp); - // 5. 添加Module Name - AddModuleName(env, infoObj, temp); - // 6. 添加Ability Name - AddAbilityName(env, infoObj, temp); - // 7. 获取ArkUI_DrawableDescriptor对象 - GetDrawableDescriptor(temp); -} - -static napi_value GetAbilityResourceInfo(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1]; - napi_status status; - // 获取传入的参数 - status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (status != napi_ok || argc < 1) { - napi_throw_error(env, nullptr, "Invalid arguments. Expected fileType string."); - return nullptr; - } - // 检查参数类型是否为字符串 - napi_valuetype valuetype; - status = napi_typeof(env, args[0], &valuetype); - if (status != napi_ok || valuetype != napi_string) { - napi_throw_error(env, nullptr, "Argument must be a string"); - return nullptr; - } - // 获取字符串参数 - char fileType[256] = {0}; // 假设文件类型不会超过255个字符 - size_t strLen; - status = napi_get_value_string_utf8(env, args[0], fileType, sizeof(fileType) - 1, &strLen); - if (status != napi_ok) { - napi_throw_error(env, nullptr, "Failed to get fileType string"); - return nullptr; - } - size_t infosCount = 0; - OH_NativeBundle_AbilityResourceInfo *infos = nullptr; - // 调用Native接口获取组件资源信息,使用传入的fileType,该接口从API version 21开始支持 - BundleManager_ErrorCode ret = OH_NativeBundle_GetAbilityResourceInfo(fileType, &infos, &infosCount); - if (ret == BUNDLE_MANAGER_ERROR_CODE_PERMISSION_DENIED) { - napi_throw_error(env, nullptr, "BUNDLE_MANAGER_ERROR_CODE_PERMISSION_DENIED"); - return nullptr; - } - if (infos == nullptr || infosCount == 0) { - napi_throw_error(env, nullptr, "no metadata found"); - return nullptr; - } - napi_value result; - napi_create_array(env, &result); - for (size_t i = 0; i < infosCount; i++) { - auto temp = (OH_NativeBundle_AbilityResourceInfo *)((char *)infos + OH_NativeBundle_GetSize() * i); - napi_value infoObj; - napi_create_object(env, &infoObj); - AssemblyAbilityResourceInfo(env, infoObj, temp); - napi_set_element(env, result, i, infoObj); - } - // 释放内存,该接口从API version 21开始支持 - OH_AbilityResourceInfo_Destroy(infos, infosCount); - return result; -} -// [End native-bundle-guidelines_003] - -// [Start native-bundle-guidelines_004] -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr }, - // 新增方法 getCurrentApplicationInfo - { "getCurrentApplicationInfo", nullptr, GetCurrentApplicationInfo, nullptr, - nullptr, nullptr, napi_default, nullptr}, - // 新增方法 getAppId - { "getAppId", nullptr, GetAppId, nullptr, nullptr, nullptr, napi_default, nullptr}, - // 新增方法 getAppIdentifier - { "getAppIdentifier", nullptr, GetAppIdentifier, nullptr, nullptr, nullptr, napi_default, nullptr}, - // 新增方法 getMainElementName - { "getMainElementName", nullptr, GetMainElementName, nullptr, nullptr, nullptr, napi_default, nullptr}, - // 新增方法 getCompatibleDeviceType - { "getCompatibleDeviceType", nullptr, GetCompatibleDeviceType, nullptr, - nullptr, nullptr, napi_default, nullptr}, - // 新增方法 isDebugMode - { "isDebugMode", nullptr, IsDebugMode, nullptr, nullptr, nullptr, napi_default, nullptr}, - // 新增方法 getModuleMetadata - { "getModuleMetadata", nullptr, GetModuleMetadata, nullptr, nullptr, nullptr, napi_default, nullptr}, - // 新增方法 getAbilityResourceInfo - { "getAbilityResourceInfo", nullptr, GetAbilityResourceInfo, nullptr, nullptr, nullptr, napi_default, nullptr} - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END -// [End native-bundle-guidelines_004] - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/types/libentry/Index.d.ts b/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index e93d13ec42e68d282160ebc02fb7496779f89d1c..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start native-bundle-guidelines_001] -export const add: (a: number, b: number) => number; -export const getCurrentApplicationInfo: () => object; // 新增暴露方法 getCurrentApplicationInfo -export const getAppId: () => string; // 新增暴露方法 getAppId -export const getAppIdentifier: () => string; // 新增暴露方法 getAppIdentifier -export const getMainElementName: () => object; // 新增暴露方法 getMainElementName -export const getCompatibleDeviceType: () => string; // 新增暴露方法 getCompatibleDeviceType -export const isDebugMode: () => string; // 新增暴露方法 isDebugMode -export const getModuleMetadata: () => object; // 新增暴露方法 getModuleMetadata -export const getAbilityResourceInfo: (fileType: string) => object; // 新增暴露方法 getAbilityResourceInfo -// [End native-bundle-guidelines_001] diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/types/libentry/oh-package.json5 b/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/NativeBundleGuidelines/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/NativeBundleGuidelines/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/ets/pages/Index.ets b/BmsSample/NativeBundleGuidelines/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 6bbdc32bfcbaa1d009c6151dd7a2524db25ea175..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start native-bundle-guidelines_005] -import { hilog } from '@kit.PerformanceAnalysisKit'; -import testNapi from 'libentry.so'; - -const DOMAIN = 0x0000; - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - hilog.info(DOMAIN, 'testTag', 'Test NAPI 2 + 3 = %{public}d', testNapi.add(2, 3)); - let appInfo = testNapi.getCurrentApplicationInfo(); - console.info("bundleNative getCurrentApplicationInfo success, data is " + JSON.stringify(appInfo)); - let appId = testNapi.getAppId(); - console.info("bundleNative getAppId success, appId is " + appId); - let appIdentifier = testNapi.getAppIdentifier(); - console.info("bundleNative getAppIdentifier success, appIdentifier is " + appIdentifier); - let mainElement = testNapi.getMainElementName(); - console.info("bundleNative getMainElementName success, data is " + JSON.stringify(mainElement)); - let deviceType = testNapi.getCompatibleDeviceType(); - console.info("bundleNative getCompatibleDeviceType success, deviceType is " + deviceType); - let isDebugMode = testNapi.isDebugMode(); - console.info("bundleNative isDebugMode success, isDebugMode is " + isDebugMode); - let moduleMetadata = testNapi.getModuleMetadata(); - console.info("bundleNative getModuleMetadata success, data is " + JSON.stringify(moduleMetadata)); - let fileType: string = '.png'; - let abilityResourceInfo = testNapi.getAbilityResourceInfo(fileType); - console.info("bundleNative getAbilityResourceInfo success, data is " + JSON.stringify(abilityResourceInfo)); - }) - } - .width('100%') - } - .height('100%') - } -} -// [End native-bundle-guidelines_005] \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/module.json5 b/BmsSample/NativeBundleGuidelines/entry/src/main/module.json5 deleted file mode 100644 index d7e583f0740b790935785c8d20444b65af08c128..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/module.json5 +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2025 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", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "requestPermissions": [ - { - "name": "ohos.permission.GET_ABILITY_INFO" - } - ], - "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": [ - "ohos.want.action.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/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/element/color.json b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/element/float.json b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/element/string.json b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/background.png b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/foreground.png b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/layered_image.json b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/startIcon.png b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/dark/element/color.json b/BmsSample/NativeBundleGuidelines/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/hvigor/hvigor-config.json5 b/BmsSample/NativeBundleGuidelines/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/NativeBundleGuidelines/hvigorfile.ts b/BmsSample/NativeBundleGuidelines/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/NativeBundleGuidelines/oh-package.json5 b/BmsSample/NativeBundleGuidelines/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/NativeBundleGuidelines/ohosTest.md b/BmsSample/NativeBundleGuidelines/ohosTest.md deleted file mode 100644 index 17c2fda5050771cd59a1b431e55a575065a7ff90..0000000000000000000000000000000000000000 --- a/BmsSample/NativeBundleGuidelines/ohosTest.md +++ /dev/null @@ -1,7 +0,0 @@ -# NativeBundle开发指导 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|-------------|------------|-------|--------------|--------------------------------| -| 工程编译 | 编译正常,构建正常 | 无 | 成功安装运行 |Pass| \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/.gitignore b/BmsSample/TypicalScenarioConfiguration/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/BmsSample/TypicalScenarioConfiguration/AppScope/app.json5 b/BmsSample/TypicalScenarioConfiguration/AppScope/app.json5 deleted file mode 100644 index a50d135b37fc66f067d0a6081ecf9e8f299a7286..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "ohos.app.hap.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/element/string.json b/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/element/string.json deleted file mode 100644 index 2f88a0f2f9a3b183fcaf53c36835882f1210c0ed..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "simple006_typical_scenario_configuration" - } - ] -} diff --git a/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/media/background.png b/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/media/foreground.png b/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/media/layered_image.json b/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/README_zh.md b/BmsSample/TypicalScenarioConfiguration/README_zh.md deleted file mode 100644 index 05f7297e3173fd1d1a2e262bf7848df0aa483388..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/README_zh.md +++ /dev/null @@ -1,63 +0,0 @@ -# 创建应用静态快捷方式指南文档示例 - -### 介绍 - -本示例通过相关设置配置快捷方式,以及如何创建快捷方式。 - -### 效果预览 - -| 桌面 | -|---------------------------------| -|![img.png](screenshots/img.png) | - -### 使用说明 - -1. 使用IDE自动签名,编译,安装,运行。 - -2. 桌面上安装图标按钮,展示配置的快捷方式的名称和图标。 - -3. 通过自动测试框架可进行测试及维护。 - -### 工程目录 -``` -AppScope/ -| |---resources/ // 工程级的资源目录 -| |--- app.json5 // 应用的全局配置信息 -entry/src/ -| |--- main/ -| |--- module.json5 // entry模块配置文件,配置指向快捷方式的配置文件 -| |---ets/ -| |---entryability/EntryAbility.ets // 应用启动加载的入口ability -| |---entrybackupability/EntryBackupAbility.ets // extensionAbility。 -| |---pages/index.ets // entry主应用入口页面 -| |---resources/base/profile/ -| |---shortcuts_config.json // 快捷方式配置文件 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API19版本SDK,版本号:5.1.1.212,镜像版本号:OpenHarmony_5.1.1.212。 - -3.本示例需要使用DevEco Studio 5.1.1 Release (Build Version: 5.1.1.840, built on September 5, 2025)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/bmsSample/TypicalScenarioConfiguration > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -```` \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/build-profile.json5 b/BmsSample/TypicalScenarioConfiguration/build-profile.json5 deleted file mode 100644 index f76aea68fc1809964ab900bfb93c5970c228c47d..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/code-linter.json5 b/BmsSample/TypicalScenarioConfiguration/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/.gitignore b/BmsSample/TypicalScenarioConfiguration/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/build-profile.json5 b/BmsSample/TypicalScenarioConfiguration/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/hvigorfile.ts b/BmsSample/TypicalScenarioConfiguration/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/obfuscation-rules.txt b/BmsSample/TypicalScenarioConfiguration/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/BmsSample/TypicalScenarioConfiguration/entry/oh-package.json5 b/BmsSample/TypicalScenarioConfiguration/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/BmsSample/TypicalScenarioConfiguration/entry/src/main/ets/entryability/EntryAbility.ets b/BmsSample/TypicalScenarioConfiguration/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index d3ee54d2beea61d38866762868bd056d3e39e3c9..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/BmsSample/TypicalScenarioConfiguration/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/ets/pages/Index.ets b/BmsSample/TypicalScenarioConfiguration/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0f481f696485b8c840d49ad9e7d7dff7f6b71241..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/module.json5 b/BmsSample/TypicalScenarioConfiguration/entry/src/main/module.json5 deleted file mode 100644 index 2114b5c6aaf61a4541cb67accf09c695ef8c769b..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/module.json5 +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start typical_scenario_configuration] -{ - "module": { - // [StartExclude typical_scenario_configuration] - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - // [EndExclude typical_scenario_configuration] - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "metadata": [ - { - "name": "ohos.ability.shortcuts", // 配置快捷方式,该值固定为ohos.ability.shortcuts - "resource": "$profile:shortcuts_config" // 指定shortcuts信息的资源位置 - } - ], - // [StartExclude typical_scenario_configuration] - "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": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "type": "backup", - "exported": false, - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ] - }, - // [EndExclude typical_scenario_configuration] -} -// [End typical_scenario_configuration] \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/element/color.json b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/element/float.json b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/element/string.json b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 35e5338bf55b5ef81be7a2cc241a448550505508..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "share", - "value": "分享好友" - }, - { - "name": "add", - "value": "添加收藏" - } - ] -} diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/add_icon.png b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/add_icon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/add_icon.png and /dev/null differ diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/background.png b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/foreground.png b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/layered_image.json b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/share_icon.png b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/share_icon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/share_icon.png and /dev/null differ diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/startIcon.png b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/profile/backup_config.json b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/profile/main_pages.json b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/profile/shortcuts_config.json b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/profile/shortcuts_config.json deleted file mode 100644 index 0df9feb218a45b183279077d1c6bcf1532162cde..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/base/profile/shortcuts_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "shortcuts": [ - { - "shortcutId": "id_test1", - "label": "$string:add", - "icon": "$media:add_icon", - "wants": [ - { - "bundleName": "com.ohos.hello", - "moduleName": "entry", - "abilityName": "EntryAbility1", - "parameters": { - "testKey": "testValue" - } - } - ] - }, - { - "shortcutId": "id_test2", - "label": "$string:share", - "icon": "$media:share_icon", - "wants": [ - { - "bundleName": "com.ohos.hello", - "moduleName": "entry", - "abilityName": "EntryAbility", - "parameters": { - "testKey": "testValue" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/dark/element/color.json b/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/hvigor/hvigor-config.json5 b/BmsSample/TypicalScenarioConfiguration/hvigor/hvigor-config.json5 deleted file mode 100644 index 004fb72ad7a233dc4733146262f01e71aad4c53a..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/BmsSample/TypicalScenarioConfiguration/hvigorfile.ts b/BmsSample/TypicalScenarioConfiguration/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/oh-package.json5 b/BmsSample/TypicalScenarioConfiguration/oh-package.json5 deleted file mode 100644 index bacd2548e873f125e0838cab19905464531ec409..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/BmsSample/TypicalScenarioConfiguration/ohosTest.md b/BmsSample/TypicalScenarioConfiguration/ohosTest.md deleted file mode 100644 index 67b25875ecc4f056f13ec1ba31a96f8822411322..0000000000000000000000000000000000000000 --- a/BmsSample/TypicalScenarioConfiguration/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 创建应用静态快捷方式 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 |测试结果| -|--------|-----------|-------|----------|--------------------------------| -| 工程编译安装 | 编译正常正常安装 | 无 | 成功拉起应用 |Pass| -| 桌面图标展示 | 进入桌面,长按图标 | 应用安装 | 桌面展示快捷方式 |Pass| \ No newline at end of file diff --git a/BmsSample/TypicalScenarioConfiguration/screenshots/img.png b/BmsSample/TypicalScenarioConfiguration/screenshots/img.png deleted file mode 100644 index 9135e6aaa847d196777c2f4c5b126082b1e12311..0000000000000000000000000000000000000000 Binary files a/BmsSample/TypicalScenarioConfiguration/screenshots/img.png and /dev/null differ diff --git a/CoreFile/AppFileBackup/.gitignore b/CoreFile/AppFileBackup/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/AppFileBackup/AppScope/app.json5 b/CoreFile/AppFileBackup/AppScope/app.json5 deleted file mode 100644 index 37bccd13dd46c0e720b87432b8556da28a2aa11a..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.appfilebackup", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/CoreFile/AppFileBackup/AppScope/resources/base/element/string.json b/CoreFile/AppFileBackup/AppScope/resources/base/element/string.json deleted file mode 100644 index 3332f8b420e0d7d92da4d019d7138e851d40a518..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AppFileBackup" - } - ] -} diff --git a/CoreFile/AppFileBackup/AppScope/resources/base/media/app_icon.png b/CoreFile/AppFileBackup/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFileBackup/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/CoreFile/AppFileBackup/README_zh.md b/CoreFile/AppFileBackup/README_zh.md deleted file mode 100644 index 0729879a03f30e8198b976db01ce4c8596e714d4..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/README_zh.md +++ /dev/null @@ -1,73 +0,0 @@ -# 应用触发数据备份恢复(仅对系统应用开放) - -## 介绍 - -仅系统应用可以触发数据备份恢复,触发后备份恢复框架会确认各个应用是否接入了数据备份恢复。如果应用已接入,备份恢复框架将会根据应用的配置文件备份、恢复数据。本实例实现了获取能力文件、应用备份数据和应用恢复数据三大功能,应用还涉及到权限申请方式和系统应用签名,该工程中展示的代码详细描述可查如下链接。 - -- [获取能力文件](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/file-management/app-file-backup.md#获取能力文件) -- [应用备份数据](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/file-management/app-file-backup.md#应用备份数据) -- [应用恢复数据](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/file-management/app-file-backup.md#应用恢复数据) - -## 效果预览 - -| | -| :------------------------------------------------: | -| | - -使用说明: - -1. 本应用主要用于拉起应用数据备份,依赖于FileBackuoExtension应用,在使用前确保安装FileBackuoExtension应用。 -2. 启动该应用后,通过点击相关的按钮可以拉起FileBackuoExtensiony应用的数据备份和恢复,备份和恢复将会按照FileBackuoExtensiony应用中配置的数据 备份和恢复框架进行。 - -## 工程目录 - -``` -├──entry/src/main -| ├──ets -| | ├──backuprestore -| | | └──BackupRestore.ets // 备份恢复函数封装 -| | ├──commom -| | | ├──Logger.ts // 日志工具 -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -## 具体实现 - -1. 导入依赖模块@ohos.file.backup,申请系统权限ohos.permission.BACKUP,详情请参考:[权限申请的方式](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/determine-application-mode.md) -2. 获取能力文件需要调用backup.getLocalCapabilities,函数封装在BackupRestore.ets。 -3. 启动应用备份过程中,备份恢复服务会将应用的数据打包成文件,通过创建实例时所注册的回调onFileReady接口返回文件句柄。 -4. 备份恢复服务会根据开发者调用getFileHandle的请求内容,将应用待恢复数据的文件句柄,通过创建实例时注册的回调onFileReady]接口返回。 - -## 相关权限 - -| 权限名 | 权限说明 | 级别 | -| ---------------------- | -------------------------- | ------------ | -| ohos.permission.BACKUP | 允许应用拥有备份恢复能力。 | system_basic | - -## 依赖 - -该应用作为系统级应用程序,为了实现备份和恢复功能,必须预先安装文件备份扩展应用。 - -## 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568。 -2. 本示例为Stage模型,支持API14版本SDK,版本号:5.0.2.58,镜像版本号:OpenHarmony 5.1.0.51。 -3. 本示例需要使用DevEco Studio 5. 1Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 -4. 本示例涉及部分接口需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md) ,把配置文件中的“apl”字段信息改为“system_basic”。 - -## 下载 - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/AppFileBackup > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` - diff --git a/CoreFile/AppFileBackup/build-profile.json5 b/CoreFile/AppFileBackup/build-profile.json5 deleted file mode 100644 index ae72b4037b4c92c08124fb46e0245b96e70e029f..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "5.0.2(14)", - "targetSdkVersion": "5.0.2(14)", - "compatibleSdkVersion": "5.0.2(14)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/code-linter.json5 b/CoreFile/AppFileBackup/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/.gitignore b/CoreFile/AppFileBackup/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/build-profile.json5 b/CoreFile/AppFileBackup/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/hvigorfile.ts b/CoreFile/AppFileBackup/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/AppFileBackup/entry/obfuscation-rules.txt b/CoreFile/AppFileBackup/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/AppFileBackup/entry/oh-package.json5 b/CoreFile/AppFileBackup/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/AppFileBackup/entry/src/main/ets/backuprestore/BackupRestore.ets b/CoreFile/AppFileBackup/entry/src/main/ets/backuprestore/BackupRestore.ets deleted file mode 100644 index 0f6562491465b9965297877775dcf86dadab5aa5..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/ets/backuprestore/BackupRestore.ets +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start get_local_cap_ability] -// [Start session_backup] -// [Start session_restore] -import { fileIo as fs } from '@kit.CoreFileKit'; -import { backup } from '@kit.CoreFileKit'; -import { common } from '@kit.AbilityKit'; -import { BusinessError } from '@ohos.base'; -// [StartExclude session_restore] -// [StartExclude session_backup] -// [StartExclude get_local_cap_ability] -import { ReadOptions } from '@kit.CoreFileKit'; -import buffer from '@ohos.buffer'; -import Logger from '../common/Logger'; - -const BUFFER: number = 1024; // 读写文件的缓冲区 -// [EndExclude get_local_cap_ability] -// [EndExclude session_backup] -// [EndExclude session_restore] - -// 请在组件内获取context,确保this.getUIContext().getHostContext()返回结果为UIAbilityContext -let context = this.getUIContext().getHostContext() as common.UIAbilityContext; -let filesDir = context.filesDir; - -// [StartExclude session_backup] -// [StartExclude session_restore] -// 获取能力文件 -export async function getLocalCapabilities(): Promise { - try { - let fileData = await backup.getLocalCapabilities(); - console.info('getLocalCapabilities success'); - let fpath = filesDir + '/localCapabilities.json'; - fs.copyFileSync(fileData.fd, fpath); - // [StartExclude get_local_cap_ability] - let file = fs.openSync(fpath, fs.OpenMode.READ_WRITE); - // 从文件中读取一段内容 - let arrayBuffer = new ArrayBuffer(BUFFER); - let readOptions: ReadOptions = { - offset: 0, // 从文件的开头开始读取 - length: arrayBuffer.byteLength - }; - let readLen = fs.readSync(file.fd, arrayBuffer, readOptions); - // 这个 buf 对象是 arrayBuffer 中从位置 0 开始的前 readLen 字节 - let buf = buffer.from(arrayBuffer, 0, readLen); - console.info('the content of file: ' + buf.toString()); - // [EndExclude get_local_cap_ability] - fs.closeSync(fileData.fd); - } catch (error) { - console.error(`getLocalCapabilities failed with err, code is ${err.code}, message is ${err.message}`); - } -} -// [End get_local_cap_ability] -// [EndExclude session_backup] - -// 应用备份数据 -// 创建SessionBackup类的实例用于备份数据 -let gSession: backup.SessionBackup; - -function createSessionBackup(): backup.SessionBackup { - let generalCallbacks: backup.GeneralCallbacks = { - // onFileReady为服务回调给应用侧数据完成的通知,建议开发者在该接口内不要进行过多的耗时实现,可以通过异步线程实现file.fd数据的处理 - onFileReady: (err: BusinessError, file: backup.File) => { - if (err) { - console.error(`onFileReady err, code is ${err.code}, message is ${err.message}`); - } - try { - let bundlePath = filesDir + '/' + file.bundleName; - if (!fs.accessSync(bundlePath)) { - fs.mkdirSync(bundlePath); - } - // 此处执行copyFileSync会多一次内存拷贝,开发者可以直接使用onFileReady的file.fd来进行数据处理,处理完成后close即可,这样会减少内存消耗 - fs.copyFileSync(file.fd, bundlePath + `/${file.uri}`); - fs.closeSync(file.fd); - console.info('onFileReady success'); - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`onFileReady failed. Code: ${err.code}, message: ${err.message}`); - } - }, - onBundleBegin: (err: BusinessError, bundleName: string) => { - if (err) { - console.error(`onBundleBegin err, code is ${err.code}, message is ${err.message}`); - } else { - console.info('onBundleBegin bundleName: ' + bundleName); - } - }, - onBundleEnd: (err: BusinessError, bundleName: string) => { - if (err) { - console.error(`onBundleEnd err, code is ${err.code}, message is ${err.message}`); - } else { - console.info('onBundleEnd bundleName: ' + bundleName); - } - }, - onAllBundlesEnd: (err: BusinessError) => { - if (err) { - console.error(`onAllBundlesEnd err, code is ${err.code}, message is ${err.message}`); - } else { - console.info('onAllBundlesEnd'); - } - }, - onBackupServiceDied: () => { - console.info('onBackupServiceDied'); - }, - onResultReport: (bundleName: string, result: string) => { - console.info('onResultReport bundleName: ' + bundleName); - console.info('onResultReport result: ' + result); - }, - onProcess: (bundleName: string, process: string) => { - console.info('onProcess bundleName: ' + bundleName); - console.info('onProcess result: ' + process); - } - } - let sessionBackup = new backup.SessionBackup(generalCallbacks); - return sessionBackup; -} - -// [StartExclude session_backup] -export async function release() { - try { - await gSession.release(); - console.info('release success'); - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`release err, code is ${err.code}, message is ${err.message}`); - } -} -// [EndExclude session_backup] -export async function sessionBackup(): Promise { - gSession = createSessionBackup(); - // 此处可根据backup.getLocalCapabilities()提供的能力文件,选择需要备份的应用 - // 也可直接根据应用包名称进行备份 - const backupApps: string[] = [ - 'com.samples.filebackupextension', - ] - await gSession.appendBundles(backupApps); - console.info('appendBundles success'); -} -// [End session_backup] -// [EndExclude session_restore] -// 应用数据恢复 -// 创建SessionRestore类的实例用于恢复数据 -let gSessionRestore: backup.SessionRestore; -let initMap = new Map(); -let testFileNum = 2; // 初始化文件个数 -let testBundleName = 'com.samples.filebackupextension'; // 测试包名 -initMap.set(testBundleName, testFileNum); -let countMap = new Map(); -countMap.set(testBundleName, 0); // 初始化计数 - -async function publishFile(file: backup.File): Promise { - console.info('start publishFile'); - let fileMeta: backup.FileMeta = { - bundleName: file.bundleName, - uri: '' - } - await gSessionRestore.publishFile(fileMeta); -} - -function createSessionRestore(): backup.SessionRestore { - let generalCallbacks: backup.GeneralCallbacks = { - onFileReady: (err: BusinessError, file: backup.File) => { - if (err) { - console.error(`onFileReady err, code is ${err.code}, message is ${err.message}`); - } - // 此处开发者请根据实际场景待恢复文件存放位置进行调整 bundlePath - let bundlePath: string = `${filesDir}/${file.bundleName}/`; - if (!fs.accessSync(bundlePath)) { - console.error('onFileReady bundlePath err : ' + bundlePath); - } - console.info('fd : ' + file.fd); - let targetPath = `${bundlePath}${file.uri}`; - fs.copyFileSync(targetPath, file.fd); - fs.closeSync(file.fd); - let currentCount = countMap.get(file.bundleName) || 0; // 如果没有找到对应的计数,则默认返回 0 - countMap.set(file.bundleName, ++currentCount); - // 恢复数据传输完成后,会通知服务端文件准备就绪 - if (countMap.get(file.bundleName) == initMap.get(file.bundleName)) { // 每个包的所有文件收到后触发publishFile - publishFile(file); - } - console.info('onFileReady success'); - }, - onBundleBegin: (err: BusinessError, bundleName: string) => { - if (err) { - console.error(`onBundleBegin failed with err, code is ${err.code}, message is ${err.message}`); - } - console.info('onBundleBegin success'); - }, - onBundleEnd: (err: BusinessError, bundleName: string) => { - if (err) { - console.error(`onBundleEnd failed with err, code is ${err.code}, message is ${err.message}`); - } - console.info('onBundleEnd success'); - }, - onAllBundlesEnd: (err: BusinessError) => { - if (err) { - console.error(`onAllBundlesEnd failed with err, code is ${err.code}, message is ${err.message}`); - } - console.info('onAllBundlesEnd success'); - }, - onBackupServiceDied: () => { - console.info('service died'); - }, - onResultReport: (bundleName: string, result: string) => { - console.info('onResultReport bundleName: ' + bundleName); - console.info('onResultReport result: ' + result); - }, - onProcess: (bundleName: string, process: string) => { - console.info('onProcess bundleName: ' + bundleName); - console.info('onProcess result: ' + process); - } - } - let sessionRestore = new backup.SessionRestore(generalCallbacks); - return sessionRestore; -} - -export async function sessionRestore(): Promise { - gSessionRestore = createSessionRestore(); - const restoreApps: string[] = [ - 'com.samples.filebackupextension' - ]; - // 能力文件的获取方式可以根据开发者实际场景进行调整。此处仅为请求示例 - // 开发者也可以根据能力文件内容的结构示例,自行构造能力文件内容 - let fileDat = await backup.getLocalCapabilities(); - await gSessionRestore.appendBundles(fileDat.fd, restoreApps); - console.info('appendBundles success'); - // 添加需要恢复的应用成功后,请根据需要恢复的应用名称,调用getFileHandle接口获取待恢复应用数文件的文件句柄 - // 应用待恢复数据文件数请依据实际备份文件个数为准,此处仅为请求示例 - let handle: backup.FileMeta = { - bundleName: restoreApps[0], - uri: 'manage.json' - }; - await gSessionRestore.getFileHandle(handle); - handle.uri = 'part.0.tar'; - await gSessionRestore.getFileHandle(handle); - console.info('getFileHandle success'); -} -// [End session_restore] diff --git a/CoreFile/AppFileBackup/entry/src/main/ets/common/Logger.ts b/CoreFile/AppFileBackup/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index 8c439f8a1ece09db4277ec28b978ab4499dd3a59..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -export class Logger { - private domain: number; - private prefix: string = '[Sample_AppFileBackup]'; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0x0000; // 应用的编码 - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]): void { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number): void { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger('[Sample_AppFileBackup]'); - diff --git a/CoreFile/AppFileBackup/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/AppFileBackup/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 0f2f8b94aa24b0a50e272270e4e18b6df93ac5fd..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/AppFileBackup/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/AppFileBackup/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/AppFileBackup/entry/src/main/ets/pages/Index.ets b/CoreFile/AppFileBackup/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 8eab2c1f8cca90c55b294573539079a9f0e6740e..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 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 { getLocalCapabilities, sessionBackup, sessionRestore, release } from '../backuprestore/BackupRestore'; - -let MARGIN = 12; // 组件间的间隔 - -@Entry -@Component -struct FileBackup { - @State message: string = ''; - - build() { - Column() { - TextArea({ - text: this.message, - placeholder: '', - }) - .width('100%') - .height('45%') - Row() { - Button($r('app.string.applicationTriggersDataBackup')) - .width('40%') - .height('100%') - .margin(MARGIN) - .onClick(() => { - sessionBackup(); - }) - Button($r('app.string.applicationTriggersDataReStore')) - .width('40%') - .height('100%') - .margin(MARGIN) - .onClick(() => { - sessionRestore(); - }) - } - .width('80%') - .height('10%') - .margin(MARGIN) - - Row() { - Button($r('app.string.releaseBackup')) - .width('40%') - .height('100%') - .margin(MARGIN) - .onClick(() => { - release(); - }) - Button($r('app.string.capabilityDocumentation')) - .width('40%') - .height('100%') - .margin(MARGIN) - .onClick(() => { - getLocalCapabilities(); - }) - } - .width('80%') - .height('10%') - } - } -} diff --git a/CoreFile/AppFileBackup/entry/src/main/module.json5 b/CoreFile/AppFileBackup/entry/src/main/module.json5 deleted file mode 100644 index 3e0bb8ef38bda50eda925b3f44eae8fffe3fcc34..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/module.json5 +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2025 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" - } - ] - } - ], - // [Start request_permission_backup] - "requestPermissions": [ - { - "name": "ohos.permission.BACKUP", - "usedScene": { - "abilities": [ - "FormAbility" - ], - "when": "always" - } - } - ] - // [End request_permission_backup] - } -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/base/element/color.json b/CoreFile/AppFileBackup/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/base/element/string.json b/CoreFile/AppFileBackup/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 7328a720bf822e672bdd7ee48d904a39ce3fc02b..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AppBackup" - }, - { - "name": "capabilityDocumentation", - "value": "获取能力文件" - }, - { - "name": "applicationTriggersDataBackup", - "value": "应用触发数据备份" - }, - { - "name": "applicationTriggersDataReStore", - "value": "应用触发数据恢复" - }, - { - "name": "releaseBackup", - "value": "结束备份服务" - }, - { - "name": "deleteFile", - "value": "文件删除" - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/base/media/background.png b/CoreFile/AppFileBackup/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFileBackup/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/base/media/foreground.png b/CoreFile/AppFileBackup/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFileBackup/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/base/media/layered_image.json b/CoreFile/AppFileBackup/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/base/media/startIcon.png b/CoreFile/AppFileBackup/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFileBackup/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/AppFileBackup/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/AppFileBackup/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/en_US/element/string.json b/CoreFile/AppFileBackup/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index a4bcd322afa4f5d03fcde26d7c195f5560bf49c3..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AppBackup" - }, - { - "name": "capabilityDocumentation", - "value": "capabilityDocumentation" - }, - { - "name": "applicationTriggersDataBackup", - "value": "applicationTriggersDataBackup" - }, - { - "name": "applicationTriggersDataReStore", - "value": "applicationTriggersDataRestore" - }, - { - "name": "releaseBackup", - "value": "releaseBackup" - }, - { - "name": "deleteFile", - "value": "deleteFile" - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/main/resources/zh_CN/element/string.json b/CoreFile/AppFileBackup/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index c6351376efc3cbb20ca61adfcef84ccee0d39594..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AppBackup" - }, - { - "name": "capabilityDocumentation", - "value": "获取能力文件" - }, - { - "name": "applicationTriggersDataBackup", - "value": "应用触发数据备份" - }, - { - "name": "applicationTriggersDataReStore", - "value": "应用触发数据恢复" - }, - { - "name": "releaseBackup", - "value": "结束备份服务" - }, - { - "name": "deleteFile", - "value": "文件删除" - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/mock/mock-config.json5 b/CoreFile/AppFileBackup/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/AppFileBackup/entry/src/ohosTest/ets/test/FileBackup.test.ets b/CoreFile/AppFileBackup/entry/src/ohosTest/ets/test/FileBackup.test.ets deleted file mode 100644 index 65ef84741d8882eb307f61d0f37067365c4d2992..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/ohosTest/ets/test/FileBackup.test.ets +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium'; -import { Driver, ON, Component, abilityDelegatorRegistry } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const DELAY_TIME = 1500; // 延时1.5秒 -const TAG = '[Sample_AppFileBackup]'; -const DOMAIN = 0xF811; -const BUNDLE = 'AppFileBackup_'; - -const DELEGATOR = abilityDelegatorRegistry.getAbilityDelegator(); -const BUNDLENAME = abilityDelegatorRegistry.getArguments().bundleName; -const ABILITYDELEGATOR = abilityDelegatorRegistry.getAbilityDelegator(); - -async function getResourceString(resource: Resource): Promise { - let manage = ABILITYDELEGATOR.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function FileBackupRestoreTest() { - describe('FileBackupTest', () => { - /** - * @tc.number StartAbility_001 - * @tc.name StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 begin'); - // start tested ability - const want: Want = { - bundleName: BUNDLENAME, - abilityName: 'EntryAbility' - }; - await DELEGATOR.startAbility(want); - // check top display ability - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - const ability: UIAbility = await DELEGATOR.getCurrentTopAbility(); - hilog.info(DOMAIN, TAG, BUNDLE + 'get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 end'); - }) - /** - * @tc.number FileBackup_001 - * @tc.name FileBackup_001 - * @tc.desc 文件的备份 - */ - it(BUNDLE + 'FileBackup_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'FileBackup_001 begin'); - let str = await getResourceString($r('app.string.applicationTriggersDataBackup')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - hilog.info(DOMAIN, TAG, BUNDLE + 'Apply to trigger file data backup'); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'FileBackup_001 end'); - }) - /** - * @tc.number FileBackup_002 - * @tc.name FileBackup_002 - * @tc.desc 结束备份服务 - */ - it(BUNDLE + 'FileBackup_002', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'FileBackup_002 begin'); - let str = await getResourceString($r('app.string.releaseBackup')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - hilog.info(DOMAIN, TAG, BUNDLE + 'End backup service'); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'FileBackup_002 end'); - }) - /** - * @tc.number FileRestore_001 - * @tc.name FileRestore_001 - * @tc.desc 启动备份应用 - */ - it(BUNDLE + 'FileRestore_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'FileRestore_001 begin'); - // start Restore ability - const want: Want = { - bundleName: 'com.samples.filebackupextension', - abilityName: 'EntryAbility' - }; - await DELEGATOR.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'Start fileBackupExtension ability'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'FileRestore_001 end'); - }) - /** - * @tc.number FileRestore_002 - * @tc.name FileRestore_002 - * @tc.desc 删除数据文件 - */ - it(BUNDLE + 'FileRestore_002', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'FileRestore_002 begin'); - let str = await getResourceString($r('app.string.deleteFile')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - hilog.info(DOMAIN, TAG, BUNDLE + 'Apply to trigger file data backup'); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'FileRestore_002 end'); - }) - /** - * @tc.number StartAbility_002 - * @tc.name StartAbility_002 - * @tc.desc 启动自身应用以触发数据恢复 - */ - it(BUNDLE + 'StartAbility_002', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_002 begin'); - const want: Want = { - bundleName: BUNDLENAME, - abilityName: 'EntryAbility' - }; - await DELEGATOR.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - const ability: UIAbility = await DELEGATOR.getCurrentTopAbility(); - hilog.info(DOMAIN, TAG, BUNDLE + 'get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_002 end'); - }) - /** - * @tc.number FileRestore_003 - * @tc.name FileRestore_003 - * @tc.desc 恢复数据文件 - */ - it(BUNDLE + 'FileRestore_003', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'FileRestore_003 begin'); - let str = await getResourceString($r('app.string.applicationTriggersDataReStore')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - hilog.info(DOMAIN, TAG, BUNDLE + 'Apply to trigger file data backup'); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'FileRestore_003 end'); - }) - /** - * @tc.number StartAbility_003 - * @tc.name StartAbility_003 - * @tc.desc - */ - it(BUNDLE + 'StartAbility_003', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_003 begin'); - // start Restore ability - const want: Want = { - bundleName: 'com.samples.filebackupextension', - abilityName: 'EntryAbility' - }; - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - await DELEGATOR.startAbility(want); - hilog.info(DOMAIN, TAG, BUNDLE + 'get top ability'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_003 end'); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/AppFileBackup/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index f94d95c7b5275a340f55ed79a37148f3fff9ab13..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 FileBackupTest from './FileBackup.test'; - -export default function testsuite() { - FileBackupTest(); -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/ohosTest/module.json5 b/CoreFile/AppFileBackup/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/AppFileBackup/entry/src/test/List.test.ets b/CoreFile/AppFileBackup/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/entry/src/test/LocalUnit.test.ets b/CoreFile/AppFileBackup/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/CoreFile/AppFileBackup/hvigor/hvigor-config.json5 b/CoreFile/AppFileBackup/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/AppFileBackup/hvigorfile.ts b/CoreFile/AppFileBackup/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/AppFileBackup/oh-package.json5 b/CoreFile/AppFileBackup/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/AppFileBackup/ohosTest.md b/CoreFile/AppFileBackup/ohosTest.md deleted file mode 100644 index 84cbbc452fa8ad54bf9b7f567469c0fae44dd0c3..0000000000000000000000000000000000000000 --- a/CoreFile/AppFileBackup/ohosTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| --------------------------- | ------------------------------------------- | ---- | ---------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | \ | 应用被拉起 | 是 | pass | -| 应用触发数据备份 | FileBackupExtension应用的文件成功创建 | \ | 日志输出备份流程 | 是 | pass | -| 退出备份恢复服务 | 备份会话已经注册 | \ | 退出备份恢复服务 | 是 | pass | -| 拉起FileBackupExtension应用 | 应用已安装 | \ | 成功拉起应用 | 是 | pass | -| 删除数据文件 | FileBackupExtension应用的文件已经创建且备份 | \ | 文件被删除 | 是 | pass | -| 拉起本应用 | 应用已安装 | \ | 应用被拉起 | 是 | pass | -| 应用触发数据恢复 | 数据文件完成备份 | \ | 日志输出恢复流程 | 是 | pass | -| 查看文件是否恢复成功 | FileBackupExtension应用已安装 | \ | 文件恢复并显示 | 是 | pass | - diff --git a/CoreFile/AppFileBackup/screenshots/start.jpg b/CoreFile/AppFileBackup/screenshots/start.jpg deleted file mode 100644 index 2312975def33f372b507f273b18a61a86b975993..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFileBackup/screenshots/start.jpg and /dev/null differ diff --git a/CoreFile/AppFsSpcaeStatisticsSample/.gitignore b/CoreFile/AppFsSpcaeStatisticsSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/AppFsSpcaeStatisticsSample/AppScope/app.json5 b/CoreFile/AppFsSpcaeStatisticsSample/AppScope/app.json5 deleted file mode 100644 index 14276414875907dccf4a453b3bca20cf7040d0e0..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.appfsspcaestatisticssample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/element/string.json b/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 1b2489f18f6608155cf41a74cf0ddd6936d15052..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AppFsSpcaeStatisticsSample" - } - ] -} diff --git a/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/media/background.png b/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/media/foreground.png b/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/media/layered_image.json b/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/README_zh.md b/CoreFile/AppFsSpcaeStatisticsSample/README_zh.md deleted file mode 100644 index 3be68f8ca658c0109283bd2db4dc2085b10cc8fd..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/README_zh.md +++ /dev/null @@ -1,66 +0,0 @@ -# 应用及文件系统空间统计 - -### 介绍 - -本示例主要展示了有关文件系统空间和应用空间统计的接口功能。使用ohos.file.statvfs、ohos.file.storageStatistics。实现了应用空间的查询功能。该工程中展示的代码与接口等详细描述可查如下链接。 - -- [应用及文件系统空间统计](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/app-fs-space-statistics.md) - -### 效果预览 - -|主页| -|--------------------------------| -|首页| - -使用说明: - -1. 在主界面,然后点击getFreeSize按钮,界面下方显示“getFreeSize success”内容。 -2. 在主界面,然后点击getCurrentBundleStats按钮,界面下方显示“getCurrentBundleStats success”内容。 -3. 在主界面,然后点击getTotalSize按钮,界面下方显示“getTotalSize success”内容。 -4. 在主界面,然后点击getTotalSizeSync按钮,界面下方显示“getTotalSizeSync success”内容。 -5. 在主界面,然后点击storageGetFreeSize按钮,界面下方显示“storageGetFreeSize success”内容。 -6. 在主界面,然后点击getFreeSizeSync按钮,界面下方显示“getFreeSizeSync success”内容。 - -### 工程目录 - -``` -├──entry/src/main -| ├──ets -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -- 使用[ohos.file.storageStatistics](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-storage-statistics.md)提供的功能获取文件系统空间和应用空间的大小。 - -### 相关权限 - -不涉及 - -## 依赖 - -不涉及 - -## 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:PC/2in1。 - -2.本示例为Stage模型,支持API12版本SDK,版本号:5.0.0。 - -3.本示例需要使用DevEco Studio 6.0.0 Release (构建版本:6.0.0.858,构建 2025年9月24日)及以上版本才可编译运行。 - -## 下载 - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/NDKEnvironmentSample > .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/CoreFile/AppFsSpcaeStatisticsSample/build-profile.json5 b/CoreFile/AppFsSpcaeStatisticsSample/build-profile.json5 deleted file mode 100644 index 5d6300826b0e7682f57218284eff9cfd959c35a8..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/build-profile.json5 +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/code-linter.json5 b/CoreFile/AppFsSpcaeStatisticsSample/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/.gitignore b/CoreFile/AppFsSpcaeStatisticsSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/build-profile.json5 b/CoreFile/AppFsSpcaeStatisticsSample/entry/build-profile.json5 deleted file mode 100644 index 6bf0d132e6f78049e712446c63f2633b2d1613d3..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/hvigorfile.ts b/CoreFile/AppFsSpcaeStatisticsSample/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/obfuscation-rules.txt b/CoreFile/AppFsSpcaeStatisticsSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/AppFsSpcaeStatisticsSample/entry/oh-package.json5 b/CoreFile/AppFsSpcaeStatisticsSample/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 62f53acbc95e5be7985f8fb1fe2db591cea260bd..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/ets/pages/Index.ets b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 210d9abed0178b9d68324f5890f315a04907b4d2..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_interface_storage] -import { statfs } from '@kit.CoreFileKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { common } from '@kit.AbilityKit'; -import { storageStatistics } from '@kit.CoreFileKit'; -// [End import_interface_storage] - -@Entry -@Component -struct Index { - @State text: string = ''; - @State documentResult: string = ''; - @State result: string = ''; - - build() { - Column({ space: $r('app.float.size_10') }) { - Row({ space: $r('app.float.size_10') }) { - // getFreeSize按钮 - Button($r('app.string.getFreeSizeButton')) - .width('50%') // 按钮宽度占屏幕宽度50% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.getFreeSize(); - }) - } - // getCurrentBundleStats按钮 - Button($r('app.string.getCurrentBundleStatsButton')) - .width('80%') // 按钮宽度占屏幕宽度30% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.getCurrentBundleStats(); - }) - // getTotalSize按钮 - Button($r('app.string.getTotalSizeButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.getTotalSize(); - }) - // getTotalSizeSync按钮 - Button($r('app.string.getTotalSizeSyncButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.getTotalSizeSync(); - }) - // getTotalSizeSync按钮 - Button($r('app.string.storageGetFreeSizeButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.storageGetFreeSize(); - }) - // getTotalSizeSync按钮 - Button($r('app.string.getFreeSizeSyncButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.getFreeSizeSync(); - }) - // 显示调用接口后的结果。 - Text(this.result) - .fontSize($r('app.float.size_25')) // 文本字体大小为50 - .fontWeight(FontWeight.Bold) // 文本字体加粗 - .margin({ top: $r('app.float.size_20') }) // 文本上边距为20 - } - .width('100%') // 外层列布局宽度占满屏幕 - .height('100%') // 外层列布局高度占满屏幕 - .alignItems(HorizontalAlign.Center) // 水平居中对齐 - .justifyContent(FlexAlign.Center) // 垂直居中对齐 - .backgroundColor($r('app.color.lightGrayColor')) // 背景颜色为浅灰色 - } - - //获取当前应用的存储空间大小。 - getCurrentBundleStats() { - try { - // [Start storageStatistics_getCurrentBundleStats] - storageStatistics.getCurrentBundleStats((err: BusinessError, bundleStats: storageStatistics.BundleStats) => { - if (err) { - console.error(`Invoke getCurrentBundleStats failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info(`Invoke getCurrentBundleStats succeeded, appsize is ${bundleStats.appSize}`); - } - }); - // [End storageStatistics_getCurrentBundleStats] - }catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - this.result = 'getCurrentBundleStats success'; - } - - //获取文件系统数据分区剩余空间大小。 - storageGetFreeSize() { - try { - // [Start storageStatistics_statfs_getFreeSize] - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - let path = context.filesDir; - statfs.getFreeSize(path, (err: BusinessError, number: number) => { - if (err) { - console.error(`Invoke getFreeSize failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info(`Invoke getFreeSize succeeded, size is ${number}`); - } - }); - // [End storageStatistics_statfs_getFreeSize] - }catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - this.result = 'getFreeSize success'; - } - //异步获取内置存储的总空间大小。 - getTotalSize() { - try { - // [Start storageStatistics_getTotalSize] - storageStatistics.getTotalSize().then((number: number) => { - console.info(`getTotalSize successfully, number is ${number}`); - }).catch((err: BusinessError) => { - console.error(`getTotalSize failed with error, code is ${err.code}, message is ${err.message}`); - }); - // [End storageStatistics_getTotalSize] - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - this.result = 'getTotalSize success'; - } - - getTotalSizeSync() { - // [Start storageStatistics_getTotalSizeSync] - try { - let number = storageStatistics.getTotalSizeSync(); - console.info(`getTotalSizeSync successfully, number is ${number}`); - } catch (err) { - let error: BusinessError = err as BusinessError; - console.error(`getTotalSizeSync failed with error, code is ${error.code}, message is ${error.message}`); - } - // [End storageStatistics_getTotalSizeSync] - this.result = 'getTotalSizeSync success'; - } - - getFreeSize() { - try { - // [Start storageStatistics_getFreeSize] - storageStatistics.getFreeSize().then((number: number) => { - console.info(`getFreeSize successfully, number is ${number}`); - }).catch((err: BusinessError) => { - console.error(`getFreeSize failed with error, code is ${err.code}, message is ${err.message}`); - }); - // [End storageStatistics_getFreeSize] - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - this.result = 'storageGetFreeSize success'; - } - - getFreeSizeSync() { - // [Start storageStatistics_getFreeSizeSync] - try { - let number = storageStatistics.getFreeSizeSync(); - console.info(`getFreeSizeSync successfully, number is ${number}`); - } catch (err) { - let error: BusinessError = err as BusinessError; - console.error(`getFreeSizeSync failed with error, code is ${error.code}, message is ${error.message}`); - } - // [End storageStatistics_getFreeSizeSync] - this.result = 'getFreeSizeSync success'; - } -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/module.json5 b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/module.json5 deleted file mode 100644 index fad7ec42333e8ddfcb67c497f2cea5a251ae6cbc..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/module.json5 +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone", - "tablet", - "2in1" - ], - "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": [ - "ohos.want.action.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/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/element/color.json b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index b99ebd2b9c4b3a455465e850b4eeee9548ba886a..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "whiteColor", - "value": "#FFFFFF" - }, - { - "name": "lightGrayColor", - "value": "#F0F0F0" - }, - { - "name": "grayColor", - "value": "#808080" - }, - { - "name": "blackColor", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/element/float.json b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 30e6a4c0edf724b1459705043d7488912328bd16..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "float": [ - { - "name": "size_5", - "value": "10" - }, - { - "name": "size_10", - "value": "10" - }, - { - "name": "size_13", - "value": "13" - }, - { - "name": "size_15", - "value": "15" - }, - { - "name": "size_20", - "value": "20" - }, - { - "name": "size_25", - "value": "25" - }, - { - "name": "size_40", - "value": "40" - }, - { - "name": "size_50", - "value": "50" - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/element/string.json b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index c7ce4819d5dca29a048f3eb739eba4e8d9e0e1f6..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "SavingUserFiles" - }, - { - "name": "reason_MICROPHONE", - "value": "reason_MICROPHONE" - }, - { - "name": "document", - "value": "文档|.txt" - }, - { - "name": "getFreeSizeButton", - "value": "getFreeSize" - }, - { - "name": "getCurrentBundleStatsButton", - "value": "getCurrentBundleStats" - }, - { - "name": "getTotalSizeSyncButton", - "value": "getTotalSizeSync" - }, - { - "name": "getFreeSizeSyncButton", - "value": "getFreeSizeSync" - }, - { - "name": "storageGetFreeSizeButton", - "value": "storageGetFreeSize" - }, - { - "name": "getTotalSizeButton", - "value": "getTotalSize" - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/background.png b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/foreground.png b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/layered_image.json b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/startIcon.png b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/dark/element/color.json b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/mock/mock-config.json5 b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/AppFsSpcaeStatisticsSample/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/ohosTest/module.json5 b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 6b9889e8ccb62f93825d6b26fa53db8e97a974c0..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone", - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/test/List.test.ets b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/test/LocalUnit.test.ets b/CoreFile/AppFsSpcaeStatisticsSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/hvigor/hvigor-config.json5 b/CoreFile/AppFsSpcaeStatisticsSample/hvigor/hvigor-config.json5 deleted file mode 100644 index b8fea3f097bd68b0bc4d87de986d2cb7732c1d9b..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/CoreFile/AppFsSpcaeStatisticsSample/hvigorfile.ts b/CoreFile/AppFsSpcaeStatisticsSample/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/AppFsSpcaeStatisticsSample/oh-package.json5 b/CoreFile/AppFsSpcaeStatisticsSample/oh-package.json5 deleted file mode 100644 index 69cb43cba3addcee1840403c67405134a2a9102c..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/AppFsSpcaeStatisticsSample/ohosTest.md b/CoreFile/AppFsSpcaeStatisticsSample/ohosTest.md deleted file mode 100644 index d5061e2510fc3d062850ddcc69f43cd28032ac81..0000000000000000000000000000000000000000 --- a/CoreFile/AppFsSpcaeStatisticsSample/ohosTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|---------------------------|--------------------------------------------| ---- | -------------------------- |------| -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用,主页元素齐备 | 否 | Pass | -| 测试getFreeSize接口 | 使用PC/2in1设备 | | getFreeSize success | 否 | Pass | -| 测试getCurrentBundleStats接口 | 使用PC/2in1设备 | | getCurrentBundleStats success | 否 | pass | -| 测试getTotalSize接口 | 使用PC/2in1设备 | | getTotalSize success | 否 | pass | -| 测试getTotalSizeSync接口 | 使用PC/2in1设备 | | getTotalSizeSync success | 否 | pass | -| 测试storageGetFreeSize接口 | 使用PC/2in1设备 | | storageGetFreeSize success | 否 | pass | -| 测试getFreeSizeSync接口 | 使用PC/2in1设备 | | getFreeSizeSync success | 否 | pass | - diff --git a/CoreFile/DistributedFileSample/.gitignore b/CoreFile/DistributedFileSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/DistributedFileSample/AppScope/app.json5 b/CoreFile/DistributedFileSample/AppScope/app.json5 deleted file mode 100644 index 693d51c38d4ba104bbf1b82b8d5f108c37223ee9..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.distributedfilesample", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/CoreFile/DistributedFileSample/AppScope/resources/base/element/string.json b/CoreFile/DistributedFileSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 9d4e186192c02385fb92fcf0d6b5849b35c45ac1..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DistributedFileSample" - } - ] -} diff --git a/CoreFile/DistributedFileSample/AppScope/resources/base/media/app_icon.png b/CoreFile/DistributedFileSample/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/CoreFile/DistributedFileSample/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/CoreFile/DistributedFileSample/README_zh.md b/CoreFile/DistributedFileSample/README_zh.md deleted file mode 100644 index c5fc1ef673472f8e6458111981b3768e44efd18c..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/README_zh.md +++ /dev/null @@ -1,75 +0,0 @@ -# 分布式文件系统 - -## 介绍 - -本实例实现了分布式文件系统的文件跨设备访问、跨设备拷贝以及设计分布式文件数据等级。使用两台设备进行分布式组网,在组网环境下可以对文件进行跨设备的访问和拷贝,该工程中展示的代码详细描述可查如下链接。 - -- [ 跨设备文件访问](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/file-access-across-devices.md) -- [ 跨设备文件拷贝](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/file-copy-across-devices.md) - -## 效果预览 - -| 应用界面 | -| :------------------------------------------------: | -| | - -使用说明: - -1. 本应用在进行分布式文件访问之前,需要两台设备进行组网并且都安装了本应用。 -2. 组网要求:两台设备连入同一个局域网中,确保设备进入可信状态,且两台设备的音乐软件能同步播放和暂停。 -3. 在启动应用后可以根据相应的按钮实现对应的功能点,首先便是设备A在分布式目录下创建文件,并将此文件的数据等级设置,使其可以跨设备进行访问。 -4. 由B设备访问应用公共目录并挂载,向A设备发起建链,设备B可在分布式路径下读取测试文件。 -5. 按钮“从沙箱复制到分布式目录”设备A在本地目录下创建一个文件,随后将其拷贝到分布式路径下。 -6. 按钮“从分布式目录复制到沙箱”设备A和B在确认组网建链后,由设备B从分布式路径下将测试文件拷贝到设备B的沙箱路径。 - -## 工程目录 - -``` -├──entry/src/main -| ├──ets -| | ├──commom -| | | ├──Logger.ts // 日志工具 -| | | ├──ShowToast.ets // 弹窗提示工具 -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -## 具体实现 - -1. 根据Openharmony提供完整的数据分级、设备分级标准,并针对不同设备制定不同的数据流转策略,来设置文件的安全等级。 -2. 完成分布式组网。 将需要跨设备访问的两个设备登录同一账号,保证设备蓝牙和Wi-Fi功能开启,蓝牙无需互连,Wi-Fi无需接入同一个局域网。 -3. 访问跨设备文件,分布式文件系统为应用提供了跨设备文件访问的能力,开发者在两个设备安装同一应用时,通过基础文件接口,可跨设备读写另一个设备该应用分布式文件路径下的文件。 -4. 拷贝跨设备文件,由设备A的将文件从沙箱路径拷贝到分布式路径下,再有组网的设备B从分布式路径将文件拷贝到设备B的应用沙箱路径。 - -## 相关权限 - -- [ohos.permission.DISTRIBUTED_SOFTBUS_CENTER](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissiondistributed_softbus_center) -- [ohos.permission.ACCESS_SERVICE_DM](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionaccess_service_dm) -- [ohos.permission.DISTRIBUTED_DATASYNC](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissiondistributed_datasync) -- [ohos.permission.INTERNET](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissioninternet) - -## 依赖 - -不涉及 - -## 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568。 -2. 本示例为Stage模型,支持API14版本以上SDK,版本号:5.0.2.58。 -3. 本示例需要使用DevEco Studio 5. 1Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 -4. 本示例涉及部分接口需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md) ,把配置文件中的“apl”字段信息改为“system_basic”。 - -## 下载 - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/DistributedFileSample > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/CoreFile/DistributedFileSample/build-profile.json5 b/CoreFile/DistributedFileSample/build-profile.json5 deleted file mode 100644 index eef67135e8c96ec5d984a0eb0c451aa8103ee856..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/build-profile.json5 +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/code-linter.json5 b/CoreFile/DistributedFileSample/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/.gitignore b/CoreFile/DistributedFileSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/build-profile.json5 b/CoreFile/DistributedFileSample/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/hvigorfile.ts b/CoreFile/DistributedFileSample/entry/hvigorfile.ts deleted file mode 100644 index a3d28cb60475cede46d0aa36973096d5544dbcd1..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/DistributedFileSample/entry/obfuscation-rules.txt b/CoreFile/DistributedFileSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/DistributedFileSample/entry/oh-package.json5 b/CoreFile/DistributedFileSample/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/DistributedFileSample/entry/src/main/ets/common/Logger.ts b/CoreFile/DistributedFileSample/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index 98d085038b35ed0a5be9a6c9882e9202d419fe3b..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -export class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0x0000; // 应用的编码 - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]): void { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number): void { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger('[Sample_DistributedFileSample]'); - diff --git a/CoreFile/DistributedFileSample/entry/src/main/ets/common/ShowToast.ets b/CoreFile/DistributedFileSample/entry/src/main/ets/common/ShowToast.ets deleted file mode 100644 index b95a0b3987d341d3382452dc74cb033b824c4c90..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/ets/common/ShowToast.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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 promptAction from '@ohos.promptAction'; - -export function showToast(msg: string, dur: number) { - promptAction.showToast({ - message: msg, - duration: dur - }); -} diff --git a/CoreFile/DistributedFileSample/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/DistributedFileSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 0f2f8b94aa24b0a50e272270e4e18b6df93ac5fd..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/DistributedFileSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/DistributedFileSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/DistributedFileSample/entry/src/main/ets/pages/Index.ets b/CoreFile/DistributedFileSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 5ccf81717214c358d5e907d2f7d793e8e14b84f7..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - - -// [Start import_interface_distributed] -import { BusinessError } from '@kit.BasicServicesKit'; -import { common, abilityAccessCtrl } from '@kit.AbilityKit'; -import { distributedDeviceManager } from '@kit.DistributedServiceKit'; -import { fileIo as fs, ListFileOptions, fileUri, securityLabel } from '@kit.CoreFileKit'; -import { buffer } from '@kit.ArkTS'; -import Logger from '../common/Logger'; -import { showToast } from '../common/ShowToast'; - -// [Start import_interface_distributed] -const BUFFER: number = 4096; // 读写文件的缓冲区 -const DELAY: number = 1000; // 延时1秒 -const MARGIN: number = 5; // 组件的间隔 - -// 设备A上在分布式路径下创建测试文件,并写入内容 -function createFile(context: common.UIAbilityContext): void { - // [Start access_A_write_distributed_file] - let pathDir: string = context.distributedFilesDir; - // 获取分布式目录的文件路径 - let filePath: string = pathDir + '/test.txt'; - - try { - // 在分布式目录下创建文件 - let file = fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - console.info('Succeeded in creating.'); - // 向文件中写入内容 - fs.writeSync(file.fd, 'content'); - // 关闭文件 - fs.closeSync(file.fd); - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`Failed to openSync / writeSync / closeSync. Code: ${err.code}, message: ${err.message}`); - } - // [End access_A_write_distributed_file] -} - -// 授权分布式数据同步权限。 -async function applyPermission(context: common.UIAbilityContext) { - // [Start distributed_Data_Permission] - let atManager = abilityAccessCtrl.createAtManager(); - try { - //以动态弹窗的方式向用户申请授权 - atManager.requestPermissionsFromUser(context, ['ohos.permission.DISTRIBUTED_DATASYNC']).then((result) => { - console.info(`request permission result: ${JSON.stringify(result)}`); - }).catch((err: BusinessError) => { - console.error(`Failed to request permissions from user. Code: ${err.code}, message: ${err.message}`); - }) - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`Catch err. Failed to request permissions from user. Code: ${err.code}, message: ${err.message}`); - } - // [End distributed_Data_Permission] -} - -// 设备B主动向设备A发起建链,建链成功后设备B可在分布式路径下读取测试文件 -async function mountPublicDir(context: common.UIAbilityContext) { - // [Start access_ConnectDfs] - // 通过分布式设备管理的接口获取设备A的networkId信息 - // [StartExclude access_ConnectDfs] - console.info(`connectDfs start`); - // [EndExclude access_ConnectDfs] - let dmInstance = distributedDeviceManager.createDeviceManager('com.example.hap'); - let deviceInfoList: distributedDeviceManager.DeviceBasicInfo[] = dmInstance.getAvailableDeviceListSync(); - if (deviceInfoList && deviceInfoList.length > 0) { - console.info(`Success to get available device list`); - let networkId = deviceInfoList[0].networkId; - // 定义访问公共文件目录的回调 - let listeners : fs.DfsListeners = { - onStatus: (networkId: string, status: number): void => { - console.info('Failed to access public directory'); - } - }; - // 开始跨设备文件访问 - fs.connectDfs(networkId, listeners).then(() => { - console.info('Success to connect dfs'); - let pathDir: string = context.distributedFilesDir; - // 获取分布式目录的文件路径 - let filePath: string = pathDir + '/test.txt'; - try { - // 打开分布式目录下的文件 - let file = fs.openSync(filePath, fs.OpenMode.READ_WRITE); - // 定义接收读取数据的缓存 - let arrayBuffer = new ArrayBuffer(4096); - // 读取文件的内容,返回值是读取到的字节个数 - class Option { - public offset: number = 0; - public length: number = 0; - }; - let option = new Option(); - option.length = arrayBuffer.byteLength; - let num = fs.readSync(file.fd, arrayBuffer, option); - // 打印读取到的文件数据 - let buf = buffer.from(arrayBuffer, 0, num); - console.info('read result: ' + buf.toString()); - fs.closeSync(file); - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`Failed to openSync / readSync. Code: ${err.code}, message: ${err.message}`); - } - }).catch((error: BusinessError) => { - let err: BusinessError = error as BusinessError; - console.error(`Failed to connect dfs. Code: ${err.code}, message: ${err.message}`); - }); - } - // [End access_ConnectDfs] -} - - - -// B设备访问跨设备文件完成,断开链路。 -function disMountPublicDir(): void { - // [Start access_DisConnectDfs] - // 获取设备A的networkId - // [StartExclude access_DisConnectDfs] - console.info(`disconnectDfs start`); - // [EndExclude access_DisConnectDfs] - let dmInstance = distributedDeviceManager.createDeviceManager('com.example.hap'); - let deviceInfoList: distributedDeviceManager.DeviceBasicInfo[] = dmInstance.getAvailableDeviceListSync(); - if (deviceInfoList && deviceInfoList.length > 0) { - console.info(`Success to get available device list`); - let networkId = deviceInfoList[0].networkId; - // 关闭跨设备文件访问 - fs.disconnectDfs(networkId).then(() => { - console.info(`Success to disconnect dfs`); - }).catch((err: BusinessError) => { - console.error(`Failed to disconnect dfs. Code: ${err.code}, message: ${err.message}`); - }) - } - // [End access_DisConnectDfs] -} - -// 将A设备的待拷贝沙箱文件,拷贝到A设备的分布式路径下。 -function copySandFile(context: common.UIAbilityContext): void { - // [Start copy_sand_to_distributed] - let pathDir: string = context.filesDir; - let distributedPathDir: string = context.distributedFilesDir; - // 待拷贝文件沙箱路径 - let filePath: string = pathDir + '/src.txt'; - try { - // 准备待拷贝沙箱文件 - let file = fs.openSync(filePath, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE); - fs.writeSync(file.fd, 'Create file success'); - fs.closeSync(file); - } catch (error) { - console.error(`Failed to createFile. Code: ${error.code}, message: ${error.message}`); - } - - // 获取待拷贝源文件uri - let srcUri = fileUri.getUriFromPath(filePath); - // 获取目标路径(分布式目录)的uri - let destUri: string = fileUri.getUriFromPath(distributedPathDir + '/src.txt'); - try { - // 将沙箱路径下的源文件拷贝到目标分布式目录下 - fs.copy(srcUri, destUri).then(()=>{ - console.info(`Succeeded in copying---. `); - console.info(`src: ${srcUri} dest: ${destUri}`); - }).catch((error: BusinessError)=>{ - let err: BusinessError = error as BusinessError; - console.error(`Failed to copy. Code: ${err.code}, message: ${err.message}`); - }) - } catch (error) { - console.error(`Catch err. Failed to copy. Code: ${error.code}, message: ${error.message}`); - } - // [End copy_sand_to_distributed] -} - -// B设备在获取A端沙箱文件时,从B设备的分布式路径下将对应的文件拷贝走,以此完成跨设备拷贝。 -function copyDistributedFile(context: common.UIAbilityContext): void { - // [Start copy_distributed_to_sand] - // [StartExclude copy_distributed_to_sand] - console.info(`copyDistributedFile start`); - // [EndExclude copy_distributed_to_sand] - let pathDir: string = context.filesDir; - let distributedPathDir: string = context.distributedFilesDir; - // 待拷贝文件的目标路径(沙箱路径) - let destPath: string = pathDir + '/dest.txt'; - // 获取目标路径uri - let destUri = fileUri.getUriFromPath(destPath); - - // 拷贝源文件路径(分布式目录) - let srcPath = distributedPathDir + '/src.txt'; - // 获取源路径uri - let srcUri: string = fileUri.getUriFromPath(srcPath); - - // 定义拷贝回调 - let progressListener: fs.ProgressListener = (progress: fs.Progress) => { - console.info(`progressSize: ${progress.processedSize}, totalSize: ${progress.totalSize}`); - }; - let options: fs.CopyOptions = { - 'progressListener' : progressListener - }; - // 通过分布式设备管理的接口获取设备A的networkId信息 - let dmInstance = distributedDeviceManager.createDeviceManager('com.example.hap'); - let deviceInfoList: distributedDeviceManager.DeviceBasicInfo[] = dmInstance.getAvailableDeviceListSync(); - if (deviceInfoList && deviceInfoList.length > 0) { - console.info(`success to get available device list`); - let networkId = deviceInfoList[0].networkId; // 这里只是两个设备连接,列表中首个即为A设备的networkId - // 定义访问分布式目录的回调 - let listeners : fs.DfsListeners = { - onStatus: (networkId: string, status: number): void => { - console.error(`Failed to access public directory,${status}`); - } - }; - // 开始跨设备文件拷贝 - fs.connectDfs(networkId, listeners).then(()=>{ - try { - // 将分布式目录下的文件拷贝到其他沙箱路径下 - fs.copy(srcUri, destUri, options).then(()=>{ - console.info(`Succeeded in copying from distribted path`); - console.info(`src: ${srcUri} dest: ${destUri}`); - fs.unlinkSync(srcPath); // 拷贝完成后清理分布式目录下的临时文件 - }).catch((error: BusinessError)=>{ - let err: BusinessError = error as BusinessError; - console.error(`Failed to copy. Code: ${err.code}, message: ${err.message}`); - }) - } catch (error) { - console.error(`Catch err. Failed to copy. Code: ${error.code}, message: ${error.message}`); - } - }).catch((error: BusinessError) => { - let err: BusinessError = error as BusinessError; - console.error(`Failed to connect dfs. Code: ${err.code}, message: ${err.message}`); - }); - } - // [End copy_distributed_to_sand] -} - -// 查看文件列表 -function getListFile(pathDir: string): void { - let listFileOption: ListFileOptions = { - recursion: false, - listNum: 0, // 0表示不限制列出的文件数量 - filter: { - suffix: ['.png', '.jpg', '.txt', '.jpeg'], - displayName: ['*'], - fileSizeOver: 0, // 文件大小必须大于 0 字节 - lastModifiedAfter: new Date(0).getTime() - } - }; - let files = fs.listFileSync(pathDir, listFileOption); - for (let i = 0; i < files.length; i++) { - Logger.info(pathDir); - Logger.info(`The name of file: ${files[i]}`); - } -} - -@Entry -@Component -struct Distributed { - build() { - Column() { - Row() { - Button($r('app.string.CreateFile')) - .width('30%') - .height('40%') - .margin(MARGIN) - .onClick(() => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - createFile(context); - }) - Button($r('app.string.AccessPublicFileDir')) - .width('30%') - .height('40%') - .margin(MARGIN) - .onClick(() => { - // 请在组件内获取context,确保this.getUIContext().getHostContext()返回结果为UIAbilityContext - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - mountPublicDir(context); - }) - Button($r('app.string.DisconnectingLink')) - .width('30%') - .height('40%') - .onClick(() => { - disMountPublicDir(); - }) - } - .width('100%') - .height('20%') - .align(Alignment.Center); - - Row() { - Button($r('app.string.CopySandToDistributed')) - .width('45%') - .height('40%') - .margin(MARGIN) - .onClick(() => { - // 请在组件内获取context,确保this.getUIContext().getHostContext()返回结果为UIAbilityContext - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - copySandFile(context); - }) - Button($r('app.string.CopyDistributedToSand')) - .width('45%') - .height('40%') - .onClick(() => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - copyDistributedFile(context); - }) - } - .width('100%') - .height('20%') - .align(Alignment.Center); - - Button($r('app.string.ApplyPermission')) - .margin(MARGIN) - .width('30%') - .height('8%') - .align(Alignment.Center) - .onClick(() => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - applyPermission(context); - }) - Button($r('app.string.GetFileList')) - .width('30%') - .height('8%') - .align(Alignment.Center) - .onClick(() => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - let pathDir: string = context.filesDir; // 应用沙箱路径 - let distributedPathDir: string = context.distributedFilesDir; // 应用分布式路径 - getListFile(pathDir); - getListFile(distributedPathDir); - }) - } - } -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/main/module.json5 b/CoreFile/DistributedFileSample/entry/src/main/module.json5 deleted file mode 100644 index b9994b128dfb80fa46fa47b417277f6299fa3964..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/module.json5 +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2025 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, - "continuable": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home", - ] - } - ] - } - ], - "definePermissions": [ - { - "name": "ohos.permission.ACCESS_SERVICE_DM", - "grantMode": "system_grant", - "availableLevel": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:EntryAbility_label" - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "always" - } - }, - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC", - "reason": "$string:dataflow", - "usedScene": { - "abilities": [ - "FormAbility" - ], - "when": "always" - }, - }, - { - "name": "ohos.permission.ACCESS_SERVICE_DM", - "reason": "$string:CerNetwork", - "usedScene": { - "abilities": [ - "FormAbility" - ], - "when": "always" - } - }, - { - "name": "ohos.permission.INTERNET", - "reason": "$string:requestINTER", - "usedScene": { - "abilities": [ - "FormAbility" - ], - "when": "always" - } - }, - ], - } -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/base/element/color.json b/CoreFile/DistributedFileSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/base/element/string.json b/CoreFile/DistributedFileSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index ab72e840f17bf9299f0cbb2b4ccc522e54668930..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "Distributed" - }, - { - "name": "dataflow", - "value": "跨设备数据流转" - }, - { - "name": "requestINTER", - "value": "网络请求" - }, - { - "name": "CerNetwork", - "value": "允许应用获取分布式设备的认证组网能力" - }, - { - "name": "SetFileLevel", - "value": "设置文件等级" - }, - { - "name": "AccessPublicFileDir", - "value": "访问公共目录" - }, - { - "name": "DisconnectingLink", - "value": "断开链路" - }, - { - "name": "CopySandToDistributed", - "value": "从沙箱复制到分布式目录" - }, - { - "name": "CopyDistributedToSand", - "value": "从分布式目录复制到沙箱" - }, - { - "name": "GetFileList", - "value": "获取文件列表" - }, - { - "name": "ApplyPermission", - "value": "申请权限" - }, - { - "name": "CreateFile", - "value": "文件创建" - }, - { - "name": "permit", - "value": "允许" - } - ] -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/background.png b/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/foreground.png b/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/layered_image.json b/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/startIcon.png b/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/DistributedFileSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/DistributedFileSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/DistributedFileSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/en_US/element/string.json b/CoreFile/DistributedFileSample/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index ba44c5f9b08872f845bae2f70a469da8365d383b..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "Distributed" - }, - { - "name": "dataflow", - "value": "dataflow" - }, - { - "name": "requestINTER", - "value": "requestINTER" - }, - { - "name": "CerNetwork", - "value": "CerNetwork" - }, - { - "name": "SetFileLevel", - "value": "SetFileLevel" - }, - { - "name": "AccessPublicFileDir", - "value": "AccessPublicFileDir" - }, - { - "name": "DisconnectingLink", - "value": "DisconnectingLink" - }, - { - "name": "CopySandToDistributed", - "value": "CopySandToDistributed" - }, - { - "name": "CopyDistributedToSand", - "value": "CopyDistributedToSand" - }, - { - "name": "GetFileList", - "value": "GetFileList" - }, - { - "name": "ApplyPermission", - "value": "ApplyPermission" - }, - { - "name": "CreateFile", - "value": "CreateFile" - }, - { - "name": "permit", - "value": "permit" - } - ] -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/main/resources/zh_CN/element/string.json b/CoreFile/DistributedFileSample/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 64195a84ecf159e379ad5d54c62fd5852a3a092a..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "Distributed" - }, - { - "name": "dataflow", - "value": "跨设备数据流转" - }, - { - "name": "requestINTER", - "value": "网络请求" - }, - { - "name": "CerNetwork", - "value": "允许应用获取分布式设备的认证组网能力" - }, - { - "name": "SetFileLevel", - "value": "设置文件等级" - }, - { - "name": "AccessPublicFileDir", - "value": "访问公共目录" - }, - { - "name": "DisconnectingLink", - "value": "断开链路" - }, - { - "name": "CopySandToDistributed", - "value": "从沙箱复制到分布式目录" - }, - { - "name": "CopyDistributedToSand", - "value": "从分布式目录复制到沙箱" - }, - { - "name": "GetFileList", - "value": "获取文件列表" - }, - { - "name": "ApplyPermission", - "value": "申请权限" - }, - { - "name": "CreateFile", - "value": "文件创建" - }, - { - "name": "permit", - "value": "允许" - } - ] -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/mock/mock-config.json5 b/CoreFile/DistributedFileSample/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/DistributedFileSample/entry/src/ohosTest/ets/test/DistributedFileSample.test.ets b/CoreFile/DistributedFileSample/entry/src/ohosTest/ets/test/DistributedFileSample.test.ets deleted file mode 100644 index e43d2528ac17cf4a5e5b84e7a29c882c195a1fdf..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/ohosTest/ets/test/DistributedFileSample.test.ets +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium'; -import { Driver, ON, Component, abilityDelegatorRegistry } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const DELAY_TIME = 1200; // 延时1.2秒 -const TAG = '[Sample_DistributedFileSamples]'; -const DOMAIN = 0xF811; -const BUNDLE = 'DistributedFileSamples_'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -const abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - -async function getResourceString(resource: Resource): Promise { - let manage = abilityDelegator.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function DistributedFileSampleTest() { - describe('DistributedFileSampleTest', () => { - /** - * @tc.number StartAbility_001 - * @tc.name StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 begin'); - // start tested ability - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - // check top display ability - const ability: UIAbility = await delegator.getCurrentTopAbility(); - hilog.info(DOMAIN, TAG, BUNDLE + 'get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('TestAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 end'); - }) - /** - * @tc.number ApplyPermission_001 - * @tc.name ApplyPermission_001 - * @tc.desc 权限申请 - */ - it(BUNDLE + 'ApplyPermission_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ApplyPermission_001 begin'); - let str = await getResourceString($r('app.string.ApplyPermission')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'ApplyPermission_001 end'); - }) - /** - * @tc.number ApplyPermission_002 - * @tc.name ApplyPermission_002 - * @tc.desc 权限申请 - */ - it(BUNDLE + 'ApplyPermission_002', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ApplyPermission_002 begin'); - let str = await getResourceString($r('app.string.permit')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'ApplyPermission_002 end'); - }) - /** - * @tc.number mountPublicDir_001 - * @tc.name mountPublicDir_001 - * @tc.desc 建链并访问文件 - */ - it(BUNDLE + 'mountPublicDir_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'mountPublicDir_001 begin'); - let str = await getResourceString($r('app.string.AccessPublicFileDir')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'mountPublicDir_001 end'); - }) - /** - * @tc.number copyDistributedFile_001 - * @tc.name copyDistributedFile_001 - * @tc.desc 跨设备拷贝文件 - */ - it(BUNDLE + 'copyDistributedFile_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'copyDistributedFile begin'); - let str = await getResourceString($r('app.string.CopyDistributedToSand')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'copyDistributedFile_001 end'); - }) - /** - * @tc.number disMountPublicDir_001 - * @tc.name disMountPublicDir_001 - * @tc.desc 关闭建链 - */ - it(BUNDLE + 'disMountPublicDir_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'disMountPublicDir_001 begin'); - let str = await getResourceString($r('app.string.DisconnectingLink')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'disMountPublicDir_001 end'); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/DistributedFileSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 981f00d1bb9e44a79bda2363dc19d46615ff093f..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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 readyTest from './Ready.test'; -import DistributedFileSampleTest from './DistributedFileSample.test'; - -export default function testsuite() { - readyTest(); - DistributedFileSampleTest(); -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/ohosTest/ets/test/Ready.test.ets b/CoreFile/DistributedFileSample/entry/src/ohosTest/ets/test/Ready.test.ets deleted file mode 100644 index 1d84a04df5a5c83dfc3cdb1c41f7310e2d16c35a..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/ohosTest/ets/test/Ready.test.ets +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium' -import { Driver, ON, Component, abilityDelegatorRegistry } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const DELAY_TIME = 1500; // 延时1.5秒 -const TAG = '[Sample_DistributedFileSamples]'; -const DOMAIN = 0xF811; -const BUNDLE = 'DistributedFileSamples_'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -const abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - -async function getResourceString(resource: Resource): Promise { - let manage = abilityDelegator.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function readyTest() { - describe('readyTest', () => { - /** - * @tc.number StartAbility_001 - * @tc.name StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 begin'); - // start tested ability - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - // check top display ability - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info("get top ability"); - expect(ability.context.abilityInfo.name).assertEqual('TestAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 end'); - - }) - /** - * @tc.number ApplyPermission_001 - * @tc.name ApplyPermission_001 - * @tc.desc 权限申请 - */ - it(BUNDLE + 'ApplyPermission_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ApplyPermission_001 begin'); - let str = await getResourceString($r('app.string.ApplyPermission')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'ApplyPermission_001 end'); - }) - /** - * @tc.number ApplyPermission_002 - * @tc.name ApplyPermission_002 - * @tc.desc 允许权限 - */ - it(BUNDLE + 'ApplyPermission_002', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ApplyPermission_002 begin'); - let str = await getResourceString($r('app.string.permit')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'ApplyPermission_002 end'); - }) - /** - * @tc.number CreateFile_001 - * @tc.name CreateFile_001 - * @tc.desc 分布式目录下创建文件 - */ - it(BUNDLE + 'CreateFile_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'CreateFile_001 begin'); - let str = await getResourceString($r('app.string.CreateFile')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'CreateFile_001 end'); - }) - /** - * @tc.number copySandFile_001 - * @tc.name copySandFile_001 - * @tc.desc 从沙箱路径复制文件到分布式路径 - */ - it(BUNDLE + 'copySandFile_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'copySandFile begin'); - let str = await getResourceString($r('app.string.CopySandToDistributed')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'copySandFile end'); - }) - - }) -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/ohosTest/module.json5 b/CoreFile/DistributedFileSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/DistributedFileSample/entry/src/test/List.test.ets b/CoreFile/DistributedFileSample/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/entry/src/test/LocalUnit.test.ets b/CoreFile/DistributedFileSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/CoreFile/DistributedFileSample/hvigor/hvigor-config.json5 b/CoreFile/DistributedFileSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/DistributedFileSample/hvigorfile.ts b/CoreFile/DistributedFileSample/hvigorfile.ts deleted file mode 100644 index 4beb74fe5b573059b972acf9312d33ea1703c016..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/DistributedFileSample/oh-package.json5 b/CoreFile/DistributedFileSample/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/DistributedFileSample/ohosTest.md b/CoreFile/DistributedFileSample/ohosTest.md deleted file mode 100644 index dce68cbf898c8ae1dad5c4145e3aebf7c27beb29..0000000000000000000000000000000000000000 --- a/CoreFile/DistributedFileSample/ohosTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# 测试用例归档 - -## 文件准备用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ---------------------------- | ---------------- | ---- | ---------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | \ | 应用被拉起 | 是 | pass | -| 权限申请 | 应用被拉起 | \ | 拉起权限申请弹窗 | 是 | pass | -| 允许多设备协同权限 | 拉起权限申请弹窗 | \ | 选择允许 | 是 | pass | -| 创建文件并设置文件等级 | 应用被拉起 | \ | 完成文件的创建 | 是 | pass | -| 将文件从沙箱拷贝到分布式目录 | 设备正常运行 | \ | 文件成功拷贝 | 是 | pass | - -## 跨设备文件访问和拷贝用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| -------------------- | --------------------------------- | ---- | ----------------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | \ | 应用被拉起 | 是 | pass | -| 权限申请 | 应用被拉起 | \ | 拉起权限申请弹窗 | 是 | pass | -| 允许多设备协同权限 | 拉起权限申请弹窗 | \ | 选择允许 | 是 | pass | -| 多设备建链并访问文件 | 两台设备已经完成可信组网 | \ | 成功建链并放了另一台设备的文件 | 是 | pass | -| 跨设备拷贝 | A设备已经将文件拷贝到分布式目录下 | \ | B设备成功从分布式目录拷贝到沙箱目录 | 是 | pass | - diff --git a/CoreFile/DistributedFileSample/screenshots/start.jpg b/CoreFile/DistributedFileSample/screenshots/start.jpg deleted file mode 100644 index 588998c6b36938d6a09c5ea60291565f04ca244b..0000000000000000000000000000000000000000 Binary files a/CoreFile/DistributedFileSample/screenshots/start.jpg and /dev/null differ diff --git a/CoreFile/EnvironmentSample/.gitignore b/CoreFile/EnvironmentSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/EnvironmentSample/AppScope/app.json5 b/CoreFile/EnvironmentSample/AppScope/app.json5 deleted file mode 100644 index af43d1d2a2802e9f6393db289f46fcac3e42f901..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.environmentsample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/CoreFile/EnvironmentSample/AppScope/resources/base/element/string.json b/CoreFile/EnvironmentSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 8c8f9dc89d70fee1a7e572ca6194c7cd294a0da8..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnvironmentSample" - } - ] -} diff --git a/CoreFile/EnvironmentSample/AppScope/resources/base/media/background.png b/CoreFile/EnvironmentSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/EnvironmentSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/EnvironmentSample/AppScope/resources/base/media/foreground.png b/CoreFile/EnvironmentSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/CoreFile/EnvironmentSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/EnvironmentSample/AppScope/resources/base/media/layered_image.json b/CoreFile/EnvironmentSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/README_zh.md b/CoreFile/EnvironmentSample/README_zh.md deleted file mode 100644 index 2e646d7c21bdf2fddb3867d25ca000cf6927dbe9..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/README_zh.md +++ /dev/null @@ -1,73 +0,0 @@ -# 获取并使用公共目录 - -## 介绍 - - 本实例主要实现了通过 ArkTS 接口获取并访问公共目录。 - -- [获取并使用公共目录](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/request-dir-permission.md) - -## 效果预览 - -| 应用启动界面 | 文件访问结果 | -| ------------------------------------------------- | ----------------------------------------------- | -| | | - -使用说明: - -1. 本应用主要通过ArkTS接口获取并访问公共目录。 -2. 在启动应用之后,点击界面上的三个按钮,通过日志反馈知道访问的结果。 - -## 工程目录 - -``` -EnvironmentSample -├──entry/src/main -| ├──ets -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -## 具体实现 - -- 在应用开始访问文件之前,使用UIAbilityContext[获取UIAbility的上下文信息](https://gitcode.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/application-models/uiability-usage.md), - 然后调用Context的相关接口获取应用的沙箱文件路径。 - -- 使用Environment.getUserDownloadDir()、Environment.getUserDesktopDir()、Environment.getUserDesktopDir()分别获取当前用户预授权下载目录的沙箱路径、当前用户预授权桌面目录的沙箱路径、当前用户预授权文档目录的沙箱路径。 - -## 相关权限 - -公共目录获取接口仅用于获取公共目录路径,不对公共目录访问权限进行校验。若需访问公共目录需申请对应的公共目录访问权限。三方应用需要访问公共目录时,需通过弹窗授权向用户申请授予 Download 目录权限、Documents 目录权限或 Desktop 目录权限, -具体参考[访问控制](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/request-user-authorization.md)。 -"requestPermissions" : [ -"ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY", -"ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY", -"ohos.permission.READ_WRITE_DESKTOP_DIRECTORY", -] - -## 依赖 - -不涉及 - -## 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:PC/2in1。 - -2.本示例为Stage模型,支持API12版本SDK,版本号:5.0.0。 - -3.本示例需要使用DevEco Studio 6.0.0 Release (构建版本:6.0.0.858,构建 2025年9月24日)及以上版本才可编译运行。 - -## 下载 - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/EnvironmentSample > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` - diff --git a/CoreFile/EnvironmentSample/build-profile.json5 b/CoreFile/EnvironmentSample/build-profile.json5 deleted file mode 100644 index 21ae45b93ea106b7f439934bcd71ee4fb2efc4c3..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/build-profile.json5 +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - { - "name": "default", - "type": "HarmonyOS", - "material": { - "certpath": "C:\\Users\\X30060367\\.ohos\\config\\default_EnvironmentSample2_GPkphMepbze08-213oaYHK9tdECbL_PC-beac30Zr-M=.cer", - "keyAlias": "debugKey", - "keyPassword": "0000001A80CDFE614831FFAEAAAA830E4999785426AE2723277EC25BF9F8D980E407DC789A08E81AE5D3", - "profile": "C:\\Users\\X30060367\\.ohos\\config\\default_EnvironmentSample2_GPkphMepbze08-213oaYHK9tdECbL_PC-beac30Zr-M=.p7b", - "signAlg": "SHA256withECDSA", - "storeFile": "C:\\Users\\X30060367\\.ohos\\config\\default_EnvironmentSample2_GPkphMepbze08-213oaYHK9tdECbL_PC-beac30Zr-M=.p12", - "storePassword": "0000001ACBF006E31F6A97BE8F92E0311638B36873632C7D367A63AD07134E43BE21C5988031AFD69ADB" - } - } - ], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/code-linter.json5 b/CoreFile/EnvironmentSample/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/.gitignore b/CoreFile/EnvironmentSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/build-profile.json5 b/CoreFile/EnvironmentSample/entry/build-profile.json5 deleted file mode 100644 index 6bf0d132e6f78049e712446c63f2633b2d1613d3..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/hvigorfile.ts b/CoreFile/EnvironmentSample/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/obfuscation-rules.txt b/CoreFile/EnvironmentSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/EnvironmentSample/entry/oh-package.json5 b/CoreFile/EnvironmentSample/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/EnvironmentSample/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/EnvironmentSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 62f53acbc95e5be7985f8fb1fe2db591cea260bd..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/EnvironmentSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/main/ets/pages/Index.ets b/CoreFile/EnvironmentSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 9268294ac9ad7fba280bf217a5f58188619a2924..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2025 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 { Environment, fileIo as fs } from '@kit.CoreFileKit'; -import { abilityAccessCtrl, common, Permissions } from '@kit.AbilityKit'; - - -const permissions: Permissions[] = ['ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY']; - - -// [Start get_user_dir_example] -function getUserDirExample() { - try { - const downloadPath = Environment.getUserDownloadDir(); - console.info(`success to getUserDownloadDir: ${downloadPath}`); - const documentsPath = Environment.getUserDocumentDir(); - console.info(`success to getUserDocumentDir: ${documentsPath}`); - } catch (error) { - const err: BusinessError = error as BusinessError; - console.error(`failed to get user dir, Error code: ${err.code}, message: ${err.message}`); - } -} -// [End get_user_dir_example] - -// [Start read_user_download_dir_example] -function readUserDownloadDirExample(context: common.UIAbilityContext) { - try { - // 获取 Download 目录 - const downloadPath = Environment.getUserDownloadDir(); - console.info(`success to getUserDownloadDir: ${downloadPath}`); - const dirPath = context.filesDir; - console.info(`success to get filesDir: ${dirPath}`); - // 查看 Download 目录下的文件并拷贝到沙箱目录中 - let fileList: string[] = fs.listFileSync(downloadPath); - fileList.forEach((file, index) => { - console.info(`${downloadPath} ${index}: ${file}`); - if (fs.statSync(`${downloadPath}/${file}`).isFile()) { - fs.copyFileSync(`${downloadPath}/${file}`, `${dirPath}/${file}`); - } - }); - // 查看沙箱目录下对应的文件 - fileList = fs.listFileSync(dirPath); - fileList.forEach((file, index) => { - console.info(`${dirPath} ${index}: ${file}`); - }); - } catch (error) { - const err: BusinessError = error as BusinessError; - console.error(`Error code: ${err.code}, message: ${err.message}`); - } -} -// [End read_user_download_dir_example] - -// [Start write_user_download_dir_example] -function writeUserDownloadDirExample() { - // 检查是否具有 READ_WRITE_DOWNLOAD_DIRECTORY 权限,无权限则需要向用户申请授予权限。 - try { - // 获取 Download 目录 - const downloadPath = Environment.getUserDownloadDir(); - console.info(`success to getUserDownloadDir: ${downloadPath}`); - // 保存 temp.txt 到 Download 目录下 - const file = fs.openSync(`${downloadPath}/temp.txt`, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE); - fs.writeSync(file.fd, 'write a message'); - fs.closeSync(file); - } catch (error) { - const err: BusinessError = error as BusinessError; - console.error(`Error code: ${err.code}, message: ${err.message}`); - } -} -// [End write_user_download_dir_example] - -function reqPermissionsFromUser(permissions: Array, context: common.UIAbilityContext): void { - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗。 - atManager.requestPermissionsFromUser(context, permissions).then((data) => { - let grantStatus: number[] = data.authResults; - let length: number = grantStatus.length; - for (let i = 0; i < length; i++) { - if (grantStatus[i] === 0) { - // 用户授权,可以继续访问目标操作。 - } else { - // 当用户拒绝授权时,系统应提示用户必须授予相应权限才能使用当前页面的功能,并指导用户前往系统设置开启所需权限。 - return; - } - } - // 授权成功。 - }).catch((err: BusinessError) => { - console.error(`Failed to request permissions from user, code: ${err.code}, message: ${err.message}`); - }) -} - -@Entry -@Component -struct Index { - @State message: string = ''; - - aboutToAppear() { - const context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; - reqPermissionsFromUser(permissions, context); - } - - build() { - Column() { - TextArea({ - text: this.message, - placeholder: '', - }) - .width('100%') - .height('50%') - - Row() { - Button($r('app.string.getUserDirExample')) - .onClick(() => { - getUserDirExample(); - this.message += 'getUserDirExample SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.readUserDownloadDirExample')) - .onClick(async () => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - readUserDownloadDirExample(context); - this.message += 'readUserDownloadDirExample SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.writeUserDownloadDirExample')) - .onClick(async () => { - writeUserDownloadDirExample(); - this.message += 'writeUserDownloadDirExample SUCCESS' + '\n'; - }) - } - } - - } -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/main/module.json5 b/CoreFile/EnvironmentSample/entry/src/main/module.json5 deleted file mode 100644 index de3ad2d8739bc15635f82e7f6aeda79128ca6f41..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/module.json5 +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "2in1" - ], - "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": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ], - "requestPermissions":[ - { - "name" : "ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY", - "reason": "$string:reason", - "usedScene": { - "abilities": [ - "FormAbility" - ], - "when":"inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/base/element/color.json b/CoreFile/EnvironmentSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/base/element/float.json b/CoreFile/EnvironmentSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/base/element/string.json b/CoreFile/EnvironmentSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f42af7a5a4e67aa04a4711be7c59fa2ad6b75fe0..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "getUserDirExample", - "value": "获取公共目录路径" - }, - { - "name": "readUserDownloadDirExample", - "value": "访问 Download 目录下的文件" - }, - { - "name": "writeUserDownloadDirExample", - "value": "保存文件到 Download 目录" - }, - { - "name": "reason", - "value": "testEnvironmentSample" - } - ] -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/background.png b/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/foreground.png b/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/layered_image.json b/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/startIcon.png b/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/EnvironmentSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/EnvironmentSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/EnvironmentSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/EnvironmentSample/entry/src/main/resources/dark/element/color.json b/CoreFile/EnvironmentSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/mock/mock-config.json5 b/CoreFile/EnvironmentSample/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41bfdf76d6f793007240d80983a52f15f97..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/ohosTest/ets/common/Logger.ts b/CoreFile/EnvironmentSample/entry/src/ohosTest/ets/common/Logger.ts deleted file mode 100644 index 5a9cb046a71466af03fd6a64c86231711f04a534..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/ohosTest/ets/common/Logger.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -export class Logger { - private domain: number; - private prefix: string = '[Sample_NDKAppFileSample]'; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]): void { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number): void { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger('[Sample_NDKAppFileSample]'); - diff --git a/CoreFile/EnvironmentSample/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/EnvironmentSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 162c9d7bb5625db2fc98579a06cc86dd69a5caf0..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, expect, it } from '@ohos/hypium'; - -import { abilityDelegatorRegistry, Component, Driver, ON, } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import Logger from '../common/Logger'; - -const DELAY_TIME = 1500; // 延时1.5秒 -const BUNDLE = 'EnvironmentTest_'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -const abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - -async function getResourceString(resource: Resource): Promise { - let manage = abilityDelegator.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - /** - * @tc.number StartAbility_001 - * @tc.name StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - Logger.info('StartAbility_001 begin'); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - - await delegator.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - const allowButton: Component = await driver.findComponent(ON.text('允许')); - await allowButton.click(); - await driver.delayMs(DELAY_TIME); // 等待2秒,确保弹窗已显示 - - const ability: UIAbility = await delegator.getCurrentTopAbility(); - Logger.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - Logger.info('StartAbility_001 end'); - }) - - /** - * @tc.number EnvironmentTest_001 - * @tc.name EnvironmentTest_001 - * @tc.desc 获取用户 Download 目录沙箱路径 - */ - it(BUNDLE + 'environmentTest_001', 0, async () => { - Logger.info(BUNDLE + 'EnvironmentTest_001 begin'); - let str = await getResourceString($r('app.string.getUserDirExample')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'EnvironmentTest_001 end'); - }) - - /** - * @tc.number EnvironmentTest_002 - * @tc.name EnvironmentTest_002 - * @tc.desc 查看Download目录下的文件 - */ - it(BUNDLE + 'environmentTest_002', 0, async () => { - Logger.info(BUNDLE + 'EnvironmentTest_002 begin'); - let str = await getResourceString($r('app.string.readUserDownloadDirExample')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'EnvironmentTest_002 end'); - }) - - /** - * @tc.number EnvironmentTest_003 - * @tc.name EnvironmentTest_003 - * @tc.desc 保存 temp.txt 到 Download 目录 - */ - it(BUNDLE + 'environmentTest_003', 0, async () => { - Logger.info(BUNDLE + 'EnvironmentTest_003 begin'); - let str = await getResourceString($r('app.string.writeUserDownloadDirExample')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'EnvironmentTest_003 end'); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/EnvironmentSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/ohosTest/module.json5 b/CoreFile/EnvironmentSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 165771dd183970a598e3e68143e9775e81d32e12..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/EnvironmentSample/entry/src/test/List.test.ets b/CoreFile/EnvironmentSample/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/entry/src/test/LocalUnit.test.ets b/CoreFile/EnvironmentSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/hvigor/hvigor-config.json5 b/CoreFile/EnvironmentSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 7a7ab8914d8db6ab89758e185df5855dffe88d04..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/CoreFile/EnvironmentSample/hvigorfile.ts b/CoreFile/EnvironmentSample/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/oh-package.json5 b/CoreFile/EnvironmentSample/oh-package.json5 deleted file mode 100644 index 69cb43cba3addcee1840403c67405134a2a9102c..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/EnvironmentSample/ohosTest.md b/CoreFile/EnvironmentSample/ohosTest.md deleted file mode 100644 index 82d500aa22b6070d93f6e646c267d18f5c234e4f..0000000000000000000000000000000000000000 --- a/CoreFile/EnvironmentSample/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|-----------------------|-------------------------------------------------| ---- | -------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用,主页元素齐备 | 是 | Pass | -| 获取公共目录路径 | 使用PC/2in1设备 | | getUserDirExample SUCCESS | 是 | Pass | -| 访问 Download 目录下的文件 | 使用PC/2in1设备且成功获取READ_WRITE_DOWNLOAD_DIRECTORY权限 | | readUserDownloadDirExample SUCCESS | 是 | pass | -| 保存文件到 Download 目录 | PC/2in1设备且成功获取READ_WRITE_DOWNLOAD_DIRECTORY权限 | | writeUserDownloadDirExample SUCCESS | 是 | pass | \ No newline at end of file diff --git a/CoreFile/EnvironmentSample/screenshots/end.jpg b/CoreFile/EnvironmentSample/screenshots/end.jpg deleted file mode 100644 index 3d1059a475eca94e69e02c677e6047ec220aa428..0000000000000000000000000000000000000000 Binary files a/CoreFile/EnvironmentSample/screenshots/end.jpg and /dev/null differ diff --git a/CoreFile/EnvironmentSample/screenshots/start.jpg b/CoreFile/EnvironmentSample/screenshots/start.jpg deleted file mode 100644 index 1dace690a75d344e8670e59b4f927bc9c40ceed9..0000000000000000000000000000000000000000 Binary files a/CoreFile/EnvironmentSample/screenshots/start.jpg and /dev/null differ diff --git a/CoreFile/FileApiFileSample/.gitignore b/CoreFile/FileApiFileSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/FileApiFileSample/AppScope/app.json5 b/CoreFile/FileApiFileSample/AppScope/app.json5 deleted file mode 100644 index bfba1d9c16eca751e1a3d82e459c1347508bde71..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.fileapisample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/CoreFile/FileApiFileSample/AppScope/resources/base/element/string.json b/CoreFile/FileApiFileSample/AppScope/resources/base/element/string.json deleted file mode 100644 index ff11c764dd11cf430a4547d81f0d17391d69e4b5..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "FileApiSample" - } - ] -} diff --git a/CoreFile/FileApiFileSample/AppScope/resources/base/media/background.png b/CoreFile/FileApiFileSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileApiFileSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/FileApiFileSample/AppScope/resources/base/media/foreground.png b/CoreFile/FileApiFileSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileApiFileSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/FileApiFileSample/AppScope/resources/base/media/layered_image.json b/CoreFile/FileApiFileSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/README_zh.md b/CoreFile/FileApiFileSample/README_zh.md deleted file mode 100644 index 359c07698f144a62dfa1af7eb7de5770bf7b9f4b..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/README_zh.md +++ /dev/null @@ -1,73 +0,0 @@ -# 应用文件访问(ArKTS)和设置分布式文件数据等级 - -## 介绍 - -本实例主要介绍几种常用文件操作的示例,如创建、读写、删除、移动、复制、获取属性、设置数据安全等级等操作。 - - - -- [ 应用文件访问(ArkTS)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/file-management/app-file-access.md) -- [设置分布式文件数据等级 - ](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/set-security-label.md) - -## 效果预览 - -| 应用成功启动界面 | 文件访问结果 | -|---------------------------------------------------|-------------------------------------------------| -| | | - -使用说明: -1.在主界面中通过点击相应的按钮,应用可以完成相应的功能,完成的反馈将如日志的形式出现在主界面的上半部分。 - -## 工程目录 - -``` -//应用文件访问 -FileSample -├──entry/src/main -| ├──ets -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -## 具体实现 - -- 在应用开始访问文件之前,使用UIAbilityContext[获取UIAbility的上下文信息](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/application-models/uiability-usage.md),然后调用Context的相关接口获取应用的沙箱文件路径。 - -- 文件的新建、读写、内容复制、查看文件列表、文件流的使用、文件哈希流的使用的功能函数都集成在fileFs.ets文件中,源码参考:fileFs.ets。 - -- 使用fs.openSync、fs.writeSync、fs.readSync、fs.closeSync分别用来来创建文件夹、打开文件、写文件、读文件、关闭文件,文件接口请参考:[ohos.file.fs](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md) - -## 相关权限 - -无 - -## 依赖 - -不涉及 - -## 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:RK3568。 - -2.本示例为Stage模型,支持API14版本SDK,版本号:5.0.2.58,镜像版本号:OpenHarmony 5.0.2.58。 - -3.本示例需要使用DevEco Studio 6.0.0 Release (构建版本:6.0.0.858,构建 2025年9月24日)及以上版本才可编译运行。 - -## 下载 - -如需单独下载本工程,执行如下命令 - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/FileAilFileSample > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` - diff --git a/CoreFile/FileApiFileSample/build-profile.json5 b/CoreFile/FileApiFileSample/build-profile.json5 deleted file mode 100644 index cb826b1b4ce61bf1593691da3a1795d3d2a3a853..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/build-profile.json5 +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - { - "name": "default", - "type": "HarmonyOS", - "material": { - "certpath": "C:\\Users\\X30060367\\.ohos\\config\\default_FileApiSample_QfzXgV_Y3xFRfKAEcaT_9Q9iRSbDymvmAA1_w5yLeWA=.cer", - "keyAlias": "debugKey", - "keyPassword": "0000001A79A2DDD805AC5023344FB4C0AB70749CC203482499E85D7F91AD50A887A7BA572B5254A79092", - "profile": "C:\\Users\\X30060367\\.ohos\\config\\default_FileApiSample_QfzXgV_Y3xFRfKAEcaT_9Q9iRSbDymvmAA1_w5yLeWA=.p7b", - "signAlg": "SHA256withECDSA", - "storeFile": "C:\\Users\\X30060367\\.ohos\\config\\default_FileApiSample_QfzXgV_Y3xFRfKAEcaT_9Q9iRSbDymvmAA1_w5yLeWA=.p12", - "storePassword": "0000001AEB875E4AEE3390DB0C17454395B9BBEB0F5C87CD35513DDB5CA0443F68C2835892016F95477F" - } - } - ], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/code-linter.json5 b/CoreFile/FileApiFileSample/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/.gitignore b/CoreFile/FileApiFileSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/build-profile.json5 b/CoreFile/FileApiFileSample/entry/build-profile.json5 deleted file mode 100644 index 6bf0d132e6f78049e712446c63f2633b2d1613d3..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/hvigorfile.ts b/CoreFile/FileApiFileSample/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/obfuscation-rules.txt b/CoreFile/FileApiFileSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/FileApiFileSample/entry/oh-package.json5 b/CoreFile/FileApiFileSample/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/FileApiFileSample/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/FileApiFileSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 69106a80a7b6d4e7fac59c4c20319197f4513bf5..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/FileApiFileSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/main/ets/pages/Index.ets b/CoreFile/FileApiFileSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0690ac9a3872ffaed60d31e19b4c066b4f8314e4..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright (c) 2025 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 { fileIo as fs, hash, ListFileOptions, ReadOptions, securityLabel, WriteOptions } from '@kit.CoreFileKit'; -import { common } from '@kit.AbilityKit'; -import { buffer } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -// [Start create_and_read_File] -function createFile(context: common.UIAbilityContext): void { - let filesDir = context.filesDir; - // 文件不存在时创建并打开文件,文件存在时打开文件 - let file = fs.openSync(filesDir + '/test.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - // 写入一段内容至文件 - let writeLen = fs.writeSync(file.fd, 'Try to write str.'); - console.info('The length of str is: ' + writeLen); - // 创建一个大小为1024字节的ArrayBuffer对象,用于存储从文件中读取的数据 - let arrayBuffer = new ArrayBuffer(1024); - // 设置读取的偏移量和长度 - let readOptions: ReadOptions = { - offset: 0, - length: arrayBuffer.byteLength - }; - // 读取文件内容到ArrayBuffer对象中,并返回实际读取的字节数 - let readLen = fs.readSync(file.fd, arrayBuffer, readOptions); - // 将ArrayBuffer对象转换为Buffer对象,并转换为字符串输出 - let buf = buffer.from(arrayBuffer, 0, readLen); - console.info('the content of file: ' + buf.toString()); - // 关闭文件 - fs.closeSync(file); -} -// [End create_and_read_File] - -// [Start read_write_file] -function readWriteFile(context: common.UIAbilityContext): void { - let filesDir = context.filesDir; - // 打开文件 - let srcFile = fs.openSync(filesDir + '/test.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - let destFile = fs.openSync(filesDir + '/destFile.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - // 读取源文件内容并写入至目的文件 - let bufSize = 4096; - let readSize = 0; - let buf = new ArrayBuffer(bufSize); - let readOptions: ReadOptions = { - offset: readSize, - length: bufSize - }; - let readLen = fs.readSync(srcFile.fd, buf, readOptions); - while (readLen > 0) { - readSize += readLen; - let writeOptions: WriteOptions = { - length: readLen - }; - fs.writeSync(destFile.fd, buf, writeOptions); - readOptions.offset = readSize; - readLen = fs.readSync(srcFile.fd, buf, readOptions); - } - // 关闭文件 - fs.closeSync(srcFile); - fs.closeSync(destFile); -} -// [End read_write_file] - -// [Start read_write_file_with_stream] -async function readWriteFileWithStream(context: common.UIAbilityContext): Promise { - let filesDir = context.filesDir; - // 创建并打开输入文件流 - let inputStream = fs.createStreamSync(filesDir + '/test.txt', 'r+'); - // 创建并打开输出文件流 - let outputStream = fs.createStreamSync(filesDir + '/destFile.txt', 'w+'); - - let bufSize = 4096; - let readSize = 0; - let buf = new ArrayBuffer(bufSize); - let readOptions: ReadOptions = { - offset: readSize, - length: bufSize - }; - // 以流的形式读取源文件内容并写入到目标文件 - let readLen = await inputStream.read(buf, readOptions); - readSize += readLen; - while (readLen > 0) { - const writeBuf = readLen < bufSize ? buf.slice(0, readLen) : buf; - await outputStream.write(writeBuf); - readOptions.offset = readSize; - readLen = await inputStream.read(buf, readOptions); - readSize += readLen; - } - // 关闭文件流 - inputStream.closeSync(); - outputStream.closeSync(); -} -// [End read_write_file_with_stream] - -// 查看文件列表 -// [Start get_list_file] -function getListFile(context: common.UIAbilityContext): void { - let listFileOption: ListFileOptions = { - recursion: false, - listNum: 0, - filter: { - suffix: ['.png', '.jpg', '.txt'], - displayName: ['test*'], - fileSizeOver: 0, - lastModifiedAfter: new Date(0).getTime() - } - }; - let filesDir = context.filesDir; - let files = fs.listFileSync(filesDir, listFileOption); - for (let i = 0; i < files.length; i++) { - console.info(`The name of file: ${files[i]}`); - } -} -// [End get_list_file] - -// [Start copy_file_with_readable] -function copyFileWithReadable(context: common.UIAbilityContext): void { - let filesDir = context.filesDir; - // 创建文件可读流 - const rs = fs.createReadStream(`${filesDir}/test.txt`); - // 创建文件可写流 - const ws = fs.createWriteStream(`${filesDir}/destFile.txt`); - // 暂停模式拷贝文件。在拷贝数据时,将原始数据暂停,然后将数据复制到另一个位置,适用于对数据完整性和一致性要求较高的场景 - rs.on('readable', () => { - const data = rs.read(); - if (!data) { - return; - } - ws.write(data); - }); -} -// [End copy_file_with_readable] - -// [Start copy_file_with_data] -function copyFileWithData(context: common.UIAbilityContext): void { - let filesDir = context.filesDir; - // 创建文件可读流 - const rs = fs.createReadStream(`${filesDir}/test.txt`); - // 创建文件可写流 - const ws = fs.createWriteStream(`${filesDir}/destFile.txt`); - // 流动模式拷贝文件。数据的读取和写入是同时进行的,不需要暂停原始数据的访问,适用于对数据实时性要求较高的场景 - rs.on('data', (emitData) => { - const data = emitData?.data; - if (!data) { - return; - } - ws.write(data as Uint8Array); - }); -} -// [End copy_file_with_data] - -// [Start hash_file_with_stream] -function hashFileWithStream(context: common.UIAbilityContext) { - let filesDir = context.filesDir; - const filePath = `${filesDir}/test.txt`; - // 创建文件可读流 - const rs = fs.createReadStream(filePath); - // 创建哈希流 - const hs = hash.createHash('sha256'); - rs.on('data', (emitData) => { - const data = emitData?.data; - hs.update(new Uint8Array(data?.split('').map((x: string) => x.charCodeAt(0))).buffer); - }); - rs.on('close', async () => { - const hashResult = hs.digest(); - const fileHash = await hash.hash(filePath, 'sha256'); - console.info(`hashResult: ${hashResult}, fileHash: ${fileHash}`); - }); -} -// [End hash_file_with_stream] - -@Entry -@Component -struct Index { - @State message: string = ''; - - build() { - Column() { - TextArea({ - text: this.message, - placeholder: '', - }) - .width('100%') - .height('50%') - - Row() { - Button($r('app.string.createFile')) - .onClick(() => { - // 请在组件内获取context,确保this.getUIContext().getHostContext()返回结果为UIAbilityContext - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - createFile(context); - this.message += 'createFile SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.readWriteFile')) - .onClick(async () => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - readWriteFile(context); - this.message += 'readWriteFile SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.readWriteFileWithStream')) - .onClick(async () => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - readWriteFileWithStream(context); - this.message += 'readWriteFileWithStream SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.getListFile')) - .onClick(async () => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - getListFile(context); - this.message += 'getListFile SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.copyFileWithReadable')) - .onClick(async () => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - copyFileWithReadable(context); - this.message += 'copyFileWithReadable SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.copyFileWithData')) - .onClick(async () => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - copyFileWithData(context); - this.message += 'copyFileWithData SUCCESS' + '\n'; - }) - } - Row() { - Button($r('app.string.hashFileWithStream')) - .onClick(async () => { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - hashFileWithStream(context); - this.message += 'hashFileWithStream SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.setSecurityLabel')) - .onClick(async () => { - // [Start set_security_label] - // 获取需要设备数据等级的文件沙箱路径,请在组件内获取context,确保this.getUIContext().getHostContext()返回结果为UIAbilityContext - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - let pathDir = context.filesDir; - let filePath = pathDir + '/test.txt'; - - //打开文件 - let file = fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - // 设置文件的数据等级为s0 - securityLabel.setSecurityLabel(filePath, 's0').then(() => { - console.info('Succeeded in setSecurityLabeling.'); - fs.closeSync(file); - }).catch((err: BusinessError) => { - console.error(`Failed to setSecurityLabel. Code: ${err.code}, message: ${err.message}`); - }); - // [End set_security_label] - this.message += 'GetUserDocumentDirPathExample SUCCESS' + '\n'; - }) - } - - } - } -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/main/module.json5 b/CoreFile/FileApiFileSample/entry/src/main/module.json5 deleted file mode 100644 index 25148c9e0e582c3ed037ae97ca8fad095ec7adb8..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone" - ], - "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": [ - "ohos.want.action.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/CoreFile/FileApiFileSample/entry/src/main/resources/base/element/color.json b/CoreFile/FileApiFileSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/main/resources/base/element/float.json b/CoreFile/FileApiFileSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/CoreFile/FileApiFileSample/entry/src/main/resources/base/element/string.json b/CoreFile/FileApiFileSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 2307a48e0f45e468d87bdb009b436b8c122491ef..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "createFile", - "value": "新建并读写一个文件" - }, - { - "name": "readWriteFile", - "value": "读取文件内容并写入到另一个文件" - }, - { - "name": "readWriteFileWithStream", - "value": "以流的形式读写文件" - }, - { - "name": "getListFile", - "value": "查看文件列表" - }, - { - "name": "copyFileWithReadable", - "value": "使用文件流暂停模式拷贝文件" - }, - { - "name": "copyFileWithData", - "value": "使用文件流流动模式拷贝文件" - }, - { - "name": "hashFileWithStream", - "value": "使用文件哈希流" - }, - { - "name": "setSecurityLabel", - "value": "设置分布式文件数据等级" - } - - - - ] -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/background.png b/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/foreground.png b/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/layered_image.json b/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/startIcon.png b/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileApiFileSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/FileApiFileSample/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/FileApiFileSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/FileApiFileSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/FileApiFileSample/entry/src/main/resources/dark/element/color.json b/CoreFile/FileApiFileSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/ohosTest/ets/common/Logger.ts b/CoreFile/FileApiFileSample/entry/src/ohosTest/ets/common/Logger.ts deleted file mode 100644 index be7d6b71dc6bad19de7a6286772b1fd15d052c0d..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/ohosTest/ets/common/Logger.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -export class Logger { - private domain: number; - private prefix: string = '[FileApiFileSample]'; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]): void { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number): void { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger('[FileApiFileSample]'); - diff --git a/CoreFile/FileApiFileSample/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/FileApiFileSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 26ff192ffe95a964b4a43ee5d50d1de056fb5256..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, expect, it } from '@ohos/hypium'; - -import { abilityDelegatorRegistry, Component, Driver, ON, } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import Logger from '../common/Logger'; - -const DELAY_TIME = 1500; // 延时1.5秒 -const BUNDLE = 'FileApiFileTest_'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -const abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - -async function getResourceString(resource: Resource): Promise { - let manage = abilityDelegator.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - /** - * @tc.number StartAbility_001 - * @tc.name StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - Logger.info('StartAbility_001 begin'); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - - await delegator.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - Logger.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - Logger.info('StartAbility_001 end'); - }) - - /** - * @tc.number FileApiFileTest_001 - * @tc.name FileApiFileTest_001 - * @tc.desc 设置分布式文件数据等级 - */ - it(BUNDLE + 'FileApiFileTest_001', 0, async () => { - Logger.info(BUNDLE + 'FileApiFileTest_001 begin'); - let str = await getResourceString($r('app.string.setSecurityLabel')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'FileApiFileTest_001 End'); - }) - - /** - * @tc.number FileApiFileTest_002 - * @tc.name FileApiFileTest_002 - * @tc.desc 新建并读写一个文件 - */ - it(BUNDLE + 'FileApiFileTest_002', 0, async () => { - Logger.info(BUNDLE + 'EnvironmentTest_002 begin'); - let str = await getResourceString($r('app.string.createFile')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'FileApiFileTest_002 end'); - }) - - /** - * @tc.number FileApiFileTest_003 - * @tc.name FileApiFileTest_003 - * @tc.desc 读取文件内容并写入到另一个文件 - */ - it(BUNDLE + 'FileApiFileTest_003', 0, async () => { - Logger.info(BUNDLE + 'FileApiFileTest_003 begin'); - let str = await getResourceString($r('app.string.readWriteFile')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'FileApiFileTest_003 end'); - }) - - - /** - * @tc.number FileApiFileTest_004 - * @tc.name FileApiFileTest_004 - * @tc.desc 以流的形式读写文件 - */ - it(BUNDLE + 'FileApiFileTest_004', 0, async () => { - Logger.info(BUNDLE + 'FileApiFileTest_004 begin'); - let str = await getResourceString($r('app.string.readWriteFileWithStream')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'FileApiFileTest_004 end'); - }) - - - /** - * @tc.number FileApiFileTest_005 - * @tc.name FileApiFileTest_005 - * @tc.desc 查看文件列表 - */ - it(BUNDLE + 'FileApiFileTest_005', 0, async () => { - Logger.info(BUNDLE + 'FileApiFileTest_005 begin'); - let str = await getResourceString($r('app.string.getListFile')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'FileApiFileTest_005 end'); - }) - - /** - * @tc.number FileApiFileTest_006 - * @tc.name FileApiFileTest_006 - * @tc.desc 使用文件流暂停模式拷贝文件 - */ - it(BUNDLE + 'FileApiFileTest_006', 0, async () => { - Logger.info(BUNDLE + 'FileApiFileTest_006 begin'); - let str = await getResourceString($r('app.string.copyFileWithReadable')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'FileApiFileTest_006 end'); - }) - - /** - * @tc.number FileApiFileTest_007 - * @tc.name FileApiFileTest_007 - * @tc.desc 使用文件流流动模式拷贝文件 - */ - it(BUNDLE + 'FileApiFileTest_007', 0, async () => { - Logger.info(BUNDLE + 'FileApiFileTest_007 begin'); - let str = await getResourceString($r('app.string.copyFileWithData')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'FileApiFileTest_007 end'); - }) - - /** - * @tc.number FileApiFileTest_008 - * @tc.name FileApiFileTest_008 - * @tc.desc 使用文件哈希流 - */ - it(BUNDLE + 'FileApiFileTest_008', 0, async () => { - Logger.info(BUNDLE + 'FileApiFileTest_008 begin'); - let str = await getResourceString($r('app.string.hashFileWithStream')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'FileApiFileTest_008 end'); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/FileApiFileSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/ohosTest/module.json5 b/CoreFile/FileApiFileSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index a43680ca704ea9bf17ba9b9f88086a2735012c37..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/FileApiFileSample/entry/src/test/List.test.ets b/CoreFile/FileApiFileSample/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/entry/src/test/LocalUnit.test.ets b/CoreFile/FileApiFileSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/hvigor/hvigor-config.json5 b/CoreFile/FileApiFileSample/hvigor/hvigor-config.json5 deleted file mode 100644 index b8fea3f097bd68b0bc4d87de986d2cb7732c1d9b..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/CoreFile/FileApiFileSample/hvigorfile.ts b/CoreFile/FileApiFileSample/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/oh-package.json5 b/CoreFile/FileApiFileSample/oh-package.json5 deleted file mode 100644 index 69cb43cba3addcee1840403c67405134a2a9102c..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/FileApiFileSample/ohosTest.md b/CoreFile/FileApiFileSample/ohosTest.md deleted file mode 100644 index bcdaa493122ecc4fc90c2536fa4692c3ec66398c..0000000000000000000000000000000000000000 --- a/CoreFile/FileApiFileSample/ohosTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| --------------------- | ------------ | ------ | --------------------------- | -- | ---- | -| 新建并读写一个文件 | 设备正常运行 | | 日志中输出createFile SUCCESS | 是 | pass | -| 读取文件内容并写入到另一个文件 | 设备正常运行 | | 日志中输出readWriteFile SUCCESS | 是 | pass | -| 以流的形式读写文件 | 设备正常运行 | 文件名 | 日志中输出readWriteFileWithStream SUCCESS | 是 | pass | -| 查看文件列表 | 设备正常运行 | | 日志中输出getListFileSUCCESS | 是 | pass | -| 使用文件流暂停模式拷贝文件 | 设备正常运行 | | 日志中输出copyFileWithReadable SUCCESS | 是 | pass | -| 使用文件流流动模式拷贝文件 | 设备正常运行 | | 日志中输出copyFileWithData SUCCESS | 是 | pass | -| 使用文件哈希流 | 设备正常运行 | | 日志中输出hashFileWithStream SUCCESS| 是 | pass | -| 设置分布式文件数据等级 | 设备正常运行 | | 日志中输出setSecurityLabel SUCCESS | 是 | pass | \ No newline at end of file diff --git a/CoreFile/FileApiFileSample/screenshots/end.png b/CoreFile/FileApiFileSample/screenshots/end.png deleted file mode 100644 index 369d4e0bdd32efaa004a624142590164068ff877..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileApiFileSample/screenshots/end.png and /dev/null differ diff --git a/CoreFile/FileApiFileSample/screenshots/start.png b/CoreFile/FileApiFileSample/screenshots/start.png deleted file mode 100644 index 2625bdc84bff5826626ac2e85517ad20f39013c4..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileApiFileSample/screenshots/start.png and /dev/null differ diff --git a/CoreFile/FileBackupExtension/.gitignore b/CoreFile/FileBackupExtension/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/FileBackupExtension/AppScope/app.json5 b/CoreFile/FileBackupExtension/AppScope/app.json5 deleted file mode 100644 index 08891bc0f14caa41b0f16ec8621248b1d8942036..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.filebackupextension", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/CoreFile/FileBackupExtension/AppScope/resources/base/element/string.json b/CoreFile/FileBackupExtension/AppScope/resources/base/element/string.json deleted file mode 100644 index 57edf168387dd07561e5d29380f455d62df5a64b..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "FileBackupExtension" - } - ] -} diff --git a/CoreFile/FileBackupExtension/AppScope/resources/base/media/app_icon.png b/CoreFile/FileBackupExtension/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileBackupExtension/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/CoreFile/FileBackupExtension/README_zh.md b/CoreFile/FileBackupExtension/README_zh.md deleted file mode 100644 index 95be0da42250df1b758d8c67db502fbbfc5a2184..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/README_zh.md +++ /dev/null @@ -1,72 +0,0 @@ -# 应用接入数据备份恢复 - -## 介绍 - -应用接入数据备份恢复需要通过配置BackupExtensionAbility实现。 - -BackupExtensionAbility,是[Stage模型](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/application-models/stage-model-development-overview.md)模型中扩展组件[ ExtensionAbility](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/application-models/extensionability-overview.md)的派生类。开发者可以通过修改配置文件定制备份恢复框架的行为,包括是否允许备份恢复,备份哪些文件等。 - -本sample主要给备份恢复服务提供应用,用于生成数据、删除数据和备份恢复后显示数据。该工程中展示的代码详细描述可查如下链接。 - -- [应用接入数据备份恢复](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/file-management/app-file-backup-extension.md) - -## 效果预览 - -| 初始界面 | 文件创建 | 文件删除 | 文件恢复后显示 | -| -------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------- | -| | | | | - -使用说明: - -1. 点击按钮“文件创建”,应用会生成5个txt文件,大小在1Byte到1024Byte之间,用于校验备份和恢复的数据为同一数据。 -2. 本应用仅适用于生成和显示数据,具体的备份和恢复的操作需要另外的应用AppFileBackup来执行。 -3. 按钮“文件删除”操作用户在备份恢复的测试验证过程中删除文件。 - -## 工程目录 -``` -entry/src/main/ets/ -|---Application -|---Common -| |---Logger.ts // 日志工具 -| |---BackupExtension.ets // 备份恢复类 -|---entruability -| |---EntryAbility.ts // Ability类 -|---entrybackability -| |---EntryBackupAbility.ts -|---fileFs -| |---CreateFile.ts // 文件的创建和删除封装 -|---pages -| |---Index.ets // 首页 -``` -## 具体实现 - -1. 备份恢复框架的开发步骤,请参考介绍中应用接入数据备份恢复链接。 -1. 应用封装CreateFile类,其中包含个函数,用于文件的创建和删除,具体代码实现请参考:CreateFile.ets。 - -## 相关权限 - -无 - -## 依赖 - -该应用为备份恢复服务的框架实现,仅进行文件的创建和删除,不涉及备份和恢复的具体流程,数据文件的备份和恢复依赖于AppFileBackup应用。 - -## 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:RK3568。 - -2.本示例为Stage模型,支持API14版本SDK,版本号:5.0.2.58,镜像版本号:OpenHarmony 5.0.2.58。 - -3.本示例需要使用DevEco Studio 5. 1Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 - -## 下载 - -如需单独下载本工程,执行如下命令: -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/FileBackupExtension > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master - -``` diff --git a/CoreFile/FileBackupExtension/build-profile.json5 b/CoreFile/FileBackupExtension/build-profile.json5 deleted file mode 100644 index ae72b4037b4c92c08124fb46e0245b96e70e029f..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "5.0.2(14)", - "targetSdkVersion": "5.0.2(14)", - "compatibleSdkVersion": "5.0.2(14)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/code-linter.json5 b/CoreFile/FileBackupExtension/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/.gitignore b/CoreFile/FileBackupExtension/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/build-profile.json5 b/CoreFile/FileBackupExtension/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/hvigorfile.ts b/CoreFile/FileBackupExtension/entry/hvigorfile.ts deleted file mode 100644 index a3d28cb60475cede46d0aa36973096d5544dbcd1..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/FileBackupExtension/entry/obfuscation-rules.txt b/CoreFile/FileBackupExtension/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/FileBackupExtension/entry/oh-package.json5 b/CoreFile/FileBackupExtension/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/FileBackupExtension/entry/src/main/ets/common/BackupExtension.ets b/CoreFile/FileBackupExtension/entry/src/main/ets/common/BackupExtension.ets deleted file mode 100644 index ea45e99c5bf37c2b2a2e967c95fc6839a00fbd8c..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/ets/common/BackupExtension.ets +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start on_backup_restore] -// [Start on_release] -import { BackupExtensionAbility } from '@kit.CoreFileKit'; -// [StartExclude on_release] -import { BundleVersion } from '@kit.CoreFileKit'; -// [EndExclude on_release] -// [StartExclude on_backup_restore] -import { fileIo } from '@kit.CoreFileKit'; -// [EndExclude on_backup_restore] - -// [StartExclude on_release] -interface ErrorInfo { - type: string, - errorCode: number, - errorInfo: string -} -// [EndExclude on_release] - -// [StartExclude on_backup_restore] -const SCENARIO_BACKUP: number = 1; -const SCENARIO_RESTORE: number = 2; -// 需要清理的临时目录 -let filePath: string = '/data/storage/el2/base/.temp/'; -// [EndExclude on_backup_restore] - -class BackupExt extends BackupExtensionAbility { - // [StartExclude on_release] - //onBackupEx - async onBackupEx(backupInfo: string): Promise { - console.info('onBackupEx ok'); - let errorInfo: ErrorInfo = { - type: 'ErrorInfo', - errorCode: 0, - errorInfo: 'app diy error info' - } - return JSON.stringify(errorInfo); - } - - // onRestoreEx - async onRestoreEx(bundleVersion : BundleVersion, restoreInfo: string): Promise { - console.info(`onRestoreEx begin`); - let errorInfo: ErrorInfo = { - type: 'ErrorInfo', - errorCode: 0, - errorInfo: 'app diy error info' - } - return JSON.stringify(errorInfo); - } - // [EndExclude on_release] - // [StartExclude on_backup_restore] - // onRelease - async onRelease(scenario: number): Promise { - try { - if (scenario == SCENARIO_BACKUP) { - // 备份场景,应用自行实现处理,以清理备份产生的临时文件为例 - console.info(`onRelease begin`); - await fileIo.rmdir(filePath); - console.info(`onRelease end, rmdir succeed`); - } - if (scenario == SCENARIO_RESTORE) { - // 恢复场景,应用自行实现处理,以清理恢复产生的临时文件为例 - console.info(`onRelease begin`); - await fileIo.rmdir(filePath); - console.info(`onRelease end, rmdir succeed`); - } - } catch (error) { - console.error(`onRelease failed with error. Code: ${error.code}, message: ${error.message}`); - } - } - // [EndExclude on_backup_restore] -} -// [End on_backup_restore] -// [End on_release] diff --git a/CoreFile/FileBackupExtension/entry/src/main/ets/common/Logger.ts b/CoreFile/FileBackupExtension/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index fbf4ecb0c07cea0cdd0a221849791c22de1a4976..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -export class Logger { - private domain: number; - private prefix: string = '[Sample_FileBackupExtension]'; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0x0000; // 应用的编码 - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]): void { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number): void { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger('[Sample_FileBackupExtension]'); - diff --git a/CoreFile/FileBackupExtension/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/FileBackupExtension/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index edc2839f203ba057c186e19b0cbbbf80c8faa8b3..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/FileBackupExtension/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 9d95efb9994d951c12095d77bdf91811e77a6adc..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start backup_sample] -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)); - } -} -// [End backup_sample] \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/main/ets/fileFs/CreateFile.ts b/CoreFile/FileBackupExtension/entry/src/main/ets/fileFs/CreateFile.ts deleted file mode 100644 index fc6aafa4649a292243bab89797f00e78a2a8017c..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/ets/fileFs/CreateFile.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2025 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 Logger from '../common/Logger'; -import { fileIo as fs } from '@kit.CoreFileKit'; -import { BusinessError } from '@ohos.base'; - -const ONE_KILOBYTE: number = 1024; // 1k = 1024B -const FILE_NUM: number = 5; // 创建文件的数量 - -export default class CreatFile { - baseDir: string = AppStorage.get('sanBoxFileDir') + '/TextDir'; - - constructor() { - } - - async createTestFiles(filePath: string): Promise { - try { - let num = FILE_NUM; - if (!fs.accessSync(filePath)) { - fs.mkdirSync(filePath); - } - let dpath = filePath; - Logger.info('sanBoxFileDir = ' + dpath); - Logger.info('num is = ' + num); - for (let i = 0; i < num; i++) { - let myFile = dpath + `/TestFile_${i}.txt`; - Logger.info('readyFile myFile = ' + myFile); - let file = fs.openSync(myFile, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE); - fs.writeSync(file.fd, new ArrayBuffer(ONE_KILOBYTE * Math.random())); - fs.closeSync(file); - } - } catch (err) { - let error: BusinessError = err as BusinessError; - Logger.error('Failed to prepare media files, error:' + error.message + error.code); - } - } - - async deleteTestFiles(filePath: string): Promise { - try { - let num = FILE_NUM; - if (!fs.accessSync(filePath)) { - fs.mkdirSync(filePath); - } - let dpath = filePath; - Logger.info('sanBoxFileDir = ' + dpath); - Logger.info('num is = ' + num); - for (let i = 0; i < num; i++) { - let myFile = dpath + `/TestFile_${i}.txt`; - fs.unlink(myFile).then(() => { - Logger.info('remove file succeed'); - }).catch((err: BusinessError) => { - Logger.error('remove file failed with error message: ' + err.message + err.code); - }); - } - } catch (err) { - let error: BusinessError = err as BusinessError; - Logger.error('Failed to prepare media files, error:' + error.message + error.code); - } - } -} - - diff --git a/CoreFile/FileBackupExtension/entry/src/main/ets/pages/Index.ets b/CoreFile/FileBackupExtension/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index c828e1b00a90a2608643f6dcb507ad46ae378091..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2025 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 CreateFile from '../fileFs/CreateFile'; -import Logger from '../common/Logger'; -import fs from '@ohos.file.fs'; -import { common } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -let context = getContext(this) as common.UIAbilityContext; -let filesDir = context.filesDir; -let countFile = 0; // 文件数量计数初始化 - -@Entry -@Component -struct BackupExample { - createFile = new CreateFile(); - baseDir: string = filesDir; - @State filePathSize: Array = []; - @State showFilePath: Array = []; - - onPageShow() { - try { - if (!fs.accessSync(this.baseDir)) { - fs.mkdirSync(this.baseDir); - // 数组初始化 - this.showFilePath[0] = ''; - this.filePathSize[0] = ''; - return; - } - Logger.info(`readyFileToFileFs successful`); - } catch (e) { - let error: BusinessError = e as BusinessError; - Logger.error(`readyFileToFileFs has failed for: {message: ${error.message}, code: ${error.code}}`); - } - let filenames = fs.listFileSync(this.baseDir); - countFile = filenames.length; - for (let i = 0; i < filenames.length; i++) { - Logger.info('filename:' + filenames[i]); - this.showFilePath[i] = filenames[i]; - let filePath = this.baseDir + '/' + filenames[i]; - this.filePathSize[i] = fs.statSync(filePath).size.toString() + 'Byte'; - Logger.info('arrayFilename: ' + i + this.showFilePath[i].toString()); - } - } - - build() { - Column() { - Text($r('app.string.FileData')) - .fontSize(14) - .fontColor($r('sys.color.font_primary')) - .margin({ top: 8, left: 48, bottom: 8 }) - .id('fileData') - .opacity(0.6) - .align(Alignment.TopStart) - .width('93%') - List({ space: 10, initialIndex: 0 }) { - ForEach(this.showFilePath, (item: string, index?: number) => { - ListItem() { - Column() { - Row() { - Text(' ' + item) - .fontSize(16) - .fontColor($r('sys.color.black')) - .width('70%') - .textAlign(TextAlign.Start) - .fontWeight(500) - .margin({ left: 20 }) - .id('file' + index) - if (index !== undefined) { - Text(this.filePathSize[index]) - .fontSize(14) - .width('20%') - .textAlign(TextAlign.End) - .fontColor($r('sys.color.black')) - .fontWeight(400) - .margin({ right: 16 }) - .opacity(0.6) - .id('size' + index) - } - } - .width('100%') - .height(56) - - if (this.showFilePath[0] !== '') { - Divider() - .strokeWidth('1vp') - .color($r('sys.color.black')) - .opacity(0.05) - .margin({ left: 24, right: 24 }) - .width('90%') - } - } - .width('100%') - } - }, (item: string) => item) - } - .height('80%') - .width('93%') - .borderRadius(24) - .backgroundColor(0xFFFFFF) - .align(Alignment.Center) - - Row() { - Button($r('app.string.CreateFiles')) - .id('createFiles') - .backgroundColor($r('sys.color.brand')) - .margin(15) - .width('35%') - .borderRadius(20) - .onClick(async () => { - await this.createFile.createTestFiles(this.baseDir); - this.onPageShow(); - }) - Button($r('app.string.FileDelete')) - .backgroundColor($r('sys.color.brand')) - .margin(15) - .width('35%') - .borderRadius(20) - .onClick(async () => { - await this.createFile.deleteTestFiles(this.baseDir); - for (let i = 0; i < countFile; i++) { - this.showFilePath[i] = ''; - } - }) - } - } - .width('100%') - .height('100%') - .backgroundColor('#F1F3F5') - } -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/main/module.json5 b/CoreFile/FileBackupExtension/entry/src/main/module.json5 deleted file mode 100644 index f683de16b7ab74290fce217fea27538e3170447b..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/module.json5 +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2025 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" - ] - } - ], - "permissions": [ - ] - } - ], - // [Start extension_abilities] - "extensionAbilities": [ - { - "name": "BackupExtension", - "srcEntry": "./ets/common/BackupExtension.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ] - } - ] - // [End extension_abilities] - } -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/main/resources/base/element/color.json b/CoreFile/FileBackupExtension/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/main/resources/base/element/string.json b/CoreFile/FileBackupExtension/entry/src/main/resources/base/element/string.json deleted file mode 100644 index c3f27a70fcfacd862b66e5f8712545f3275ae0ec..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "FileBackup" - }, - { - "name": "CreateFiles", - "value": "文件创建" - }, - { - "name": "FileData", - "value": "文件数据" - }, - { - "name": "FilelistWaitingToBeGenerated", - "value": "文件列表正在生成" - }, - { - "name": "FileDelete", - "value": "文件删除" - } - ] -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/background.png b/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/foreground.png b/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/layered_image.json b/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/startIcon.png b/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileBackupExtension/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/FileBackupExtension/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/FileBackupExtension/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 8c0d561a7345eca6f6c09a118983d0d9e67becf5..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "allowToBackupRestore": true, - "includes": [ - "data/storage/el2/base/haps/*/files/" - ], - "excludes": [ - "" - ], - "fullBackupOnly": false, - "restoreDeps": "" -} diff --git a/CoreFile/FileBackupExtension/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/FileBackupExtension/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/FileBackupExtension/entry/src/main/resources/dark/element/color.json b/CoreFile/FileBackupExtension/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/mock/mock-config.json5 b/CoreFile/FileBackupExtension/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/FileBackupExtension/entry/src/ohosTest/ets/test/Index.test.ets b/CoreFile/FileBackupExtension/entry/src/ohosTest/ets/test/Index.test.ets deleted file mode 100644 index 08c87e09a68dffe7f2027022f38f19e6c5f2ec2c..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/ohosTest/ets/test/Index.test.ets +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium'; -import { Driver, ON, Component, abilityDelegatorRegistry } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const DELAY_TIME = 1200; // 延时1.2秒 -const TAG = '[Sample_FileBackupExtension]'; -const DOMAIN = 0xF811; -const BUNDLE = 'FileBackupExtension_'; - -const DELEGATOR = abilityDelegatorRegistry.getAbilityDelegator(); -const BUNDLENAME = abilityDelegatorRegistry.getArguments().bundleName; -const ABILITYDELEGATOR = abilityDelegatorRegistry.getAbilityDelegator(); - -async function getResourceString(resource: Resource): Promise { - let manage = ABILITYDELEGATOR.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function IndexTest() { - describe('IndexTest', () => { - /** - * @tc.number StartAbility_001 - * @tc.name StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 begin'); - // start tested ability - const want: Want = { - bundleName: BUNDLENAME, - abilityName: 'EntryAbility' - }; - await DELEGATOR.startAbility(want); - // check top display ability - const ability: UIAbility = await DELEGATOR.getCurrentTopAbility(); - hilog.info(DOMAIN, TAG, BUNDLE + 'get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('TestAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 end'); - }) - /** - * @tc.number FileBackupExtension_001 - * @tc.name FileBackupExtension_001 - * @tc.desc 文件的创建 - */ - it(BUNDLE + 'FileBackupExtension_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'FileBackupExtension_001 begin'); - let str = await getResourceString($r('app.string.CreateFiles')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - hilog.info(DOMAIN, TAG, BUNDLE + 'Create the file'); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'FileBackupExtension_001 end'); - }) - /** - * @tc.number FileBackupExtension_002 - * @tc.name FileBackupExtension_002 - * @tc.desc 文件删除 - */ - it(BUNDLE + 'FileBackupExtension_002', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'FileBackupExtension_002 begin'); - let str = await getResourceString($r('app.string.FileDelete')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - hilog.info(DOMAIN, TAG, BUNDLE + 'Delete the file'); - await button.click(); - await driver.delayMs(DELAY_TIME); - hilog.info(DOMAIN, TAG, BUNDLE + 'FileBackupExtension_002 end'); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/FileBackupExtension/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 00cfe9627bd61a31322328fd121fab7f4d2f6d64..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 IndexTest from './Index.test'; - -export default function testsuite() { - IndexTest(); -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/ohosTest/module.json5 b/CoreFile/FileBackupExtension/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/FileBackupExtension/entry/src/test/List.test.ets b/CoreFile/FileBackupExtension/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/entry/src/test/LocalUnit.test.ets b/CoreFile/FileBackupExtension/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/CoreFile/FileBackupExtension/hvigor/hvigor-config.json5 b/CoreFile/FileBackupExtension/hvigor/hvigor-config.json5 deleted file mode 100644 index d584c19c247db9a7caee4b606bb931aa9279c637..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/CoreFile/FileBackupExtension/hvigorfile.ts b/CoreFile/FileBackupExtension/hvigorfile.ts deleted file mode 100644 index 4beb74fe5b573059b972acf9312d33ea1703c016..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/FileBackupExtension/oh-package.json5 b/CoreFile/FileBackupExtension/oh-package.json5 deleted file mode 100644 index 9b142d655b140175b33fe2a0c804ca498119f87f..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/FileBackupExtension/ohosTest.md b/CoreFile/FileBackupExtension/ohosTest.md deleted file mode 100644 index 5bfa93327d5ba626833fd473c94994ca758745a6..0000000000000000000000000000000000000000 --- a/CoreFile/FileBackupExtension/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| -------- | ---------------- | ---- | -------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | \ | 应用被拉起 | 是 | pass | -| 文件创建 | 应用被拉起 | \ | 输出创建的文件 | 是 | pass | -| 文件删除 | 文件已经成功创建 | \ | 文件被删除 | 是 | pass | - diff --git a/CoreFile/FileBackupExtension/screenshots/fileCreate.jpg b/CoreFile/FileBackupExtension/screenshots/fileCreate.jpg deleted file mode 100644 index 3cf78db1bf3eedf3d0a5abc40e8a94346d5bbc55..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileBackupExtension/screenshots/fileCreate.jpg and /dev/null differ diff --git a/CoreFile/FileBackupExtension/screenshots/fileDelete.jpg b/CoreFile/FileBackupExtension/screenshots/fileDelete.jpg deleted file mode 100644 index 69661629a3143f1ece356f07943eaa7e528f1260..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileBackupExtension/screenshots/fileDelete.jpg and /dev/null differ diff --git a/CoreFile/FileBackupExtension/screenshots/fileRestore.jpg b/CoreFile/FileBackupExtension/screenshots/fileRestore.jpg deleted file mode 100644 index 3cf78db1bf3eedf3d0a5abc40e8a94346d5bbc55..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileBackupExtension/screenshots/fileRestore.jpg and /dev/null differ diff --git a/CoreFile/FileBackupExtension/screenshots/start.jpg b/CoreFile/FileBackupExtension/screenshots/start.jpg deleted file mode 100644 index c754711035cdae672df8e5951ffe2569aceb9577..0000000000000000000000000000000000000000 Binary files a/CoreFile/FileBackupExtension/screenshots/start.jpg and /dev/null differ diff --git a/CoreFile/NDKAppFileSample/.gitignore b/CoreFile/NDKAppFileSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/NDKAppFileSample/AppScope/app.json5 b/CoreFile/NDKAppFileSample/AppScope/app.json5 deleted file mode 100644 index 089e8345e9c895c6ae4c940f5da3da4847971c2a..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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.samples.ndkappfilesample", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/CoreFile/NDKAppFileSample/AppScope/resources/base/element/string.json b/CoreFile/NDKAppFileSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 42807f9a7ded386aef72f7d636ade1e532944576..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "NDKAppFileSample" - } - ] -} diff --git a/CoreFile/NDKAppFileSample/AppScope/resources/base/media/app_icon.png b/CoreFile/NDKAppFileSample/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKAppFileSample/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/CoreFile/NDKAppFileSample/README_zh.md b/CoreFile/NDKAppFileSample/README_zh.md deleted file mode 100644 index 6b926255e04f50fa1853693a478f14ca0c7ed51e..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/README_zh.md +++ /dev/null @@ -1,104 +0,0 @@ -# 应用文件访问(C++) - -## 介绍 - - 本实例主要实现了使用C++的方式去访问应用沙箱目录下的文件,使用接口FileManagement_ErrCode OH_FileIO_GetFileLocation(char *uri, int uriLength, FileIO_FileLocation *location),接口的详细说明请参考:FileIO。主要实现的功能是:使用文件uri作为入参,调用C语言函数去访问应用文件,并确定文件的存储位置。该工程中展示的代码详细描述可查如下链接。 - -- [应用文件访问(C/C++)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/file-management/native-fileio-guidelines.md) - -## 效果预览 - -| 应用启动界面 | 文件访问结果 | -| ------------------------------------------------- | ----------------------------------------------- | -| | | - -使用说明: - -1. 本应用主要使用napi的方式,使用C语言函数对应用的沙箱文件进行访问,可以在创建文件后向napi定义的函数传递文件的uri参数,通过uri对文件进行访问,并确定文件的存储文件是本地还是云端。 -2. 在启动应用之后,按顺序点击界面上的两个按钮,先创建文件,在对文件进行访问,通过日的反馈知道访问的结果。 - -## 工程目录 - -``` -NDKAppFileSample -├──entry/src/main -| ├──cpp -| | ├──types -| | | ├──libentry -| | | └──CMakeLists.txt // CMake脚本文件 -| | | └──napi_init.cpp // napi函数封装类 -| ├──ets -| | ├──commom -| | | ├──Logger.ts // 封装日志类 -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | ├──fileFs -| | | └──fileFs.ets // 文件创建函数封装 -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -## 具体实现 - -1. 在CMake脚本中链接动态库,即在CMakeLists.txt中添加以下lib。 - - ``` - target_link_libraries(sample PUBLIC libohfileio.so) - ``` - -2. 添加头文件 - - ``` - #include - ``` - -3. 调用OH_FileIO_GetFileLocation接口获取文件存储位置。示例代码如下所示: - - ```c - void GetFileLocationExample() { - char *uri = "file://com.example.demo/data/storage/el2/base/files/test.txt"; - FileIO_FileLocation location; - FileManagement_ErrCode ret = OH_FileIO_GetFileLocation(uri, strlen(uri), &location); - if (ret == 0) { - if (location == FileIO_FileLocation::LOCAL) { - printf("This file is on local."); - } else if (location == FileIO_FileLocation::CLOUD) { - printf("This file is on cloud."); - } else if (location == FileIO_FileLocation::LOCAL_AND_CLOUD) { - printf("This file is both on local and cloud."); - } - } else { - printf("GetFileLocation failed, error code is %d", ret); - } - } - ``` - -## 相关权限 - -无 - -## 依赖 - -不涉及 - -## 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:RK3568。 - -2.本示例为Stage模型,支持API14版本SDK,版本号:5.0.2.58,镜像版本号:OpenHarmony 5.0.2.58。 - -3.本示例需要使用DevEco Studio 5. 1Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 - -## 下载 - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/NDKAppFileSample > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` - diff --git a/CoreFile/NDKAppFileSample/build-profile.json5 b/CoreFile/NDKAppFileSample/build-profile.json5 deleted file mode 100644 index 7ec08f186136cdac941298fea102f3c996d99c89..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/build-profile.json5 +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": 20, - "compatibleSdkVersion": 20, - "runtimeOS": "OpenHarmony", - "buildOption": { - "externalNativeOptions": { - "abiFilters": [ - "arm64-v8a", - "x86_64" - ], - "abiFilters": [ - "arm64-v8a", - "x86_64", - "armeabi-v7a" - ] - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/code-linter.json5 b/CoreFile/NDKAppFileSample/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/.gitignore b/CoreFile/NDKAppFileSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/build-profile.json5 b/CoreFile/NDKAppFileSample/entry/build-profile.json5 deleted file mode 100644 index 01bed8940ff6f2d5843f8d1d7e184725f59be699..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/build-profile.json5 +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/hvigorfile.ts b/CoreFile/NDKAppFileSample/entry/hvigorfile.ts deleted file mode 100644 index a3d28cb60475cede46d0aa36973096d5544dbcd1..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/NDKAppFileSample/entry/obfuscation-rules.txt b/CoreFile/NDKAppFileSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/NDKAppFileSample/entry/oh-package.json5 b/CoreFile/NDKAppFileSample/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/cpp/CMakeLists.txt b/CoreFile/NDKAppFileSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 57d6c2cf3bb86f1612ebfdd21dcb1de6f94fb50a..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(NDKAppFileSample) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so PUBLIC libohfileio.so PUBLIC libhilog_ndk.z.so) \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/cpp/napi_init.cpp b/CoreFile/NDKAppFileSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 7de71f3e22473a1a2b614f0e1662cf0b3180724f..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include -#include "hilog/log.h" -#include - -#undef LOG_TAG -#define LOG_TAG "Sample_NDKAppFileAccess" -#include -#include - -// [Start get_file_location_example] -void GetFileLocationExample() -{ - char *uri = "file://com.example.demo/data/storage/el2/base/files/test.txt"; - FileIO_FileLocation location; - FileManagement_ErrCode ret = OH_FileIO_GetFileLocation(uri, strlen(uri), &location); - if (ret == 0) { - if (location == FileIO_FileLocation::LOCAL) { - printf("This file is on local."); - } else if (location == FileIO_FileLocation::CLOUD) { - printf("This file is on cloud."); - } else if (location == FileIO_FileLocation::LOCAL_AND_CLOUD) { - printf("This file is both on local and cloud."); - } - } else { - printf("GetFileLocation failed, error code is %d", ret); - } -} -// [End get_file_location_example] - -static napi_value GetFileLocation(napi_env env, napi_callback_info info) -{ - GetFileLocationExample(); - return nullptr; -} - -static napi_value GetFileLocationOld(napi_env env, napi_callback_info info) -{ - // [StartExclude get_file_location] - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - // 确保传入了一个参数 - if (argc < 1) { - napi_throw_error(env, nullptr, "Expected one argument"); - return nullptr; - } - // 确保传入的是字符串 - napi_valuetype valuetype; - napi_typeof(env, args[0], &valuetype); - if (valuetype != napi_string) { - napi_throw_error(env, nullptr, "Argument should be a string"); - return nullptr; - } - // 获取字符串的长度 - size_t strLength = 0; - napi_get_value_string_utf8(env, args[0], nullptr, 0, &strLength); - // [EndExclude get_file_location] - // 为 char* uri 分配内存 - char *uri = new char[strLength + 1]; // +1 for null terminator - // 将 JavaScript 字符串复制到 uri - // [StartExclude get_file_location] - napi_get_value_string_utf8(env, args[0], uri, strLength + 1, &strLength); - // 输出 uri 字符串(用于调试) - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", uri); - // [EndExclude get_file_location] - FileIO_FileLocation location; - FileManagement_ErrCode ret = OH_FileIO_GetFileLocation(uri, strlen(uri), &location); - if (ret == 0) { - if (location == FileIO_FileLocation::LOCAL) { - OH_LOG_INFO(LogType::LOG_APP, "This file is on local."); - } else if (location == FileIO_FileLocation::CLOUD) { - OH_LOG_INFO(LogType::LOG_APP, "This file is on cloud."); - } else if (location == FileIO_FileLocation::LOCAL_AND_CLOUD) { - OH_LOG_INFO(LogType::LOG_APP, "This file is both on local and cloud."); - } - } else { - OH_LOG_INFO(LogType::LOG_APP, "GetFileLocation failed, error code is %{public}d", ret); - } - // [StartExclude get_file_location] - // 如果需要返回值,可以创建一个 JavaScript 字符串返回 - napi_value result; - napi_create_string_utf8(env, uri, strLength, &result); - return result; - // [EndExclude get_file_location] -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) { - napi_property_descriptor desc[] = { - {"getFileLocation", nullptr, GetFileLocation, nullptr, nullptr, nullptr, napi_default, nullptr}}; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/CoreFile/NDKAppFileSample/entry/src/main/cpp/types/libentry/Index.d.ts b/CoreFile/NDKAppFileSample/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 3fda4ca42101d8cab805328d9c0cd5bd4cb914fd..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const getFileLocation: (uri: string) => string; \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/cpp/types/libentry/oh-package.json5 b/CoreFile/NDKAppFileSample/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/ets/common/Logger.ts b/CoreFile/NDKAppFileSample/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index e8235b04f40ae9b505e231b1313793d02f08cad4..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -export class Logger { - private domain: number; - private prefix: string = '[Sample_NDKAppFileSample]'; - private format: string = `%{public}s`; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0x0000; // 应用的编码 - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]): void { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number): void { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger('[Sample_NDKAppFileSample]'); - diff --git a/CoreFile/NDKAppFileSample/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/NDKAppFileSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 5afd14516d50a8898c7a11765e5d4bd211c95e10..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; // 应用的编码 - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN, 'testTag', `%{public}s`, 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', `%{public}s`, 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', `%{public}s`, 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', `Failed to load the content. Cause: %{public}s`, JSON.stringify(err) ?? ''); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', `%{public}s`, 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', `%{public}s`, 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', `%{public}s`, 'Ability onBackground'); - } -}; diff --git a/CoreFile/NDKAppFileSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/NDKAppFileSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index bfb5ec138342078036fc8b9fcacec64c20eb6621..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; // 应用的编码 - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', `onRestore ok %{public}s`, JSON.stringify(bundleVersion)); - } -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/ets/fileFs/FileFs.ets b/CoreFile/NDKAppFileSample/entry/src/main/ets/fileFs/FileFs.ets deleted file mode 100644 index 2633102d17d9c6bad26058458c0ebcc394131e8f..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/ets/fileFs/FileFs.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; -import { fileIo as fs, ReadOptions } from '@kit.CoreFileKit'; -import { buffer } from '@kit.ArkTS'; -import Logger from '../common/Logger'; - -const BUFFER: number = 1024; // 读取文件缓冲区大小 - -// 获取应用文件沙箱路径 -let context = getContext(this) as common.UIAbilityContext; -let filesDir = context.filesDir; - -export function createFile(): string { - // 新建并打开文件 - let file = fs.openSync(filesDir + '/test.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - // 写入一段内容至文件 - let writeLen = fs.writeSync(file.fd, 'Try to write str : hello world'); - Logger.info('The length of str is: ' + writeLen); - // 从文件读取一段内容 - let arrayBuffer = new ArrayBuffer(BUFFER); - let readOptions: ReadOptions = { - offset: 0, // 从文件的开头开始读取 - length: arrayBuffer.byteLength - }; - let readLen = fs.readSync(file.fd, arrayBuffer, readOptions); - // 这个 buf 对象是 arrayBuffer 中从位置 0 开始的前 readLen 字节 - let buf = buffer.from(arrayBuffer, 0, readLen); - Logger.info('the content of file: ' + buf.toString()); - let str = 'the content of file: ' + buf.toString(); - // 关闭文件 - fs.closeSync(file); - return str; -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/ets/pages/Index.ets b/CoreFile/NDKAppFileSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0974c9263733b02a12e43424c92e7a9a46dad8af..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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 { fileUri } from '@kit.CoreFileKit'; -import { common } from '@kit.AbilityKit'; -import testNapi from 'libentry.so'; -import { createFile } from '../fileFs/FileFs'; - -// 获取应用文件沙箱路径 -let context = getContext(this) as common.UIAbilityContext; -let filesDir = context.filesDir; - -let filePath = filesDir + '/test.txt'; -let uri = fileUri.getUriFromPath(filePath); - -@Entry -@Component -struct Index { - @State message: string = ''; - - build() { - Column() { - TextArea({ - text: this.message, - placeholder: '', - }) - .width('100%') - .height('50%') - Row() { - Button($r('app.string.createWriteReadfile')) - .onClick(() => { - this.message += createFile() + '\n'; - }) - Button($r('app.string.DetermineFileLocation')) - .onClick(() => { - testNapi.getFileLocation(uri); - this.message += 'getFileLocation SUCCESS' + '\n'; - }) - } - - } - } -} diff --git a/CoreFile/NDKAppFileSample/entry/src/main/module.json5 b/CoreFile/NDKAppFileSample/entry/src/main/module.json5 deleted file mode 100644 index e1157a62520d73a3244b923d000b9260e80b9538..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/module.json5 +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 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", - "ohos.want.action.sendData" - ], - "uris": [ - { - "scheme": "file", - "type": "text/plain", - } - ] - } - ] - } - ], - "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/CoreFile/NDKAppFileSample/entry/src/main/resources/base/element/color.json b/CoreFile/NDKAppFileSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/element/string.json b/CoreFile/NDKAppFileSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 57b6b1f4e1a87e3f7609aacfa61ae54d38a3f917..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NDKAppFileSample" - }, - { - "name": "createWriteReadfile", - "value": "创建文件" - }, - { - "name": "DetermineFileLocation", - "value": "判定文件位置" - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/background.png b/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/foreground.png b/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/layered_image.json b/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/startIcon.png b/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/NDKAppFileSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/NDKAppFileSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/NDKAppFileSample/entry/src/main/resources/en_US/element/string.json b/CoreFile/NDKAppFileSample/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 9ba2ee7b69a77dfedf93e5868affa5c61baf82c3..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NDKAppFileSample" - }, - { - "name": "createWriteReadfile", - "value": "createWriteReadFile" - }, - { - "name": "DetermineFileLocation", - "value": "DetermineFileLocation" - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/main/resources/zh_CN/element/string.json b/CoreFile/NDKAppFileSample/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 8621b9837a0a8b0102487df6cbc319bcd4181ee9..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "NDKAppFileSample" - }, - { - "name": "createWriteReadfile", - "value": "创建文件" - }, - { - "name": "DetermineFileLocation", - "value": "判定文件位置" - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/ohosTest/ets/common/Logger.ts b/CoreFile/NDKAppFileSample/entry/src/ohosTest/ets/common/Logger.ts deleted file mode 100644 index 5a9cb046a71466af03fd6a64c86231711f04a534..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/ohosTest/ets/common/Logger.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -export class Logger { - private domain: number; - private prefix: string = '[Sample_NDKAppFileSample]'; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]): void { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number): void { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger('[Sample_NDKAppFileSample]'); - diff --git a/CoreFile/NDKAppFileSample/entry/src/ohosTest/ets/test/Index.test.ets b/CoreFile/NDKAppFileSample/entry/src/ohosTest/ets/test/Index.test.ets deleted file mode 100644 index 94e7242f7b5de15bde7c221a631548c8c4e9c184..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/ohosTest/ets/test/Index.test.ets +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, expect } from '@ohos/hypium'; -import { Driver, ON, Component, abilityDelegatorRegistry, } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import Logger from '../common/Logger'; - -const DELAY_TIME = 1500; // 延时1.5秒 -const BUNDLE = 'NDKAppFileAccess_'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -const abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - -async function getResourceString(resource: Resource): Promise { - let manage = abilityDelegator.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function IndexTest() { - describe('IndexTest', () => { - /** - * @tc.number StartAbility_001 - * @tc.name StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - Logger.info('StartAbility_001 begin'); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - const ability: UIAbility = await delegator.getCurrentTopAbility(); - Logger.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - Logger.info('StartAbility_001 end'); - }) - /** - * @tc.number NDKFileAccessTest_001 - * @tc.name NDkFileAccessTest_001 - * @tc.desc 文件的创建 - */ - it(BUNDLE + 'fileAccessTest_001', 0, async () => { - Logger.info(BUNDLE + 'NDKFileAccessTest_001 begin'); - let str = await getResourceString($r('app.string.createWriteReadfile')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'NDKFileAccessTest_001 end'); - }) - /** - * @tc.number NDKFileAccessTest_002 - * @tc.name NDKFileAccessTest_002 - * @tc.desc 判断文件位置 - */ - it(BUNDLE + 'fileAccessTest_002', 0, async () => { - Logger.info(BUNDLE + 'NDKFileAccessTest_002 begin'); - let str = await getResourceString($r('app.string.DetermineFileLocation')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'NDKFileAccessTest_002 end'); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/NDKAppFileSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 00cfe9627bd61a31322328fd121fab7f4d2f6d64..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 IndexTest from './Index.test'; - -export default function testsuite() { - IndexTest(); -} \ No newline at end of file diff --git a/CoreFile/NDKAppFileSample/entry/src/ohosTest/module.json5 b/CoreFile/NDKAppFileSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/NDKAppFileSample/hvigor/hvigor-config.json5 b/CoreFile/NDKAppFileSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/NDKAppFileSample/hvigorfile.ts b/CoreFile/NDKAppFileSample/hvigorfile.ts deleted file mode 100644 index 4beb74fe5b573059b972acf9312d33ea1703c016..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/NDKAppFileSample/oh-package.json5 b/CoreFile/NDKAppFileSample/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/NDKAppFileSample/ohosTest.md b/CoreFile/NDKAppFileSample/ohosTest.md deleted file mode 100644 index 21dd0878f663e2bba436ebbd97df8ec079852d3a..0000000000000000000000000000000000000000 --- a/CoreFile/NDKAppFileSample/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------ | ------------ | ---- |-----------------------------| -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用,主页元素齐备 | 是 | Pass | -| 创建文件 | 设备正常运行 | | 文件内容 | 是 | Pass | -| 确定文件位置 | 文件成功创建 | | 输出日志getFileLocation SUCCESS | 是 | pass | - diff --git a/CoreFile/NDKAppFileSample/screenshots/end.jpg b/CoreFile/NDKAppFileSample/screenshots/end.jpg deleted file mode 100644 index 791d48cb3a9f4f37d328f08bc29d11d01aa750e4..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKAppFileSample/screenshots/end.jpg and /dev/null differ diff --git a/CoreFile/NDKAppFileSample/screenshots/start.jpg b/CoreFile/NDKAppFileSample/screenshots/start.jpg deleted file mode 100644 index 180a127cf5e6263c47b2c0df1d0fd14242f81ee2..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKAppFileSample/screenshots/start.jpg and /dev/null differ diff --git a/CoreFile/NDKEnvironmentSample/.gitignore b/CoreFile/NDKEnvironmentSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/NDKEnvironmentSample/AppScope/app.json5 b/CoreFile/NDKEnvironmentSample/AppScope/app.json5 deleted file mode 100644 index 37a5d46cc8a38dbf3ecb7cd7faa37371b245c945..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.ndkenvironmentsample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/CoreFile/NDKEnvironmentSample/AppScope/resources/base/element/string.json b/CoreFile/NDKEnvironmentSample/AppScope/resources/base/element/string.json deleted file mode 100644 index f9a2fbb89756edfedb45456dc7718db342c4eaf8..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "NDKEnvironmentSample" - } - ] -} diff --git a/CoreFile/NDKEnvironmentSample/AppScope/resources/base/media/background.png b/CoreFile/NDKEnvironmentSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKEnvironmentSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/NDKEnvironmentSample/AppScope/resources/base/media/foreground.png b/CoreFile/NDKEnvironmentSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKEnvironmentSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/NDKEnvironmentSample/AppScope/resources/base/media/layered_image.json b/CoreFile/NDKEnvironmentSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/README_zh.md b/CoreFile/NDKEnvironmentSample/README_zh.md deleted file mode 100644 index 46f10257ef7366690072add8604e3fedcb3b4694..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/README_zh.md +++ /dev/null @@ -1,108 +0,0 @@ -# 应用文件访问(C++) - -## 介绍 - - 本实例主要实现了使用C++的方式去获取并使用公共目录,支持三方应用在公共文件用户目录下进行文件访问操作。 - -- [获取并使用公共目录 - (C/C++)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/request-dir-permission.md) -- [获取用户目录环境 - (C/C++)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/native-environment-guidelines.md) - -## 效果预览 - -| 应用启动界面 | 文件访问结果 | -|---------------------------------------------------|-------------------------------------------------| -| | | - -使用说明: - -1. 本应用主要使用napi的方式,使用C语言函数对应用的沙箱文件进行访问。 -2. 在启动应用之后,点击界面上的六个按钮,通过日志反馈知道访问的结果。 - -## 工程目录 - -``` -NDKEnvironmentSample -├──entry/src/main -| ├──cpp -| | ├──types -| | | ├──libentry -| | | └──CMakeLists.txt // CMake脚本文件 -| | | └──napi_init.cpp // napi函数封装类 -| ├──ets -| | ├──commom -| | | ├──Logger.ts // 封装日志类 -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -## 具体实现 - -1. 在CMake脚本中链接动态库,即在CMakeLists.txt中添加以下lib。 - - ``` - target_link_libraries(sample PUBLIC libohenvironment.so) - ``` - -2. 添加头文件 - - ``` - #include - #include - #include - #include - ``` - -3. 例如调用[OH_Environment_GetUserDownloadDir](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/capi-oh-environment-h.md#oh_environment_getuserdownloaddir)接口获取用户Download目录沙箱路径, - 在接口中使用malloc申请的内存需要在使用完后释放因此需要free对应的内存。示例代码如下所示: - ```c - void GetUserDownloadDirPathExample() { - char *downloadPath = NULL; - FileManagement_ErrCode ret = OH_Environment_GetUserDownloadDir(&downloadPath); - if (ret == 0) { - printf("Download Path=%s", downloadPath); - free(downloadPath); - } else { - printf("GetDownloadPath failed, error code is %d", ret); - } - } - ``` - -## 相关权限 - -公共目录获取接口仅用于获取公共目录路径,不对公共目录访问权限进行校验。若需访问公共目录需申请对应的公共目录访问权限。三方应用需要访问公共目录时,需通过弹窗授权向用户申请授予Download目录权限、Documents目录权限或Desktop目录权限, -具体参考[访问控制](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/request-user-authorization.md)。 -"requestPermissions" : [ -"ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY", -"ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY", -"ohos.permission.READ_WRITE_DESKTOP_DIRECTORY", -] - -## 依赖 - -不涉及 - -## 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:PC/2in1。 - -2.本示例为Stage模型,支持API12版本SDK,版本号:5.0.0。 - -3.本示例需要使用DevEco Studio 6.0.0 Release (构建版本:6.0.0.858,构建 2025年9月24日)及以上版本才可编译运行。 - -## 下载 - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/NDKEnvironmentSample > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` - diff --git a/CoreFile/NDKEnvironmentSample/build-profile.json5 b/CoreFile/NDKEnvironmentSample/build-profile.json5 deleted file mode 100644 index 21867cb7ec595917de7a321ef6780b223b03f399..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/build-profile.json5 +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - { - "name": "default", - "type": "HarmonyOS", - "material": { - "certpath": "C:\\Users\\X30060367\\.ohos\\config\\default_NDKEnvironmentSample_Cw3Grot3Yvk7eZHKNxvu6HFJBIXkWeGahtgSfuiZiDY=.cer", - "keyAlias": "debugKey", - "keyPassword": "0000001B03C74549233EFE9BB307946F66261B786E8B72EB8BB5701967FB89A518BD1C09FDA7EAC8FB070E", - "profile": "C:\\Users\\X30060367\\.ohos\\config\\default_NDKEnvironmentSample_Cw3Grot3Yvk7eZHKNxvu6HFJBIXkWeGahtgSfuiZiDY=.p7b", - "signAlg": "SHA256withECDSA", - "storeFile": "C:\\Users\\X30060367\\.ohos\\config\\default_NDKEnvironmentSample_Cw3Grot3Yvk7eZHKNxvu6HFJBIXkWeGahtgSfuiZiDY=.p12", - "storePassword": "0000001BD0507F99197599EAAE3B66B76234B36455516A1CC9124A72918FD055075A49BDBF823840206A84" - } - } - ], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/code-linter.json5 b/CoreFile/NDKEnvironmentSample/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/.gitignore b/CoreFile/NDKEnvironmentSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/build-profile.json5 b/CoreFile/NDKEnvironmentSample/entry/build-profile.json5 deleted file mode 100644 index 3974c0bbe91b785fb2f765d1e8ba3cb31e2ae74c..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - }, - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/hvigorfile.ts b/CoreFile/NDKEnvironmentSample/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/obfuscation-rules.txt b/CoreFile/NDKEnvironmentSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/NDKEnvironmentSample/entry/oh-package.json5 b/CoreFile/NDKEnvironmentSample/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/CMakeLists.txt b/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 783c03949671273f894f479fbec4aa673748f99e..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(NDKEnvironmentSample) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libohenvironment.so libhilog_ndk.z.so) \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/napi_init.cpp b/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 35d2241f8421cda27ac1605aa6a853f46906a020..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include "cstring" -#include -#include -#include -#include -#include -#include -#include - - -#undef LOG_TAG -#define LOG_TAG "Sample_NDKEnvironment" - -std::string g_path = ""; - -// [Start get_user_download_dir_example] -void GetUserDownloadDirExample() -{ - char *downloadPath = nullptr; - FileManagement_ErrCode ret = OH_Environment_GetUserDownloadDir(&downloadPath); - if (ret == 0) { - OH_LOG_INFO(LOG_APP, "Download Path=%{public}s", downloadPath); - free(downloadPath); - } else { - OH_LOG_ERROR(LOG_APP, "GetDownloadPath fail, error code is %{public}d", ret); - } -} -// [End get_user_download_dir_example] - -static napi_value DoGetUserDownloadDirExample(napi_env env, napi_callback_info info) -{ - GetUserDownloadDirExample(); - return nullptr; -} - -// [Start scan_user_download_dir_path_example] -void ScanUserDownloadDirPathExample() -{ - // 获取 download 路径 - char *downloadPath = nullptr; - FileManagement_ErrCode ret = OH_Environment_GetUserDownloadDir(&downloadPath); - if (ret == 0) { - OH_LOG_INFO(LOG_APP, "Download Path=%{public}s", downloadPath); - } else { - OH_LOG_ERROR(LOG_APP, "GetDownloadPath fail, error code is %{public}d", ret); - return; - } - // 查看文件夹下的文件 - struct dirent **namelist = nullptr; - int num = scandir(downloadPath, &namelist, nullptr, nullptr); - if (num < 0) { - free(downloadPath); - OH_LOG_ERROR(LOG_APP, "Failed to scan dir"); - return; - } - - for (int i = 0; i < num; i++) { - OH_LOG_INFO(LOG_APP, "%{public}s", namelist[i]->d_name); - } - free(downloadPath); - for (int i = 0; i < num; i++) { - free(namelist[i]); - } - free(namelist); -} -// [End scan_user_download_dir_path_example] - -static napi_value DoScanUserDownloadDirPathExample(napi_env env, napi_callback_info info) -{ - ScanUserDownloadDirPathExample(); - return nullptr; -} - -// [Start write_user_download_dir_path_example] -void WriteUserDownloadDirPathExample() -{ - // 获取 download 路径 - char *downloadPath = nullptr; - FileManagement_ErrCode ret = OH_Environment_GetUserDownloadDir(&downloadPath); - if (ret == 0) { - OH_LOG_INFO(LOG_APP, "Download Path=%{public}s", downloadPath); - } else { - OH_LOG_ERROR(LOG_APP, "GetDownloadPath fail, error code is %{public}d", ret); - return; - } - // 保存文件到 download 目录下 - std::string filePath = std::string(downloadPath) + "/temp.txt"; - free(downloadPath); - - std::ofstream outfile; - outfile.open(filePath.c_str()); - if (!outfile) { - OH_LOG_ERROR(LOG_APP, "Failed to open file"); - return; - } - std::string msg = "Write a message"; - outfile.write(msg.c_str(), msg.size()); - outfile.close(); -} -// [End write_user_download_dir_path_example] - -static napi_value DoWriteUserDownloadDirPathExample(napi_env env, napi_callback_info info) -{ - WriteUserDownloadDirPathExample(); - return nullptr; -} - -// [Start get_user_download_dir_path_example] -void GetUserDownloadDirPathExample() -{ - char *downloadPath = nullptr; - FileManagement_ErrCode ret = OH_Environment_GetUserDownloadDir(&downloadPath); - if (ret == 0) { - OH_LOG_INFO(LOG_APP, "Download Path=%{public}s", downloadPath); - free(downloadPath); - } else { - OH_LOG_ERROR(LOG_APP, "GetDownloadPath fail, error code is %{public}d", ret); - } -} -// [End get_user_download_dir_path_example] - -static napi_value DoGetUserDownloadDirPathExample(napi_env env, napi_callback_info info) -{ - GetUserDownloadDirPathExample(); - return nullptr; -} - -// [Start get_user_desktop_dir_path_example] -void GetUserDesktopDirPathExample() -{ - char *desktopPath = nullptr; - FileManagement_ErrCode ret = OH_Environment_GetUserDesktopDir(&desktopPath); - if (ret == 0) { - OH_LOG_INFO(LOG_APP, "Desktop Path=%{public}s", desktopPath); - free(desktopPath); - } else { - OH_LOG_ERROR(LOG_APP, "GetDesktopPath fail, error code is %{public}d", ret); - } -} -// [End get_user_desktop_dir_path_example] -static napi_value DoGetUserDesktopDirPathExample(napi_env env, napi_callback_info info) -{ - GetUserDesktopDirPathExample(); - return nullptr; -} - -// [Start get_user_document_dir_path_example] -void GetUserDocumentDirPathExample() -{ - char *documentPath = nullptr; - FileManagement_ErrCode ret = OH_Environment_GetUserDocumentDir(&documentPath); - if (ret == 0) { - OH_LOG_INFO(LOG_APP, "Document Path=%{public}s", documentPath); - free(documentPath); - } else { - OH_LOG_ERROR(LOG_APP, "GetDocumentPath fail, error code is %{public}d", ret); - } -} -// [End get_user_document_dir_path_example] - -static napi_value DoGetUserDocumentDirPathExample(napi_env env, napi_callback_info info) -{ - GetUserDocumentDirPathExample(); - return nullptr; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = {{"doGetUserDownloadDirExample", nullptr, DoGetUserDownloadDirExample, nullptr, - nullptr, nullptr, napi_default, nullptr}, - {"doScanUserDownloadDirPathExample", nullptr, DoScanUserDownloadDirPathExample, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"doWriteUserDownloadDirPathExample", nullptr, DoWriteUserDownloadDirPathExample, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"doGetUserDownloadDirPathExample", nullptr, DoGetUserDownloadDirPathExample, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"doGetUserDesktopDirPathExample", nullptr, DoGetUserDesktopDirPathExample, - nullptr, nullptr, nullptr, napi_default, nullptr}, - {"doGetUserDocumentDirPathExample", nullptr, DoGetUserDocumentDirPathExample, - nullptr, nullptr, nullptr, napi_default, nullptr} - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/types/libentry/Index.d.ts b/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 3addff9a4f8c8cb35ea5452e1001f7b38386156b..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const doGetUserDownloadDirExample: () => string; -export const doScanUserDownloadDirPathExample: () => string; -export const doWriteUserDownloadDirPathExample: () => string; - -export const doGetUserDownloadDirPathExample: () => string; -export const doGetUserDesktopDirPathExample: () => string; -export const doGetUserDocumentDirPathExample: () => string; \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/types/libentry/oh-package.json5 b/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index ea410725a8826704d061021d98cf02aa76cd8016..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/ets/common/Logger.ts b/CoreFile/NDKEnvironmentSample/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index 8f4e9c8449dcc95e2a569ce13e2a42d7d7a0d49d..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -export class Logger { - private domain: number; - private prefix: string = '[Sample_NDKEnvironmentSample]'; - private format: string = `%{public}s`; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0x0000; // 应用的编码 - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]): void { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number): void { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger('[Sample_NDKEnvironmentSample]'); - diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/NDKEnvironmentSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 62f53acbc95e5be7985f8fb1fe2db591cea260bd..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/NDKEnvironmentSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/ets/pages/Index.ets b/CoreFile/NDKEnvironmentSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 1518eeb28494e67f52880cd13b2305885e961379..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'libentry.so'; -import { abilityAccessCtrl, common, Permissions } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -const permissions: Permissions[] = ['ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY']; - -function reqPermissionsFromUser(permissions: Array, context: common.UIAbilityContext): void { - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗。 - atManager.requestPermissionsFromUser(context, permissions).then((data) => { - let grantStatus: number[] = data.authResults; - let length: number = grantStatus.length; - for (let i = 0; i < length; i++) { - if (grantStatus[i] === 0) { - // 用户授权,可以继续访问目标操作。 - } else { - // 当用户拒绝授权时,系统应提示用户必须授予相应权限才能使用当前页面的功能,并指导用户前往系统设置开启所需权限。 - return; - } - } - // 授权成功。 - }).catch((err: BusinessError) => { - console.error(`Failed to request permissions from user, code: ${err.code}, message: ${err.message}`); - }) -} - -@Entry -@Component -struct Index { - @State message: string = ''; - - aboutToAppear() { - const context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; - reqPermissionsFromUser(permissions, context); - } - - build() { - Column() { - TextArea({ - text: this.message, - placeholder: '', - }) - .width('100%') - .height('50%') - - Row() { - Button($r('app.string.getUserDownloadDirExample')) - .onClick(() => { - testNapi.doGetUserDownloadDirExample(); - this.message += "GetUserDownloadDirExample SUCCESS" + '\n'; - }) - } - - Row() { - Button($r('app.string.ScanUserDownloadDirPathExample')) - .onClick(async () => { - testNapi.doScanUserDownloadDirPathExample(); - this.message += "ScanUserDownloadDirPathExample SUCCESS" + '\n'; - }) - } - - Row() { - Button($r('app.string.WriteUserDownloadDirPathExample')) - .onClick(async () => { - testNapi.doWriteUserDownloadDirPathExample(); - this.message += "WriteUserDownloadDirPathExample SUCCESS" + '\n'; - }) - } - - Row() { - Button($r('app.string.GetUserDownloadDirPathExample')) - .onClick(async () => { - testNapi.doGetUserDownloadDirPathExample(); - this.message += 'GetUserDownloadDirPathExample SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.GetUserDesktopDirPathExample')) - .onClick(async () => { - testNapi.doGetUserDesktopDirPathExample(); - this.message += 'GetUserDesktopDirPathExample SUCCESS' + '\n'; - }) - } - - Row() { - Button($r('app.string.GetUserDocumentDirPathExample')) - .onClick(async () => { - testNapi.doGetUserDocumentDirPathExample(); - this.message += 'GetUserDocumentDirPathExample SUCCESS' + '\n'; - }) - } - } - } -} diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/module.json5 b/CoreFile/NDKEnvironmentSample/entry/src/main/module.json5 deleted file mode 100644 index de3ad2d8739bc15635f82e7f6aeda79128ca6f41..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/module.json5 +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "2in1" - ], - "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": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ], - "requestPermissions":[ - { - "name" : "ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY", - "reason": "$string:reason", - "usedScene": { - "abilities": [ - "FormAbility" - ], - "when":"inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/element/color.json b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/element/float.json b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/element/string.json b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 014204c8ebf3be69a1befa8473343ab58962cc14..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "getUserDownloadDirExample", - "value": "获取用户Download目录沙箱路径" - }, - { - "name": "ScanUserDownloadDirPathExample", - "value": "查看Download目录下的文件" - }, - { - "name": "WriteUserDownloadDirPathExample", - "value": "保存temp.txt到Download目录" - }, - { - "name": "GetUserDownloadDirPathExample", - "value": "获取用户Download目录沙箱路径" - }, - { - "name": "GetUserDesktopDirPathExample", - "value": "获取用户Desktop目录沙箱路径" - }, - { - "name": "GetUserDocumentDirPathExample", - "value": "获取用户Document目录沙箱路径" - }, - { - "name": "reason", - "value": "testNdkEnvironmentSample" - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/background.png b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/foreground.png b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/layered_image.json b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/startIcon.png b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/dark/element/color.json b/CoreFile/NDKEnvironmentSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/ets/common/Logger.ts b/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/ets/common/Logger.ts deleted file mode 100644 index 2940a49c2e638dd4a8740890de9001be1417c7c4..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/ets/common/Logger.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -export class Logger { - private domain: number; - private prefix: string = '[Sample_NDKEnvironmentSample]'; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]): void { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number): void { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger('[Sample_NDKEnvironmentSample]'); - diff --git a/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index b6fa04144dfdb436cf66fe973f784f604605bb95..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, expect, it } from '@ohos/hypium'; - -import { abilityDelegatorRegistry, Component, Driver, ON, } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import Logger from '../common/Logger'; - -const DELAY_TIME = 1500; // 延时1.5秒 -const BUNDLE = 'NDKEnvironmentTest_'; - -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; -const abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - -async function getResourceString(resource: Resource): Promise { - let manage = abilityDelegator.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - /** - * @tc.number StartAbility_001 - * @tc.name StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - Logger.info('StartAbility_001 begin'); - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - - await delegator.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - const allowButton: Component = await driver.findComponent(ON.text('允许')); - await allowButton.click(); - await driver.delayMs(DELAY_TIME); // 等待2秒,确保弹窗已显示 - - const ability: UIAbility = await delegator.getCurrentTopAbility(); - Logger.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - Logger.info('StartAbility_001 end'); - }) - - /** - * @tc.number NDKEnvironmentTest_001 - * @tc.name NDKEnvironmentTest_001 - * @tc.desc 获取用户 Download 目录沙箱路径 - */ - it(BUNDLE + 'environmentTest_001', 0, async () => { - Logger.info(BUNDLE + 'NDKEnvironmentTest_001 begin'); - let str = await getResourceString($r('app.string.getUserDownloadDirExample')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'NDKEnvironmentTest_001 end'); - }) - - /** - * @tc.number NDKEnvironmentTest_002 - * @tc.name NDKEnvironmentTest_002 - * @tc.desc 查看Download目录下的文件 - */ - it(BUNDLE + 'environmentTest_002', 0, async () => { - Logger.info(BUNDLE + 'NDKEnvironmentTest_002 begin'); - let str = await getResourceString($r('app.string.ScanUserDownloadDirPathExample')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'environmentTest_002 end'); - }) - - /** - * @tc.number NDKEnvironmentTest_003 - * @tc.name NDKEnvironmentTest_003 - * @tc.desc 保存 temp.txt 到 Download 目录 - */ - it(BUNDLE + 'environmentTest_003', 0, async () => { - Logger.info(BUNDLE + 'NDKEnvironmentTest_003 begin'); - let str = await getResourceString($r('app.string.WriteUserDownloadDirPathExample')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'NDKEnvironmentTest_003 end'); - }) - - /** - * @tc.number NDKEnvironmentTest_004 - * @tc.name NDKEnvironmentTest_004 - * @tc.desc 获取用户Download目录沙箱路径 - */ - it(BUNDLE + 'environmentTest_004', 0, async () => { - Logger.info(BUNDLE + 'NDKEnvironmentTest_004 begin'); - let str = await getResourceString($r('app.string.GetUserDownloadDirPathExample')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'NDKEnvironmentTest_004 end'); - }) - - - /** - * @tc.number NDKEnvironmentTest_005 - * @tc.name NDKEnvironmentTest_005 - * @tc.desc 获取用户Desktop目录沙箱路径 - */ - it(BUNDLE + 'environmentTest_005', 0, async () => { - Logger.info(BUNDLE + 'NDKEnvironmentTest_005 begin'); - let str = await getResourceString($r('app.string.GetUserDesktopDirPathExample')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'NDKEnvironmentTest_005 end'); - }) - - /** - * @tc.number NDKEnvironmentTest_006 - * @tc.name NDKEnvironmentTest_006 - * @tc.desc 获取用户Document目录沙箱路径 - */ - it(BUNDLE + 'environmentTest_006', 0, async () => { - Logger.info(BUNDLE + 'NDKEnvironmentTest_006 begin'); - let str = await getResourceString($r('app.string.GetUserDocumentDirPathExample')); - let driver: Driver = Driver.create(); - await driver.assertComponentExist(ON.text(str)); - let button: Component = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'NDKEnvironmentTest_006 end'); - }) - - - }) -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/module.json5 b/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 165771dd183970a598e3e68143e9775e81d32e12..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/NDKEnvironmentSample/hvigor/hvigor-config.json5 b/CoreFile/NDKEnvironmentSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 7a7ab8914d8db6ab89758e185df5855dffe88d04..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/CoreFile/NDKEnvironmentSample/hvigorfile.ts b/CoreFile/NDKEnvironmentSample/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/NDKEnvironmentSample/oh-package.json5 b/CoreFile/NDKEnvironmentSample/oh-package.json5 deleted file mode 100644 index 69cb43cba3addcee1840403c67405134a2a9102c..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/NDKEnvironmentSample/ohosTest.md b/CoreFile/NDKEnvironmentSample/ohosTest.md deleted file mode 100644 index 2170dd615d425384d7415e7996df093a530eefd3..0000000000000000000000000000000000000000 --- a/CoreFile/NDKEnvironmentSample/ohosTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|-----------------------|--------------------------------------------| ---- | -------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用,主页元素齐备 | 是 | Pass | -| 获取用户 Download 目录沙箱路径 | 使用PC/2in1设备 | | GetUserDownloadDirExample SUCCESS | 是 | Pass | -| 查看Download目录下的文件 | 使用PC/2in1设备且成功获取READ_WRITE_DOWNLOAD_DIRECTORY权限 | | ScanUserDownloadDirPathExample SUCCESS | 是 | pass | -| 保存 temp.txt 到 Download 目录 | 使用PC/2in1设备且成功获取READ_WRITE_DOWNLOAD_DIRECTORY权限 | | WriteUserDownloadDirPathExample SUCCESS | 是 | pass | -| 获取用户Download目录沙箱路径 | 使用PC/2in1设备 | | GetUserDownloadDirPathExample SUCCESS | 是 | pass | -| 获取用户Desktop目录沙箱路径 | 使用PC/2in1设备 | | GetUserDesktopDirPathExample SUCCESS | 是 | pass | -| 获取用户Document目录沙箱路径 | 使用PC/2in1设备 | | GetUserDocumentDirPathExample SUCCESS | 是 | pass | - diff --git a/CoreFile/NDKEnvironmentSample/screenshots/end.png b/CoreFile/NDKEnvironmentSample/screenshots/end.png deleted file mode 100644 index 4c0a3830bb796ff6a1bcca1c4d627e9153692d6d..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKEnvironmentSample/screenshots/end.png and /dev/null differ diff --git a/CoreFile/NDKEnvironmentSample/screenshots/start.png b/CoreFile/NDKEnvironmentSample/screenshots/start.png deleted file mode 100644 index 818d26c1cdd4cc2693cb1957ffbe9ad1af1c88ae..0000000000000000000000000000000000000000 Binary files a/CoreFile/NDKEnvironmentSample/screenshots/start.png and /dev/null differ diff --git a/CoreFile/PersistPermission/.gitignore b/CoreFile/PersistPermission/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/PersistPermission/AppScope/app.json5 b/CoreFile/PersistPermission/AppScope/app.json5 deleted file mode 100644 index 2637525d9cd4b50b0aeccae3cc443f9d6beda4bf..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.persistpermission", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/CoreFile/PersistPermission/AppScope/resources/base/element/string.json b/CoreFile/PersistPermission/AppScope/resources/base/element/string.json deleted file mode 100644 index 6e88e367c05e70b45cbdca48a5383546aab18458..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "PersistPermission" - } - ] -} diff --git a/CoreFile/PersistPermission/AppScope/resources/base/media/background.png b/CoreFile/PersistPermission/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/PersistPermission/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/PersistPermission/AppScope/resources/base/media/foreground.png b/CoreFile/PersistPermission/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/CoreFile/PersistPermission/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/PersistPermission/AppScope/resources/base/media/layered_image.json b/CoreFile/PersistPermission/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/build-profile.json5 b/CoreFile/PersistPermission/build-profile.json5 deleted file mode 100644 index 8492b3d734d39bea26372c31042126cc81435f6d..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/code-linter.json5 b/CoreFile/PersistPermission/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/.gitignore b/CoreFile/PersistPermission/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/build-profile.json5 b/CoreFile/PersistPermission/entry/build-profile.json5 deleted file mode 100644 index 6bf0d132e6f78049e712446c63f2633b2d1613d3..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/hvigorfile.ts b/CoreFile/PersistPermission/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/obfuscation-rules.txt b/CoreFile/PersistPermission/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/PersistPermission/entry/oh-package.json5 b/CoreFile/PersistPermission/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/PersistPermission/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/PersistPermission/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 62f53acbc95e5be7985f8fb1fe2db591cea260bd..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/PersistPermission/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/main/ets/pages/Index.ets b/CoreFile/PersistPermission/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 9be9ebd9f5f66c9328974b2e9d948443aec60ed9..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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 { persistPermissionExample } from '../persistpermission/PersistPermission'; -import { revokePermissionExample } from '../persistpermission/PersistPermission'; -import { activatePermissionExample } from '../persistpermission/PersistPermission'; - -@Entry -@Component -struct Index { - @State message: string = ''; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.size_15')) - .fontWeight(FontWeight.Bold) - Button($r('app.string.invokeInterfaceButton1')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - persistPermissionExample(); - }) - Button($r('app.string.invokeInterfaceButton2')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - revokePermissionExample(); - }) - Button($r('app.string.invokeInterfaceButton3')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - activatePermissionExample(); - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/main/ets/persistpermission/PersistPermission.ets b/CoreFile/PersistPermission/entry/src/main/ets/persistpermission/PersistPermission.ets deleted file mode 100644 index a8fcb13989caf847d31edde99e309cf1140fe309..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/ets/persistpermission/PersistPermission.ets +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start activate_permission_example] -// [Start revoke_permission_example] -// [Start persist_permission_example] -import { BusinessError } from '@kit.BasicServicesKit'; -import { picker } from '@kit.CoreFileKit'; -import { fileShare } from '@kit.CoreFileKit'; - -// [StartExclude activate_permission_example] -// [StartExclude revoke_permission_example] -export async function persistPermissionExample() { - try { - // [StartExclude persist_permission_example] - // [Start can_use_example] - if (!canIUse('SystemCapability.FileManagement.AppFileService.FolderAuthorization')) { - console.error('this api is not supported on this device'); - return; - } - // [End can_use_example] - // [EndExclude persist_permission_example] - let documentSelectOptions = new picker.DocumentSelectOptions(); - let documentPicker = new picker.DocumentViewPicker(); - let uris = await documentPicker.select(documentSelectOptions); - let policyInfo: fileShare.PolicyInfo = { - uri: uris[0], - operationMode: fileShare.OperationMode.READ_MODE, - }; - let policies: fileShare.PolicyInfo[] = [policyInfo]; - fileShare.persistPermission(policies).then(() => { - console.info('persistPermission successfully'); - }).catch((err: BusinessError>) => { - console.error('persistPermission failed with error message: ' + err.message + ', error code: ' + err.code); - if (err.code == 13900001 && err.data) { - for (let i = 0; i < err.data.length; i++) { - console.error('error code : ' + JSON.stringify(err.data[i].code)); - console.error('error uri : ' + JSON.stringify(err.data[i].uri)); - console.error('error reason : ' + JSON.stringify(err.data[i].message)); - } - } - }); - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`persistPermission failed with err, Error code: ${err.code}, message: ${err.message}`); - } -} -// [End persist_permission_example] -// [EndExclude revoke_permission_example] -export async function revokePermissionExample() { - try { - let uri = 'file://docs/storage/Users/username/tmp.txt'; - let policyInfo: fileShare.PolicyInfo = { - uri: uri, - operationMode: fileShare.OperationMode.READ_MODE, - }; - let policies: fileShare.PolicyInfo[] = [policyInfo]; - fileShare.revokePermission(policies).then(() => { - console.info('revokePermission successfully'); - }).catch((err: BusinessError>) => { - console.error('revokePermission failed with error message: ' + err.message + ', error code: ' + err.code); - if (err.code == 13900001 && err.data) { - for (let i = 0; i < err.data.length; i++) { - console.error('error code : ' + JSON.stringify(err.data[i].code)); - console.error('error uri : ' + JSON.stringify(err.data[i].uri)); - console.error('error reason : ' + JSON.stringify(err.data[i].message)); - } - } - }); - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`revokePermission failed with err, Error code: ${err.code}, message: ${err.message}`); - } -} -// [End revoke_permission_example] -// [EndExclude activate_permission_example] -export async function activatePermissionExample() { - try { - let uri = 'file://docs/storage/Users/username/tmp.txt'; - let policyInfo: fileShare.PolicyInfo = { - uri: uri, - operationMode: fileShare.OperationMode.READ_MODE, - }; - let policies: fileShare.PolicyInfo[] = [policyInfo]; - fileShare.activatePermission(policies).then(() => { - console.info('activatePermission successfully'); - }).catch((err: BusinessError>) => { - console.error('activatePermission failed with error message: ' + err.message + ', error code: ' + err.code); - if (err.code == 13900001 && err.data) { - for (let i = 0; i < err.data.length; i++) { - console.error('error code : ' + JSON.stringify(err.data[i].code)); - console.error('error uri : ' + JSON.stringify(err.data[i].uri)); - console.error('error reason : ' + JSON.stringify(err.data[i].message)); - if (err.data[i].code == fileShare.PolicyErrorCode.PERMISSION_NOT_PERSISTED) { - //可以选择进行持久化后再激活。 - } - } - } - }); - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`activatePermission failed with err, Error code: ${err.code}, message: ${err.message}`); - } -} -// [End activate_permission_example] \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/main/module.json5 b/CoreFile/PersistPermission/entry/src/main/module.json5 deleted file mode 100644 index 25148c9e0e582c3ed037ae97ca8fad095ec7adb8..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone" - ], - "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": [ - "ohos.want.action.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/CoreFile/PersistPermission/entry/src/main/resources/base/element/color.json b/CoreFile/PersistPermission/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/main/resources/base/element/float.json b/CoreFile/PersistPermission/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 3d7a861509938ed4854066b6aeeedd22770786c2..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "float": [ - { - "name": "size_15", - "value": "15" - }, - { - "name": "size_20", - "value": "20" - } - ] -} diff --git a/CoreFile/PersistPermission/entry/src/main/resources/base/element/string.json b/CoreFile/PersistPermission/entry/src/main/resources/base/element/string.json deleted file mode 100644 index fbfc735a552639eb417d022113eb988868862076..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "PersistPermission" - }, - { - "name": "invokeInterfaceButton1", - "value": "persistPermission" - }, - { - "name": "invokeInterfaceButton2", - "value": "revokePermission" - }, - { - "name": "invokeInterfaceButton3", - "value": "activatePermission" - } - ] -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/main/resources/base/media/background.png b/CoreFile/PersistPermission/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/PersistPermission/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/PersistPermission/entry/src/main/resources/base/media/foreground.png b/CoreFile/PersistPermission/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/CoreFile/PersistPermission/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/PersistPermission/entry/src/main/resources/base/media/layered_image.json b/CoreFile/PersistPermission/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/main/resources/base/media/startIcon.png b/CoreFile/PersistPermission/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/PersistPermission/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/PersistPermission/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/PersistPermission/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/PersistPermission/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/PersistPermission/entry/src/main/resources/dark/element/color.json b/CoreFile/PersistPermission/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/mock/mock-config.json5 b/CoreFile/PersistPermission/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41bfdf76d6f793007240d80983a52f15f97..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/PersistPermission/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/PersistPermission/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/ohosTest/module.json5 b/CoreFile/PersistPermission/entry/src/ohosTest/module.json5 deleted file mode 100644 index a43680ca704ea9bf17ba9b9f88086a2735012c37..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/PersistPermission/entry/src/test/List.test.ets b/CoreFile/PersistPermission/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/entry/src/test/LocalUnit.test.ets b/CoreFile/PersistPermission/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/hvigor/hvigor-config.json5 b/CoreFile/PersistPermission/hvigor/hvigor-config.json5 deleted file mode 100644 index b8fea3f097bd68b0bc4d87de986d2cb7732c1d9b..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/CoreFile/PersistPermission/hvigorfile.ts b/CoreFile/PersistPermission/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/PersistPermission/oh-package.json5 b/CoreFile/PersistPermission/oh-package.json5 deleted file mode 100644 index 69cb43cba3addcee1840403c67405134a2a9102c..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/PersistPermission/ohosTest.md b/CoreFile/PersistPermission/ohosTest.md deleted file mode 100644 index 5659e5d6839ce3c3d55186cf020e168c745aca42..0000000000000000000000000000000000000000 --- a/CoreFile/PersistPermission/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|---------------------------|--------------------------------------------| ---- | -------------------------- |------| -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 否 | Pass | -| 测试persistPermission接口 | 安装应用,进入首页 | | 成功运行 | 否 | Pass | -| 测试revokePermission接口 | 安装应用,进入首页 | | 成功运行 | 否 | pass | -| 测试activatePermission接口 | 安装应用,进入首页 | | 成功运行 | 否 | pass | \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/.gitignore b/CoreFile/UserFile/FileShareDevelopment_C/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/UserFile/FileShareDevelopment_C/AppScope/app.json5 b/CoreFile/UserFile/FileShareDevelopment_C/AppScope/app.json5 deleted file mode 100644 index b4c2f451bcd9d09fd4a31e44418e01cebae0e2e2..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.filesharedevelopment_c", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/element/string.json b/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/element/string.json deleted file mode 100644 index a2fbd05b2af882f42e60d6e1776e60f680392ee4..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "FileShareDevelopment_C" - } - ] -} diff --git a/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/media/background.png b/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/media/foreground.png b/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/media/layered_image.json b/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/build-profile.json5 b/CoreFile/UserFile/FileShareDevelopment_C/build-profile.json5 deleted file mode 100644 index e9ec668d0151c34f1df85976365151af79338510..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/code-linter.json5 b/CoreFile/UserFile/FileShareDevelopment_C/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/.gitignore b/CoreFile/UserFile/FileShareDevelopment_C/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/build-profile.json5 b/CoreFile/UserFile/FileShareDevelopment_C/entry/build-profile.json5 deleted file mode 100644 index 3974c0bbe91b785fb2f765d1e8ba3cb31e2ae74c..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - }, - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/hvigorfile.ts b/CoreFile/UserFile/FileShareDevelopment_C/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/obfuscation-rules.txt b/CoreFile/UserFile/FileShareDevelopment_C/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/UserFile/FileShareDevelopment_C/entry/oh-package.json5 b/CoreFile/UserFile/FileShareDevelopment_C/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/CMakeLists.txt b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index d518f5c17358b093987b8103d928a18681c8e34a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(FileShareDevelopment_C) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libohfileshare.so) \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/napi_init.cpp b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 5246c30a0f4943a6a30629055c92d42c7d168428..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include -#include -#include - -static napi_value NAPI_OH_FileShare_PersistPermission(napi_env env, napi_callback_info info) -{ - // [Start persist_permission_example] - static const uint32_t policyNum = 2; - char strTestPath1[] = "file://com.example.fileshare/data/storage/el2/base/files/test1.txt"; - char strTestPath2[] = "file://com.example.fileshare/data/storage/el2/base/files/test2.txt"; - FileShare_PolicyInfo policy[policyNum] = { - {strTestPath1, static_cast(strlen(strTestPath1)), FileShare_OperationMode::READ_MODE}, - {strTestPath2, static_cast(strlen(strTestPath2)), FileShare_OperationMode::WRITE_MODE}}; - FileShare_PolicyErrorResult* result = nullptr; - uint32_t resultNum = 0; - napi_value napiResult; - std::string resultStr; - auto ret = OH_FileShare_PersistPermission(policy, policyNum, &result, &resultNum); - if (ret != ERR_OK) { - if (ret == ERR_EPERM && result != nullptr) { - for (uint32_t i = 0; i < resultNum; i++) { - std::cout << "error uri: " << result[i].uri << std::endl; - std::cout << "error code: " << result[i].code << std::endl; - std::cout << "error message: " << result[i].message << std::endl; - // [StartExclude persist_permission_example] - resultStr += "error uri: "; - resultStr += result[i].uri; - resultStr += "\n"; - resultStr += "error code: "; - resultStr += result[i].code; - resultStr += "\n"; - resultStr += "error message: "; - resultStr += result[i].message; - resultStr += "\n"; - // [EndExclude persist_permission_example] - } - } - } - OH_FileShare_ReleasePolicyErrorResult(result, resultNum); - // [End persist_permission_example] - napi_status status = napi_create_string_utf8(env, resultStr.c_str(), NAPI_AUTO_LENGTH, &napiResult); - if (status != napi_ok) { - return nullptr; - } - return napiResult; -} - -static napi_value NAPI_OH_FileShare_ActivatePermission(napi_env env, napi_callback_info info) -{ - static const uint32_t policyNum = 2; - char strTestPath1[] = "file://com.example.fileshare/data/storage/el2/base/files/test1.txt"; - char strTestPath2[] = "file://com.example.fileshare/data/storage/el2/base/files/test2.txt"; - FileShare_PolicyInfo policy[policyNum] = { - {strTestPath1, static_cast(strlen(strTestPath1)), FileShare_OperationMode::READ_MODE}, - {strTestPath2, static_cast(strlen(strTestPath2)), FileShare_OperationMode::WRITE_MODE}}; - FileShare_PolicyErrorResult* result = nullptr; - uint32_t resultNum = 0; - napi_value napiResult; - std::string resultStr; - // [Start activate_permission_example] - auto ret = OH_FileShare_ActivatePermission(policy, policyNum, &result, &resultNum); - if (ret != ERR_OK) { - if (ret == ERR_EPERM && result != nullptr) { - for (uint32_t i = 0; i < resultNum; i++) { - std::cout << "error uri: " << result[i].uri << std::endl; - std::cout << "error code: " << result[i].code << std::endl; - std::cout << "error message: " << result[i].message << std::endl; - // [StartExclude activate_permission_example] - resultStr += "error uri: "; - resultStr += result[i].uri; - resultStr += "\n"; - resultStr += "error code: "; - resultStr += result[i].code; - resultStr += "\n"; - resultStr += "error message: "; - resultStr += result[i].message; - resultStr += "\n"; - // [EndExclude activate_permission_example] - } - } - } - OH_FileShare_ReleasePolicyErrorResult(result, resultNum); - // [End activate_permission_example] - napi_status status = napi_create_string_utf8(env, resultStr.c_str(), NAPI_AUTO_LENGTH, &napiResult); - if (status != napi_ok) { - return nullptr; - } - return napiResult; -} - -static napi_value NAPI_OH_FileShare_DeactivatePermission(napi_env env, napi_callback_info info) -{ - static const uint32_t policyNum = 2; - char strTestPath1[] = "file://com.example.fileshare/data/storage/el2/base/files/test1.txt"; - char strTestPath2[] = "file://com.example.fileshare/data/storage/el2/base/files/test2.txt"; - FileShare_PolicyInfo policy[policyNum] = { - {strTestPath1, static_cast(strlen(strTestPath1)), FileShare_OperationMode::READ_MODE}, - {strTestPath2, static_cast(strlen(strTestPath2)), FileShare_OperationMode::WRITE_MODE}}; - FileShare_PolicyErrorResult* result = nullptr; - uint32_t resultNum = 0; - napi_value napiResult; - std::string resultStr; - // [Start deactivate_permission_example] - auto ret = OH_FileShare_DeactivatePermission(policy, policyNum, &result, &resultNum); - if (ret != ERR_OK) { - if (ret == ERR_EPERM && result != nullptr) { - for (uint32_t i = 0; i < resultNum; i++) { - std::cout << "error uri: " << result[i].uri << std::endl; - std::cout << "error code: " << result[i].code << std::endl; - std::cout << "error message: " << result[i].message << std::endl; - // [StartExclude deactivate_permission_example] - resultStr += "error uri: "; - resultStr += result[i].uri; - resultStr += "\n"; - resultStr += "error code: "; - resultStr += result[i].code; - resultStr += "\n"; - resultStr += "error message: "; - resultStr += result[i].message; - resultStr += "\n"; - // [EndExclude deactivate_permission_example] - } - } - } - OH_FileShare_ReleasePolicyErrorResult(result, resultNum); - // [End deactivate_permission_example] - napi_status status = napi_create_string_utf8(env, resultStr.c_str(), NAPI_AUTO_LENGTH, &napiResult); - if (status != napi_ok) { - return nullptr; - } - return napiResult; -} - -static napi_value NAPI_OH_FileShare_RevokePermission(napi_env env, napi_callback_info info) -{ - static const uint32_t policyNum = 2; - char strTestPath1[] = "file://com.example.fileshare/data/storage/el2/base/files/test1.txt"; - char strTestPath2[] = "file://com.example.fileshare/data/storage/el2/base/files/test2.txt"; - FileShare_PolicyInfo policy[policyNum] = { - {strTestPath1, static_cast(strlen(strTestPath1)), FileShare_OperationMode::READ_MODE}, - {strTestPath2, static_cast(strlen(strTestPath2)), FileShare_OperationMode::WRITE_MODE}}; - FileShare_PolicyErrorResult* result = nullptr; - uint32_t resultNum = 0; - napi_value napiResult; - std::string resultStr; - // [Start revoke_permission_example] - auto ret = OH_FileShare_RevokePermission(policy, policyNum, &result, &resultNum); - if (ret != ERR_OK) { - if (ret == ERR_EPERM && result != nullptr) { - for (uint32_t i = 0; i < resultNum; i++) { - std::cout << "error uri: " << result[i].uri << std::endl; - std::cout << "error code: " << result[i].code << std::endl; - std::cout << "error message: " << result[i].message << std::endl; - // [StartExclude revoke_permission_example] - resultStr += "error uri: "; - resultStr += result[i].uri; - resultStr += "\n"; - resultStr += "error code: "; - resultStr += result[i].code; - resultStr += "\n"; - resultStr += "error message: "; - resultStr += result[i].message; - resultStr += "\n"; - // [EndExclude revoke_permission_example] - } - } - } - OH_FileShare_ReleasePolicyErrorResult(result, resultNum); - // [End revoke_permission_example] - napi_status status = napi_create_string_utf8(env, resultStr.c_str(), NAPI_AUTO_LENGTH, &napiResult); - if (status != napi_ok) { - return nullptr; - } - return napiResult; -} - -static napi_value NAPI_OH_FileShare_CheckPersistentPermission(napi_env env, napi_callback_info info) -{ - static const uint32_t policyNum = 2; - char strTestPath1[] = "file://com.example.fileshare/data/storage/el2/base/files/test1.txt"; - char strTestPath2[] = "file://com.example.fileshare/data/storage/el2/base/files/test2.txt"; - FileShare_PolicyInfo policy[policyNum] = { - {strTestPath1, static_cast(strlen(strTestPath1)), FileShare_OperationMode::READ_MODE}, - {strTestPath2, static_cast(strlen(strTestPath2)), FileShare_OperationMode::WRITE_MODE}}; - uint32_t resultNum = 0; - napi_value napiResult; - std::string resultStr; - // [Start check_persistent_permission_example] - bool *result = nullptr; - auto ret = OH_FileShare_CheckPersistentPermission(policy, policyNum, &result, &resultNum); - if (ret != ERR_OK) { - if (ret == ERR_EPERM && result != nullptr) { - for (uint32_t i = 0; i < resultNum && resultNum <= policyNum; i++) { - std::cout << "uri: " << policy[i].uri << std::endl; - std::cout << "result: " << result[i] << std::endl; - // [StartExclude check_persistent_permission_example] - resultStr += "uri: "; - resultStr += policy[i].uri; - resultStr += "\n"; - resultStr += "result: "; - resultStr += result[i]; - resultStr += "\n"; - // [EndExclude check_persistent_permission_example] - } - } - } - std::cout << "retCode: " << ret << std::endl; - free(result); - // [End check_persistent_permission_example] - napi_status status = napi_create_string_utf8(env, resultStr.c_str(), NAPI_AUTO_LENGTH, &napiResult); - if (status != napi_ok) { - return nullptr; - } - return napiResult; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "OH_FileShare_PersistPermission", nullptr, NAPI_OH_FileShare_PersistPermission, nullptr, nullptr, nullptr, - napi_default, nullptr }, - { "OH_FileShare_ActivatePermission", nullptr, NAPI_OH_FileShare_ActivatePermission, nullptr, nullptr, nullptr, - napi_default, nullptr }, - { "OH_FileShare_DeactivatePermission", nullptr, NAPI_OH_FileShare_DeactivatePermission, nullptr, nullptr, - nullptr, napi_default, nullptr }, - { "OH_FileShare_RevokePermission", nullptr, NAPI_OH_FileShare_RevokePermission, nullptr, nullptr, nullptr, - napi_default, nullptr }, - { "OH_FileShare_CheckPersistentPermission", nullptr, NAPI_OH_FileShare_CheckPersistentPermission, nullptr, - nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/types/libentry/Index.d.ts b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 55c491c6e10cf6cf237a6c3a351c69f216bac7a3..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const OH_FileShare_PersistPermission: () => string; - -export const OH_FileShare_ActivatePermission: () => string; - -export const OH_FileShare_DeactivatePermission: () => string; - -export const OH_FileShare_RevokePermission: () => string; - -export const OH_FileShare_CheckPersistentPermission: () => string; \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/types/libentry/oh-package.json5 b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 62f53acbc95e5be7985f8fb1fe2db591cea260bd..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/ets/pages/Index.ets b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 197ac7b6f943be8d872e331f4ae8fcc58d362d06..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'libentry.so'; - -@Entry -@Component -struct Index { - @State message: string = ''; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.size_15')) - .fontWeight(FontWeight.Bold) - Button($r('app.string.invokeInterfaceButton1')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - this.message = testNapi.OH_FileShare_PersistPermission(); - }) - Button($r('app.string.invokeInterfaceButton2')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - this.message = testNapi.OH_FileShare_ActivatePermission(); - }) - Button($r('app.string.invokeInterfaceButton3')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - this.message = testNapi.OH_FileShare_DeactivatePermission(); - }) - Button($r('app.string.invokeInterfaceButton4')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - this.message = testNapi.OH_FileShare_RevokePermission(); - }) - Button($r('app.string.invokeInterfaceButton5')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - this.message = testNapi.OH_FileShare_CheckPersistentPermission(); - }) - } - .width('100%') - } - .height('100%') - } -} diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/module.json5 b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/module.json5 deleted file mode 100644 index 25148c9e0e582c3ed037ae97ca8fad095ec7adb8..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone" - ], - "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": [ - "ohos.want.action.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/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/element/color.json b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/element/float.json b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/element/float.json deleted file mode 100644 index b8724de0724df917bb9d708b7422428398a86490..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "float": [ - { - "name": "size_5", - "value": "5" - }, - { - "name": "size_10", - "value": "10" - }, - { - "name": "size_15", - "value": "15" - }, - { - "name": "size_20", - "value": "20" - } - ] -} diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/element/string.json b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 622a2e862e2c547f24b39aaa5a9c3060a17fad7c..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "FileShareDevelopment_C" - }, - { - "name": "invokeInterfaceButton1", - "value": "PersistPermission" - }, - { - "name": "invokeInterfaceButton2", - "value": "ActivatePermission" - }, - { - "name": "invokeInterfaceButton3", - "value": "DeactivatePermission" - }, - { - "name": "invokeInterfaceButton4", - "value": "RevokePermission" - }, - { - "name": "invokeInterfaceButton5", - "value": "CheckPersistentPermission" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/background.png b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/foreground.png b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/layered_image.json b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/startIcon.png b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/dark/element/color.json b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/mock/Libentry.mock.ets b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index eebf1ed910f6a8f2a9e7e565aa71b179b7b8b537..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/mock/mock-config.json5 b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/ohosTest/module.json5 b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/ohosTest/module.json5 deleted file mode 100644 index a43680ca704ea9bf17ba9b9f88086a2735012c37..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/test/List.test.ets b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/test/LocalUnit.test.ets b/CoreFile/UserFile/FileShareDevelopment_C/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/hvigor/hvigor-config.json5 b/CoreFile/UserFile/FileShareDevelopment_C/hvigor/hvigor-config.json5 deleted file mode 100644 index b8fea3f097bd68b0bc4d87de986d2cb7732c1d9b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/CoreFile/UserFile/FileShareDevelopment_C/hvigorfile.ts b/CoreFile/UserFile/FileShareDevelopment_C/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileShareDevelopment_C/oh-package.json5 b/CoreFile/UserFile/FileShareDevelopment_C/oh-package.json5 deleted file mode 100644 index 69cb43cba3addcee1840403c67405134a2a9102c..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/UserFile/FileShareDevelopment_C/ohosTest.md b/CoreFile/UserFile/FileShareDevelopment_C/ohosTest.md deleted file mode 100644 index 2f2529b2ef5f0a31f02bb9da7ce9a989fa42e632..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileShareDevelopment_C/ohosTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|---------------------------|--------------------------------------------| ---- | -------------------------- |------| -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 否 | Pass | -| 测试OH_FileShare_PersistPermission接口 | 安装应用,进入首页 | | 成功运行 | 否 | Pass | -| 测试OH_FileShare_ActivatePermission接口 | 安装应用,进入首页 | | 成功运行 | 否 | pass | -| 测试OH_FileShare_DeactivatePermission接口 | 安装应用,进入首页 | | 成功运行 | 否 | pass | -| 测试OH_FileShare_RevokePermission接口 | 安装应用,进入首页 | | 成功运行 | 否 | pass | -| 测试OH_FileShare_CheckPersistentPermission接口 | 安装应用,进入首页 | | 成功运行 | 否 | pass | \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/.gitignore b/CoreFile/UserFile/FileUriDevelopment_C/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/UserFile/FileUriDevelopment_C/AppScope/app.json5 b/CoreFile/UserFile/FileUriDevelopment_C/AppScope/app.json5 deleted file mode 100644 index faa606f8a1db76b33e2b33740c17295753b56941..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.fileuridevelopment_c", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/CoreFile/UserFile/FileUriDevelopment_C/AppScope/resources/base/element/string.json b/CoreFile/UserFile/FileUriDevelopment_C/AppScope/resources/base/element/string.json deleted file mode 100644 index f1da2e079ed5b583dc877fbeb3909bb94e8fa4b4..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "FileUriDevelopment_C" - } - ] -} diff --git a/CoreFile/UserFile/FileUriDevelopment_C/AppScope/resources/base/media/app_icon.png b/CoreFile/UserFile/FileUriDevelopment_C/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileUriDevelopment_C/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/CoreFile/UserFile/FileUriDevelopment_C/PageImg/FileUriDevelopment_c.jpeg b/CoreFile/UserFile/FileUriDevelopment_C/PageImg/FileUriDevelopment_c.jpeg deleted file mode 100644 index e7a5dfae8c5213963db7ba118185abcfbf4ef0dd..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileUriDevelopment_C/PageImg/FileUriDevelopment_c.jpeg and /dev/null differ diff --git a/CoreFile/UserFile/FileUriDevelopment_C/README_zh.md b/CoreFile/UserFile/FileUriDevelopment_C/README_zh.md deleted file mode 100644 index 36f1a9fcb15ca19d47fcbf8584b77a29a0f3d3e5..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/README_zh.md +++ /dev/null @@ -1,96 +0,0 @@ -# FileUri开发指导(C/C++) - -### 介绍 - -该工程提供了关于文件URI的基本操作,对外提供了URI与沙箱路径之间互相转换、远端URI判定、获取URI所在目录路径的URI等接口,方便用户将文件URI与沙箱路径相互转换。该工程中展示的代码详细描述可查如下链接。 - -- [FileUri开发指导(C/C++)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/file-management/native-fileuri-guidelines.md) - -### 效果预览 - -|主页| -|--------------------------------| -|| - -使用说明: - -1. 在主界面,点击GetUriFromPath接口按钮获取代码里指定文件路径对应的uri,并输出到文本框里。 -2. 在主界面,点击GetPathFromUri接口按钮获取代码里指定uri对应的文件路径,并输出到文本框里。 -3. 在主界面,点击GetFullDirectoryUri接口按钮获取代码里指定文件uri所在路径的uri,并输出到文本框里。 -4. 在主界面,点击IsValidUri接口按钮判断代码里指定文件uri是否正确,并判断结果输出到文本框里。 -5. 在主界面,点击GetFileName接口按钮获取uri中的文件名称,并输出到文本框里。 -6. 切换到Deveco日志页面,搜索”HiAppEvent eventInfo“,出现以下日志。 - -``` -HiAppEvent eventInfo.WatcherType=OnTrigger: /data/storage/el2/base/haps/entry/files/test.txt -HiAppEvent eventInfo.WatcherType=OnTrigger: file://com.samples.fileuridevelopment_c/data/storage/el2/base/haps/entry/files/test.txt -HiAppEvent eventInfo.WatcherType=OnTrigger: file://com.samples.fileuridevelopment_c/data/storage/el2/base/haps/entry/files/test.txt -HiAppEvent eventInfo.WatcherType=OnTrigger: /data/storage/el2/base/haps/entry/files/test.txt -HiAppEvent eventInfo.WatcherType=OnTrigger: file://com.samples.fileuridevelopment_c/data/storage/el2/base/haps/entry/files/test.txt -HiAppEvent eventInfo.WatcherType=OnTrigger: file://com.samples.fileuridevelopment_c/data/storage/el2/base/haps/entry/files -HiAppEvent eventInfo.WatcherType=OnTrigger: file://com.samples.fileuridevelopment_c/data/storage/el2/base/haps/entry/files/test.txt -HiAppEvent eventInfo.WatcherType=OnTrigger: file://com.samples.fileuridevelopment_c/data/storage/el2/base/haps/entry/files/test.txt -HiAppEvent eventInfo.WatcherType=OnTrigger: test.txt -``` - - - -### 工程目录 - -``` -├──entry/src/main -| ├──cpp -| | └──CMakeLists.txt // 动态库链接 -| | └──napi_init.cpp // c++函数实现文件 -| | ├──types // c++函数配置目录 -| ├──ets -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -* 在CMake脚本中链接动态库,添加头文件。 - -* 调用OH_FileUri_GetUriFromPath接口,在接口中malloc的内存需要在使用完后释放,因此需要free对应的内存。 -* 调用OH_FileUri_GetPathFromUri通过URi转成对应的PATH,在接口中malloc的内存需要在使用完后释放,因此需要free对应的内存。 -* 调用OH_FileUri_GetFullDirectoryUri获取URI所在路径的URI,在接口中malloc的内存需要在使用完后释放,因此需要free对应的内存。 -* 调用OH_FileUri_IsValidUri接口进行URI格式验证。 -* 调用OH_FileUri_GetFileName获取URI中的文件名称,在接口中malloc的内存需要在使用完后释放,因此需要free对应的内存。 - -### 相关权限 - -不涉及 - -### 依赖 - -不涉及 - -### 约束与限制 - -1.转换或者判断URI类型之前必须保证传入的参数正确有效。 - -2.为保证数据的准确性,在转换或者判断过程中只允许处理一个对象。 - -3.本示例仅支持标准系统上运行,支持设备:RK3568。 - -4.本示例已适配API16版本SDK,版本号:5.1.0.47,镜像版本号:OpenHarmony5.1.0.47。 - -5.本示例需要使用DevEco Studio (5.0.3.910)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/UserFile/FileUriDevelopment_C > .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/CoreFile/UserFile/FileUriDevelopment_C/build-profile.json5 b/CoreFile/UserFile/FileUriDevelopment_C/build-profile.json5 deleted file mode 100644 index 4dc6ec2b7f3bc8e9765d5eb43fd5a99c7bcf9ef0..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/build-profile.json5 +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "5.0.4(16)", - "compatibleSdkVersion": "5.0.4(16)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "externalNativeOptions": { - "abiFilters": [ - "arm64-v8a", - "x86_64" - ], - "abiFilters": [ - "arm64-v8a", - "x86_64", - "armeabi-v7a" - ], - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/.gitignore b/CoreFile/UserFile/FileUriDevelopment_C/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/build-profile.json5 b/CoreFile/UserFile/FileUriDevelopment_C/entry/build-profile.json5 deleted file mode 100644 index 01bed8940ff6f2d5843f8d1d7e184725f59be699..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/build-profile.json5 +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/hvigorfile.ts b/CoreFile/UserFile/FileUriDevelopment_C/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/FileUriDevelopment_C/entry/obfuscation-rules.txt b/CoreFile/UserFile/FileUriDevelopment_C/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/UserFile/FileUriDevelopment_C/entry/oh-package.json5 b/CoreFile/UserFile/FileUriDevelopment_C/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/CMakeLists.txt b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 0492dce8c055fce65a30e726a96fe5723b4fe846..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(FileUriDevelopment_C) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libohfileuri.so libhilog_ndk.z.so) \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/napi_init.cpp b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index d386293db255ec7ee94f20e280ff65678b93d265..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include -#include -#include - -#undef LOG_TAG -#define LOG_TAG "Sample_fileUri" - -// [Start get_uri_from_path_example] -static napi_value NAPI_Global_OH_FileUri_GetUriFromPathExample(napi_env env, napi_callback_info info) -{ - // [StartExclude get_uri_from_path_example] - // 参数个数为1 - size_t argc = 1; - napi_value args[1] = { nullptr }; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - // 获取字符串的长度,初始化字符串长度为0 - size_t strLength = 0; - napi_get_value_string_utf8(env, args[0], nullptr, 0, &strLength); - // [EndExclude get_uri_from_path_example] - // 为 char* uri 分配内存 - char *path = new char[strLength + 1]; // +1 for null terminator - // 将 JavaScript 字符串复制到 uri - // [StartExclude get_uri_from_path_example] - napi_get_value_string_utf8(env, args[0], path, strLength + 1, &strLength); - // [EndExclude get_uri_from_path_example] - unsigned int length = strlen(path); - // 输出传入路径字符串 - // [StartExclude get_uri_from_path_example] - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", path); - // [EndExclude get_uri_from_path_example] - char *uriResult = nullptr; - FileManagement_ErrCode ret = OH_FileUri_GetUriFromPath(path, length, &uriResult); - // 输出结果uri字符串 - // [StartExclude get_uri_from_path_example] - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", uriResult); - napi_value result; - // [EndExclude get_uri_from_path_example] - if (ret == 0 && uriResult != nullptr) { - // 将C字符串转换为napi_value - napi_status status = napi_create_string_utf8(env, uriResult, NAPI_AUTO_LENGTH, &result); - if (status != napi_ok) { - free(uriResult); - return nullptr; - } - free(uriResult); // 释放临时字符串 - } else { - // 将C字符串转换为napi_value - napi_status status = napi_create_string_utf8(env, "Hello World", NAPI_AUTO_LENGTH, &result); - if (status != napi_ok) { - return nullptr; - } - } - return result; -} -// [End get_uri_from_path_example] - -// [Start get_path_from_uri_example] -static napi_value NAPI_Global_OH_FileUri_GetPathFromUriExample(napi_env env, napi_callback_info info) -{ - // [StartExclude get_path_from_uri_example] - // 参数个数为1 - size_t argc = 1; - napi_value args[1] = { nullptr }; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - // 获取字符串的长度,初始化字符串长度为0 - size_t strLength = 0; - napi_get_value_string_utf8(env, args[0], nullptr, 0, &strLength); - // 为 char* uri 分配内存 - // [EndExclude get_path_from_uri_example] - char *uri = new char[strLength + 1]; // +1 for null terminator - // 将 JavaScript 字符串复制到 uri - napi_get_value_string_utf8(env, args[0], uri, strLength + 1, &strLength); - - unsigned int length = strlen(uri); - // 输出传入uri符串 - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", uri); - char *pathResult = nullptr; - FileManagement_ErrCode ret = OH_FileUri_GetPathFromUri(uri, length, &pathResult); - // 输出获取路径结果符串 - // [StartExclude get_path_from_uri_example] - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", pathResult); - napi_value result; - // [EndExclude get_path_from_uri_example] - if (ret == 0 && pathResult != nullptr) { - // 将C字符串转换为napi_value - napi_status status = napi_create_string_utf8(env, pathResult, NAPI_AUTO_LENGTH, &result); - if (status != napi_ok) { - free(pathResult); - return nullptr; - } - free(pathResult); // 释放临时字符串 - } else { - // 将空字符串转换为napi_value - napi_status status = napi_create_string_utf8(env, "", NAPI_AUTO_LENGTH, &result); - if (status != napi_ok) { - return nullptr; - } - } - return result; -} -// [End get_path_from_uri_example] - -// [Start get_full_directory_uri] -static napi_value NAPI_Global_OH_FileUri_GetFullDirectoryUriExample(napi_env env, napi_callback_info info) -{ - // [StartExclude get_full_directory_uri] - // 参数个数为1 - size_t argc = 1; - napi_value args[1] = { nullptr }; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - // 获取字符串的长度,初始化字符串长度为0 - size_t strLength = 0; - napi_get_value_string_utf8(env, args[0], nullptr, 0, &strLength); - // 为 char* uri 分配内存 - // [EndExclude get_full_directory_uri] - char *uri = new char[strLength + 1]; // +1 for null terminator - // 将 JavaScript 字符串复制到 uri - napi_get_value_string_utf8(env, args[0], uri, strLength + 1, &strLength); - - unsigned int length = strlen(uri); - // 输出传入uri字符串 - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", uri); - char *uriResult = nullptr; - FileManagement_ErrCode ret = OH_FileUri_GetFullDirectoryUri(uri, length, &uriResult); - // 输出所在路径uri字符串 - // [StartExclude get_full_directory_uri] - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", uriResult); - napi_value result = nullptr; - // [EndExclude get_full_directory_uri] - if (ret == 0 && uriResult != nullptr) { - // 使用napi接口创建一个字符串类型的napi_value来返回正确结果 - napi_create_string_utf8(env, uriResult, NAPI_AUTO_LENGTH, &result); - } else { - // 使用napi接口创建一个表示null值的napi_value来返回错误或空值情况 - napi_get_null(env, &result); - } - if (uriResult != nullptr) { - free(uriResult); - } - return result; -} -// [End get_full_directory_uri] - -// [Start is_valid_uri_example] -static napi_value NAPI_Global_OH_FileUri_IsValidUriExample(napi_env env, napi_callback_info info) -{ - // [StartExclude is_valid_uri_example] - // 参数个数为1 - size_t argc = 1; - napi_value args[1] = { nullptr }; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - // 获取字符串的长度,初始化字符串长度为0 - size_t strLength = 0; - napi_get_value_string_utf8(env, args[0], nullptr, 0, &strLength); - // 为 char* uri 分配内存 - // [EndExclude is_valid_uri_example] - char *uri = new char[strLength + 1]; // +1 for null terminator - // 将 JavaScript 字符串复制到 uri - napi_get_value_string_utf8(env, args[0], uri, strLength + 1, &strLength); - unsigned int length = strlen(uri); - // 输出传入uri字符串 - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", uri); - bool flags = OH_FileUri_IsValidUri(uri, length); - // [StartExclude is_valid_uri_example] - napi_value result; - // 将bool值转换为napi_value - napi_status status = napi_get_boolean(env, flags, &result); - if (status != napi_ok) { - // 处理错误 - napi_throw_error(env, nullptr, "Failed to convert boolean to napi_value"); - return nullptr; - } - return result; - // [EndExclude is_valid_uri_example] -} -// [End is_valid_uri_example] - -// [Start get_file_name_example] -static napi_value NAPI_Global_OH_FileUri_GetFileNameExample(napi_env env, napi_callback_info info) -{ - // [StartExclude get_file_name_example] - // 参数个数为1 - size_t argc = 1; - napi_value args[1] = { nullptr }; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - // 获取字符串的长度,初始化字符串长度为0 - size_t strLength = 0; - napi_get_value_string_utf8(env, args[0], nullptr, 0, &strLength); - // 为 char* uri 分配内存 - // [EndExclude get_file_name_example] - char *uri = new char[strLength + 1]; // +1 for null terminator - // 将 JavaScript 字符串复制到 uri - napi_get_value_string_utf8(env, args[0], uri, strLength + 1, &strLength); - - unsigned int length = strlen(uri); - // 输出传入uri字符串 - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", uri); - char *uriResult = nullptr; - FileManagement_ErrCode ret = OH_FileUri_GetFileName(uri, length, &uriResult); - // 输出获取到的文件名称 - // [StartExclude get_file_name_example] - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger: %{public}s", uriResult); - napi_value result; - // [EndExclude get_file_name_example] - if (ret == 0 && uriResult != nullptr) { - // 将C字符串转换为napi_value - napi_status status = napi_create_string_utf8(env, uriResult, NAPI_AUTO_LENGTH, &result); - if (status != napi_ok) { - free(uriResult); - return NULL; - } - free(uriResult); // 释放临时字符串 - } else { - // 将空字符串转换为napi_value - napi_status status = napi_create_string_utf8(env, "", NAPI_AUTO_LENGTH, &result); - if (status != napi_ok) { - return nullptr; - } - } - return result; -} -// [End get_file_name_example] - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - {"OH_FileUri_GetUriFromPathExample", nullptr, NAPI_Global_OH_FileUri_GetUriFromPathExample, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"OH_FileUri_GetPathFromUriExample", nullptr, NAPI_Global_OH_FileUri_GetPathFromUriExample, nullptr, nullptr, - nullptr, napi_default, nullptr}, - {"OH_FileUri_GetFullDirectoryUriExample", nullptr, NAPI_Global_OH_FileUri_GetFullDirectoryUriExample, nullptr, - nullptr, nullptr, napi_default, nullptr}, - {"OH_FileUri_IsValidUriExample", nullptr, NAPI_Global_OH_FileUri_IsValidUriExample, nullptr, nullptr, nullptr, - napi_default, nullptr}, - {"OH_FileUri_GetFileNameExample", nullptr, NAPI_Global_OH_FileUri_GetFileNameExample, nullptr, nullptr, nullptr, - napi_default, nullptr}}; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, // 模块版本号,设置为1遵循当前的 N-API 版本规范 - .nm_flags = 0, // 模块标志,设置为0,表示没有特殊标志 - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, // 保留字段,通常初始化为0 -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/types/libentry/Index.d.ts b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 2385e74adf0d95611ec79daf797336daeeaa25a0..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const OH_FileUri_GetUriFromPathExample: (path: string) => string; - -export const OH_FileUri_GetPathFromUriExample: (uri: string) => string; - -export const OH_FileUri_GetFullDirectoryUriExample: (uri: string) => string; - -export const OH_FileUri_IsValidUriExample: (uri: string) => boolean; - -export const OH_FileUri_GetFileNameExample: (uri: string) => string; \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/types/libentry/oh-package.json5 b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/common/Logger.ts b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index 148b9e9cacba97fab13dcc6526e2f0ed4143ff0f..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN: number = 0x0000; // 此处使用自行申请的应用代码号 -const PREFIX: string = '[Sample_FileUriDevelopment_C]'; // 应用log标签 - -export class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = DOMAIN; - } - - getDomain() { - return this.domain; - } - - getPrefix() { - return this.prefix; - } - - getFormat() { - return this.format; - } - - debug(...args: string[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]) { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number) { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger(PREFIX); diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index c5539bddd7a772710f55da0ddd7b5676305469de..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b74fe507979e31c9d239b7f29ea9102f6144b7cf..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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 { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -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/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/pages/Index.ets b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 529cb201a958a3f55b0c1aff286349382b67cbe2..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2025 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 { buffer } from '@kit.ArkTS'; -import { fileUri, fileIo as fs, ReadOptions } from '@kit.CoreFileKit'; -import common from '@ohos.app.ability.common'; -import Logger from '../common/Logger'; -import testNapi from 'libentry.so'; - -// 获取应用文件沙箱路径 -let context = getContext(this) as common.UIAbilityContext; -let filesDir = context.filesDir; -let filePath = filesDir + '/test.txt'; // 文件路径 -let uri = fileUri.getUriFromPath(filePath); // 从文件路径获取 URI - -export function createFile(): string { - // 新建并打开文件 - let file = fs.openSync(filesDir + '/test.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - // 写入一段内容至文件 - let writeLen = fs.writeSync(file.fd, 'Try to write str : hello world'); - Logger.info('The length of str is: ' + writeLen); // 写入内容的长度 - // 从文件读取一段内容 - let arrayBuffer = new ArrayBuffer(1024); // 分配一个 1024 字节的缓冲区 - let readOptions: ReadOptions = { - offset: 0, // 从文件的开头开始读取 - length: arrayBuffer.byteLength // 读取的长度为缓冲区的大小 - }; - let readLen = fs.readSync(file.fd, arrayBuffer, readOptions); // 实际读取的字节数 - // 这个 buf 对象是 arrayBuffer 中从位置 0 开始的前 readLen 字节 - let buf = buffer.from(arrayBuffer, 0, readLen); - Logger.info('the content of file: ' + buf.toString()); // 打印文件内容 - let str = 'the content of file: ' + buf.toString(); - // 关闭文件 - fs.closeSync(file); - return str; -} - -@Entry -@Component -struct Index { - @State message: string = ''; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.size_50')) // 设置字体大小为 50 - .fontWeight(FontWeight.Bold) - Button($r('app.string.invokeInterfaceButton1')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - createFile(); - this.message = testNapi.OH_FileUri_GetUriFromPathExample(filePath); - }) - - Button($r('app.string.invokeInterfaceButton2')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - this.message = testNapi.OH_FileUri_GetPathFromUriExample(uri); - }) - - Button($r('app.string.invokeInterfaceButton3')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - this.message = testNapi.OH_FileUri_GetFullDirectoryUriExample(uri); - }) - - Button($r('app.string.invokeInterfaceButton4')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - if (testNapi.OH_FileUri_IsValidUriExample(uri)) { - this.message = 'UriIsTrue'; - } - }) - - Button($r('app.string.invokeInterfaceButton5')) - .width('80%') // 设置按钮宽度为 80% - .height('10%') // 设置按钮高度为 10% - .margin({ top: $r('app.float.size_20') }) // 设置按钮上边距为 20 - .onClick(() => { - this.message = testNapi.OH_FileUri_GetFileNameExample(uri); - }) - } - .width('100%') // 设置列的宽度为 100% - } - .height('100%') // 设置行的高度为 100% - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/module.json5 b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/module.json5 deleted file mode 100644 index 4144486d1af4c03b0d767cce1cda86fc0d697f91..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/element/color.json b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/element/color.json deleted file mode 100644 index b99ebd2b9c4b3a455465e850b4eeee9548ba886a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "whiteColor", - "value": "#FFFFFF" - }, - { - "name": "lightGrayColor", - "value": "#F0F0F0" - }, - { - "name": "grayColor", - "value": "#808080" - }, - { - "name": "blackColor", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/element/float.json b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 30e6a4c0edf724b1459705043d7488912328bd16..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "float": [ - { - "name": "size_5", - "value": "10" - }, - { - "name": "size_10", - "value": "10" - }, - { - "name": "size_13", - "value": "13" - }, - { - "name": "size_15", - "value": "15" - }, - { - "name": "size_20", - "value": "20" - }, - { - "name": "size_25", - "value": "25" - }, - { - "name": "size_40", - "value": "40" - }, - { - "name": "size_50", - "value": "50" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/element/string.json b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/element/string.json deleted file mode 100644 index c1fa7ac34d315f0057cd5a2f0d33f890a3d768dd..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "FileUriDevelopment_C" - }, - { - "name": "invokeInterfaceButton1", - "value": "GetUriFromPath" - }, - { - "name": "invokeInterfaceButton2", - "value": "GetPathFromUri" - }, - { - "name": "invokeInterfaceButton3", - "value": "GetFullDirectoryUri" - }, - { - "name": "invokeInterfaceButton4", - "value": "IsValidUri" - }, - { - "name": "invokeInterfaceButton5", - "value": "GetFileName" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/background.png b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/foreground.png b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/layered_image.json b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/startIcon.png b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/en_US/element/string.json b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index db4dedd6b71384eef6ce60ec319fedbaf5b5f99f..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "FileUriDevelopment_C" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/zh_CN/element/string.json b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 5cb723ed88048c84158b1ac0b1d423cdfc5567f6..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "FileUriDevelopment_C" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index d1adb0ac477672784a3591e55bcd03a7b9ade3f3..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { describe, it, expect } from '@ohos/hypium'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const TAG = '[Sample_FileUriDevelopment_c]'; -const DOMAIN = 0xF811; -const BUNDLE = 'FileUriDevelopment_c_'; -const DELAY_TIME_1S = 1000; - -const DELEGATOR: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const BUNDLENAME = abilityDelegatorRegistry.getArguments().bundleName; - -export default function abilityTest() { - describe('FileUriDevelopment_cTest', () => { - /** - * @tc.number CoreFileKit_StartAbility_001 - * @tc.name CoreFileKit_StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,begin'); - // start tested ability - const want: Want = { - bundleName: BUNDLENAME, - abilityName: 'EntryAbility' - }; - await DELEGATOR.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME_1S); - // check top display ability - const ability: UIAbility = await DELEGATOR.getCurrentTopAbility(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,end'); - }) - /** - * @tc.number CoreFileKit_InterfaceTest_001 - * @tc.name CoreFileKit_InterfaceTest_001 - * @tc.desc 测试接口OH_FileUri_GetUriFromPath - */ - it(BUNDLE + 'InterfaceTest_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_001, begin'); - // 初始化 Driver,用于 UI 操作 - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - // 查找按钮组件 - const getUriFromPathButton = await driver.findComponent(ON.text('GetUriFromPath')); - // 点击按钮 - await getUriFromPathButton.click(); - // 等待 1000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - // 检查文本组件是否改变 - await driver.assertComponentExist( - ON.text('file://' + BUNDLENAME + '/data/storage/el2/base/haps/entry/files/test.txt') - ); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_001, end'); - done(); - }) - /** - * @tc.number CoreFileKit_InterfaceTest_002 - * @tc.name CoreFileKit_InterfaceTest_002 - * @tc.desc 测试接口OH_FileUri_GetPathFromUri - */ - it(BUNDLE + 'InterfaceTest_002', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_002, begin'); - // 初始化 Driver,用于 UI 操作 - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - // 查找按钮组件 - const getPathFromUriButton = await driver.findComponent(ON.text('GetPathFromUri')); - // 点击按钮 - await getPathFromUriButton.click(); - // 等待 1000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('/data/storage/el2/base/haps/entry/files/test.txt')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_002, end'); - done(); - }) - /** - * @tc.number CoreFileKit_InterfaceTest_003 - * @tc.name CoreFileKit_InterfaceTest_003 - * @tc.desc 测试接口OH_FileUri_GetFullDirectoryUri - */ - it(BUNDLE + 'InterfaceTest_003', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_003, begin'); - // 初始化 Driver,用于 UI 操作 - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - // 查找按钮组件 - const getFullDirectoryUriButton = await driver.findComponent(ON.text('GetFullDirectoryUri')); - // 点击按钮 - await getFullDirectoryUriButton.click(); - // 等待 1000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('file://' + BUNDLENAME + '/data/storage/el2/base/haps/entry/files')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_003, end'); - done(); - }) - /** - * @tc.number CoreFileKit_InterfaceTest_004 - * @tc.name CoreFileKit_InterfaceTest_004 - * @tc.desc 测试接口OH_FileUri_IsValidUri - */ - it(BUNDLE + 'InterfaceTest_004', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_004, begin'); - // 初始化 Driver,用于 UI 操作 - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - // 查找按钮组件 - const isValidUriButton = await driver.findComponent(ON.text('IsValidUri')); - // 点击按钮 - await isValidUriButton.click(); - // 等待 1000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('UriIsTrue')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_004, end'); - done(); - }) - /** - * @tc.number CoreFileKit_InterfaceTest_005 - * @tc.name CoreFileKit_InterfaceTest_005 - * @tc.desc 测试接口OH_FileUri_GetFileName - */ - it(BUNDLE + 'InterfaceTest_005', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_005, begin'); - // 初始化 Driver,用于 UI 操作 - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - // 查找按钮组件 - const getFileNameButton = await driver.findComponent(ON.text('GetFileName')); - // 点击按钮 - await getFileNameButton.click(); - // 等待 1000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('test.txt')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'InterfaceTest_005, end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/ohosTest/module.json5 b/CoreFile/UserFile/FileUriDevelopment_C/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/UserFile/FileUriDevelopment_C/hvigor/hvigor-config.json5 b/CoreFile/UserFile/FileUriDevelopment_C/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/FileUriDevelopment_C/hvigorfile.ts b/CoreFile/UserFile/FileUriDevelopment_C/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/FileUriDevelopment_C/oh-package.json5 b/CoreFile/UserFile/FileUriDevelopment_C/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/UserFile/FileUriDevelopment_C/ohosTest.md b/CoreFile/UserFile/FileUriDevelopment_C/ohosTest.md deleted file mode 100644 index 7e0bd48c959710787f1d4a3416f8489c873cbf2d..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/FileUriDevelopment_C/ohosTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# FileUriDevelopment_C 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ---------------------------------- | ------------------ | ---- | ---------------------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 调用OH_FileUri_GetUriFromPath | 安装应用,进入首页 | | 获取到的URI输出到应用页面文本框内 | 是 | Pass | -| 调用OH_FileUri_GetPathFromUri | 安装应用,进入首页 | | 获取到的PATH输出到应用页面文本框内 | 是 | Pass | -| 调用OH_FileUri_GetFullDirectoryUri | 安装应用,进入首页 | | 获取URI所在路径的URI输出到应用页面文本框 | 是 | Pass | -| 调用OH_FileUri_IsValidUri | 安装应用,进入首页 | | 将URI判断结果输出到应用页面文本框 | 是 | Pass | -| 调用OH_FileUri_GetFileName | 安装应用,进入首页 | | 获取URI中的文件名称输出到应用页面文本框 | 是 | Pass | - diff --git a/CoreFile/UserFile/SavingUserFiles/.gitignore b/CoreFile/UserFile/SavingUserFiles/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/UserFile/SavingUserFiles/AppScope/app.json5 b/CoreFile/UserFile/SavingUserFiles/AppScope/app.json5 deleted file mode 100644 index f0844e5ac72ef36746b8940c401e2f02e689fc8a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.savinguserfiles", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/CoreFile/UserFile/SavingUserFiles/AppScope/resources/base/element/string.json b/CoreFile/UserFile/SavingUserFiles/AppScope/resources/base/element/string.json deleted file mode 100644 index 371fd0d4b2690a89cd3385ba1d4dbec3045f3c64..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "SavingUserFiles" - } - ] -} diff --git a/CoreFile/UserFile/SavingUserFiles/AppScope/resources/base/media/app_icon.png b/CoreFile/UserFile/SavingUserFiles/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SavingUserFiles/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/CoreFile/UserFile/SavingUserFiles/PageImg/SavingUserFiles.jpeg b/CoreFile/UserFile/SavingUserFiles/PageImg/SavingUserFiles.jpeg deleted file mode 100644 index 177fa6325670bbe63c13378738bff744d29d6d7d..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SavingUserFiles/PageImg/SavingUserFiles.jpeg and /dev/null differ diff --git a/CoreFile/UserFile/SavingUserFiles/README_zh.md b/CoreFile/UserFile/SavingUserFiles/README_zh.md deleted file mode 100644 index 5b3ab9b09c756dede75f0c6b04c16959c9434dbf..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/README_zh.md +++ /dev/null @@ -1,78 +0,0 @@ -# 保存用户文件 - -### 介绍 - -本示例主要展示了有关保存用户文件的功能,使用PhotoViewPicker、PhotoAccessHelper、@ohos.file.picker(选择器)、@ohos.file.fs (文件管理)、fs.openSync、fs.writeSync、AudioViewPicker等,实现了保存文件的功能。该工程中展示的代码与接口等详细描述可查如下链接。 - -- [保存用户文件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/save-user-file.md) - -### 效果预览 - -|主页| -|--------------------------------| -|首页| - -使用说明: - -1. 在主界面,然后点击SaveDocument按钮,选择保存的路径并确认,成功后返回成功结果到页面文本框,并在日志中输出“write data to file succeed and size is:”内容。 -2. 点击ReadFiles按钮,选择指定文件夹下的文档类文件,将选择成功结果输出到页面文本框中,并在日志中输出“readSync data to file succeed and buffer size is:”内容,验证保存文件是否成功。 -3. 点击SaveAudioFiles按钮,选择保存文件的路径,成功将保存成功结果返回到页面文本框中,并在日志中输出“write data to file succeed and size is:”内容。 - -### 工程目录 - -``` -├──entry/src/main -| ├──ets -| | ├──common -| | | └──Logger.ts // 日志打印封装类 -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -* 保存文档类文件: - * * 导入[@ohos.file.picker(选择器)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-picker.md)模块和[@ohos.file.fs (文件管理)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md)模块。 - * 创建文档保存选项实例。 - * 创建文件选择器DocumentViewPicker实例。调用save()接口拉起FilePicker界面进行文件保存。 - * 待界面从FilePicker返回后,使用基础文件API的fs.openSync接口,通过URI打开这个文件得到文件描述符(fd)。 - * 通过(fd)使用基础文件API的fs.writeSync接口对这个文件进行编辑修改,编辑修改完成后关闭(fd)。 -* 保存音频类文件: - * * 导入[@ohos.file.picker(选择器)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-picker.md)模块和[@ohos.file.fs (文件管理)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md)模块。 - * 创建音频保存选项实例。 - * 创建音频选择器AudioViewPicker实例。调用save()接口拉起FilePicker界面进行文件保存。 - * 待界面从FilePicker返回后,可以使用基础文件API的fs.openSync接口,通过URI打开这个文件得到文件描述符(fd)。 - * 通过(fd)使用基础文件API的fs.writeSync接口对这个文件进行编辑修改,编辑修改完成后关闭(fd)。 - -### 相关权限 - -不涉及 - -### 依赖 - -不涉及 - -### 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:RK3568。 - -2.本示例已适配API16版本SDK,版本号:5.1.0.47。 - -3.本示例需要使用DevEco Studio (5.0.3.910)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/UserFile/SavingUserFiles > .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/CoreFile/UserFile/SavingUserFiles/build-profile.json5 b/CoreFile/UserFile/SavingUserFiles/build-profile.json5 deleted file mode 100644 index 3f8522bc1155d9eacd9e4127237bcbb47a28e4b6..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/build-profile.json5 +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "externalNativeOptions": { - "abiFilters": [ - "arm64-v8a", - "x86_64" - ], - "abiFilters": [ - "arm64-v8a", - "x86_64", - ] - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/.gitignore b/CoreFile/UserFile/SavingUserFiles/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/build-profile.json5 b/CoreFile/UserFile/SavingUserFiles/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/hvigorfile.ts b/CoreFile/UserFile/SavingUserFiles/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/SavingUserFiles/entry/obfuscation-rules.txt b/CoreFile/UserFile/SavingUserFiles/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/UserFile/SavingUserFiles/entry/oh-package.json5 b/CoreFile/UserFile/SavingUserFiles/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/common/Logger.ts b/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index d6af62689d8188da61eb7692924fc9d7ffbc9d8d..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN: number = 0x0000; // 此处使用自行申请的应用代码号 -const PREFIX: string = '[Sample_SavingUserFiles]'; // 应用log标签 - -export class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = DOMAIN; - } - - getDomain() { - return this.domain; - } - - getPrefix() { - return this.prefix; - } - - getFormat() { - return this.format; - } - - debug(...args: string[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]) { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number) { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger(PREFIX); diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index edc2839f203ba057c186e19b0cbbbf80c8faa8b3..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 8a761988f4c83de80122362bdb8c56efa80e139f..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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 { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - - -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/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/pages/Index.ets b/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index d15f2cbaeb39489ccd51ef0abf8aec0825b21488..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_interface_save] -import { fileUri, picker } from '@kit.CoreFileKit'; -import { fileIo as fs } from '@kit.CoreFileKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { common } from '@kit.AbilityKit'; -// [End import_interface_save] - -@Entry -@Component -struct Index { - @State text: string = ''; - @State documentResult: string = ''; - @State result: string = ''; - @State downloadResult: string = ''; - @State uri_image: string = ''; - @State uri: string = ''; - @State documentUris: string[] = []; - - build() { - Column({ space: $r('app.float.size_10') }) { - Row({ space: $r('app.float.size_10') }) { - // 写入文件按钮 - Button($r('app.string.saveDocumentButton')) - .width('50%') // 按钮宽度占屏幕宽度50% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.saveDocumentFile(); - }) - // 读取文件按钮 - Button($r('app.string.readFilesButton')) - .width('30%') // 按钮宽度占屏幕宽度30% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.selectDocumentFiles(); - }) - } - Text(this.documentResult) - .fontSize($r('app.float.size_50')) // 文本字体大小为50 - .fontWeight(FontWeight.Bold) // 文本字体加粗 - .margin({ top: $r('app.float.size_20') }) // 文本上边距为20 - // 保存音频文件按钮 - Button($r('app.string.saveAudioFilesButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.saveAudioFile(); - }) - // 显示文件URI - Text(this.result) - .fontSize($r('app.float.size_50')) // 文本字体大小为50 - .fontWeight(FontWeight.Bold) // 文本字体加粗 - .margin({ top: $r('app.float.size_20') }) // 文本上边距为20 - // Download按钮 - Button($r('app.string.downloadSaveFileButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.downLoad(); - }) - // 显示downloadResult。 - Text(this.downloadResult) - .fontSize($r('app.float.size_50')) // 文本字体大小为50 - .fontWeight(FontWeight.Bold) // 文本字体加粗 - .margin({ top: $r('app.float.size_20') }) // 文本上边距为20 - } - .width('100%') // 外层列布局宽度占满屏幕 - .height('100%') // 外层列布局高度占满屏幕 - .alignItems(HorizontalAlign.Center) // 水平居中对齐 - .justifyContent(FlexAlign.Center) // 垂直居中对齐 - .backgroundColor($r('app.color.lightGrayColor')) // 背景颜色为浅灰色 - } - - saveDocumentFile() { - try { - // [Start document_save_options] - const documentSaveOptions = new picker.DocumentSaveOptions(); - documentSaveOptions.newFileNames = ['DocumentViewPicker01.txt']; - documentSaveOptions.fileSuffixChoices = ['文档|.txt', '.pdf']; - // [End document_save_options] - - // [Start save_file_picker] - let uris: string[] = []; - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - const documentViewPicker = new picker.DocumentViewPicker(context); - documentViewPicker.save(documentSaveOptions).then((documentSaveResult: string[]) => { - uris = documentSaveResult; - console.info('documentViewPicker.save to file succeed and uris are:' + uris); - // [StartExclude save_file_picker] - this.writeDocumentFile(uris); - // [EndExclude save_file_picker] - }).catch((err: BusinessError) => { - console.error(`Invoke documentViewPicker.save failed, code is ${err.code}, message is ${err.message}`); - }); - // [End save_file_picker] - }catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - } - - writeDocumentFile(uris: string[]) { - try { - // [Start document_open_mode] - if (uris.length > 0) { - let uri: string = uris[0]; - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); - console.info('file fd: ' + file.fd); - // [Start document_writesync] - let writeLen: number = fs.writeSync(file.fd, 'hello, world'); - console.info('write data to file succeed and size is:' + writeLen); - fs.closeSync(file); - // [End document_writesync] - } - // [End document_open_mode] - }catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - } - - selectDocumentFiles() { - try { - const documentSelectOptions = new picker.DocumentSelectOptions(); - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - const documentViewPicker = new picker.DocumentViewPicker(context); - documentViewPicker.select(documentSelectOptions).then((documentSelectResult: string[]) => { - this.documentUris = documentSelectResult; - console.info('documentViewPicker.select to file succeed and uris are:' + this.documentUris); - if (this.documentUris.length > 0) { - this.readDocumentFile(this.documentUris[0]); - } - }).catch((err: BusinessError) => { - console.error(`Invoke documentViewPicker.select failed, code is ${err.code}, message is ${err.message}`); - }); - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - } - - readDocumentFile(uri: string) { - try { - let file = fs.openSync(uri, fs.OpenMode.READ_ONLY); - console.info('file fd: ' + file.fd); - let buffer = new ArrayBuffer(4096); // 创建一个 4096 字节的缓冲区 - let readLen = fs.readSync(file.fd, buffer); - console.info('readSync data to file succeed and buffer size is:' + readLen); - this.documentResult = 'Successfully read the file'; - fs.closeSync(file); - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - } - - saveAudioFile() { - try { - // [Start audio_save_options] - const audioSaveOptions = new picker.AudioSaveOptions(); - audioSaveOptions.newFileNames = ['AudioViewPicker03.mp3']; // 保存文件名(可选) - // [End audio_save_options] - - // [Start audio_save_file] - let uris: string[] = []; - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - const audioViewPicker = new picker.AudioViewPicker(context); - audioViewPicker.save(audioSaveOptions).then((audioSelectResult: string[]) => { - uris = audioSelectResult; - console.info('audioViewPicker.save to file succeed and uri is:' + uris); - // [StartExclude audio_save_file] - this.writeAudioFile(uris); - // [EndExclude audio_save_file] - }).catch((err: BusinessError) => { - console.error(`Invoke audioViewPicker.save failed, code is ${err.code}, message is ${err.message}`); - }); - // [End audio_save_file] - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - } - - writeAudioFile(uris: string[]) { - try { - // [Start audio_open_mode] - if (uris.length > 0) { - let uri: string = uris[0]; - //这里需要注意接口权限参数是fileIo.OpenMode.READ_WRITE。 - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); - console.info('file fd: ' + file.fd); - // [Start audio_write_sync] - let writeLen = fs.writeSync(file.fd, 'hello, world'); - console.info('write data to file succeed and size is:' + writeLen); - fs.closeSync(file); - // [End audio_write_sync] - } - // [End audio_open_mode] - this.result = 'Successfully saved audio files'; - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - } - - downLoad() { - try { - // [Start download_save_file] - let uri: string = ''; - // 请在组件内获取context,确保this.getUIContext().getHostContext()返回结果为UIAbilityContext - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - const documentViewPicker = new picker.DocumentViewPicker(context); - // [Start download_save_options] - const documentSaveOptions = new picker.DocumentSaveOptions(); - // 配置保存的模式为DOWNLOAD,若配置了DOWNLOAD模式,此时配置的其他documentSaveOptions参数将不会生效。 - documentSaveOptions.pickerMode = picker.DocumentPickerMode.DOWNLOAD; - // [End download_save_options] - documentViewPicker.save(documentSaveOptions).then((documentSaveResult: Array) => { - uri = documentSaveResult[0]; - console.info('documentViewPicker.save succeed and uri is:' + uri); - const testFilePath = new fileUri.FileUri(uri + '/test.txt').path; - const file = fs.openSync(testFilePath, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE); - fs.writeSync(file.fd, 'Hello World!'); - fs.closeSync(file.fd); - }).catch((err: BusinessError) => { - console.error(`Invoke documentViewPicker.save failed, code is ${err.code}, message is ${err.message}`); - }) - // [End download_save_file] - this.downloadResult = 'Successfully download'; - } catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/module.json5 b/CoreFile/UserFile/SavingUserFiles/entry/src/main/module.json5 deleted file mode 100644 index 4144486d1af4c03b0d767cce1cda86fc0d697f91..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/element/color.json b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/element/color.json deleted file mode 100644 index b99ebd2b9c4b3a455465e850b4eeee9548ba886a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "whiteColor", - "value": "#FFFFFF" - }, - { - "name": "lightGrayColor", - "value": "#F0F0F0" - }, - { - "name": "grayColor", - "value": "#808080" - }, - { - "name": "blackColor", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/element/float.json b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 30e6a4c0edf724b1459705043d7488912328bd16..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "float": [ - { - "name": "size_5", - "value": "10" - }, - { - "name": "size_10", - "value": "10" - }, - { - "name": "size_13", - "value": "13" - }, - { - "name": "size_15", - "value": "15" - }, - { - "name": "size_20", - "value": "20" - }, - { - "name": "size_25", - "value": "25" - }, - { - "name": "size_40", - "value": "40" - }, - { - "name": "size_50", - "value": "50" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/element/string.json b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/element/string.json deleted file mode 100644 index ba20722970263fd4c90608b311d5b1254054f448..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "SavingUserFiles" - }, - { - "name": "reason_MICROPHONE", - "value": "reason_MICROPHONE" - }, - { - "name": "document", - "value": "文档|.txt" - }, - { - "name": "saveDocumentButton", - "value": "SaveDocument" - }, - { - "name": "readFilesButton", - "value": "ReadFiles" - }, - { - "name": "downloadSaveFileButton", - "value": "Download" - }, - { - "name": "saveAudioFilesButton", - "value": "SaveAudioFiles" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/background.png b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/foreground.png b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/layered_image.json b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/startIcon.png b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/dark/element/color.json b/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/UserFile/SavingUserFiles/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 380410b1e9c9e8760aa994454db677b3bfb51672..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON, Component } from '@kit.TestKit'; -import { describe, it, expect } from '@ohos/hypium'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const TAG = '[Sample_SavingUserFiles]'; -const DOMAIN = 0xF811; -const BUNDLE = 'SavingUserFiles_'; -const DELAY_TIME_1S = 1000; -const DELAY_TIME_2S = 2000; -const DELAY_TIME_3S = 3000; -const DELAY_TIME_4S = 4000; - -const DELEGATOR: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const BUNDLENAME = abilityDelegatorRegistry.getArguments().bundleName; - -export default function abilityTest() { - describe('SaveUserFilesTest', () => { - /** - * @tc.number CoreFileKit_StartAbility_001 - * @tc.name CoreFileKit_StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,begin'); - // start tested ability - const want: Want = { - bundleName: BUNDLENAME, - abilityName: 'EntryAbility' - }; - await DELEGATOR.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME_1S); - - const ability: UIAbility = await DELEGATOR.getCurrentTopAbility(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,end'); - }) - /** - * @tc.number CoreFileKit_SavingDocumentFile_001 - * @tc.name CoreFileKit_SavingDocumentFile_001 - * @tc.desc 测试在设备保存文档类文件并读取文件功能 - */ - it(BUNDLE + 'SavingDocumentFile_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'SavingDocumentFile_001, begin'); - // 初始化 Driver,用于 UI 操作 - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - // 查找按钮组件 - const selectingDocumentButton = await driver.findComponent(ON.text('SaveDocument')); - // 点击按钮 - await selectingDocumentButton.click(); - // 等待,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_3S); - - let pathClick: Driver = Driver.create(); - // 点击按钮 - await pathClick.click(200, 470); - // 等待,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - - let saveClick: Driver = Driver.create(); - // 点击按钮 - await saveClick.click(660, 100); - // 等待,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_2S); - - // 查找按钮组件 - const selectingSaveDocumentButton = await driver.findComponent(ON.text('ReadFiles')); - // 点击按钮 - await selectingSaveDocumentButton.click(); - // 等待,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_2S); - - let downloadclick: Driver = Driver.create(); - // 点击按钮 - await downloadclick.click(400, 300); - // 等待,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - - let selectclick: Driver = Driver.create(); - // 点击按钮 - await selectclick.click(400, 300); - // 等待,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('Successfully read the file')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'SavingDocumentFile_001, end'); - done(); - }) - /** - * @tc.number 测试在设备保存音频类文件功能_SavingAudioFile_002 - * @tc.name 测试在设备保存音频类文件功能_SavingAudioFile_002 - * @tc.desc 测试在设备保存音频类文件功能 - */ - it(BUNDLE + 'SavingAudioFile_002', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'SavingAudioFile_002, begin'); - // 初始化 Driver,用于 UI 操作 - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - // 查找按钮组件 - const confirmButton = await driver.findComponent(ON.text('SaveAudioFiles')); - // 点击按钮 - await confirmButton.click(); - // 等待,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_4S); - - let saveClick: Driver = Driver.create(); - // 点击按钮 - await saveClick.click(680, 80); - // 等待,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_2S); - - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('Successfully saved audio files')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'SavingAudioFile_002, end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/UserFile/SavingUserFiles/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/UserFile/SavingUserFiles/entry/src/ohosTest/module.json5 b/CoreFile/UserFile/SavingUserFiles/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/UserFile/SavingUserFiles/hvigor/hvigor-config.json5 b/CoreFile/UserFile/SavingUserFiles/hvigor/hvigor-config.json5 deleted file mode 100644 index d584c19c247db9a7caee4b606bb931aa9279c637..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/CoreFile/UserFile/SavingUserFiles/hvigorfile.ts b/CoreFile/UserFile/SavingUserFiles/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/SavingUserFiles/oh-package.json5 b/CoreFile/UserFile/SavingUserFiles/oh-package.json5 deleted file mode 100644 index e41bae026aab3b50d0abb42fece08ba43b4a772b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/UserFile/SavingUserFiles/ohosTest.md b/CoreFile/UserFile/SavingUserFiles/ohosTest.md deleted file mode 100644 index c101606f39164a6a2865a03f476287ff810bda68..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SavingUserFiles/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# SavingUserFiles 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ---------------------- | ------------------ | ---- | -------------------------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 申请权限 | 成功拉起应用 | | 成功申请权限 | 是 | Pass | -| 保存文档类文件到开发板 | 安装应用,进入首页 | | 将保存文件的信息输出到页面文本框内 | 是 | Pass | -| 保存音频类文件到开发板 | 安装应用,进入首页 | | 将保存音频类文件成功的结果输出到页面文本框内 | 是 | Pass | diff --git a/CoreFile/UserFile/SelectingUserFiles/.gitignore b/CoreFile/UserFile/SelectingUserFiles/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/UserFile/SelectingUserFiles/AppScope/app.json5 b/CoreFile/UserFile/SelectingUserFiles/AppScope/app.json5 deleted file mode 100644 index 8b5685257cd96e99344598bea66eef88d831843d..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.selectinguserfiles", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/CoreFile/UserFile/SelectingUserFiles/AppScope/resources/base/element/string.json b/CoreFile/UserFile/SelectingUserFiles/AppScope/resources/base/element/string.json deleted file mode 100644 index ed6a94c8cda69a9a46f72069b6f1888d772770e0..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "SelectingUserFiles" - } - ] -} diff --git a/CoreFile/UserFile/SelectingUserFiles/AppScope/resources/base/media/app_icon.png b/CoreFile/UserFile/SelectingUserFiles/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SelectingUserFiles/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/CoreFile/UserFile/SelectingUserFiles/PageImg/AudioPicker.jpeg b/CoreFile/UserFile/SelectingUserFiles/PageImg/AudioPicker.jpeg deleted file mode 100644 index 446e5e2989987cdd975fd3e076270034cf7190ec..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SelectingUserFiles/PageImg/AudioPicker.jpeg and /dev/null differ diff --git a/CoreFile/UserFile/SelectingUserFiles/PageImg/SelectingUserFiles.jpeg b/CoreFile/UserFile/SelectingUserFiles/PageImg/SelectingUserFiles.jpeg deleted file mode 100644 index 838b97949e8b477a64c135a1e5e1fe04b27c7a6a..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SelectingUserFiles/PageImg/SelectingUserFiles.jpeg and /dev/null differ diff --git a/CoreFile/UserFile/SelectingUserFiles/README_zh.md b/CoreFile/UserFile/SelectingUserFiles/README_zh.md deleted file mode 100644 index cd5329eab62218c777e465f85f17cbfe17b808ae..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/README_zh.md +++ /dev/null @@ -1,90 +0,0 @@ -# 选择用户文件 - -### 介绍 - -本示例主要展示了通过文件选择器(FilePicker)拉起对应的应用访问,相关文件。根据用户文件的常见类型,选择器(FilePicker)分别提供以下选项: - -- PhotoViewPicker:适用于图片或视频类型文件的选择与保存(该接口在后续版本不再演进)。请使用PhotoAccessHelper的PhotoViewPicker来选择图片文件。请使用[安全控件创建媒体资源](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/media/medialibrary/photoAccessHelper-savebutton.md)。 -- DocumentViewPicker:适用于文件类型文件的选择与保存。DocumentViewPicker对接的选择资源来自于FilePicker, 负责文件类型的资源管理,文件类型不区分后缀,比如浏览器下载的图片、文档等,都属于文件类型。 -- AudioViewPicker:适用于音频类型文件的选择与保存。AudioViewPicker目前对接的选择资源来自于FilePicker。 - -该工程中展示的代码与权限等详细描述可查如下链接。 - -- [选择用户文件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/select-user-file.md) - -### 效果预览 - -|主界面| -|--------------------------------| -|主页| - -| Picker | -| ------------------------------------------------------------ | -| Picker页面 | - -使用说明: - -1. 在主界面,可以SelectDocument按钮,拉起FilePicker应用,选择指定目录下的文档类文件,将读取成功的结果输出到文本框,并将文档类文件有关数据输出到日志,搜索”readSync data to file succeed and buffer size is“有对应日志。 -2. 在主界面,可以SelectAudio按钮,拉起AudioFilePicker应用,出现如上Picker页面即可。 - -### 工程目录 - -``` -├──entry/src/main -| ├──ets -| | ├──common -| | | └──Logger.ts // 日志打印封装类 -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -* 选择文档类文件: - * 导入[@ohos.file.picker(选择器)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-picker.md)模块和[@ohos.file.fs (文件管理)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md)模块。 - * 创建文件类型、文件选择选项实例。 - * 创建文件选择器DocumentViewPicker实例。调用select()接口拉起FilePicker应用界面进行文件选择。 - * 待界面从FilePicker返回后,使用基础文件API的fs.openSync接口通过uri打开这个文件得到文件描述符(fd)。 - * 通过fd使用基础文件API的fs.readSync接口读取文件内的数据。 -* 选择音频类文件: - * 导入[@ohos.file.picker(选择器)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-picker.md)模块和[@ohos.file.fs (文件管理)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md)模块。 - * 创建音频类型文件选择选项实例。 - * 创建音频选择器AudioViewPicker实例。调用select()接口拉起FilePicker应用界面进行文件选择。 - * 待界面从FilePicker返回后,可以使用基础文件API的fs.openSync接口通过uri打开这个文件得到文件描述符(fd)。 - * 通过fd使用基础文件API的fs.readSync接口读取文件内的数据。 - -### 相关权限 -不涉及 - -### 依赖 - -不涉及 - -### 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:RK3568。 - -2.本示例已适配API16版本SDK,版本号:5.1.0.47。 - -3.本示例需要使用DevEco Studio (5.0.3.910)及以上版本才可编译运行。 - -4.本示例相关权限为system_basic级别,需要配置高权限签名,可参考[申请使用受控权限](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/declare-permissions-in-acl.md)。 - - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/UserFile/SelectingUserFiles > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` - diff --git a/CoreFile/UserFile/SelectingUserFiles/build-profile.json5 b/CoreFile/UserFile/SelectingUserFiles/build-profile.json5 deleted file mode 100644 index 868043c6c1a43073617a697f0897daa084b683b4..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/build-profile.json5 +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "externalNativeOptions": { - "abiFilters": [ - "arm64-v8a", - "x86_64" - ], - "abiFilters": [ - "arm64-v8a", - "x86_64" - ] - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/.gitignore b/CoreFile/UserFile/SelectingUserFiles/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/build-profile.json5 b/CoreFile/UserFile/SelectingUserFiles/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/hvigorfile.ts b/CoreFile/UserFile/SelectingUserFiles/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/SelectingUserFiles/entry/obfuscation-rules.txt b/CoreFile/UserFile/SelectingUserFiles/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/UserFile/SelectingUserFiles/entry/oh-package.json5 b/CoreFile/UserFile/SelectingUserFiles/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/common/Logger.ts b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index 482418828702781224e1387103b58533624bdf01..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN: number = 0x0000; // 此处使用自行申请的应用代码号 -const PREFIX: string = '[Sample_SelectingUserFiles]'; // 应用log标签 - -export class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = DOMAIN; - } - - getDomain() { - return this.domain; - } - - getPrefix() { - return this.prefix; - } - - getFormat() { - return this.format; - } - - debug(...args: string[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]) { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number) { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger(PREFIX); diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index edc2839f203ba057c186e19b0cbbbf80c8faa8b3..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b74fe507979e31c9d239b7f29ea9102f6144b7cf..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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 { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -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/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/pages/Index.ets b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 0a9299906bc1d651f16e825a2151bb87bfeebc8f..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start import_interface_select] -import { BusinessError } from '@kit.BasicServicesKit'; -import { common } from '@kit.AbilityKit'; -import { fileAccess, fileIo as fs, picker } from '@kit.CoreFileKit'; -import Logger from '../common/Logger'; -// [End import_interface_select] - -@Entry -@Component -struct Index { - @State result: string = ''; - @State saveresult: string = ''; - @State documentUris: string[] = []; - @State audioUris: string = ''; - @State fileContent: string = ''; - - build() { - Column({ space: $r('app.float.size_10') }) { // 设置列内元素间距为10 - Column({ space: $r('app.float.size_10') }) { // 设置列内元素间距为10 - // 预制条件保存文件按钮 - Button($r('app.string.saveDocumentFileButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - - this.saveDocumentFile(); - }) - Text(this.saveresult) - .fontSize($r('app.float.size_50')) // 文本字体大小为50 - .fontWeight(FontWeight.Bold) // 文本字体加粗 - .margin({ top: $r('app.float.size_20') }) // 文本上边距为20 - // 读取文件按钮 - Button($r('app.string.selectDocumentFileButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.selectDocumentFiles(); - }) - Text(this.result) - .fontSize($r('app.float.size_50')) // 文本字体大小为50 - .fontWeight(FontWeight.Bold) // 文本字体加粗 - .margin({ top: $r('app.float.size_20') }) // 文本上边距为20 - // 选择音频文件按钮 - Button($r('app.string.selectAudioFileButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.selectAudioFile(); - }) - // 显示文件内容 - Text(this.fileContent) - .fontSize($r('app.float.size_50')) // 文本字体大小为50 - .fontWeight(FontWeight.Bold) // 文本字体加粗 - .margin({ top: $r('app.float.size_20') }) // 文本上边距为20 - } - } - .width('100%') // 设置外层列的宽度为100% - .height('100%') // 设置外层列的高度为100% - .alignItems(HorizontalAlign.Center) // 设置子元素水平居中 - .justifyContent(FlexAlign.Center) // 设置子元素垂直居中 - .backgroundColor($r('app.color.lightGrayColor')) // 设置背景颜色为浅灰色 - } - - saveDocumentFile() { - try { - const documentSaveOptions = new picker.DocumentSaveOptions(); - documentSaveOptions.newFileNames = ['test0.txt', 'test0.pdf']; - let uris: string[] = []; - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - const documentViewPicker = new picker.DocumentViewPicker(context); - documentViewPicker.save(documentSaveOptions).then((documentSaveResult: string[]) => { - uris = documentSaveResult; - console.info('documentViewPicker.save to file succeed and uris are:' + uris); - this.saveresult = 'Save Success'; - }).catch((err: BusinessError) => { - console.error(`Invoke documentViewPicker.save failed, code is ${err.code}, message is ${err.message}`); - }); - }catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - } - - selectDocumentFiles() { - try { - // [Start create_document_select_option] - const documentSelectOptions = new picker.DocumentSelectOptions(); - // [End create_document_select_option] - - // [Start picker_select] - let uris: string[] = []; - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - const documentViewPicker = new picker.DocumentViewPicker(context); - documentViewPicker.select(documentSelectOptions).then((documentSelectResult: string[]) => { - uris = documentSelectResult; - Logger.info('documentViewPicker.select to file succeed and uris are:' + uris); - // [StartExclude picker_select] - if (uris.length > 0) { - this.readDocumentFile(uris); - } - // [EndExclude picker_select] - }).catch((err: BusinessError) => { - Logger.error(`Invoke documentViewPicker.select failed, code is ${err.code}, message is ${err.message}`); - }); - // [End picker_select] - }catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - } - - readDocumentFile(uris: string[]) { - try { - // [Start document_read_only] - if (uris.length > 0) { - let uri: string = uris[0]; - //这里需要注意接口权限参数是fs.OpenMode.READ_WRITE。 - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); - console.info('file fd: ' + file.fd); - // [Start document_fs_read_sync] - let buffer = new ArrayBuffer(4096); // 分配一个大小为4096字节的缓冲区 - let readLen = fs.readSync(file.fd, buffer); // 读取文件内容 - Logger.info('readSync data to file succeed and buffer size is:' + readLen); - fs.closeSync(file); - // [End document_fs_read_sync] - } - // [End document_read_only] - }catch (error) { - let err: BusinessError = error as BusinessError; - console.error(`DocumentViewPicker failed with err, code is: ${err.code}, message is: ${err.message}`); - } - this.result = 'Read Success'; - } - - - async selectAudioFile() { - try { - // [Start audio_select_option] - const audioSelectOptions = new picker.AudioSelectOptions(); - // [End audio_select_option] - - // [Start audio_select_picker] - let uris: string[] = []; - // 请在组件内获取context,确保this.getUIContext().getHostContext()返回结果为UIAbilityContext - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - const audioViewPicker = new picker.AudioViewPicker(context); - audioViewPicker.select(audioSelectOptions).then((audioSelectResult: Array) => { - //文件选择成功后,返回被选中音频的URI结果集。 - uris = audioSelectResult; - console.info('audioViewPicker.select to file succeed and uri is:' + uris); - // [End audio_select_picker] - // [StartExclude audio_view_picker] - this.fileContent = 'Select Success'; - this.readAudioFile(uris); - // [EndExclude audio_view_picker] - }).catch((err: BusinessError) => { - console.error(`Invoke audioViewPicker.select failed, code is ${err.code}, message is ${err.message}`); - }) - } catch (err) { - const error: BusinessError = err as BusinessError; - Logger.error(`Invoke audioViewPicker.select failed, code is ${error.code}, message is ${error.message}`); - } - } - - readAudioFile(uris: string[]) { - try { - // [Start openmode_read_only] - if (uris.length > 0) { - let uri: string = uris[0]; - //这里需要注意接口权限参数是fs.OpenMode.READ_ONLY。 - let file = fs.openSync(uri, fs.OpenMode.READ_ONLY); - console.info('file fd: ' + file.fd); - // [Start fs_read_sync] - const buffer = new ArrayBuffer(4096); // 分配一个大小为4096字节的缓冲区 - const readLen = fs.readSync(file.fd, buffer); // 读取文件内容 - Logger.info('readSync data to file succeed and buffer size is:' + readLen); - // [StartExclude fs_read_sync] - this.fileContent = `Read ${readLen} bytes from file.`; // 显示读取的字节数 - // [EndExclude fs_read_sync] - fs.closeSync(file); - // [End fs_read_sync] - } - // [End openmode_read_only] - } catch (err) { - const error: BusinessError = err as BusinessError; - Logger.error(`Failed to read file, code is ${error.code}, message is ${error.message}`); - } - } - -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/module.json5 b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/module.json5 deleted file mode 100644 index a3d8eaddbbffbd63b77c10eb38f7df6998ac10ac..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/module.json5 +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 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" - } - ] - } - ], - "requestPermissions": [ - - ] - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/element/color.json b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/element/color.json deleted file mode 100644 index b99ebd2b9c4b3a455465e850b4eeee9548ba886a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "whiteColor", - "value": "#FFFFFF" - }, - { - "name": "lightGrayColor", - "value": "#F0F0F0" - }, - { - "name": "grayColor", - "value": "#808080" - }, - { - "name": "blackColor", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/element/float.json b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 30e6a4c0edf724b1459705043d7488912328bd16..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "float": [ - { - "name": "size_5", - "value": "10" - }, - { - "name": "size_10", - "value": "10" - }, - { - "name": "size_13", - "value": "13" - }, - { - "name": "size_15", - "value": "15" - }, - { - "name": "size_20", - "value": "20" - }, - { - "name": "size_25", - "value": "25" - }, - { - "name": "size_40", - "value": "40" - }, - { - "name": "size_50", - "value": "50" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/element/string.json b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/element/string.json deleted file mode 100644 index b77061fb71d3092b2ff4e8a8b539333b9dc46d02..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "SelectingUserFiles" - }, - { - "name": "reason_MICROPHONE", - "value": "reason_MICROPHONE" - }, - { - "name": "selectDocumentFileButton", - "value": "SelectDocumentFile" - }, - { - "name": "saveDocumentFileButton", - "value": "SaveDocumentFile" - }, - { - "name": "selectAudioFileButton", - "value": "SelectAudioFile" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/background.png b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/foreground.png b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/layered_image.json b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/startIcon.png b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/dark/element/color.json b/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/UserFile/SelectingUserFiles/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 83b6ce0ca20bf1c9ed1844f8340d4a313fd47cf0..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { describe, it, expect } from '@ohos/hypium'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const TAG = '[Sample_SelectingUserFiles]'; -const DOMAIN = 0xF811; -const BUNDLE = 'SelectingUserFiles_'; -const DELAY_TIME_1S = 1000; -const DELAY_TIME_2S = 2000; -const DELAY_TIME_3S = 3000; - -const DELEGATOR: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -const BUNDLENAME = abilityDelegatorRegistry.getArguments().bundleName; - -export default function abilityTest() { - describe('SelectingUserFilesTest', () => { - /** - * @tc.number CoreFileKit_StartAbility_001 - * @tc.name CoreFileKit_StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,begin'); - // start tested ability - const want: Want = { - bundleName: BUNDLENAME, - abilityName: 'EntryAbility' - }; - await DELEGATOR.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME_1S); - // check top display ability - const ability: UIAbility = await DELEGATOR.getCurrentTopAbility(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,end'); - }) - /** - * @tc.number CoreFileKit_SelectDocumentFileTest_001 - * @tc.name CoreFileKit_SelectDocumentFileTest_001 - * @tc.desc 测试选择文档类文件功能 - */ - it(BUNDLE + 'SelectDocumentFileTest_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'SelectDocumentFileTest_001, begin'); - // 初始化 Driver,用于 UI 操作 - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - // 查找按钮组件 - const selectingDocumentButton = await driver.findComponent(ON.text('SelectDocumentFile')); - // 点击按钮 - await selectingDocumentButton.click(); - // 等待 2000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_2S); - - let downloadClick: Driver = Driver.create(); - // 点击屏幕坐标 (124, 428) 处 - await downloadClick.click(124, 328); - // 等待 1000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - - let selectClick: Driver = Driver.create(); - // 点击屏幕坐标 (176, 320) 处 - await selectClick.click(176, 320); - // 等待 1000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('Read Success')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'SelectDocumentFileTest_001, end'); - done(); - }) - /** - * @tc.number CoreFileKit_SelectAudioFileTest_002 - * @tc.name CoreFileKit_SelectAudioFileTest_002 - * @tc.desc 测试选择音频类文件功能 - */ - it(BUNDLE + 'SelectAudioFileTest_002', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'SelectDocumentFileTest_002, begin'); - // 初始化 Driver,用于 UI 操作 - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - // 查找按钮组件 - const selectingAudioButton = await driver.findComponent(ON.text('SelectAudioFile')); - // 点击按钮 - await selectingAudioButton.click(); - // 等待 3000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_3S); - - let selectClick: Driver = Driver.create(); - // 点击屏幕坐标 (364, 764) 处 - await selectClick.click(364, 764); - // 等待 1000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_1S); - - let backDriver: Driver = Driver.create(); - await backDriver.pressBack(); // 模拟返回键操作 - // 等待 3000 毫秒,确保点击后的操作完成 - await driver.delayMs(DELAY_TIME_3S); - - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('Select Success')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'SelectDocumentFileTest_002, end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/UserFile/SelectingUserFiles/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/UserFile/SelectingUserFiles/entry/src/ohosTest/module.json5 b/CoreFile/UserFile/SelectingUserFiles/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/UserFile/SelectingUserFiles/hvigor/hvigor-config.json5 b/CoreFile/UserFile/SelectingUserFiles/hvigor/hvigor-config.json5 deleted file mode 100644 index d584c19c247db9a7caee4b606bb931aa9279c637..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/CoreFile/UserFile/SelectingUserFiles/hvigorfile.ts b/CoreFile/UserFile/SelectingUserFiles/hvigorfile.ts deleted file mode 100644 index 6b365cacd0191d3b1178eb6b9807b1ae0add6271..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/hvigorfile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/SelectingUserFiles/oh-package.json5 b/CoreFile/UserFile/SelectingUserFiles/oh-package.json5 deleted file mode 100644 index e41bae026aab3b50d0abb42fece08ba43b4a772b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/UserFile/SelectingUserFiles/ohosTest.md b/CoreFile/UserFile/SelectingUserFiles/ohosTest.md deleted file mode 100644 index a761a4355eb7396e4c58a69697c6013b35ff9b25..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/SelectingUserFiles/ohosTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# SelectingUserFiles 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| -------------- | ------------------ | ---- | ---------------------------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 选择文档类文件 | 安装应用,进入首页 | | 成功选择文档文件,输出成功结果到应用页面文本框 | 是 | Pass | -| 选择音频类文件 | 安装应用,进入首页 | | 成功拉起选择页面 | 是 | Pass | diff --git a/CoreFile/UserFile/UserFileURI/.gitignore b/CoreFile/UserFile/UserFileURI/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/CoreFile/UserFile/UserFileURI/AppScope/app.json5 b/CoreFile/UserFile/UserFileURI/AppScope/app.json5 deleted file mode 100644 index bc4886d3c65225acf71576662e5d0fd2a42c99b7..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.userfileuri", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/CoreFile/UserFile/UserFileURI/AppScope/resources/base/element/string.json b/CoreFile/UserFile/UserFileURI/AppScope/resources/base/element/string.json deleted file mode 100644 index ebc4295724049456ed63672eab496169b7ad9846..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "UserFileURI" - } - ] -} diff --git a/CoreFile/UserFile/UserFileURI/AppScope/resources/base/media/app_icon.png b/CoreFile/UserFile/UserFileURI/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/UserFileURI/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/CoreFile/UserFile/UserFileURI/PageImg/UserFileURI.jpeg b/CoreFile/UserFile/UserFileURI/PageImg/UserFileURI.jpeg deleted file mode 100644 index a7eee99df45f3a211e49784bd2949d7af511ba4e..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/UserFileURI/PageImg/UserFileURI.jpeg and /dev/null differ diff --git a/CoreFile/UserFile/UserFileURI/README_zh.md b/CoreFile/UserFile/UserFileURI/README_zh.md deleted file mode 100644 index 877f698ed8f1f438b249346fd5c0a81cda7fa412..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/README_zh.md +++ /dev/null @@ -1,101 +0,0 @@ -# 用户文件uri介绍 - -### 介绍 - -本示例主要展示了有关用户文件uri的功能,使用DocumentViewPicker接口 、AudioViewPicker接口、fileAccess模块、fs模块、photoAccessHelper模块、userFileManager模块、createFileAccessHelper等,实现了获取文档类uri、获取媒体文件uri、通过uri复制文件的功能。该工程中展示的代码与权限等详细描述可查如下链接。 - -- [用户文件uri介绍](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/file-management/user-file-uri-intro.md) - -### 效果预览 - -|主页| -|:------------------------------:| -|主页| - -使用说明: - -1. 在主界面,可以选择点击ReadDocumentUri、ReadMediaUri、CopyAFile按钮使用对应的功能。 -2. 点击ReadDocumentUri按钮,将在指定目录创建一个文件,在日志中打印文件的uri,重命名该文件,再次打印该文件的uri,成功后将输出“ReadDocumentUriSuccess”到主页文本框,在Deveco日志中搜索“rename success, renameUri”,有对应的日志。 -3. 点击ReadMediaUri按钮,拉起PhotoAccessHelper的PhotoViewPicker选择已有媒体文件或拍摄一个媒体文件,读取该媒体文件的uri已经基本信息,并输出“ReadMediaUriSuccess”到主页文本框,在Deveco日志中搜索“PhotoViewPicker.select successfully”,有对应的日志。 -4. 点击CopyAFile按钮,复制指定文件到指定目录,并输出”CopyAFileSuccess“到主页文本框,在Deveco日志中搜索“copyFile success, fileUr“,有对应的日志。 -5. 点击SelectDocumentFile按钮,可以调用Picker选择查看创建的文档类文件与复制的文档类文件,直观查看创建和复制结果。 - -### 工程目录 - -``` -├──entry/src/main -| ├──ets -| | ├──common -| | | └──Logger.ts // 日志打印封装类 -| | | └──PermissionUtils.ets // 权限申请封装类 -| | ├──entryability -| | | └──EntryAbility.ets // 程序入口类 -| | ├──entrybackupability -| | | └──EntryBackupAbility.ets -| | └──pages // 页面文件 -| | └──Index.ets // 主界面 -| ├──resources // 资源文件目录 -``` - -### 具体实现 - -* 文档类uri获取方式: - * 通过[文件选择器(FilePicker)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-picker.md#ohosfilepicker-选择器)的DocumentViewPicker接口选择或保存文件,返回选择或保存的文件uri。 - * 通过[文件选择器(FilePicker)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-picker.md#ohosfilepicker-选择器)的AudioViewPicker接口选择或保存文件,返回选择或保存的文件uri。 - * 通过[fileAccess模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-fileAccess-sys.md)获取文件uri,使用获取到的文件uri进行重命名操作。 - * 通过[fileAccess模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-fileAccess-sys.md)获取文档类目录下的文件得到对应文件的FileInfo对象,此对象中就包含对应文件或者目录的uri属性,此模块中的接口为系统接口,使用此模块需要注意应用是否为系统应用。支持获取文件uri的目录有: - - 外部存储目录 - - Docs目录 - - Download目录 - - Desktop目录 - - Documents目录 - - Share共享盘目录 - -* 媒体文件uri使用方式: - * 通过[photoAccessHelper模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md)的PhotoViewPicker选择媒体文件,返回选择的媒体文件文件的uri。 - * 通过[photoAccessHelper模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md)模块中的getAssets或createAsset接口获取媒体文件对应文件的uri。 - * 通过[userFileManager模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-userFileManager-sys.md)中的getPhotoAssets、getAudioAssets、createAudioAsset或createPhotoAsset接口获取媒体文件对应文件的uri。 - * normal等级的应用使用此类uri可以通过[photoAccessHelper模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md)模块进行进一步处理。 - * system_basic等级及以上的应用使用此类uri的方式除了上述通过[photoAccessHelper模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md)外还可以通过[userFileManager模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-userFileManager-sys.md)进行进一步处理。 - * 若normal等级的应用也可以通过临时授权的方式使用[photoAccessHelper模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md)的PhotoViewPicker得到的uri使用photoAccessHelper.getAssets接口获取对应uri的PhotoAsset对象。这种方式获取的对象可以调用getThumbnail获取缩略图和使用get接口读取PhotoKeys中的部分信息。 -* 用户复制文件到指定目录: - * 通过[fileAccess模块](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-fileAccess-sys.md)的createFileAccessHelper接口创建fileAccessHelper helper。 - * 获取源文件的srcUri。 - * 获取目的路径的destUri。 - * 获取备用名 fileName。 - * 使用helper.copyFile(srcUri, destUri, fileName) 进行文件操作。 - -### 相关权限 - -[ohos.permission.FILE_ACCESS_MANAGER](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionfile_access_manager) - -[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) - -[ohos.permission.READ_IMAGEVIDEO](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionread_imagevideo) - -### 依赖 - -不涉及 - -### 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:RK3568。 - -2.本示例已适配API16版本SDK,版本号:5.1.0.47,镜像版本号:OpenHarmony5.1.0.47。 - -3.本示例需要使用DevEco Studio (5.0.3.910)及以上版本才可编译运行。 - -4.本示例相关权限为system_basic级别,需要配置高权限签名,可参考[申请使用受控权限](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/declare-permissions-in-acl.md)。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/CoreFile/UserFile/UserFileURI > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` - diff --git a/CoreFile/UserFile/UserFileURI/build-profile.json5 b/CoreFile/UserFile/UserFileURI/build-profile.json5 deleted file mode 100644 index 2e48ccc23f74bb7e3a33ecfadd00733a2f3dbca2..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/build-profile.json5 +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "5.0.4(16)", - "targetSdkVersion": "5.0.4(16)", - "compatibleSdkVersion": "5.0.4(16)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "externalNativeOptions": { - "abiFilters": [ - "arm64-v8a", - "x86_64" - ], - "abiFilters": [ - "arm64-v8a", - "x86_64", - "armeabi-v7a" - ], - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/.gitignore b/CoreFile/UserFile/UserFileURI/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/build-profile.json5 b/CoreFile/UserFile/UserFileURI/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/hvigorfile.ts b/CoreFile/UserFile/UserFileURI/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/UserFileURI/entry/obfuscation-rules.txt b/CoreFile/UserFile/UserFileURI/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/CoreFile/UserFile/UserFileURI/entry/oh-package.json5 b/CoreFile/UserFile/UserFileURI/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/UserFileURI/entry/src/main/ets/common/Logger.ts b/CoreFile/UserFile/UserFileURI/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index 58add1cbec1f88ce259811fda78d912977b7917d..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN: number = 0x0000; // 此处使用自行申请的应用代码号 -const PREFIX: string = '[Sample_UserFileURI]'; // 应用log标签 - -export class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = DOMAIN; - } - - getDomain() { - return this.domain; - } - - getPrefix() { - return this.prefix; - } - - getFormat() { - return this.format; - } - - debug(...args: string[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]) { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number) { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger(PREFIX); diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/ets/common/PermissionUtils.ets b/CoreFile/UserFile/UserFileURI/entry/src/main/ets/common/PermissionUtils.ets deleted file mode 100644 index 2dcfc7442e0b5f01cb7d41113846b85f17951421..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/ets/common/PermissionUtils.ets +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2025 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 { abilityAccessCtrl, bundleManager, common, Permissions } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { promptAction } from '@kit.ArkUI'; - -export const permissions: Permissions[] = ['ohos.permission.READ_IMAGEVIDEO']; - -async function checkPermissionGrant(permission: Permissions): Promise { - // 1. 创建应用权限管理器 - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - let grantStatus: abilityAccessCtrl.GrantStatus = abilityAccessCtrl.GrantStatus.PERMISSION_DENIED; - - // 2. 获取应用程序的accessTokenID - let tokenId: number = 0; - try { - let bundleInfo: bundleManager.BundleInfo = await bundleManager.getBundleInfoForSelf( - bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION); - let appInfo: bundleManager.ApplicationInfo = bundleInfo.appInfo; - tokenId = appInfo.accessTokenId; - } catch (error) { - const err: BusinessError = error as BusinessError; - console.error(`Failed to get bundle info for self. Code is ${err.code}, message is ${err.message}`); - } - - // 3. 校验应用是否被授予权限 - try { - grantStatus = await atManager.checkAccessToken(tokenId, permission); - } catch (error) { - const err: BusinessError = error as BusinessError; - console.error(`Failed to check access token. Code is ${err.code}, message is ${err.message}`); - } - - return grantStatus; -} - - -export async function checkAndRequestPermissions(permissions: Permissions[], context: common.UIAbilityContext): - Promise { - let grantStatus: abilityAccessCtrl.GrantStatus = await checkPermissionGrant(permissions[0]); - - if (grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { - // 已经授权,可以继续访问目标操作 - promptAction.showToast({ - message: 'permission succeed!', // 显示文本 - }) - } else { - // 申请权限 - reqPermissionsFromUser(permissions, context); - } -} - -// 使用UIExtensionAbility:将common.UIAbilityContext 替换为common.UIExtensionContext -export function reqPermissionsFromUser(permissions: Permissions[], context: common.UIAbilityContext): void { - // 1. 创建应用权限管理器 - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - // 2. 拉起弹框请求用户授权 requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗 - atManager.requestPermissionsFromUser(context, permissions).then((data) => { - let grantStatus: number[] = data.authResults; - let length: number = grantStatus.length; - for (let i = 0; i < length; i++) { - if (grantStatus[i] === 0) { - // 用户授权,可以继续访问目标操作 - promptAction.showToast({ - message: 'permission succeed!', // 显示文本 - }) - } else { - // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限 - promptAction.showToast({ - message: 'user refused authorization!', // 显示文本 - }) - return; - } - } - // 授权成功 - }).catch((err: BusinessError) => { - console.error(`Failed to request permissions from user. Code is ${err.code}, message is ${err.message}`); - }) -} - - - diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/ets/entryability/EntryAbility.ets b/CoreFile/UserFile/UserFileURI/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index e985a322b65aad6515c26543aea3e9342471de92..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { checkAndRequestPermissions,permissions } from '../common/PermissionUtils' -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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) => { - checkAndRequestPermissions(permissions, this.context); - 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'); - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/CoreFile/UserFile/UserFileURI/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b74fe507979e31c9d239b7f29ea9102f6144b7cf..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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 { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -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/CoreFile/UserFile/UserFileURI/entry/src/main/ets/pages/Index.ets b/CoreFile/UserFile/UserFileURI/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 3d69240ac4fb672d001611ad75a1de687fc96918..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start copy_file_uri_example ] -// [Start function_example] -// [Start import_user_fileAccess] -// [Start import_get_uri_assets] -import { BusinessError } from '@kit.BasicServicesKit'; -// [StartExclude import_get_uri_assets] -import { Want } from '@kit.AbilityKit'; -// [EndExclude import_get_uri_assets] -import { common } from '@kit.AbilityKit'; -// [StartExclude import_get_uri_assets] -import { fileAccess} from '@kit.CoreFileKit'; -// [EndExclude import_get_uri_assets] -// [StartExclude copy_file_uri_example] -// [StartExclude function_example] -import { dataSharePredicates } from '@kit.ArkData'; -// [StartExclude import_get_uri_assets] -import { fileIo as fs} from '@kit.CoreFileKit'; -import { picker } from '@kit.CoreFileKit'; -// [EndExclude import_get_uri_assets] -import { photoAccessHelper } from '@kit.MediaLibraryKit'; - -// 定义一个uri数组,用于接收PhotoViewPicker选择图片返回的uri -let uris: string[] = []; -// [EndExclude function_example] -// [EndExclude copy_file_uri_example] - -// context 是EntryAbility 传过来的context -let context = this.getUIContext().getHostContext() as common.UIAbilityContext; -// [End import_user_fileAccess] - -// [StartExclude copy_file_uri_example] -// [StartExclude function_example] -// [StartExclude import_get_uri_assets] -async function getFileAccessAbilityInfo() { - let wantInfos: Want[] = []; - try { - wantInfos = await fileAccess.getFileAccessAbilityInfo(); - console.info('getFileAccessAbilityInfo data ' + JSON.stringify(wantInfos)); - } catch (err) { - let error: BusinessError = err as BusinessError; - console.error('getFileAccessAbilityInfo failed, errCode:' + error.code + ', errMessage:' + error.message); - } -} -// [EndExclude import_get_uri_assets] - -// 调用PhotoViewPicker.select选择图片 -async function photoPickerGetUri() { - try { - let photoSelectOptions = new photoAccessHelper.PhotoSelectOptions(); - photoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE; - // 设置最多可以选择的图片数量为1 - photoSelectOptions.maxSelectNumber = 1; - let photoPicker = new photoAccessHelper.PhotoViewPicker(); - // 等待用户选择图片 - let photoSelectResult: photoAccessHelper.PhotoSelectResult = await photoPicker.select(photoSelectOptions); - console.info('PhotoViewPicker.select successfully, PhotoSelectResult uri: ' + JSON.stringify(photoSelectResult)); - uris = photoSelectResult.photoUris; - } catch (err) { - let err: BusinessError = error as BusinessError; - console.error(`PhotoViewPicker failed with err, code is ${err.code}, message is ${err.message}`); - } -} - -async function uriGetAssets(): Promise { - // 检查uris数组是否为空 - if (uris.length === 0) { - throw new Error('No URIs available'); - } - try { - let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(context); - let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates(); - // 配置查询条件,使用PhotoViewPicker选择图片返回的uri进行查询 - predicates.equalTo('uri', uris[0]); - let fetchOption: photoAccessHelper.FetchOptions = { - fetchColumns: [photoAccessHelper.PhotoKeys.WIDTH, photoAccessHelper.PhotoKeys.HEIGHT, - photoAccessHelper.PhotoKeys.TITLE, photoAccessHelper.PhotoKeys.DURATION], - predicates: predicates - }; - let fetchResult: photoAccessHelper.FetchResult = - await phAccessHelper.getAssets(fetchOption); - // 得到uri对应的PhotoAsset对象,读取文件的部分信息 - const asset: photoAccessHelper.PhotoAsset = await fetchResult.getFirstObject(); - console.info('asset displayName: ', asset.displayName); - console.info('asset uri: ', asset.uri); - console.info('asset photoType: ', asset.photoType); - console.info('asset width: ', asset.get(photoAccessHelper.PhotoKeys.WIDTH)); - console.info('asset height: ', asset.get(photoAccessHelper.PhotoKeys.HEIGHT)); - console.info('asset title: ' + asset.get(photoAccessHelper.PhotoKeys.TITLE)); - // 获取缩略图 - asset.getThumbnail((err, pixelMap) => { - if (err == undefined) { - console.info('getThumbnail successful ' + JSON.stringify(pixelMap)); - } else { - console.error('getThumbnail fail', err); - } - }); - // [StartExclude import_get_uri_assets] - if (uris.length !== 0 && asset !== null) { - return 'ReadMediaUriSuccess'; - } - // [EndExclude import_get_uri_assets] - } catch (error) { - console.error(`uriGetAssets failed with err, code is ${error.code}, message is ${error.message}`); - return 'ReadMediaUriFail'; - } - return 'ReadMediaUriFail'; -} -// [End import_get_uri_assets] -// [EndExclude function_example] -async function documentURIExample() { - let fileAccessHelper: fileAccess.FileAccessHelper; - // wantInfos 从getFileAccessAbilityInfo()获取 - let wantInfos: Want[] = [ - { - bundleName: 'com.ohos.UserFile.ExternalFileManager', - abilityName: 'FileExtensionAbility', - }, - ]; - try { - fileAccessHelper = fileAccess.createFileAccessHelper(context, wantInfos); - if (!fileAccessHelper) { - console.error('createFileAccessHelper interface returns an undefined object'); - } - // 以内置存储目录为例 - // 示例代码sourceUri表示Download目录,该uri是对应的fileInfo中uri - // 开发者应根据自己实际获取的uri进行开发 - let sourceUri: string = 'file://docs/storage/Users/currentUser/Download'; - let displayName: string = 'test1.txt'; - let fileUri: string; - try { - // 创建文件返回该文件的uri - fileUri = await fileAccessHelper.createFile(sourceUri, displayName); - if (!fileUri) { - console.error('createFile return undefined object'); - } - console.info('createFile success, fileUri: ' + JSON.stringify(fileUri)); - // 将刚创建的文件进行重命名,返回新文件的uri - let renameUri = await fileAccessHelper.rename(fileUri, 'renameFile.txt'); - console.info('rename success, renameUri: ' + JSON.stringify(renameUri)); - } catch (err) { - let error: BusinessError = err as BusinessError; - console.error('createFile failed, errCode:' + error.code + ', errMessage:' + error.message); - } - } catch (err) { - let error: BusinessError = err as BusinessError; - console.error('createFileAccessHelper failed, errCode:' + error.code + ', errMessage:' + error.message); - } -} -// [End function_example] -// [EndExclude copy_file_uri_example] -async function copyingFileByUriExample() { - let fileAccessHelper: fileAccess.FileAccessHelper; - // wantInfos 从getFileAccessAbilityInfo()获取 - let wantInfos: Want[] = [ - { - bundleName: 'com.ohos.UserFile.ExternalFileManager', - abilityName: 'FileExtensionAbility', - }, - ]; - try { - fileAccessHelper = fileAccess.createFileAccessHelper(context, wantInfos); - if (!fileAccessHelper) { - console.error('createFileAccessHelper interface returns an undefined object'); - } - // 以内置存储目录为例 - // 示例代码sourceUri表示Download目录,该uri是对应的fileInfo中uri - // 开发者应根据自己实际获取的uri进行开发 - let sourceUri: string = 'file://docs/storage/Users/currentUser/Download/renameFile.txt'; - // 将文件复制到的位置uri - let destUri: string = 'file://docs/storage/Users/currentUser/Documents'; - // 如果文件名冲突,要使用的文件名 - let displayName: string = 'file.txt'; - // 存放返回的uri - let fileUri: string; - try { - // 复制文件返回该文件的uri - fileUri = await fileAccessHelper.copyFile(sourceUri, destUri, displayName); - if (!fileUri) { - console.error('copyFile return undefined object'); - } - console.info('copyFile success, fileUri: ' + JSON.stringify(fileUri)); - } catch (err) { - let error: BusinessError = err as BusinessError; - console.error('copyFile failed, errCode:' + error.code + ', errMessage:' + error.message); - } - } catch (err) { - let error: BusinessError = err as BusinessError; - console.error('createFileAccessHelper failed, errCode:' + error.code + ', errMessage:' + error.message); - } -} -// [End copy_file_uri_example] - -@Entry -@Component -struct Index { - @State uriMessage: string = ''; // 初始化状态变量,用于显示消息 - @State result: string = ''; - @State documentUris: string[] = []; - - build() { - Column({ space: $r('app.float.size_10') }) { // 外层列布局,子元素间距为10 - Column({ space: $r('app.float.size_10') }) { // 内层列布局,子元素间距为10 - // 读取文件uri按钮 - Button($r('app.string.readDocumentUriButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.uriMessage = ''; // 重置消息为默认值 - documentURIExample(); // 调用方法处理文档URI - }) - // 读取图片uri按钮 - Button($r('app.string.readMediaUriButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(async () => { - try { - this.uriMessage = ''; // 重置消息为默认值 - // 首先获取图片URI - await photoPickerGetUri(); - // 然后获取图片资源信息 - this.uriMessage = await uriGetAssets(); - } catch (error) { - console.error('Error:', error); // 日志记录错误信息 - this.uriMessage = 'Error: ' + error.message; // 显示错误信息 - } - }) - // 通过uri复制文件按钮 - Button($r('app.string.copyAFileButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - this.uriMessage = ''; // 重置消息为默认值 - copyingFileByUriExample(); // 调用方法处理文件复制 - }) - Text(this.uriMessage) - .fontSize($r('app.float.size_50')) // 文本字体大小为50 - .fontWeight(FontWeight.Bold) // 文本字体加粗 - .margin({ top: $r('app.float.size_20') }) // 文本上边距为20 - // 读取文件按钮 - Button($r('app.string.selectDocumentFileButton')) - .width('80%') // 按钮宽度占屏幕宽度80% - .height('10%') // 按钮高度占屏幕高度10% - .fontSize($r('app.float.size_25')) // 按钮字体大小为25 - .borderRadius($r('app.float.size_25')) // 按钮圆角半径为25 - .backgroundColor($r('app.color.whiteColor')) // 按钮背景颜色为白色 - .shadow({ - radius: $r('app.float.size_10'), // 阴影半径为10 - color: $r('app.color.grayColor'), // 阴影颜色为灰色 - offsetX: $r('app.float.size_15'), // 阴影水平偏移量为15 - offsetY: $r('app.float.size_15') // 阴影垂直偏移量为15 - }) - .fontColor($r('app.color.blackColor')) // 按钮字体颜色为黑色 - .onClick(() => { - documentURIExample(); - this.selectDocumentFiles(); - }) - Text(this.result) - .fontSize($r('app.float.size_50')) // 文本字体大小为50 - .fontWeight(FontWeight.Bold) // 文本字体加粗 - .margin({ top: $r('app.float.size_20') }) // 文本上边距为20 - } - } - .width('100%') // 外层列布局宽度占满屏幕 - .height('100%') // 外层列布局高度占满屏幕 - .alignItems(HorizontalAlign.Center) // 水平居中对齐 - .justifyContent(FlexAlign.Center) // 垂直居中对齐 - .backgroundColor($r('app.color.lightGrayColor')) // 背景颜色为浅灰色 - } - - selectDocumentFiles() { - const documentSelectOptions = new picker.DocumentSelectOptions(); - const context = getContext(this) as common.Context; - const documentViewPicker = new picker.DocumentViewPicker(context); - documentViewPicker.select(documentSelectOptions).then((documentSelectResult: string[]) => { - this.documentUris = documentSelectResult; - console.info('documentViewPicker.select to file succeed and uris are:' + this.documentUris); - if (this.documentUris.length > 0) { - this.readDocumentFile(this.documentUris[0]); - } - }).catch((err: BusinessError) => { - console.error(`Invoke documentViewPicker.select failed, code is ${err.code}, message is ${err.message}`); - }); - } - - readDocumentFile(uri: string) { - let file = fs.openSync(uri, fs.OpenMode.READ_ONLY); - console.info('file fd: ' + file.fd); - let buffer = new ArrayBuffer(4096); // 分配一个大小为4096字节的缓冲区 - let readLen = fs.readSync(file.fd, buffer); // 读取文件内容 - console.info('readSync data to file succeed and buffer size is:' + readLen); - this.result = 'readSync data to file succeed and buffer size is:' + readLen; - fs.closeSync(file); - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/module.json5 b/CoreFile/UserFile/UserFileURI/entry/src/main/module.json5 deleted file mode 100644 index 53bb015f4665af68fb160db8015fb64c2779893e..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/module.json5 +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2025 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" - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.FILE_ACCESS_MANAGER", // 声明要申请的权限 - "reason": "$string:reason_MICROPHONE", // 申请该权限的原因 - "usedScene": { - "abilities": [ - "FormAbility" // 使用权限的UIAbility或者ExtensionAbility组件的名称。 - ], - "when":"always" // 调用时机 always:始终 inuse:使用时(在前台) - } - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", // 声明要申请的权限 - "reason": "$string:reason_MICROPHONE", // 申请该权限的原因 - "usedScene": { - "abilities": [ - "FormAbility" // 使用权限的UIAbility或者ExtensionAbility组件的名称。 - ], - "when":"always" // 调用时机 always:始终 inuse:使用时(在前台) - } - }, - { - "name": "ohos.permission.READ_IMAGEVIDEO", // 声明要申请的权限 - "reason": "$string:reason_MICROPHONE", // 申请该权限的原因 - "usedScene": { - "abilities": [ - "FormAbility" // 使用权限的UIAbility或者ExtensionAbility组件的名称。 - ], - "when":"always" // 调用时机 always:始终 inuse:使用时(在前台) - } - } - ] - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/element/color.json b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/element/color.json deleted file mode 100644 index b99ebd2b9c4b3a455465e850b4eeee9548ba886a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "whiteColor", - "value": "#FFFFFF" - }, - { - "name": "lightGrayColor", - "value": "#F0F0F0" - }, - { - "name": "grayColor", - "value": "#808080" - }, - { - "name": "blackColor", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/element/float.json b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 30e6a4c0edf724b1459705043d7488912328bd16..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "float": [ - { - "name": "size_5", - "value": "10" - }, - { - "name": "size_10", - "value": "10" - }, - { - "name": "size_13", - "value": "13" - }, - { - "name": "size_15", - "value": "15" - }, - { - "name": "size_20", - "value": "20" - }, - { - "name": "size_25", - "value": "25" - }, - { - "name": "size_40", - "value": "40" - }, - { - "name": "size_50", - "value": "50" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/element/string.json b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 14d5b9d74694e1dfae09c106a92739ad567c577c..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "UserFileURI" - }, - { - "name": "reason_MICROPHONE", - "value": "reason_MICROPHONE" - }, - { - "name": "readDocumentUriButton", - "value": "ReadDocumentUri" - }, - { - "name": "readMediaUriButton", - "value": "ReadMediaUri" - }, - { - "name": "copyAFileButton", - "value": "CopyAFile" - }, - { - "name": "selectDocumentFileButton", - "value": "selectDocumentFile" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/background.png b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/foreground.png b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/layered_image.json b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/startIcon.png b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/profile/backup_config.json b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/profile/main_pages.json b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/dark/element/color.json b/CoreFile/UserFile/UserFileURI/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/ohosTest/ets/test/Ability.test.ets b/CoreFile/UserFile/UserFileURI/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index bb990456658dfc7bbac0cf9fe622246cc88c1250..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2025 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 { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { describe, expect, it } from '@ohos/hypium'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const TAG = '[Sample_UserFileUri]'; -const DOMAIN = 0xF811; -const BUNDLE = 'UserFileUri_'; -const DELAY_TIME_1S = 1000; -const DELAY_TIME_2S = 2000; - -const DELEGATOR = abilityDelegatorRegistry.getAbilityDelegator(); -const BUNDLENAME = abilityDelegatorRegistry.getArguments().bundleName; - - -export default function abilityTest() { - describe('UserFileUriTest', () => { - /** - * @tc.number CoreFileKit_StartAbility_001 - * @tc.name CoreFileKit_StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,begin'); - // start tested ability - const want: Want = { - bundleName: BUNDLENAME, - abilityName: 'EntryAbility' - }; - await DELEGATOR.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME_1S); - // check top display ability - const ability: UIAbility = await DELEGATOR.getCurrentTopAbility(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,end'); - }) - /** - * @tc.number CoreFileKit_UserDocumentFileURI_001 - * @tc.name CoreFileKit_UserDocumentFileURI_001 - * @tc.desc 测试在设备生成文件并读取uri功能 - */ - it(BUNDLE + 'UserDocumentFileURI_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UserDocumentFileURI_001, begin'); - - const driver = Driver.create(); - // 等待 1000 毫秒,确保 UI 渲染完成 - await driver.delayMs(DELAY_TIME_1S); - - let applyPermission: Driver = Driver.create(); - await applyPermission.click(500, 700); // 点击屏幕坐标 (500, 700) 处 - await driver.delayMs(DELAY_TIME_2S); // 延迟2秒,等待操作完成 - - // 查找按钮组件 - const readButton = await driver.findComponent(ON.text('ReadDocumentUri')); - await readButton.click(); - await driver.delayMs(DELAY_TIME_2S); // 延迟2秒,等待操作完成 - - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('ReadDocumentUriSuccess')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'UserDocumentFileURI_001, end') - done(); - }) - /** - * @tc.number CoreFileKit_UserMediaFileURI_002 - * @tc.name CoreFileKit_UserMediaFileURI_002 - * @tc.desc 测试在设备选择图片并读取图片uri功能 - */ - it(BUNDLE + 'UserMediaFileURI_002', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UserMediaFileURI_002, begin'); - - const driver = Driver.create(); - // 查找按钮组件 - const button = await driver.findComponent(ON.text('ReadMediaUri')); - await button.click(); - await driver.delayMs(DELAY_TIME_2S); // 延迟2秒,等待操作完成 - - let selectMedia: Driver = Driver.create(); - await selectMedia.click(200, 300); // 点击屏幕坐标 (200, 300) 处 - await driver.delayMs(DELAY_TIME_2S); // 延迟2秒,等待操作完成 - - await selectMedia.click(360, 1100); // 点击屏幕坐标 (360, 1100) 处 - await driver.delayMs(DELAY_TIME_2S); // 延迟2秒,等待操作完成 - - await selectMedia.click(680, 80); // 点击屏幕坐标 (680, 80) 处 - await driver.delayMs(DELAY_TIME_2S); // 延迟2秒,等待操作完成 - - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('ReadMediaUriSuccess')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'UserMediaFileURI_002, end') - done(); - }) - /** - * @tc.number CoreFileKit_CopyingFileByURI_003 - * @tc.name CoreFileKit_CopyingFileByURI_003 - * @tc.desc 测试通过uri复制文件功能 - */ - it(BUNDLE + 'CopyingFileByURI_003', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'CopyingFileByURI_003, begin'); - - const driver = Driver.create(); - // 查找按钮组件 - const copyButton = await driver.findComponent(ON.text('CopyAFile')); - await copyButton.click(); - await driver.delayMs(DELAY_TIME_2S); // 延迟2秒,等待操作完成 - - // 检查文本组件是否改变 - await driver.assertComponentExist(ON.text('CopyAFileSuccess')); - - // 标记测试用例完成 - hilog.info(DOMAIN, TAG, BUNDLE + 'CopyingFileByURI_003, end') - done(); - }) - }) -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/ohosTest/ets/test/List.test.ets b/CoreFile/UserFile/UserFileURI/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/CoreFile/UserFile/UserFileURI/entry/src/ohosTest/module.json5 b/CoreFile/UserFile/UserFileURI/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/CoreFile/UserFile/UserFileURI/hvigor/hvigor-config.json5 b/CoreFile/UserFile/UserFileURI/hvigor/hvigor-config.json5 deleted file mode 100644 index d584c19c247db9a7caee4b606bb931aa9279c637..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/CoreFile/UserFile/UserFileURI/hvigorfile.ts b/CoreFile/UserFile/UserFileURI/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/CoreFile/UserFile/UserFileURI/oh-package.json5 b/CoreFile/UserFile/UserFileURI/oh-package.json5 deleted file mode 100644 index e41bae026aab3b50d0abb42fece08ba43b4a772b..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/CoreFile/UserFile/UserFileURI/ohosTest.md b/CoreFile/UserFile/UserFileURI/ohosTest.md deleted file mode 100644 index 33c63ca8447fd712ad30265c222cf868cd05e232..0000000000000000000000000000000000000000 --- a/CoreFile/UserFile/UserFileURI/ohosTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserFileURI 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ----------------- | ------------------ | ---- | --------------------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 申请权限 | 成功拉起应用 | | 成功申请权限 | 是 | Pass | -| 读取文档类文件uri | 安装应用,进入首页 | | 将读取文件uri成功结果输出到指定文本框内 | 是 | Pass | -| 读取媒体文件uri | 安装应用,进入首页 | | 将读取图片的uri成功结果输出到指定文本框 | 是 | Pass | -| 通过uri复制文件 | 安装应用,进入首页 | | 将读取复制文件成功结果输出到指定文本框 | 是 | Pass | diff --git a/DistributedAppDev/ContinueSample/.gitignore b/DistributedAppDev/ContinueSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/DistributedAppDev/ContinueSample/AppScope/app.json5 b/DistributedAppDev/ContinueSample/AppScope/app.json5 deleted file mode 100644 index ee840c39ab1b2ee22af7e67af4810a80f95a7438..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.sample.continue", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/DistributedAppDev/ContinueSample/AppScope/resources/base/element/string.json b/DistributedAppDev/ContinueSample/AppScope/resources/base/element/string.json deleted file mode 100644 index fbd361bc4606c4dfcf9f81932c97558f0fbdd450..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ContinueSample" - } - ] -} diff --git a/DistributedAppDev/ContinueSample/AppScope/resources/base/media/app_icon.png b/DistributedAppDev/ContinueSample/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/ContinueSample/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git "a/DistributedAppDev/ContinueSample/ContinueSample\346\265\213\350\257\225\347\224\250\344\276\213\346\212\245\345\221\212.md" "b/DistributedAppDev/ContinueSample/ContinueSample\346\265\213\350\257\225\347\224\250\344\276\213\346\212\245\345\221\212.md" deleted file mode 100644 index 883196a54e6caf9d62f507e181cd7569a70e45b5..0000000000000000000000000000000000000000 --- "a/DistributedAppDev/ContinueSample/ContinueSample\346\265\213\350\257\225\347\224\250\344\276\213\346\212\245\345\221\212.md" +++ /dev/null @@ -1,5 +0,0 @@ -| 用例名称 | 预置条件 | 用例测试功能 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ---------------- | -------- | ------------ | -------------------------------------------------- | ------------------------------------ | -------- | -------- | -| ContinueTest_001 | 位于主页 | 界面UI展示 | 打开ContinueSample,点击动态配置迁移能力 | 跳转至动态配置迁移能力界面 | 是 | Pass | -| ContinueTest_003 | 位于主页 | 界面UI展示 | 打开ContinueSample,点击基础迁移数据示例 | 跳转至基础迁移数据示例界面 | 是 | Pass | -| ContinueTest_003 | 位于主页 | 界面UI展示 | 打开ContinueSample,点击使用分布式数据对象迁移数据 | 跳转至使用分布式数据对象迁移数据界面 | 是 | Pass | \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/README_zh.md b/DistributedAppDev/ContinueSample/README_zh.md deleted file mode 100644 index f725b166d0eb8adf19a6b2057bf1c790dff362a1..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/README_zh.md +++ /dev/null @@ -1,59 +0,0 @@ -# 跨端迁移 - -### 介绍 - -本示例主要展示了应用数据跨端迁移的能力,通过跨端迁移的能力实现了一个简单的迁移应用,可以响应系统迁移事件,控制应用的迁移能力、是否迁移页面栈以及迁移后是否退出源端等。使用了分布式数据对象接口[@ohos.data.distributedDataObject](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkdata/js-apis-data-distributedobject.md)等接口,通过分布式数据对象以及资产实现了文件数据的流转迁移。本示例仅适配设备类型为phone。 - -### 效果预览 - -| 主页 | -| -------------------------------- | -| ![image](./screenshots/home.png) | - -使用说明 - -1. 启动应用,进入主页,点击动态配置迁移能力按钮,可以跳转配置页设置迁移状态; -2. 进入主页,点击基础迁移数据示例,可以验证基础迁移数据; -3. 进入主页,点击使用分布式数据对象迁移数据,可以验证分布式对象基础数据迁移; -4. 进入主页,点击使用分布式数据对象资产迁移数据,可以验证分布式对象资产数据迁移; -5. 进入主页,点击使用分布式数据对象(多个资产)迁移数据,可以验证分布式对象多个资产数据迁移。 - -### 工程目录 - -``` -entry/src/main/ets/ -|---ability_devicea // 基础迁移数据示例对应ability -|---ability_devicea -|---common -| |---Constant.ets // 常量 -| |---Logger.ets // 日志工具 -|---continue -| |---DataObj.ets // 分布式数据对象迁移数据界面 -| |---MultiAsset.ets // 分布式对象多个资产数据迁移界面 -| |---PageName.ets // 动态配置迁移能力界面 -| |---Second.ets // 基础迁移数据示例界面 -|---entryability -|---migrationability // 分布式数据对象迁移数据对应ability -|---migrationability_asset // 分布式数据对象资产迁移数据对应ability -|---migrationability_multi_asset // 分布式数据对象多个迁移数据对应ability -|---migrationability_quickstart // 快速启动目标应用对应ability -|---pages -| |---index.ets // 首页 -``` - -### 具体实现 - -- 在示例应用里,迁移设置的功能在PageName.ets](entry/src/main/ets/continue/PageName.ets)中实现,通过[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的值可以控制当前应用是否迁移页面栈以及迁移后源端是否退出。源码参考:[EntryAbility.ets](entry/src/main/ets/entryability/EntryAbility.ets)。 -- 通过分布式数据对象和分布式对象资产实现文件等数据的迁移。源码参考:[DataObj.ets](entry/src/main/ets/continue/DataObj.ets),[MultiAsset.ets](entry/src/main/ets/continue/MultiAsset.ets)。 - -### 依赖 - -不涉及 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568; -2. 本示例完整功能必须双端授予允许使用分布式协同能力,迁移等功能暂不支持RK3568。 -3. 本示例为stage模型,已适配API version 12版本SDK,SDK版本号(API Version 12 Release),镜像版本号(5.0.0.16)。 -4. 本示例需要使用DevEco Studio 版本号(5.0Release)及以上才可编译运行。 diff --git a/DistributedAppDev/ContinueSample/build-profile.json5 b/DistributedAppDev/ContinueSample/build-profile.json5 deleted file mode 100644 index e175b21f789f4e226b70700f9dc3ded667df1ce7..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/build-profile.json5 +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - { - "name": "default", - "type": "HarmonyOS", - "material": { - "certpath": "C:\\Users\\dengxiaoyu\\.ohos\\config\\default_ContinueSample_lN-uD0pAULFC1aTtDJTemwnlYOTggF8jYFEJaHWVG4A=.cer", - "storePassword": "0000001BB9C37CAA446B92470CFFF03DBF523F5025CD88C467136E40D8A15E881280417B9ED09975F7F211", - "keyAlias": "debugKey", - "keyPassword": "0000001BA28DF1E22223EE08FDA0428503F75D802D759782732F13BA43822442508BD87B5E294C66CD2ADC", - "profile": "C:\\Users\\dengxiaoyu\\.ohos\\config\\default_ContinueSample_lN-uD0pAULFC1aTtDJTemwnlYOTggF8jYFEJaHWVG4A=.p7b", - "signAlg": "SHA256withECDSA", - "storeFile": "C:\\Users\\dengxiaoyu\\.ohos\\config\\default_ContinueSample_lN-uD0pAULFC1aTtDJTemwnlYOTggF8jYFEJaHWVG4A=.p12" - } - } - ], - "products": [ - { - "name": "default", - "signingConfig": "default", - "compatibleSdkVersion": "5.0.1(13)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/code-linter.json5 b/DistributedAppDev/ContinueSample/code-linter.json5 deleted file mode 100644 index 44d50304643a42f437232b908c9b44c51cea8f60..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/code-linter.json5 +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/.gitignore b/DistributedAppDev/ContinueSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/build-profile.json5 b/DistributedAppDev/ContinueSample/entry/build-profile.json5 deleted file mode 100644 index 982dbb524bd63408e05cfbed7204dd87a31dd681..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/hvigorfile.ts b/DistributedAppDev/ContinueSample/entry/hvigorfile.ts deleted file mode 100644 index c6edcd90486dd5a853cf7d34c8647f08414ca7a3..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/DistributedAppDev/ContinueSample/entry/obfuscation-rules.txt b/DistributedAppDev/ContinueSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/DistributedAppDev/ContinueSample/entry/oh-package.json5 b/DistributedAppDev/ContinueSample/entry/oh-package.json5 deleted file mode 100644 index 10cda399b0aec3099b257299a57d284393e4e55a..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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/DistributedAppDev/ContinueSample/entry/src/main/ets/ability_devicea/Ability_deviceA.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/ability_devicea/Ability_deviceA.ets deleted file mode 100644 index e950ff469b8570a842c4f1b98dffdb232be4627c..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/ability_devicea/Ability_deviceA.ets +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2025 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 { promptAction, window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class Ability_deviceA extends UIAbility { - storage: LocalStorage = new LocalStorage(); - - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - // 将上述的保存的数据取出恢复 - let continueInput = ''; - if (want.parameters !== undefined) { - continueInput = JSON.stringify(want.parameters.data); - AppStorage.setOrCreate('continueInput', continueInput as string); - console.info(`continue input ${continueInput}`) - } - // 触发页面恢复 - this.context.restoreWindowStage(this.storage); - } - } - - onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { - console.info(`EntryAbility onNewWant ${AbilityConstant.LaunchReason.CONTINUATION}`) - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - // 将上述的保存的数据取出恢复 - let continueInput = ''; - if (want.parameters !== undefined) { - continueInput = JSON.stringify(want.parameters.data); - AppStorage.setOrCreate('continueInput', continueInput as string); - console.info(`continue input ${continueInput}`); - } - this.context.restoreWindowStage(this.storage); - } - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('continue/Second', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } - - onContinue(wantParam: Record) { - const targetVersion = wantParam.version; // 获取迁移对端应用的版本号 - // 应用可根据源端版本号设置支持接续的最小兼容版本号,源端版本号可从app.json5文件中的versionCode字段获取;防止目标端版本号过低导致不兼容。 - const versionThreshold: number = 0; // 替换为应用自己支持兼容的最小版本号 - // 兼容性校验 - if (targetVersion < versionThreshold) { - // 建议在校验版本兼容性失败后,提示用户拒绝迁移的原因 - promptAction.showToast({ - message: '目标端应用版本号过低,不支持接续,请您升级应用版本后再试', - duration: 2000 - }) - // 在兼容性校验不通过时返回MISMATCH - return AbilityConstant.OnContinueResult.MISMATCH; - } - console.info(`onContinue version = ${wantParam.version}, targetDevice: ${wantParam.targetDevice}`) - // 迁移数据保存 - const continueInput = '迁移的数据'; - if (continueInput) { - // 将要迁移的数据保存在wantParam的自定义字段(如:data)中; - wantParam['data'] = continueInput; - } - return AbilityConstant.OnContinueResult.AGREE; - } -} diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/ability_deviceb/Ability_deviceB.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/ability_deviceb/Ability_deviceB.ets deleted file mode 100644 index 9fc9c9d495017dc83e95bbe3729ef331d999b99e..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/ability_deviceb/Ability_deviceB.ets +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2025 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 { promptAction, window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class Ability_deviceB extends UIAbility { - storage: LocalStorage = new LocalStorage(); - - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - // 将上述的保存的数据取出恢复 - let continueInput = ''; - if (want.parameters !== undefined) { - continueInput = JSON.stringify(want.parameters.data); - console.info(`continue input ${continueInput}`) - } - // 触发页面恢复 - this.context.restoreWindowStage(this.storage); - } - } - - onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { - console.info(`EntryAbility onNewWant ${AbilityConstant.LaunchReason.CONTINUATION}`) - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - // 将上述的保存的数据取出恢复 - let continueInput = ''; - if (want.parameters !== undefined) { - continueInput = JSON.stringify(want.parameters.data); - console.info(`continue input ${continueInput}`); - } - this.context.restoreWindowStage(this.storage); - } - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } - - onContinue(wantParam: Record) { - const targetVersion = wantParam.version; // 获取迁移对端应用的版本号 - // 应用可根据源端版本号设置支持接续的最小兼容版本号,源端版本号可从app.json5文件中的versionCode字段获取;防止目标端版本号过低导致不兼容。 - const versionThreshold: number = 0; // 替换为应用自己支持兼容的最小版本号 - // 兼容性校验 - if (targetVersion < versionThreshold) { - // 建议在校验版本兼容性失败后,提示用户拒绝迁移的原因 - promptAction.showToast({ - message: '目标端应用版本号过低,不支持接续,请您升级应用版本后再试', - duration: 2000 - }) - // 在兼容性校验不通过时返回MISMATCH - return AbilityConstant.OnContinueResult.MISMATCH; - } - console.info(`onContinue version = ${wantParam.version}, targetDevice: ${wantParam.targetDevice}`) - // 迁移数据保存 - const continueInput = '迁移的数据'; - if (continueInput) { - // 将要迁移的数据保存在wantParam的自定义字段(如:data)中; - wantParam['data'] = continueInput; - } - return AbilityConstant.OnContinueResult.AGREE; - } -} diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/commom/Constants.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/commom/Constants.ets deleted file mode 100644 index ae18315c669e9a22991f5e36c2562b321c6262e6..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/commom/Constants.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export default class CommonConstants { - static readonly BUTTON_MARGIN_TOP: number = 100; - static readonly BUTTON_WIDTH: number = 310; - static readonly BUTTON_MARGIN: number = 10; - static readonly TEXT_MARGIN_TOP: number = 30; - static readonly TEXT_MARGIN_BOTTOM: number = 50; -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/commom/Logger.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/commom/Logger.ets deleted file mode 100644 index 65d40e772037c3120229ecb00bfce81d2d986e92..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/commom/Logger.ets +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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 '@ohos.hilog'; - -class Logger { - private domain: number = 0x0000; - private prefix: string = '[Sample_Continue]'; - private format: string = '%{public}s, %{public}s'; - - constructor() { - } - - debug(...args: string[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger(); \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/DataObj.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/DataObj.ets deleted file mode 100644 index 7f5ddf1304577fea0b0050684a5e5dc2b21566ec..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/DataObj.ets +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2025 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 { commonType } from '@kit.ArkData'; -import CommonConstants from '../commom/Constants'; -import logger from '../commom/Logger'; - -// 业务数据定义 -class ParentObject { - mother: string - father: string - - constructor(mother: string, father: string) { - this.mother = mother - this.father = father - } -} - -// 支持字符、数字、布尔值、对象的传递 -class SourceObject { - name: string | undefined - age: number | undefined - isVis: boolean | undefined - parent: ParentObject | undefined - - constructor(name: string | undefined, age: number | undefined, isVis: boolean | undefined, - parent: ParentObject | undefined) { - this.name = name - this.age = age - this.isVis = isVis - this.parent = parent - } -} - -class SourceObject2 { - name: string | undefined - age: number | undefined - isVis: boolean | undefined - parent: ParentObject | undefined - attachment: commonType.Asset | undefined // 新增资产属性 - - constructor(name: string | undefined, age: number | undefined, isVis: boolean | undefined, - parent: ParentObject | undefined, attachment: commonType.Asset | undefined) { - this.name = name - this.age = age - this.isVis = isVis - this.parent = parent - this.attachment = attachment; - } -} - -let parentSource: ParentObject = new ParentObject('xxx mom', 'xxx Dad'); - -@Entry -@Component -struct DataObj { - @StorageLink('sourceObj') sourceObj: SourceObject | undefined = new SourceObject('xxx', 0, false, parentSource); - @StorageLink('sourceObjAsset') sourceObjAsset: SourceObject2 | undefined = undefined; - - onPageShow(): void { - logger.info('this.sourceObj: ' + JSON.stringify(this.sourceObj)); - logger.info('this.sourceObjAsset: ' + JSON.stringify(this.sourceObjAsset)); - } - - build() { - Column() { - Text($r('app.string.verify_migrate_data_using_dataObject')) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .margin({ top: CommonConstants.TEXT_MARGIN_TOP, bottom: CommonConstants.TEXT_MARGIN_BOTTOM }) - - Text(JSON.stringify(this.sourceObj)) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - - Text($r('app.string.verify_migrate_data_using_dataObject_asset')) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .margin({ top: CommonConstants.TEXT_MARGIN_TOP, bottom: CommonConstants.TEXT_MARGIN_BOTTOM }) - - Text(JSON.stringify(this.sourceObjAsset)) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/MultiAsset.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/MultiAsset.ets deleted file mode 100644 index 4d8fc283c3bd50e8ae554b290f0df3bc9190b6f5..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/MultiAsset.ets +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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 CommonConstants from '../commom/Constants'; -import logger from '../commom/Logger'; - -class SourceObject { - name: string | undefined - assets: Object | undefined // 分布式数据对象的中添加一个Object属性 - - constructor(name: string | undefined, assets: Object | undefined) { - this.name = name - this.assets = assets; - } -} - -@Entry -@Component -struct MultiAsset { - @StorageLink('sourceObjMultiAsset') sourceObjMultiAsset: SourceObject | undefined = undefined; - - onPageShow(): void { - logger.info('this.sourceObjMultiAsset: ' + JSON.stringify(this.sourceObjMultiAsset)); - } - - build() { - Column() { - Text('验证分布式对象多个资产数据迁移:') - .id('DataObjHelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .margin({ top: CommonConstants.TEXT_MARGIN_TOP, bottom: CommonConstants.TEXT_MARGIN_BOTTOM }) - - Text(JSON.stringify(this.sourceObjMultiAsset)) - .id('DataObjHelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/PageName.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/PageName.ets deleted file mode 100644 index e52cb1fa3f2e88ad3c8cf5358dce34c31f9dab5f..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/PageName.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start onPageShow_setContinueState] -// [Start component_setContinueState] -import { AbilityConstant, common } from '@kit.AbilityKit'; -// [StartExclude onPageShow_setContinueState] -// [StartExclude component_setContinueState] -import CommonConstants from '../commom/Constants'; -// [EndExclude onPageShow_setContinueState] -// [EndExclude component_setContinueState] - -@Entry -@Component -struct PageName { - private context = getContext(this) as common.UIAbilityContext; - - // [StartExclude component_setContinueState] - onPageShow() { - // 进入该页面时,将应用设置为可迁移状态 - this.context.setMissionContinueState(AbilityConstant.ContinueState.ACTIVE, (result) => { - console.info('setMissionContinueState ACTIVE result: ', JSON.stringify(result)); - }); - } - - // [EndExclude component_setContinueState] - build() { - // [StartExclude onPageShow_setContinueState] - // [StartExclude component_setContinueState] - Column() { - // [EndExclude component_setContinueState] - - Button($r('app.string.setMissionContinueState_active')).onClick(() => { - //点击该按钮时,将应用设置为可迁移状态 - this.context.setMissionContinueState(AbilityConstant.ContinueState.ACTIVE, (result) => { - console.info('setMissionContinueState ACTIVE result: ', JSON.stringify(result)); - }); - }) - // [StartExclude component_setContinueState] - .margin({ top: CommonConstants.BUTTON_MARGIN_TOP }) - // [EndExclude component_setContinueState] - - // [StartExclude component_setContinueState] - Button($r('app.string.setMissionContinueState_inactive')).onClick(() => { - //点击该按钮时,将应用设置为不可迁移状态 - this.context.setMissionContinueState(AbilityConstant.ContinueState.INACTIVE, (result) => { - console.info('setMissionContinueState INACTIVE result: ', JSON.stringify(result)); - }); - }) - .margin(CommonConstants.BUTTON_MARGIN) - // [EndExclude component_setContinueState] - } - // [StartExclude component_setContinueState] - .width('100%') - .height('100%') - // [EndExclude component_setContinueState] - // [EndExclude onPageShow_setContinueState] - } -} - -// [End onPageShow_setContinueState] -// [End component_setContinueState] \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/Second.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/Second.ets deleted file mode 100644 index 5b79ad94f9839d4eb9b83c2dd0c8e02e2e1e3874..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/continue/Second.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -@Entry -@Component -struct Second { - @StorageLink('continueInput') continueInput: string|undefined = $r('app.string.default_text').params?.toString(); - - build() { - RelativeContainer() { - Text(this.continueInput) - .id('SecondHelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/entryability/EntryAbility.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index b26415c9739f741ee12949f55a49c93c234663fc..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start onContinue] -// [Start onCreate] -// [Start onNewWant] -// [Start onCreate_setContinueState] -// [Start keep_continuity] -// [Start continue_page_stack] -// [Start continue_source_exit] -import { AbilityConstant, UIAbility, Want, wantConstant } from '@kit.AbilityKit'; -// [StartExclude onCreate] -// [StartExclude onNewWant] -// [StartExclude onCreate_setContinueState] -// [StartExclude keep_continuity] -// [StartExclude continue_page_stack] -// [StartExclude continue_source_exit] -// [EndExclude continue_page_stack] -import { promptAction } from '@kit.ArkUI'; -// [StartExclude onContinue] -import { window } from '@kit.ArkUI'; -// [EndExclude onContinue] -// [EndExclude onCreate] -// [EndExclude onNewWant] -// [EndExclude onCreate_setContinueState] -// [EndExclude keep_continuity] -// [EndExclude continue_source_exit] -export default class EntryAbility extends UIAbility { - // [StartExclude onContinue] - // [StartExclude keep_continuity] - // [StartExclude continue_page_stack] - // [StartExclude continue_source_exit] - // [StartExclude onCreate_setContinueState] - storage: LocalStorage = new LocalStorage(); - // [EndExclude keep_continuity] - // [EndExclude onCreate_setContinueState] - // [StartExclude onNewWant] - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - // [StartExclude onCreate_setContinueState] - // [StartExclude keep_continuity] - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - // 将上述的保存的数据取出恢复 - let continueInput = ''; - if (want.parameters !== undefined) { - continueInput = JSON.stringify(want.parameters.data); - console.info(`continue input ${continueInput}`) - } - // [EndExclude onCreate_setContinueState] - // [StartExclude onCreate] - this.context.setMissionContinueState(AbilityConstant.ContinueState.INACTIVE, (result) => { - console.info(`setMissionContinueState: ${JSON.stringify(result)}`); - }); - // [EndExclude onCreate] - // [StartExclude onCreate_setContinueState] - // 触发页面恢复 - this.context.restoreWindowStage(this.storage); - // [EndExclude onCreate_setContinueState] - } - // [EndExclude keep_continuity] - // [StartExclude onCreate] - // [StartExclude onCreate_setContinueState] - // 迁移冷启动时,设置状态为可迁移 - this.context.setMissionContinueState(AbilityConstant.ContinueState.ACTIVE, (result) => { - console.info(`setMissionContinueState: ${JSON.stringify(result)}`); - }); - // [EndExclude onCreate] - // [EndExclude onCreate_setContinueState] - } - - // [StartExclude onCreate] - // [EndExclude onNewWant] - // [StartExclude onCreate_setContinueState] - onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { - // [StartExclude keep_continuity] - console.info(`EntryAbility onNewWant ${AbilityConstant.LaunchReason.CONTINUATION}`) - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - // 将上述的保存的数据取出恢复 - let continueInput = ''; - if (want.parameters !== undefined) { - continueInput = JSON.stringify(want.parameters.data); - console.info(`continue input ${continueInput}`); - } - this.context.restoreWindowStage(this.storage); - } - // [EndExclude keep_continuity] - // [StartExclude onNewWant] - // 迁移热启动时,设置状态为可迁移 - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - this.context.setMissionContinueState(AbilityConstant.ContinueState.ACTIVE, (result) => { - console.info('setMissionContinueState ACTIVE result: ', JSON.stringify(result)); - }); - } - // [EndExclude onNewWant] - } - - // [StartExclude keep_continuity] - // [StartExclude onNewWant] - onDestroy(): void { - console.info('testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - console.info('testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - console.error('testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - console.info('testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - console.info('testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - console.info('testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - console.info('testTag', '%{public}s', 'Ability onBackground'); - } - - // [EndExclude onContinue] - // [EndExclude continue_page_stack] - // [EndExclude continue_source_exit] - onContinue(wantParam: Record) { - // [StartExclude continue_page_stack] - // [StartExclude continue_source_exit] - const targetVersion = wantParam.version; // 获取迁移对端应用的版本号 - // 应用可根据源端版本号设置支持接续的最小兼容版本号,源端版本号可从app.json5文件中的versionCode字段获取;防止目标端版本号过低导致不兼容。 - const versionThreshold: number = 0; // 替换为应用自己支持兼容的最小版本号 - // 兼容性校验 - if (targetVersion < versionThreshold) { - // 建议在校验版本兼容性失败后,提示用户拒绝迁移的原因 - promptAction.showToast({ - message: '目标端应用版本号过低,不支持接续,请您升级应用版本后再试', - duration: 2000 - }) - // 在兼容性校验不通过时返回MISMATCH - return AbilityConstant.OnContinueResult.MISMATCH; - } - console.info(`onContinue version = ${wantParam.version}, targetDevice: ${wantParam.targetDevice}`) - // 迁移数据保存 - const continueInput = '迁移的数据'; - if (continueInput) { - // 将要迁移的数据保存在wantParam的自定义字段(如:data)中; - wantParam['data'] = continueInput; - } - // [EndExclude continue_page_stack] - // [EndExclude continue_source_exit] - // [StartExclude onContinue] - console.info(`onContinue version = ${wantParam.version}, targetDevice: ${wantParam.targetDevice}`); - // [StartExclude continue_source_exit] - wantParam[wantConstant.Params.SUPPORT_CONTINUE_PAGE_STACK_KEY] = false; - // [EndExclude continue_source_exit] - // [StartExclude continue_page_stack] - wantParam[wantConstant.Params.SUPPORT_CONTINUE_SOURCE_EXIT_KEY] = false; - // [EndExclude continue_page_stack] - // [EndExclude onContinue] - return AbilityConstant.OnContinueResult.AGREE; - } - - // [StartExclude continue_source_exit] - // [StartExclude onContinue] - onWindowStageRestore(windowStage: window.WindowStage) { - // 若不需要自动迁移页面栈信息,则需要在此处设置应用迁移后进入的页面 - windowStage.loadContent('continue/PageName', (err, data) => { - if (err.code) { - console.info('Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - console.info('Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - // [EndExclude onContinue] - // [EndExclude onCreate] - // [EndExclude onNewWant] - // [EndExclude onCreate_setContinueState] - // [EndExclude keep_continuity] - // [EndExclude continue_source_exit] -} -// [End onContinue] -// [End onCreate] -// [End onNewWant] -// [End onCreate_setContinueState] -// [End keep_continuity] -// [End continue_page_stack] -// [End continue_source_exit] \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability/MigrationAbility.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability/MigrationAbility.ets deleted file mode 100644 index d660fb405602720dd88c002d417108a1deb85cbb..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability/MigrationAbility.ets +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start dataObject_onContinue] -// [Start dataObject_onCreate_onNewWant] -import { UIAbility, AbilityConstant, Want } from '@kit.AbilityKit'; -import { distributedDataObject } from '@kit.ArkData'; -// [StartExclude dataObject_onCreate_onNewWant] -import { BusinessError } from '@kit.BasicServicesKit'; -// [EndExclude dataObject_onCreate_onNewWant] -import { hilog } from '@kit.PerformanceAnalysisKit'; -// [StartExclude dataObject_onContinue] -// [StartExclude dataObject_onCreate_onNewWant] -import { window } from '@kit.ArkUI'; -// [EndExclude dataObject_onContinue] -// [EndExclude dataObject_onCreate_onNewWant] - -const TAG: string = '[MigrationAbility]'; -const DOMAIN_NUMBER: number = 0xFF00; - -// [StartExclude dataObject_onContinue] -// 示例数据对象定义与上同 -// [EndExclude dataObject_onContinue] -// [StartExclude dataObject_onCreate_onNewWant] -// 业务数据定义 -class ParentObject { - mother: string - father: string - - constructor(mother: string, father: string) { - this.mother = mother - this.father = father - } -} - -// 支持字符、数字、布尔值、对象的传递 -class SourceObject { - name: string | undefined - age: number | undefined - isVis: boolean | undefined - parent: ParentObject | undefined - - constructor(name: string | undefined, age: number | undefined, isVis: boolean | undefined, parent: ParentObject | undefined) { - this.name = name - this.age = age - this.isVis = isVis - this.parent = parent - } -} -// [EndExclude dataObject_onCreate_onNewWant] - -export default class MigrationAbility extends UIAbility { - d_object?: distributedDataObject.DataObject; - // [StartExclude dataObject_onContinue] - // [StartExclude dataObject_onCreate_onNewWant] - contentStorage?: LocalStorage; - // [EndExclude dataObject_onContinue] - // [EndExclude dataObject_onCreate_onNewWant] - - // [StartExclude dataObject_onContinue] - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - // [StartExclude dataObject_onCreate_onNewWant] - console.info(`EntryAbility onCreate ${AbilityConstant.LaunchReason.CONTINUATION}`) - this.context.restoreWindowStage(this.contentStorage); - // [EndExclude dataObject_onCreate_onNewWant] - // 调用封装好的分布式数据对象处理函数 - this.handleDistributedData(want); - } - } - - onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - if (want.parameters !== undefined) { - // [StartExclude dataObject_onCreate_onNewWant] - console.info(`EntryAbility onNewWant ${AbilityConstant.LaunchReason.CONTINUATION}`) - this.context.restoreWindowStage(this.contentStorage); - // [EndExclude dataObject_onCreate_onNewWant] - // 调用封装好的分布式数据对象处理函数 - this.handleDistributedData(want); - } - } - } - - handleDistributedData(want: Want) { - // 创建空的分布式数据对象 - let remoteSource: SourceObject = new SourceObject(undefined, undefined, undefined, undefined); - this.d_object = distributedDataObject.create(this.context, remoteSource); - - // 读取分布式数据对象组网id - let dataSessionId = ''; - if (want.parameters !== undefined) { - dataSessionId = want.parameters.dataSessionId as string; - } - // 添加数据变更监听 - this.d_object.on('status', (sessionId: string, networkId: string, status: 'online' | 'offline' | 'restored') => { - hilog.info(DOMAIN_NUMBER, TAG, 'status changed ' + sessionId + ' ' + status + ' ' + networkId); - if (status === 'restored') { - if (this.d_object) { - // 收到迁移恢复的状态时,可以从分布式数据对象中读取数据 - hilog.info(DOMAIN_NUMBER, TAG, 'restored name:' + this.d_object['name']); - hilog.info(DOMAIN_NUMBER, TAG, 'restored parents:' + JSON.stringify(this.d_object['parent'])); - // [StartExclude dataObject_onCreate_onNewWant] - let sourceObj: SourceObject = new SourceObject(this.d_object['name'], this.d_object['age'], this.d_object['isVis'], this.d_object['parent']); - AppStorage.setOrCreate('sourceObj', sourceObj); - // [EndExclude dataObject_onCreate_onNewWant] - } - } - }); - // 激活分布式数据对象 - this.d_object.setSessionId(dataSessionId); - } - // [EndExclude dataObject_onContinue] - - // [StartExclude dataObject_onCreate_onNewWant] - async onContinue(wantParam: Record): Promise { - // ... - let parentSource: ParentObject = new ParentObject('jack mom', 'jack Dad'); - let source: SourceObject = new SourceObject('jack', 18, false, parentSource); - - // 创建分布式数据对象 - this.d_object = distributedDataObject.create(this.context, source); - - // 生成数据对象组网id,激活分布式数据对象 - let dataSessionId: string = distributedDataObject.genSessionId(); - this.d_object.setSessionId(dataSessionId); - - // 将组网id存在want中传递到对端 - wantParam['dataSessionId'] = dataSessionId; - - // 数据对象持久化,确保迁移后即使应用退出,对端依然能够恢复数据对象 - // 从wantParam.targetDevice中获取到对端设备的networkId作为入参 - await this.d_object.save(wantParam.targetDevice as string).then((result: - distributedDataObject.SaveSuccessResponse) => { - hilog.info(DOMAIN_NUMBER, TAG, `Succeeded in saving. SessionId: ${result.sessionId}, - version:${result.version}, deviceId:${result.deviceId}`); - }).catch((err: BusinessError) => { - hilog.error(DOMAIN_NUMBER, TAG, 'Failed to save. Error: ', JSON.stringify(err) ?? ''); - }); - // [StartExclude dataObject_onContinue] - return AbilityConstant.OnContinueResult.AGREE; - // [EndExclude dataObject_onContinue] - } - // [EndExclude dataObject_onCreate_onNewWant] - - // [StartExclude dataObject_onContinue] - // [StartExclude dataObject_onCreate_onNewWant] - onDestroy(): void { - console.info('testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - console.info('testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('continue/DataObj', (err) => { - if (err.code) { - console.error('testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - console.info('testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageRestore(windowStage: window.WindowStage) { - // 若不需要自动迁移页面栈信息,则需要在此处设置应用迁移后进入的页面 - windowStage.loadContent('continue/DataObj', (err, data) => { - if (err.code) { - console.info('Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - console.info('Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - console.info('testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - console.info('testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - console.info('testTag', '%{public}s', 'Ability onBackground'); - } - // [EndExclude dataObject_onContinue] - // [EndExclude dataObject_onCreate_onNewWant] -} -// [End dataObject_onContinue] -// [End dataObject_onCreate_onNewWant] \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability_asset/MigrationAbility_asset.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability_asset/MigrationAbility_asset.ets deleted file mode 100644 index efa2255e494f1d1b0bc1b61768219454e5536b26..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability_asset/MigrationAbility_asset.ets +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start dataObject_asset_source] -// [Start dataObject_asset_sink] -// 导入模块 -import { UIAbility, AbilityConstant, Want } from '@kit.AbilityKit'; -import { distributedDataObject, commonType } from '@kit.ArkData'; -import { fileIo, fileUri } from '@kit.CoreFileKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { BusinessError } from '@ohos.base'; -// [StartExclude dataObject_asset_source] -import { window } from '@kit.ArkUI'; -// [EndExclude dataObject_asset_source] - -const TAG: string = '[MigrationAbility]'; -const DOMAIN_NUMBER: number = 0xFF00; - -// [StartExclude dataObject_asset_sink] -// 数据对象定义 -class ParentObject { - mother: string - father: string - - constructor(mother: string, father: string) { - this.mother = mother - this.father = father - } -} - -class SourceObject { - name: string | undefined - age: number | undefined - isVis: boolean | undefined - parent: ParentObject | undefined - attachment: commonType.Asset | undefined // 新增资产属性 - - constructor(name: string | undefined, age: number | undefined, isVis: boolean | undefined, - parent: ParentObject | undefined, attachment: commonType.Asset | undefined) { - this.name = name - this.age = age - this.isVis = isVis - this.parent = parent - this.attachment = attachment; - } -} -// [EndExclude dataObject_asset_sink] - -export default class MigrationAbility_asset extends UIAbility { - d_object?: distributedDataObject.DataObject; - // [StartExclude dataObject_asset_source] - // [StartExclude dataObject_asset_sink] - contentStorage?: LocalStorage; - // [EndExclude dataObject_asset_sink] - - handleDistributedData(want: Want) { - // ... - // 创建一个各属性为空的资产对象 - let attachment: commonType.Asset = { - name: '', - uri: '', - path: '', - createTime: '', - modifyTime: '', - size: '', - } - - // [StartExclude dataObject_asset_sink] - // 读取分布式数据对象组网id - let dataSessionId = ''; - if (want.parameters !== undefined) { - dataSessionId = want.parameters.dataSessionId as string; - } - // [EndExclude dataObject_asset_sink] - - // 使用该空资产对象创建分布式数据对象,其余基础属性可以直接使用undefined - let source: SourceObject = new SourceObject(undefined, undefined, undefined, undefined, attachment); - this.d_object = distributedDataObject.create(this.context, source); - - this.d_object.on('status', (sessionId: string, networkId: string, status: 'online' | 'offline' | 'restored') => { - if (status === 'restored') { - // 收到监听的restored回调,表示分布式资产对象同步完成 - if (this.d_object) { - hilog.info(DOMAIN_NUMBER, TAG, 'restored attachment:' + JSON.stringify(this.d_object['attachment'])); - // [StartExclude dataObject_asset_sink] - let sourceObjAsset: SourceObject = - new SourceObject(this.d_object['name'], this.d_object['age'], this.d_object['isVis'], - this.d_object['parent'], this.d_object['attachment']); - AppStorage.setOrCreate('sourceObjAsset', sourceObjAsset); - // [EndExclude dataObject_asset_sink] - } - } - }); - - // [StartExclude dataObject_asset_sink] - // 激活分布式数据对象 - this.d_object.setSessionId(dataSessionId); - // [EndExclude dataObject_asset_sink] - } - // [EndExclude dataObject_asset_source] - - // [StartExclude dataObject_asset_sink] - async onContinue(wantParam: Record): Promise { - // ... - - // 1. 将资产写入分布式文件目录下 - let distributedDir: string = this.context.distributedFilesDir; // 获取分布式文件目录路径 - let fileName: string = '/test.txt'; // 文件名 - let filePath: string = distributedDir + fileName; // 文件路径 - - try { - // 在分布式目录下创建文件 - let file = fileIo.openSync(filePath, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); - hilog.info(DOMAIN_NUMBER, TAG, 'Create file success.'); - // 向文件中写入内容(若资产为图片,可将图片转换为buffer后写入) - fileIo.writeSync(file.fd, '[Sample] Insert file content here.'); - // 关闭文件 - fileIo.closeSync(file.fd); - } catch (error) { - let err: BusinessError = error as BusinessError; - hilog.error(DOMAIN_NUMBER, TAG, `Failed to openSync / writeSync / closeSync. Code: ${err.code}, message: ${err.message}`); - } - - // 2. 使用分布式文件目录下的文件创建资产对象 - let distributedUri: string = fileUri.getUriFromPath(filePath); // 获取分布式文件Uri - - // 获取文件参数 - let ctime: string = ''; - let mtime: string = ''; - let size: string = ''; - await fileIo.stat(filePath).then((stat: fileIo.Stat) => { - ctime = stat.ctime.toString(); // 创建时间 - mtime = stat.mtime.toString(); // 修改时间 - size = stat.size.toString(); // 文件大小 - }) - - // 创建资产对象 - let attachment: commonType.Asset = { - name: fileName, - uri: distributedUri, - path: filePath, - createTime: ctime, - modifyTime: mtime, - size: size, - } - - // 3. 将资产对象作为分布式数据对象的根属性,创建分布式数据对象 - let parentSource: ParentObject = new ParentObject('jack mom', 'jack Dad'); - let source: SourceObject = new SourceObject('jack', 18, false, parentSource, attachment); - this.d_object = distributedDataObject.create(this.context, source); - - // 生成组网id,激活分布式数据对象,save持久化保存 - // [StartExclude dataObject_asset_source] - let dataSessionId: string = distributedDataObject.genSessionId(); - this.d_object.setSessionId(dataSessionId); - - // 将组网id存在want中传递到对端 - wantParam['dataSessionId'] = dataSessionId; - - // 数据对象持久化,确保迁移后即使应用退出,对端依然能够恢复数据对象 - // 从wantParam.targetDevice中获取到对端设备的networkId作为入参 - await this.d_object.save(wantParam.targetDevice as string).then((result: - distributedDataObject.SaveSuccessResponse) => { - hilog.info(DOMAIN_NUMBER, TAG, `Succeeded in saving. SessionId: ${result.sessionId}, - version:${result.version}, deviceId:${result.deviceId}`); - }).catch((err: BusinessError) => { - hilog.error(DOMAIN_NUMBER, TAG, 'Failed to save. Error: ', JSON.stringify(err) ?? ''); - }); - return AbilityConstant.OnContinueResult.AGREE; - // [EndExclude dataObject_asset_source] - } - - // [StartExclude dataObject_asset_source] - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - // [StartExclude dataObject_onCreate_onNewWant] - console.info(`EntryAbility onCreate ${AbilityConstant.LaunchReason.CONTINUATION}`) - this.context.restoreWindowStage(this.contentStorage); - // [EndExclude dataObject_onCreate_onNewWant] - // 调用封装好的分布式数据对象处理函数 - this.handleDistributedData(want); - } - } - - onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - if (want.parameters !== undefined) { - // [StartExclude dataObject_onCreate_onNewWant] - console.info(`EntryAbility onNewWant ${AbilityConstant.LaunchReason.CONTINUATION}`) - this.context.restoreWindowStage(this.contentStorage); - // [EndExclude dataObject_onCreate_onNewWant] - // 调用封装好的分布式数据对象处理函数 - this.handleDistributedData(want); - } - } - } - - onDestroy(): void { - console.info('testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - console.info('testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('continue/DataObj', (err) => { - if (err.code) { - console.error('testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - console.info('testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageRestore(windowStage: window.WindowStage) { - // 若不需要自动迁移页面栈信息,则需要在此处设置应用迁移后进入的页面 - windowStage.loadContent('continue/DataObj', (err, data) => { - if (err.code) { - console.info('Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - console.info('Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - console.info('testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - console.info('testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - console.info('testTag', '%{public}s', 'Ability onBackground'); - } - // [EndExclude dataObject_asset_source] - // [EndExclude dataObject_asset_sink] -} -// [End dataObject_asset_source] -// [End dataObject_asset_sink] diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability_multi_asset/MigrationAbility_multi_asset.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability_multi_asset/MigrationAbility_multi_asset.ets deleted file mode 100644 index c27968ed048b0f092943ed99f63bec940592ae9f..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability_multi_asset/MigrationAbility_multi_asset.ets +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start dataObject_multi_asset] -// 导入模块 -import { distributedDataObject, commonType } from '@kit.ArkData'; -import { UIAbility, AbilityConstant, Want } from '@kit.AbilityKit'; -// [StartExclude dataObject_multi_asset] -import { fileIo, fileUri } from '@kit.CoreFileKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { BusinessError } from '@ohos.base'; -import { window } from '@kit.ArkUI'; - -const TAG: string = '[MigrationAbility]'; -const DOMAIN_NUMBER: number = 0xFF00; -// [EndExclude dataObject_multi_asset] - -// 数据对象定义 -class SourceObject { - name: string | undefined - assets: Object | undefined // 分布式数据对象的中添加一个Object属性 - - constructor(name: string | undefined, assets: Object | undefined) { - this.name = name - this.assets = assets; - } -} - -export default class MigrationAbility_multi_asset extends UIAbility { - d_object?: distributedDataObject.DataObject; - // [StartExclude dataObject_multi_asset] - contentStorage?: LocalStorage; - // [EndExclude dataObject_multi_asset] - - // 该函数用于将资产数组转为Record - GetAssetsWrapper(assets: commonType.Assets): Record { - let wrapper: Record = {} - let num: number = assets.length; - for (let i: number = 0; i < num; i++) { - wrapper[`asset${i}`] = assets[i]; - } - return wrapper; - } - - async onContinue(wantParam: Record): Promise { - // [StartExclude dataObject_multi_asset] - // 1. 将资产写入分布式文件目录下 - let distributedDir: string = this.context.distributedFilesDir; // 获取分布式文件目录路径 - let fileName: string = '/test.txt'; // 文件名 - let filePath: string = distributedDir + fileName; // 文件路径 - - let fileName2: string = '/test2.txt'; // 文件名 - let filePath2: string = distributedDir + fileName2; // 文件路径 - - try { - // 在分布式目录下创建文件 - let file = fileIo.openSync(filePath, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); - hilog.info(DOMAIN_NUMBER, TAG, 'Create file success.'); - // 向文件中写入内容(若资产为图片,可将图片转换为buffer后写入) - fileIo.writeSync(file.fd, '[Sample] Insert file content here.'); - // 关闭文件 - fileIo.closeSync(file.fd); - - // 在分布式目录下创建文件2 - let file2 = fileIo.openSync(filePath2, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); - hilog.info(DOMAIN_NUMBER, TAG, 'Create file success.'); - // 向文件2中写入内容(若资产为图片,可将图片转换为buffer后写入) - fileIo.writeSync(file2.fd, '[Sample] Insert file2 content here.'); - // 关闭文件2 - fileIo.closeSync(file2.fd); - } catch (error) { - let err: BusinessError = error as BusinessError; - hilog.error(DOMAIN_NUMBER, TAG, `Failed to openSync / writeSync / closeSync 2. Code: ${err.code}, message: ${err.message}`); - } - - // 2. 使用分布式文件目录下的文件创建资产对象 - let distributedUri: string = fileUri.getUriFromPath(filePath); // 获取分布式文件Uri - let distributedUri2: string = fileUri.getUriFromPath(filePath2); - - // 获取文件参数 - let ctime: string = ''; - let mtime: string = ''; - let size: string = ''; - await fileIo.stat(filePath).then((stat: fileIo.Stat) => { - ctime = stat.ctime.toString(); // 创建时间 - mtime = stat.mtime.toString(); // 修改时间 - size = stat.size.toString(); // 文件大小 - }) - let ctime2: string = ''; - let mtime2: string = ''; - let size2: string = ''; - await fileIo.stat(filePath2).then((stat: fileIo.Stat) => { - ctime2 = stat.ctime.toString(); // 创建时间 - mtime2 = stat.mtime.toString(); // 修改时间 - size2 = stat.size.toString(); // 文件大小 - }) - // [EndExclude dataObject_multi_asset] - - // 创建多个资产对象 - let attachment1: commonType.Asset = { - // [StartExclude dataObject_multi_asset] - name: fileName, - uri: distributedUri, - path: filePath, - createTime: ctime, - modifyTime: mtime, - size: size, - // [EndExclude dataObject_multi_asset] - } - - let attachment2: commonType.Asset = { - // [StartExclude dataObject_multi_asset] - name: fileName2, - uri: distributedUri2, - path: filePath2, - createTime: ctime2, - modifyTime: mtime2, - size: size2, - // [EndExclude dataObject_multi_asset] - } - - // 将资产对象插入资产数组 - let assets: commonType.Assets = []; - assets.push(attachment1); - assets.push(attachment2); - - // 将资产数组转为Record Object,并用于创建分布式数据对象 - let assetsWrapper: Object = this.GetAssetsWrapper(assets); - let source: SourceObject = new SourceObject('jack', assetsWrapper); - this.d_object = distributedDataObject.create(this.context, source); - - // [StartExclude dataObject_multi_asset] - // 生成组网id,激活分布式数据对象,save持久化保存 - // [StartExclude dataObject_asset_source] - let dataSessionId: string = distributedDataObject.genSessionId(); - this.d_object.setSessionId(dataSessionId); - - // 将组网id存在want中传递到对端 - wantParam['dataSessionId'] = dataSessionId; - - // 数据对象持久化,确保迁移后即使应用退出,对端依然能够恢复数据对象 - // 从wantParam.targetDevice中获取到对端设备的networkId作为入参 - await this.d_object.save(wantParam.targetDevice as string).then((result: - distributedDataObject.SaveSuccessResponse) => { - hilog.info(DOMAIN_NUMBER, TAG, `Succeeded in saving. SessionId: ${result.sessionId}, - version:${result.version}, deviceId:${result.deviceId}`); - }).catch((err: BusinessError) => { - hilog.error(DOMAIN_NUMBER, TAG, 'Failed to save. Error: ', JSON.stringify(err) ?? ''); - }); - return AbilityConstant.OnContinueResult.AGREE; - // [EndExclude dataObject_multi_asset] - } - - // [StartExclude dataObject_multi_asset] - handleDistributedData(want: Want) { - // ... - // 创建一个各属性为空的资产对象 - let attachment1: commonType.Asset = { - name: '', - uri: '', - path: '', - createTime: '', - modifyTime: '', - size: '', - } - let attachment2: commonType.Asset = { - name: '', - uri: '', - path: '', - createTime: '', - modifyTime: '', - size: '', - } - - let assets: commonType.Assets = []; - assets.push(attachment1); - assets.push(attachment2); - let assetsWrapper: Object = this.GetAssetsWrapper(assets); - - // 读取分布式数据对象组网id - let dataSessionId = ''; - if (want.parameters !== undefined) { - dataSessionId = want.parameters.dataSessionId as string; - } - - // 使用该空资产对象创建分布式数据对象,其余基础属性可以直接使用undefined - let source: SourceObject = new SourceObject(undefined, undefined); - this.d_object = distributedDataObject.create(this.context, source); - - this.d_object.on('status', (sessionId: string, networkId: string, status: 'online' | 'offline' | 'restored') => { - if (status === 'restored') { - // 收到监听的restored回调,表示分布式资产对象同步完成 - if (this.d_object) { - hilog.info(DOMAIN_NUMBER, TAG, 'restored attachment:' + JSON.stringify(this.d_object['assets'])); - let sourceObjMultiAsset: SourceObject = - new SourceObject(this.d_object['name'], this.d_object['assets']); - AppStorage.setOrCreate('sourceObjMultiAsset', sourceObjMultiAsset); - } - } - }); - - // 激活分布式数据对象 - this.d_object.setSessionId(dataSessionId); - } - - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - console.info(`EntryAbility onCreate ${AbilityConstant.LaunchReason.CONTINUATION}`) - this.context.restoreWindowStage(this.contentStorage); - // 调用封装好的分布式数据对象处理函数 - this.handleDistributedData(want); - } - } - - onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - if (want.parameters !== undefined) { - console.info(`EntryAbility onNewWant ${AbilityConstant.LaunchReason.CONTINUATION}`) - this.context.restoreWindowStage(this.contentStorage); - // 调用封装好的分布式数据对象处理函数 - this.handleDistributedData(want); - } - } - } - - onDestroy(): void { - console.info('testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - console.info('testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('continue/MultiAsset', (err) => { - if (err.code) { - console.error('testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - console.info('testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageRestore(windowStage: window.WindowStage) { - // 若不需要自动迁移页面栈信息,则需要在此处设置应用迁移后进入的页面 - windowStage.loadContent('continue/MultiAsset', (err, data) => { - if (err.code) { - console.info('Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - console.info('Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - console.info('testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - console.info('testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - console.info('testTag', '%{public}s', 'Ability onBackground'); - } - // [EndExclude dataObject_multi_asset] -} -// [End dataObject_multi_asset] diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability_quickstart/MigrationAbility_quickStart.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability_quickstart/MigrationAbility_quickStart.ets deleted file mode 100644 index 5ca9c508ca41ff205725a010fd7c236ce888982f..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/migrationability_quickstart/MigrationAbility_quickStart.ets +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start continue_quick_start] -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -// [StartExclude continue_quick_start] -import { promptAction, window } from '@kit.ArkUI'; -// [EndExclude continue_quick_start] -const TAG: string = '[MigrationAbility]'; -const DOMAIN_NUMBER: number = 0xFF00; - -export default class MigrationAbility_quickStart extends UIAbility { - storage : LocalStorage = new LocalStorage(); - - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN_NUMBER, TAG, '%{public}s', 'Ability onCreate'); - - // 1.已配置快速拉起功能,应用立即启动时触发应用生命周期回调 - if (launchParam.launchReason === AbilityConstant.LaunchReason.PREPARE_CONTINUATION) { - //若应用迁移数据较大,可在此处添加加载页面(页面中显示loading等) - //可处理应用自定义跳转、时序等问题 - // ... - } - } - - onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN_NUMBER, TAG, 'onNewWant'); - - // 1.已配置快速拉起功能,应用立即启动时触发应用生命周期回调 - if (launchParam.launchReason === AbilityConstant.LaunchReason.PREPARE_CONTINUATION) { - //若应用迁移数据较大,可在此处添加加载页面(页面中显示loading等) - //可处理应用自定义跳转、时序等问题 - // ... - } - - // 2.迁移数据恢复时触发应用生命周期回调 - if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { - // 将上述保存的数据从want.parameters中取出恢复 - let continueInput = ''; - if (want.parameters !== undefined) { - continueInput = JSON.stringify(want.parameters.data); - hilog.info(DOMAIN_NUMBER, TAG, `continue input ${JSON.stringify(continueInput)}`); - } - // 触发页面恢复 - this.context.restoreWindowStage(this.storage); - } - } - - // [StartExclude continue_quick_start] - onContinue(wantParam: Record) { - const targetVersion = wantParam.version; // 获取迁移对端应用的版本号 - // 应用可根据源端版本号设置支持接续的最小兼容版本号,源端版本号可从app.json5文件中的versionCode字段获取;防止目标端版本号过低导致不兼容。 - const versionThreshold: number = 0; // 替换为应用自己支持兼容的最小版本号 - // 兼容性校验 - if (targetVersion < versionThreshold) { - // 建议在校验版本兼容性失败后,提示用户拒绝迁移的原因 - promptAction.showToast({ - message: '目标端应用版本号过低,不支持接续,请您升级应用版本后再试', - duration: 2000 - }) - // 在兼容性校验不通过时返回MISMATCH - return AbilityConstant.OnContinueResult.MISMATCH; - } - console.info(`onContinue version = ${wantParam.version}, targetDevice: ${wantParam.targetDevice}`) - // 迁移数据保存 - const continueInput = '迁移的数据'; - if (continueInput) { - // 将要迁移的数据保存在wantParam的自定义字段(如:data)中; - wantParam['data'] = continueInput; - } - return AbilityConstant.OnContinueResult.AGREE; - } - - onDestroy(): void { - hilog.info(DOMAIN_NUMBER, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN_NUMBER, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN_NUMBER, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN_NUMBER, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN_NUMBER, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN_NUMBER, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN_NUMBER, 'testTag', '%{public}s', 'Ability onBackground'); - } - // [EndExclude continue_quick_start] -} -// [End continue_quick_start] \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/ets/pages/Index.ets b/DistributedAppDev/ContinueSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index bbaecb90d6dedb2bace004bf3cd83fdec8fd1d3f..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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 { common, Want } from '@kit.AbilityKit'; -import { router } from '@kit.ArkUI'; -import CommonConstants from '../commom/Constants'; -import logger from '../commom/Logger'; - -const TAG: string = '[Index]'; - -@Entry -@Component -struct Index { - private context = getContext(this) as common.UIAbilityContext; - - build() { - Column() { - Button($r('app.string.setMissionContinueState')).onClick(() => { - router.pushUrl({ url: 'continue/PageName' }, () => { - logger.info(`${TAG} setTimeout router pushUrl continue/PageName`); - }) - }) - .margin({ top: CommonConstants.BUTTON_MARGIN_TOP }) - .width(CommonConstants.BUTTON_WIDTH) - - Button($r('app.string.basic_continue_data_example')).onClick(() => { - let want: Want = { - bundleName: 'com.sample.continue', - abilityName: 'Ability_deviceA' - } - this.context.startAbility(want); - }) - .margin(CommonConstants.BUTTON_MARGIN) - .width(CommonConstants.BUTTON_WIDTH) - - Button($r('app.string.migrate_data_using_dataObject')).onClick(() => { - let want: Want = { - bundleName: 'com.sample.continue', - abilityName: 'MigrationAbility' - } - this.context.startAbility(want); - }) - .margin(CommonConstants.BUTTON_MARGIN) - .width(CommonConstants.BUTTON_WIDTH) - - Button($r('app.string.migrate_data_using_dataObject_asset')).onClick(() => { - let want: Want = { - bundleName: 'com.sample.continue', - abilityName: 'MigrationAbility_asset' - } - this.context.startAbility(want); - }) - .margin(CommonConstants.BUTTON_MARGIN) - .width(CommonConstants.BUTTON_WIDTH) - - Button($r('app.string.migrate_data_using_dataObject_multi_asset')).onClick(() => { - let want: Want = { - bundleName: 'com.sample.continue', - abilityName: 'MigrationAbility_multi_asset' - } - this.context.startAbility(want); - }) - .margin(CommonConstants.BUTTON_MARGIN) - .width(CommonConstants.BUTTON_WIDTH) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/module.json5 b/DistributedAppDev/ContinueSample/entry/src/main/module.json5 deleted file mode 100644 index f19632549fb856c1ac1f6995a2cc0bb658b285e5..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/module.json5 +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone" - ], - "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, - "continuable": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - }, - { - "name": "Ability_deviceA", - "continueType": [ - 'continueType1' - ], - "continuable": true, - "srcEntry": "./ets/ability_devicea/Ability_deviceA.ets", - "description": "$string:Ability_deviceA_desc", - "icon": "$media:layered_image", - "label": "$string:Ability_deviceA_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "Ability_deviceB", - "continueType": [ - 'continueType1' - ], - "continuable": true, - "srcEntry": "./ets/ability_deviceb/Ability_deviceB.ets", - "description": "$string:Ability_deviceB_desc", - "icon": "$media:layered_image", - "label": "$string:Ability_deviceB_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - }, - { - "name": "MigrationAbility", - "srcEntry": "./ets/migrationability/MigrationAbility.ets", - "description": "$string:MigrationAbility_desc", - "icon": "$media:layered_image", - "label": "$string:MigrationAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "continuable": true, - }, - { - "name": "MigrationAbility_quickStart", - "srcEntry": "./ets/migrationability_quickstart/MigrationAbility_quickStart.ets", - "description": "$string:MigrationAbility_quickStart_desc", - "icon": "$media:layered_image", - "label": "$string:MigrationAbility_quickStart_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "continuable": true, - "continueType": [ - 'EntryAbility_ContinueQuickStart' - ] - }, - { - "name": "MigrationAbility_asset", - "srcEntry": "./ets/migrationability_asset/MigrationAbility_asset.ets", - "description": "$string:MigrationAbility_asset_desc", - "icon": "$media:layered_image", - "label": "$string:MigrationAbility_asset_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "continuable": true, - }, - { - "name": "MigrationAbility_multi_asset", - "srcEntry": "./ets/migrationability_multi_asset/MigrationAbility_multi_asset.ets", - "description": "$string:MigrationAbility_multi_asset_desc", - "icon": "$media:layered_image", - "label": "$string:MigrationAbility_multi_asset_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "continuable": true, - } - ] - } -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/element/color.json b/DistributedAppDev/ContinueSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/element/float.json b/DistributedAppDev/ContinueSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a53507576908b67bb11a73eed637561e8cb9971e..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "20fp" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/element/string.json b/DistributedAppDev/ContinueSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index afabb09ac35446658b04d6542dc45f65cb63a43c..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "ContinueSample" - }, - { - "name": "Ability_deviceA_desc", - "value": "description" - }, - { - "name": "Ability_deviceA_label", - "value": "label" - }, - { - "name": "Ability_deviceB_desc", - "value": "description" - }, - { - "name": "Ability_deviceB_label", - "value": "label" - }, - { - "name": "MigrationAbility_desc", - "value": "description" - }, - { - "name": "MigrationAbility_label", - "value": "label" - }, - { - "name": "MigrationAbility_asset_desc", - "value": "description" - }, - { - "name": "MigrationAbility_asset_label", - "value": "label" - }, - { - "name": "MigrationAbility_multi_asset_desc", - "value": "description" - }, - { - "name": "MigrationAbility_multi_asset_label", - "value": "label" - }, - { - "name": "MigrationAbility_quickStart_desc", - "value": "description" - }, - { - "name": "MigrationAbility_quickStart_label", - "value": "label" - }, - { - "name": "setMissionContinueState_active", - "value": "Set it to the migrate state" - }, - { - "name": "setMissionContinueState_inactive", - "value": "Set to non-transferable state" - }, - { - "name": "setMissionContinueState", - "value": "Dynamic configuration of migration capabilities" - }, - { - "name": "basic_continue_data_example", - "value": "Basic migration data example" - }, - { - "name": "migrate_data_using_dataObject", - "value": "Migrate data using distributed data objects" - }, - { - "name": "migrate_data_using_dataObject_asset", - "value": "Migrate data using distributed data objects (assets)" - }, - { - "name": "migrate_data_using_dataObject_multi_asset", - "value": "Migrate data using distributed data objects (multiple assets)" - }, - { - "name": "default_text", - "value": "default text" - }, - { - "name": "verify_migrate_data_using_dataObject", - "value": "Verify the basic data migration of distributed objects" - }, - { - "name": "verify_migrate_data_using_dataObject_asset", - "value": "Verify the data migration of distributed object assets" - }, - { - "name": "verify_migrate_data_using_dataObject_multi_asset", - "value": "Verify the data migration of multiple assets of distributed objects" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/background.png b/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/foreground.png b/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/layered_image.json b/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/startIcon.png b/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/profile/backup_config.json b/DistributedAppDev/ContinueSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/profile/main_pages.json b/DistributedAppDev/ContinueSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 4254f6b83bce7c4bb33e7292dad3fb0522127976..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "src": [ - "pages/Index", - "continue/DataObj", - "continue/MultiAsset", - "continue/PageName", - "continue/Second" - ] -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/dark/element/color.json b/DistributedAppDev/ContinueSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/main/resources/zh_CN/element/string.json b/DistributedAppDev/ContinueSample/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 12b022594c55b53f00727f0891dd4141cbbcd462..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "setMissionContinueState_active", - "value": "设置为可迁移状态" - }, - { - "name": "setMissionContinueState_inactive", - "value": "设置为不可迁移状态" - }, - { - "name": "setMissionContinueState", - "value": "动态配置迁移能力" - }, - { - "name": "basic_continue_data_example", - "value": "基础迁移数据示例" - }, - { - "name": "migrate_data_using_dataObject", - "value": "使用分布式数据对象迁移数据" - }, - { - "name": "migrate_data_using_dataObject_asset", - "value": "使用分布式数据对象(资产)迁移数据" - }, - { - "name": "migrate_data_using_dataObject_multi_asset", - "value": "使用分布式数据对象(多个资产)迁移数据" - }, - { - "name": "default_text", - "value": "默认文本" - }, - { - "name": "verify_migrate_data_using_dataObject", - "value": "验证分布式对象基础数据迁移" - }, - { - "name": "verify_migrate_data_using_dataObject_asset", - "value": "验证分布式对象资产数据迁移" - }, - { - "name": "verify_migrate_data_using_dataObject_multi_asset", - "value": "验证分布式对象多个资产数据迁移" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/mock/mock-config.json5 b/DistributedAppDev/ContinueSample/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41bfdf76d6f793007240d80983a52f15f97..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/ohosTest/ets/test/Ability.test.ets b/DistributedAppDev/ContinueSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 7f30942b81554a399e89aa253c7089eca4f8d8d1..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/ohosTest/ets/test/Continue.test.ets b/DistributedAppDev/ContinueSample/entry/src/ohosTest/ets/test/Continue.test.ets deleted file mode 100644 index e9395fb4b1cacfbf1ca478bd2ec373d75aff1357..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/ohosTest/ets/test/Continue.test.ets +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, it, beforeAll, afterAll } from '@ohos/hypium'; -import { BusinessError } from '@ohos.base'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON, Component } from '@kit.TestKit'; - -// 正常等待时长 -export const COMMON_DELAY: number = 1000; - -// 等待组件最长时长 -export const WAIT_DELAY: number = 2000; - -const DELEGATOR: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - -const TAG: string = 'ContinueTest'; - -export default function ContinueTest() { - describe('ContinueTest', () => { - let dr: Driver = Driver.create(); - beforeAll(async () => { - try { - await DELEGATOR.startAbility({ - 'bundleName': 'com.sample.continue', - 'abilityName': 'EntryAbility', - }).then(() => { - console.info(`${TAG} com.sample.continue EntryAbility start success`); - }); - } catch (exception) { - console.info(`Failed to startAbility. Code: ${(exception as BusinessError).code}, message: ${(exception as BusinessError).message}`); - }; - }); - - afterAll(async () => { - await dr.delayMs(COMMON_DELAY); - await dr.pressHome(); - await dr.delayMs(COMMON_DELAY); - }); - - /* - * @tc.number: ContinueTest_001 - * @tc.name: 动态配置迁移能力 - * @tc.type: 0 || TestType.FUNCTION || Level.LEVEL0 - * @tc.desc: 动态配置迁移能力测试 - */ - it('ContinueTest_001', 0, ContinueTest_001(dr)); - - /* - * @tc.number: ContinueTest_002 - * @tc.name: 校验基础迁移数据示例页面展示正确 - * @tc.type: 0 || TestType.FUNCTION || Level.LEVEL0 - * @tc.desc: 校验基础迁移数据示例页面展示正确 - */ - it('ContinueTest_002', 0, ContinueTest_002(dr)); - - /* - * @tc.number: ContinueTest_003 - * @tc.name: 校验用分布式数据对象迁移数据页面展示正确 - * @tc.type: 0 || TestType.FUNCTION || Level.LEVEL0 - * @tc.desc: 校验使用分布式数据对象迁移数据页面展示正确 - */ - it('ContinueTest_003', 0, ContinueTest_003(dr)); - }); -} - -function ContinueTest_001(driver: Driver): Function { - return async (done: Function) => { - console.info(`${TAG} ContinueTest_001 start`); - await driver.delayMs(COMMON_DELAY); - try { - let button: Component = await driver.findComponent(ON.text('动态配置迁移能力')); - await button.click(); - await driver.delayMs(COMMON_DELAY); - } catch (err) { - console.error(TAG, `ContinueTest_001 err.code : ${err?.code}, message: ${err?.message}`); - } - done(); - console.info(`${TAG} ContinueTest_001 end`); - }; -} - -function ContinueTest_002(driver: Driver): Function { - return async (done: Function) => { - console.info(`${TAG} ContinueTest_002 start`); - await driver.delayMs(COMMON_DELAY); - try { - let button = await driver.waitForComponent(ON.text('基础迁移数据示例'), WAIT_DELAY); - await button.click(); - console.info(`${TAG} ContinueTest_002 clicked1`); - // 校验NFC页面展示正确 - await driver.delayMs(COMMON_DELAY); - await driver.assertComponentExist(ON.text('默认文本')); - } catch (err) { - console.error(TAG, `ContinueTest_002 err.code : ${err?.code}, message: ${err?.message}`); - } - done(); - console.info(`${TAG} ContinueTest_002 end`); - }; -} - -function ContinueTest_003(driver: Driver): Function { - return async (done: Function) => { - console.info(`${TAG} ContinueTest_003 start`); - await driver.delayMs(COMMON_DELAY); - try { - let button = await driver.waitForComponent(ON.text('使用分布式数据对象迁移数据'), WAIT_DELAY); - await button.click(); - console.info(`${TAG} ContinueTest_003 clicked1`); - // 校验NFC页面展示正确 - await driver.delayMs(COMMON_DELAY); - await driver.assertComponentExist(ON.text('验证分布式对象基础数据迁移')); - } catch (err) { - console.error(TAG, `ContinueTest_003 err.code : ${err?.code}, message: ${err?.message}`); - } - done(); - console.info(`${TAG} ContinueTest_003 end`); - }; -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/ohosTest/ets/test/List.test.ets b/DistributedAppDev/ContinueSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 242e76351dc4a36e5cd8fb595ef495888225509e..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; -import ContinueTest from './Continue.test'; - -export default function testsuite() { - abilityTest(); - ContinueTest(); -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/ohosTest/module.json5 b/DistributedAppDev/ContinueSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 1cafc28b86d7d9f2b34f24d26a75c0dbd7299715..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/DistributedAppDev/ContinueSample/entry/src/test/List.test.ets b/DistributedAppDev/ContinueSample/entry/src/test/List.test.ets deleted file mode 100644 index a60c87c5cbb0badf7c3fd8975034590e6fafa992..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/entry/src/test/LocalUnit.test.ets b/DistributedAppDev/ContinueSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 841bfd77e56060e50ec0924302a5ae624e76e3aa..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/hvigor/hvigor-config.json5 b/DistributedAppDev/ContinueSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 1e473e424320d4e68b16737b289f5c851bb19d36..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,22 +0,0 @@ -{ - "modelVersion": "5.0.1", - "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/DistributedAppDev/ContinueSample/hvigorfile.ts b/DistributedAppDev/ContinueSample/hvigorfile.ts deleted file mode 100644 index f3cb9f1a87a81687554a76283af8df27d8bda775..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/DistributedAppDev/ContinueSample/oh-package-lock.json5 b/DistributedAppDev/ContinueSample/oh-package-lock.json5 deleted file mode 100644 index 26d726f5447b0cb02c0dab10cd704da925c80427..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/oh-package-lock.json5 +++ /dev/null @@ -1,27 +0,0 @@ -{ - "meta": { - "stableOrder": true - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "@ohos/hamock", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.19": { - "name": "@ohos/hypium", - "version": "1.0.19", - "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.19.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/DistributedAppDev/ContinueSample/oh-package.json5 b/DistributedAppDev/ContinueSample/oh-package.json5 deleted file mode 100644 index 9b142d655b140175b33fe2a0c804ca498119f87f..0000000000000000000000000000000000000000 --- a/DistributedAppDev/ContinueSample/oh-package.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/DistributedAppDev/ContinueSample/screenshots/home.png b/DistributedAppDev/ContinueSample/screenshots/home.png deleted file mode 100644 index fc4339b6bc2431201607cc68bb21073fec40cc01..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/ContinueSample/screenshots/home.png and /dev/null differ diff --git a/DistributedAppDev/DistributedAuthentication/.gitignore b/DistributedAppDev/DistributedAuthentication/.gitignore deleted file mode 100644 index fbabf771011fe78f9919db0b1195ab6cadffc2b0..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/AppScope/app.json5 b/DistributedAppDev/DistributedAuthentication/AppScope/app.json5 deleted file mode 100644 index af5917641e662e7af54f8669a7760dbc4632b01b..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/AppScope/app.json5 +++ /dev/null @@ -1,26 +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. - */ - -{ - "app": { - "bundleName": "com.samples.devicemanager", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "distributedNotificationEnabled": true - } -} diff --git a/DistributedAppDev/DistributedAuthentication/AppScope/resources/base/element/string.json b/DistributedAppDev/DistributedAuthentication/AppScope/resources/base/element/string.json deleted file mode 100644 index 4a7c00154d3ed1cf90e6ebb36458060349028b25..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DeviceManager" - } - ] -} diff --git a/DistributedAppDev/DistributedAuthentication/AppScope/resources/base/media/app_icon.png b/DistributedAppDev/DistributedAuthentication/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/DistributedAuthentication/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git "a/DistributedAppDev/DistributedAuthentication/DMSample\346\265\213\350\257\225\347\224\250\344\276\213\346\212\245\345\221\212.md" "b/DistributedAppDev/DistributedAuthentication/DMSample\346\265\213\350\257\225\347\224\250\344\276\213\346\212\245\345\221\212.md" deleted file mode 100644 index edaf9ebc3c161769de32cc1d43522146170a0d2f..0000000000000000000000000000000000000000 --- "a/DistributedAppDev/DistributedAuthentication/DMSample\346\265\213\350\257\225\347\224\250\344\276\213\346\212\245\345\221\212.md" +++ /dev/null @@ -1,13 +0,0 @@ -| 用例名称 | 预置条件 | 用例测试功能 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| -------- | --------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | -------- | -------- | -| DMSample_test001 | 位于主页 | 界面UI展示 | 打开DMSample | 展示本机设备信息,允许被发现开关打开,支持距离上报开关关闭(默认允许被发现,默认不上报距离) | 是 | Pass | -| DMSample_test002 | 位于主页 | 选择过滤条件 | 1.打开DMSample,点击过滤条件
2.在过滤条件页面选择对应的过滤条件
3.返回首页 | 1.过滤条件页面对应过滤条件选项展示对应的选择条件
2.首页过滤条件后面展示对应选择的过滤条件 | 是 | Pass | -| DMSample_test003 | 位于主页 | 发现设备 | 打开DMSample,点击发现 | 发现另外一台设备,展示在过滤条件下面 | 否 | Pass | -| DMSample_test004 | 位于主页 | 带过滤条件发现设备 | 1.执行DMSample_test002选择过滤条件,不选择默认发现不上线设备
2.点击发现 | 发现对应过滤条件的设备,展示在过滤条件下面 | 否 | Pass | -| DMSample_test005 | 位于主页 | 认证设备,PIN码认证 | 1.执行DMSample_test002或DMSample_test003,发现设备
2.点击发现的设备 | 被控端出现“是否允许对端链接本机”授权提示框 | 否 | Pass | -| DMSample_test006 | 位于主页 | 认证设备,PIN码认证,被控端选择取消授权 | 1.执行DMSample_test002或DMSample_test003,发现设备
2.点击发现的设备
3.点击被控端授权提示框中的取消按钮 | 被控端授权弹窗消失 | 否 | Pass | -| DMSample_test007 | 位于主页 | 认证设备,PIN码认证,被控端选择同意授权 | 1.执行DMSample_test002或DMSample_test003,发现设备
2.点击发现的设备
3.点击被控端授权提示框中的同意按钮 | 1.被控端授权弹窗消失
2.被控端出现PIN码展示框,显示6位数字
3.主控端出现PIN码输入框,用户输入被控端展示的PIN码
4.Sample主界面出现已连接设备卡片,并且展示认证的设备信息 | 否 | Pass | -| DMSample_test008 | 位于主页 | 取消认证 | 1.执行DMSample_test007,认证设备
2.点击已认证 | 1.弹出是否删除设备弹窗,点击取消弹窗消失不删除设备,点击删除弹窗消失,删除选择的设备
2.Sample主界面删除已连接设备卡片 | 否 | Pass | -| DMSample_test009 | 位于主页 | 不允许被发现 | A设备关闭允许被发现开关
B设备打开DMSample,点击发现| B设备发现不了设备A | 否 | Pass | -| DMSample_test010 | 位于主页 | 获取可信设备列表 | 1.执行DMSample_test007认证设备
2.点击已连接设备后面的刷新 | 1.出现刷新动效
2.刷新已连接设备列表 | 否 | Pass | - diff --git a/DistributedAppDev/DistributedAuthentication/README.md b/DistributedAppDev/DistributedAuthentication/README.md deleted file mode 100644 index bd515db121b45003f4725c03a2c07ac7c1633928..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# DeviceManager - - - -### Introduction - -This sample shows the use of the **DeviceManager** API in eTS, including obtaining the trusted device list, scanning for devices, authenticating devices, and subscribing to device status changes. - -### Usage - -1. The sample app automatically obtains the trusted devices and displays them in the **online** state on the device list. It also scans for devices and displays the discovered devices in the **discover** state on the device list. - -2. Touch a device in the **discover** state to trigger authentication. After the authentication is complete, the page is automatically refreshed. - -3. Subscribe to device status changes. When the device status changes, the page is automatically refreshed. - -### Constraints - -1. This sample requires a networking test. - -2. This sample can only be run on standard-system devices. diff --git a/DistributedAppDev/DistributedAuthentication/README_zh.md b/DistributedAppDev/DistributedAuthentication/README_zh.md deleted file mode 100644 index 17f11356c014820fc288c76affb6728a2f41a788..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/README_zh.md +++ /dev/null @@ -1,81 +0,0 @@ -# 设备管理 - -### 介绍 - -本示例主要展示了设备管理相关的功能,使用[@ohos.distributedDeviceManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-distributedservice-kit/js-apis-distributedDeviceManager.md) -等接口,实现了包括获取本机设备信息,获取授信设备列表,根据过滤条件扫描设备,设备认证,设备状态订阅等功能。 - -### 效果预览 - -|主页| 选择过滤条件 | 发现与可信设备列表 |取消认证| -|--------------------------------|-------------------------------------------------------|-----------------------------------------------|--------------------------------| -![main](screenshots/device/main.jpeg)| ![filteroption](screenshots/device/filteroption.jpeg) | ![discover](screenshots/device/discover.jpeg) |![delete](screenshots/device/delete.jpeg) - -使用说明 -1. 进入应用会自动获取本机设备信息,并且注册设备状态监听,在有设备上下线的时候,刷新可信设备列表; -2. 在主界面,可以点击刷新,刷新可信设备列表,点击已认证,解除认证关系(只能解除本应用组网设备); -3. 在主界面,可以点击过滤条件,选择对应的过滤条件,在发现设备时进行过滤; -4. 在主界面,可以点击发现,发现周边的设备,并点击发现的设备,进行PIN码认证。 - -### 工程目录 - -``` -entry/src/main/ets/ -|---common -| |---Constant.ets // 常量 -| |---Logger.ets // 日志工具 -|---entryability -|---model -| |---RemoteDeviceModel.ets // 主要封装了DeviceManager库相关的接口,实现相关的功能 -|---pages -| |---index.ets // 首页 -| |---FilterOption.ets // 过滤条件页面 -| |---ListDeviceView.ets // 列表设备组件 -``` - -### 具体实现 - -获取本机设备信息,获取授信设备列表,根据过滤条件扫描设备,设备认证,设备状态订阅,控制设备是否允许被发现等功能,接口封装在RemoteDeviceModel,源码参考:[RemoteDeviceModel.ts](entry/src/main/ets/model/RemoteDeviceModel.ets) - - * 使用RemoteDeviceModel.createDeviceManager()来获取DeviceManager对象; - * 获取本机设备信息:调用RemoteDeviceModel.getLocalDeviceInfo()来获取本机设备信息; - * 注册设备状态监听:调用RemoteDeviceModel.registerDeviceStateListener(),来注册设备状态监听; - * 获取可信设备列表:调用RemoteDeviceModel.getTrustedDeviceList()来获取可信设备列表; - * 发现和停止发现设备:调用RemoteDeviceModel.startDeviceDiscovery()发现设备,调用RemoteDeviceModel.stopDeviceDiscovery()停止发现设备; - * 认证和取消认证设备:调用RemoteDeviceModel.authenticateDevice()认证,调用RemoteDeviceModel.unAuthenticateDevice()取消认证设备; - -### 相关概念 - -设备管理:用于获取可信设备和本地设备的相关信息。在调用DeviceManager的方法前,需要先通过createDeviceManager构建一个DeviceManager实例。 - -### 相关权限 - -允许不同设备间的数据交换:ohos.permission.DISTRIBUTED_DATASYNC。 - -### 约束与限制 - -1.本示例需要组网测试。 - -2.本示例仅支持标准系统上运行,支持设备:RK3568。 - -3.本示例为Stage模型,支持API12版本SDK,SDK版本号(API Version 12 Release),镜像版本号(5.0 Release)。 - -4.本示例需要使用DevEco Studio 版本号(4.0 Release)及以上版本才可编译运行。 - -5.本示例需要使用@ohos.distributedDeviceManager系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/faqs/full-sdk-switch-guide.md) -。 - -6.本示例涉及系统接口,需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/hapsigntool-overview.md) -,把配置文件中的“app-feature”字段信息改为“hos_system_app”。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/SystemFeature/DistributedAppDev/DistributedAuthentication > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/DistributedAppDev/DistributedAuthentication/build-profile.json5 b/DistributedAppDev/DistributedAuthentication/build-profile.json5 deleted file mode 100644 index 7a15325e28f2999bcba0fb51e5cf6bcbe1037a04..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2024-2025 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", - "compileSdkVersion": 12, - "compatibleSdkVersion": 12, - "runtimeOS": "OpenHarmony" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/.gitignore b/DistributedAppDev/DistributedAuthentication/entry/.gitignore deleted file mode 100644 index 5a6ba80fa3d9498a23ae8ae7d9518f8743fa8a96..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/node_modules -/.preview -/build -/.cxx \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/build-profile.json5 b/DistributedAppDev/DistributedAuthentication/entry/build-profile.json5 deleted file mode 100644 index 648265bbc1c93020ab22014689ba6442b6da30c1..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/build-profile.json5 +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -{ - "apiType": 'stageMode', - "buildOption": { - }, - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/hvigorfile.ts b/DistributedAppDev/DistributedAuthentication/entry/hvigorfile.ts deleted file mode 100644 index 80e4ec5b81689f238c34614b167a0b9e9c83e8d9..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/DistributedAppDev/DistributedAuthentication/entry/oh-package.json5 b/DistributedAppDev/DistributedAuthentication/entry/oh-package.json5 deleted file mode 100644 index e234165e561ea940298e7e589c00c188ae9022d8..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - - -{ - "license": "ISC", - "devDependencies": {}, - "name": "entry", - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": {} -} diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/common/Constant.ets b/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/common/Constant.ets deleted file mode 100644 index 865bf113c78818a8260bcaaf2da9d0e9ca76fae2..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/common/Constant.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2023-2025 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. - */ - -let context = getContext(); - -interface DistributedFilterOptionListType { - isOnlineItemList: string[], - isTrustedItemList: string[], - authFormItemList: string[], - rangeItemList: string[] -} - -export const DISTRIBUTED_FILTER_OPTION_LIST: DistributedFilterOptionListType = { - isOnlineItemList: [ - context.resourceManager.getStringSync($r('app.string.no_filter')), - context.resourceManager.getStringSync($r('app.string.online')), - context.resourceManager.getStringSync($r('app.string.offline')), - ], - isTrustedItemList: [ - context.resourceManager.getStringSync($r('app.string.no_filter')), - context.resourceManager.getStringSync($r('app.string.credible')), - context.resourceManager.getStringSync($r('app.string.incredible')), - ], - authFormItemList: [ - context.resourceManager.getStringSync($r('app.string.no_filter')), - context.resourceManager.getStringSync($r('app.string.identical_account')), - context.resourceManager.getStringSync($r('app.string.across_account')), - context.resourceManager.getStringSync($r('app.string.no_account')), - ], - rangeItemList: [ - context.resourceManager.getStringSync($r('app.string.no_filter')), - '50', - '80', - '100' - ] -}; \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/common/GlobalThis.ets b/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/common/GlobalThis.ets deleted file mode 100644 index eaaabe0aecb9b57b0709282dcf4b74f4716b5ca6..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/common/GlobalThis.ets +++ /dev/null @@ -1,48 +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. - */ - -export class GlobalContext { - private constructor() { - } - - private static instance: GlobalContext; - private _objects = new Map(); - - public static getContext(): GlobalContext { - if (!GlobalContext.instance) { - GlobalContext.instance = new GlobalContext(); - } - return GlobalContext.instance; - } - - getObject(value: string): Object | undefined { - return this._objects.get(value); - } - - setObject(key: string, objectClass: Object): void { - this._objects.set(key, objectClass); - } -} - -export function getGlobalObject(key: string): Object { - if (GlobalContext.getContext().getObject(key) === undefined) { - return ''; - } - return GlobalContext.getContext().getObject(key)!; -} - -export function setGlobalObject(key: string, value: Object): void { - GlobalContext.getContext().setObject(key, value); -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/common/Logger.ets b/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/common/Logger.ets deleted file mode 100644 index 19d3fbb947579db1989e458f4dd12dfd3a324c3e..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/common/Logger.ets +++ /dev/null @@ -1,43 +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. - */ - -import hilog from '@ohos.hilog'; - -class Logger { - private domain: number = 0xFF00; - private prefix: string = '[Sample_DeviceManager]'; - private format: string = '%{public}s, %{public}s'; - - constructor() { - } - - debug(...args: string[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger(); \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/entryability/EntryAbility.ets b/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 37a8717b30e41e06cee49d03b44d8949f49469c2..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2023-2025 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 '@ohos.hilog'; -import Ability from '@ohos.app.ability.UIAbility'; -import Window from '@ohos.window'; -import remoteDeviceModel from '../model/RemoteDeviceModel'; -import Want from '@ohos.app.ability.Want'; -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; - -export default class EntryAbility extends Ability { - async onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - } - - onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - remoteDeviceModel.unregisterDeviceListCallback(); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: Window.WindowStage) { - // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground() { - // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/model/RemoteDeviceModel.ets b/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/model/RemoteDeviceModel.ets deleted file mode 100644 index ae9a7c54b6f563e3c774b16546b034812f86b255..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/model/RemoteDeviceModel.ets +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright (c) 2022-2025 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 { distributedDeviceManager } from '@kit.DistributedServiceKit'; -import promptAction from '@ohos.promptAction'; -import logger from '../common/Logger'; - -interface dataType { - action?: distributedDeviceManager.DeviceStateChange; - device: distributedDeviceManager.DeviceBasicInfo; - subscribeId?: number; -} - -class RemoteDeviceModel { - private static dmInstance: RemoteDeviceModel = new RemoteDeviceModel(); - trustedDeviceList: Array = []; - discoverList: Array = []; - localDevice: distributedDeviceManager.DeviceBasicInfo | undefined = undefined; - deviceManager: distributedDeviceManager.DeviceManager | undefined = undefined; - isSupportRange: boolean = false; - - static getInstance(): RemoteDeviceModel { - if (RemoteDeviceModel.dmInstance === undefined) { - RemoteDeviceModel.dmInstance = new RemoteDeviceModel(); - } - return RemoteDeviceModel.dmInstance!; - } - - constructor() { - } - - // [Start create_device_manager] - async createDeviceManager(): Promise { - if (typeof (this.deviceManager) != 'undefined') { - return; - } - - logger.info('[DeviceManager.RemoteDeviceModel] deviceManager.createDeviceManager begin'); - try { - let dmInstance = distributedDeviceManager.createDeviceManager('com.samples.devicemanager'); - this.deviceManager = dmInstance - // [StartExclude create_device_manager] - this.getLocalDeviceInfo(); - this.registerDeviceStateListener(); - this.getTrustedDeviceList(); - // [EndExclude create_device_manager] - logger.info(`[DeviceManager.RemoteDeviceModel] createDeviceManager callback returned, - value= ${JSON.stringify(this.deviceManager)}`); - } catch (error) { - logger.error(`[DeviceManager.RemoteDeviceModel] createDeviceManager throw error, - error=${error} message=${error.message}`); - } - logger.info('[DeviceManager.RemoteDeviceModel] distributedDeviceManager.createDeviceManager end'); - } - // [End create_device_manager] - - getLocalDeviceInfo(): void { - if (typeof (this.deviceManager) == 'undefined') { - logger.error('[DeviceManager.RemoteDeviceModel] deviceManager has not initialized'); - return; - } - - logger.info('[DeviceManager.RemoteDeviceModel] getLocalDeviceInfo begin'); - let deviceId: string = this.deviceManager.getLocalDeviceId(); - let deviceName: string = this.deviceManager.getLocalDeviceName(); - let deviceType: number = this.deviceManager.getLocalDeviceType(); - let networkId: string = this.deviceManager.getLocalDeviceNetworkId(); - logger.info('[DeviceManager.RemoteDeviceModel] getLocalDeviceInfo deviceType: ' + deviceType); - this.localDevice = { - deviceId, - deviceName, - deviceType: deviceType.toString(), - networkId - }; - AppStorage.setOrCreate('localDevice', this.localDevice); - logger.info('[DeviceManager.RemoteDeviceModel] getLocalDeviceInfo end localDevice = ' + - JSON.stringify(this.localDevice)); - } - - // [Start get_available_device_list] - getTrustedDeviceList(): void { - if (typeof (this.deviceManager) == 'undefined') { - logger.error('[DeviceManager.RemoteDeviceModel] deviceManager has not initialized'); - promptAction.showToast({ - message: 'deviceManager has not initialized' - }); - return; - } - - logger.info('[DeviceManager.RemoteDeviceModel] getTrustedDeviceList begin'); - try { - this.trustedDeviceList = this.deviceManager.getAvailableDeviceListSync(); - // [StartExclude get_available_device_list] - AppStorage.setOrCreate('trustedDeviceList', this.trustedDeviceList); - // [EndExclude get_available_device_list] - } catch (error) { - logger.error('[DeviceManager.RemoteDeviceModel] getTrustedDeviceList error: ${error}' + error.toString()); - promptAction.showToast({ - message: 'getTrustedDeviceList failed' - }); - } - } - // [End get_available_device_list] - - deviceStateChangeActionOnline(device: distributedDeviceManager.DeviceBasicInfo): void { - this.trustedDeviceList[this.trustedDeviceList.length] = device; - logger.info('[DeviceManager.RemoteDeviceModel] online, device list = ' + JSON.stringify(this.trustedDeviceList)); - for (let i = this.discoverList.length - 1; i >= 0; i--) { - if (this.discoverList[i].deviceId == device.deviceId) { - this.discoverList.splice(i, 1); - break; - } - } - for (let j = 0; j < this.trustedDeviceList.length; j++) { - if (this.trustedDeviceList[j].deviceId === device.deviceId) { - this.trustedDeviceList[j] = device; - break; - } - } - AppStorage.setOrCreate('discoverDeviceList', this.discoverList); - AppStorage.setOrCreate('trustedDeviceList', this.trustedDeviceList); - } - - deviceStateChangeActionOffline(device: distributedDeviceManager.DeviceBasicInfo): void { - logger.info('[DeviceManager.RemoteDeviceModel] offline, this.trustedDeviceList.length=' + - this.trustedDeviceList.length); - let list: Array = []; - for (let i = 0; i < this.trustedDeviceList.length; i++) { - if (this.trustedDeviceList[i].deviceId !== device.deviceId) { - list.push(this.trustedDeviceList[i]); - } - } - this.trustedDeviceList = list; - AppStorage.setOrCreate('trustedDeviceList', this.trustedDeviceList); - logger.info('[DeviceManager.RemoteDeviceModel] offline, device list=' + JSON.stringify(this.trustedDeviceList)); - } - - // [Start device_state_change] - registerDeviceStateListener(): void { - logger.info('[DeviceManager.RemoteDeviceModel] registerDeviceStateListener'); - if (typeof (this.deviceManager) == 'undefined') { - logger.error('[DeviceManager.RemoteDeviceModel] deviceManager has not initialized'); - promptAction.showToast({ - message: 'deviceManager has not initialized' - }); - return; - } - - // [StartExclude device_state_change] - let self = this; - // [EndExclude device_state_change] - this.deviceManager.on('deviceStateChange', (data: dataType) => { - if (data == null) { - return; - } - logger.info('[DeviceManager.RemoteDeviceModel] deviceStateChange data=' + JSON.stringify(data)); - switch (data.action) { - case distributedDeviceManager.DeviceStateChange.AVAILABLE: - logger.info('[DeviceManager.RemoteDeviceModel] deviceStateChange ONLINE'); - // [StartExclude device_state_change] - self.deviceStateChangeActionOnline(data.device!); - // [EndExclude device_state_change] - break; - case distributedDeviceManager.DeviceStateChange.UNAVAILABLE: - logger.info('[DeviceManager.RemoteDeviceModel] deviceStateChange OFFLINE'); - // [StartExclude device_state_change] - self.deviceStateChangeActionOffline(data.device!); - // [EndExclude device_state_change] - break; - default: - break; - } - }) - } - // [End device_state_change] - - deviceFound(data: dataType): void { - for (let i = 0; i < this.discoverList.length; i++) { - if (this.discoverList[i].deviceId == data.device!.deviceId) { - logger.info('[DeviceManager.RemoteDeviceModel] device founded ignored'); - return; - } - } - this.discoverList[this.discoverList.length] = data.device!; - AppStorage.setOrCreate('discoverDeviceList', this.discoverList); - logger.info('[DeviceManager.RemoteDeviceModel] deviceFound self.discoverList=' + this.discoverList); - } - - private getFilterOptions(): Record { - let filterOptions: Record = {}; - let filterOptionsMap = AppStorage.get('filterOptions') as Map; - let authFormName = AppStorage.get("authFormName") as string; - let isOnlineName = AppStorage.get("isOnlineName") as string; - let isTrustedName = AppStorage.get("isTrustedName") as string; - let rangeName = AppStorage.get("rangeName") as string; - let authForm = filterOptionsMap.get(authFormName); - let isOnline = filterOptionsMap.get(isOnlineName); - let isTrusted = filterOptionsMap.get(isTrustedName); - let range = filterOptionsMap.get(rangeName); - - if(authForm == 1){ - filterOptions['authorizationType'] = 1; - }else if(authForm == 2) { - filterOptions['authorizationType'] = 2; - }else if(authForm == 3) { - filterOptions['authorizationType'] = 0; - } - - if(isOnline == 1){ - filterOptions['availableStatus'] = 1; - }else if(isOnline == 2) { - filterOptions['availableStatus'] = 0; - } - - if(isTrusted == 1){ - filterOptions['authenticationStatus'] = 1; - }else if(isTrusted == 2) { - filterOptions['authenticationStatus'] = 0; - } - - if(range == 1){ - filterOptions['discoverDistance'] = 50; - }else if(range == 2) { - filterOptions['discoverDistance'] = 80; - }else if(range == 3) { - filterOptions['discoverDistance'] = 100; - } - - return filterOptions; - } - - // [Start start_discovering] - startDeviceDiscovery(): void { - if (typeof (this.deviceManager) == 'undefined') { - logger.error('[DeviceManager.RemoteDeviceModel] deviceManager has not initialized'); - promptAction.showToast({ - message: 'deviceManager has not initialized' - }); - return; - } - let self = this; - try { - this.deviceManager.on('discoverSuccess', (data) => { - if (data == null) { - return; - } - logger.info('[DeviceManager.RemoteDeviceModel] deviceFound data=' + JSON.stringify(data)); - self.deviceFound(data); - }) - this.deviceManager.on('discoverFailure', (data) => { - logger.info('[DeviceManager.RemoteDeviceModel] discoverFail data=' + JSON.stringify(data)); - }) - // [StartExclude start_discovering] - this.deviceManager.on('serviceDie', () => { - logger.error('[DeviceManager.RemoteDeviceModel] serviceDie'); - }) - - this.discoverList = []; - AppStorage.setOrCreate('discoverDeviceList', this.discoverList); - // [EndExclude start_discovering] - let discoverParam: Record = { - 'discoverTargetType': 1 - }; - let filterOptions: Record = this.getFilterOptions(); - logger.info('[DeviceManager.RemoteDeviceModel] startDeviceDiscovery filterOptions = ' + JSON.stringify(filterOptions)); - if (Object.entries(filterOptions).length == 0) { - this.deviceManager.startDiscovering(discoverParam); - } else { - this.deviceManager.startDiscovering(discoverParam, filterOptions); - } - } catch (e) { - logger.error('[DeviceManager.RemoteDeviceModel] startDeviceDiscovery failed err: ' + e.toString()); - } - } - // [End start_discovering] - - stopDeviceDiscovery(): void { - if (typeof (this.deviceManager) == 'undefined') { - logger.error('[DeviceManager.RemoteDeviceModel] deviceManager has not initialized'); - promptAction.showToast({ - message: 'deviceManager has not initialized' - }); - return; - } - logger.info('[DeviceManager.RemoteDeviceModel] stopDeviceDiscovery'); - try { - this.deviceManager.stopDiscovering(); - this.deviceManager.off('discoverSuccess'); - this.deviceManager.off('discoverFailure'); - } catch (e) { - logger.error('[DeviceManager.RemoteDeviceModel] stopDeviceDiscovery failed err: ' + e.toString()); - } - } - - unregisterDeviceListCallback(): void { - if (typeof (this.deviceManager) == 'undefined') { - logger.error('[DeviceManager.RemoteDeviceModel] deviceManager has not initialized'); - promptAction.showToast({ - message: 'deviceManager has not initialized' - }); - return; - } - try { - this.stopDeviceDiscovery(); - this.deviceManager.off('deviceStateChange'); - this.deviceManager.off('serviceDie'); - this.trustedDeviceList = []; - this.discoverList = []; - } catch (e) { - logger.error('[DeviceManager.RemoteDeviceModel] stopDeviceDiscovery failed err: ' + e.toString()); - } - } - - // [Start bind_target] - authenticateDevice(device: distributedDeviceManager.DeviceBasicInfo): void { - logger.info('[DeviceManager.RemoteDeviceModel] authenticateDevice ' + JSON.stringify(device)); - if (typeof (this.deviceManager) == 'undefined') { - logger.error('[DeviceManager.RemoteDeviceModel] deviceManager has not initialized'); - promptAction.showToast({ - message: 'deviceManager has not initialized' - }); - return; - } - - for (let i = 0; i < this.discoverList.length; i++) { - if (this.discoverList[i].deviceId != device.deviceId) { - continue; - } - - let bindParam: Record = { - 'bindLevel': 3, - 'bindType': 1, // PIN码认证 - 'targetPkgName': 'ohos.samples.etsdevicemanager', - 'appName': 'DeviceManager', - }; - try { - this.deviceManager.bindTarget(device.deviceId, bindParam, (err: BusinessError, data: Object) => { - if (err) { - logger.error('[DeviceManager.RemoteDeviceModel] authenticateDevice error:' + JSON.stringify(err)); - return; - } - logger.info('[DeviceManager.RemoteDeviceModel] authenticateDevice succeed:' + JSON.stringify(data)); - }) - } catch (e) { - logger.error('[DeviceManager.RemoteDeviceModel] authenticateDevice failed err: ' + e.toString()); - } - } - } - // [End bind_target] - - unAuthenticateDevice(device: distributedDeviceManager.DeviceBasicInfo): void { - logger.info('[DeviceManager.RemoteDeviceModel] unAuthenticateDevice ' + JSON.stringify(device)); - if (typeof (this.deviceManager) == 'undefined') { - logger.error('[DeviceManager.RemoteDeviceModel] deviceManager has not initialized'); - promptAction.showToast({ - message: 'deviceManager has not initialized' - }); - return; - } - - for (let i = 0; i < this.trustedDeviceList.length; i++) { - if (this.trustedDeviceList[i].deviceId != device.deviceId) { - continue; - } - try { - this.deviceManager.unbindTarget(device.deviceId) - } catch (e) { - logger.error('[DeviceManager.RemoteDeviceModel] unAuthenticateDevice failed err: ' + e.toString()); - } - } - } -} - -export default RemoteDeviceModel.getInstance(); \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/pages/FilterOption.ets b/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/pages/FilterOption.ets deleted file mode 100644 index d775bb8d2183a42b8b9ac2aecadcd72b87ac3dd8..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/pages/FilterOption.ets +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright (c) 2023-2025 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 deviceInfo from '@ohos.deviceInfo'; -import logger from '../common/Logger'; -import router from '@ohos.router'; -import { DISTRIBUTED_FILTER_OPTION_LIST } from '../common/Constant'; - -@CustomDialog -struct FilterOptionDialog { - title: string = ''; - filterItems: string[] = []; - controller?: CustomDialogController; - cancel: () => void = () => { - }; - confirm: (selectedIndex: number, title: string) => void = () => { - }; - selectedIndex: number = 0; - filterOptions: Object = new Object(); - - build() { - Column() { - Text(this.title) - .fontSize(20) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - .margin({ bottom: 24 }) - - List() { - ForEach(this.filterItems, (item: string, index: number) => { - ListItem() { - Column() { - Row() { - Text(item) - .fontSize(16) - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - .fontColor('#182431') - Blank() - Radio({ value: item, group: this.title }) - .checked(index == this.selectedIndex ? true : false) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.selectedIndex = index; - } - logger.info(item + ' status is ' + isChecked); - }) - .align(Alignment.End) - } - .margin({ bottom: 6, top: 6 }) - .width('100%') - - Divider() - .color('#182431') - .opacity(0.05) - .visibility(index == this.filterItems.length - 1 ? Visibility.None : Visibility.Visible) - }.width('100%') - .height(48) - } - }, (item: string) => JSON.stringify(item)) - }.width('100%') - .height((this.filterItems.length) * 48) - - Flex({ justifyContent: FlexAlign.SpaceAround }) { - Button($r('app.string.cancel')) - .onClick(() => { - this.controller!.close() - this.cancel() - }) - .backgroundColor(0xffffff) - .fontColor('#007DFF') - .fontWeight(500) - Divider() - .vertical(true) - .height(24) - .color('#182431') - .opacity(0.2) - .alignSelf(ItemAlign.Center) - Button($r('app.string.confirm')) - .onClick(() => { - this.controller!.close() - this.confirm(this.selectedIndex, this.title) - }) - .backgroundColor(0xffffff) - .fontColor('#007DFF') - .fontWeight(500) - } - } - .margin({ bottom: 12, left: 12, right: 12 }) - .borderRadius(24) - .backgroundColor('#FFFFFF') - .alignItems(HorizontalAlign.Start) - .padding(24) - } -} - -@Entry -@Component -export struct FilterOption { - @State deviceType: string = ''; - @State authForm: string = ''; - @State isOnline: string = ''; - @State isTrusted: string = ''; - @State range: string = ''; - dialogController: CustomDialogController | undefined = undefined; - filterOptions: Object = new Object(); - onSelectedIndexChange = async (index: number, title: string) => { - this.onSelected(index, title); - } - - aboutToAppear() { - try { - let filterOptions = AppStorage.get('filterOptions') as Map; - let authFormItemList = DISTRIBUTED_FILTER_OPTION_LIST.authFormItemList; - let authFormName = AppStorage.get("authFormName") as string; - let isOnlineItemList = DISTRIBUTED_FILTER_OPTION_LIST.isOnlineItemList; - let isOnlineName = AppStorage.get("isOnlineName") as string; - let isTrustedItemList = DISTRIBUTED_FILTER_OPTION_LIST.isTrustedItemList; - let isTrustedName = AppStorage.get("isTrustedName") as string; - let rangeItemList = DISTRIBUTED_FILTER_OPTION_LIST.rangeItemList; - let rangeName = AppStorage.get("rangeName") as string; - this.authForm = authFormItemList[filterOptions.get(authFormName)!]; - this.isOnline = isOnlineItemList[filterOptions.get(isOnlineName)!]; - this.isTrusted = isTrustedItemList[filterOptions.get(isTrustedName)!]; - this.range = rangeItemList[filterOptions.get(rangeName)!]; - logger.info(`getStringByNameSync success, ${this.authForm} ${this.isOnline} ${this.isTrusted} ${this.range}`); - } catch (error) { - logger.error(`getStringByNameSync failed, error code: ${error.code}, message: ${error.message}.`); - } - logger.info('aboutToAppear filterOptions = ' + JSON.stringify(AppStorage.get('filterOptions'))); - } - - onCancel() { - logger.info('Callback when the first button is clicked'); - } - - onSelected(index: number, title: string) { - logger.info('filterOptions = ' + JSON.stringify(AppStorage.get('filterOptions')) + ' index = ' + index + - ' title = ' + title); - let filterOptions = AppStorage.get('filterOptions') as Map; - filterOptions.set(title, index) - AppStorage.setOrCreate('filterOptions', filterOptions) - filterOptions = AppStorage.get('filterOptions') as Map; - let authFormItemList = DISTRIBUTED_FILTER_OPTION_LIST.authFormItemList; - let authFormName = AppStorage.get("authFormName") as string; - let isOnlineItemList = DISTRIBUTED_FILTER_OPTION_LIST.isOnlineItemList; - let isOnlineName = AppStorage.get("isOnlineName") as string; - let isTrustedItemList = DISTRIBUTED_FILTER_OPTION_LIST.isTrustedItemList; - let isTrustedName = AppStorage.get("isTrustedName") as string; - let rangeItemList = DISTRIBUTED_FILTER_OPTION_LIST.rangeItemList; - let rangeName = AppStorage.get("rangeName") as string; - this.authForm = authFormItemList[filterOptions.get(authFormName)!] - this.isOnline = isOnlineItemList[filterOptions.get(isOnlineName)!] - this.isTrusted = isTrustedItemList[filterOptions.get(isTrustedName)!] - this.range = rangeItemList[filterOptions.get(rangeName)!] - } - - existApp() { - logger.info('Click the callback in the blank area'); - } - - openDialog(itemList: string[], titleResource: Resource) { - let title = ''; - try { - title = getContext(this).resourceManager.getStringSync(titleResource.id); - } catch (error) { - logger.error(`getStringByNameSync failed, error code: ${error.code}, message: ${error.message}.`); - } - - this.dialogController = new CustomDialogController({ - builder: FilterOptionDialog({ - title: title, - filterItems: itemList, - cancel: this.onCancel, - confirm: this.onSelectedIndexChange, - selectedIndex: (AppStorage.get('filterOptions') as Map).get(title) - }), - cancel: this.existApp, - autoCancel: true, - alignment: deviceInfo.deviceType == 'tablet' ? DialogAlignment.Center : DialogAlignment.Bottom, - gridCount: 4, - customStyle: deviceInfo.deviceType == 'tablet' ? false : true - }); - this.dialogController.open(); - } - - build() { - Column() { - Row() { - Image($r('app.media.ic_back')) - .height(24) - .width(24) - .margin({ right: 16 }) - .onClick(() => { - router.back(); - }) - .visibility(deviceInfo.deviceType == 'tablet' ? Visibility.None : Visibility.Visible) - - Text($r('app.string.filter_options')) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - .fontSize(20) - .lineHeight(26) - } - .width('100%') - .margin({ top: 12, bottom: 24 }) - .padding({ left: 12 }) - - Column() { - Row() { - Text($r('app.string.is_online')) - .fontColor('#182431') - .fontSize(16) - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - Blank() - Text(this.isOnline) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi') - .fontSize(14) - .opacity(0.6) - Image($r('app.media.ic_arrow')) - .width(12) - .height(24) - .margin({ left: 4 }) - } - .width('100%') - .height(48) - .onClick(() => { - this.openDialog(DISTRIBUTED_FILTER_OPTION_LIST.isOnlineItemList, $r('app.string.is_online')); - }) - - Divider() - .color('#182431') - .opacity(0.05) - - Row() { - Text($r('app.string.is_trusted')) - .fontColor('#182431') - .fontSize(16) - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - Blank() - Text(this.isTrusted) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi') - .fontSize(14) - .opacity(0.6) - Image($r('app.media.ic_arrow')) - .width(12) - .height(24) - .margin({ left: 4 }) - } - .width('100%') - .height(48) - .onClick(() => { - this.openDialog(DISTRIBUTED_FILTER_OPTION_LIST.isTrustedItemList, $r('app.string.is_trusted')); - }) - - Divider() - .color('#182431') - .opacity(0.05) - - Row() { - Text($r('app.string.auth_form')) - .fontColor('#182431') - .fontSize(16) - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - Blank() - Text(this.authForm) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi') - .fontSize(14) - .opacity(0.6) - Image($r('app.media.ic_arrow')) - .width(12) - .height(24) - .margin({ left: 4 }) - } - .width('100%') - .height(48) - .onClick(() => { - this.openDialog(DISTRIBUTED_FILTER_OPTION_LIST.authFormItemList, $r('app.string.auth_form')); - }) - - Divider() - .color('#182431') - .opacity(0.05) - - Row() { - Text($r('app.string.range')) - .fontColor('#182431') - .fontSize(16) - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - Blank() - Text(this.range) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi') - .fontSize(14) - .opacity(0.6) - Image($r('app.media.ic_arrow')) - .width(12) - .height(24) - .margin({ left: 4 }) - } - .width('100%') - .height(48) - .onClick(() => { - this.openDialog(DISTRIBUTED_FILTER_OPTION_LIST.rangeItemList, $r('app.string.range')); - }) - .margin({ bottom: 4 }) - }.width('100%') - .borderRadius(24) - .padding({ left: 12, right: 12 }) - .backgroundColor('#FFFFFF') - }.backgroundColor('#F1F3F5') - .padding(12) - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/pages/Index.ets b/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 297a15829d8ee59769b6e7b59f81832953880272..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (c) 2022-2025 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 deviceInfo from '@ohos.deviceInfo'; -import { distributedDeviceManager } from '@kit.DistributedServiceKit'; -import logger from '../common/Logger'; -import remoteDeviceModel from '../model/RemoteDeviceModel'; -import router from '@ohos.router'; -import { FilterOption } from '../pages/FilterOption'; -import { ListDeviceView } from '../pages/ListDeviceView'; -import { abilityAccessCtrl } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -class optionsType { - url: string = 'pages/FilterOption' -} - -@Entry -@Component -struct Index { - @State isShowLoading: boolean = false; - @State indexWidth: string = '100%'; - @StorageLink('localDevice') localDevice: distributedDeviceManager.DeviceBasicInfo | undefined = undefined; - @StorageLink('trustedDeviceList') trustedDeviceList: Array = - new Array(); - @StorageLink('discoverDeviceList') discoverDeviceList: Array = - new Array(); - @State isSupportRange: boolean = false; - @State isAllowDiscovered: boolean = true; - @State isLocalDeviceActive: boolean = false; - @State filterOption: string = ''; - @State isDiscovering: boolean = false; - scroller: Scroller = new Scroller(); - - async routeFilterOptionPage() { - let options = new optionsType(); - try { - await router.pushUrl(options); - } catch (err) { - logger.info(`fail callback, code: ${err.code}, msg: ${err.msg}`); - } - } - - getDeviceTypeIcon(deviceType: number): Resource { - logger.info(`getDeviceTypeIcon deviceType: ${deviceType}`) - if (deviceType == 0x11) { - return $r('app.media.ic_pad'); - } else if (deviceType == 0x0E) { - return $r('app.media.ic_phone'); - } else if (deviceType == 0) { - return $r('app.media.ic_pc'); - } else { - return $r('app.media.ic_pc'); - } - } - - async aboutToAppear() { - // [Start permissions_user_grant] - let atManager = abilityAccessCtrl.createAtManager(); - atManager.requestPermissionsFromUser(getContext(this), ['ohos.permission.DISTRIBUTED_DATASYNC']) - .then(async (data) => { - logger.info(`data: ${JSON.stringify(data)}`); - // [StartExclude permissions_user_grant] - await remoteDeviceModel.createDeviceManager(); - try { - logger.info(`local deviceType:` + deviceInfo.deviceType); - let authFormName: string = getContext(this).resourceManager.getStringSync($r('app.string.auth_form').id); - let isOnlineName: string = getContext(this).resourceManager.getStringSync($r('app.string.is_online').id); - let isTrustedName: string = getContext(this).resourceManager.getStringSync($r('app.string.is_trusted').id); - let rangeName: string = getContext(this).resourceManager.getStringSync($r('app.string.range').id); - - AppStorage.setOrCreate('authFormName', authFormName); - AppStorage.setOrCreate('isOnlineName', isOnlineName); - AppStorage.setOrCreate('isTrustedName', isTrustedName); - AppStorage.setOrCreate('rangeName', rangeName); - - let filterOptions = new Map(); - filterOptions.set(authFormName, 0); - filterOptions.set(isOnlineName, 0); - filterOptions.set(isTrustedName, 0); - filterOptions.set(rangeName, 0); - AppStorage.setOrCreate('filterOptions', filterOptions); - logger.info(`local filterOptions:` + JSON.stringify(filterOptions)); - } catch (error) { - logger.error(`getStringByNameSync failed, error code: ${error.code}, message: ${error.message}.`); - } - // [EndExclude permissions_user_grant] - }) - .catch((err: BusinessError) => { - logger.error(`requestPermissionsFromUser error: ${JSON.stringify(err)}`); - }); - // [End permissions_user_grant] - } - - build() { - Row() { - Scroll(this.scroller) { - Column() { - Column() { - Text($r("app.string.app_name")) - .fontColor('#182431') - .fontSize(24) - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - .width('100%') - .margin({ top: 12, bottom: 20 }) - }.width('100%') - .margin({ left: 24 }) - - Column() { - Row() { - Image(this.getDeviceTypeIcon(Number(this.localDevice?.deviceType))) - .width(24) - .height(24) - Text(this.localDevice?.deviceName) - .fontSize(16) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - .margin({ left: 8 }) - } - .width('100%') - .height(48) - - .height(48) - }.borderRadius(24) - .backgroundColor('#FFFFFF') - .padding({ left: 12, right: 12, top: 4, bottom: 4 }) - .width('100%') - - Column() { - Row() { - Text($r('app.string.trusted_devices')) - .fontSize(14) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi-Medium') - .lineHeight(19) - .margin({ left: 12, top: 19, bottom: 10 }) - .opacity(0.6) - - Blank() - - Text($r('app.string.refresh')) - .fontSize(14) - .fontColor('#007DFF') - .fontFamily('HarmonyHeiTi-Medium') - .lineHeight(19) - .margin({ left: 12, top: 19, bottom: 10, right: 12 }) - .onClick(() => { - remoteDeviceModel.getTrustedDeviceList(); - this.isShowLoading = true; - let gThis = this; - setTimeout(() => { - gThis.isShowLoading = false; - }, 3000); - }) - .visibility(this.isShowLoading ? Visibility.None : Visibility.Visible) - LoadingProgress() - .color('#007DFF') - .width(24) - .height(24) - .margin({ left: 12, top: 19, bottom: 10, right: 12 }) - .visibility(this.isShowLoading ? Visibility.Visible : Visibility.None) - }.width('100%') - - List() { - ForEach(this.trustedDeviceList, (item: distributedDeviceManager.DeviceBasicInfo, index: number) => { - ListItem() { - Column() { - ListDeviceView({ deviceInfo: item, visible: Visibility.Visible }) - Divider() - .color('#182431') - .opacity(0.05) - .visibility(index == this.trustedDeviceList.length - 1 ? Visibility.None : Visibility.Visible) - } - } - }, (item: distributedDeviceManager.DeviceBasicInfo) => JSON.stringify(item)) - } - .width('100%') - .borderRadius(24) - .padding({ left: 12, right: 12, top: 4, bottom: 4 }) - .backgroundColor('#FFFFFF') - .visibility(this.trustedDeviceList.length == 0 ? Visibility.None : Visibility.Visible) - } - - Column() { - Row() { - Text($r('app.string.usable_devices')) - .fontSize(14) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi-Medium') - .lineHeight(19) - .opacity(0.6) - .margin({ left: 12, top: 19, bottom: 10 }) - - Blank() - - Text(this.isDiscovering == false ? $r('app.string.discover') : $r('app.string.stop')) - .fontSize(14) - .fontColor(this.isDiscovering == false ? '#007DFF' : '#FA2A2D') - .lineHeight(19) - .margin({ left: 12, top: 19, bottom: 10, right: 12 }) - .onClick(() => { - if (this.isDiscovering) { - remoteDeviceModel.stopDeviceDiscovery(); - } else { - remoteDeviceModel.startDeviceDiscovery(); - } - this.isDiscovering = !this.isDiscovering; - }) - }.width('100%') - }.width('100%') - - Column() { - Column() { - Row() { - Text($r('app.string.filter_options')) - .fontSize(16) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - Blank() - Row() { - Text(this.filterOption) - .fontSize(14) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi') - .opacity(0.6) - .margin({ left: 12 }) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - .maxLines(1) - .fontWeight(400) - Image($r('app.media.ic_arrow')) - .width(12) - .height(24) - .margin({ left: 8 }) - } - }.onClick(() => { - if (deviceInfo.deviceType == 'tablet') { - this.indexWidth = '50%'; - } else { - this.routeFilterOptionPage(); - } - }) - .width('100%') - .margin({ top: 12, bottom: 12 }) - - Divider() - .color('#182431') - .opacity(0.05) - .visibility(this.discoverDeviceList.length == 0 ? Visibility.None : Visibility.Visible) - }.height(48) - .alignItems(HorizontalAlign.Center) - - List() { - ForEach(this.discoverDeviceList, (item: distributedDeviceManager.DeviceBasicInfo, index: number) => { - ListItem() { - Column() { - ListDeviceView({ deviceInfo: item }) - Divider() - .color('#182431') - .opacity(0.05) - .visibility(index == this.discoverDeviceList.length - 1 ? Visibility.None : Visibility.Visible) - } - } - .onClick(() => { - remoteDeviceModel.authenticateDevice(item); - }) - }, (item: distributedDeviceManager.DeviceBasicInfo) => JSON.stringify(item)) - } - .visibility(this.discoverDeviceList.length == 0 ? Visibility.None : Visibility.Visible) - .width('100%') - }.width('100%') - .borderRadius(24) - .padding({ left: 12, right: 12, bottom: 4, top: 4 }) - .backgroundColor('#FFFFFF') - } - .padding(12) - .width(this.indexWidth) - } - .scrollBar(BarState.Off) - .scrollable(ScrollDirection.Vertical) - .height('100%') - .backgroundColor('#F1F3F5') - .align(Alignment.Top) - - Column() { - FilterOption() - }.visibility(this.indexWidth == '50%' ? Visibility.Visible : Visibility.None) - .width('50%') - .height('100%') - } - } -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/pages/ListDeviceView.ets b/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/pages/ListDeviceView.ets deleted file mode 100644 index 63ef3199130acc982ae95954c8b1380793d0de80..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/ets/pages/ListDeviceView.ets +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2023-2025 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 deviceInfo from '@ohos.deviceInfo'; -import deviceManager from '@ohos.distributedDeviceManager'; -import logger from '../common/Logger'; -import remoteDeviceModel from '../model/RemoteDeviceModel'; - -@CustomDialog -struct DeleteDeviceDialog { - @Prop deviceName: string = ''; - @Link deviceInfo: deviceManager.DeviceBasicInfo; - controller?: CustomDialogController; - cancel: () => void = () => { - }; - confirm: () => void = () => { - }; - private isDelete: string = ''; - - aboutToAppear() { - this.isDelete = getContext(this).resourceManager.getStringSync($r('app.string.isDelete').id); - } - - build() { - Column() { - Text(this.isDelete + this.deviceName) - .fontSize(20) - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - .lineHeight(26) - .margin({ bottom: 26 }) - .fontSize(20) - .fontColor('#182431') - - Flex({ justifyContent: FlexAlign.SpaceAround }) { - Button($r('app.string.cancel')) - .fontSize(16) - .onClick(() => { - this.controller!.close(); - this.cancel(); - }) - .backgroundColor(0xffffff) - .fontColor('#007DFF') - .fontWeight(500) - Divider() - .vertical(true) - .height(24) - .color('#182431') - .opacity(0.2) - .alignSelf(ItemAlign.Center) - Button($r('app.string.delete')) - .fontSize(16) - .onClick(() => { - this.controller!.close(); - this.confirm(); - }) - .backgroundColor(0xffffff) - .fontColor('#FA2A2D') - .fontWeight(500) - } - } - .margin({ bottom: 12, left: 12, right: 12 }) - .borderRadius(24) - .backgroundColor('#FFFFFF') - .alignItems(HorizontalAlign.Center) - .padding(24) - } -} - -@Component -export struct ListDeviceView { - @State deviceInfo: deviceManager.DeviceBasicInfo | undefined = undefined; - @State visible: Visibility = Visibility.None; - dialogController: CustomDialogController = new CustomDialogController({ - builder: DeleteDeviceDialog({ - cancel: this.onCancel, - confirm: this.onAccept, - deviceName: this.deviceInfo!.deviceName, - deviceInfo: $deviceInfo - }), - cancel: this.existApp, - autoCancel: true, - alignment: deviceInfo.deviceType == 'tablet' ? DialogAlignment.Center : DialogAlignment.Bottom, - gridCount: 4, - customStyle: deviceInfo.deviceType == 'tablet' ? false : true - }); - - onCancel() { - logger.info('Callback when the first button is clicked'); - } - - onAccept() { - logger.info('[DeviceManager.RemoteDeviceModel] listDeviceView ' + JSON.stringify(this.deviceInfo)); - remoteDeviceModel.unAuthenticateDevice(this.deviceInfo!); - logger.info('Callback when the second button is clicked'); - } - - existApp() { - logger.info('Click the callback in the blank area'); - } - - getDeviceTypeIcon(deviceType: number): Resource { - logger.info(`getDeviceTypeIcon deviceType: ${deviceType}`) - if (deviceType == 0x11) { - return $r('app.media.ic_pad'); - } else if (deviceType == 0x0E) { - return $r('app.media.ic_phone'); - } else if (deviceType == 0) { - return $r('app.media.ic_pc'); - } else { - return $r('app.media.ic_pc'); - } - } - - build() { - Column() { - Row() { - Image(this.getDeviceTypeIcon(Number(this.deviceInfo!.deviceType))) - .width(24) - .height(24) - .align(Alignment.Start) - Column() { - Text(this.deviceInfo!.deviceName) - .fontSize(16) - .fontColor('#182431') - .fontFamily('HarmonyHeiTi-Medium') - .fontWeight(500) - .margin({ left: 12 }) - .lineHeight(22) - Text(this.deviceInfo!.deviceId) - .fontSize(14) - .opacity(0.6) - .margin({ left: 12, top: 2 }) - .fontColor('#182431') - .maxLines(1) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - .constraintSize({ maxWidth: '60%' }) - }.alignItems(HorizontalAlign.Start) - - Blank() - - Row() { - Text($r('app.string.certified')) - .fontColor('#182431') - .fontSize(14) - .opacity(0.6) - - Image($r('app.media.ic_arrow')) - .width(12) - .height(24) - .margin({ left: 6 }) - } - .margin({ left: 24 }) - .visibility(this.visible) - .onClick(() => { - this.dialogController.open(); - }) - }.width('100%') - .height(64) - }.width('100%') - } -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/module.json5 b/DistributedAppDev/DistributedAuthentication/entry/src/main/module.json5 deleted file mode 100644 index ddd2c785007ac3ae046b9e19cb43a334f8e3654f..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/module.json5 +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2023-2025 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", - "metadata": [ - { - "name": "ArkTSPartialUpdate", - "value": "true" - } - ], - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:description_mainability", - "icon": "$media:icon", - "label": "$string:app_name", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC", - "reason": "$string:distributed_permission", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/element/color.json b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/element/string.json b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 5d1896bac0adac117b752e0bd82f96a2ba2920fb..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "app_name", - "value": "eTSDeviceManger" - }, - { - "name": "description_mainability", - "value": "eTSDeviceManger Ability" - }, - { - "name": "refresh_device_list", - "value": "Refresh device list" - }, - { - "name": "device_name", - "value": "Device name" - }, - { - "name": "device_id", - "value": "Device id" - }, - { - "name": "device_type", - "value": "Device type" - }, - { - "name": "device_state", - "value": "State" - }, - { - "name": "auth_form", - "value": "Auth Form" - }, - { - "name": "is_online", - "value": "Is online" - }, - { - "name": "is_trusted", - "value": "Is trusted" - }, - { - "name": "range", - "value": "Range" - }, - { - "name": "no_filter", - "value": "No Filter" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "confirm", - "value": "confirm" - }, - { - "name": "support_range", - "value": "Support Range" - }, - { - "name": "allowed_discovered", - "value": "Allowed Discovered" - }, - { - "name": "trusted_devices", - "value": "Trusted Devices" - }, - { - "name": "refresh", - "value": "Refresh" - }, - { - "name": "usable_devices", - "value": "Usable Devices" - }, - { - "name": "discover", - "value": "Discover" - }, - { - "name": "stop", - "value": "Stop" - }, - { - "name": "filter_options", - "value": "Filter Options" - }, - { - "name": "delete", - "value": "Delete" - }, - { - "name": "certified", - "value": "Certified" - }, - { - "name": "isDelete", - "value": "Is Delete " - }, - { - "name": "tablet", - "value": "Tablet" - }, - { - "name": "phone", - "value": "Phone" - }, - { - "name": "other", - "value": "Other" - }, - { - "name": "identical_account", - "value": "Identical Account" - }, - { - "name": "across_account", - "value": "Across Account" - }, - { - "name": "no_account", - "value": "No Account" - }, - { - "name": "online", - "value": "OnLine" - }, - { - "name": "offline", - "value": "OffLine" - }, - { - "name": "credible", - "value": "Credible" - }, - { - "name": "incredible", - "value": "Incredible" - }, - { - "name": "distributed_permission", - "value": "allows data exchange between different devices" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_arrow.svg b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_arrow.svg deleted file mode 100644 index a8bb182f8c44814c6c230fa9f4083a646ae6b7aa..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_arrow.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_back.svg b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_back.svg deleted file mode 100644 index 17ce316be4af00b445206d75f6d1d6ff92c054eb..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_back.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_circle.svg b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_circle.svg deleted file mode 100644 index f4fdc8209cee3eecde3abd39e2e46ac8dd2e3793..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_circle.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_pad.svg b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_pad.svg deleted file mode 100644 index ad1e0df3ebdad7ce6260c6bac927ec5f25bcc362..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_pad.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_pc.svg b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_pc.svg deleted file mode 100644 index e1544b2ef050766ce0c27d72e12931df473e21a1..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_pc.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_phone.svg b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_phone.svg deleted file mode 100644 index 1be29dc8fc6e799c67a85179ca5a1a2309f7e8d9..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/ic_phone.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/icon.png b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/profile/main_pages.json b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index bf03f20fa92e9176c77eea1537184f49d9f5e5af..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/FilterOption" - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/en_US/element/string.json b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 9fef32716883dfd2ed35ad3c5d8a99cc4e648475..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "app_name", - "value": "eTSDeviceManger" - }, - { - "name": "description_mainability", - "value": "eTSDeviceManger Ability" - }, - { - "name": "refresh_device_list", - "value": "Refresh device list" - }, - { - "name": "device_name", - "value": "Device name" - }, - { - "name": "device_id", - "value": "Device id" - }, - { - "name": "device_type", - "value": "Device type" - }, - { - "name": "device_state", - "value": "State" - }, - { - "name": "auth_form", - "value": "Auth Form" - }, - { - "name": "is_online", - "value": "is online" - }, - { - "name": "is_trusted", - "value": "is trusted" - }, - { - "name": "range", - "value": "range" - }, - { - "name": "no_filter", - "value": "No Filter" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "confirm", - "value": "confirm" - }, - { - "name": "support_range", - "value": "Support Range" - }, - { - "name": "allowed_discovered", - "value": "Allowed Discovered" - }, - { - "name": "trusted_devices", - "value": "Trusted Devices" - }, - { - "name": "refresh", - "value": "Refresh" - }, - { - "name": "usable_devices", - "value": "Usable Devices" - }, - { - "name": "discover", - "value": "Discover" - }, - { - "name": "stop", - "value": "Stop" - }, - { - "name": "filter_options", - "value": "Filter Options" - }, - { - "name": "delete", - "value": "Delete" - }, - { - "name": "certified", - "value": "Certified" - }, - { - "name": "isDelete", - "value": "Is Delete " - }, - { - "name": "tablet", - "value": "Tablet" - }, - { - "name": "phone", - "value": "Phone" - }, - { - "name": "other", - "value": "Other" - }, - { - "name": "identical_account", - "value": "Identical Account" - }, - { - "name": "across_account", - "value": "Across Account" - }, - { - "name": "no_account", - "value": "No Account" - }, - { - "name": "online", - "value": "OnLine" - }, - { - "name": "offline", - "value": "OffLine" - }, - { - "name": "credible", - "value": "Credible" - }, - { - "name": "incredible", - "value": "Incredible" - }, - { - "name": "distributed_permission", - "value": "allows data exchange between different devices" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/zh_CN/element/string.json b/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 7ed69ff13caa75ace2dc01e894e4e41be6d343ca..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "app_name", - "value": "分布式设备发现与连接" - }, - { - "name": "description_mainability", - "value": "eTSDeviceManger Ability" - }, - { - "name": "refresh_device_list", - "value": "刷新设备列表" - }, - { - "name": "device_name", - "value": "设备名称" - }, - { - "name": "device_id", - "value": "设备Id" - }, - { - "name": "device_type", - "value": "设备类型" - }, - { - "name": "device_state", - "value": "状态" - }, - { - "name": "auth_form", - "value": "认证类型" - }, - { - "name": "is_online", - "value": "是否上线" - }, - { - "name": "is_trusted", - "value": "是否可信" - }, - { - "name": "range", - "value": "距离" - }, - { - "name": "no_filter", - "value": "不过滤" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "confirm", - "value": "确定" - }, - { - "name": "support_range", - "value": "支持距离上报" - }, - { - "name": "allowed_discovered", - "value": "允许被发现" - }, - { - "name": "trusted_devices", - "value": "已连接设备" - }, - { - "name": "refresh", - "value": "刷新" - }, - { - "name": "usable_devices", - "value": "可用设备" - }, - { - "name": "discover", - "value": "发现" - }, - { - "name": "stop", - "value": "停止" - }, - { - "name": "filter_options", - "value": "过滤条件" - }, - { - "name": "delete", - "value": "删除" - }, - { - "name": "certified", - "value": "已认证" - }, - { - "name": "isDelete", - "value": "是否删除 " - }, - { - "name": "tablet", - "value": "平板" - }, - { - "name": "phone", - "value": "手机" - }, - { - "name": "other", - "value": "其他" - }, - { - "name": "identical_account", - "value": "同账号" - }, - { - "name": "across_account", - "value": "跨账号" - }, - { - "name": "no_account", - "value": "无账号" - }, - { - "name": "online", - "value": "上线" - }, - { - "name": "offline", - "value": "下线" - }, - { - "name": "credible", - "value": "可信" - }, - { - "name": "incredible", - "value": "不可信" - }, - { - "name": "distributed_permission", - "value": "允许不同设备间的数据交换" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 416e7d88636c1e76ef3065cce9f561a8babbe0aa..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -import hilog from '@ohos.hilog'; -import type TestRunner from '@ohos.application.testRunner'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -let abilityDelegator = undefined; -let abilityDelegatorArguments = undefined; - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun' - ]); - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}`; - } - } - return targetParams.trim(); -} - -async function onAbilityCreateCallback() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); - let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); - let debug = abilityDelegatorArguments.parameters['-D']; - if (debug == 'true') { - cmd += ' -D'; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, (err, d) => { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }); - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/test/Ability.test.ets b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 7059d5689c5583f3576971d2186396cff8764b94..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2022-2025 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 { describe, it, expect } from '@ohos/hypium'; -import { Driver, ON, Component, MatchPattern } from '@ohos.UiTest'; -import hilog from '@ohos.hilog'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const BUNDLE = 'DeviceManager_'; -const TAG = '[Sample_DeviceManager]'; -const DOMAIN = 0xF811; - -let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - -async function getResourceString(resource: Resource): Promise { - let manage = abilityDelegator.getAppContext().resourceManager; - let text = await manage.getStringValue(resource); - return text; -} - -export default function IndexTest() { - describe('ActsAbilityTest', () => { - /** - * 启动Ability - */ - it(BUNDLE + 'startAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'startAbility_001 start'); - try { - await abilityDelegator.startAbility({ - bundleName: "com.samples.devicemanager", - abilityName: "EntryAbility" - }); - done(); - } catch (err) { - expect(err.code).assertEqual(0); - done(); - } - hilog.info(DOMAIN, TAG, BUNDLE + 'startAbility_001 end'); - }); - - /** - * 进入首页 - */ - it(BUNDLE + 'IndexPageEnter_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'IndexPageEnter_001 start'); - let driver = Driver.create(); - await driver.delayMs(1000); - // 获取分布式访问权限 - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.accept')))); - let btnAccept = await driver.findComponent(ON.text(await getResourceString($r('app.string.accept')))); - await driver.delayMs(200); - await btnAccept.click(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.app_name')), MatchPattern.CONTAINS)); - let titleComponent = await driver.findComponent(ON.text(await getResourceString($r('app.string.app_name')), MatchPattern.CONTAINS)); - let titleContent = await titleComponent.getText(); - await driver.delayMs(200); - expect(await getResourceString($r('app.string.app_name'))).assertEqual(titleContent); - await driver.delayMs(200); - hilog.info(DOMAIN, TAG, BUNDLE + 'IndexPageEnter_001 end'); - }); - - /** - * 获取本机设备信息 - */ - it(BUNDLE + 'GetLocalDeviceInfo_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'GetLocalDeviceInfo_001 start'); - let driver = Driver.create(); - await driver.delayMs(500); - await driver.assertComponentExist(ON.text('OpenHarmony', MatchPattern.CONTAINS)); - let localDeviceComponent = await driver.findComponent(ON.text('OpenHarmony', MatchPattern.CONTAINS)); - let deviceName = await localDeviceComponent.getText(); - await driver.delayMs(200); - expect(deviceName).assertContain('OpenHarmony'); - await driver.delayMs(200); - hilog.info(DOMAIN, TAG, BUNDLE + 'GetLocalDeviceInfo_001 end'); - }); - - /** - * 发现可用设备 - */ - it(BUNDLE + 'DiscoveryDevices_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'DiscoveryDevices_001 start'); - let driver = Driver.create(); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.discover')), MatchPattern.CONTAINS)); - let discover = await driver.findComponents(ON.text(await getResourceString($r('app.string.discover')), MatchPattern.CONTAINS)); - await driver.delayMs(500); - await discover[1].click(); - await driver.delayMs(1000); - hilog.info(DOMAIN, TAG, BUNDLE + 'DiscoveryDevices_001 end'); - }); - - /** - * 进入过滤条件页面 - */ - it(BUNDLE + 'FilterOptions_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'FilterOptions_001 start'); - let driver = Driver.create(); - await driver.delayMs(500); - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.filter_options')), MatchPattern.CONTAINS)); - let filterOption = await driver.findComponent(ON.text(await getResourceString($r('app.string.filter_options')), MatchPattern.CONTAINS)); - await filterOption.click(); - await driver.delayMs(500); - // 点击是否上线 - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.is_online')), MatchPattern.CONTAINS)); - let isLine = await driver.findComponent(ON.text(await getResourceString($r('app.string.is_online')), MatchPattern.CONTAINS)); - await isLine.click(); - let isLineRadioList = await driver.findComponents(ON.type('Radio')); - await isLineRadioList[1].click(); - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.confirm')), MatchPattern.CONTAINS)); - let isLineConfirm = await driver.findComponent(ON.text(await getResourceString($r('app.string.confirm')), MatchPattern.CONTAINS)); - await isLineConfirm.click(); - await driver.delayMs(500); - // 点击是否可信 - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.is_trusted')), MatchPattern.CONTAINS)); - let isTrue = await driver.findComponent(ON.text(await getResourceString($r('app.string.is_trusted')), MatchPattern.CONTAINS)); - await isTrue.click(); - let isTrueRadioList = await driver.findComponents(ON.type('Radio')); - await isTrueRadioList[2].click(); - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.confirm')), MatchPattern.CONTAINS)); - let isTrueConfirm = await driver.findComponent(ON.text(await getResourceString($r('app.string.confirm')), MatchPattern.CONTAINS)); - await isTrueConfirm.click(); - await driver.delayMs(500); - // 点击认证类型 - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.auth_form')), MatchPattern.CONTAINS)); - let authentication = await driver.findComponent(ON.text(await getResourceString($r('app.string.auth_form')), MatchPattern.CONTAINS)); - await authentication.click(); - let authenticationRadioList = await driver.findComponents(ON.type('Radio')); - await authenticationRadioList[2].click(); - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.confirm')), MatchPattern.CONTAINS)); - let authenticationConfirm = await driver.findComponent(ON.text(await getResourceString($r('app.string.confirm')), MatchPattern.CONTAINS)); - await authenticationConfirm.click(); - await driver.delayMs(500); - // 点击距离 - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.range')), MatchPattern.CONTAINS)); - let distance = await driver.findComponent(ON.text(await getResourceString($r('app.string.range')), MatchPattern.CONTAINS)); - await distance.click(); - let distanceRadioList = await driver.findComponents(ON.type('Radio')); - await distanceRadioList[3].click(); - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.confirm')), MatchPattern.CONTAINS)); - let distanceConfirm = await driver.findComponent(ON.text(await getResourceString($r('app.string.confirm')), MatchPattern.CONTAINS)); - await distanceConfirm.click(); - await driver.delayMs(500); - await driver.pressBack(); - await driver.delayMs(500); - hilog.info(DOMAIN, TAG, BUNDLE + 'FilterOptions_001 end'); - }); - - /** - * 停止发现可用设备 - */ - it(BUNDLE + 'StopDiscoveryDevices_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StopDiscoveryDevices_001 start'); - let driver = Driver.create(); - await driver.delayMs(500); - await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.stop')), MatchPattern.CONTAINS)); - let stop = await driver.findComponent(ON.text(await getResourceString($r('app.string.stop')), MatchPattern.CONTAINS)); - await stop.click(); - await driver.delayMs(200); - hilog.info(DOMAIN, TAG, BUNDLE + 'StopDiscoveryDevices_001 end'); - }); - }); -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/test/List.test.ets b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 3e0ac0f0365011db47cfe4d91dda14490e6ff668..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/testability/TestAbility.ets b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index 341d835e4b7a72884c659506907f42100125817b..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2022-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. - */ - -import hilog from '@ohos.hilog'; -import Ability from '@ohos.app.ability.UIAbility'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; -import Window from '@ohos.window'; -import Want from '@ohos.app.ability.Want'; -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; -import { setGlobalObject } from '../../../main/ets/common/GlobalThis' - -export default class TestAbility extends Ability { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - setGlobalObject('this.context', this.context); - let abilityDelegator: Object; - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let abilityDelegatorArguments: Object; - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); - } - - onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: Window.WindowStage) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/testability/pages/Index.ets b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index 9f91af3e15c63609ac9b2b828815656a2cadfea8..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2022-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. - */ - -import hilog from '@ohos.hilog'; - -@Entry -@Component -struct Index { - aboutToAppear() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); - } - - build() { - } - } \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/module.json5 b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/module.json5 deleted file mode 100644 index e283e5b89d2f87775f784e66c2f46a9a08e0dad4..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2023-2025 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_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/element/color.json b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/element/string.json b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index c43f839ddd5ac62eeb845a083914dc3ce721bec3..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "app_name", - "value": "eTSDeviceManger" - }, - { - "name": "description_mainability", - "value": "eTSDeviceManger Ability" - }, - { - "name": "refresh_device_list", - "value": "Refresh device list" - }, - { - "name": "device_name", - "value": "Device name" - }, - { - "name": "device_id", - "value": "Device id" - }, - { - "name": "device_type", - "value": "Device type" - }, - { - "name": "device_state", - "value": "State" - }, - { - "name": "auth_form", - "value": "Auth Form" - }, - { - "name": "is_online", - "value": "Is online" - }, - { - "name": "is_trusted", - "value": "Is trusted" - }, - { - "name": "range", - "value": "Range" - }, - { - "name": "no_filter", - "value": "No Filter" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "confirm", - "value": "confirm" - }, - { - "name": "support_range", - "value": "Support Range" - }, - { - "name": "allowed_discovered", - "value": "Allowed Discovered" - }, - { - "name": "trusted_devices", - "value": "Trusted Devices" - }, - { - "name": "refresh", - "value": "Refresh" - }, - { - "name": "usable_devices", - "value": "Usable Devices" - }, - { - "name": "discover", - "value": "Discover" - }, - { - "name": "stop", - "value": "Stop" - }, - { - "name": "filter_options", - "value": "Filter Options" - }, - { - "name": "delete", - "value": "Delete" - }, - { - "name": "certified", - "value": "Certified" - }, - { - "name": "isDelete", - "value": "Is Delete " - }, - { - "name": "tablet", - "value": "Tablet" - }, - { - "name": "phone", - "value": "Phone" - }, - { - "name": "other", - "value": "Other" - }, - { - "name": "identical_account", - "value": "Identical Account" - }, - { - "name": "across_account", - "value": "Across Account" - }, - { - "name": "no_account", - "value": "No Account" - }, - { - "name": "online", - "value": "OnLine" - }, - { - "name": "offline", - "value": "OffLine" - }, - { - "name": "credible", - "value": "Credible" - }, - { - "name": "incredible", - "value": "Incredible" - }, - { - "name": "accept", - "value": "accept" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/media/icon.png b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/profile/test_pages.json b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/en_US/element/string.json b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/en_US/element/string.json deleted file mode 100644 index 09e42a6db80856f522a312b49f37f252e7fc4e5d..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/en_US/element/string.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "app_name", - "value": "eTSDeviceManger" - }, - { - "name": "description_mainability", - "value": "eTSDeviceManger Ability" - }, - { - "name": "refresh_device_list", - "value": "Refresh device list" - }, - { - "name": "device_name", - "value": "Device name" - }, - { - "name": "device_id", - "value": "Device id" - }, - { - "name": "device_type", - "value": "Device type" - }, - { - "name": "device_state", - "value": "State" - }, - { - "name": "auth_form", - "value": "Auth Form" - }, - { - "name": "is_online", - "value": "is online" - }, - { - "name": "is_trusted", - "value": "is trusted" - }, - { - "name": "range", - "value": "range" - }, - { - "name": "no_filter", - "value": "No Filter" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "confirm", - "value": "confirm" - }, - { - "name": "support_range", - "value": "Support Range" - }, - { - "name": "allowed_discovered", - "value": "Allowed Discovered" - }, - { - "name": "trusted_devices", - "value": "Trusted Devices" - }, - { - "name": "refresh", - "value": "Refresh" - }, - { - "name": "usable_devices", - "value": "Usable Devices" - }, - { - "name": "discover", - "value": "Discover" - }, - { - "name": "stop", - "value": "Stop" - }, - { - "name": "filter_options", - "value": "Filter Options" - }, - { - "name": "delete", - "value": "Delete" - }, - { - "name": "certified", - "value": "Certified" - }, - { - "name": "isDelete", - "value": "Is Delete " - }, - { - "name": "tablet", - "value": "Tablet" - }, - { - "name": "phone", - "value": "Phone" - }, - { - "name": "other", - "value": "Other" - }, - { - "name": "identical_account", - "value": "Identical Account" - }, - { - "name": "across_account", - "value": "Across Account" - }, - { - "name": "no_account", - "value": "No Account" - }, - { - "name": "online", - "value": "OnLine" - }, - { - "name": "offline", - "value": "OffLine" - }, - { - "name": "credible", - "value": "Credible" - }, - { - "name": "incredible", - "value": "Incredible" - }, - { - "name": "accept", - "value": "accept" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/zh_CN/element/string.json b/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/zh_CN/element/string.json deleted file mode 100644 index aaf5f6a560a0db40096cd7e0ce57cd2f7e061c30..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/entry/src/ohosTest/resources/zh_CN/element/string.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "app_name", - "value": "分布式设备发现与连接" - }, - { - "name": "description_mainability", - "value": "eTSDeviceManger Ability" - }, - { - "name": "refresh_device_list", - "value": "刷新设备列表" - }, - { - "name": "device_name", - "value": "设备名称" - }, - { - "name": "device_id", - "value": "设备Id" - }, - { - "name": "device_type", - "value": "设备类型" - }, - { - "name": "device_state", - "value": "状态" - }, - { - "name": "auth_form", - "value": "认证类型" - }, - { - "name": "is_online", - "value": "是否上线" - }, - { - "name": "is_trusted", - "value": "是否可信" - }, - { - "name": "range", - "value": "距离" - }, - { - "name": "no_filter", - "value": "不过滤" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "confirm", - "value": "确定" - }, - { - "name": "support_range", - "value": "支持距离上报" - }, - { - "name": "allowed_discovered", - "value": "允许被发现" - }, - { - "name": "trusted_devices", - "value": "已连接设备" - }, - { - "name": "refresh", - "value": "刷新" - }, - { - "name": "usable_devices", - "value": "可用设备" - }, - { - "name": "discover", - "value": "发现" - }, - { - "name": "stop", - "value": "停止" - }, - { - "name": "filter_options", - "value": "过滤条件" - }, - { - "name": "delete", - "value": "删除" - }, - { - "name": "certified", - "value": "已认证" - }, - { - "name": "isDelete", - "value": "是否删除 " - }, - { - "name": "tablet", - "value": "平板" - }, - { - "name": "phone", - "value": "手机" - }, - { - "name": "other", - "value": "其他" - }, - { - "name": "identical_account", - "value": "同账号" - }, - { - "name": "across_account", - "value": "跨账号" - }, - { - "name": "no_account", - "value": "无账号" - }, - { - "name": "online", - "value": "上线" - }, - { - "name": "offline", - "value": "下线" - }, - { - "name": "credible", - "value": "可信" - }, - { - "name": "incredible", - "value": "不可信" - }, - { - "name": "accept", - "value": "允许" - } - ] -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/hvigor/hvigor-config.json5 b/DistributedAppDev/DistributedAuthentication/hvigor/hvigor-config.json5 deleted file mode 100644 index 957deeebb90184ed01a9950d8f29c0eec189123b..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022-2025 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": "4.1.2", - "dependencies": { - "@ohos/hvigor-ohos-plugin": "4.1.2" - } -} \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/hvigor/hvigor-wrapper.js b/DistributedAppDev/DistributedAuthentication/hvigor/hvigor-wrapper.js deleted file mode 100644 index 26073b8c2cff8b61295873b6e829403ea6e21986..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var u=require("path"),D=require("os"),e=require("fs"),t=require("crypto"),r=require("child_process"),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={},C={},E=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(C,"__esModule",{value:!0}),C.maxPathLength=C.isMac=C.isLinux=C.isWindows=void 0;const F=E(D),A="Windows_NT",o="Darwin";function a(){return F.default.type()===A}function c(){return F.default.type()===o}C.isWindows=a,C.isLinux=function(){return"Linux"===F.default.type()},C.isMac=c,C.maxPathLength=function(){return c()?1016:a()?259:4095},function(e){var t=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),r=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),i=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&t(D,u,e);return r(D,u),D};Object.defineProperty(e,"__esModule",{value:!0}),e.ENABLE_SIGN_TASK_KEY=e.HVIGOR_CACHE_DIR_KEY=e.WORK_SPACE=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.PROJECT_CACHES=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 E=i(D),F=i(u),A=C;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,A.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,A.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=F.resolve(E.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=F.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.PROJECT_CACHES="project_caches",e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=F.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=F.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=F.resolve(e.HVIGOR_USER_HOME,e.PROJECT_CACHES),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_WRAPPER_HOME=F.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.WORK_SPACE="workspace",e.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",e.ENABLE_SIGN_TASK_KEY="enableSignTask"}(i);var s={},l={};Object.defineProperty(l,"__esModule",{value:!0}),l.logInfoPrintConsole=l.logErrorAndExit=void 0,l.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)},l.logInfoPrintConsole=function(u){console.log(u)};var B=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),d=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),f=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&B(D,u,e);return d(D,u),D};Object.defineProperty(s,"__esModule",{value:!0});var _=s.executeBuild=void 0;const O=f(e),p=f(u),h=l;_=s.executeBuild=function(u){const D=p.resolve(u,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const u=O.realpathSync(D);require(u)}catch(e){(0,h.logErrorAndExit)(`Error: ENOENT: no such file ${D},delete ${u} and retry.`)}};var P={},v={};!function(u){var D=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(u,"__esModule",{value:!0}),u.hashFile=u.hash=u.createHash=void 0;const r=D(t),i=D(e);u.createHash=(u="MD5")=>r.default.createHash(u);u.hash=(D,e)=>(0,u.createHash)(e).update(D).digest("hex");u.hashFile=(D,e)=>{if(i.default.existsSync(D))return(0,u.hash)(i.default.readFileSync(D,"utf-8"),e)}}(v);var g={},m={},R={};Object.defineProperty(R,"__esModule",{value:!0}),R.Unicode=void 0;class I{}R.Unicode=I,I.SPACE_SEPARATOR=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,I.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]/,I.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(m,"__esModule",{value:!0}),m.JudgeUtil=void 0;const y=R;m.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&y.Unicode.SPACE_SEPARATOR.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||y.Unicode.ID_START.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||y.Unicode.ID_CONTINUE.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var N=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(g,"__esModule",{value:!0}),g.parseJsonText=g.parseJsonFile=void 0;const S=N(e),b=N(D),w=N(u),H=m;var x;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(x||(x={}));let M,T,G,V,j,J,U="start",L=[],W=0,$=1,K=0,k=!1,z="default",q="'",Z=1;function Y(u,D=!1){T=String(u),U="start",L=[],W=0,$=1,K=0,V=void 0,k=D;do{M=X(),nu[U]()}while("eof"!==M.type);return V}function X(){for(z="default",j="",q="'",Z=1;;){J=Q();const u=Du[z]();if(u)return u}}function Q(){if(T[W])return String.fromCodePoint(T.codePointAt(W))}function uu(){const u=Q();return"\n"===u?($++,K=0):u?K+=u.length:K++,u&&(W+=u.length),u}g.parseJsonFile=function(u,D=!1,e="utf-8"){const t=S.default.readFileSync(w.default.resolve(u),{encoding:e});try{return Y(t,D)}catch(D){if(D instanceof SyntaxError){const e=D.message.split("at");if(2===e.length)throw new Error(`${e[0].trim()}${b.default.EOL}\t at ${u}:${e[1].trim()}`)}throw new Error(`${u} is not in valid JSON/JSON5 format.`)}},g.parseJsonText=Y;const Du={default(){switch(J){case"/":return uu(),void(z="comment");case void 0:return uu(),eu("eof")}if(!H.JudgeUtil.isIgnoreChar(J)&&!H.JudgeUtil.isSpaceSeparator(J))return Du[U]();uu()},start(){z="value"},beforePropertyName(){switch(J){case"$":case"_":return j=uu(),void(z="identifierName");case"\\":return uu(),void(z="identifierNameStartEscape");case"}":return eu("punctuator",uu());case'"':case"'":return q=J,uu(),void(z="string")}if(H.JudgeUtil.isIdStartChar(J))return j+=uu(),void(z="identifierName");throw Fu(x.Char,uu())},afterPropertyName(){if(":"===J)return eu("punctuator",uu());throw Fu(x.Char,uu())},beforePropertyValue(){z="value"},afterPropertyValue(){switch(J){case",":case"}":return eu("punctuator",uu())}throw Fu(x.Char,uu())},beforeArrayValue(){if("]"===J)return eu("punctuator",uu());z="value"},afterArrayValue(){switch(J){case",":case"]":return eu("punctuator",uu())}throw Fu(x.Char,uu())},end(){throw Fu(x.Char,uu())},comment(){switch(J){case"*":return uu(),void(z="multiLineComment");case"/":return uu(),void(z="singleLineComment")}throw Fu(x.Char,uu())},multiLineComment(){switch(J){case"*":return uu(),void(z="multiLineCommentAsterisk");case void 0:throw Fu(x.Char,uu())}uu()},multiLineCommentAsterisk(){switch(J){case"*":return void uu();case"/":return uu(),void(z="default");case void 0:throw Fu(x.Char,uu())}uu(),z="multiLineComment"},singleLineComment(){switch(J){case"\n":case"\r":case"\u2028":case"\u2029":return uu(),void(z="default");case void 0:return uu(),eu("eof")}uu()},value(){switch(J){case"{":case"[":return eu("punctuator",uu());case"n":return uu(),tu("ull"),eu("null",null);case"t":return uu(),tu("rue"),eu("boolean",!0);case"f":return uu(),tu("alse"),eu("boolean",!1);case"-":case"+":return"-"===uu()&&(Z=-1),void(z="numerical");case".":case"0":case"I":case"N":return void(z="numerical");case'"':case"'":return q=J,uu(),j="",void(z="string")}if(void 0===J||!H.JudgeUtil.isDigitWithoutZero(J))throw Fu(x.Char,uu());z="numerical"},numerical(){switch(J){case".":return j=uu(),void(z="decimalPointLeading");case"0":return j=uu(),void(z="zero");case"I":return uu(),tu("nfinity"),eu("numeric",Z*(1/0));case"N":return uu(),tu("aN"),eu("numeric",NaN)}if(void 0!==J&&H.JudgeUtil.isDigitWithoutZero(J))return j=uu(),void(z="decimalInteger");throw Fu(x.Char,uu())},zero(){switch(J){case".":case"e":case"E":return void(z="decimal");case"x":case"X":return j+=uu(),void(z="hexadecimal")}return eu("numeric",0)},decimalInteger(){switch(J){case".":case"e":case"E":return void(z="decimal")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimal(){switch(J){case".":j+=uu(),z="decimalFraction";break;case"e":case"E":j+=uu(),z="decimalExponent"}},decimalPointLeading(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalFraction");throw Fu(x.Char,uu())},decimalFraction(){switch(J){case"e":case"E":return j+=uu(),void(z="decimalExponent")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimalExponent(){switch(J){case"+":case"-":return j+=uu(),void(z="decimalExponentSign")}if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Fu(x.Char,uu())},decimalExponentSign(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Fu(x.Char,uu())},decimalExponentInteger(){if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},hexadecimal(){if(H.JudgeUtil.isHexDigit(J))return j+=uu(),void(z="hexadecimalInteger");throw Fu(x.Char,uu())},hexadecimalInteger(){if(!H.JudgeUtil.isHexDigit(J))return eu("numeric",Z*Number(j));j+=uu()},identifierNameStartEscape(){if("u"!==J)throw Fu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":break;default:if(!H.JudgeUtil.isIdStartChar(u))throw Fu(x.Identifier)}j+=u,z="identifierName"},identifierName(){switch(J){case"$":case"_":case"‌":case"‍":return void(j+=uu());case"\\":return uu(),void(z="identifierNameEscape")}if(!H.JudgeUtil.isIdContinueChar(J))return eu("identifier",j);j+=uu()},identifierNameEscape(){if("u"!==J)throw Fu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!H.JudgeUtil.isIdContinueChar(u))throw Fu(x.Identifier)}j+=u,z="identifierName"},string(){switch(J){case"\\":return uu(),void(j+=function(){const u=Q(),D=function(){switch(Q()){case"b":return uu(),"\b";case"f":return uu(),"\f";case"n":return uu(),"\n";case"r":return uu(),"\r";case"t":return uu(),"\t";case"v":return uu(),"\v"}return}();if(D)return D;switch(u){case"0":if(uu(),H.JudgeUtil.isDigit(Q()))throw Fu(x.Char,uu());return"\0";case"x":return uu(),function(){let u="",D=Q();if(!H.JudgeUtil.isHexDigit(D))throw Fu(x.Char,uu());if(u+=uu(),D=Q(),!H.JudgeUtil.isHexDigit(D))throw Fu(x.Char,uu());return u+=uu(),String.fromCodePoint(parseInt(u,16))}();case"u":return uu(),ru();case"\n":case"\u2028":case"\u2029":return uu(),"";case"\r":return uu(),"\n"===Q()&&uu(),""}if(void 0===u||H.JudgeUtil.isDigitWithoutZero(u))throw Fu(x.Char,uu());return uu()}());case'"':case"'":if(J===q){const u=eu("string",j);return uu(),u}return void(j+=uu());case"\n":case"\r":case void 0:throw Fu(x.Char,uu());case"\u2028":case"\u2029":!function(u){console.warn(`JSON5: '${Eu(u)}' in strings is not valid ECMAScript; consider escaping.`)}(J)}j+=uu()}};function eu(u,D){return{type:u,value:D,line:$,column:K}}function tu(u){for(const D of u){if(Q()!==D)throw Fu(x.Char,uu());uu()}}function ru(){let u="",D=4;for(;D-- >0;){const D=Q();if(!H.JudgeUtil.isHexDigit(D))throw Fu(x.Char,uu());u+=uu()}return String.fromCodePoint(parseInt(u,16))}const nu={start(){if("eof"===M.type)throw Fu(x.EOF);iu()},beforePropertyName(){switch(M.type){case"identifier":case"string":return G=M.value,void(U="afterPropertyName");case"punctuator":return void Cu();case"eof":throw Fu(x.EOF)}},afterPropertyName(){if("eof"===M.type)throw Fu(x.EOF);U="beforePropertyValue"},beforePropertyValue(){if("eof"===M.type)throw Fu(x.EOF);iu()},afterPropertyValue(){if("eof"===M.type)throw Fu(x.EOF);switch(M.value){case",":return void(U="beforePropertyName");case"}":Cu()}},beforeArrayValue(){if("eof"===M.type)throw Fu(x.EOF);"punctuator"!==M.type||"]"!==M.value?iu():Cu()},afterArrayValue(){if("eof"===M.type)throw Fu(x.EOF);switch(M.value){case",":return void(U="beforeArrayValue");case"]":Cu()}},end(){}};function iu(){const u=function(){let u;switch(M.type){case"punctuator":switch(M.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=M.value}return u}();if(k&&"object"==typeof u&&(u._line=$,u._column=K),void 0===V)V=u;else{const D=L[L.length-1];Array.isArray(D)?k&&"object"!=typeof u?D.push({value:u,_line:$,_column:K}):D.push(u):D[G]=k&&"object"!=typeof u?{value:u,_line:$,_column:K}:u}!function(u){if(u&&"object"==typeof u)L.push(u),U=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=L[L.length-1];U=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Cu(){L.pop();const u=L[L.length-1];U=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function Eu(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return`\\x${`00${D}`.substring(D.length)}`}return u}function Fu(u,D){let e="";switch(u){case x.Char:e=void 0===D?`JSON5: invalid end of input at ${$}:${K}`:`JSON5: invalid character '${Eu(D)}' at ${$}:${K}`;break;case x.EOF:e=`JSON5: invalid end of input at ${$}:${K}`;break;case x.Identifier:K-=5,e=`JSON5: invalid identifier character at ${$}:${K}`}const t=new Au(e);return t.lineNumber=$,t.columnNumber=K,t}class Au extends SyntaxError{}var ou={},au=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),cu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),su=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&au(D,u,e);return cu(D,u),D},lu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ou,"__esModule",{value:!0}),ou.isFileExists=ou.offlinePluginConversion=ou.executeCommand=ou.getNpmPath=ou.hasNpmPackInPaths=void 0;const Bu=r,du=lu(e),fu=su(u),_u=i,Ou=l;ou.hasNpmPackInPaths=function(u,D){try{return require.resolve(u,{paths:[...D]}),!0}catch(u){return!1}},ou.getNpmPath=function(){const u=process.execPath;return fu.join(fu.dirname(u),_u.NPM_TOOL)},ou.executeCommand=function(u,D,e){0!==(0,Bu.spawnSync)(u,D,e).status&&(0,Ou.logErrorAndExit)(`Error: ${u} ${D} execute failed.See above for details.`)},ou.offlinePluginConversion=function(u,D){return D.startsWith("file:")||D.endsWith(".tgz")?fu.resolve(u,_u.HVIGOR,D.replace("file:","")):D},ou.isFileExists=function(u){return du.default.existsSync(u)&&du.default.statSync(u).isFile()};var pu=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),hu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),Pu=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&pu(D,u,e);return hu(D,u),D},vu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(P,"__esModule",{value:!0});var gu=P.initProjectWorkSpace=void 0;const mu=Pu(e),Ru=vu(D),Iu=Pu(u),yu=i,Nu=v,Su=g,bu=l,wu=ou;let Hu,xu,Mu;function Tu(u,D,e){return void 0!==e.dependencies&&(0,wu.offlinePluginConversion)(yu.HVIGOR_PROJECT_ROOT_DIR,D.dependencies[u])===Iu.normalize(e.dependencies[u])}gu=P.initProjectWorkSpace=function(){if(Hu=function(){const u=Iu.resolve(yu.HVIGOR_PROJECT_WRAPPER_HOME,yu.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);mu.existsSync(u)||(0,bu.logErrorAndExit)(`Error: Hvigor config file ${u} does not exist.`);return(0,Su.parseJsonFile)(u)}(),Mu=function(u){let D;D=function(u){const D=u.hvigorVersion;if(D.startsWith("file:")||D.endsWith(".tgz"))return!1;const e=u.dependencies,t=Object.getOwnPropertyNames(e);for(const u of t){const D=e[u];if(D.startsWith("file:")||D.endsWith(".tgz"))return!1}if(1===t.length&&"@ohos/hvigor-ohos-plugin"===t[0])return D>"2.5.0";return!1}(u)?function(u){let D=`${yu.HVIGOR_ENGINE_PACKAGE_NAME}@${u.hvigorVersion}`;const e=u.dependencies;if(e){Object.getOwnPropertyNames(e).sort().forEach((u=>{D+=`,${u}@${e[u]}`}))}return(0,Nu.hash)(D)}(u):(0,Nu.hash)(process.cwd());return Iu.resolve(Ru.default.homedir(),".hvigor","project_caches",D)}(Hu),xu=function(){const u=Iu.resolve(Mu,yu.WORK_SPACE,yu.DEFAULT_PACKAGE_JSON);return mu.existsSync(u)?(0,Su.parseJsonFile)(u):{dependencies:{}}}(),function(){const u=Iu.resolve(yu.HVIGOR_USER_HOME,yu.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(mu.existsSync(u))(0,Su.parseJsonFile)(u)}(),!(0,wu.hasNpmPackInPaths)(yu.HVIGOR_ENGINE_PACKAGE_NAME,[Iu.join(Mu,yu.WORK_SPACE)])||(0,wu.offlinePluginConversion)(yu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion)!==xu.dependencies[yu.HVIGOR_ENGINE_PACKAGE_NAME]||!function(){function u(u){const D=null==u?void 0:u.dependencies;return void 0===D?0:Object.getOwnPropertyNames(D).length}const D=u(Hu),e=u(xu);if(D+1!==e)return!1;for(const u in null==Hu?void 0:Hu.dependencies)if(!(0,wu.hasNpmPackInPaths)(u,[Iu.join(Mu,yu.WORK_SPACE)])||!Tu(u,Hu,xu))return!1;return!0}())try{!function(){(0,bu.logInfoPrintConsole)("Hvigor installing...");for(const u in Hu.dependencies)Hu.dependencies[u]&&(Hu.dependencies[u]=(0,wu.offlinePluginConversion)(yu.HVIGOR_PROJECT_ROOT_DIR,Hu.dependencies[u]));const u={dependencies:{...Hu.dependencies}};u.dependencies[yu.HVIGOR_ENGINE_PACKAGE_NAME]=(0,wu.offlinePluginConversion)(yu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion);const D=Iu.join(Mu,yu.WORK_SPACE);try{mu.mkdirSync(D,{recursive:!0});const e=Iu.resolve(D,yu.DEFAULT_PACKAGE_JSON);mu.writeFileSync(e,JSON.stringify(u))}catch(u){(0,bu.logErrorAndExit)(u)}(function(){const u=["config","set","store-dir",yu.HVIGOR_PNPM_STORE_PATH],D={cwd:Iu.join(Mu,yu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(yu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)})(),function(){const u=["install"],D={cwd:Iu.join(Mu,yu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(yu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)}(),(0,bu.logInfoPrintConsole)("Hvigor install success.")}()}catch(u){!function(){const u=Iu.join(Mu,yu.WORK_SPACE);if((0,bu.logInfoPrintConsole)("Hvigor cleaning..."),!mu.existsSync(u))return;const D=mu.readdirSync(u);if(!D||0===D.length)return;const e=Iu.resolve(Mu,"node_modules","@ohos","hvigor","bin","hvigor.js");mu.existsSync(e)&&(0,wu.executeCommand)(process.argv[0],[e,"--stop-daemon"],{});try{D.forEach((D=>{mu.rmSync(Iu.resolve(u,D),{recursive:!0})}))}catch(D){(0,bu.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${u}.`)}}()}return Mu};var Gu={};!function(t){var C=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),E=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),F=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&C(D,u,e);return E(D,u),D},A=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.executeInstallPnpm=t.isPnpmInstalled=t.environmentHandler=t.checkNpmConifg=t.PNPM_VERSION=void 0;const o=r,a=F(e),c=A(D),s=F(u),B=i,d=l,f=ou;t.PNPM_VERSION="7.30.0",t.checkNpmConifg=function(){const u=s.resolve(B.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),D=s.resolve(c.default.homedir(),".npmrc");if((0,f.isFileExists)(u)||(0,f.isFileExists)(D))return;const e=(0,f.getNpmPath)(),t=(0,o.spawnSync)(e,["config","get","prefix"],{cwd:B.HVIGOR_PROJECT_ROOT_DIR});if(0!==t.status||!t.stdout)return void(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const r=s.resolve(`${t.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,f.isFileExists)(r)||(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},t.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},t.isPnpmInstalled=function(){return!!a.existsSync(B.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,f.hasNpmPackInPaths)("pnpm",[B.HVIGOR_WRAPPER_TOOLS_HOME])},t.executeInstallPnpm=function(){(0,d.logInfoPrintConsole)(`Installing pnpm@${t.PNPM_VERSION}...`);const u=(0,f.getNpmPath)();!function(){const u=s.resolve(B.HVIGOR_WRAPPER_TOOLS_HOME,B.DEFAULT_PACKAGE_JSON);try{a.existsSync(B.HVIGOR_WRAPPER_TOOLS_HOME)||a.mkdirSync(B.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const D={dependencies:{}};D.dependencies[B.PNPM]=t.PNPM_VERSION,a.writeFileSync(u,JSON.stringify(D))}catch(D){(0,d.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,f.executeCommand)(u,["install","pnpm"],{cwd:B.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,d.logInfoPrintConsole)("Pnpm install success.")}}(Gu),function(){Gu.checkNpmConifg(),Gu.environmentHandler(),Gu.isPnpmInstalled()||Gu.executeInstallPnpm();const D=gu();_(u.join(D,i.WORK_SPACE))}(); \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/hvigorfile.ts b/DistributedAppDev/DistributedAuthentication/hvigorfile.ts deleted file mode 100644 index 6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/DistributedAppDev/DistributedAuthentication/hvigorw b/DistributedAppDev/DistributedAuthentication/hvigorw deleted file mode 100644 index 39f66a85d4d17cf6b0cda498ca3effbb65485958..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/hvigorw +++ /dev/null @@ -1,61 +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/DistributedAppDev/DistributedAuthentication/hvigorw.bat b/DistributedAppDev/DistributedAuthentication/hvigorw.bat deleted file mode 100644 index af893e9a2c9170d04610c906f1cf1b6f3ac144ac..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/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/DistributedAppDev/DistributedAuthentication/oh-package.json5 b/DistributedAppDev/DistributedAuthentication/oh-package.json5 deleted file mode 100644 index 400b51e18d7686bd2cd0444ceaa47c531e17de85..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -{ - "license": "ISC", - "devDependencies": { - "@ohos/hypium": "1.0.6" - }, - "name": "devicemanager", - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": {} -} diff --git a/DistributedAppDev/DistributedAuthentication/ohosTest.md b/DistributedAppDev/DistributedAuthentication/ohosTest.md deleted file mode 100644 index c08e231a301a99c750b23bf049e8beb0b88e8957..0000000000000000000000000000000000000000 --- a/DistributedAppDev/DistributedAuthentication/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -|测试功能|预置条件|输入|预期输出|是否自动|测试结果| -|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------| -|拉起应用| 设备正常运行,进入首页| |成功拉起应用|是|Pass| -|获取本机设备信息功能测试| 位于主页| | 获取本机设备信息|是|Pass| -|获取可信设备列表功能测试| 位于主页| 点击刷新和已认证按钮| 获取可信设备列表|是|Pass| -|发现可用设备功能测试| 位于主页| 点击发现按钮| 发现可用设备|是|Pass| -|进入过滤条件页面功能测试| 位于主页| 点击过滤条件按钮| 可进行是否上线,是否可信,认证类型,距离过滤|是|Pass| -|停止发现可用设备功能测试| 位于主页| 点击停止按钮| 停止发现可用设备|是|Pass| diff --git a/DistributedAppDev/DistributedAuthentication/screenshots/device/delete.jpeg b/DistributedAppDev/DistributedAuthentication/screenshots/device/delete.jpeg deleted file mode 100644 index 72964b44de52db5cbd2228bf88248907797b4fc7..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/DistributedAuthentication/screenshots/device/delete.jpeg and /dev/null differ diff --git a/DistributedAppDev/DistributedAuthentication/screenshots/device/discover.jpeg b/DistributedAppDev/DistributedAuthentication/screenshots/device/discover.jpeg deleted file mode 100644 index b8d4de44d9eb4411c08b5af1f2ff5a50817e4b02..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/DistributedAuthentication/screenshots/device/discover.jpeg and /dev/null differ diff --git a/DistributedAppDev/DistributedAuthentication/screenshots/device/filteroption.jpeg b/DistributedAppDev/DistributedAuthentication/screenshots/device/filteroption.jpeg deleted file mode 100644 index 390c41e79c730cf291825a28bad725aacf96ef47..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/DistributedAuthentication/screenshots/device/filteroption.jpeg and /dev/null differ diff --git a/DistributedAppDev/DistributedAuthentication/screenshots/device/main.jpeg b/DistributedAppDev/DistributedAuthentication/screenshots/device/main.jpeg deleted file mode 100644 index 17f9c9aa348015d462e9a15dc36b42a77f34d865..0000000000000000000000000000000000000000 Binary files a/DistributedAppDev/DistributedAuthentication/screenshots/device/main.jpeg and /dev/null differ diff --git a/DriverDevelopmentKit/DriverDemo/.gitignore b/DriverDevelopmentKit/DriverDemo/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/DriverDevelopmentKit/DriverDemo/AppScope/app.json5 b/DriverDevelopmentKit/DriverDemo/AppScope/app.json5 deleted file mode 100644 index 81b8f648734a9d7f64bbe76a52f8ac7011bed473..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.driverwithuidemo", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/element/string.json b/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/element/string.json deleted file mode 100644 index d52f4e34ae12bff20106cbb05e6d94d57b2985b2..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DriverWithUIDemo" - } - ] -} diff --git a/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/media/background.png b/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/media/foreground.png b/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/media/layered_image.json b/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/README_zh.md b/DriverDevelopmentKit/DriverDemo/README_zh.md deleted file mode 100644 index d68fb5628cad40cd9f949dbdab6a8316cccb4c85..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/README_zh.md +++ /dev/null @@ -1,73 +0,0 @@ -# 驱动开发服务 - -### 介绍 - -本示例主要展示了通过DriverDevelopmentKit开发驱动服务,使用[@ohos.driver.deviceManager](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-driver-deviceManager.md) 、[@ohos.app.ability.DriverExtensionAbility](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-app-ability-driverExtensionAbility.md) 、[@ohos.rpc](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ipc-kit/js-apis-rpc.md) -等接口,实现了插入外设时拉起外设驱动服务端,查询外设列表,驱动UI界面与驱动服务端通信的功能; - -### 效果预览 - -屏幕截屏或者视频,文件不超过4个,每张截屏图片不能太大,推荐占1/4页左右,每张图片附上图片标题,示例效果如下所示; - -| 主页 | 点击后界面 | -|----|-------| -| ![image](screenshots/main.png) | ![image](screenshots/click_main.png) | - -使用说明 - -1. 安装该示例应用后,当目标设备插入时,扩展外设驱动服务SA会拉起DriverExtensionAbility相关进程 -2. 在主界面,点击“Hello”文字,会触发查询外设列表,筛选目标外设,绑定驱动服务端,给服务端发送“Hello”等一系列流程; -3. 流程结束会主界面中“Hello”文字会修改为驱动服务端发送的“Hello World”文字; - - -### 工程目录 - -给出项目中关键的目录结构并描述它们的作用,示例如下: - -``` -entry/src/main/ets -|---driverextability -| |---DriverExtAbility.ets //主要重载了继承驱动扩展能力DriverExtensionAbility,onConnect创建服务端实例,接受客户端消息后回复等 -|---entryability -| |---EntryAbility.ets //UIAbility定义 -|---pages -| |---Index.ets //应用首页主要逻辑,包含了点击按钮触发与服务端通信的一系列流程 -entry/src/main/cpp -|---types -| |---libentry //创建native c++工程,自动生成的文件目录 -| | |---Index.d.ts //定义ArkTs层接口,该示例暂未使用 -|---napi_init.cpp //主要封装了通过CAPI来与设备交互功能,该示例暂未使用 -|---CMakeLists.txt //主要通过Cmake语法编译libentry.so,该示例暂未使用 -``` - -### 具体实现 - -* 驱动UI界面,功能包括查询设备列表、绑定设备驱动服务端、与设备驱动服务端通信,源码参考:[Index.ets](code/DocsSample/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/pages/Index.ets) - * 使用deviceManager.queryDevices来获取设备列表; - * 通过deviceManager.bindDeviceDriver来绑定设备驱动服务端,通过返回值拿到驱动服务端实例; - * 通过服务端实例调用sendMessageRequest与设备驱动服务端通信,并获取到服务端回应,将回应数据打印到主界面; - -* 驱动服务端,与驱动UI界面通信,源码参考:[DriverExtAbility.ets](code/DocsSample/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/driverextability/DriverExtAbility.ts) - * 如效果预览中的**点击后界面**,就是UI界面通过bindDeviceDriver接口获取到驱动服务端实例,再通过服务端实例与服务端通信; - -### 相关权限 - -[ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md) - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568; -2. 本示例为Stage模型,仅支持API11版本SDK,SDK版本号(API Version 11),镜像版本号(4.1Release) -3. 本示例需要使用DevEco Studio 版本号(6.0Release)版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/DriverDevelopmentKit > .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/DriverDevelopmentKit/DriverDemo/build-profile.json5 b/DriverDevelopmentKit/DriverDemo/build-profile.json5 deleted file mode 100644 index ab50391f9e434660e1d005af95e7f469ce54eced..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/build-profile.json5 +++ /dev/null @@ -1,44 +0,0 @@ -{ - "app": { - "signingConfigs": [ - ], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/code-linter.json5 b/DriverDevelopmentKit/DriverDemo/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/.gitignore b/DriverDevelopmentKit/DriverDemo/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/build-profile.json5 b/DriverDevelopmentKit/DriverDemo/entry/build-profile.json5 deleted file mode 100644 index 1bdab41be5c3f4d4a37e8b15069197a160b30e84..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/build-profile.json5 +++ /dev/null @@ -1,44 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - }, - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/hvigorfile.ts b/DriverDevelopmentKit/DriverDemo/entry/hvigorfile.ts deleted file mode 100644 index b0e3a1ab98a91bc918d6404b2413111a5011f14a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/obfuscation-rules.txt b/DriverDevelopmentKit/DriverDemo/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/DriverDevelopmentKit/DriverDemo/entry/oh-package-lock.json5 b/DriverDevelopmentKit/DriverDemo/entry/oh-package-lock.json5 deleted file mode 100644 index 05149e9a0799aca540bf4cd16ae71233319d991b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/oh-package-lock.json5 +++ /dev/null @@ -1,19 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry" - }, - "packages": { - "libentry.so@src/main/cpp/types/libentry": { - "name": "libentry.so", - "version": "1.0.0", - "resolved": "", - "registryType": "local" - } - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/oh-package.json5 b/DriverDevelopmentKit/DriverDemo/entry/oh-package.json5 deleted file mode 100644 index 54cb066266f9993f5a023f2ac5a8dfc5d2574643..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/oh-package.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/CMakeLists.txt b/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 514a8a0fd081f0b6b97eceaba98b07980984ea3a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(DriverWithUIDemo) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so) \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/napi_init.cpp b/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 3e613da4cd8fdc9bd46bb8737c784c7aa86d563d..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - - return sum; - -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts b/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 b/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index ea410725a8826704d061021d98cf02aa76cd8016..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/driverextability/DriverExtAbility.ets b/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/driverextability/DriverExtAbility.ets deleted file mode 100644 index 5caba00e5019a088b8ba5fb1d1b0586149c0abeb..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/driverextability/DriverExtAbility.ets +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start driver_service_step4] -import { DriverExtensionAbility } from '@kit.DriverDevelopmentKit'; -import { Want } from '@kit.AbilityKit'; -import { rpc } from '@kit.IPCKit'; - -const REQUEST_CODE = 99; // 与扩展外设客户端约定请求码。 -// [End driver_service_step4] - -// [Start driver_service_step5] -class StubTest extends rpc.RemoteObject { - // 接收应用传递过来的消息处理,以及将处理的结果返回给客户端。 - onRemoteMessageRequest(code: number, data: rpc.MessageSequence, reply: rpc.MessageSequence, - option: rpc.MessageOption) { - if (code === REQUEST_CODE) { - // 接收应用传递过来的数据。 - // 应用使用多次调用data.writeString()写入多个数据时,驱动可以通过多次调用data.readString()方法接收对应的数据。 - let optFir: string = data.readString(); - // 驱动将数据的处理结果返回给应用。 - // 示例中为接收了"Hello",并将"Hello World"返回给应用。 - reply.writeString(optFir + ` World`); - } - return true; - } -} -// [End driver_service_step5] - -// [Start driver_service_step6] -export default class DriverExtAbility extends DriverExtensionAbility { - onInit(want: Want) { - console.info('testTag', `onInit, want: ${want.abilityName}`); - } - - onRelease() { - console.info('testTag', `onRelease`); - } - - onConnect(want: Want) { - console.info('testTag', `onConnect, want: ${want.abilityName}`); - return new StubTest("test"); - } - - onDisconnect(want: Want) { - console.info('testTag', `onDisconnect, want: ${want.abilityName}`); - } - - onDump(params: Array) { - console.info('testTag', `onDump, params:` + JSON.stringify(params)); - return ['params']; - } -} -// [End driver_service_step6] \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/entryability/EntryAbility.ets b/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 62f53acbc95e5be7985f8fb1fe2db591cea260bd..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/pages/Index.ets b/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index c2d2c6ea8b6069217232ddefd67c3e11b44a7148..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start driver_ui_step2] -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { deviceManager } from '@kit.DriverDevelopmentKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { rpc } from '@kit.IPCKit'; - -const REQUEST_CODE: number = 99; // 自定义通信Code,此处仅供参考 -const productId: number = 4258; // 请声明连接的USB设备的productId -const vendorId: number = 4817; // 请声明连接的USB设备的vendorId -const DOMAIN = 0x0000; -// [End driver_ui_step2] - -@Entry -@Component -struct Index { - // [Start driver_ui_step3] - @State message: string = 'Hello'; - private remote: rpc.IRemoteObject | null = null; - // [End driver_ui_step3] - - // [Start driver_ui_step4] - private async queryTargetDeviceId(): Promise { - try { - const devices: deviceManager.Device[] = deviceManager.queryDevices(deviceManager.BusType.USB); - const index = devices.findIndex((item: deviceManager.Device) => { - let usbDevice = item as deviceManager.USBDevice; - // 如果不知道设备productId和vendorId,可以通过该日志查看连接的usb设备的相关信息 - hilog.info(DOMAIN, 'testTag', `usbDevice.productId = ${usbDevice.productId}, usbDevice.vendorId = ${usbDevice.vendorId}`); - return usbDevice.productId === productId && usbDevice.vendorId === vendorId; - }); - hilog.info(DOMAIN, 'testTag', `queryTargetDeviceId index = ${index}, deviceId = ${devices[index].deviceId}`); - if (index < 0) { - hilog.error(DOMAIN, 'testTag', 'can not find device'); - return -1; - } - return devices[index].deviceId; - } catch (error) { - hilog.error(DOMAIN, 'testTag', `queryDevice failed, err: ${JSON.stringify(error)}`); - } - return -1; - } - // [End driver_ui_step4] - - // [Start driver_ui_step5] - private async getDriverRemote(deviceId: number): Promise { - try { - let remoteDeviceDriver: deviceManager.RemoteDeviceDriver = await deviceManager.bindDeviceDriver(deviceId, - (err: BusinessError, id: number) => { - hilog.info(DOMAIN, 'testTag', `device[${id}] id disconnect, err: ${JSON.stringify(err)}`); - }); - return remoteDeviceDriver.remote; - } catch (error) { - hilog.error(DOMAIN, 'testTag', `bindDriverWithDeviceId failed, err: ${JSON.stringify(error)}`); - } - return null; - } - // [End driver_ui_step5] - - // [Start driver_ui_step6] - private async communicateWithRemote(): Promise { - const deviceId: number = await this.queryTargetDeviceId(); - hilog.info(DOMAIN, 'testTag', `queryTargetDeviceId, deviceId=${deviceId}`); - if (deviceId < 0) { - hilog.error(DOMAIN, 'testTag', 'can not find target device'); - return; - } - this.remote = await this.getDriverRemote(deviceId); - if (this.remote === null) { - hilog.error(DOMAIN, 'testTag', `getDriverRemote failed`); - return; - } - - let option = new rpc.MessageOption(); - let data = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - // 向驱动发送信息"Hello" - hilog.info(DOMAIN, 'testTag', `communicateWithRemote, message=${this.message}`); - data.writeString(this.message); - - try { - await this.remote.sendMessageRequest(REQUEST_CODE, data, reply, option); - // 获取驱动返回信息"Hello world" - this.message = reply.readString(); - hilog.info(DOMAIN, 'testTag', `sendMessageRequest, message: ${this.message}`); - } catch (error) { - hilog.error(DOMAIN, 'testTag', `sendMessageRequest failed, err: ${JSON.stringify(error)}`); - } - } - // [End driver_ui_step6] - - // [Start driver_ui_step7] - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - // 点击"Hello",与远程对象通信,显示"Hello World" - this.communicateWithRemote(); - }) - } - .width('100%') - } - .height('100%') - } - // [End driver_ui_step7] -} diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/module.json5 b/DriverDevelopmentKit/DriverDemo/entry/src/main/module.json5 deleted file mode 100644 index 3812c0952c9d4c4f89ca72e4203996783dbeb0d7..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/module.json5 +++ /dev/null @@ -1,83 +0,0 @@ -// [Start driver_service_step7] -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "2in1" - ], - "requestPermissions": [ - { - "name": "ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER" // 此处为扩展外设相关权限,必须配置。 - } - ], - "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": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "DriverExtAbility", - "icon": "$media:startIcon", - "description": "driver", - "type": "driver", - "exported": true, - "srcEntry": "./ets/driverextability/DriverExtAbility.ets", - "metadata": [ - { - "name": "bus", // 必填项,所属总线。 - "value": "USB" - }, - { - "name": "desc", // 选填项,必要的驱动描述。 - "value": "the sample of driverExtensionAbility" - }, - { - "name": "vendor", // 选填项,驱动厂商名称。 - "value": "string" - }, - { - "name": "vid", // 支持 USB vendor id 列表,填写16进制,此处为4817的16进制。 - "value": "0x12D1" - }, - { - "name": "pid", // 支持的 USB product id 列表,填写16进制,此处为4258的16进制。 - "value": "0x10A2" - }, - { - "name": "launchOnBind", // 选填项,延迟拉起驱动。此处“true”表示延迟拉起,“false”表示即时拉起,配置错误或不配置,默认为“false”。 - "value": "true" - }, - { - "name": "ohos.permission.ACCESS_DDK_ALLOWED", // 选填项,允许应用访问。此处“true”表示允许访问,“false”表示不允许访问,配置错误或不配置,默认为“false”。 - "value": "true" - } - ] - } - ] - } -} -// [End driver_service_step7] \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/element/color.json b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/element/float.json b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/element/string.json b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/background.png b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/foreground.png b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/layered_image.json b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/startIcon.png b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/profile/backup_config.json b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/profile/main_pages.json b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/dark/element/color.json b/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/mock/Libentry.mock.ets b/DriverDevelopmentKit/DriverDemo/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index c2171716d040a605ef6af71e90b937a945f2677d..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,7 +0,0 @@ -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/mock/mock-config.json5 b/DriverDevelopmentKit/DriverDemo/entry/src/mock/mock-config.json5 deleted file mode 100644 index 6540976c9acc8afbd45895db6404334cff195465..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets b/DriverDevelopmentKit/DriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index e69ba7df683fdabb2eb860ed68e0c10a589ac59e..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,64 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Level } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('testUiDriver', Level.LEVEL1, async (done: Function) => { - console.info("uitest: TestUiExample begin"); - // 初始化Driver对象 - const driver = Driver.create(); - const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - console.info("uitest: bundleName=", bundleName); - // 指定被测应用包名、ability名,请开发者替换为被测应用包名和ability名 - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - } - // 拉起被测应用 - await delegator.startAbility(want); - // 等待应用拉起完成 - await driver.waitForIdle(4000,5000); - // 确认当前应用顶部Ability为指定的ability - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info("get top ability"); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - - // 依据指定文本“Hello”查找目标控件 - const helloCom = await driver.findComponent(ON.text('Hello')); - // 点击目标控件 - await helloCom.click(); - await driver.waitForIdle(4000,5000); - await sleep(3000); - // 通过断言文本为“Hello World”的控件存在,确认操作后页面变化符合预期 - await driver.assertComponentExist(ON.text('Hello World')); - await driver.pressBack(); - done(); - }) - }) -} - -function sleep(ms: number): Promise { - return new Promise(resolve => setTimeout(resolve, ms)); -} diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/ohosTest/ets/test/List.test.ets b/DriverDevelopmentKit/DriverDemo/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/ohosTest/module.json5 b/DriverDevelopmentKit/DriverDemo/entry/src/ohosTest/module.json5 deleted file mode 100644 index 0c3af0f4892d53cb0a63497d76fedb225ccdae93..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/test/List.test.ets b/DriverDevelopmentKit/DriverDemo/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/entry/src/test/LocalUnit.test.ets b/DriverDevelopmentKit/DriverDemo/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/hvigor/hvigor-config.json5 b/DriverDevelopmentKit/DriverDemo/hvigor/hvigor-config.json5 deleted file mode 100644 index 7a7ab8914d8db6ab89758e185df5855dffe88d04..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/DriverDevelopmentKit/DriverDemo/hvigorfile.ts b/DriverDevelopmentKit/DriverDemo/hvigorfile.ts deleted file mode 100644 index 47113e2e36ecefde41c136272a0bd6ff745cffe4..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/oh-package-lock.json5 b/DriverDevelopmentKit/DriverDemo/oh-package-lock.json5 deleted file mode 100644 index 1020c3e205d5185ca5e0e62036d0c4bca2527cb1..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.24": "@ohos/hypium@1.0.24" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.24": { - "name": "", - "version": "1.0.24", - "integrity": "sha512-3dCqc+BAR5LqEGG2Vtzi8O3r7ci/3fYU+FWjwvUobbfko7DUnXGOccaror0yYuUhJfXzFK0aZNMGSnXaTwEnbw==", - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.24.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/DriverDemo/oh-package.json5 b/DriverDevelopmentKit/DriverDemo/oh-package.json5 deleted file mode 100644 index c72aa05d549507e5ea6ce0bc0a8080c450508c7d..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/DriverDemo/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "modelVersion": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/DriverDevelopmentKit/DriverDemo/screenshots/click_main.png b/DriverDevelopmentKit/DriverDemo/screenshots/click_main.png deleted file mode 100644 index 88fe1bf4d2b7a0cd3843526a49ef5b06ee472b8a..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/DriverDemo/screenshots/click_main.png and /dev/null differ diff --git a/DriverDevelopmentKit/DriverDemo/screenshots/main.png b/DriverDevelopmentKit/DriverDemo/screenshots/main.png deleted file mode 100644 index 6c65e0db9c4753f6fef24bed6acaa4fb80de0728..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/DriverDemo/screenshots/main.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/.gitignore b/DriverDevelopmentKit/HidDriverDemo/.gitignore deleted file mode 100644 index 8aa0419d18a172c1c7b91aa32994a07dc8eeb5a8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -**/oh-package-lock.json5 -/sign \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/AppScope/app.json5 b/DriverDevelopmentKit/HidDriverDemo/AppScope/app.json5 deleted file mode 100644 index 85fa172dd84d5baf96c62b7c39000227ab7ade70..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.keyboard_demo", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/DriverDevelopmentKit/HidDriverDemo/AppScope/resources/base/element/string.json b/DriverDevelopmentKit/HidDriverDemo/AppScope/resources/base/element/string.json deleted file mode 100644 index 802e2f0245eada8a7229a3392d60eb1424eef8dc..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "HidDriverDemo" - } - ] -} diff --git a/DriverDevelopmentKit/HidDriverDemo/AppScope/resources/base/media/app_icon.png b/DriverDevelopmentKit/HidDriverDemo/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/README_zh.md b/DriverDevelopmentKit/HidDriverDemo/README_zh.md deleted file mode 100644 index 154c4ee64cc64f35f4bf084c8df752ef922b5d31..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/README_zh.md +++ /dev/null @@ -1,90 +0,0 @@ -# 驱动开发服务 - -### 介绍 - -本示例主要展示了通过DriverDevelopmentKit开发套件中HID DDK开发输入类设备驱动应用,使用[@ohos.driver.deviceManager](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-driver-deviceManager.md) 、[@ohos.app.ability.DriverExtensionAbility](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-app-ability-driverExtensionAbility.md) 、[@ohos.rpc](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ipc-kit/js-apis-rpc.md)、[HID DDK](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/capi-hid-ddk-api-h.md) -等接口,实现了整个输入类设备驱动功能,包括输入类设备UI参数设置界面及驱动服务端。其中UI参数界面包括输入报告,输出报告,特性报告,关于界面,驱动服务端通过客户端绑定拉起,驱动服务端主要给UI界面提供接口及与物理设备通信; - -### 效果预览 - -| 主页(输入报告) | 输出 | 特性 | 关于 | -|--------------------------------|----------------------------------|-----------------------------------|---------------------------------| -| ![image](screenshots/main.png) | ![image](screenshots/output.png) | ![image](screenshots/feature.png) | ![image](screenshots/about.png) | - -使用说明 - -1. 安装该示例应用后,当目标设备插入时,扩展外设驱动服务SA会拉起DriverExtensionAbility相关进程(即:驱动服务端) -2. 在主界面绘制完成后,会调用deviceManager的绑定接口,绑定驱动服务端,成功后主界面会显示“设备已连接”; -3. 主界面根据键盘常用输入功能设置了一些参数,用户可以根据HID协议填充参数,完成跟物理设备进行输入报告通信; -4. 输出界面根据键盘常用输出功能设置了一些参数,用户可以根据HID协议填充参数,完成跟物理设备进行输出报告通信; -5. 特性界面根据键盘特性功能设置了一些参数,用户可以根据HID协议填充参数,完成跟物理设备进行特性报告通信; -6. 关于界面,可以读取物理设备RawName、RawInfo等信息。 -7. 退出按钮,退出驱动界面。 - -### 工程目录 - -给出项目中关键的目录结构并描述它们的作用,示例如下: - -``` -entry/src/main/ets -|---components -| |---AttributesComponent.ets //“关于”部件页面构造 -| |---FeatureComponent.ets //“特性”部件页面构造 -| |---InputComponent.ets //“输入”部件页面构造 -| |---OutputComponent.ets //“输出”部件页面构造 -|---DriverAbility -| |---driver.ts //主要重载了继承驱动扩展能力DriverExtensionAbility,Onit初始化USB接口等 -|---entryability -| |---EntryAbility.ets //界面ability -|---pages -| |---Index.ets //应用首页 -|---tool -| |---GlobalContext.ets //用于上下文存储单例对象工具 -| |---RpcTool.ets //主要封装了扩展外设相关接口,实现相关功能,如:查询设备,绑定设备,连接远程对象等 -|---utils -| |---Params.ets //输入输出报告信息结构 -| |---RequestCode.ets //请求码 -entry/src/main/cpp -|---types -| |---libentry //创建native c++工程,自动生成的文件目录 -|---data_parser.cpp //主要封装了从输入类设备读取到数据与系统数据转换等功能 -|---data_parser.h //申明数据转换类接口 -|---hello.cpp //主要封装了输入类驱动相关接口,实现相关功能,如:发送report等功能 -|---key_code.h //驱动所使用的键值定义 -``` - -### 具体实现 - -* 驱动UI界面,功能包括查询设备列表、绑定设备驱动服务端、与设备驱动服务端通信,源码参考:[Index.ets](code/DocsSample/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/pages/Index.ets) - * 使用deviceManager.queryDevices来获取设备列表; - * 通过deviceManager.bindDeviceDriver来绑定设备驱动服务端,通过返回值拿到驱动服务端实例; - * 通过服务端实例调用sendMessageRequest与设备驱动服务端通信,并获取到服务端回应,将回应数据打印到主界面; - -* 驱动服务端,与驱动UI界面通信,源码参考:[driver.ts](code/DocsSample/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/driverability/driver.ts) - * 当物理设备插入后,UI界面通过bindDeviceDriver接口获取到驱动服务端实例,再通过服务端实例与服务端通信; - * 驱动服务拉起后,会调用DriverExtAbility中onInit方法,可以在此方法中通过Napi接口调用CAPI,初始化USB DDK等 - * 驱动UI界面通过deviceManager调用绑定接口,会调用DriverExtAbility中onConnect返回服务端实例 - * 驱动UI界面通过服务端实例与服务端通信,服务端通过Napi接口调用CAPI,与物理设备通信 - -### 相关权限 - -[ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md) -[ohos.permission.ACCESS_DDK_HID](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/restricted-permissions.md) - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568; -2. 本示例为Stage模型,仅支持API18版本SDK,SDK版本号(API Version 18),镜像版本号(5.1Release) -3. 本示例需要使用DevEco Studio 版本号(6.0Release)版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/DriverDevelopmentKit > .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/DriverDevelopmentKit/HidDriverDemo/build-profile.json5 b/DriverDevelopmentKit/HidDriverDemo/build-profile.json5 deleted file mode 100644 index 9daac2c8f9e75b9f6736c215843c3648121eb453..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/code-linter.json5 b/DriverDevelopmentKit/HidDriverDemo/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/.gitignore b/DriverDevelopmentKit/HidDriverDemo/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/build-profile.json5 b/DriverDevelopmentKit/HidDriverDemo/entry/build-profile.json5 deleted file mode 100644 index 2d8b081b615348a99aa197f90186f3d8891b7dc1..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a", - "x86_64" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/hvigorfile.ts b/DriverDevelopmentKit/HidDriverDemo/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/HidDriverDemo/entry/obfuscation-rules.txt b/DriverDevelopmentKit/HidDriverDemo/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/DriverDevelopmentKit/HidDriverDemo/entry/oh-package.json5 b/DriverDevelopmentKit/HidDriverDemo/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/CMakeLists.txt b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index ae8941ad2427425f0fa0fb5d244abe7333448f59..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.4.1) -project(hid_demo) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -set(CMAKE_CXX_STANDARD 17) -set(LIB_DIR ${NATIVERENDER_ROOT_PATH}/../../../libs/) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include - ${LIB_DIR}/include) - -#add_library(libparse_point SHARED parse_point_info.cpp) -#add_library(libparse_point SHARED IMPORTED) -#set_target_properties(libparse_point PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/${OHOS_ARCH}/libparse_point.so) - -add_library(entry SHARED hello.cpp data_parser.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libhid.z.so libhilog_ndk.z.so -lpthread) \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/data_parser.cpp b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/data_parser.cpp deleted file mode 100644 index a7027511cce2961541425129dec69fe4cdac13b3..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/data_parser.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "data_parser.h" -#include -#include -#include - -#define LOG_TAG "hidTag [NATIVE]" - -const int NUM_TWO = 2; -const int NUM_FOUR = 4; -const int NUM_SIX = 6; -const int NUM_SIXTY_FOUR = 64; - -DataParser &DataParser::GetInstance() -{ - static DataParser parser; - return parser; -} - -uint32_t DataParser::StartWork() -{ - // [Start driver_hid_report_step1] - // 初始化HID DDK - int32_t ret = OH_Hid_Init(); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_Init() return failed: %{public}d", ret); - return ret; - } - // [End driver_hid_report_step1] - - // [Start driver_hid_report_step2] - uint32_t bInterfaceNum1 = 0x00; - // 打开deviceId和interfaceIndex1指定的HID设备(一般为/dev/hidraw0设备文件) - ret = OH_Hid_Open(deviceID_, bInterfaceNum1, &hid_); - if (ret != 0) { - OH_LOG_ERROR(LOG_APP, "Failed to open hid device, interface number:%{public}u ret:%{public}d", - bInterfaceNum1, ret); - return ret; - } - uint32_t bInterfaceNum2 = 0x01; - // 打开deviceId和interfaceIndex2指定的HID设备(一般为/dev/hidraw1设备文件) - ret = OH_Hid_Open(deviceID_, bInterfaceNum2, &hid2_); - if (ret != 0) { - OH_LOG_ERROR(LOG_APP, "Failed to open hid device, interface number:%{public}u ret:%{public}d", - bInterfaceNum2, ret); - return ret; - } - // [End driver_hid_report_step2] - - Init(); - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s hid device initialized successfully", FILE_NAME, __LINE__, - __func__); - return ret; -} - -bool DataParser::CheckIfZeroArray(const uint8_t *buff, uint32_t length) -{ - uint8_t zeroBuff[READ_INPUT_ARRAY_LEN] = {0x00}; - for (int i = 0; i < length; i++) { - if (zeroBuff[i] != buff[i]) { - return false; - } - } - - return true; -} - -KeysState DataParser::ParseKeys(const uint8_t *buff, uint32_t length, bool bRead) -{ - // 检查输入是否有效 - if (buff == nullptr || length == 0) { - OH_LOG_ERROR(LOG_APP, "buff is null or length is invalid"); - exit(0); - } - - char hexFormat[NUM_SIXTY_FOUR]; - int32_t num = 0; - for (int i = 0; i < length; i++) { - num += sprintf(hexFormat + num, "%02X ", buff[i]); - } - - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s %{public}s", FILE_NAME, __LINE__, __func__, hexFormat); - - int baseIndex = 0; - if (!bRead) { - baseIndex = 1; - } - - KeysState result = { 0x00 }; - for (int i = 0; i < sizeof(result.states) / sizeof(result.states[0]); i++) { - if (buff[baseIndex] & (1 << i)) { - result.states[i] = true; - } else { - result.states[i] = false; - } - } - - uint8_t code = 0; - bool bNotFirst = false; - bool bHasValidData = false; - for (int i = 0; i < NUM_SIX; i++) { - code = buff[i + NUM_TWO + baseIndex]; - if (code >= NUM_FOUR && code <= 0x65 && code != 0x32 && code != 0x64) { - if (bNotFirst) { - result.keys.append(" "); - } - result.keys.append(inputContentMap[code]); - bHasValidData = true; - } - bNotFirst = true; - } - - if (!bHasValidData) { - result.keys.append("未输入有效数据"); - } - - return result; -} - -void DataParser::UpdateKeyCodeMap(uint64_t deviceID) -{ - deviceID_ = deviceID; -} - -void DataParser::UpdateHid(Hid_DeviceHandle *hid) -{ - hid_ = hid; -} - -void DataParser::UpdateHid2(Hid_DeviceHandle *hid2) -{ - hid2_ = hid2; -} - -Hid_DeviceHandle *DataParser::getHidObject() -{ - return hid_; -} - -Hid_DeviceHandle *DataParser::getHid2Object() -{ - return hid2_; -} - -void DataParser::Init() -{ - inputContentMap.clear(); - - InitLetter(); - InitSpecialChar(); - - vector> vec = { - {0x53, "NumLockSmallKeyboard"}, - {0x54, "/SmallKeyboard"}, - {0x55, "*SmallKeyboard"}, - {0x56, "-SmallKeyboard"}, - {0x57, "+SmallKeyboard"}, - {0x58, "回车SmallKeyboard"}, - {0x59, "1SmallKeyboard"}, - {0x5a, "2SmallKeyboard"}, - {0x5b, "3SmallKeyboard"}, - {0x5c, "4SmallKeyboard"}, - {0x5d, "5SmallKeyboard"}, - {0x5e, "6SmallKeyboard"}, - {0x5f, "7SmallKeyboard"}, - {0x60, "8SmallKeyboard"}, - {0x61, "9SmallKeyboard"}, - {0x62, "0SmallKeyboard"}, - {0x63, ".SmallKeyboard"}, - {0x65, "目字键"}, - }; - inputContentMap.insert(vec.begin(), vec.end()); -} - -void DataParser::InitLetter() -{ - vector> vec = { - {4, "a"}, - {5, "b"}, - {6, "c"}, - {7, "d"}, - {8, "e"}, - {9, "f"}, - {0xa, "g"}, - {0xb, "h"}, - {0xc, "i"}, - {0xd, "j"}, - {0xe, "k"}, - {0xf, "l"}, - {0x10, "m"}, - {0x11, "n"}, - {0x12, "o"}, - {0x13, "p"}, - {0x14, "q"}, - {0x15, "r"}, - {0x16, "s"}, - {0x17, "t"}, - {0x18, "u"}, - {0x19, "v"}, - {0x1a, "w"}, - {0x1b, "x"}, - {0x1c, "y"}, - {0x1d, "z"}, - {0x1e, "1"}, - {0x1f, "2"}, - {0x20, "3"}, - {0x21, "4"}, - {0x22, "5"}, - {0x23, "6"}, - {0x24, "7"}, - {0x25, "8"}, - {0x26, "9"}, - {0x27, "0"}, - }; - inputContentMap.insert(vec.begin(), vec.end()); -} - -void DataParser::InitSpecialChar() -{ - vector> vec = { - {0x28, "回车"}, - {0x29, "Esc"}, - {0x2a, "BackSpace"}, - {0x2b, "Tab"}, - {0x2c, "空格"}, - {0x2d, "-"}, - {0x2e, "="}, - {0x2f, "["}, - {0x30, "]"}, - {0x31, "\\"}, - {0x33, ";"}, - {0x34, "''"}, - {0x35, "``"}, - {0x36, ","}, - {0x37, "."}, - {0x38, "/"}, - {0x39, "CapsLock"}, - {0x3a, "F1"}, - {0x3b, "F2"}, - {0x3c, "F3"}, - {0x3d, "F4"}, - {0x3e, "F5"}, - {0x3f, "F6"}, - {0x40, "F7"}, - {0x41, "F8"}, - {0x42, "F9"}, - {0x43, "F10"}, - {0x44, "F11"}, - {0x45, "F12"}, - {0x46, "PrintScreen"}, - {0x47, "ScrollLock"}, - {0x48, "PauseBreak"}, - {0x49, "Insert"}, - {0x4a, "Home"}, - {0x4b, "PageUp"}, - {0x4c, "Delete"}, - {0x4d, "End"}, - {0x4e, "PageDown"}, - {0x4f, "Right"}, - {0x50, "Left"}, - {0x51, "Down"}, - {0x52, "Up"}, - }; - inputContentMap.insert(vec.begin(), vec.end()); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/data_parser.h b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/data_parser.h deleted file mode 100644 index ac5790afb93263ee02f7665ced25cbf707816861..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/data_parser.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef DATA_PARSER_H -#define DATA_PARSER_H - -#include -#include - -#include -#include -#include -#include - -using namespace std; -namespace fs = std::filesystem; - -#define FILE_NAME fs::path(__FILE__).filename().string().c_str() -#define READ_INPUT_ARRAY_LEN 9 - -struct KeysState { - bool states[8]; - string keys; -}; - -struct KeysSetting { - std::map led; -}; - -class DataParser { - public: - DataParser() = default; - - virtual ~DataParser() = default; - - static DataParser &GetInstance(); - - bool CheckIfZeroArray(const uint8_t *buff, uint32_t length); - - virtual KeysState ParseKeys(const uint8_t *buffer, uint32_t length, bool bRead); - - void Init(); - - void UpdateKeyCodeMap(uint64_t deviceID); - void UpdateHid(Hid_DeviceHandle *hid); - void UpdateHid2(Hid_DeviceHandle *hid2); - - uint32_t StartWork(); - - Hid_DeviceHandle *getHidObject(); - Hid_DeviceHandle *getHid2Object(); - - private: - uint64_t deviceID_; - Hid_DeviceHandle *hid_; - Hid_DeviceHandle *hid2_; - unordered_map inputContentMap; - - void InitLetter(); - void InitSpecialChar(); -}; - -#endif // DATA_PARSER_H diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/hello.cpp b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/hello.cpp deleted file mode 100644 index ecd9a60bfee3c6b2c5be9dc9ce84461d6f2f1535..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/hello.cpp +++ /dev/null @@ -1,684 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include "hilog/log.h" -#include "data_parser.h" -#include -#include // for strtol -#include -#include // for LONG_MIN, LONG_MAX -#include // for isspace -#include -#include -#include -#include -#include - -#define LOG_TAG "hidTag [NATIVE]" - -const int NUM_TWO = 2; -const int NUM_FOUR = 4; -const int NUM_EIGHT = 8; -const int NUM_NINE = 9; -const int NUM_SIXTEEN = 16; -const int NUM_THIRTY_TWO = 32; -const int NUM_SIXTY_FOUR = 64; -const int HEX_FORMAT_SIZE = 256; -const int DATA_BUFF_SIZE = 1024; -const int DATA_BUFF_SIZE1 = 4096; -const int CONST_TIMEOUT = 5000; - -static napi_value HidInit(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - size_t argc = 1; - napi_status status; - napi_value args[1]; - status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s argc:%{public}zu", FILE_NAME, __LINE__, __func__, argc); - if (status != napi_ok || argc != 1) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - - uint32_t deviceId = 0; - status = napi_get_value_uint32(env, args[0], &deviceId); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, nullptr, "Failed to get uint32 value"); - return nullptr; - } - - uint32_t busNum = ((deviceId & 0xFFFF0000) >> NUM_SIXTEEN); - uint32_t deviceNum = deviceId & 0xFFFF; - - DataParser::GetInstance().UpdateKeyCodeMap((static_cast(busNum) << NUM_THIRTY_TWO) | deviceNum); - - uint32_t ret = DataParser::GetInstance().StartWork(); - - napi_value result = nullptr; - napi_create_uint32(env, ret, &result); - return result; -} - -static napi_value GetRawInfo(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - - // [Start driver_hid_report_step5_1] - Hid_RawDevInfo rawDevInfo; - int32_t ret = OH_Hid_GetRawInfo(DataParser::GetInstance().getHidObject(), &rawDevInfo); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_GetRawInfo failed, ret:%{public}d", ret); - return nullptr; - } - // [End driver_hid_report_step5_1] - - char hexFormat[HEX_FORMAT_SIZE]; - sprintf(hexFormat, "busType:%02X vendor:%04X product:%04X", rawDevInfo.busType, - rawDevInfo.vendor, rawDevInfo.product); - - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s %{public}s", FILE_NAME, __LINE__, __func__, hexFormat); - napi_value result = nullptr; - napi_create_string_utf8(env, hexFormat, strlen(hexFormat), &result); - return result; -} - -static napi_value GetRawName(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - - // [Start driver_hid_report_step5_2] - char dataBuff[DATA_BUFF_SIZE]; - int32_t ret = OH_Hid_GetRawName(DataParser::GetInstance().getHidObject(), dataBuff, sizeof(dataBuff)); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_GetRawName failed, ret:%{public}d", ret); - return nullptr; - } - // [End driver_hid_report_step5_2] - - napi_value result = nullptr; - napi_create_string_utf8(env, dataBuff, strlen(dataBuff), &result); - return result; -} - -static napi_value GetPhysicalAddress(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - - // [Start driver_hid_report_step5_3] - char dataBuff[DATA_BUFF_SIZE]; - int32_t ret = OH_Hid_GetPhysicalAddress(DataParser::GetInstance().getHidObject(), dataBuff, sizeof(dataBuff)); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_GetPhysicalAddress failed, ret:%{public}d", ret); - return nullptr; - } - // [End driver_hid_report_step5_3] - - napi_value result = nullptr; - napi_create_string_utf8(env, dataBuff, strlen(dataBuff), &result); - return result; -} - -static napi_value GetRawUniqueId(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - - // [Start driver_hid_report_step5_4] - uint8_t dataBuff[NUM_SIXTY_FOUR]; - int32_t ret = OH_Hid_GetRawUniqueId(DataParser::GetInstance().getHidObject(), dataBuff, sizeof(dataBuff)); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_GetRawUniqueId failed, ret:%{public}d", ret); - return nullptr; - } - // [End driver_hid_report_step5_4] - - char hexFormat[HEX_FORMAT_SIZE]; - int32_t num = 0; - for (int i = 0; i < NUM_SIXTEEN; i++) { - num += sprintf(hexFormat + num, "%02X ", dataBuff[i]); - } - - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s %{public}s", FILE_NAME, __LINE__, __func__, hexFormat); - napi_value result = nullptr; - napi_create_string_utf8(env, hexFormat, strlen(hexFormat), &result); - return result; -} - -static napi_value BuildKeyboardResult(napi_env env, napi_value result, napi_value modifierKeysArray, napi_status status, - KeysState object) -{ - status = napi_set_named_property(env, result, "states", modifierKeysArray); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_set_named_property failed, status: %{public}u", status); - return result; - } - - napi_value regularKey = nullptr; - status = napi_create_string_utf8(env, object.keys.c_str(), NAPI_AUTO_LENGTH, ®ularKey); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_create_string_utf8 failed, status: %{public}u", status); - return result; - } - - status = napi_set_named_property(env, result, "keys", regularKey); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_set_named_property failed, status: %{public}u", status); - } - return result; -} - -static napi_value GetKeyboardState(napi_env env, napi_callback_info info) -{ - // [Start driver_hid_report_step4_3] - uint8_t dataBuff[NUM_NINE] = { 0x00 }; - // 读取输入报告 - int32_t ret = OH_Hid_GetReport(DataParser::GetInstance().getHidObject(), HID_INPUT_REPORT, dataBuff, - sizeof(dataBuff)); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_GetReport failed. ret: %{public}u", ret); - return nullptr; - } - // [End driver_hid_report_step4_3] - - KeysState object = DataParser::GetInstance().ParseKeys(dataBuff, 9, false); - - napi_value result = nullptr; - napi_status status = napi_create_object(env, &result); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_create_object failed, status: %{public}u", status); - return result; - } - - napi_value modifierKeysArray; - size_t modifierKeysLength = sizeof(object.states) / sizeof(object.states[0]); - status = napi_create_array_with_length(env, modifierKeysLength, &modifierKeysArray); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_create_array_with_length failed, status: %{public}u", status); - return result; - } - - for (size_t i = 0; i < modifierKeysLength; i++) { - napi_value element; - status = napi_get_boolean(env, (object.states[i] != 0), &element); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_get_boolean failed, i:%{public}zu status: %{public}u", i, status); - return result; - } - status = napi_set_element(env, modifierKeysArray, i, element); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_set_element failed, i:%{public}zu status: %{public}u", i, status); - return result; - } - } - - return BuildKeyboardResult(env, result, modifierKeysArray, status, object); -} - -static bool SetNonBlock(napi_env env, napi_callback_info info, bool& nonblock) -{ - size_t argc = 1; - napi_value args[1]; - napi_status status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s argc:%{public}zu", FILE_NAME, __LINE__, __func__, argc); - if (status != napi_ok || argc < 1) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return false; - } - - bool nonblockTag; - status = napi_get_value_bool(env, args[0], &nonblockTag); - if (status != napi_ok) { - napi_throw_error(env, nullptr, "Failed to get boolean value"); - return false; - } - - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s nonblockTag:%{public}d", FILE_NAME, __LINE__, __func__, - nonblockTag); - int32_t ret; - if (nonblockTag) { - // [Start driver_hid_report_step4_1] - // nonblock取值:1启用非阻塞,0禁用非阻塞 - ret = OH_Hid_SetNonBlocking(DataParser::GetInstance().getHidObject(), nonblockTag); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_SetNonBlocking failed. ret: %{public}u", ret); - return false; - } - // [End driver_hid_report_step4_1] - } - nonblock = nonblockTag; - return true; -} - -static napi_value BuildReadKeyboardResult(napi_env env, KeysState object) -{ - napi_value result = nullptr; - napi_status status = napi_create_object(env, &result); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_create_object failed, status: %{public}u", status); - return result; - } - - napi_value modifierKeysArray; - size_t modifierKeysLength = sizeof(object.states) / sizeof(object.states[0]); - status = napi_create_array_with_length(env, modifierKeysLength, &modifierKeysArray); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_create_array_with_length failed, status: %{public}u", status); - return result; - } - - for (size_t i = 0; i < modifierKeysLength; i++) { - napi_value element; - status = napi_get_boolean(env, (object.states[i] != 0), &element); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_get_boolean failed, i:%{public}zu status: %{public}u", i, status); - return result; - } - - status = napi_set_element(env, modifierKeysArray, i, element); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_set_element failed, i:%{public}zu status: %{public}u", i, status); - return result; - } - } - - status = napi_set_named_property(env, result, "states", modifierKeysArray); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_set_named_property failed, status: %{public}u", status); - return result; - } - - napi_value regularKey = nullptr; - status = napi_create_string_utf8(env, object.keys.c_str(), NAPI_AUTO_LENGTH, ®ularKey); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_create_string_utf8 failed, status: %{public}u", status); - return result; - } - - status = napi_set_named_property(env, result, "keys", regularKey); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "napi_set_named_property failed, status: %{public}u", status); - } - return result; -} - -static napi_value ReadKeyboardState(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - bool nonblock; - if (!SetNonBlock(env, info, nonblock)) { - return nullptr; - } - - uint8_t dataBuff[READ_INPUT_ARRAY_LEN]; - dataBuff[0] = 0x00; - uint32_t bytesRead = 0; - KeysState object; - int32_t ret; - for (int i = 0; i < NUM_TWO; i++) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_Read. i: %{public}u", i); - memset(dataBuff, 0, sizeof(dataBuff)); - // [Start driver_hid_report_step4_2] - if (nonblock) { - ret = OH_Hid_Read(DataParser::GetInstance().getHidObject(), dataBuff, sizeof(dataBuff), &bytesRead); - } else { - ret = OH_Hid_ReadTimeout(DataParser::GetInstance().getHidObject(), dataBuff, sizeof(dataBuff), - CONST_TIMEOUT, &bytesRead); - } - // [End driver_hid_report_step4_2] - - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_ReadTimeout or OH_Hid_Read failed. ret: %{public}u", ret); - return nullptr; - } - - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s bytesRead:%{public}u", FILE_NAME, __LINE__, __func__, - bytesRead); - if (DataParser::GetInstance().CheckIfZeroArray(dataBuff, READ_INPUT_ARRAY_LEN)) { - OH_LOG_INFO(LOG_APP, "OH_Hid_Read. dataBuff is all zero."); - continue; - } else { - object = DataParser::GetInstance().ParseKeys(dataBuff, NUM_EIGHT, true); - break; - } - } - - return BuildReadKeyboardResult(env, object); -} - -static napi_value ApplyKeyboardSettings(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[NUM_FOUR]; - napi_status status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s argc:%{public}zu", FILE_NAME, __LINE__, __func__, argc); - if (status != napi_ok || argc < 1) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - - bool isArray; - status = napi_is_array(env, args[0], &isArray); - if (status != napi_ok || !isArray) { - OH_LOG_ERROR(LOG_APP, "First argument must be an array"); - return nullptr; - } - - uint32_t length; - status = napi_get_array_length(env, args[0], &length); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "Failed to get array length"); - return nullptr; - } - - uint8_t dataBuff[NUM_TWO] = { 0x00 }; - for (uint32_t i = 0; i < length; ++i) { - napi_value element; - status = napi_get_element(env, args[0], i, &element); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "Failed to get element from array"); - return nullptr; - } - - bool value; - status = napi_get_value_bool(env, element, &value); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "Failed to get boolean value"); - return nullptr; - } - - if (value) { - dataBuff[1] |= 1 << i; - } - } - - OH_LOG_INFO(LOG_APP, "dataBuff[1]:%{public}d", dataBuff[1]); - // [Start driver_hid_report_step3_2] - // 发送输出报告 - int32_t ret = OH_Hid_SendReport(DataParser::GetInstance().getHidObject(), HID_OUTPUT_REPORT, dataBuff, - sizeof(dataBuff)); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_SendReport failed. ret: %{public}u", ret); - } - // [End driver_hid_report_step3_2] - - napi_value result = nullptr; - napi_create_uint32(env, ret, &result); - return result; -} - -static napi_value WriteKeyboardSettings(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - - size_t argc = 1; - napi_value args[NUM_FOUR]; - napi_status status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (status != napi_ok || argc < 1) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - - bool isArray; - status = napi_is_array(env, args[0], &isArray); - if (status != napi_ok || !isArray) { - OH_LOG_ERROR(LOG_APP, "First argument must be an array"); - return nullptr; - } - - uint32_t length; - status = napi_get_array_length(env, args[0], &length); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "Failed to get array length"); - return nullptr; - } - - uint8_t dataBuff[NUM_TWO] = { 0x00 }; - for (uint32_t i = 0; i < length; ++i) { - napi_value element; - status = napi_get_element(env, args[0], i, &element); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "Failed to get element from array"); - return nullptr; - } - - bool value; - status = napi_get_value_bool(env, element, &value); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "Failed to get boolean value"); - return nullptr; - } - - if (value) { - dataBuff[1] |= 1 << i; - } - } - - OH_LOG_INFO(LOG_APP, "dataBuff[1]:%{public}d", dataBuff[1]); - // [Start driver_hid_report_step3_1] - uint32_t bytesWritten; - // 写入报告 - int32_t ret = OH_Hid_Write(DataParser::GetInstance().getHidObject(), dataBuff, sizeof(dataBuff), &bytesWritten); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_Write failed. ret: %{public}u", ret); - } - // [End driver_hid_report_step3_1] - OH_LOG_INFO(LOG_APP, "bytesWritten:%{public}u", bytesWritten); - - napi_value result = nullptr; - napi_create_uint32(env, ret, &result); - return result; -} - -static napi_value GetKeyboardFeatures(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - - // [Start driver_hid_report_step4_4] - uint8_t dataBuff[NUM_EIGHT] = { 0x00 }; - // 指定报告编号 - dataBuff[0] = 0x07; - // 读取特性报告 - int32_t ret = OH_Hid_GetReport(DataParser::GetInstance().getHid2Object(), HID_FEATURE_REPORT, dataBuff, - sizeof(dataBuff)); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_GetReport failed. ret: %{public}u", ret); - return nullptr; - } - // [End driver_hid_report_step4_4] - - char hexFormat[HEX_FORMAT_SIZE]; - int32_t num = 0; - for (int i = 0; i < sizeof(dataBuff) / sizeof(dataBuff[0]); i++) { - num += sprintf(hexFormat + num, "%02X, ", dataBuff[i]); - } - - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s %{public}s", FILE_NAME, __LINE__, __func__, hexFormat); - napi_value result = nullptr; - napi_create_string_utf8(env, hexFormat, strlen(hexFormat), &result); - return result; -} - -void HexStringToUint8Array(const std::string& hexString, uint8_t* dataBuff, size_t bufferSize) -{ - std::stringstream ss(hexString); - std::string item; - size_t index = 0; - - while (std::getline(ss, item, ',') && index < bufferSize) { - // 去除可能的空格和 "0x" 前缀 - item.erase(std::remove_if(item.begin(), item.end(), ::isspace), item.end()); - if (item.substr(0, NUM_TWO) == "0x") { - item = item.substr(NUM_TWO); - } - - unsigned int value; - std::stringstream converter(item); - converter << std::hex << item; // 设置为十六进制模式 - converter >> value; - - if (converter.fail() || converter.bad()) { - OH_LOG_ERROR(LOG_APP, "%{public}s, converter fail or bad.item: %{public}s", __func__, item.c_str()); - } - - dataBuff[index++] = static_cast(value); - } - - // 检查是否所有预期的值都被正确解析 - if (index != bufferSize) { - OH_LOG_ERROR(LOG_APP, "[%{public}s:%{public}d] %{public}s. index:%{public}d Hex string does not contain" - "enough values to fill the buffer.", FILE_NAME, __LINE__, __func__, index); - } -} - -static napi_value ApplyKeyboardFeatures(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - - size_t argc = 1; - napi_status status; - napi_value args[1]; - status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s argc:%{public}zu", FILE_NAME, __LINE__, __func__, argc); - if (status != napi_ok || argc < 1) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - - size_t bytesOut; - char hexFormat[HEX_FORMAT_SIZE]; - status = napi_get_value_string_utf8(env, args[0], hexFormat, sizeof(hexFormat), &bytesOut); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "Failed to get boolean value"); - return nullptr; - } - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s. hextFormat: %{public}s", FILE_NAME, __LINE__, __func__, - hexFormat); - - // [Start driver_hid_report_step3_3] - uint8_t dataBuff[NUM_EIGHT] = { 0x00 }; - string str(hexFormat); - HexStringToUint8Array(str, dataBuff, sizeof(dataBuff)); - // 发送特性报告 - int32_t ret = OH_Hid_SendReport(DataParser::GetInstance().getHid2Object(), HID_FEATURE_REPORT, dataBuff, - sizeof(dataBuff)); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_SendReport failed. ret: %{public}u", ret); - } - // [End driver_hid_report_step3_3] - - napi_value result = nullptr; - napi_create_uint32(env, ret, &result); - return result; -} - -static napi_value GetReportDescriptor(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - - // [Start driver_hid_report_step6] - uint8_t dataBuff[DATA_BUFF_SIZE1]; - uint32_t bytesRead; - int32_t ret = OH_Hid_GetReportDescriptor(DataParser::GetInstance().getHidObject(), dataBuff, sizeof(dataBuff), - &bytesRead); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_GetReportDescriptor failed, ret:%{public}d", ret); - return nullptr; - } - // [End driver_hid_report_step6] - - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s bytesRead:%{public}u", FILE_NAME, __LINE__, __func__, - bytesRead); - char *hexFormat = new char[NUM_FOUR * bytesRead]; - memset(hexFormat, 0x00, NUM_FOUR * bytesRead); - int32_t num = 0; - for (int i = 0; i < bytesRead; i++) { - num += sprintf(hexFormat + num, "%02X ", dataBuff[i]); - } - - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s %{public}s", FILE_NAME, __LINE__, __func__, hexFormat); - napi_value result = nullptr; - napi_create_string_utf8(env, hexFormat, strlen(hexFormat), &result); - delete [] hexFormat; - return result; -} - -static napi_value ReleaseResource(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "[%{public}s:%{public}d] %{public}s enter", FILE_NAME, __LINE__, __func__); - - // [Start driver_hid_report_step7] - Hid_DeviceHandle *hid = DataParser::GetInstance().getHidObject(); - int32_t ret1 = OH_Hid_Close(&hid); - DataParser::GetInstance().UpdateHid(hid); - // [End driver_hid_report_step7] - - Hid_DeviceHandle *hid2 = DataParser::GetInstance().getHid2Object(); - int32_t ret2 = OH_Hid_Close(&hid2); - DataParser::GetInstance().UpdateHid2(hid); - - if (ret1 != HID_DDK_SUCCESS || ret2 != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_Init() return failed: %{public}d, %{public}d", ret1, ret2); - } else { - // [Start driver_hid_report_step8] - ret1 = OH_Hid_Release(); - if (ret1 != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_Init() return failed: %{public}d", ret1); - } - // [End driver_hid_report_step8] - } - - napi_value result = nullptr; - napi_create_uint32(env, ret1, &result); - return result; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - {"hidInit", nullptr, HidInit, nullptr, nullptr, nullptr, napi_default, nullptr }, - {"getRawInfo", nullptr, GetRawInfo, nullptr, nullptr, nullptr, napi_default, nullptr }, - {"getRawName", nullptr, GetRawName, nullptr, nullptr, nullptr, napi_default, nullptr }, - {"getPhysicalAddress", nullptr, GetPhysicalAddress, nullptr, nullptr, nullptr, napi_default, nullptr }, - {"getRawUniqueId", nullptr, GetRawUniqueId, nullptr, nullptr, nullptr, napi_default, nullptr }, - {"getKeyboardState", nullptr, GetKeyboardState, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"readKeyboardState", nullptr, ReadKeyboardState, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"applyKeyboardSettings", nullptr, ApplyKeyboardSettings, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"writeKeyboardSettings", nullptr, WriteKeyboardSettings, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"getKeyboardFeatures", nullptr, GetKeyboardFeatures, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"applyKeyboardFeatures", nullptr, ApplyKeyboardFeatures, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"getReportDescriptor", nullptr, GetReportDescriptor, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"releaseResource", nullptr, ReleaseResource, nullptr, nullptr, nullptr, napi_default, nullptr}, - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 821bbdbe30156de17f6dd10b920d47cef9e68443..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -declare namespace hidNapi { - type keyStates = { - states: boolean[]; - keys: string; - }; - - function hidInit(deviceId: number):number; - function getRawInfo():string; - function getRawName():string; - function getPhysicalAddress():string; - function getRawUniqueId():string; - function getKeyboardState():keyStates; - function readKeyboardState(nonblock: boolean):keyStates; - function applyKeyboardSettings(states: boolean[]):number; - function writeKeyboardSettings(states: boolean[]):number; - function getKeyboardFeatures():string; - function applyKeyboardFeatures(features: string):number; - function getReportDescriptor():string; - function releaseResource():number; -} - -export default hidNapi; \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/DriverAbility/driver.ts b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/DriverAbility/driver.ts deleted file mode 100644 index 5adfe68630923351e3906ea480f9ca2b6fa71885..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/DriverAbility/driver.ts +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -//@ts-nocheck -import { rpc } from '@kit.IPCKit'; -import { DriverExtensionAbility } from '@kit.DriverDevelopmentKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import hidNapi from 'libentry.so'; -import { RequestCode, InputType, OutputType} from '../utils/RequestCode'; - -let deviceId; - -class FirstDriverAbilityStub extends rpc.RemoteObject { - constructor(des) { - if (typeof des === 'string') { - super(des); - } else { - return null; - } - } - onRemoteMessageRequest(code: number, - data: MessageSequence, - reply: MessageSequence, - options: MessageOption - ) { - try{ - switch (code) { - case RequestCode.GetRawInfo: - return reply.writeString(hidNapi.getRawInfo()); - case RequestCode.GetRawName: - return reply.writeString(hidNapi.getRawName()); - case RequestCode.GetPhysicalAddr: - return reply.writeString(hidNapi.getPhysicalAddress()); - case RequestCode.GetRawUniqueId: - return reply.writeString(hidNapi.getRawUniqueId()); - case RequestCode.GetInput: { - let inputType = data.readInt(); - hilog.info(0, 'driverTag', `GetInput prev ${inputType}`); - let result: keyStates; - if (inputType == InputType.ReadBlock) { - result = hidNapi.readKeyboardState(false); - } else if (inputType == InputType.ReadNonBlock) { - result = hidNapi.readKeyboardState(true); - } else { - result = hidNapi.getKeyboardState(); - } - result.states.forEach((state) => { - reply.writeBoolean(state); - }); - return reply.writeString(result.keys); - } - case RequestCode.SetOutput: { - let outputType = data.readInt(); - hilog.info(0, 'driverTag', `SetOutput prev ${outputType}`); - const keysLedStates = Array.from({ length: 4 }, (_, index) => { - return data.readBoolean(); - }); - if (outputType == OutputType.SendReport) { - let result = hidNapi.applyKeyboardSettings(keysLedStates); - hilog.info(0, 'driverTag', `applyKeyboardSettings result:${result}`); - } else { - let result = hidNapi.writeKeyboardSettings(keysLedStates); - hilog.info(0, 'driverTag', `writeKeyboardSettings result:${result}`); - } - return true; - } - case RequestCode.GetFeature: - return reply.writeString(hidNapi.getKeyboardFeatures()); - case RequestCode.SetFeature: - let result = hidNapi.applyKeyboardFeatures(data.readString()); - hilog.info(0, 'driverTag', `applyKeyboardFeatures result:${result}`); - return true; - case RequestCode.GetDescriptor: - return reply.writeString(hidNapi.getReportDescriptor()); - default: - return true; - } - } catch (error) { - hilog.info(0, 'driverTag', `onRemoteMessageRequest exception ${error}`); - } - } - - sendDisconnect() { - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - hilog.info(0, 'driverTag', `sendDisconnect`); - sendMessageRequest(0x99, dataSend, reply, option).then((ret) => { - let msg = reply.readInt(); - reply.writeInt(msg); - hilog.info(0, 'driverTag', `sendDisconnect sendMessageRequest ret:${ret} msg:${msg}`); - }).catch((error) => { - hilog.info(0, 'driverTag', `sendDisconnect sendMessageRequest failed:${error}`); - }); - } -} - -export default class DriverExtAbility extends DriverExtensionAbility { - async onInit(want): void { - hilog.info(0, 'driverTag','DriverAbility OnInit'); - hilog.info(0, 'driverTag','OnInit deviceId '+ want.parameters['deviceId']); - deviceId = want.parameters['deviceId']; - hilog.info(0, 'driverTag','before hidInit'); - let result = hidNapi.hidInit(deviceId); - hilog.info(0, 'driverTag',`hidInit result:${result}`); - } - onRelease() :void { - hilog.info(0, 'driverTag', 'DriverAbility onRelease'); - // 释放底层资源 - let result = hidNapi.releaseResource(); - hilog.info(0, 'driverTag',`releaseResource result:${result}`); - } - onConnect(want): rpc.RemoteObject { - hilog.info(0, 'driverTag', 'DriverAbility onConnect'); - return new FirstDriverAbilityStub('remote'); - } - onDisconnect(want): void { - hilog.info(0, 'driverTag', 'DriverAbility onDisconnect'); - } - onDump(params): Array { - hilog.info(0, 'driverTag', 'DriverAbility onDump, params:' + JSON.stringify(params)); - return ['params']; - } -}; \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/AttributesComponent.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/AttributesComponent.ets deleted file mode 100644 index 050b4b274bc304442812c00ec9ec7715b2c27270..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/AttributesComponent.ets +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2025 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 RpcTool from '../tool/RpcTool'; -import { RequestCode } from '../utils/RequestCode'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -@Component -//@Preview -export struct AttributesComponent { - @Link rawName: string; - @Link rawUniqueId: string; - @Link physicalAddress: string; - @Link rawInfo: string; - @Link descriptor: string; - controller: TextAreaController = new TextAreaController(); - - @Styles normalStyle() { - .backgroundColor(Color.Blue) - } - - @Styles pressedStyle() { - .backgroundColor(Color.White) - } - - build() { - Column({space: 30}) { - Row() { - Text('Raw name:') - .padding({left:10}) - .fontSize(18) - Text(this.rawName) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 33}) - .height('6%') - .fontSize(17) - Button($r('app.string.get_str')) - .margin({left: 10}) - .onClick(()=>{ - RpcTool.getInstance().testGetInferface(RpcTool.getInstance().deviceId, RequestCode.GetRawName); - hilog.info(0, 'testTag ui', ` rawName: ${this.rawName}`); - }) - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - }) - } - .width('100%') - .margin({left:35}) - - Row() { - Text('Raw Info:') - .padding({left:10}) - .fontSize(18) - Text(this.rawInfo) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 47}) - .height('6%') - .fontSize(17) - Button($r('app.string.get_str')) - .margin({left: 10}) - .onClick(()=>{ - RpcTool.getInstance().testGetInferface(RpcTool.getInstance().deviceId, RequestCode.GetRawInfo); - }) - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - }) - } - .width('100%') - .margin({left:35}) - Row() { - Text('Raw unique id:') - .padding({left:10}) - .fontSize(18) - Text(this.rawUniqueId) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 1}) - .height('6%') - .fontSize(17) - Button($r('app.string.get_str')) - .margin({left: 10}) - .onClick(()=>{ - RpcTool.getInstance().testGetInferface(RpcTool.getInstance().deviceId, RequestCode.GetRawUniqueId); - hilog.info(0, 'testTag ui', ` rawUniqueId: ${this.rawUniqueId}`); - }) - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - }) - } - .width('100%') - .margin({left:35}) - - Row() { - Text('Physical addr:') - .padding({left:10}) - .fontSize(18) - Text(this.physicalAddress) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 10}) - .height('6%') - .fontSize(17) - Button($r('app.string.get_str')) - .margin({left: 10}) - .onClick(()=>{ - RpcTool.getInstance().testGetInferface(RpcTool.getInstance().deviceId, RequestCode.GetPhysicalAddr); - hilog.info(0, 'testTag ui', ` physicalAddress: ${this.physicalAddress}`); - }) - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - }) - } - .width('100%') - .margin({left:35}) - - Row() { - Text('descriptor:') - .padding({left:10}) - .fontSize(18) - TextArea({text: this.descriptor, placeholder: '', controller: this.controller}) - .placeholderFont({ size: 16, weight: 400 }) - .margin({left:35}) - .width('40%') - .height('45%') - .fontSize(17) - .fontColor(Color.Black) - .enabled(false) - .backgroundColor('#0C182431') - .borderStyle(BorderStyle.Solid).borderWidth(1).borderColor('#FF007DFF') - .onChange((value: string) => { - }) - Button($r('app.string.get_str')) - .margin({left: 10}) - .onClick(()=>{ - RpcTool.getInstance().testGetInferface(RpcTool.getInstance().deviceId, RequestCode.GetDescriptor); - hilog.info(0, 'testTag ui', ` physicalAddress: ${this.descriptor}`); - }) - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - }) - } - .width('100%') - .margin({left:35}) - } - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/FeatureComponent.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/FeatureComponent.ets deleted file mode 100644 index 7925378a995bac5c73ef7460281eb59b3b6cf667..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/FeatureComponent.ets +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2025 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 RpcTool from '../tool/RpcTool'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const TURN_ON_LIGHT:string = '07,ff,ff,00,0d,00,00,00'; -const TURN_OFF_LIGHT:string = '07,ff,ff,00,00,00,00,00'; - -@Component -export struct FeatureComponent{ - @Link featureData: string; - @State setData: string = ''; - controller: TextAreaController = new TextAreaController(); - - @Styles normalStyle() { - .backgroundColor(Color.Blue) - } - - @Styles pressedStyle() { - .backgroundColor(Color.White) - } - - build() { - Column({space: 60}) { - Column({space: 20}) { - Row() { - Button($r('app.string.get_str')) - .fontSize(18) - .height(30) - .width(70) - .margin({left:20,top:5}) - .onClick(() => { - RpcTool.getInstance().getFeature(); - }) - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - }) - } - .width('100%') - .margin({left:30}) - - Column({space: 0}) { - Text($r('app.string.get_str')) - .padding({left: 10}) - .fontSize(16) - .width('20%') - TextArea({text: this.featureData, placeholder: '此处用于显示获取的特性数据', controller: this.controller}) - .placeholderFont({ size: 16, weight: 400 }) - .margin({left:10}) - .width('83%') - .height('20%') - .fontSize(18) - .fontColor('#182431') - .enabled(false) - .backgroundColor('#0C182431') - .borderStyle(BorderStyle.Solid).borderWidth(1).borderColor('#FF007DFF') - .onChange((value: string) => { - hilog.info(0, 'testTag ui', 'feature value:' + this.featureData); - this.featureData = value; - }) - } - .width('100%') - .margin({left:35}) - .alignItems(HorizontalAlign.Start) - } - .width('100%') - - Row() { - Text($r('app.string.set_led')) - .padding({left:10}) - .fontSize(18) - Toggle({ type: ToggleType.Switch, isOn: false }) - .margin({left:21}) - .onChange((value)=>{ - if (value) { - this.setData = TURN_ON_LIGHT; - } else { - this.setData = TURN_OFF_LIGHT; - } - - RpcTool.getInstance().setFeature(this.setData); - }) - } - .width('100%') - .margin({left:35}) - - }.margin({bottom: 100}) - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/InputComponent.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/InputComponent.ets deleted file mode 100644 index f249c1a485d66a991cf66be539dde7d5ae497761..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/InputComponent.ets +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025 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 RpcTool from '../tool/RpcTool'; -import { InputParams } from '../utils/Params'; -import { InputType } from '../utils/RequestCode'; - -@Component -export struct InputComponent{ - @Link inputParams: InputParams; - @State inputType: InputType = InputType.GetReport; - @State tipStr: string = '请按下键盘按键的同时点击获取按钮'; - controller: TextAreaController = new TextAreaController(); - - @Styles normalStyle() { - .backgroundColor(Color.Blue) - } - - @Styles pressedStyle() { - .backgroundColor(Color.White) - } - - @Styles disableStyle() { - .backgroundColor(Color.Gray) - } - - build() { - Column({space: 30}) { - Row() { - Row({space: 20}) { - Column() { - Text('GetReport') - Radio({ value: 'GetReport', group: 'radioGroup', indicatorType:RadioIndicatorType.TICK }).checked(true) - .height(30) - .width(30) - .onChange((isChecked: boolean) => { - this.inputType = InputType.GetReport; - this.tipStr = '请按下键盘按键的同时点击获取按钮'; - }) - } - - Column() { - Text($r('app.string.read_block')) - Radio({ value: 'Read(阻塞)', group: 'radioGroup', indicatorType:RadioIndicatorType.TICK }).checked(false) - .height(30) - .width(30) - .onChange((isChecked: boolean) => { - this.inputType = InputType.ReadBlock; - this.tipStr = '点击获取按钮按钮灰化后,点击键盘按键即可,只按一个按键'; - }) - } - Column() { - Text($r('app.string.read_nonblock')) - Radio({ value: 'Read(非阻塞)', group: 'radioGroup', indicatorType:RadioIndicatorType.TICK }).checked(false) - .height(30) - .width(30) - .onChange((isChecked: boolean) => { - this.inputType = InputType.ReadNonBlock; - this.tipStr = '先点击键盘按键再点击获取按钮,只按一个按键'; - }) - } - } - - Button($r('app.string.get_str')) - .fontSize(15) - .height(30) - .width(70) - .margin({left:80,top:5}) - .enabled(this.inputParams.freshUI) - .onClick(() => { - this.inputParams.freshUI = false; - RpcTool.getInstance().getInput(RpcTool.getInstance().deviceId, this.inputType); - }) - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - disabled: this.disableStyle, - }) - } - - - Row() { - Text('Left Ctrl:') - .padding({left:10}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: this.inputParams.stateOfE0 }) - .margin({left:13}) - .enabled(false) - .backgroundColor('#0c3d6086') - Text('Left Shift:') - .padding({left:100}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: this.inputParams.stateOfE1 }) - .margin({left:11}) - .enabled(false) - .backgroundColor('#0c3d6086') - }.width('100%') - .margin({left:35}) - - Row() { - Text('Left Alt:') - .padding({left:10}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: this.inputParams.stateOfE2 }) - .margin({left:21}) - .enabled(false) - .backgroundColor('#0c3d6086') - Text('Left Win:') - .padding({left:100}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: this.inputParams.stateOfE3 }) - .margin({left:19}) - .enabled(false) - .backgroundColor('#0c3d6086') - }.width('100%') - .margin({left:35}) - - Row() { - Text('Right Ctrl:') - .padding({left:10}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: this.inputParams.stateOfE7 }) - .margin({left:5}) - .enabled(false) - .backgroundColor('#0c3d6086') - Text('Right shift:') - .padding({left:97}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: this.inputParams.stateOfE4 }) - .margin({left:3}) - .enabled(false) - .backgroundColor('#0c3d6086') - }.width('100%') - .margin({left:30}) - - Row() { - Text('Right Alt:') - .padding({left:10}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: this.inputParams.stateOfE5 }) - .margin({left:10}) - .enabled(false) - .backgroundColor('#0c3d6086') - Text('Right Win:') - .padding({left:97}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: this.inputParams.stateOfE6 }) - .margin({left:9}) - .enabled(false) - .backgroundColor('#0c3d6086') - }.width('100%') - .margin({left:35}) - - Column({space: 0}) { - Text('数据') - .padding({left: 10}) - .fontSize(18) - .width('20%') - TextArea({text: this.inputParams.data, placeholder: this.tipStr, controller: this.controller}) - .placeholderFont({ size: 16, weight: 400 }) - .margin({left:10}) - .width('83%') - .height('20%') - .fontSize(21) - .fontColor('#182431') - .enabled(false) - .backgroundColor('#0C182431') - .borderStyle(BorderStyle.Solid).borderWidth(1).borderColor('#FF007DFF') - .onChange((value: string) => { - }) - } - .width('100%') - .margin({left:35}) - .alignItems(HorizontalAlign.Start) - } - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/OutputComponent.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/OutputComponent.ets deleted file mode 100644 index 076e2605128f13030e600c07b1c4469aa337f6cd..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/components/OutputComponent.ets +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2025 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 RpcTool from '../tool/RpcTool'; -import { OutputParams } from '../utils/Params'; -import { OutputType } from '../utils/RequestCode'; - - -@Component -//@Preview -export struct OutputComponent{ - @State outparams: OutputParams = new OutputParams(); - @State outputType: OutputType = OutputType.SendReport; - - @Styles normalStyle() { - .backgroundColor(Color.Blue) - } - - @Styles pressedStyle() { - .backgroundColor(Color.White) - } - - build() { - Column({space: 30}) { - Row() { - Row({space: 20}) { - Column() { - Text('SendReport') - Radio({ value: 'SendReport', group: 'outradioGroup', indicatorType:RadioIndicatorType.TICK }).checked(true) - .height(30) - .width(30) - .onChange((isChecked: boolean) => { - this.outputType = OutputType.SendReport; - }) - } - - Column() { - Text('Write') - Radio({ value: 'Write', group: 'outradioGroup', indicatorType:RadioIndicatorType.TICK }).checked(false) - .height(30) - .width(30) - .onChange((isChecked: boolean) => { - this.outputType = OutputType.Write; - }) - } - } - - Button($r('app.string.str_set')) - .fontSize(15) - .height(30) - .width(70) - .margin({left:150,top:5}) - .onClick(() => { - RpcTool.getInstance().setOutput(this.outputType, this.outparams); - }) - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - }) - } - .width('100%') - .margin({left: 50}) - - Row() { - Text('Num Lock:') - .padding({left:10}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: false }) - .margin({left:9}) - .onChange((value) => { - this.outparams.numLock = value; - }) - }.width('100%') - .margin({left:35}) - - Row() { - Text('Caps Lock:') - .padding({left:10}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: false }) - .margin({left:9}) - .onChange((value) => { - this.outparams.capsLock = value; - }) - }.width('100%') - .margin({left:30}) - - Row() { - Text('Scroll Lock:') - .padding({left:10}) - .fontSize(20) - Toggle({ type: ToggleType.Switch, isOn: false }) - .onChange((value) => { - this.outparams.scrollLock = value; - }) - }.width('100%') - .margin({left:35}) - }.margin({bottom: 100}) - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/entryability/EntryAbility.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index c5539bddd7a772710f55da0ddd7b5676305469de..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/pages/Index.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 92f46c98dd6212ad8dc1ab6d38003ae9779e71ad..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) 2025 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 { InputComponent } from '../components/InputComponent'; -import { AttributesComponent } from '../components/AttributesComponent'; -import { common } from '@kit.AbilityKit'; -import RpcTool from '../tool/RpcTool'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { prompt } from '@kit.ArkUI'; -import { OutputComponent } from '../components/OutputComponent'; -import { InputParams } from '../utils/Params'; -import { RequestCode } from '../utils/RequestCode'; -import { FeatureComponent } from '../components/FeatureComponent'; - -const IMAGE_WIDTH_HEIGHT: number = 60; // 图片宽高 -const IMAGE_INTERVAL: number = 20; // 图片与图片间距 -const IMAGE_TEXT_INTERVAL: number = 10; // 图片和文本间距 -const MARGIN_LEFT_RIGHT: number = 20; // 顶部菜单栏与屏幕边缘间隔 -const MARGIN_TOP_BOTTOM: number = 20; // 菜单栏上下间距 - -@Preview -@Entry -@Component -struct Index { - @State vendorId: string = ''; - @State productId: string = ''; - @State description: string = ''; - @State currentIndex: number = 0; - @State connectStatus: boolean = false; - saveMessage : string = `save config success`; - - // 输入页面 - @State inputParams: InputParams = new InputParams(); - - // 特性页面 - @State featureData: string = ''; - - // 关于页面 - @State rawName: string = ''; - @State rawUniqueId: string = ''; - @State physicalAddress: string = ''; - @State rawInfo: string = ''; - @State descriptor: string = ''; - - private topMenu = [ - ['输入', $rawfile('ic_keyboard_set_normal.svg'), $rawfile('ic_keyboard_set_select.svg')], - ['输出', $rawfile('ic_locale_set_normal.svg'), $rawfile('ic_locale_set_select.svg')], - ['特性', $rawfile('ic_locale_set_normal.svg'), $rawfile('ic_locale_set_select.svg')], - ['关于', $rawfile('ic_about_normal.svg'), $rawfile('ic_about_select.svg')] - ]; - private bottomMenu = [['退出', $rawfile('ic_quit_normal.svg'), $rawfile('ic_quit_normal.svg')]]; - private controller: TabsController = new TabsController(); - private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; - - async aboutToAppear() { - RpcTool.getInstance().init(this); - RpcTool.getInstance().bindDevice(); - } - - bindCallback(vendorId: string, productId: string, description: string) { - hilog.info(0, 'testTag ui', `bindCallback vendorId: ${vendorId} productId:${productId}`); - this.vendorId = vendorId; - this.productId = productId; - this.description = description; - if (vendorId.length == 0 || productId.length == 0) { - this.connectStatus = false; - } else { - this.connectStatus = true; - } - } - - updateInputPage(inputParams: InputParams) { - this.inputParams.setValue(inputParams); - } - - updateAttributePage(requestType: RequestCode, data: string) { - switch (requestType) { - case RequestCode.GetRawName: - this.rawName = data; - break; - case RequestCode.GetRawUniqueId: - this.rawUniqueId = data; - break; - case RequestCode.GetPhysicalAddr: - this.physicalAddress = data; - break; - case RequestCode.GetRawInfo: - this.rawInfo = data; - break; - case RequestCode.GetDescriptor: - this.descriptor = data; - break; - default: - break; - } - } - - updateFeaturePage(data: string) { - this.featureData = data; - } - - getSaveMessage() { - if(!this.vendorId || this.vendorId.length == 0) { - return '当前设备未连接'; - } else { - return `save config success`; - } - } - - build() { - Stack() { - Column() { - // 侧边栏 - Row() { - Row() { - ForEach(this.topMenu, (item:string|Resource, index) => { - Column() { - Image((this.currentIndex == index) ? item[2] : item[1]) - .width(IMAGE_WIDTH_HEIGHT) - .height(IMAGE_WIDTH_HEIGHT) - Text(item[0]) - .margin({ top: IMAGE_TEXT_INTERVAL }) - } - .margin({ right: IMAGE_INTERVAL }) - .justifyContent(FlexAlign.Center) - .onClick(() => { - if (item[0] == '保存') { - prompt.showToast({ message: this.getSaveMessage(), bottom: 100, duration: 1800 }); - } else { - this.currentIndex = index; - } - }) - }) - } - .margin({ left: MARGIN_LEFT_RIGHT, bottom: MARGIN_TOP_BOTTOM }) - - Row() { - ForEach(this.bottomMenu, (item:(string|Resource)[], index) => { - Column() { - Image(item[1]) - .width(IMAGE_WIDTH_HEIGHT) - .height(IMAGE_WIDTH_HEIGHT) - Text(item[0]) - .margin({ top: 10 }) - } - .justifyContent(FlexAlign.Center) - .onClick(() => { - if (item[0] === '退出') { - RpcTool.getInstance().unbind(); - this.context.terminateSelf(); - } - }) - }) - } - .margin({ right: MARGIN_LEFT_RIGHT, bottom: MARGIN_TOP_BOTTOM }) - } - .width('100%') - .margin({ top: MARGIN_TOP_BOTTOM }) - .border({ width: { bottom: 0.5 }, color: Color.Gray }) - .justifyContent(FlexAlign.SpaceBetween) - - Stack() { - // 主内容区域 - Row() { - Tabs({ controller: this.controller, index: this.currentIndex }) { - TabContent() { - InputComponent({inputParams: $inputParams}); - } - - TabContent() { - OutputComponent(); - } - - TabContent() { - FeatureComponent({featureData: $featureData}); - } - - TabContent() { - AttributesComponent({rawName: $rawName, rawUniqueId: $rawUniqueId, physicalAddress: $physicalAddress, rawInfo: $rawInfo, descriptor: $descriptor}); - } - } - .barHeight(0) - .height('100%') - .scrollable(false) - } - .layoutWeight(1) - } - .alignContent(Alignment.TopStart) - .layoutWeight(1) - }.width('100%') - .height('100%') - .alignItems(HorizontalAlign.Center) - - Text(this.connectStatus ? $r('app.string.device_connect') : $r('app.string.device_disconnect')) - .fontColor(this.connectStatus ? Color.Black : Color.Red) - .margin({ right: 30, bottom: 20 }) - .fontSize(14) - }.width('100%') - .height('100%') - .alignContent(Alignment.BottomEnd) - } -} - -export {Index} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/tool/GlobalContext.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/tool/GlobalContext.ets deleted file mode 100644 index 505159bfec732caa8abc1e33f6a54c24331cbdb0..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/tool/GlobalContext.ets +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const TAG = 'GlobalContext'; - -export default class GlobalContext { - private constructor() { - } - - private static instance: GlobalContext; - private _objects = new Map(); - private isDebug: boolean = false; - - public static getContext(): GlobalContext { - if (GlobalContext.instance == null){ - GlobalContext.instance = new GlobalContext(); - } - return GlobalContext.instance; - } - - public getObject(key: string): Object | undefined{ - let result = this._objects.get(key); - this.printLog('getObject: ' + key + ' -> ' + (result != null)); - return result; - } - - public hasObject(key: string): boolean { - return this._objects.has(key); - } - - public setObject(key: string, objectClass: Object): void { - this._objects.set(key, objectClass); - this.printLog('setObject: ' + key); - } - - public printLog(message: string): void { - if(!this.isDebug){ - return; - } - console.info(TAG, message); - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/tool/RpcTool.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/tool/RpcTool.ets deleted file mode 100644 index a4b2f39702f488ff790139d6f2a2da23a4babf4e..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/tool/RpcTool.ets +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (c) 2025 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 { rpc } from '@kit.IPCKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { deviceManager } from '@kit.DriverDevelopmentKit'; -import { Index } from '../pages/Index'; -import GlobalContext from './GlobalContext' -import { BusinessError } from '@kit.BasicServicesKit'; -import { InputParams, OutputParams } from '../utils/Params'; -import { RequestCode, InputType, OutputType } from '../utils/RequestCode'; - -const VENDOR_ID: number = 9390; // 24AE -const PRODUCT_ID_LIST = [0xC31C,0x9EF4]; // 这里只配了罗技K120和狼蛛F2088的pid - -export async function sleep(ms: number) { - return new Promise(res => setTimeout(res, ms)); -} - -class MyDeathRecipient { - private rpcTool: RpcTool; - - constructor(rpc: RpcTool) { - this.rpcTool = rpc; - } - - onRemoteDied() { - hilog.info(0, 'testTag ui', 'onRemoteDied'); - this.rpcTool.resetStatus(); - this.rpcTool.bindStateChanged(); - } -} - - -export default class RpcTool { - public deviceId: number = -1; - private vendorId: number = 0; - private productId: number = 0; - private description: string = ''; - private message: string = ''; - private bindState: boolean = false; - private remote: rpc.RemoteObject | null = null; - private isQuerying: boolean = false; - private isBinding: boolean = false; - private indexUI?: Index; - private connectStatusChanged = false; - public static instance: RpcTool; - - public static getInstance(): RpcTool { - if (!GlobalContext.getContext().hasObject('prcToolInstance')) { - GlobalContext.getContext().setObject('prcToolInstance', new RpcTool()); - } - return GlobalContext.getContext().getObject('prcToolInstance') as RpcTool; - } - - public resetStatus(): void { - this.remote = null; - this.bindState = false; - this.isBinding = false; - } - - //查询方法 - private query() { - hilog.info(0, 'testTag ui', 'query enter'); - if (this.isBinding || this.bindState) { - hilog.info(0, 'testTag ui', 'has bind. device id:' + this.deviceId); - return; - } - if (this.deviceId != -1) { - hilog.info(0, 'testTag ui', 'has query. device id:' + this.deviceId); - return; - } - this.isQuerying = true; - try { - let devices: deviceManager.Device[] = deviceManager.queryDevices(deviceManager.BusType.USB); - for (let item of devices) { - let device = item as deviceManager.USBDevice; - hilog.info(0, 'testTag ui', 'querydevice id:' + device.deviceId + ',bustype:' + device.busType + - ',vid:' + device.vendorId + ',pid:' + device.productId + ', des:' + device.description); - let index = PRODUCT_ID_LIST.indexOf(device.productId); - if (index >= 0) { - this.deviceId = device.deviceId; - this.vendorId = device.vendorId; - this.productId = device.productId; - this.description = device.description; - break; - } - } - } catch (error) { - hilog.error(0, 'testTag ui', `Failed to query device. Code is ${error.code}, message is ${error.message}`); - } - this.message = this.deviceId.toString(); - this.isQuerying = false; - } - - async bindStateChanged() { - hilog.info(0, 'testTag ui', 'bindStateChanged enter'); - this.bindState == false; - this.remote = null; - this.deviceId = -1; - this.vendorId = 0; - this.productId = 0; - this.description = ''; - this.indexUI?.bindCallback(this.getVendorId(), this.getProductId(), this.description); - await sleep(1500); - await this.bindDevice(); - } - - //绑定方法 - private async bind() { - hilog.info(0, 'testTag ui', 'bind enter'); - if (this.deviceId == -1) { - hilog.error(0, 'testTag ui', 'deviceId is invalid!'); - return; - } - if (this.remote != null) { - hilog.info(0, 'testTag ui', 'has bind device. device id:' + this.deviceId); - return; - } - - if (this.isBinding) { - hilog.info(0, 'testTag ui', 'is binding now'); - return; - } - this.isBinding = true; - try { - hilog.info(0, 'testTag ui', 'bindDevice id is:' + this.deviceId); - let data: deviceManager.RemoteDeviceDriver = await deviceManager.bindDeviceDriver(this.deviceId, - async (err: BusinessError, id: number) => { - hilog.error(0, 'testTag ui', 'Device is disconnected:' + data); - this.bindState = false; - this.isBinding = false; - this.bindStateChanged(); - }); - - hilog.info(0, 'testTag ui', 'bindDevice success:' + data.deviceId); - - this.remote = data.remote as rpc.RemoteObject; - if (this.remote === null) { - hilog.error(0, 'testTag ui', 'create remote fail'); - this.bindState = false; - this.isBinding = false; - return; - } - - let deathRecipient = new MyDeathRecipient(this); - this.remote.registerDeathRecipient(deathRecipient, 0); - this.bindState = true; - this.isBinding = false; - hilog.info(0, 'testTag ui', 'create remote success'); - } catch (error) { - hilog.error(0, 'testTag ui', 'bindDevice fail. Code:' + error + ', message:' + error.message); - this.bindState = false; - this.isBinding = false; - } - } - - //初始化 - init(indexUI: Index) { - this.indexUI = indexUI; - } - - //绑定设备(包含了query和bind) - async bindDevice() { - //初始都为false,避免重复绑定 - if (this.isQuerying || this.isBinding) { - return; - } - hilog.info(0, 'testTag ui', 'bindDevice enter'); - while (this.remote == null) { - this.query(); - await this.bind(); - await sleep(1500); - hilog.info(0, 'testTag ui', 'timeOut'); - } - this.indexUI?.bindCallback(this.getVendorId(), this.getProductId(), this.description); - hilog.info(0, 'testTag ui', `vendorId:${this.vendorId} productId:${this.productId} descprtion:${this.description}`); - } - - getVendorId() { - if (this.vendorId == 0) { - return ''; - } else { - return `0x${this.vendorId.toString(16).toUpperCase()}`; - } - } - - getProductId() { - if (this.productId == 0) { - return ''; - } else { - return `0x${this.productId.toString(16).toUpperCase()}`; - } - } - - async queryConnectStatus() { - hilog.info(0, 'testTag ui', 'queryConnectStatus enter'); - while (this.remote != null) { - await this.getConnectStatus(); - if (this.connectStatusChanged) { - this.connectStatusChanged = false; - this.bindStateChanged(); - break; - } - await sleep(3000); - } - } - - async getConnectStatus() { - let option = new rpc.MessageOption(); - let dataSend = rpc.MessageSequence.create(); - let reply = rpc.MessageSequence.create(); - hilog.info(0, 'testTag ui', `getConnectStatus`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `the remote is null`); - return; - } - try { - await this.remote.sendMessageRequest(RequestCode.ConnectStatus, dataSend, reply, option); - let stat = reply.readInt(); - this.connectStatusChanged = (stat == 0 ? true : false); - hilog.info(0, 'testTag ui', `getConnectStatus ${stat}`); - } catch (error) { - this.connectStatusChanged = false; - hilog.info(0, 'testTag ui', 'getConnectStatus failed'); - } - } - - async unbind() { - if (this.deviceId != -1) { - hilog.info(0, 'testTag ui', `[app] unbind`); - await deviceManager.unbindDevice(this.deviceId); - } - } - - async getInput(deviceId: number, inputType: InputType) { - hilog.info(0, 'testTag ui', `[app] getInput enter`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - let inputParams = new InputParams(); - - dataSend.writeInt(inputType); - - this.remote.sendMessageRequest(RequestCode.GetInput, dataSend, reply, option).then((ret) => { - inputParams.stateOfE0 = reply.readBoolean(); - inputParams.stateOfE1 = reply.readBoolean(); - inputParams.stateOfE2 = reply.readBoolean(); - inputParams.stateOfE3 = reply.readBoolean(); - inputParams.stateOfE7 = reply.readBoolean(); - inputParams.stateOfE4 = reply.readBoolean(); - inputParams.stateOfE5 = reply.readBoolean(); - inputParams.stateOfE6 = reply.readBoolean(); - inputParams.data = reply.readString(); - inputParams.freshUI = true; - - this.indexUI?.updateInputPage(inputParams); - hilog.info(0, 'testTag ui', `[app] getInput ret:${ret} E0:${inputParams.stateOfE0} E1:${inputParams.stateOfE1} - E2:${inputParams.stateOfE2} E3:${inputParams.stateOfE3} E4:${inputParams.stateOfE4} E5:${inputParams.stateOfE5} - E6:${inputParams.stateOfE6} E7:${inputParams.stateOfE7} data:${inputParams.data}`); - }).catch(() => { - inputParams.data = '未输入有效数据'; - inputParams.freshUI = true; - this.indexUI?.updateInputPage(inputParams); - hilog.info(0, 'testTag ui', '[app] getInput failed'); - }); - - return inputParams; - } - - setOutput(outputType: OutputType, outputParams: OutputParams) { - hilog.info(0, 'testTag ui', `[app] setOutput enter`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - dataSend.writeInt(outputType); - dataSend.writeBoolean(outputParams.numLock); - dataSend.writeBoolean(outputParams.capsLock); - dataSend.writeBoolean(outputParams.scrollLock); - dataSend.writeBoolean(outputParams.compose); - - this.remote.sendMessageRequest(RequestCode.SetOutput, dataSend, reply, option).then((ret) => { - hilog.info(0, 'testTag ui', `[app] setOutput success ret:${ret} `); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] setOutput failed'); - }); - return; - } - - testGetInferface(deviceId: number, requestType: RequestCode) { - hilog.info(0, 'testTag ui', `[app] testGetInferface enter`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return ''; - } - - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - dataSend.writeInt(deviceId); - let data = ''; - this.remote.sendMessageRequest(requestType, dataSend, reply, option).then((ret) => { - data = reply.readString(); - this.indexUI?.updateAttributePage(requestType, data); - hilog.info(0, 'testTag ui', `[app] testGetInferface success ret:${ret}, rawName/phyaddr/uniqueId: ${data}`); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] testGetInferface failed'); - }); - return data; - } - - getFeature() { - hilog.info(0, 'testTag ui', `[app] getFeature enter`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - let data = ''; - this.remote.sendMessageRequest(RequestCode.GetFeature, dataSend, reply, option).then((ret) => { - data = reply.readString(); - this.indexUI?.updateFeaturePage(data); - hilog.info(0, 'testTag ui', `[app] getFeature success ret:${ret}, feature: ${data}`); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] getFeature failed'); - }); - return; - } - - setFeature(data: string) { - hilog.info(0, 'testTag ui', `[app] setFeature enter`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - dataSend.writeString(data); - this.remote.sendMessageRequest(RequestCode.SetFeature, dataSend, reply, option).then((ret) => { - hilog.info(0, 'testTag ui', `[app] setFeature success ret:${ret}, feature: ${data}`); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] setFeature failed'); - }); - return; - } -} - diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/utils/Params.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/utils/Params.ets deleted file mode 100644 index 820befae3bc0a00679e8b14f9764cf4acd59a908..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/utils/Params.ets +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export class InputParams{ - public stateOfE0: boolean = false; - public stateOfE1: boolean = false; - public stateOfE2: boolean = false; - public stateOfE3: boolean = false; - public stateOfE4: boolean = false; - public stateOfE5: boolean = false; - public stateOfE6: boolean = false; - public stateOfE7: boolean = false; - public data: string = ''; - public freshUI: boolean = true; - - setValue(inputParams: InputParams) { - this.stateOfE0 = inputParams.stateOfE0; - this.stateOfE1 = inputParams.stateOfE1; - this.stateOfE2 = inputParams.stateOfE2; - this.stateOfE3 = inputParams.stateOfE3; - this.stateOfE4 = inputParams.stateOfE4; - this.stateOfE5 = inputParams.stateOfE5; - this.stateOfE6 = inputParams.stateOfE6; - this.stateOfE7 = inputParams.stateOfE7; - this.data = inputParams.data; - this.freshUI = inputParams.freshUI; - } -} - -export class OutputParams{ - public numLock: boolean = false; - public capsLock: boolean = false; - public scrollLock: boolean = false; - public compose: boolean = false; - - setValue(outputParams: OutputParams) { - this.numLock = outputParams.numLock; - this.capsLock = outputParams.capsLock; - this.scrollLock = outputParams.scrollLock; - this.compose = outputParams.compose; - } -} diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/utils/RequestCode.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/utils/RequestCode.ets deleted file mode 100644 index 984052ba6a169fcb5b0e438a0888535a4a6acf30..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/ets/utils/RequestCode.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export enum RequestCode { - ConnectStatus = 3, - GetRawInfo = 4, - GetRawName = 5, - GetPhysicalAddr = 6, - GetRawUniqueId = 7, - GetInput = 8, - SetOutput = 9, - GetFeature = 10, - SetFeature = 11, - GetDescriptor = 12, -}; - -export enum InputType { - GetReport = 0, - ReadBlock = 1, - ReadNonBlock = 2, -}; - -export enum OutputType { - SendReport = 0, - Write = 1, -}; \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/module.json5 b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/module.json5 deleted file mode 100644 index 01cb0df912e6f25f721b62c46acfbf611abb9642..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/module.json5 +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "2in1" - ], - "requestPermissions": [ - { - "name": "ohos.permission.ACCESS_DDK_HID" - }, - { - "name": "ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER" - } - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:startIcon", - "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": "DriverExtAbility", - "icon": "$media:startIcon", - "description": "driver", - "type": "driver", - "exported": true, - "srcEntry": "./ets/DriverAbility/driver.ts", - "metadata": [ - { - "name": "bus", - "value": "USB" - }, - { - "name": "desc", - "value": "the sample of driverExtensionAbility" - }, - { - "name": "vendor", - "value": "string" - }, - { - "name": "vid", - "value": "0x46D,0x1A2C" - }, - { - "name": "pid", - "value": "0xC31C,0x9EF4" - }, - { - "name": "launchOnBind", - "value": "true" - } - ] - } - ] - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/element/color.json b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/element/string.json b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 19f5e4f8cb5f01c4d0e58095b3432458e9ba9b80..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "get_str", - "value": "获取" - }, - { - "name": "str_data", - "value": "数据" - }, - { - "name": "set_led", - "value": "设置键盘背光灯:" - }, - { - "name": "read_block", - "value": "Read(阻塞)" - }, - { - "name": "read_nonblock", - "value": "Read(非阻塞)" - }, - { - "name": "str_set", - "value": "设置" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/app_icon.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/app_icon.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/background.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/foreground.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/layered_image.json b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/startIcon.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/profile/backup_config.json b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/profile/main_pages.json b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/en_US/element/string.json b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 19f5e4f8cb5f01c4d0e58095b3432458e9ba9b80..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "get_str", - "value": "获取" - }, - { - "name": "str_data", - "value": "数据" - }, - { - "name": "set_led", - "value": "设置键盘背光灯:" - }, - { - "name": "read_block", - "value": "Read(阻塞)" - }, - { - "name": "read_nonblock", - "value": "Read(非阻塞)" - }, - { - "name": "str_set", - "value": "设置" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_about_normal.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_about_normal.svg deleted file mode 100644 index 3387f4c0237a0a0ab89f8f0693eef37f73fdf505..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_about_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_about_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_about_select.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_about_select.svg deleted file mode 100644 index 6ff81e52e7479add0160ec1854eb839293b2bb7f..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_about_select.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_about_select - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg deleted file mode 100644 index e6424755b97e7fa4d50c76a659b69f6858b3b3d8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_keyboard_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg deleted file mode 100644 index 60863085dd74ac26f9ad9113268d981fc58ca447..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_keyboard_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg deleted file mode 100644 index e33896c20c382c604d8417754a6d88e908d14c19..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_locale_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg deleted file mode 100644 index 8c9ee3b63c47c9355c04681a8c4ca07ce6f47114..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_locale_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_pen.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_pen.png deleted file mode 100644 index 9d959aeabe36bc25d7bdbcc4bb9aad9d530ac902..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_pen.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg deleted file mode 100644 index e878183476d1b9455531d53b2e56d308da5f10ba..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_pen_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg deleted file mode 100644 index 7a8acea71607f4d95f8ba9cc2fd6e0ab6e4f972e..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_pen_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg deleted file mode 100644 index 94d8f1301720fab6674660010a9c371e8467fbd0..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_quit_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_save_normal.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_save_normal.svg deleted file mode 100644 index 7868f7037dd42dc49eedb578956c7496b2e080d8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_save_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_save_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_select.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_select.svg deleted file mode 100644 index a7bb34b5422711c01876da7d90b7313855054608..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_select.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_set_normal.svg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_set_normal.svg deleted file mode 100644 index 265b373f41b5a82dfaffc9e9721d91876b8ee4dc..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/ic_set_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_set_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/log102.jpeg b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/log102.jpeg deleted file mode 100644 index b67c2515d0fe85898836f42eb99c8c05bcbb7b93..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/log102.jpeg and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pens.PNG b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pens.PNG deleted file mode 100644 index 13e2abe82a62533a429497071f6c336961a45285..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pens.PNG and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png deleted file mode 100644 index 84bd71a268b532582b680827b7b2c93a6436cf95..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png deleted file mode 100644 index d2b5097a2c9f3420908f6a203f2181a3d060a3f8..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png deleted file mode 100644 index d2db5a1b220d889e4536e46c15216d5c470445be..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png deleted file mode 100644 index b50f6e3d445c7ad2a5a13c722385a9dcc8e10a05..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png deleted file mode 100644 index b7d79bb8125b0bb51f3c2ebb57b6a092b125d3c7..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png deleted file mode 100644 index a3dff6a1663db6d344bac6f20b895c888635203f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png deleted file mode 100644 index 871236a32219b18f9e57a678513b006d4e51a087..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png deleted file mode 100644 index b8bc8e3b929000362bcea64a0629746145df8920..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/zh_CN/element/string.json b/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 44f2d22c44b65f86e9ed3272870dafacb0029f62..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "get_str", - "value": "获取" - }, - { - "name": "str_data", - "value": "数据" - }, - { - "name": "set_led", - "value": "设置键盘背光灯:" - }, - { - "name": "read_block", - "value": "Read(阻塞)" - }, - { - "name": "read_nonblock", - "value": "Read(非阻塞)" - }, - { - "name": "str_set", - "value": "设置" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/mock/Libentry.mock.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 133fac9027ff6bbdcccfe98838fdbb2dc34639ab..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const nativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default nativeMock; \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/mock/mock-config.json5 b/DriverDevelopmentKit/HidDriverDemo/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 611ac103799838675117f0aac9bad11f9b8b5e73..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Level } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('testConnectState', 0, async (done: Function) => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - console.info('uitest: TestUiExample begin'); - // 初始化Driver对象 - const driver = Driver.create(); - const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - console.info('uitest: bundleName=', bundleName); - // 指定被测应用包名、ability名,请开发者替换为被测应用包名和ability名 - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - } - // 拉起被测应用 - await delegator.startAbility(want); - console.info('uitest: startAbility'); - // 等待应用拉起完成 - await driver.waitForIdle(500,1000); - // 确认当前应用顶部Ability为指定的ability - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - - // 依据指定文本“设备未连接”查找目标控件 - await driver.assertComponentExist(ON.text('设备未连接')); - // 点击目标控件 - await driver.waitForIdle(4000,5000); - await sleep(3000); - // 通过断言文本为“设备已连接”的控件存在,确认操作后页面变化符合预期 - await driver.assertComponentExist(ON.text('设备已连接')); - await driver.pressBack(); - done(); - }) - }) -} - -function sleep(ms: number): Promise { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/ohosTest/ets/test/List.test.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/ohosTest/module.json5 b/DriverDevelopmentKit/HidDriverDemo/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/test/List.test.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/entry/src/test/LocalUnit.test.ets b/DriverDevelopmentKit/HidDriverDemo/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/hvigor/hvigor-config.json5 b/DriverDevelopmentKit/HidDriverDemo/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/HidDriverDemo/hvigorfile.ts b/DriverDevelopmentKit/HidDriverDemo/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/HidDriverDemo/oh-package.json5 b/DriverDevelopmentKit/HidDriverDemo/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/DriverDevelopmentKit/HidDriverDemo/ohosTest.md b/DriverDevelopmentKit/HidDriverDemo/ohosTest.md deleted file mode 100644 index 9c26131c86ce488601ce56e7694a5c6827b69a9d..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/HidDriverDemo/ohosTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# 输入类设备驱动测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 |测试结果| -|---------------|---------|------------------------|--------------------|------|--------------------------------| -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 |Pass| -| 插入HID外设(罗技键盘) | 位于主页 | 手动插入HID外设 | 连接状态显示已连接 | 否 |Pass| -| 插入HID外设(罗技键盘) | 位于主页 | 手动插入HID外设 | 日志输出“onConnect” | 否 |Pass| -| 输入特性 | 位于主页 | 按住键盘左Ctrl键不放, 点击“获取”按钮 | 对应“Left Ctrl”开关打开 | 否 |Pass| -| 输出特性 | 位于输出页 | 点击“Num Lock”键,点击“设置”按钮 | 罗技键盘上“Num Lock”灯亮 | 否 |Pass| -| 外设属性获取 | 位于关于页 | 点击“Raw name”后的“获取”按钮 | 能读取键盘的“Raw name”属性 | 否 |Pass| \ No newline at end of file diff --git a/DriverDevelopmentKit/HidDriverDemo/screenshots/about.png b/DriverDevelopmentKit/HidDriverDemo/screenshots/about.png deleted file mode 100644 index b2abc1309acd139ea97b055e464ac47b1dc0af94..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/screenshots/about.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/screenshots/feature.png b/DriverDevelopmentKit/HidDriverDemo/screenshots/feature.png deleted file mode 100644 index 6d4ed28c49f72bca1c92240e3f4e8aabc2507d2b..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/screenshots/feature.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/screenshots/main.png b/DriverDevelopmentKit/HidDriverDemo/screenshots/main.png deleted file mode 100644 index 9fa60f50a7e338be6078908c3256fb4ff142102c..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/screenshots/main.png and /dev/null differ diff --git a/DriverDevelopmentKit/HidDriverDemo/screenshots/output.png b/DriverDevelopmentKit/HidDriverDemo/screenshots/output.png deleted file mode 100644 index 291f3549427ac736953827d6fef0a52862f48697..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/HidDriverDemo/screenshots/output.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/.gitignore b/DriverDevelopmentKit/ScsiPeripheralDemo/.gitignore deleted file mode 100644 index 8aa0419d18a172c1c7b91aa32994a07dc8eeb5a8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -**/oh-package-lock.json5 -/sign \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/AppScope/app.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/AppScope/app.json5 deleted file mode 100644 index a176d614361b52904b70ecd7712c941cf8bcc038..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.mass_storage_device", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/AppScope/resources/base/element/string.json b/DriverDevelopmentKit/ScsiPeripheralDemo/AppScope/resources/base/element/string.json deleted file mode 100644 index ca57f5e49af61befc6aef4185332685cf5d0d3d0..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "mass_storage_device" - } - ] -} diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/AppScope/resources/base/media/app_icon.png b/DriverDevelopmentKit/ScsiPeripheralDemo/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/README_zh.md b/DriverDevelopmentKit/ScsiPeripheralDemo/README_zh.md deleted file mode 100644 index 8456ba86dba1bcd5d86453ea64c45b96d60f35f3..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/README_zh.md +++ /dev/null @@ -1,85 +0,0 @@ -# 驱动开发服务 - -### 介绍 - -本示例主要展示了通过DriverDevelopmentKit开发套件中SCSI DDK开发驱动服务,使用[@ohos.driver.deviceManager](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-driver-deviceManager.md) 、[@ohos.app.ability.DriverExtensionAbility](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-app-ability-driverExtensionAbility.md) 、[@ohos.rpc](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ipc-kit/js-apis-rpc.md)、[SCSI DDK](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/capi-usb-ddk-api-h.md) -等接口,实现了整个SCSI存储设备驱动功能,包括SCSI存储设备UI参数设置界面及驱动服务端。其中UI参数界面包括按键设置、区域设置、关于界面、保存按钮、tokenID界面,驱动服务端通过客户端绑定拉起,驱动服务端主要给UI参数界面提供接口及与物理设备通信; - -### 效果预览 - -| 主页(设备参数) | 常用命令 | 通用命令 | -|--------------------------------|-------------------------------------|-----------------------------------| -| ![image](screenshots/main.png) | ![image](screenshots/usual_cmd.png) | ![image](screenshots/com_cmd.png) | - -使用说明 - -1. 安装该示例应用后,当目标设备插入时,扩展外设驱动服务SA会拉起DriverExtensionAbility相关进程(即:驱动服务端) -2. 在主界面绘制完成后,会调用deviceManager的绑定接口,绑定驱动服务端,成功后主界面会显示“设备已连接”; -3. 主界面会读取SCSI存储设备的基本信息,包括制造商,产品标识,产品版本,容量等; -4. 常用命令界面可以使用SCSI的常用命令,包括Inquery等,通过常用命令与物理设备通信; -5. 通用命令界面可以构建通用命令,与物理设备使用通用命令通信; -6. 退出按钮,退出驱动界面。 - -### 工程目录 - -给出项目中关键的目录结构并描述它们的作用,示例如下: - -``` -entry/src/main/ets -|---components -| |---ComCommandComponent.ets //“通用命令”部件页面构造 -| |---DevParamsComponent.ets //“设备参数”部件页面构造 -| |---SendCommandComponent.ets //“常用命令”部件页面构造 -|---DriverAbility -| |---driver.ts //主要重载了继承驱动扩展能力DriverExtensionAbility,Onit初始化USB接口等 -|---entryability -| |---EntryAbility.ets //界面ability -|---pages -| |---Index.ets //应用首页 -|---tool -| |---GlobalContext.ets //用于上下文存储单例对象工具 -| |---RpcTool.ets //主要封装了扩展外设相关接口,实现相关功能,如:查询设备,绑定设备,连接远程对象等 -|---utils -| |---DevParams.ets //设备信息结构 -| |---RequestCode.ets //请求码 -entry/src/main/cpp -|---types -| |---libentry //创建native c++工程,自动生成的文件目录 -|---hello.cpp //主要封装了SCSI存储驱动相关接口,实现相关功能,如:发送Inquery命令等功能 -``` - -### 具体实现 - -* 驱动UI界面,功能包括查询设备列表、绑定设备驱动服务端、与设备驱动服务端通信,源码参考:[Index.ets](code/DocsSample/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/pages/Index.ets) - * 使用deviceManager.queryDevices来获取设备列表; - * 通过deviceManager.bindDeviceDriver来绑定设备驱动服务端,通过返回值拿到驱动服务端实例; - * 通过服务端实例调用sendMessageRequest与设备驱动服务端通信,并获取到服务端回应,将回应数据打印到主界面; - -* 驱动服务端,与驱动UI界面通信,源码参考:[driver.ts](code/DocsSample/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/driverability/driver.ts) - * 当物理设备插入后,UI界面通过bindDeviceDriver接口获取到驱动服务端实例,再通过服务端实例与服务端通信; - * 驱动服务拉起后,会调用DriverExtAbility中onInit方法,可以在此方法中通过Napi接口调用CAPI,初始化USB DDK等 - * 驱动UI界面通过deviceManager调用绑定接口,会调用DriverExtAbility中onConnect返回服务端实例 - * 驱动UI界面通过服务端实例与服务端通信,服务端通过Napi接口调用CAPI,与物理设备通信 - -### 相关权限 - -[ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md) -[ohos.permission.ACCESS_DDK_SCSI_PERIPHERAL](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/restricted-permissions.md) - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568; -2. 本示例为Stage模型,仅支持API18版本SDK,SDK版本号(API Version 18),镜像版本号(5.1Release) -3. 本示例需要使用DevEco Studio 版本号(6.0Release)版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/DriverDevelopmentKit > .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/DriverDevelopmentKit/ScsiPeripheralDemo/build-profile.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/build-profile.json5 deleted file mode 100644 index 9daac2c8f9e75b9f6736c215843c3648121eb453..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/code-linter.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/.gitignore b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/build-profile.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/build-profile.json5 deleted file mode 100644 index dc385e53a655c9653146bb9d9be73a8085d66694..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/build-profile.json5 +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a" - ] - }, - "napiLibFilterOption": { - "enableOverride": true - } - }, - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/hvigorfile.ts b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/hvigorfile.ts deleted file mode 100644 index f0a4a5d350c4cbb51cf7c99b25ebd0713b713587..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/ScsiPeripheralDemo/entry/obfuscation-rules.txt b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/DriverDevelopmentKit/ScsiPeripheralDemo/entry/oh-package.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/oh-package.json5 deleted file mode 100644 index 799333cb7810f99a72e75e910e4b08ec3c795fe9..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/oh-package.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "license": "ISC", - "devDependencies": {}, - "author": "", - "name": "entry", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/CMakeLists.txt b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 5f73d981c15511dbf52fe246849032b3f4e821b2..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.4.1) -project(NativeScsiPeripheral) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -set(CMAKE_CXX_STANDARD 17) -set(LIB_DIR ${NATIVERENDER_ROOT_PATH}/../../../libs/) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include - ${LIB_DIR}/include) - -add_library(entry SHARED hello.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libscsi.z.so libhilog_ndk.z.so -lpthread) \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/hello.cpp b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/hello.cpp deleted file mode 100644 index ec3802dd177dcd5eb8472255a73c8b4d296f1bed..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/hello.cpp +++ /dev/null @@ -1,1007 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include "hilog/log.h" -#include "scsi_peripheral/scsi_peripheral_api.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -#define LOG_TAG "testTag [NATIVE]" - -uint64_t g_devHandle = 0; -ScsiPeripheral_Device *g_scsiPeripheralDevice = nullptr; -ScsiPeripheral_DeviceMemMap *g_scsiDeviceMemMap = nullptr; -constexpr size_t DEVICE_MEM_MAP_SIZE = 10 * 1024; -constexpr size_t PARSE_SENSE_DATA_MAX_LENGTH = 1024; -constexpr int32_t DIRECTION_ERROR = -3; -constexpr int32_t MAX_SCSI_COUNT = 4; -constexpr int32_t DIRECTION_WARNING = -4; -constexpr int32_t ARGC_SIZE = 3; -constexpr int32_t ALLOCATION_LENGTH = 512; -constexpr int32_t REQUEST_TIMEOUT = 5000; -constexpr int32_t RIGHT_OFFSET = 16; -constexpr int32_t LEFT_OFFSET = 32; -constexpr int32_t NUM_TWO = 2; -constexpr int32_t NUM_FIVE = 5; -constexpr int32_t NUM_NINETY = 19; - -static napi_status CreateStringFromCString(napi_env env, const char *str, napi_value* result) -{ - size_t length = strlen(str); - return napi_create_string_utf8(env, str, length, result); -} - -char* ConvertHexDataToHexStr(char* hexStr, uint8_t* hexData, uint32_t len) -{ - memset(hexStr, 0x00, MAX_SCSI_COUNT * len); - int32_t num = 0; - for (int i = 0; i < len; i++) { - num += sprintf(hexStr + num, "%02X ", hexData[i]); - } - OH_LOG_INFO(LOG_APP, "HexStr is: %{public}s", hexStr); - - return hexStr; -} - -bool IsAllZero(const uint8_t* array, size_t length) -{ - return all_of(array, array + length, [](uint8_t value) { return value == 0; }); -} - -uint32_t convertSenseInfoToSenseInfoStr(ScsiPeripheral_BasicSenseInfo& senseInfo, char* buffer, uint32_t len) -{ - if (buffer == nullptr || len == 0) { - return 0; - } - - memset(buffer, 0, len); - uint32_t num = 0; - - num += sprintf(buffer + num, "responseCode=0x%x;\n", senseInfo.responseCode); - num += sprintf(buffer + num, "valid=%d;\n", senseInfo.valid); - num += sprintf(buffer + num, "information=0x%x;\n", senseInfo.information); - num += sprintf(buffer + num, "commandSpecific=0x%x;\n", senseInfo.commandSpecific); - num += sprintf(buffer + num, "sksv=%d;\n", senseInfo.sksv); - num += sprintf(buffer + num, "senseKeySpecific=0x%x;\n", senseInfo.senseKeySpecific); - - return num; -} - -static napi_value ScsiInit(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter ScsiInit\n"); - sleep(1); // 防止拔掉后很快就插上设备,所以这里sleep - - // 解析deviceId - size_t argc = 1; - napi_value argv; - napi_get_cb_info(env, info, &argc, &argv, nullptr, nullptr); - if (argc < 1) { - OH_LOG_ERROR(LOG_APP, "ScsiInit argc is invalid"); - return nullptr; - } - - uint32_t devicedId = 0; - napi_get_value_uint32(env, argv, &devicedId); - uint32_t busNum = ((devicedId & 0xFFFF0000) >> RIGHT_OFFSET); - uint32_t deviceNum = devicedId & 0xFFFF; - g_devHandle = (static_cast(busNum) << LEFT_OFFSET) | deviceNum; - // [Start driver_scsi_step1] - // 初始化SCSI Peripheral DDK - int32_t ret = OH_ScsiPeripheral_Init(); - // [End driver_scsi_step1] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_ScsiPeripheral_Init failed, ret = %{public}d\n", ret); - return nullptr; - } - - int i = 0; - uint8_t interfaceIndex = 0; - while (i < MAX_SCSI_COUNT) { - i++; - sleep(1); - // [Start driver_scsi_step2] - ret = OH_ScsiPeripheral_Open(g_devHandle, interfaceIndex, &g_scsiPeripheralDevice); - // [End driver_scsi_step2] - if (ret == SCSIPERIPHERAL_DDK_SUCCESS) { - break; - } - - OH_LOG_ERROR(LOG_APP, "OH_ScsiPeripheral_Open failed, ret = %{public}d\n", ret); - if (i >= NUM_TWO) { - interfaceIndex = 1; - } - } - if (i >= MAX_SCSI_COUNT) { - return nullptr; - } - - if (g_scsiDeviceMemMap == nullptr) { - // [Start driver_scsi_step3] - ret = OH_ScsiPeripheral_CreateDeviceMemMap(g_scsiPeripheralDevice, DEVICE_MEM_MAP_SIZE, &g_scsiDeviceMemMap); - // [End driver_scsi_step3] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS || g_scsiDeviceMemMap == nullptr) { - OH_LOG_ERROR(LOG_APP, "OH_ScsiPeripheral_CreateDeviceMemMap failed, ret = %{public}d\n", ret); - return nullptr; - } - } - - OH_LOG_DEBUG(LOG_APP, "ScsiInit, g_scsiDeviceMemMap->size=%{public}d\n", g_scsiDeviceMemMap->size); - napi_value result = nullptr; - napi_create_uint32(env, ret, &result); - return result; -} - -static bool BuildInquiryResult(napi_env env, napi_value& result, ScsiPeripheral_InquiryInfo inquiryInfo, - ScsiPeripheral_Response response) -{ - napi_value deviceInfo; - napi_create_object(env, &deviceInfo); - - napi_value devTypeValue; - napi_create_int32(env, inquiryInfo.deviceType, &devTypeValue); - napi_set_named_property(env, deviceInfo, "devType", devTypeValue); - - napi_value vendorValue; - CreateStringFromCString(env, inquiryInfo.idVendor, &vendorValue); - napi_set_named_property(env, deviceInfo, "vendor", vendorValue); - - napi_value productValue; - CreateStringFromCString(env, inquiryInfo.idProduct, &productValue); - napi_set_named_property(env, deviceInfo, "product", productValue); - - napi_value revisionValue; - CreateStringFromCString(env, inquiryInfo.revProduct, &revisionValue); - napi_set_named_property(env, deviceInfo, "revision", revisionValue); - - // 拼接查询的原始数据到字符串,方便传给arkts侧 - napi_value originData = nullptr; - char *hexFormat = new char[MAX_SCSI_COUNT * g_scsiDeviceMemMap->transferredLength]; - if (hexFormat != nullptr) { - ConvertHexDataToHexStr(hexFormat, g_scsiDeviceMemMap->address, g_scsiDeviceMemMap->transferredLength); - napi_create_string_utf8(env, hexFormat, - MAX_SCSI_COUNT * g_scsiDeviceMemMap->transferredLength, &originData); - delete [] hexFormat; - hexFormat = nullptr; - } else { - napi_create_string_utf8(env, "error", NUM_FIVE, &originData); - } - napi_set_named_property(env, deviceInfo, "originData", originData); - - napi_value status; - napi_create_int32(env, response.status, &status); - - if (napi_create_array(env, &result) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_array failed", __func__); - return false; - } - - if (napi_set_element(env, result, 0, deviceInfo) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 0 failed", __func__); - return false; - } - - if (napi_set_element(env, result, 1, status) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 1 failed", __func__); - return false; - } - return true; -} - -static bool DoInquiry(napi_env env, napi_value& result) -{ - if (g_scsiDeviceMemMap == nullptr) { - return false; - } - OH_LOG_DEBUG(LOG_APP, "Inquiry, g_scsiDeviceMemMap->size=%{public}d\n", g_scsiDeviceMemMap->size); - ScsiPeripheral_InquiryRequest inquiryRequest; - inquiryRequest.allocationLength = ALLOCATION_LENGTH; - inquiryRequest.timeout = REQUEST_TIMEOUT; - ScsiPeripheral_InquiryInfo inquiryInfo = {0}; - inquiryInfo.data = g_scsiDeviceMemMap; - memset(g_scsiDeviceMemMap->address, 0x00, DEVICE_MEM_MAP_SIZE); - ScsiPeripheral_Response response; - // [Start driver_scsi_step5] - int32_t ret = OH_ScsiPeripheral_Inquiry(g_scsiPeripheralDevice, &inquiryRequest, &inquiryInfo, &response); - // [End driver_scsi_step5] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "GetDeviceInfo OH_ScsiPeripheral_Inquiry failed, ret = %{public}d\n", ret); - return false; - } - - OH_LOG_DEBUG(LOG_APP, "%{public}s success. devType=%{public}x\n", __func__, inquiryInfo.deviceType); - OH_LOG_DEBUG(LOG_APP, "%{public}s success. idVendor=%{public}s\n", __func__, inquiryInfo.idVendor); - OH_LOG_DEBUG(LOG_APP, "%{public}s success. idProduct=%{public}s\n", __func__, inquiryInfo.idProduct); - OH_LOG_DEBUG(LOG_APP, "%{public}s success. revProduct=%{public}s\n", __func__, inquiryInfo.revProduct); - OH_LOG_DEBUG(LOG_APP, "%{public}s success. transferredLength=%{public}d\n", - __func__, g_scsiDeviceMemMap->transferredLength); - OH_LOG_DEBUG(LOG_APP, "%{public}s success. inquiry data=%{public}s, size=%{public}d, offset=%{public}d," - "bufferLength=%{public}d, transferredLength=%{public}d", __func__, - g_scsiDeviceMemMap->address, g_scsiDeviceMemMap->size, g_scsiDeviceMemMap->offset, - g_scsiDeviceMemMap->bufferLength, g_scsiDeviceMemMap->transferredLength); - - if (!BuildInquiryResult(env, result, inquiryInfo, response)) { - return false; - } - - OH_LOG_INFO(LOG_APP, "GetDeviceInfo success"); - return true; -} - -static napi_value Inquiry(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter Inquiry\n"); - - napi_value result = nullptr; - if (DoInquiry(env, result)) { - return result; - } - OH_LOG_INFO(LOG_APP, "GetDeviceInfo failed\n"); - - napi_value deviceInfo; - napi_create_object(env, &deviceInfo); - napi_value devTypeValue; - napi_create_int32(env, 0, &devTypeValue); - napi_set_named_property(env, deviceInfo, "devType", devTypeValue); - napi_value vendorValue; - CreateStringFromCString(env, "", &vendorValue); - napi_set_named_property(env, deviceInfo, "vendor", vendorValue); - napi_value productValue; - CreateStringFromCString(env, "", &productValue); - napi_set_named_property(env, deviceInfo, "product", productValue); - napi_value revisionValue; - CreateStringFromCString(env, "", &revisionValue); - napi_set_named_property(env, deviceInfo, "revision", revisionValue); - napi_value status; - napi_create_int32(env, -1, &status); - napi_value result1; - napi_create_array(env, &result1); - napi_set_element(env, result, 0, deviceInfo); - napi_set_element(env, result, 1, status); - return result; -} - -static bool BuildReadCapacityResult(napi_env env, ScsiPeripheral_CapacityInfo capacityInfo, - ScsiPeripheral_Response response, napi_value& result) -{ - napi_value address; - if (napi_create_uint32(env, capacityInfo.lbAddress, &address) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_uint32 address failed", __func__); - return false; - } - - napi_value length; - if (napi_create_uint32(env, capacityInfo.lbLength, &length) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_uint32 length failed", __func__); - return false; - } - - napi_value status; - if (napi_create_int32(env, response.status, &status) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_uint32 status failed", __func__); - return false; - } - - if (napi_create_array(env, &result) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_array failed", __func__); - return false; - } - - if (napi_set_element(env, result, 0, address) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 0 failed", __func__); - return false; - } - - if (napi_set_element(env, result, 1, length) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 1 failed", __func__); - return false; - } - - if (napi_set_element(env, result, NUM_TWO, status) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 2 failed", __func__); - return false; - } - - OH_LOG_INFO(LOG_APP, "ReadCapacity success\n"); - return true; -} - -static bool DoReadCapacity(napi_env env, napi_callback_info info, napi_value& result) -{ - size_t argc = NUM_TWO; - napi_value args[NUM_TWO] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < NUM_TWO) { - OH_LOG_ERROR(LOG_APP, "ReadCapacity argc is invalid"); - return false; - } - - uint32_t blockAddr = 0; - napi_get_value_uint32(env, args[1], &blockAddr); - OH_LOG_INFO(LOG_APP, "===ReadCapacity. blockAddr: %{public}u", blockAddr); - - ScsiPeripheral_ReadCapacityRequest readCapacityRequest; - readCapacityRequest.lbAddress = blockAddr; - readCapacityRequest.control = 0; - readCapacityRequest.byte8 = 0; - readCapacityRequest.timeout = REQUEST_TIMEOUT; - ScsiPeripheral_CapacityInfo capacityInfo; - ScsiPeripheral_Response response; - - int32_t ret = 0; - // 获取开始时间点 - auto start = std::chrono::high_resolution_clock::now(); - // [Start driver_scsi_step6] - ret = OH_ScsiPeripheral_ReadCapacity10(g_scsiPeripheralDevice, &readCapacityRequest, &capacityInfo, &response); - // [End driver_scsi_step6] - // 获取结束时间点 - auto end = std::chrono::high_resolution_clock::now(); - // 计算时间差,并转换为微秒 - auto duration = std::chrono::duration_cast(end - start).count(); - // 打印时间差 - OH_LOG_INFO(LOG_APP, "%{public}s scsi read capacity time difference in milliseconds, duration:%{public}lld us", - __func__, duration); - - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "ReadCapacity OH_ScsiPeripheral_ReadCapacity10 failed, ret = %{public}d\n", ret); - return false; - } - OH_LOG_INFO(LOG_APP, "%{public}s success. %{public}zu, %{public}zu", __func__, capacityInfo, - capacityInfo.lbLength); - - if (!BuildReadCapacityResult(env, capacityInfo, response, result)) { - return false; - } - OH_LOG_INFO(LOG_APP, "ReadCapacity success\n"); - return true; -} - -static napi_value ReadCapacity(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter ReadCapacity\n"); - - napi_value result; - if (DoReadCapacity(env, info, result)) { - return result; - } - OH_LOG_INFO(LOG_APP, "ReadCapacity failed\n"); - - napi_value address; - napi_create_uint32(env, 0, &address); - napi_value length; - napi_create_uint32(env, 0, &length); - napi_value status; - napi_create_int32(env, -1, &status); - napi_value result1; - napi_create_array(env, &result1); - napi_set_element(env, result, 0, address); - napi_set_element(env, result, 1, length); - napi_set_element(env, result, NUM_TWO, status); - return result; -} - -static napi_value TestUnitReady(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter TestUnitReady\n"); - do { - ScsiPeripheral_TestUnitReadyRequest request; - request.timeout = REQUEST_TIMEOUT; - ScsiPeripheral_Response response; - // [Start driver_scsi_step4] - int32_t ret = OH_ScsiPeripheral_TestUnitReady(g_scsiPeripheralDevice, &request, &response); - // [End driver_scsi_step4] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "TestUnitReady OH_ScsiPeripheral_TestUnitReady failed, ret = %{public}d\n", ret); - break; - } - - napi_value result; - napi_create_int32(env, response.status, &result); - OH_LOG_INFO(LOG_APP, "TestUnitReady success"); - return result; - } while (false); - - OH_LOG_INFO(LOG_APP, "TestUnitReady failed\n"); - napi_value result; - napi_create_int32(env, -1, &result); - return result; -} - -static bool ParseData(napi_env env, char *hexFormat, ScsiPeripheral_Response response, napi_value& senseData, - napi_value& parseSenseInfo) -{ - if (IsAllZero(response.senseData, SCSIPERIPHERAL_MAX_SENSE_DATA_LEN)) { - // 生成senseData napi_value - ConvertHexDataToHexStr(hexFormat, response.senseData, SCSIPERIPHERAL_MAX_SENSE_DATA_LEN); - napi_create_string_utf8(env, hexFormat, MAX_SCSI_COUNT * SCSIPERIPHERAL_MAX_SENSE_DATA_LEN, &senseData); - - // 生成senseInfo napi_value - napi_create_string_utf8(env, "senseInfo: no data", NUM_NINETY, &parseSenseInfo); - } else { - // 解析senseData - ScsiPeripheral_BasicSenseInfo senseInfo; - memset(&senseInfo, 0x00, sizeof(ScsiPeripheral_BasicSenseInfo)); - // [Start driver_scsi_step8] - int32_t ret = OH_ScsiPeripheral_ParseBasicSenseInfo(response.senseData, SCSIPERIPHERAL_MAX_SENSE_DATA_LEN, - &senseInfo); - // [End driver_scsi_step8] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "RequestSense OH_ScsiPeripheral_ParseBasicSenseInfo failed, ret = %{public}d", - ret); - return false; - } - OH_LOG_INFO(LOG_APP, "senseInfo: responseCode= 0x%{public}x, valid=%{public}d, information=0x%{public}x, " - "commandSpecific=0x%{public}x, sksv=%{public}d, senseKeySpecific=0x%{public}x", - senseInfo.responseCode, senseInfo.valid, senseInfo.information, - senseInfo.commandSpecific, senseInfo.sksv, senseInfo.senseKeySpecific); - - // 拼接解析后的senseData,即senseInfo - char buffer[PARSE_SENSE_DATA_MAX_LENGTH]; - memset(buffer, 0, sizeof(buffer)); - uint32_t num = 0; - num = convertSenseInfoToSenseInfoStr(senseInfo, buffer, PARSE_SENSE_DATA_MAX_LENGTH); - OH_LOG_INFO(LOG_APP, "RequestSense buffer: %{public}s", buffer); - - // 生成senseData napi_value - ConvertHexDataToHexStr(hexFormat, response.senseData, SCSIPERIPHERAL_MAX_SENSE_DATA_LEN); - napi_create_string_utf8(env, hexFormat, MAX_SCSI_COUNT * SCSIPERIPHERAL_MAX_SENSE_DATA_LEN, &senseData); - - // 生成senseInfo napi_value - napi_create_string_utf8(env, buffer, num, &parseSenseInfo); - } - return true; -} - -static bool DoRequestSense(napi_env env, char *hexFormat, napi_value& result) -{ - ScsiPeripheral_RequestSenseRequest senseRequest; - senseRequest.allocationLength = SCSIPERIPHERAL_MAX_SENSE_DATA_LEN + 1; - senseRequest.control = 0; - senseRequest.byte1 = 0; - senseRequest.timeout = REQUEST_TIMEOUT; - ScsiPeripheral_Response response; - memset(&response, 0x00, sizeof(ScsiPeripheral_Response)); - // [Start driver_scsi_step7] - int32_t ret = OH_ScsiPeripheral_RequestSense(g_scsiPeripheralDevice, &senseRequest, &response); - // [End driver_scsi_step7] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "RequestSense OH_ScsiPeripheral_RequestSense failed, ret = %{public}d\n", ret); - return false; - } - - for (int i = 0; i < SCSIPERIPHERAL_MAX_SENSE_DATA_LEN; ++i) { - OH_LOG_INFO(LOG_APP, "scsi request sense data: i:%{public}d, data:%{public}d", i, response.senseData[i]); - } - - napi_value senseData = nullptr; - napi_value parseSenseInfo = nullptr; - if (!ParseData(env, hexFormat, response, senseData, parseSenseInfo)) { - return false; - } - - napi_value status; - if (napi_create_int32(env, response.status, &status) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_uint32 status failed", __func__); - return false; - } - - if (napi_create_array(env, &result) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_array failed", __func__); - return false; - } - - if (napi_set_element(env, result, 0, senseData) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 0 failed", __func__); - return false; - } - - if (napi_set_element(env, result, 1, parseSenseInfo) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 1 failed", __func__); - return false; - } - - if (napi_set_element(env, result, NUM_TWO, status) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 2 failed", __func__); - return false; - } - - OH_LOG_INFO(LOG_APP, "RequestSense success.\n"); - return true; -} - -static napi_value RequestSense(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter RequestSense\n"); - char *hexFormat = new char[MAX_SCSI_COUNT * SCSIPERIPHERAL_MAX_SENSE_DATA_LEN]; - memset(hexFormat, 0, MAX_SCSI_COUNT * SCSIPERIPHERAL_MAX_SENSE_DATA_LEN); - - napi_value result; - if (DoRequestSense(env, hexFormat, result)) { - delete [] hexFormat; - hexFormat = nullptr; - return result; - } - - if (hexFormat != nullptr) { - delete [] hexFormat; - hexFormat = nullptr; - } - - OH_LOG_INFO(LOG_APP, "RequestSense failed.\n"); - napi_value senseData; - napi_create_string_utf8(env, "", 0, &senseData); - napi_value parseSenseInfo; - napi_create_string_utf8(env, "", 0, &parseSenseInfo); - napi_value status; - napi_create_int32(env, -1, &status); - napi_value result1; - napi_create_array(env, &result1); - napi_set_element(env, result, 0, senseData); - napi_set_element(env, result, 1, parseSenseInfo); - napi_set_element(env, result, NUM_TWO, status); - return result; -} - -static bool BuildReadBlocksData(napi_env env, napi_callback_info info, napi_value& result, char *hexFormat, - ScsiPeripheral_Response response) -{ - napi_value readData; - ConvertHexDataToHexStr(hexFormat, g_scsiDeviceMemMap->address, g_scsiDeviceMemMap->transferredLength); - if (napi_create_string_utf8(env, hexFormat, MAX_SCSI_COUNT * g_scsiDeviceMemMap->transferredLength, - &readData)!= napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_uint32 readData failed", __func__); - return false; - } - - napi_value status; - if (napi_create_int32(env, response.status, &status) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_uint32 status failed", __func__); - return false; - } - - if (napi_create_array(env, &result) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_array failed", __func__); - return false; - } - - if (napi_set_element(env, result, 0, readData) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 0 failed", __func__); - return false; - } - - if (napi_set_element(env, result, 1, status) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 1 failed", __func__); - return false; - } - return true; -} - -static bool DoReadBlocksData(napi_env env, napi_callback_info info, napi_value& result, char *hexFormat) -{ - size_t argc = ARGC_SIZE; - napi_value args[ARGC_SIZE] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < ARGC_SIZE) { - OH_LOG_ERROR(LOG_APP, "ReadBlocksData argc is invalid"); - return false; - } - - uint32_t blockAddr = 0; - napi_get_value_uint32(env, args[1], &blockAddr); - - uint32_t blockNum = 0; - napi_get_value_uint32(env, args[NUM_TWO], &blockNum); - - OH_LOG_INFO(LOG_APP, "%{public}s, blockAddr:%{public}d, blockNum:%{public}d", __func__, blockAddr, blockNum); - ScsiPeripheral_IORequest request; - request.lbAddress = blockAddr; - request.transferLength = blockNum; - request.control = 0; - request.byte1 = 0; - request.byte6 = 0; - request.timeout = REQUEST_TIMEOUT; - request.data = g_scsiDeviceMemMap; - memset(g_scsiDeviceMemMap->address, 0x00, DEVICE_MEM_MAP_SIZE); - ScsiPeripheral_Response response; - // [Start driver_scsi_step9] - int32_t ret = OH_ScsiPeripheral_Read10(g_scsiPeripheralDevice, &request, &response); - // [End driver_scsi_step9] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "ReadBlocksData OH_ScsiPeripheral_Read10 failed, ret = %{public}d\n", ret); - return false; - } - OH_LOG_INFO(LOG_APP, "%{public}s, read response duration:%{public}d", __func__, response.duration); - - OH_LOG_INFO(LOG_APP, "%{public}s, readData:%{public}s, size:%{public}d, transferredLength:%{public}d", - __func__, (char *)(g_scsiDeviceMemMap->address), - g_scsiDeviceMemMap->size, g_scsiDeviceMemMap->transferredLength); - - if (!BuildReadBlocksData(env, info, result, hexFormat, response)) { - return false; - } - - OH_LOG_INFO(LOG_APP, "ReadBlocksData success"); - return true; -} - -static napi_value ReadBlocksData(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter ReadBlocksData\n"); - char *hexFormat = new char[MAX_SCSI_COUNT * DEVICE_MEM_MAP_SIZE]; - memset(hexFormat, 0, MAX_SCSI_COUNT * DEVICE_MEM_MAP_SIZE); - napi_value result; - if (DoReadBlocksData(env, info, result, hexFormat)) { - if (hexFormat != nullptr) { - delete [] hexFormat; - hexFormat = nullptr; - } - return result; - } - - if (hexFormat != nullptr) { - delete [] hexFormat; - hexFormat = nullptr; - } - - OH_LOG_INFO(LOG_APP, "ReadBlocksData failed\n"); - napi_value readData; - napi_create_string_utf8(env, "", 0, &readData); - napi_value status; - napi_create_int32(env, -1, &status); - napi_value result1; - napi_create_array(env, &result1); - napi_set_element(env, result, 0, readData); - napi_set_element(env, result, 1, status); - return result; -} - -static napi_value WriteBlocksData(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter WriteBlocksData\n"); - do { - size_t argc = MAX_SCSI_COUNT; - napi_value args[MAX_SCSI_COUNT] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < ARGC_SIZE) { - OH_LOG_ERROR(LOG_APP, "ReadBlocksData argc is invalid"); - break; - } - - uint32_t blockAddr = 0; - napi_get_value_uint32(env, args[1], &blockAddr); - - uint32_t blockNum = 0; - napi_get_value_uint32(env, args[NUM_TWO], &blockNum); - - size_t writeDataSize; - napi_get_value_string_utf8(env, args[ARGC_SIZE], nullptr, 0, &writeDataSize); - std::string writeData; - writeData.resize(writeDataSize); - napi_get_value_string_utf8(env, args[ARGC_SIZE], &writeData[0], writeDataSize + 1, nullptr); - - OH_LOG_DEBUG(LOG_APP, "%{public}s, writeData:%{public}s", __func__, writeData.data()); - memset(g_scsiDeviceMemMap->address, 0x00, DEVICE_MEM_MAP_SIZE); - memcpy(g_scsiDeviceMemMap->address, writeData.data(), writeDataSize); - ScsiPeripheral_IORequest request; - request.lbAddress = blockAddr; - request.transferLength = blockNum; - request.control = 0; - request.byte1 = 0; - request.byte6 = 0; - request.timeout = REQUEST_TIMEOUT; - request.data = g_scsiDeviceMemMap; - ScsiPeripheral_Response response; - // [Start driver_scsi_step10] - int32_t ret = OH_ScsiPeripheral_Write10(g_scsiPeripheralDevice, &request, &response); - // [End driver_scsi_step10] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "WriteBlocksData OH_ScsiPeripheral_Write10 failed, ret = %{public}d\n", ret); - break; - } - OH_LOG_INFO(LOG_APP, "%{public}s, write response duration:%{public}d", __func__, response.duration); - - napi_value result; - napi_create_int32(env, response.status, &result); - OH_LOG_INFO(LOG_APP, "WriteBlocksData success."); - return result; - } while (false); - - OH_LOG_INFO(LOG_APP, "WriteBlocksData failed.\n"); - napi_value result; - napi_create_int32(env, -1, &result); - return result; -} - -static napi_value VerifyBlocksData(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter VerifyBlocksData\n"); - do { - size_t argc = ARGC_SIZE; - napi_value args[ARGC_SIZE] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < ARGC_SIZE) { - OH_LOG_ERROR(LOG_APP, "ReadBlocksData argc is invalid"); - break; - } - - uint32_t blockAddr = 0; - napi_get_value_uint32(env, args[1], &blockAddr); - - uint32_t blockNum = 0; - napi_get_value_uint32(env, args[NUM_TWO], &blockNum); - - ScsiPeripheral_VerifyRequest request; - request.lbAddress = blockAddr; - request.verificationLength = blockNum; - request.timeout = REQUEST_TIMEOUT; - ScsiPeripheral_Response response; - // [Start driver_scsi_step11] - int32_t ret = OH_ScsiPeripheral_Verify10(g_scsiPeripheralDevice, &request, &response); - // [End driver_scsi_step11] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "VerifyBlocksData OH_ScsiPeripheral_Verify10 failed, ret = %{public}d\n", ret); - break; - } - - napi_value result; - napi_create_int32(env, response.status, &result); - OH_LOG_INFO(LOG_APP, "VerifyBlocksData success"); - return result; - } while (false); - - OH_LOG_INFO(LOG_APP, "VerifyBlocksData failed\n"); - napi_value result; - napi_create_int32(env, -1, &result); - return result; -} - -static bool BuildSendCDBDataResult(napi_env env, napi_value& result, int32_t direction, char *hexFormat, - ScsiPeripheral_Response response) -{ - napi_value retData; - napi_status retNapiStatus; - if (response.status == 0 && (direction == DIRECTION_ERROR || direction == DIRECTION_WARNING)) { - ConvertHexDataToHexStr(hexFormat, g_scsiDeviceMemMap->address, g_scsiDeviceMemMap->transferredLength); - retNapiStatus = napi_create_string_utf8(env, hexFormat, - MAX_SCSI_COUNT * g_scsiDeviceMemMap->transferredLength, &retData); - } else { - retNapiStatus = napi_create_string_utf8(env, "", 0, &retData); - } - if (retNapiStatus != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_uint32 readData failed", __func__); - return false; - } - - napi_value status; - if (napi_create_int32(env, response.status, &status) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_uint32 status failed", __func__); - return false; - } - - if (napi_create_array(env, &result) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_create_array failed", __func__); - return false; - } - - if (napi_set_element(env, result, 0, retData) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 0 failed", __func__); - return false; - } - - if (napi_set_element(env, result, 1, status) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s scsi napi_set_element 1 failed", __func__); - return false; - } -} - -static bool BuildSendCDBDataReq(napi_env env, napi_callback_info info, int32_t& direction, - ScsiPeripheral_Request request) -{ - size_t argc = NUM_FIVE; - napi_value args[NUM_FIVE] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < NUM_FIVE) { - OH_LOG_ERROR(LOG_APP, "SendCDBData argc is invalid"); - return false; - } - - uint32_t cmdDataLength; - napi_get_array_length(env, args[1], &cmdDataLength); - OH_LOG_INFO(LOG_APP, "SendCDBData cmdDataLength:%{public}d", cmdDataLength); - - for (size_t i = 0; i < cmdDataLength; ++i) { - napi_value element; - napi_get_element(env, args[1], i, &element); - uint32_t elementValue; - napi_get_value_uint32(env, element, &elementValue); - OH_LOG_INFO(LOG_APP, "SendCDBData cmd[%{public}d]:[%{public}d]", i, elementValue); - } - - uint32_t cmdLen = 0; - napi_get_value_uint32(env, args[NUM_TWO], &cmdLen); - OH_LOG_INFO(LOG_APP, "SendCDBData cmdLen:%{public}d", cmdLen); - napi_get_value_int32(env, args[ARGC_SIZE], &direction); - OH_LOG_INFO(LOG_APP, "SendCDBData direction:%{public}d", direction); - size_t extraDataSize; - napi_get_value_string_utf8(env, args[MAX_SCSI_COUNT], nullptr, 0, &extraDataSize); - string extraData; - extraData.resize(extraDataSize); - napi_get_value_string_utf8(env, args[MAX_SCSI_COUNT], &extraData[0], extraDataSize + 1, nullptr); - OH_LOG_INFO(LOG_APP, "SendCDBData extraDataSize:%{public}d, extraData:%{public}s", - extraDataSize, extraData.data()); - memset(g_scsiDeviceMemMap->address, 0x00, DEVICE_MEM_MAP_SIZE); - if (extraDataSize > 0) { - memcpy(g_scsiDeviceMemMap->address, extraData.data(), extraDataSize); - } - - request.cdbLength = cmdLen; - for (int i = 0; i < SCSIPERIPHERAL_MAX_CMD_DESC_BLOCK_LEN && i < cmdDataLength; ++i) { - napi_value element; - napi_get_element(env, args[1], i, &element); - uint32_t elementValue; - napi_get_value_uint32(env, element, &elementValue); - request.commandDescriptorBlock[i] = static_cast(elementValue); - } - request.dataTransferDirection = direction; - request.timeout = REQUEST_TIMEOUT; - request.data = g_scsiDeviceMemMap; - - return true; -} - -static bool DoSendCDBData(napi_env env, napi_callback_info info, napi_value& result, char *hexFormat) -{ - ScsiPeripheral_Request request; - int32_t direction = 0; - if (!BuildSendCDBDataReq(env, info, direction, request)) { - return false; - } - - ScsiPeripheral_Response response; - // [Start driver_scsi_step12] - int32_t ret = OH_ScsiPeripheral_SendRequestByCdb(g_scsiPeripheralDevice, &request, &response); - // [End driver_scsi_step12] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "SendCDBData OH_ScsiPeripheral_SendRequestByCdb failed, ret = %{public}d\n", ret); - return false; - } - - OH_LOG_INFO(LOG_APP, "%{public}s, retData:%{public}s, size:%{public}d, transferredLength:%{public}d, " - "status = %{public}d", __func__, (char *)(g_scsiDeviceMemMap->address), - g_scsiDeviceMemMap->size, g_scsiDeviceMemMap->transferredLength, response.status); - if (!BuildSendCDBDataResult(env, result, direction, hexFormat, response)) { - return false; - } - - OH_LOG_INFO(LOG_APP, "SendCDBData success"); - return true; -} - -static napi_value SendCDBData(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter SendCDBData\n"); - char *hexFormat = new char[MAX_SCSI_COUNT * DEVICE_MEM_MAP_SIZE]; - memset(hexFormat, 0, MAX_SCSI_COUNT * DEVICE_MEM_MAP_SIZE); - - napi_value result; - if (DoSendCDBData(env, info, result, hexFormat)) { - if (hexFormat != nullptr) { - delete [] hexFormat; - hexFormat = nullptr; - } - return result; - } - - if (hexFormat != nullptr) { - delete [] hexFormat; - hexFormat = nullptr; - } - - OH_LOG_INFO(LOG_APP, "SendCDBData failed\n"); - napi_value retData; - napi_create_string_utf8(env, "", 0, &retData); - napi_value status; - napi_create_int32(env, -1, &status); - napi_value result1; - napi_create_array(env, &result1); - napi_set_element(env, result, 0, retData); - napi_set_element(env, result, 1, status); - return result; -} - -static napi_value ReleaseResource(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter ReleaseResource\n"); - do { - int32_t ret = SCSIPERIPHERAL_DDK_SUCCESS; - if (g_scsiDeviceMemMap != nullptr) { - // [Start driver_scsi_step13] - ret = OH_ScsiPeripheral_DestroyDeviceMemMap(g_scsiDeviceMemMap); - // [End driver_scsi_step13] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_ScsiPeripheral_DestroyDeviceMemMap failed, ret = %{public}d\n", ret); - break; - } - g_scsiDeviceMemMap = nullptr; - } - - if (g_scsiPeripheralDevice != nullptr) { - // [Start driver_scsi_step14] - ret = OH_ScsiPeripheral_Close(&g_scsiPeripheralDevice); - // [End driver_scsi_step14] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_ScsiPeripheral_Close failed, ret = %{public}d\n", ret); - break; - } - g_scsiPeripheralDevice = nullptr; - } - // [Start driver_scsi_step15] - ret = OH_ScsiPeripheral_Release(); - // [End driver_scsi_step15] - if (ret != SCSIPERIPHERAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_ScsiPeripheral_Release failed, ret = %{public}d\n", ret); - break; - } - } while (false); - return nullptr; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - OH_LOG_INFO(LOG_APP, "luobin1120 Init\n"); - napi_property_descriptor desc[] = { - {"scsiInit", nullptr, ScsiInit, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"inquiry", nullptr, Inquiry, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"readCapacity", nullptr, ReadCapacity, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"testUnitReady", nullptr, TestUnitReady, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"requestSense", nullptr, RequestSense, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"readBlocksData", nullptr, ReadBlocksData, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"writeBlocksData", nullptr, WriteBlocksData, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"verifyBlocksData", nullptr, VerifyBlocksData, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"sendCDBData", nullptr, SendCDBData, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"releaseResource", nullptr, ReleaseResource, nullptr, nullptr, nullptr, napi_default, nullptr}, - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - printf("limabiao RegisterEntryModule enter\n"); - OH_LOG_INFO(LOG_APP, "limabiao RegisterEntryModule enter\n"); - napi_module_register(&demoModule); -} diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/types/libentry/index.d.ts b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/types/libentry/index.d.ts deleted file mode 100644 index 89a76c64040c81447522c1af0d9f5cfca07b7add..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/types/libentry/index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -declare namespace scsiNapi { - type DeviceInfo = { - devType: number; // 设备类型,例如:spc、sbc、mmc - vendor: string; // 厂商标识 - product: string; // 产品标识 - revision: string; // 产品版本 - originData: string; // inqiry命令查询的原始数据 - }; - function scsiInit(deviceId:number): number; // 初始化ddk并打开设备文件 - function inquiry(deviceId:number): [DeviceInfo, number]; // 读取设备的基本信息 - function readCapacity(deviceId:number, blockAddr: number): [number, number, number]; // 读取设备容量,返回最后一个逻辑块地址,单个逻辑块大小 - function testUnitReady(deviceId:number): number; // 检测某个逻辑单元是否准备好 - function requestSense(deviceId:number): [string, string, number]; // 检测上次命令的执行状态 - function readBlocksData(deviceId:number, blockAddr:number, blockNum:number): [string, number]; // 读取指定范围的块数据,参数是起始块和块数量 - function writeBlocksData(deviceId:number, blockAddr:number, blockNum:number, data:string): number; // 修改指定范围的块数据,参数是起始块和块数量 - function verifyBlocksData(deviceId:number, blockAddr:number, blockNum:number): number; // 校验指定范围的块数据,参数是起始块和块数量 - function sendCDBData(deviceId:number, cmdData:number[], cmdLen:number, direction:number, extraData:string): [string, number]; // 发送通用命令,发送内容为CDB数据和额外需要写的数据,返回响应内容 - function releaseResource(): void; // 释放资源 -} -export default scsiNapi; \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/types/libentry/oh-package.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 2826cc7d6bd199c1008bb51d898dffa922201e6c..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/DriverAbility/driver.ts b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/DriverAbility/driver.ts deleted file mode 100644 index 769b30f15366a3898148f3be6aec0c7b956dacd1..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/DriverAbility/driver.ts +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -//@ts-nocheck -import { rpc } from '@kit.IPCKit'; -import { DriverExtensionAbility } from '@kit.DriverDevelopmentKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import scsiNapi from 'libentry.so'; -import { RequestCode } from '../utils/RequestCode'; - -let deviceId; -let initResult; - -class FirstDriverAbilityStub extends rpc.RemoteObject { - constructor(des) { - if (typeof des === 'string') { - super(des); - } else { - return null; - } - } - - checkParams():boolean { - if (scsiNapi == null || initResult != 31700000) { - hilog.error(0, 'testTag', `scsiNapi == null or scsiInit is failed.`); - return false; - } - - return true; - } - - onRemoteMessageRequest(code: number, - data: MessageSequence, - reply: MessageSequence, - options: MessageOption - ) { - hilog.info(0, 'testTag', `testtag driver extension onRemoteMessageRequest called ${code}`); - try{ - if (!this.checkParams() && code != RequestCode.ConnectStatus) { - return false; - } - - switch (code) { - case RequestCode.ConnectStatus: { - hilog.info(0, 'testTag', `driver testtag ConnectStatus`); - let status = data.readInt(); - hilog.info(0, 'testTag', `driver result: status:${status}`); - reply.writeInt(type); - return true; - } - case RequestCode.GetDeviceInfo: { - hilog.info(0, 'testTag', `driver testtag GetDeviceInfo`); - let [deviceInfo, status] = scsiNapi.inquiry(deviceId); - hilog.info(0, 'testTag', `driver result: devType:${deviceInfo.devType}, vendor:${deviceInfo.vendor}, product:${deviceInfo.product}, revision:${deviceInfo.revision}, status:${status}`); - reply.writeInt(status); - reply.writeInt(deviceInfo.devType); - reply.writeString(deviceInfo.vendor); - reply.writeString(deviceInfo.product); - reply.writeString(deviceInfo.revision); - - let [lbAddress, blockVolume, status2] = scsiNapi.readCapacity(deviceId, 0); - hilog.info(0, 'testTag', `driver result: blockNum:${lbAddress}, blockVolume:${blockVolume}, status:${status2}`); - reply.writeInt(status2); - reply.writeLong(lbAddress); - reply.writeInt(blockVolume); - return true; - } - case RequestCode.Inquiry: { - hilog.info(0, 'testTag', `driver testtag Inquiry`); - let [deviceInfo, status] = scsiNapi.inquiry(deviceId); - hilog.info(0, 'testTag', `driver result: devType:${deviceInfo.devType}, vendor:${deviceInfo.vendor}, product:${deviceInfo.product}, revision:${deviceInfo.revision}, status:${status}`); - reply.writeInt(status); - reply.writeInt(deviceInfo.devType); - reply.writeString(deviceInfo.vendor); - reply.writeString(deviceInfo.product); - reply.writeString(deviceInfo.revision); - reply.writeString(deviceInfo.originData); - return true; - } - case RequestCode.ReadCapacity: { - hilog.info(0, 'testTag', `driver testtag ReadCapacity`); - let blockAddr = data.readLong(); - const [blockNum, blockVolume, status] = scsiNapi.readCapacity(deviceId, blockAddr); - hilog.info(0, 'testTag', `driver result: blockNum:${blockNum}, blockVolume:${blockVolume}, status:${status}`); - reply.writeInt(status); - reply.writeLong(blockNum); - reply.writeInt(blockVolume); - return true; - } - case RequestCode.TestUnitReady: { - hilog.info(0, 'testTag', `driver testtag TestUnitReady`); - let status = scsiNapi.testUnitReady(deviceId); - hilog.info(0, 'testTag', `driver testtag result: status:${status}`); - reply.writeInt(status); - return true; - } - case RequestCode.ReadBlockData: { - hilog.info(0, 'testTag', `driver testtag ReadBlockData`); - let blockAddr = data.readInt(); - let blockNum = data.readInt(); - let [blockData, status] = scsiNapi.readBlocksData(deviceId, blockAddr, blockNum); - hilog.info(0, 'testTag', `driver testtag result: data:${blockData}, status:${status}`); - reply.writeInt(status); - reply.writeString(blockData.substring(0, (blockData.length - 1) > 2048? 2048 : (blockData.length - 1))); - return true; - } - case RequestCode.WriteBlockData: { - hilog.info(0, 'testTag', `driver testtag WriteBlockData`); - let blockAddr = data.readInt(); - let blockNum = data.readInt(); - let writeData = data.readString(); - let status = scsiNapi.writeBlocksData(deviceId, blockAddr, blockNum, writeData); - hilog.info(0, 'testTag', `driver testtag result: status:${status}`); - reply.writeInt(status); - return true; - } - case RequestCode.VerifyBlockData: { - hilog.info(0, 'testTag', `driver testtag VerifyBlockData`); - let blockAddr = data.readInt(); - let blockNum = data.readInt(); - let status = scsiNapi.verifyBlocksData(deviceId, blockAddr, blockNum); - hilog.info(0, 'testTag', `driver testtag result: status:${status}`); - reply.writeInt(status); - return true; - } - case RequestCode.RequestSense: { - hilog.info(0, 'testTag', `driver testtag RequestSense`); - const [data, parseInfo, status] = scsiNapi.requestSense(deviceId); - hilog.info(0, 'testTag', `driver testtag result: data:${data}, status:${status}`); - reply.writeInt(status); - reply.writeString(data); - reply.writeString(parseInfo); - return true; - } - case RequestCode.SendCdbData: { - hilog.info(0, 'testTag', `driver testtag SendCdbData`); - let cmdData = data.readByteArray(); - let extraData = data.readString(); - let cdbLen = data.readInt(); - let direction = data.readInt(); - hilog.info(0, 'testTag', `===driver testtag result: cdbLen:${cdbLen}, dir:${direction}, cmdData:${cmdData}, extraData:${extraData}`); - let [retData, status] = scsiNapi.sendCDBData(deviceId, cmdData, cdbLen, direction, extraData); - hilog.info(0, 'testTag', `driver testtag result: status:${status}, retDataLen:${retData.length}, retData:${retData}`); - reply.writeInt(status); - reply.writeString(retData.substring(0, (retData.length - 1) > 2048? 2048 : (retData.length - 1))); - return true; - } - default : - throw new Error("Invalid RequestCode"); - } - } catch (error) { - hilog.info(0, 'testTag', `onRemoteMessageRequest exception, RequestCode:${code}`); - } - } - - sendDisconnect() { - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - hilog.info(0, 'testTag', `sendDisconnect`); - sendMessageRequest(0x99, dataSend, reply, option).then((ret) => { - let msg = reply.readInt(); - reply.writeInt(msg); - hilog.info(0, 'testTag', `sendDisconnect sendMessageRequest ret:${ret} msg:${msg}`); - }).catch((error) => { - hilog.info(0, 'testTag', 'sendDisconnect sendMessageRequest failed'); - }); - } -} - -export default class DriverExtAbility extends DriverExtensionAbility { - async onInit(want): void { - hilog.info(0, 'testTag','DriverAbility OnInit start'); - hilog.info(0, 'testTag','OnInit deviceId '+ want.parameters["deviceId"]); - deviceId = want.parameters["deviceId"]; - initResult = scsiNapi.scsiInit(deviceId); - hilog.info(0, 'testTag',`scsiInit initResult:${initResult}`); - } - onRelease() :void { - hilog.info(0, 'testTag', 'DriverAbility onRelease'); - // 释放底层资源 - scsiNapi.releaseResource(); - } - onConnect(want): rpc.RemoteObject { - hilog.info(0, 'testTag', 'DriverAbility onConnect'); - return new FirstDriverAbilityStub('remote'); - } - onDisconnect(want): void { - hilog.info(0, 'testTag', 'DriverAbility onDisconnect'); - } - onDump(params): Array { - hilog.info(0, 'testTag', 'DriverAbility onDump, params:' + JSON.stringify(params)); - return ['params']; - } -}; \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/component/ComCommandComponent.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/component/ComCommandComponent.ets deleted file mode 100644 index 422893ddba3148ef3243d575ca78896e7904ec5a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/component/ComCommandComponent.ets +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (c) 2025 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 { promptAction } from '@kit.ArkUI'; -import RpcTool from '../tool/RpcTool'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { DirectionType } from '../utils/RequestCode'; - -interface Options { - value:string; -} - -@Component -@Preview -export struct ComCommandComponent { - @State dataOfCDB: number[] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - @Link dataOfComCommandPage: string; - @Link execResultOfComCommandPage: string; - @State cdbLen: number = 0; - @State dirType: DirectionType = DirectionType.None; - controller: TextAreaController = new TextAreaController(); - @State selectArray: Array = [{value: 'None'}, {value: 'To dev'}, {value: 'From dev'}, {value: 'To And From dev'}]; - - hexToNum(value: string): number { - if (value.length == 0) { - return 0; - } - - let num: number = parseInt(value, 16); - hilog.info(0, 'testTag ui', `hexToNum: ${value}`); - return num; - } - - popMessage(): void { - try { - promptAction.showToast({ - message: '请正确填写!', - duration: 2000 - }); - } catch (error) { - let message = (error as BusinessError).message; - let code = (error as BusinessError).code; - hilog.info(0, 'testTag ui', `showToast args error code is ${code}, message is ${message}`); - }; - } - - @Styles normalStyle() { - .backgroundColor(Color.Blue) - } - - @Styles pressedStyle() { - .backgroundColor(Color.White) - } - - @Styles disableStyle() { - .backgroundColor(Color.Gray) - } - - @Builder - renderComponent(name: string, row: number, byteNum: number):void { - GridItem() { - Text(name) - .borderStyle(BorderStyle.Solid).borderWidth(1).borderColor(Color.Black) - .fontSize(15) - .width('100%') - .height('100%') - } - .rowStart(row) - .rowEnd(row) - .columnStart(0) - .columnEnd(0) - - GridItem() { - TextInput() - .fontSize(15) - .width('100%') - .height('100%') - .backgroundColor(Color.White) - .borderStyle(BorderStyle.Solid).borderWidth(1).borderColor(Color.Black).borderRadius(0) - .onChange((value) => { - hilog.info(0, 'testTag ui', `row:${row}, byteNum:${byteNum}}`); - let regex = /^[0-9a-fA-F]*$/; - - // 输入长度不超过2,并且只能输入0-9、a-f、A-F - if (value.length > 2 || !regex.test(value)) { - this.popMessage(); - return; - } - - this.dataOfCDB[byteNum] = this.hexToNum(value); - }) - } - .rowStart(row) - .rowEnd(row) - .columnStart(1) - .columnEnd(1) - } - - build() { - Column({space: 15}) { - Row({space: 10}) { - Row({space: 0}) { - Text($r('app.string.direction')) - .fontSize(15) - .padding({left:10}) - Select(this.selectArray) - .value(this.selectArray[0].value) - .selectedOptionFont({size:15}) - .optionFont({size:15}) - .height(30) - .width(100) - .onSelect((index:number,text?:string|undefined)=>{ - switch (index) { - case 0: - this.dirType = DirectionType.None; - break; - case 1: - this.dirType = DirectionType.ToDev; - break; - case 2: - this.dirType = DirectionType.FromDev; - break; - case 3: - this.dirType = DirectionType.ToFromDev; - break; - default : - break; - } - hilog.info(0, 'testTag ui', `dirType:${this.dirType}`); - }) - }.padding({left: 0}) - - Row({space: 0}) { - Text($r('app.string.result')) - .padding({left:10}) - .fontSize(15) - TextInput({text: this.execResultOfComCommandPage}) - .height(30) - .width(60) - .margin({left:0}) - .enabled(false) - } - - Button($r('app.string.send')) - .fontSize(15) - .height(30) - .width(70) - .margin({left:5,top:10}) - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - disabled: this.disableStyle, - }) - .onClick(() => { - RpcTool.getInstance().sendCommonCDBData(this.dataOfCDB, this.dataOfComCommandPage, this.cdbLen, this.dirType - ); - }) - }.width('100%') - - Column({space: 0}) { - Row({space:30}) { - Text($r('app.string.cdb_data')) - .margin({left: 0}) - .fontSize(15) - .width('40%') - .align(Alignment.Start) - Row({space:0}) { - Text($r('app.string.cdb_data_bit')) - .margin({left: 0}) - .fontSize(15) - .width('60%') - .align(Alignment.Start) - - TextInput() - .fontSize(15) - .width('30%') - .height(30) - .onChange((value)=>{ - this.cdbLen = parseInt(value, 10); - }) - } - .width('40%') - } - .margin({left: 0}) - .height('9%') - - Row({space:10}) { - Grid() { - this.renderComponent('byte 0', 0, 0); - this.renderComponent('byte 1', 1, 1); - this.renderComponent('byte 2', 2, 2); - this.renderComponent('byte 3', 3, 3); - this.renderComponent('byte 4', 4, 4); - this.renderComponent('byte 5', 5, 5); - this.renderComponent('byte 6', 6, 6); - this.renderComponent('byte 7', 7, 7); - } - .columnsTemplate('1.4fr 3fr') - .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr') - .columnsGap(0) - .rowsGap(0) - .width('45%') - .margin({left: 10}) - - Grid() { - this.renderComponent('byte 8', 0, 8); - this.renderComponent('byte 9', 1, 9); - this.renderComponent('byte 10', 2, 10); - this.renderComponent('byte 11', 3, 11); - this.renderComponent('byte 12', 4, 12); - this.renderComponent('byte 13', 5, 13); - this.renderComponent('byte 14', 6, 14); - this.renderComponent('byte 15', 7, 15); - } - .columnsTemplate('1.6fr 3fr') - .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr') - .columnsGap(0) - .rowsGap(0) - .width('45%') - } - .width('95%') - .height('95%') - .align(Alignment.Center) - } - .width('100%') - .height('60%') - - Column({space: 0}) { - Text('数据') - .padding({left: 0}) - .fontSize(15) - .width('20%') - TextArea({text: this.dataOfComCommandPage, placeholder: '如果需要写数据,可以在这里输入...', controller: this.controller}) - .placeholderFont({ size: 16, weight: 400 }) - .margin({left:0}) - .width('100%') - .height('60%') - .fontSize(15) - .fontColor('#182431') - .backgroundColor('#0C182431') - .borderStyle(BorderStyle.Solid).borderWidth(1).borderColor('#FF007DFF') - .onChange((value: string) => { - this.dataOfComCommandPage = value; - }) - } - .width('100%') - .height('30%') - .padding({left:20, top: 10, right:20}) - .alignItems(HorizontalAlign.Start) - } - .width('100%') - .height('100%') - } -} diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/component/DevParamsComponent.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/component/DevParamsComponent.ets deleted file mode 100644 index 00782d6ebb29d90bbd2d7e5a350cb156b052fb82..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/component/DevParamsComponent.ets +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2025 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 RpcTool from '../tool/RpcTool'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { rpc } from '@kit.IPCKit'; -import DevParams from '../utils/DevParams'; - -interface Options { - value:string; -} -@Component -@Preview -export struct DevParamsComponent { - @Link devParams: DevParams; - @State index: number = 0; - @State bindButtonState: boolean = true; - - aboutToAppear() { - } - - build() { - Column({space:30}) { - Row() { - Text($r('app.string.dev_type')) - .padding({left:10}) - .fontSize(20) - Text(this.devParams.devType.toString()) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 8}) - .height('6%') - }.width('100%') - .margin({left:35}) - - Row() { - Text($r('app.string.vendor_id')) - .padding({left:10}) - .fontSize(20) - Text(this.devParams.vendorId) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 28}) - .height('6%') - }.width('100%') - .margin({left:35}) - - Row() { - Text($r('app.string.product_id')) - .padding({left:10}) - .fontSize(20) - Text(this.devParams.productId) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 8}) - .height('6%') - }.width('100%') - .margin({left:35}) - - Row() { - Text($r('app.string.revision')) - .padding({left:10}) - .fontSize(20) - Text(this.devParams.revision) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 8}) - .height('6%') - }.width('100%') - .margin({left:35}) - - Row() { - Text($r('app.string.volume')) - .padding({left:10}) - .fontSize(20) - Text(this.devParams.volumeStrType) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 48}) - .height('6%') - }.width('100%') - .margin({left:35}) - - Row() { - Text($r('app.string.block_num')) - .padding({left:10}) - .fontSize(20) - Text(this.devParams.blockNum.toString()) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 48}) - .height('6%') - }.width('100%') - .margin({left:35}) - - Row() { - Text($r('app.string.block_volume')) - .padding({left:10}) - .fontSize(20) - Text(this.devParams.blockVolume.toString()) - .width('40%') - .backgroundColor('#0C182431') - .margin({left: 28}) - .height('6%') - }.width('100%') - .margin({left:35}) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Center) - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/component/SendCommandComponent.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/component/SendCommandComponent.ets deleted file mode 100644 index 146973c525b14f5f13175e01826e1eab5bff84e2..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/component/SendCommandComponent.ets +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2025 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 { promptAction } from '@kit.ArkUI'; -import { BusinessError } from '@kit.BasicServicesKit'; -import RpcTool from '../tool/RpcTool'; - -interface Options { - value:string; -} - -enum CommandType { - INQUIRY = 0, - READ_CAPACITY = 1, - TEST_UNIT_READY = 2, - READ = 3, - WRITE = 4, - VERIFY = 5, - REQUEST_SENSE = 6, -} - -@Component -@Preview -export struct SendCommandComponent { - @State commandsArray: Array = [{value: 'inquiry'}, {value: 'read_capacity'}, {value: 'test_unit_ready'}, - {value: 'read'},{value: 'write'}, {value: 'verify'}, {value: 'request_sense'}]; - - // 几个组件的值 - @State index: number = 0; - @State blockStartAddr: number = -1; - @State blockNum: number = -1; - @State blockStartAddrStr: string = ''; - @State blockNumStr: string = ''; - - // 几个组件的状态标记位 - @State blockStartState: boolean = true; - @State blockNumState: boolean = true; - @State textAreaState: boolean = true; - - @Link dataOfSendCommandPage: string; - @Link execResult: string; - - controller: TextAreaController = new TextAreaController(); - - popMessage(): void { - try { - promptAction.showToast({ - message: '请正确填写!', - duration: 2000 - }); - } catch (error) { - let message = (error as BusinessError).message; - let code = (error as BusinessError).code; - hilog.info(0, 'testTag ui', `showToast args error code is ${code}, message is ${message}`); - }; - } - - @Styles normalStyle() { - .backgroundColor(Color.Blue) - } - - @Styles pressedStyle() { - .backgroundColor(Color.White) - } - - @Styles disableStyle() { - .backgroundColor(Color.Gray) - } - - build() { - Column({space: 30}) { - Row({space: 10}) { - Text($r('app.string.commands')) - .padding({left:10}) - .fontSize(18) - Select(this.commandsArray) - .selected(this.index) - .selectedOptionFont({size:20}) - .optionFont({size:20}) - .width('30%') - .margin({left:20}) - .onSelect((index:number,text?:string|undefined)=>{ - hilog.info(0, 'testTag ui', `SCSI command select Index:${index}`); - this.index = index; - switch (this.index) { - - case CommandType.READ: - case CommandType.VERIFY: - this.blockStartState = true; - this.blockNumState = true; - break; - case CommandType.WRITE: - this.blockStartState = true; - this.blockNumState = true; - break; - case CommandType.TEST_UNIT_READY: - case CommandType.INQUIRY: - case CommandType.REQUEST_SENSE: - this.blockStartState = false; - this.blockNumState = false; - break; - case CommandType.READ_CAPACITY: - this.blockStartState = true; - this.blockNumState = false; - default : - break; - } - this.dataOfSendCommandPage = ''; - this.blockStartAddrStr = ''; - this.blockNumStr = ''; - this.execResult = ''; - hilog.info(0, 'testTag ui', `==blockStartAddrStr:${this.blockStartAddrStr}`); - }) - Button($r('app.string.send')) - .fontSize(18) - .width('20%') - .stateStyles({ - normal: this.normalStyle, - pressed: this.pressedStyle, - disabled: this.disableStyle, - }) - .onClick(()=>{ - switch (this.index) { - case CommandType.TEST_UNIT_READY: - RpcTool.getInstance().testUnitReady(this.blockStartAddr, this.blockNum); - break; - case CommandType.READ: - case CommandType.VERIFY: - if (this.blockStartAddr == -1 || this.blockNum <= 0) { - this.popMessage(); - return; - } - if (this.index == CommandType.READ) { - RpcTool.getInstance().readBlockData(this.blockStartAddr, this.blockNum); - } else if (this.index == CommandType.VERIFY) { - RpcTool.getInstance().verify(this.blockStartAddr, this.blockNum); - } - break; - case CommandType.WRITE: - if (this.blockStartAddr == -1 || this.blockNum <= 0 || this.dataOfSendCommandPage.length == 0) { - this.popMessage(); - return; - } - RpcTool.getInstance().writeBlockData(this.blockStartAddr, this.blockNum, this.dataOfSendCommandPage); - break; - case CommandType.INQUIRY: - RpcTool.getInstance().inquiry(); - break; - case CommandType.REQUEST_SENSE: - RpcTool.getInstance().requestSense(); - break; - case CommandType.READ_CAPACITY: - hilog.info(0, 'testTag ui', `==blockStartAddr:${this.blockStartAddr}`); - if (this.blockStartAddr == -1) { - this.popMessage(); - return; - } - RpcTool.getInstance().readCapacity(this.blockStartAddr); - break; - default: - break; - } - }) - } - .width('100%') - .margin({left:35}) - - Row({space: 10}) { - Text($r('app.string.block_start')) - .padding({left:10}) - .fontSize(18) - TextInput({text: this.blockStartAddrStr}) - .width('30%') - .margin({left:42}) - .type(InputType.Number) - .backgroundColor(this.blockStartState? '#0C182431' : '#ffa2a5a5') - .enabled(this.blockStartState) - .onChange((value) => { - this.blockStartAddrStr = value; - if (this.blockStartAddrStr.length == 0) { - this.blockStartAddr = -1; - } else { - this.blockStartAddr = parseInt(value, 10); - } - - hilog.info(0, 'testTag ui', `==blockStartAddr:${this.blockStartAddr}, blockStartAddrStr:${this.blockStartAddrStr}`); - }) - } - .width('100%') - .margin({left:35}) - - Row({space: 10}) { - Text($r('app.string.block_num_str')) - .padding({left:10}) - .fontSize(18) - TextInput({text: this.blockNumStr}) - .width('30%') - .margin({left:42}) - .type(InputType.Number) - .backgroundColor(this.blockNumState? '#0C182431' : '#ffa2a5a5') - .enabled(this.blockNumState) - .onChange((value) => { - this.blockNumStr = value; - if (this.blockNumStr.length == 0) { - this.blockNum = -1; - } else { - this.blockNum = parseInt(value, 10); - } - }) - } - .width('100%') - .margin({left:35}) - - Row({space: 10}) { - Text($r('app.string.exec_result')) - .padding({left:10}) - .fontSize(18) - TextInput({text: this.execResult}) - .width('30%') - .margin({left:26}) - .enabled(false) - } - .width('100%') - .margin({left:35}) - - Column({space: 0}) { - Text($r('app.string.data')) - .padding({left: 10}) - .fontSize(18) - .width('20%') - TextArea({text: this.dataOfSendCommandPage, placeholder: '如果需要写数据,可以在这里输入...', controller: this.controller}) - .placeholderFont({ size: 16, weight: 400 }) - .margin({left:10}) - .width('83%') - .height('30%') - .fontSize(18) - .fontColor('#182431') - .enabled(this.textAreaState) - .backgroundColor('#0C182431') - .borderStyle(BorderStyle.Solid).borderWidth(1).borderColor('#FF007DFF') - .onChange((value: string) => { - this.dataOfSendCommandPage = value; - }) - } - .width('100%') - .margin({left:35}) - .alignItems(HorizontalAlign.Start) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Center) - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/entryability/EntryAbility.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 3397e6f55f4f6216e2d81004686647422067a65e..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/pages/Index.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 7ff28e391b4b86ad17e1d94471ad21817a8ab724..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2025 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 { DevParamsComponent } from '../component/DevParamsComponent'; -import { SendCommandComponent } from '../component/SendCommandComponent'; -import { ComCommandComponent } from '../component/ComCommandComponent'; -import { common } from '@kit.AbilityKit' -import { prompt } from '@kit.ArkUI' -import RpcTool from '../tool/RpcTool'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import DevParams from '../utils/DevParams'; - -const IMAGE_WIDTH_HEIGHT: number = 60; // 图片宽高 -const IMAGE_INTERVAL: number = 20; // 图片与图片间距 -const IMAGE_TEXT_INTERVAL: number = 10; // 图片和文本间距 -const MARGIN_LEFT_RIGHT: number = 2; // 顶部菜单栏与屏幕边缘间隔 -const MARGIN_TOP_BOTTOM: number = 20; // 菜单栏上下间距 - -@Preview -@Entry -@Component -struct Index { - @State description: string = ''; - @State currentIndex: number = 0; - @State connectStatus: boolean = false; - saveMessage : string = `save config success`; - - @State devType: number = -1; - @State vendorId: string = ''; - @State productId: string = ''; - @State revision: string = ''; - @State volumeNumType: number = 0; - @State volumeStrType: string = ''; - @State blockNum: number = 0; - @State blockVolume: number = 0; - @State devParams: DevParams = new DevParams(); - @State dataOfSendCommandPage: string = ''; - @State execResult: string = ''; - @State execResultOfComCommandPage: string = ''; - @State dataOfComCommandPage: string = ''; - - - private topMenu = [ - ['设备参数', $rawfile('ic_keyboard_set_normal.svg'), $rawfile('ic_keyboard_set_select.svg')], - ['常用命令', $rawfile('ic_about_normal.svg'), $rawfile('ic_about_select.svg')], - ['通用命令', $rawfile('ic_save_normal.svg'), $rawfile('ic_save_normal.svg')] - ]; - private bottomMenu = [['退出', $rawfile('ic_quit_normal.svg'), $rawfile('ic_quit_normal.svg')]]; - private controller: TabsController = new TabsController(); - private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; - - async aboutToAppear() { - RpcTool.getInstance().init(this); - RpcTool.getInstance().bindDevice(); - } - - async aboutToDisappear() { - hilog.info(0, 'testTag ui', `aboutToDisappear`); - await RpcTool.getInstance().unbindDevice(); - } - - bindCallback(vendorId: string, productId: string, description: string) { - hilog.info(0, 'testTag ui', `bindCallback vendorId: ${vendorId} productId:${productId}`); - this.vendorId = vendorId; - this.productId = productId; - this.description = description; - if (vendorId.length == 0 || productId.length == 0) { - this.connectStatus = false; - } else { - this.connectStatus = true; - } - } - - updataDevParamsComponent(devParams: DevParams) { - this.devParams.setValue(devParams); - hilog.info(0, 'testTag ui', `updataDevParamsComponent vendorId: ${devParams.vendorId} productId:${devParams.productId}`); - } - - updateSendCommandComponent(result: number, respData: string) { - this.execResult = result.toString(); - this.dataOfSendCommandPage = respData; - hilog.info(0, 'testTag ui', `updateSendCommandComponent dataOfIO: ${this.dataOfSendCommandPage}`); - } - - updateComCommandComponent(result: number, respData: string) { - this.execResultOfComCommandPage = result.toString(); - this.dataOfComCommandPage = respData; - hilog.info(0, 'testTag ui', `updateComCommandComponent dataOfIO: ${this.dataOfComCommandPage}`); - } - - getSaveMessage() { - if(!this.vendorId || this.vendorId.length == 0) { - console.log('===>00'); - return '当前设备未连接'; - } else { - console.log('===>11'); - return `save config success`; - - } - } - - build() { - Stack() { - Column() { - Row() { - Row() { - ForEach(this.topMenu, (item:string|Resource, index) => { - Column() { - Image((this.currentIndex == index) ? item[2] : item[1]) - .width(IMAGE_WIDTH_HEIGHT) - .height(IMAGE_WIDTH_HEIGHT) - Text(item[0]) - .margin({ top: IMAGE_TEXT_INTERVAL }) - } - .margin({ right: IMAGE_INTERVAL }) - .justifyContent(FlexAlign.Center) - .onClick(() => { - this.currentIndex = index; - }) - }) - } - .margin({ left: MARGIN_LEFT_RIGHT, bottom: MARGIN_TOP_BOTTOM }) - - Row() { - ForEach(this.bottomMenu, (item:(string|Resource)[], index) => { - Column() { - Image(item[1]) - .width(IMAGE_WIDTH_HEIGHT) - .height(IMAGE_WIDTH_HEIGHT) - Text(item[0]) - .margin({ top: 10 }) - } - .justifyContent(FlexAlign.Center) - .onClick(() => { - if (item[0] === '退出') { - this.context.terminateSelf(); - } - }) - }) - } - .margin({ right: MARGIN_LEFT_RIGHT, bottom: MARGIN_TOP_BOTTOM }) - } - .width('100%') - .margin({ top: MARGIN_TOP_BOTTOM }) - .border({ width: { bottom: 0.5 }, color: Color.Gray }) - .justifyContent(FlexAlign.SpaceBetween) - - Stack() { - // 主内容区域 - Row() { - Tabs({ controller: this.controller, index: this.currentIndex }) { - TabContent() { - DevParamsComponent({devParams: $devParams}) - } - TabContent() { - SendCommandComponent({dataOfSendCommandPage: $dataOfSendCommandPage, execResult: $execResult}) - } - TabContent() { - ComCommandComponent({ - dataOfComCommandPage: $dataOfComCommandPage, - execResultOfComCommandPage: $execResultOfComCommandPage - }) - } - } - .barHeight(0) - .height('100%') - .scrollable(false) - } - .layoutWeight(1) - } - .alignContent(Alignment.TopStart) - .layoutWeight(1) - }.width('100%') - .height('100%') - .alignItems(HorizontalAlign.Center) - - Text(this.connectStatus ? $r('app.string.device_connect') : $r('app.string.device_disconnect')) - .fontColor(this.connectStatus ? Color.Black : Color.Red) - .margin({ right: 30, bottom: 5 }) - .fontSize(14) - } - .width('100%') - .height('100%') - .alignContent(Alignment.BottomEnd) - } -} - -export {Index} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/tool/GlobalContext.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/tool/GlobalContext.ets deleted file mode 100644 index abc3be8af21f2765a8657078b085a4171093d9e8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/tool/GlobalContext.ets +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const TAG = 'GlobalContext'; - -export default class GlobalContext { - private constructor() { - } - - private static instance: GlobalContext; - private _objects = new Map(); - private isDebug: boolean = false; - - public static getContext(): GlobalContext { - if (GlobalContext.instance == null){ - GlobalContext.instance = new GlobalContext(); - } - return GlobalContext.instance; - } - - public getObject(key: string): Object | undefined{ - let result = this._objects.get(key); - this.printLog('getObject: ' + key + ' -> ' + (result != null)); - return result; - } - - public hasObject(key: string): boolean { - return this._objects.has(key); - } - - public setObject(key: string, objectClass: Object): void { - this._objects.set(key, objectClass); - this.printLog('setObject: ' + key); - } - - public printLog(message: string): void { - if(!this.isDebug){ - return; - } - console.info(TAG, message); - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/tool/RpcTool.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/tool/RpcTool.ets deleted file mode 100644 index 27d1b1546d4ccbde548b7fda736dbfafd8c97eb4..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/tool/RpcTool.ets +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright (c) 2025 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 { rpc } from '@kit.IPCKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { deviceManager } from '@kit.DriverDevelopmentKit'; -import {Index} from '../pages/Index'; -import GlobalContext from './GlobalContext'; -import { BusinessError } from '@kit.BasicServicesKit'; -import DevParams from '../utils/DevParams'; -import { RequestCode } from '../utils/RequestCode'; - -const VENDOR_ID: number = 9390; // 24AE -const PRODUCT_ID_LIST = [9488,49271, 25479, 24601, 45331, 4, 2112, 21904,4660, 22136, 8224]; // 1871 - -export async function sleep(ms: number) { - return new Promise(res => setTimeout(res, ms)); -} - -class MyDeathRecipient { - private rpcTool: RpcTool; - - constructor(rpc: RpcTool) { - this.rpcTool = rpc; - } - - onRemoteDied() { - hilog.info(0, 'testTag ui', 'onRemoteDied'); - this.rpcTool.resetStatus(); - this.rpcTool.bindStateChanged(); - } -} - -export default class RpcTool { - // 标志位 - private bindState: boolean = false; - private remote: rpc.RemoteObject | null = null; - private isQuerying : boolean = false; - private isBinding : boolean = false; - private indexUI? : Index; - private connectStatusChanged = false; - - // 供外部访问,当前绑定的设备信息 - public devices: Array = []; - public vendorId: number = 0; // 厂商标识 - public productId: number = 0; // 产品标识 - public description: string = ''; - public deviceId: number = -1; - public codeOfLastCommand: number = -1; - public senseData: string = ''; - public readData: string = ''; - - public devParams: DevParams = new DevParams(); - - // 其他 - private message: string = ''; - private static instance: RpcTool; - - public static getInstance(): RpcTool { - if (!GlobalContext.getContext().hasObject('prcToolInstance')) { - GlobalContext.getContext().setObject('prcToolInstance', new RpcTool()); - } - return GlobalContext.getContext().getObject('prcToolInstance') as RpcTool; - } - - public resetStatus(): void { - this.remote = null; - this.bindState = false; - this.isBinding = false; - } - - async unbindDevice() { - hilog.info(0, 'testTag ui', 'unbind enter'); - if (this.deviceId == -1) { - hilog.error(0, 'testTag ui', 'deviceId is invalid!'); - return; - } - - try { - hilog.info(0, 'testTag ui', 'unbindDevice id is:' + this.deviceId); - await deviceManager.unbindDevice(this.deviceId, async (err: BusinessError) => { - if (err) { - hilog.error(0, 'testTag ui', 'Failed to unbind device: ' + err.message); - } else { - this.isBinding = false; - this.bindState = false; - hilog.info(0, 'testTag ui', 'Device is disconnected'); - } - }); - } catch (error) { - hilog.error(0, 'testTag ui', 'bindDevice fail. Code:' + error.code + ', message:' + error.message); - this.bindState = true; - this.isBinding = true; - } - } - - private query() { - hilog.info(0, 'testTag ui', 'query enter'); - if (this.isBinding || this.bindState) { - hilog.info(0, 'testTag ui', 'has bind. device id:' + this.deviceId); - return; - } - if (this.deviceId != -1) { - hilog.info(0, 'testTag ui', 'has query. device id:' + this.deviceId); - return; - } - this.isQuerying = true; - try { - this.devices = deviceManager.queryDevices(deviceManager.BusType.USB); - for (let item of this.devices) { - let device = item as deviceManager.USBDevice; - hilog.info(0, 'testTag ui', 'querydevice id:' + device.deviceId + ',bustype:' + device + - ',vid:' + device.vendorId + ',pid:' + device.productId + ', des:' + device.description + - ', des:' + device.description); - let index = PRODUCT_ID_LIST.indexOf(device.productId); - if (index >= 0) { - this.deviceId = device.deviceId; - this.vendorId = device.vendorId; - this.productId = device.productId; - this.description = device.description; - break; - } - } - } catch (error) { - hilog.error(0, 'testTag ui', `Failed to query device. Code is ${error.code}, message is ${error.message}`); - } - this.message = this.deviceId.toString(); - this.isQuerying = false; - } - - async bindStateChanged() { - hilog.info(0, 'testTag ui', 'bindStateChanged enter'); - this.bindState == false; - this.remote = null; - this.deviceId = -1; - this.vendorId = 0; - this.productId = 0; - this.description = ''; - - this.indexUI?.bindCallback(this.getVendorId(), this.getProductId(), this.description); - await sleep(1500); - await this.bindDevice(); - } - - private async bind() { - hilog.info(0, 'testTag ui', 'bind enter'); - if (this.deviceId == -1) { - hilog.error(0, 'testTag ui', 'deviceId is invalid!'); - return; - } - if (this.remote != null) { - hilog.info(0, 'testTag ui', 'has bind device. device id:' + this.deviceId); - return; - } - - if (this.isBinding) { - hilog.info(0, 'testTag ui', 'is binding now'); - return; - } - this.isBinding = true; - try { - hilog.info(0, 'testTag ui', 'bindDevice id is:' + this.deviceId); - let data: deviceManager.RemoteDeviceDriver = await deviceManager.bindDeviceDriver(this.deviceId, - async (err: BusinessError, id: number) => { - hilog.error(0, 'testTag ui', 'Device is disconnected:' + data); - this.bindState = false; - this.isBinding = false; - this.bindStateChanged(); - }); - - hilog.info(0, 'testTag ui', 'bindDevice success:' + data.deviceId); - - this.remote = data.remote as rpc.RemoteObject; - if (this.remote === null) { - hilog.error(0, 'testTag ui', 'create remote fail'); - this.bindState = false; - this.isBinding = false; - return; - } - - let deathRecipient = new MyDeathRecipient(this); - this.remote.registerDeathRecipient(deathRecipient, 0); - this.bindState = true; - this.isBinding = false; - this.getDeviceInfo(); - hilog.info(0, 'testTag ui', 'create remote success'); - } catch (error) { - hilog.error(0, 'testTag ui', 'bindDevice fail. Code:' + error.code + ', message:' + error.message); - this.bindState = false; - this.isBinding = false; - } - } - - init(indexUI: Index) { - this.indexUI = indexUI; - hilog.info(0, 'testTag ui', 'init'); - } - - async bindDevice() { - if (this.isQuerying || this.isBinding) { - hilog.info(0, 'testTag ui', 'querying or binding, then leave'); - return; - } - hilog.info(0, 'testTag ui', 'bindDevice enter'); - while (this.remote == null) { - this.query(); - await this.bind(); - await sleep(1500); - hilog.info(0, 'testTag ui', 'timeOut'); - } - - this.indexUI?.bindCallback(this.getVendorId(), this.getProductId(), this.description); - hilog.info(0, 'testTag ui', `vendorId:${this.vendorId} productId:${this.productId} descprtion:${this.description}`); - } - - getVendorId() { - if(this.vendorId == 0) { - return ''; - } else { - return `0x${this.vendorId.toString(16).toUpperCase()}`; - } - } - getProductId() { - if(this.productId == 0) { - return ''; - } else { - return `0x${this.productId.toString(16).toUpperCase()}`; - } - } - - async queryConnectStatus() { - hilog.info(0, 'testTag ui', 'queryConnectStatus enter'); - while(this.remote != null) { - await this.getConnectStatus(); - if(this.connectStatusChanged) { - this.connectStatusChanged = false; - this.bindStateChanged(); - break; - } - await sleep(3000); - } - } - - async getConnectStatus() { - let option = new rpc.MessageOption(); - let dataSend = rpc.MessageSequence.create(); - let reply = rpc.MessageSequence.create(); - hilog.info(0, 'testTag ui', `getConnectStatus`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `the remote is null`); - return; - } - try { - await this.remote.sendMessageRequest(RequestCode.ConnectStatus, dataSend, reply, option); - let stat = reply.readInt(); - this.connectStatusChanged = (stat == 0 ? true : false); - hilog.info(0, 'testTag ui', `getConnectStatus ${stat}`); - } catch (error) { - this.connectStatusChanged = false; - hilog.info(0, 'testTag ui', 'getConnectStatus failed'); - } - } - - getDeviceInfo() { - hilog.info(0, 'testTag ui', `[app] getDeviceInfo enter`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - this.remote.sendMessageRequest(RequestCode.GetDeviceInfo, dataSend, reply, option).then((ret) => { - reply.readInt(); - this.devParams.devType = reply.readInt(); - this.devParams.vendorId = reply.readString(); - this.devParams.productId = reply.readString(); - this.devParams.revision = reply.readString(); - let status2 = reply.readInt(); - if (status2 >= 0) { - this.devParams.blockNum = reply.readLong() + 1; - this.devParams.blockVolume = reply.readInt(); - } else { - this.devParams.blockNum = reply.readLong(); - this.devParams.blockVolume = reply.readInt(); - } - - this.indexUI?.updataDevParamsComponent(this.devParams); - hilog.info(0, 'testTag ui', `[app] getDeviceInfo ret:${ret} devType:${this.devParams.devType} vendorId:${this.vendorId} - productId:${this.productId} revision:${this.devParams.revision} blockNum:${this.devParams.blockNum} - blockVolume:${this.devParams.blockVolume}`); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] getDeviceInfo failed'); - }); - } - - inquiry() { - hilog.info(0, 'testTag ui', `[app] inquiry() enter`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - this.remote.sendMessageRequest(RequestCode.Inquiry, dataSend, reply, option).then((ret) => { - let result = reply.readInt(); // 接收命令的执行结果 - let devType = reply.readInt(); - let idVendor = reply.readString(); - let idProduct = reply.readString(); - let revision = reply.readString(); - let originData = reply.readString(); - let respData = 'devType: ' + devType + ';\n' + - ': ' + idVendor.trim() + ';\n' + - 'productId: ' + idProduct.trim() + ';\n' + - 'revision: ' + revision.trim + ';\n' + - 'originData: ' + originData.trim() + ';\n'; - this.indexUI?.updateSendCommandComponent(result, respData); - hilog.info(0, 'testTag ui', `[app] inquiry() result:${result} respData:${respData}`); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] inquiry() failed'); - }); - } - - capacityTransferToSuitUnit(devVolume: number) { - let capacity = ''; - let devVolumeFloat = 0; - if (devVolume < 1024) { // 字节 - capacity = 'capacity: ' + devVolumeFloat + 'B'; - } else if (devVolume >= 1024 && devVolume < (1024 * 1024)) { // KB - devVolumeFloat = devVolume / 1024; - devVolumeFloat = Math.floor(devVolumeFloat * 100) / 100; - capacity = 'capacity: ' + devVolumeFloat + 'KB'; - } else if (devVolume >= (1024 * 1024) && devVolume < (1024 * 1024 * 1024)) { // M - devVolumeFloat = devVolume / 1024 / 1024; - devVolumeFloat = Math.floor(devVolumeFloat * 100) / 100; - capacity = 'capacity: ' + devVolumeFloat + 'M'; - } else if (devVolume >= (1024 * 1024 * 1024) && devVolume < (1024 * 1024 * 1024 * 1024)) { // G - devVolumeFloat = devVolume / 1024 / 1024 / 1024; - devVolumeFloat = Math.floor(devVolumeFloat * 100) / 100; - capacity = 'capacity: ' + devVolumeFloat + 'G'; - } else if (devVolume >= (1024 * 1024 * 1024 * 1024) && devVolume < (1024 * 1024 * 1024 * 1024 * 1024)) { // T - devVolumeFloat = devVolume / 1024 / 1024 / 1024 / 1024; - devVolumeFloat = Math.floor(devVolumeFloat * 100) / 100; - capacity = 'capacity: ' + devVolumeFloat + 'T'; - } - - return capacity; - } - - readCapacity(blockAddr: number) { - hilog.info(0, 'testTag ui', `[app] readCapacity() enter`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - - dataSend.writeLong(blockAddr); - this.remote.sendMessageRequest(RequestCode.ReadCapacity, dataSend, reply, option).then((ret) => { - // 接收数据 - let result = reply.readInt(); // 接收命令的执行结果 - let lbAddr = reply.readLong(); - let blockVolume = reply.readInt(); - - // 组装数据 - let respData = 'last LBA: ' + lbAddr + ';\n' + - 'number of logical blocks: ' + (lbAddr + 1) + ';\n' + - 'logical block length: ' + blockVolume + 'byte;\n'; - if (result < 0) { - respData = ''; - } - - // 更新数据并在页面展示 - this.indexUI?.updateSendCommandComponent(result, respData); - hilog.info(0, 'testTag ui', `[app] readCapacity() result: ${result}, respData:${respData}`); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] readCapacity() failed'); - }); - } - - testUnitReady(blockStartAddr:number, blockEndAddr:number) { - hilog.info(0, 'testTag ui', `[app] testUnitReady() enter`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - this.remote.sendMessageRequest(RequestCode.TestUnitReady, dataSend, reply, option).then((ret) => { - // 有待进一步验证确定 - let result = reply.readInt(); // 接收命令的执行结果 - this.indexUI?.updateSendCommandComponent(result, ''); - hilog.info(0, 'testTag ui', `[app] testUnitReady() result:${result} `); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] testUnitReady() failed'); - }); - } - - readBlockData(blockStartAddr:number, blockNum:number) { - hilog.info(0, 'testTag ui', `[app] readBlockData() enter`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - dataSend.writeInt(blockStartAddr); - dataSend.writeInt(blockNum); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - this.remote.sendMessageRequest(RequestCode.ReadBlockData, dataSend, reply, option).then((ret) => { - let result = reply.readInt(); // 接收读操作的执行结果 - let respData = 'data: ' + reply.readString(); - this.indexUI?.updateSendCommandComponent(result, respData); - hilog.info(0, 'testTag ui', `[app] readBlockData() readData:${respData}`); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] readBlockData() failed'); - }); - } - - writeBlockData(blockStartAddr:number, blockNum:number, dataFromInput:string) { - hilog.info(0, 'testTag ui', `[app] writeBlockData() enter`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - dataSend.writeInt(blockStartAddr); - dataSend.writeInt(blockNum); - dataSend.writeString(dataFromInput); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - this.remote.sendMessageRequest(RequestCode.WriteBlockData, dataSend, reply, option).then((ret) => { - let result = reply.readInt(); // 接收写操作的执行结果 - this.indexUI?.updateSendCommandComponent(result, ''); - hilog.info(0, 'testTag ui', `[app] writeBlockData() result:${result} `); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] writeBlockData() failed'); - }); - - return; - } - - verify(blockStartAddr:number, blockNum:number) { - hilog.info(0, 'testTag ui', `[app] verify() enter`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - dataSend.writeInt(blockStartAddr); - dataSend.writeInt(blockNum); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - this.remote.sendMessageRequest(RequestCode.VerifyBlockData, dataSend, reply, option).then((ret) => { - let result = reply.readInt(); // 接收e命令的执行结果 - this.indexUI?.updateSendCommandComponent(result, ''); - hilog.info(0, 'testTag ui', `[app] verify() result:${result}`); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] verify() failed'); - }); - - return; - } - - requestSense() { - hilog.info(0, 'testTag ui', `[app] requestSense() enter`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - this.remote.sendMessageRequest(RequestCode.RequestSense, dataSend, reply, option).then((ret) => { - // 接收数据 - let result = reply.readInt(); // 接收request sense命令的执行结果 - let senseData = reply.readString(); - let senseInfo = reply.readString(); - - // 组装数据 - let respData = 'sense data: ' + senseData + ';\n' + senseInfo; - - // 更新数据并显示到页面 - this.indexUI?.updateSendCommandComponent(result, respData); - hilog.info(0, 'testTag ui', `[app] requestSense() respData:${respData}`); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] requestSense() failed'); - }); - - return; - } - - sendCommonCDBData(cdbData: number[], extraData: string, cdbLen: number, dir: number) { - hilog.info(0, 'testTag ui', `[app] sendCommonCDBData() enter`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - hilog.info(0, 'testTag ui', `sendCommonCDBData cmdData:${cdbData}, extraData:${extraData}`); - dataSend.writeByteArray(cdbData); - dataSend.writeString(extraData); - dataSend.writeInt(cdbLen); - dataSend.writeInt(dir); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `[app] the remote is null`); - return; - } - - this.remote.sendMessageRequest(RequestCode.SendCdbData, dataSend, reply, option).then((ret) => { - let result = reply.readInt(); // 接收命令执行结果 - let respData = reply.readString(); // 接收响应数据 - - // 更新数据并显示到页面 - this.indexUI?.updateComCommandComponent(result, respData); - hilog.info(0, 'testTag ui', `[app] sendCommonCDBData() result:${result} readData:${respData} readDataLen:${respData.length} `); - }).catch(() => { - hilog.info(0, 'testTag ui', '[app] sendCommonCDBData() failed'); - }); - - return; - } -} - diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/utils/DevParams.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/utils/DevParams.ets deleted file mode 100644 index 6593c1a9a5b878c7d29810a6e496b1534c3b4bef..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/utils/DevParams.ets +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export default class DevParams { - public deviceId: number = -1; - public devType: number = -1; - public vendorId: string = ''; - public productId: string = ''; - public revision: string = ''; - public volumeNumType: number = 0; - public volumeStrType: string = ''; - public blockNum: number = 0; - public blockVolume: number = 0; - - capacityTransferToSuitUnit(devVolume: number) { - let capacity = ''; - let devVolumeFloat = 0; - if (devVolume < 1024) { // 字节 - capacity = devVolumeFloat + 'B'; - } else if (devVolume >= 1024 && devVolume < (1024 * 1024)) { // KB - devVolumeFloat = devVolume / 1024; - devVolumeFloat = Math.floor(devVolumeFloat * 100) / 100; - capacity = devVolumeFloat + 'KB'; - } else if (devVolume >= (1024 * 1024) && devVolume < (1024 * 1024 * 1024)) { // M - devVolumeFloat = devVolume / 1024 / 1024; - devVolumeFloat = Math.floor(devVolumeFloat * 100) / 100; - capacity = devVolumeFloat + 'M'; - } else if (devVolume >= (1024 * 1024 * 1024) && devVolume < (1024 * 1024 * 1024 * 1024)) { // G - devVolumeFloat = devVolume / 1024 / 1024 / 1024; - devVolumeFloat = Math.floor(devVolumeFloat * 100) / 100; - capacity = devVolumeFloat + 'G'; - } else if (devVolume >= (1024 * 1024 * 1024 * 1024) && devVolume < (1024 * 1024 * 1024 * 1024 * 1024)) { // T - devVolumeFloat = devVolume / 1024 / 1024 / 1024 / 1024; - devVolumeFloat = Math.floor(devVolumeFloat * 100) / 100; - capacity = devVolumeFloat + 'T'; - } - - return capacity; - } - - setValue(devParams: DevParams) { - this.deviceId = devParams.deviceId; - this.devType = devParams.devType; - this.vendorId = devParams.vendorId; - this.productId = devParams.productId; - this.revision = devParams.revision; - this.blockNum = devParams.blockNum; - this.blockVolume = devParams.blockVolume; - - this.volumeNumType = (this.blockNum + 1) * this.blockVolume; - this.volumeStrType = this.capacityTransferToSuitUnit(this.volumeNumType); - } - - clear() { - this.deviceId = -1; - this.devType = -1; - this.vendorId = ''; - this.productId = ''; - this.revision = ''; - this.volumeNumType = 0; - this.volumeStrType = ''; - this.blockNum = 0; - this.blockVolume = 0; - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/utils/RequestCode.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/utils/RequestCode.ets deleted file mode 100644 index acec3c89de7a60ae0883be31936a3416fcb6b802..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/ets/utils/RequestCode.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export enum RequestCode { - ConnectStatus = 1, - GetDeviceInfo = 2, - Inquiry = 3, - ReadCapacity = 4, - TestUnitReady = 5, - ReadBlockData = 6, - WriteBlockData = 7, - VerifyBlockData = 8, - RequestSense = 9, - SendCdbData = 10, -}; - -export enum DirectionType { - None = -1, - ToDev = -2, - FromDev = -3, - ToFromDev = -4, -}; \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/module.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/module.json5 deleted file mode 100644 index 05ad89bf788ad7c7eac4274092ec3df9710d517f..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/module.json5 +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "2in1" - ], - "requestPermissions": [ - { - "name": "ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER" - }, - { - "name": "ohos.permission.ACCESS_DDK_SCSI_PERIPHERAL" - } - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:startIcon", - "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": "DriverAbility", - "srcEntry": "./ets/DriverAbility/driver.ts", - "icon": "$media:app_icon", - "exported": true, - "type": "driver", - "metadata": [ - { - "name": "bus", // 必填项,所属总线 - "value": "USB" - }, - { - "name": "desc", // 必填项,必要的驱动描述 - "value": "the sample of mouse driver" - }, - { - "name": "vendor", // 必填项,驱动厂商名称 - "value": "logitech" - }, - { - "name": "vid", // 支持 USB vendor id 列表,用逗号分隔,不可为空 - "value": "0x93A,0x46D,0x58F,0x17EF,0x0,0x1005,0x5448,0x5117,0x781,0x048D,0x346D,0x3689" - }, - { - "name": "pid", // 支持的 USB product id 列表,用逗号分隔,不可为空 - "value": "0x2510,0xC077,0x6387,0x6019,0x3825, 0x608D,0xB113,0x4,0x0840,0x5590,0x1234,0x5678,0x2020" - } - ] - } - ] - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/element/color.json b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/element/string.json b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 5b6304a516f7864be0b42c05cb5bc05d4d213a64..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "mass-storage-device" - }, - { - "name": "direction", - "value": "方向:" - }, - { - "name": "result", - "value": "执行结果:" - }, - { - "name": "send", - "value": "发送" - }, - { - "name": "cdb_data", - "value": "CDB数据(网格内数据请输入十六进制数据,不包含0x)" - }, - { - "name": "cdb_data_bit", - "value": "CDB数据字节数(6~16):" - }, - { - "name": "dev_type", - "value": "设备类型:" - }, - { - "name": "vendor_id", - "value": "制造商:" - }, - { - "name": "product_id", - "value": "产品标识:" - }, - { - "name": "revision", - "value": "产品版本:" - }, - { - "name": "volume", - "value": "容量:" - }, - { - "name": "block_num", - "value": "块数:" - }, - { - "name": "block_volume", - "value": "块大小:" - }, - { - "name": "commands", - "value": "SCSI命令:" - }, - { - "name": "block_start", - "value": "起始块:" - }, - { - "name": "block_num_str", - "value": "块 数:" - }, - { - "name": "exec_result", - "value": "执行结果:" - }, - { - "name": "data", - "value": "数据" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/background.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/foreground.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/layered_image.json b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/startIcon.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/profile/backup_config.json b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/profile/main_pages.json b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/en_US/element/string.json b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 5b6304a516f7864be0b42c05cb5bc05d4d213a64..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "mass-storage-device" - }, - { - "name": "direction", - "value": "方向:" - }, - { - "name": "result", - "value": "执行结果:" - }, - { - "name": "send", - "value": "发送" - }, - { - "name": "cdb_data", - "value": "CDB数据(网格内数据请输入十六进制数据,不包含0x)" - }, - { - "name": "cdb_data_bit", - "value": "CDB数据字节数(6~16):" - }, - { - "name": "dev_type", - "value": "设备类型:" - }, - { - "name": "vendor_id", - "value": "制造商:" - }, - { - "name": "product_id", - "value": "产品标识:" - }, - { - "name": "revision", - "value": "产品版本:" - }, - { - "name": "volume", - "value": "容量:" - }, - { - "name": "block_num", - "value": "块数:" - }, - { - "name": "block_volume", - "value": "块大小:" - }, - { - "name": "commands", - "value": "SCSI命令:" - }, - { - "name": "block_start", - "value": "起始块:" - }, - { - "name": "block_num_str", - "value": "块 数:" - }, - { - "name": "exec_result", - "value": "执行结果:" - }, - { - "name": "data", - "value": "数据" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_about_normal.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_about_normal.svg deleted file mode 100644 index 3387f4c0237a0a0ab89f8f0693eef37f73fdf505..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_about_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_about_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_about_select.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_about_select.svg deleted file mode 100644 index 6ff81e52e7479add0160ec1854eb839293b2bb7f..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_about_select.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_about_select - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg deleted file mode 100644 index e6424755b97e7fa4d50c76a659b69f6858b3b3d8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_keyboard_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg deleted file mode 100644 index 60863085dd74ac26f9ad9113268d981fc58ca447..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_keyboard_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg deleted file mode 100644 index e33896c20c382c604d8417754a6d88e908d14c19..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_locale_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg deleted file mode 100644 index 8c9ee3b63c47c9355c04681a8c4ca07ce6f47114..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_locale_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_pen.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_pen.png deleted file mode 100644 index 9d959aeabe36bc25d7bdbcc4bb9aad9d530ac902..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_pen.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg deleted file mode 100644 index e878183476d1b9455531d53b2e56d308da5f10ba..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_pen_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg deleted file mode 100644 index 7a8acea71607f4d95f8ba9cc2fd6e0ab6e4f972e..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_pen_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg deleted file mode 100644 index 94d8f1301720fab6674660010a9c371e8467fbd0..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_quit_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_save_normal.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_save_normal.svg deleted file mode 100644 index 7868f7037dd42dc49eedb578956c7496b2e080d8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_save_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_save_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_set_normal.svg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_set_normal.svg deleted file mode 100644 index 265b373f41b5a82dfaffc9e9721d91876b8ee4dc..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/ic_set_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_set_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/log102.jpeg b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/log102.jpeg deleted file mode 100644 index b67c2515d0fe85898836f42eb99c8c05bcbb7b93..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/log102.jpeg and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pens.PNG b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pens.PNG deleted file mode 100644 index 13e2abe82a62533a429497071f6c336961a45285..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pens.PNG and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png deleted file mode 100644 index 84bd71a268b532582b680827b7b2c93a6436cf95..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png deleted file mode 100644 index d2b5097a2c9f3420908f6a203f2181a3d060a3f8..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png deleted file mode 100644 index d2db5a1b220d889e4536e46c15216d5c470445be..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png deleted file mode 100644 index b50f6e3d445c7ad2a5a13c722385a9dcc8e10a05..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png deleted file mode 100644 index b7d79bb8125b0bb51f3c2ebb57b6a092b125d3c7..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png deleted file mode 100644 index a3dff6a1663db6d344bac6f20b895c888635203f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png deleted file mode 100644 index 871236a32219b18f9e57a678513b006d4e51a087..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png deleted file mode 100644 index b8bc8e3b929000362bcea64a0629746145df8920..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/zh_CN/element/string.json b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 9b425bb59596926b7f07fab93eca42160dcf7942..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "mass-storage-device" - }, - { - "name": "direction", - "value": "方向:" - }, - { - "name": "result", - "value": "执行结果:" - }, - { - "name": "send", - "value": "发送" - }, - { - "name": "cdb_data", - "value": "CDB数据(网格内数据请输入十六进制数据,不包含0x)" - }, - { - "name": "cdb_data_bit", - "value": "CDB数据字节数(6~16):" - }, - { - "name": "dev_type", - "value": "设备类型:" - }, - { - "name": "vendor_id", - "value": "制造商:" - }, - { - "name": "product_id", - "value": "产品标识:" - }, - { - "name": "revision", - "value": "产品版本:" - }, - { - "name": "volume", - "value": "容量:" - }, - { - "name": "block_num", - "value": "块数:" - }, - { - "name": "block_volume", - "value": "块大小:" - }, - { - "name": "commands", - "value": "SCSI命令:" - }, - { - "name": "block_start", - "value": "起始块:" - }, - { - "name": "block_num_str", - "value": "块 数:" - }, - { - "name": "exec_result", - "value": "执行结果:" - }, - { - "name": "data", - "value": "数据" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/mock/mock-config.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/ohosTest/ets/test/Ability.test.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 826af8be91043299b7c0e3173f6375ddf72c63bd..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Level } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('testConnnectState',Level.LEVEL1, async (done: Function) => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - console.info('uitest: TestUiExample begin'); - // 初始化Driver对象 - const driver = Driver.create(); - const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - console.info('uitest: bundleName=', bundleName); - // 指定被测应用包名、ability名,请开发者替换为被测应用包名和ability名 - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - } - // 拉起被测应用 - await delegator.startAbility(want); - console.info('uitest: startAbility'); - // 等待应用拉起完成 - await driver.waitForIdle(500,1000); - // 确认当前应用顶部Ability为指定的ability - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - - // 依据指定文本“设备未连接”查找目标控件 - await driver.assertComponentExist(ON.text('设备未连接')); - // 点击目标控件 - await driver.waitForIdle(4000,5000); - await sleep(3000); - // 通过断言文本为“设备已连接”的控件存在,确认操作后页面变化符合预期 - await driver.assertComponentExist(ON.text('设备已连接')); - await driver.pressBack(); - done(); - }) - }) -} - -function sleep(ms: number): Promise { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/ohosTest/ets/test/List.test.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index cb3acc6568498776523e81b07c7ebd876d3b2fc4..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/ohosTest/module.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/test/List.test.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/test/List.test.ets deleted file mode 100644 index 1ea8dc0e3feb08cda8a3a325c8f42cf5b4f83261..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/test/LocalUnit.test.ets b/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 9938a8c6863e827d8f7b9be1da9de0b6a4c38471..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/hvigor/hvigor-config.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/ScsiPeripheralDemo/hvigorfile.ts b/DriverDevelopmentKit/ScsiPeripheralDemo/hvigorfile.ts deleted file mode 100644 index 9e275a87e18fb8f539c5b5fa84ee68dfb03123a3..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/ScsiPeripheralDemo/oh-package.json5 b/DriverDevelopmentKit/ScsiPeripheralDemo/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/ohosTest.md b/DriverDevelopmentKit/ScsiPeripheralDemo/ohosTest.md deleted file mode 100644 index 3192dab82891a5f6b6fcfe41064c3feb81cd60d9..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/ScsiPeripheralDemo/ohosTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# SCSI协议类存储设备驱动测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 |测试结果| -|----------|------------------|--------------------|------------|------|--------------------------------| -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 |Pass| -| 设备识别 | 插入外设(SCSI协议类U盘) | 手动插入外设 | 连接状态显示已连接 | 否 |Pass| -| 设备主要参数读取 | 位于主页 | 设备连接上会自动读取 | 能正确读取设备信息 | 否 |Pass| -| 常用命令测试 | 位于常用命令页 | SCSI命令下拉框选择Inquery | 能查询设备信息 | 否 |Pass| -| 通用命令测试 | 位于通用命令页 | 手动填写通用命令各个字段参数 | 能正确发送及返回数据 | 否 |Pass| -| 退出 | 位于主页页 | 点击“退出” | 应用能正常退出 | 否 |Pass| \ No newline at end of file diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/screenshots/com_cmd.png b/DriverDevelopmentKit/ScsiPeripheralDemo/screenshots/com_cmd.png deleted file mode 100644 index b8ea11ac1daf5f749ccf35bf912e67e0894b0de3..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/screenshots/com_cmd.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/screenshots/main.png b/DriverDevelopmentKit/ScsiPeripheralDemo/screenshots/main.png deleted file mode 100644 index 4a258174560031d6489626982bcdbd5c1c101978..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/screenshots/main.png and /dev/null differ diff --git a/DriverDevelopmentKit/ScsiPeripheralDemo/screenshots/usual_cmd.png b/DriverDevelopmentKit/ScsiPeripheralDemo/screenshots/usual_cmd.png deleted file mode 100644 index c936fbd8213ca78d2eb4ced410c86822f57d7d80..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/ScsiPeripheralDemo/screenshots/usual_cmd.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/.gitignore b/DriverDevelopmentKit/UsbDriverDemo/.gitignore deleted file mode 100644 index 8aa0419d18a172c1c7b91aa32994a07dc8eeb5a8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -**/oh-package-lock.json5 -/sign \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/AppScope/app.json5 b/DriverDevelopmentKit/UsbDriverDemo/AppScope/app.json5 deleted file mode 100644 index 66c83bcdf9c876818c2bc0e12ee05a2286d50a86..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.usbdriverdemo", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/element/string.json b/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/element/string.json deleted file mode 100644 index 9850968a3124bfc632e10d7b50256f2b92adf37b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "UsbDriverDemo" - } - ] -} diff --git a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/app_icon.jpg b/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/app_icon.jpg deleted file mode 100644 index 5161726841612eb3f9ffd5d86207f849c14bd7cb..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/app_icon.jpg and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/background.png b/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/foreground.png b/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/layered_image.json b/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/README_zh.md b/DriverDevelopmentKit/UsbDriverDemo/README_zh.md deleted file mode 100644 index 60b168adecb9b7124f9794e03d1cc2e8b25f7c68..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/README_zh.md +++ /dev/null @@ -1,91 +0,0 @@ -# 驱动开发服务 - -### 介绍 - -本示例主要展示了通过DriverDevelopmentKit开发套件中USB DDK开发驱动服务端,使用[@ohos.driver.deviceManager](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-driver-deviceManager.md) 、[@ohos.app.ability.DriverExtensionAbility](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-app-ability-driverExtensionAbility.md) 、[@ohos.rpc](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ipc-kit/js-apis-rpc.md)、[USB DDK](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/capi-usb-ddk-api-h.md)、[HID DDK](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/capi-hid-ddk-api-h.md) -等接口,实现了整个手写板驱动功能,包括手写板UI参数设置界面及驱动服务端。其中UI参数界面包括按键设置、区域设置、关于界面、保存按钮、tokenID界面,驱动服务端通过客户端绑定拉起,驱动服务端主要给UI参数界面提供接口及与物理设备通信; - -### 效果预览 - -| 主页(按键设置) | 区域设置 | 关于 | 获取token | -|----------|--------------------------------------|---------------------------------|---------------------------------| -| ![image](screenshots/main.png) | ![image](screenshots/locale_set.png) | ![image](screenshots/about.png) | ![image](screenshots/token.png) | - -使用说明 - -1. 安装该示例应用后,当目标设备插入时,扩展外设驱动服务SA会拉起DriverExtensionAbility相关进程(即:手写板驱动服务端) -2. 在主界面绘制完成后,会调用deviceManager的绑定接口,绑定驱动服务端,成功后主界面会显示“设备已连接”; -3. 主界面展示了手写板上4个按钮,用户可以自定义手写板4个按钮功能; -4. 区域设置可以设置手写板绘画区域与系统显示界面的对应关系 -5. 关于界面显示手写板产品信息,包括vendorId、productId -6. 保存按钮,用来保存用户设置 - -### 工程目录 - -给出项目中关键的目录结构并描述它们的作用,示例如下: - -``` -entry/src/main/ets -|---components -| |---AboutComponent.ets //“关于”部件页面构造 -| |---KeyPressComponent.ets //“按键设置”部件页面构造 -| |---PensComponent.ets //“笔”部件页面构造 -| |---RegionComponent.ets //“区域设置”部件页面构造 -|---DriverAbility -| |---driver.ts //主要重载了继承驱动扩展能力DriverExtensionAbility,Onit初始化USB接口等 -|---entryability -|---pages -| |---Index.ets //应用首页 -|---tool -| |---RpcTool.ets //主要封装了扩展外设相关接口,实现相关功能,如:查询设备,绑定设备,连接远程对象等 -entry/src/main/cpp -|---types -| |---libentry //创建native c++工程,自动生成的文件目录 -|---data_parser.cpp //主要封装了手写笔和按键相关接口,实现相关功能,如:笔的移动或者按下,按键的按下或者抬起等功能 -|---data_parser.h //定义DataParser类,声明相关接口和成员变量 -|---hello.cpp //主要封装了手写板驱动相关接口,实现相关功能,如:获取键盘输入,设置方向,获取方向等功能 -|---hid_simulator.cpp //主要封装了转换事件数据相关接口,实现相关功能,如:转换移动事件数据,转换按键事件数据等功能 -|---hid_simulator.h //定义了HidSimulator类,声明了数据类型EventType,EventData -|---inject_thread.cpp //主要封装了线程相关接口,实现相关功能,如:创建触摸屏设备,创建键盘设备等相关功能 -|---inject_thread.h //定义了InjectThread类,声明了相关接口和成员变量,定义了虚拟设备名称 -|---key_code.h //定义了数据类型KeyCode,声明了支持的按键值 -|---parse_point_info.cpp //实现了接口ParsePointInfo,主要功能:手写笔坐标转换 -|---parse_point_info.h //声明接口ParsePointInfo -``` - -### 具体实现 - -* 驱动UI界面,功能包括查询设备列表、绑定设备驱动服务端、与设备驱动服务端通信,源码参考:[Index.ets](code/DocsSample/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/pages/Index.ets) - * 使用deviceManager.queryDevices来获取设备列表; - * 通过deviceManager.bindDeviceDriver来绑定设备驱动服务端,通过返回值拿到驱动服务端实例; - * 通过服务端实例调用sendMessageRequest与设备驱动服务端通信,并获取到服务端回应,将回应数据打印到主界面; - -* 驱动服务端,与驱动UI界面通信,源码参考:[driver.ts](code/DocsSample/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/driverability/driver.ts) - * 当物理设备插入后,UI界面通过bindDeviceDriver接口获取到驱动服务端实例,再通过服务端实例与服务端通信; - * 驱动服务拉起后,会调用DriverExtAbility中onInit方法,可以在此方法中通过Napi接口调用CAPI,初始化USB DDK等 - * 驱动UI界面通过deviceManager调用绑定接口,会调用DriverExtAbility中onConnect返回服务端实例 - * 驱动UI界面通过服务端实例与服务端通信,服务端通过Napi接口调用CAPI,与物理设备通信 - -### 相关权限 - -[ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md) -[ohos.permission.ACCESS_DDK_USB](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/restricted-permissions.md) -[ohos.permission.ACCESS_DDK_HID](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/restricted-permissions.md) - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568; -2. 本示例为Stage模型,仅支持API11版本SDK,SDK版本号(API Version 11),镜像版本号(4.1Release) -3. 本示例需要使用DevEco Studio 版本号(6.0Release)版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/DriverDevelopmentKit > .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/DriverDevelopmentKit/UsbDriverDemo/build-profile.json5 b/DriverDevelopmentKit/UsbDriverDemo/build-profile.json5 deleted file mode 100644 index 749246729d50f570adab686c344a14dc47a2ce21..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/build-profile.json5 +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "compileSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/code-linter.json5 b/DriverDevelopmentKit/UsbDriverDemo/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/.gitignore b/DriverDevelopmentKit/UsbDriverDemo/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/build-profile.json5 b/DriverDevelopmentKit/UsbDriverDemo/entry/build-profile.json5 deleted file mode 100644 index 4fc508c047d5652000063db03511c1ae9e91df3d..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/build-profile.json5 +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - }, - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/hvigorfile.ts b/DriverDevelopmentKit/UsbDriverDemo/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/obfuscation-rules.txt b/DriverDevelopmentKit/UsbDriverDemo/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/DriverDevelopmentKit/UsbDriverDemo/entry/oh-package.json5 b/DriverDevelopmentKit/UsbDriverDemo/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/CMakeLists.txt b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 6d7b0e71ff9c97a4a69ebfa03f67ec75be221c1f..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.4.1) -project(NativeUsbMouse) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -set(CMAKE_CXX_STANDARD 17) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - - -#add_library(parse_point SHARED parse_point_info.cpp) -#add_library(libparse_point SHARED IMPORTED) -#set_target_properties(libparse_point PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/arm64-v8a/libparse_point.so) - -add_library(entry SHARED hello.cpp data_parser.cpp hid_simulator.cpp inject_thread.cpp parse_point_info.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libusb_ndk.z.so libhid.z.so libhilog_ndk.z.so -lpthread) \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/data_parser.cpp b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/data_parser.cpp deleted file mode 100644 index b24d3714f4cc3475452adfd7e2c7dc74fc200acc..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/data_parser.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#define LOG_TAG "testTag [NATIVE]" - -#include "data_parser.h" -#include "parse_point_info.h" -#include - -#define MIN_BUFFER_SIZE 10 -#define ABSX_MAX_A13F (0x5750) -#define ABSY_MAX_A13F (0x3692) -#define ABSX_MAX_A153 (0x6338) -#define ABSY_MAX_A153 (0x6338) - -static int g_absXMax = 1; -static int g_absYMax = 1; - -static bool g_isKeyDown = false; -static bool g_isPenDown = false; -static bool g_isRightKeyDown = false; -static int g_direct = 1; -static int g_keyIndex = -1; -constexpr int NUM_TWO = 2; -constexpr int NUM_THREE = 3; -constexpr int NUM_FOUR = 4; -constexpr int NUM_SIX = 6; - -#define HANDWRITING_ABSPRESSURE_MAX 8191 - -char g_outStr[256] = {0}; -static void PrintBuffer(const uint8_t *buffer, uint32_t length) -{ - int32_t index = 0; - for (uint32_t idx = 0; idx < length; ++idx) { - index += sprintf(g_outStr + index, "%02X ", buffer[idx]); - } - OH_LOG_DEBUG(LOG_APP, "recv data len: %{public}u : %{public}s", length, g_outStr); -} - -static void Reset() -{ - g_isKeyDown = false; - g_isPenDown = false; -} - -// 单例 -DataParser &DataParser::GetInstance() -{ - static DataParser parser; - return parser; -} - -void DataParser::Init(int vid, int pid) -{ - if (pid == 0xA13F) { - g_absXMax = ABSX_MAX_A13F; - g_absYMax = ABSY_MAX_A13F; - } else if (pid == 0xA150 || pid == 0xA153) { - g_absXMax = ABSX_MAX_A153; - g_absYMax = ABSY_MAX_A153; - } else { - OH_LOG_ERROR(LOG_APP, "invalid vid:%{public}x & pid:%{public}x", vid, pid); - } - g_isKeyDown = false; - g_isPenDown = false; - g_isRightKeyDown = false; - g_keyIndex = -1; -} - -void DataParser::StartWork() -{ - simulator_.StartWork(); -} - -// 更新按键映射键值 -void DataParser::UpdateKeyCodeMap(int keyIndex, int keyValue) -{ - keyCodeMap_[keyIndex] = keyValue; -} - -void DataParser::SetScreenSize(int screenWidth, int screenHeight) -{ - screenWidth_ = screenWidth; - screenHeight_ = screenHeight; -} - -void DataParser::GetAbsMax(int32_t &absXMax, int32_t &absYMax, int32_t &absPressureMax) -{ - if (screenWidth_ > screenHeight_) { - absXMax = g_absXMax; - absYMax = g_absYMax; - } else { - absXMax = g_absYMax; - absYMax = g_absXMax; - } - absPressureMax = HANDWRITING_ABSPRESSURE_MAX; -} - -// 根据屏幕宽高,调整手写板方向 -void DataParser::ConvertAbs(uint32_t &absX, uint32_t &absY) -{ - float temp = 0; - switch (g_direct) { - case 1: // 手写板 90度 - temp = absX; - absX = (static_cast(absY) / g_absYMax * g_absXMax); - absY = (static_cast(g_absXMax - temp) / g_absXMax * g_absYMax); - break; - case NUM_TWO: // 手写板 180度 - absX = g_absXMax - absX; - absY = g_absYMax - absY; - break; - case NUM_THREE: // 手写板 270度 - temp = absY; - absY = (static_cast(absX) / g_absXMax * g_absYMax); - absX = (static_cast(g_absYMax - temp) / g_absYMax * g_absXMax); - break; - default: - break; - } -} - -void DataParser::SetDirection(uint32_t direction) -{ - g_direct = direction; -} - -uint32_t DataParser::GetDirection() -{ - return g_direct; -} - -int32_t DataParser::ParseKeyData(const uint8_t *buffer, uint32_t length) -{ - g_isKeyDown = true; - if (buffer[NUM_THREE] == 0x1) { - g_keyIndex = 0; - } else if (buffer[NUM_THREE] == 0x2) { - g_keyIndex = 1; - } else if (buffer[NUM_THREE] == 0x4) { - g_keyIndex = NUM_TWO; - } else if (buffer[NUM_THREE] == 0x8) { - g_keyIndex = NUM_THREE; - } else { - g_isKeyDown = false; - if (g_keyIndex == -1) { - g_keyIndex = 0; - } - } - eventData_.type = EVENT_TYPE_KEY; - eventData_.changed = true; - eventData_.isDown = g_isKeyDown; - eventData_.keyVal = keyCodeMap_[g_keyIndex]; - return 0; -} - -int32_t DataParser::ParsePenKeyData(const uint8_t *buffer, uint32_t length) -{ - // 按下按键,或者抬起按键时,buffer[1] = 0,其他时刻是2 - if (buffer[1] == 0) { - g_isRightKeyDown = !g_isRightKeyDown; - eventData_.changed = true; - } - uint32_t xOffset = *reinterpret_cast(&buffer[NUM_TWO]); - uint32_t yOffset = *reinterpret_cast(&buffer[NUM_FOUR]); - ConvertAbs(xOffset, yOffset); - if (eventData_.changed) { - eventData_.type = EVENT_TYPE_PEN_KEY; - eventData_.isDown = g_isRightKeyDown; - } else { - eventData_.type = EVENT_TYPE_MOVE; - eventData_.isDown = false; - } - eventData_.absX = xOffset; - eventData_.absY = yOffset; - return 0; -} - -bool DataParser::IsPenUp(const uint8_t *buffer, uint32_t length) -{ - // 笔是否接触到手写板,接触到则为1,不接触到则为0 - return (length < MIN_BUFFER_SIZE || buffer[1] != 0xA1); -} - -bool DataParser::IsPenMove(const uint8_t *buffer, uint32_t length) -{ - return (length >= MIN_BUFFER_SIZE && buffer[0] == 0x03); -} - -int32_t DataParser::ParseMoveData(const uint8_t *buffer, uint32_t length) -{ - // 笔是否接触到手写板,接触到则为1,不接触到则为0 - bool downState = (buffer[1] == 0xA1); - if (g_isPenDown != downState) { - eventData_.changed = true; - g_isPenDown = downState; - } - - // x offset - uint32_t xOffset = *reinterpret_cast(&buffer[NUM_TWO]); - - // y offset - uint32_t yOffset = *reinterpret_cast(&buffer[NUM_FOUR]); - - // press - uint16_t pressValue = *reinterpret_cast(&buffer[NUM_SIX]); - - ConvertAbs(xOffset, yOffset); - eventData_.type = EVENT_TYPE_MOVE; - eventData_.absX = xOffset; - eventData_.absY = yOffset; - eventData_.isDown = g_isPenDown; - eventData_.pressVal = pressValue; - return 0; -} - -int32_t DataParser::ParsePrivateData(const uint8_t *buffer, uint32_t length) -{ - auto [withinRange, x, y, pressure, btnRight] = ParsePointInfo(buffer); - // 1 笔到达时清理现场 - if (!withinRange) { - if (btnRight) { - OH_LOG_INFO(LOG_APP, "Pen is comming"); - Reset(); - } else { - OH_LOG_INFO(LOG_APP, "Pen is leave"); - } - return -1; - } - OH_LOG_ERROR(LOG_APP, "withinRange:%{public}d btnRight:%{public}d g_isRightKeyDown:%{public}d", withinRange, - btnRight, g_isRightKeyDown); - // 如果笔上按键动作变化,则发送 EVENT_TYPE_PEN_KEY - if (g_isRightKeyDown != btnRight) { - eventData_.changed = true; - g_isRightKeyDown = btnRight; - eventData_.isDown = g_isRightKeyDown; - eventData_.type = EVENT_TYPE_PEN_KEY; - } else { - bool downState = (pressure > 0); - if (g_isPenDown != downState) { - eventData_.changed = true; - g_isPenDown = downState; - } - eventData_.isDown = g_isPenDown; - eventData_.type = EVENT_TYPE_MOVE; - } - ConvertAbs(x, y); - eventData_.absX = x; - eventData_.absY = y; - eventData_.pressVal = pressure; - return 0; -} - -int32_t DataParser::ParseData(const uint8_t *buffer, uint32_t length) -{ - PrintBuffer(buffer, length); - if (length < MIN_BUFFER_SIZE) { - OH_LOG_ERROR(LOG_APP, "invalid length"); - return -1; - } - int ret = -1; - if (buffer[0] == 0x03) { // 笔的移动或者按下事件 - ret = ParseMoveData(buffer, length); - } else if (buffer[0] == 0x0c) { // 按键的按下或者抬起事件 - ret = ParseKeyData(buffer, length); - } else if (buffer[0] == 0x1) { // 笔上的按键,无法区分上下键 - ret = ParsePenKeyData(buffer, length); - } else if (buffer[0] == 0x2) { // 私有协议 - ret = ParsePrivateData(buffer, length); - } else { - OH_LOG_INFO(LOG_APP, "recv not interesting data"); - } - OH_LOG_INFO(LOG_APP, "type:%{public}d,isDown:%{public}d,press:%{public}d,x:%{public}d,y:%{public}d,key:%{public}d", - eventData_.type, eventData_.isDown, eventData_.pressVal, eventData_.absX, eventData_.absY, - eventData_.keyVal); - if (ret == 0) { - simulator_.ConvertEventData(eventData_); - } - lastData_ = eventData_; - eventData_.Reset(); - return ret; -} diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/data_parser.h b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/data_parser.h deleted file mode 100644 index 0f026b28d727c78c1b515cc5372ea76eb68a8349..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/data_parser.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef DATA_PARSER_H -#define DATA_PARSER_H - -#include "hid_simulator.h" - -#define MAX_KEY_NUM 4 - -class DataParser { - public: - DataParser() = default; - - virtual ~DataParser() = default; - - static DataParser &GetInstance(); - - void Init(int vid, int pid); - - // 解析数据 - virtual int32_t ParseData(const uint8_t *buffer, uint32_t length); - - virtual bool IsPenUp(const uint8_t *buffer, uint32_t length); - - virtual bool IsPenMove(const uint8_t *buffer, uint32_t length); - - // 设置keycode map - void UpdateKeyCodeMap(int keyIndex, int keyValue); - - // 设置屏幕宽高 - void SetScreenSize(int screenWidth, int screenHeight); - - void GetAbsMax(int32_t &absXMax, int32_t &absYMax, int32_t &absPressureMax); - - void SetDirection(uint32_t direction); - - uint32_t GetDirection(); - - // 开启EmitEvent - void StartWork(); - - private: - int32_t ParseKeyData(const uint8_t *buffer, uint32_t length); - - int32_t ParseMoveData(const uint8_t *buffer, uint32_t length); - - int32_t ParsePenKeyData(const uint8_t *buffer, uint32_t length); - - int32_t ParseEventData(const uint8_t *buffer, uint32_t length); - - int32_t ParsePrivateData(const uint8_t *buffer, uint32_t length); - - void ConvertAbs(uint32_t &absX, uint32_t &absY); - - private: - int screenWidth_; - int screenHeight_; - EventData eventData_; - EventData lastData_; - int keyCodeMap_[MAX_KEY_NUM]; - HidSimulator simulator_; -}; - -#endif // DATA_PARSER_H diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/hello.cpp b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/hello.cpp deleted file mode 100644 index e6d96ef5b3b4a33a845788b7950dfd52aff113f6..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/hello.cpp +++ /dev/null @@ -1,595 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#define LOG_TAG "testTag [NATIVE]" - -#include "napi/native_api.h" -#include "hilog/log.h" -#include "data_parser.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -uint64_t g_devHandle = 0; -uint64_t g_interfaceHandle = 0; -uint8_t g_dataEp = 0; -uint8_t g_interface = 0; -uint16_t g_maxPktSize = 0; -bool g_stopIo = false; -UsbDeviceMemMap *devMmap = nullptr; -DDK_Ashmem *ashmem = nullptr; -constexpr size_t BTN_MAPPING_INFO_SIZE = 4; -constexpr size_t PRODUCT_DESC_MAX_LEN = 100; -constexpr unsigned long long TIME_CONVERSION_NS_S = 1000000000ULL; -constexpr int NUM_TWO = 2; -constexpr int NUM_THREE = 3; -constexpr int BIT_THIRTY_TWO = 32; -constexpr int BIT_EIGHT = 8; -constexpr int BIT_SEVEN = 7; - -// 将unicode编码形式的字符串转化为ASCII码 -std::string UnicodeToAsc(unsigned char *in, int inLen) -{ - wchar_t wstr[PRODUCT_DESC_MAX_LEN] = {0}; - unsigned short tmpShort; - int indexCnt = 0; - - for (uint32_t j = 0; j < inLen; j += NUM_TWO) { - memcpy(&tmpShort, in + j, NUM_TWO); - wstr[indexCnt++] = tmpShort; - } - char str[PRODUCT_DESC_MAX_LEN] = {0}; - size_t result = wcstombs(str, wstr, PRODUCT_DESC_MAX_LEN); - if (result == static_cast(-1)) { - OH_LOG_INFO(LOG_APP, "wcstombs error"); - return ""; - } - return std::string(str); -} - -static bool IsInterfaceIn(struct UsbEndpointDescriptor epDesc) -{ - return (((epDesc.bEndpointAddress >> BIT_SEVEN) & 1) == 1) && ((epDesc.bmAttributes & 0x03) == 0x03); -} - -static std::tuple GetInfoFromEndpoint(struct UsbDdkEndpointDescriptor *epDesc, - uint8_t bInterfaceNumber, uint32_t numEp) -{ - for (uint32_t epIdx = 0; epIdx < numEp; ++epIdx) { - struct UsbEndpointDescriptor endpointDescriptor = epDesc[epIdx].endpointDescriptor; - // interrupt in - if (IsInterfaceIn(endpointDescriptor)) { - OH_LOG_INFO(LOG_APP, "bInterfaceNumber: %{public}u\n", bInterfaceNumber); - OH_LOG_INFO(LOG_APP, "bEndpointAddress: %{public}u\n", endpointDescriptor.bEndpointAddress); - return {true, bInterfaceNumber, endpointDescriptor.bEndpointAddress, endpointDescriptor.wMaxPacketSize}; - } - } - return {false, {}, {}, {}}; -} - -// 获取手写板的接口和端点 -static std::tuple GetInterfaceAndEndpoint(const struct UsbDdkConfigDescriptor *config) -{ - for (uint32_t intIdx = 0; intIdx < config->configDescriptor.bNumInterfaces; ++intIdx) { - struct UsbDdkInterfaceDescriptor *intDesc = config->interface[intIdx].altsetting; - uint32_t numSetting = config->interface[intIdx].numAltsetting; - for (uint32_t setIdx = 0; setIdx < numSetting; ++setIdx) { - uint32_t numEp = intDesc[setIdx].interfaceDescriptor.bNumEndpoints; - struct UsbDdkEndpointDescriptor *epDesc = intDesc[setIdx].endPoint; - uint8_t bInterfaceNumber = intDesc[setIdx].interfaceDescriptor.bInterfaceNumber; - return GetInfoFromEndpoint(epDesc, bInterfaceNumber, numEp); - } - } - return {false, {}, {}, {}}; -} - -struct AsyncContext { - napi_env env; - napi_async_work work; - - napi_deferred deferred; - napi_status status; -}; - -static auto g_getKeyboardExecute = [](napi_env env, void *data) { - AsyncContext *asyncContext = reinterpret_cast(data); - uint32_t bufferLen = g_maxPktSize; - // [Start driver_usb_step5_1] - // 占用接口,同时也会卸载内核键盘驱动 - // 创建用于存放数据的缓冲区 - int32_t ret = OH_Usb_CreateDeviceMemMap(g_devHandle, bufferLen, &devMmap); - // [End driver_usb_step5_1] - if (ret != 0 || devMmap == nullptr) { - OH_LOG_ERROR(LOG_APP, "OH_Usb_CreateDeviceMemMap failed"); - asyncContext->status = napi_generic_failure; - return; - } - - DataParser &parser = DataParser::GetInstance(); - parser.StartWork(); - OH_LOG_INFO(LOG_APP, "parser.StartWork"); - g_stopIo = false; - while (!g_stopIo) { - OH_LOG_INFO(LOG_APP, "excute OH_Usb_SendPipeRequest start"); - - // [Start driver_usb_step5_2] - struct UsbRequestPipe pipe; - pipe.interfaceHandle = g_interfaceHandle; - pipe.endpoint = g_dataEp; - pipe.timeout = 4; // 中断传输超时时间,保持和手写板bInterval保持一致 - // 读取手写板数据 - // 通过USB中断传输方式,读取键值 - ret = OH_Usb_SendPipeRequest(&pipe, devMmap); - // [End driver_usb_step5_2] - if (ret != 0) { - OH_LOG_ERROR(LOG_APP, "GetUsbKeyboardInput failed"); - continue; - } - - // 处理读取到的数据 - parser.ParseData(devMmap->address, devMmap->transferedLength); - } - OH_LOG_ERROR(LOG_APP, "g_stopIo end"); - if (ret == 0) { - asyncContext->status = napi_ok; - } else { - asyncContext->status = napi_generic_failure; - } -}; - -static auto g_getKeyboardComplete = [](napi_env env, napi_status status, void *data) { - AsyncContext *asyncContext = reinterpret_cast(data); - if (asyncContext->deferred) { - napi_value result = nullptr; - napi_create_int32(env, 0, &result); - if (asyncContext->status == napi_ok) { - napi_resolve_deferred(env, asyncContext->deferred, result); - } else { - napi_reject_deferred(env, asyncContext->deferred, result); - } - } - - napi_delete_async_work(env, asyncContext->work); - delete asyncContext; -}; - -static napi_value GetBoardInput(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter GetBoardInput\n"); - - auto asyncContext = new (std::nothrow) AsyncContext(); - asyncContext->env = env; - asyncContext->status = napi_ok; - - napi_value result = nullptr; - napi_create_promise(env, &asyncContext->deferred, &result); - napi_value resource = nullptr; - napi_create_string_utf8(env, "GetKbdInput", NAPI_AUTO_LENGTH, &resource); - // 创建异步任务 - napi_status status = napi_create_async_work(env, nullptr, resource, g_getKeyboardExecute, g_getKeyboardComplete, - reinterpret_cast(asyncContext), &asyncContext->work); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s create async work failed", __func__); - return result; - } - napi_queue_async_work(env, asyncContext->work); - return result; -} - -static void SelectInterfaceSetting() -{ - // [Start driver_usb_step3] - uint8_t settingIndex = 0; - // 接口获取备用设置 - int32_t ret = OH_Usb_GetCurrentInterfaceSetting(g_interfaceHandle, &settingIndex); - if (ret != USB_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Usb_GetCurrentInterfaceSetting failed, ret=%{public}d", ret); - } - - // 激活备用设置 - ret = OH_Usb_SelectInterfaceSetting(g_interfaceHandle, settingIndex); - if (ret != USB_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Usb_SelectInterfaceSetting failed, ret=%{public}d", ret); - } - // [End driver_usb_step3] -} - -static void GetDevices() -{ - // [Start driver_usb_step7] - constexpr size_t maxUsbDeviceNum = 128; - struct Usb_DeviceArray deviceArray; - deviceArray.deviceIds = new uint64_t[maxUsbDeviceNum]; - // 获取设备列表 - int32_t ret = OH_Usb_GetDevices(&deviceArray); - if (ret != USB_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Usb_GetDevices failed, ret=%{public}d", ret); - } - // [End driver_usb_step7] -} - -static std::optional GetProductStringDescriptor(uint16_t iProduct) -{ - // [Start driver_usb_step4_2] - uint8_t strDesc[100] = {0}; - // 获取产品字符串描述符 - uint32_t len = 100; - struct UsbControlRequestSetup strDescSetup; - strDescSetup.bmRequestType = 0x80; - strDescSetup.bRequest = 0x06; - strDescSetup.wValue = (0x03 << BIT_EIGHT) | (iProduct); // desc Index - strDescSetup.wIndex = 0x409; // language Id - strDescSetup.wLength = len; - auto ret = OH_Usb_SendControlReadRequest(g_interfaceHandle, &strDescSetup, UINT32_MAX, strDesc, &len); - // [End driver_usb_step4_2] - if (ret != 0) { - OH_LOG_ERROR(LOG_APP, "send ctrl read failed%{public}d", ret); - return {}; - } - - // 将unicode形式的描述符转化为ASCII, 便于打印 - std::string desc = UnicodeToAsc(strDesc + 2, len - 2); - OH_LOG_INFO(LOG_APP, "strDesc %{public}s\n", desc.data()); - return desc; -} - -static napi_value CreateJsArray(napi_env env, const std::string &desc, uint16_t idProduct) -{ - napi_value result; - // 将获取到的产品描述符传给js层 - napi_value jsDesc; - if (napi_create_string_utf8(env, desc.data(), desc.length(), &jsDesc) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s napi_create_string_utf8 failed", __func__); - napi_get_undefined(env, &result); - return result; - } - napi_value jsProductId; - if (napi_create_uint32(env, idProduct, &jsProductId) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s napi_create_uint32 failed", __func__); - napi_get_undefined(env, &result); - return result; - } - napi_value jsArray; - if (napi_create_array(env, &jsArray) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s napi_create_array failed", __func__); - napi_get_undefined(env, &result); - return result; - } - if (napi_set_element(env, jsArray, 0, jsDesc) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s napi_set_element 0 failed", __func__); - napi_get_undefined(env, &result); - return result; - } - if (napi_set_element(env, jsArray, 1, jsProductId) != napi_ok) { - OH_LOG_ERROR(LOG_APP, "%{public}s napi_set_element 1 failed", __func__); - napi_get_undefined(env, &result); - return result; - } - return jsArray; -} - -static bool GetPipeInfo() -{ - OH_LOG_INFO(LOG_APP, "GetPipeInfo enter"); - - // [Start driver_usb_step2] - struct UsbDdkConfigDescriptor *config = nullptr; - // 获取配置描述符 - auto ret = OH_Usb_GetConfigDescriptor(g_devHandle, 1, &config); - OH_LOG_INFO(LOG_APP, "OH_Usb_GetConfigDescriptor ret = %{public}d", ret); - if (ret != 0) { - OH_LOG_ERROR(LOG_APP, "get config desc failed:%{public}d", ret); - return false; - } - // 从配置描述符中找到手写板相关的接口和端点 - auto [res, interface, endpoint, maxPktSize] = GetInterfaceAndEndpoint(config); - OH_LOG_INFO(LOG_APP, "OH_Usb_GetConfigDescriptor ret = %{public}d", res); - if (!res) { - OH_LOG_ERROR(LOG_APP, "GetInterfaceAndEndpoint failed"); - return false; - } - // 释放配置描述符,防止内存泄露 - OH_Usb_FreeConfigDescriptor(config); - g_dataEp = endpoint; - g_maxPktSize = maxPktSize; - g_interface = interface; - // 占用接口,同时也会卸载内核键盘驱动 - ret = OH_Usb_ClaimInterface(g_devHandle, g_interface, &g_interfaceHandle); - // [End driver_usb_step2] - if (ret != 0) { - OH_LOG_ERROR(LOG_APP, "claim interface failed%{public}d", ret); - return false; - } - return true; -} - -static std::tuple GetDeviceInfo() -{ - // [Start driver_usb_step1] - // 初始化USB DDK - int32_t ret = OH_Usb_Init(); - OH_LOG_INFO(LOG_APP, "OH_Usb_Init ret=:%{public}d\n", ret); - // [StartExclude driver_usb_step1] - if (ret != 0) { - OH_LOG_ERROR(LOG_APP, "init ddk failed"); - return {false, {}}; - } - // [EndExclude driver_usb_step1] - struct UsbDeviceDescriptor devDesc; - // 获取设备描述符 - ret = OH_Usb_GetDeviceDescriptor(g_devHandle, &devDesc); - // [End driver_usb_step1] - if (ret != 0) { - OH_LOG_ERROR(LOG_APP, "get dev desc failed:%{public}d", ret); - return {false, {}}; - } - // 过滤目的设备 - if (devDesc.idVendor != 0x0b57 || (devDesc.idProduct != 0x8835 && devDesc.idProduct != 0xa153 && - devDesc.idProduct != 0xa150 && devDesc.idProduct != 0x8811 && devDesc.idProduct != 0xA13F)) { - OH_LOG_ERROR(LOG_APP, "device invalid :%{public}u, %{public}u", devDesc.idVendor, devDesc.idProduct); - return {false, {}}; - } - - return {true, devDesc}; -} - -static void SetFeature(uint16_t iProduct) -{ - OH_LOG_INFO(LOG_APP, "SetFeature enter\n"); - - if (iProduct != 0xA150 && iProduct != 0xA153) { - OH_LOG_WARN(LOG_APP, "no need set feature\n"); - return; - } - - // [Start driver_usb_step4_1] - // 设置feature - uint32_t timeout = 5000; - struct UsbControlRequestSetup strDescSetup; - strDescSetup.bmRequestType = 0x21; - strDescSetup.bRequest = 0x09; - strDescSetup.wValue = ((0x03 << BIT_EIGHT) | 0x02); // desc Index - strDescSetup.wIndex = 0x0; - strDescSetup.wLength = 0x02; - uint8_t data[128] = {0x02, 0x02}; - uint32_t dataLen = 2; - int32_t ret = OH_Usb_SendControlWriteRequest(g_interfaceHandle, &strDescSetup, timeout, data, dataLen); - // [End driver_usb_step4_1] - if (ret < 0) { - OH_LOG_ERROR(LOG_APP, "OH_Usb_SendControlWriteRequest error ret:%{public}d", ret); - } - OH_LOG_INFO(LOG_APP, "SetFeature OK!"); -} - -static napi_value GetProductDesc(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter GetProductDesc\n"); - napi_value result; - // 解析deviceId - size_t argc = 1; - napi_value argv; - - napi_get_cb_info(env, info, &argc, &argv, nullptr, nullptr); - if (argc < 1) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - napi_get_undefined(env, &result); - return result; - } - - uint32_t devicedId = 0; - napi_get_value_uint32(env, argv, &devicedId); - uint32_t busNum = ((devicedId & 0xFFFF0000) >> 16); - uint32_t deviceNum = devicedId & 0xFFFF; - g_devHandle = (static_cast(busNum) << BIT_THIRTY_TWO) | deviceNum; - - auto [res, devDesc] = GetDeviceInfo(); - OH_LOG_INFO(LOG_APP, "GetDeviceInfo ret=:%{public}d\n", res); - if (!res) { - napi_get_undefined(env, &result); - return result; - } - - if (!GetPipeInfo()) { - napi_get_undefined(env, &result); - return result; - } - DataParser::GetInstance().Init(devDesc.idVendor, devDesc.idProduct); - - SetFeature(devDesc.idProduct); - - auto productDesc = GetProductStringDescriptor(devDesc.iProduct); - if (!productDesc.has_value()) { - OH_LOG_ERROR(LOG_APP, "GetProductStringDescriptor failed"); - napi_get_undefined(env, &result); - return result; - } - return CreateJsArray(env, productDesc.value(), devDesc.idProduct); -} - -static napi_value ReleaseResource(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter ReleaseResource\n"); - g_stopIo = true; - // [Start driver_usb_step6] - // 销毁缓冲区 - OH_Usb_DestroyDeviceMemMap(devMmap); - // 释放接口 - int32_t ret = OH_Usb_ReleaseInterface(g_interfaceHandle); - if (ret != 0) { - OH_LOG_ERROR(LOG_APP, "ReleaseInterface failed %{public}d", ret); - } - // 释放USB DDK - OH_Usb_Release(); - // [End driver_usb_step6] - return nullptr; -} - -// 设置屏幕分辨率,方便后续坐标标准化 -static napi_value SetDisplayInfo(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter SetDisplayInfo\n"); - size_t argc = NUM_TWO; - napi_value args[NUM_TWO] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < NUM_TWO) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - - uint32_t width; - uint32_t height = 0; - napi_get_value_uint32(env, args[0], &width); - napi_get_value_uint32(env, args[1], &height); - OH_LOG_INFO(LOG_APP, "display info width:%{public}u, height:%{public}u", width, height); - DataParser::GetInstance().SetScreenSize(width, height); - return nullptr; -} - -// 设置按键定制 -static napi_value SetButtonMapping(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter SetButtonMapping\n"); - size_t argc = 1; - napi_value arg = {nullptr}; - - napi_get_cb_info(env, info, &argc, &arg, nullptr, nullptr); - if (argc < 1) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - bool isTypedArray = false; - if (napi_is_typedarray(env, arg, &isTypedArray) != napi_ok || !isTypedArray) { - OH_LOG_ERROR(LOG_APP, "The type of mappingInfo must be TypedArray."); - return nullptr; - } - - napi_typedarray_type type; - napi_value buffer; - int32_t *int32Buffer = nullptr; - size_t bufferSize = 0; - size_t offset = 0; - napi_status infoStatus = napi_get_typedarray_info( - env, arg, &type, &bufferSize, reinterpret_cast(&int32Buffer), &buffer, &offset); - if (infoStatus != napi_ok) { - OH_LOG_ERROR(LOG_APP, "get typedarray info failed, status: %{public}d", infoStatus); - return nullptr; - } - if (type != napi_int32_array) { - OH_LOG_ERROR(LOG_APP, "The type of buffer must be int32Array."); - return nullptr; - } - if (bufferSize == 0 || bufferSize > BTN_MAPPING_INFO_SIZE * sizeof(int32_t)) { - OH_LOG_ERROR(LOG_APP, "The size of buffer invalid%{public}zu", bufferSize); - return nullptr; - } - DataParser::GetInstance().UpdateKeyCodeMap(0, int32Buffer[0]); - DataParser::GetInstance().UpdateKeyCodeMap(1, int32Buffer[1]); - DataParser::GetInstance().UpdateKeyCodeMap(NUM_TWO, int32Buffer[NUM_TWO]); - DataParser::GetInstance().UpdateKeyCodeMap(NUM_THREE, int32Buffer[NUM_THREE]); - return nullptr; -} - -// 设置按键定制 -static napi_value SetOneButtonMapping(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter SetOneButtonMapping\n"); - size_t argc = NUM_TWO; - napi_value args[NUM_TWO] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < NUM_TWO) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - - uint32_t index; - uint32_t keyCode = 0; - napi_get_value_uint32(env, args[0], &index); - napi_get_value_uint32(env, args[1], &keyCode); - DataParser::GetInstance().UpdateKeyCodeMap(index, keyCode); - return nullptr; -} - -// 设置按键定制 -static napi_value SetDirection(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter SetDirection\n"); - size_t argc = 1; - napi_value args[1] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < 1) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - - uint32_t direction = 0; - napi_get_value_uint32(env, args[0], &direction); - DataParser::GetInstance().SetDirection(direction); - return nullptr; -} - -// 设置按键定制 -static napi_value GetDirection(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter GetDirection\n"); - uint32_t direction = DataParser::GetInstance().GetDirection(); - napi_value result = nullptr; - napi_create_int32(env, direction, &result); - return result; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - {"getBoardInput", nullptr, GetBoardInput, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"getProductDesc", nullptr, GetProductDesc, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"releaseResource", nullptr, ReleaseResource, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setDisplayInfo", nullptr, SetDisplayInfo, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setButtonMapping", nullptr, SetButtonMapping, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setOneButtonMapping", nullptr, SetOneButtonMapping, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setDirection", nullptr, SetDirection, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"getDirection", nullptr, GetDirection, nullptr, nullptr, nullptr, napi_default, nullptr}, - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/hid_simulator.cpp b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/hid_simulator.cpp deleted file mode 100644 index 118b67cbd2d8ef2c3780ac793a3328e5c16eb4cd..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/hid_simulator.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "hid_simulator.h" -#include "data_parser.h" -#include -#include -#include "key_code.h" - -#define DOWN 1 -#define UP 0U - -Hid_EmitItem synEvent = {.type = EV_SYN, .code = SYN_REPORT, .value = 0}; - -static const uint16_t GetLittleKeyCode(int ohosKeyCode) -{ - switch (ohosKeyCode) { - case KEYCODE_A: return KEY_A; - case KEYCODE_B: return KEY_B; - case KEYCODE_C: return KEY_C; - case KEYCODE_D: return KEY_D; - case KEYCODE_E: return KEY_E; - case KEYCODE_F: return KEY_F; - case KEYCODE_G: return KEY_G; - case KEYCODE_H: return KEY_H; - case KEYCODE_I: return KEY_I; - case KEYCODE_J: return KEY_J; - case KEYCODE_K: return KEY_K; - case KEYCODE_L: return KEY_L; - case KEYCODE_M: return KEY_M; - case KEYCODE_N: return KEY_N; - case KEYCODE_O: return KEY_O; - case KEYCODE_P: return KEY_P; - case KEYCODE_Q: return KEY_Q; - case KEYCODE_R: return KEY_R; - case KEYCODE_S: return KEY_S; - case KEYCODE_T: return KEY_T; - case KEYCODE_U: return KEY_U; - case KEYCODE_V: return KEY_V; - case KEYCODE_W: return KEY_W; - case KEYCODE_X: return KEY_X; - case KEYCODE_Y: return KEY_Y; - case KEYCODE_Z: return KEY_Z; - case KEYCODE_1: return KEY_1; - case KEYCODE_2: return KEY_2; - case KEYCODE_3: return KEY_3; - case KEYCODE_4: return KEY_4; - case KEYCODE_5: return KEY_5; - case KEYCODE_6: return KEY_6; - case KEYCODE_7: return KEY_7; - case KEYCODE_8: return KEY_8; - case KEYCODE_9: return KEY_9; - case KEYCODE_0: return KEY_0; - default: return KEY_UNKNOWN; - } -} - -static const uint16_t GetLinuxKeyCode(int ohosKeyCode) -{ - switch (ohosKeyCode) { - case KEYCODE_UNKNOWN: return KEY_UNKNOWN; - case KEYCODE_BACK: return KEY_BACKSPACE; - case KEYCODE_SPACE: return KEY_SPACE; - case KEYCODE_DEL: return KEY_DELETE; - case KEYCODE_ESCAPE: return KEY_ESC; - case KEYCODE_SYSRQ: return KEY_SYSRQ; - case KEYCODE_ENTER: return KEY_ENTER; - case KEYCODE_SHIFT_LEFT: return KEY_LEFTSHIFT; - case KEYCODE_SHIFT_RIGHT: return KEY_RIGHTSHIFT; - case KEYCODE_BRIGHTNESS_DOWN: return KEY_BRIGHTNESSDOWN; - case KEYCODE_BRIGHTNESS_UP: return KEY_BRIGHTNESSUP; - case KEYCODE_MUTE: return KEY_MUTE; - case KEYCODE_VOLUME_DOWN: return KEY_VOLUMEDOWN; - case KEYCODE_VOLUME_UP: return KEY_VOLUMEUP; - default: return GetLittleKeyCode(ohosKeyCode); - } -} - -HidSimulator::HidSimulator() -{ - injectThread_ = std::make_unique(); -} - -void HidSimulator::StartWork() -{ - injectThread_->Start(); -} - -void HidSimulator::ConvertEventData(const EventData &data) -{ - if (data.type == EVENT_TYPE_MOVE) { - ConvertMoveEventData(data); - } else if (data.type == EVENT_TYPE_PEN_KEY) { - ConvertPenKeyEventData(data); - } else if (data.type == EVENT_TYPE_KEY) { - ConvertKeyEventData(data); - } - injectThread_->Sync(); - eventData_ = data; -} - -void HidSimulator::ConvertMoveEventData(const EventData &data) -{ - if (data.changed) { - Hid_EmitItem event = {.type = EV_MSC, .code = MSC_SCAN, .value = 0x000d0042}; - injectThread_->InjectEvent(DEV_TOUCH_PAD, event); - event = {.type = EV_KEY, .code = BTN_TOUCH, .value = data.isDown ? DOWN : UP}; - injectThread_->InjectEvent(DEV_TOUCH_PAD, event); - } - if (data.absX != eventData_.absX) { - Hid_EmitItem event = {.type = EV_ABS, .code = ABS_X, .value = data.absX}; - injectThread_->InjectEvent(DEV_TOUCH_PAD, event); - } - if (data.absY != eventData_.absY) { - Hid_EmitItem event = {.type = EV_ABS, .code = ABS_Y, .value = data.absY}; - injectThread_->InjectEvent(DEV_TOUCH_PAD, event); - } - // 压力值 - if (data.pressVal) { - Hid_EmitItem event = {.type = EV_ABS, .code = ABS_PRESSURE, .value = data.pressVal}; - injectThread_->InjectEvent(DEV_TOUCH_PAD, event); - } else if (eventData_.pressVal) { - Hid_EmitItem event = {.type = EV_ABS, .code = ABS_PRESSURE, .value = 0}; - injectThread_->InjectEvent(DEV_TOUCH_PAD, event); - } - injectThread_->InjectEvent(DEV_TOUCH_PAD, synEvent); -} - -void HidSimulator::ConvertKeyEventData(const EventData &data) -{ - Hid_EmitItem event = { - .type = EV_KEY, - .code = GetLinuxKeyCode(data.keyVal), - .value = (data.isDown ? DOWN : UP)}; - injectThread_->InjectEvent(DEV_KEYBOARD, event); - injectThread_->InjectEvent(DEV_KEYBOARD, synEvent); -} - -void HidSimulator::ConvertPenKeyEventData(const EventData &data) -{ - if (data.changed) { - Hid_EmitItem event = {.type = EV_KEY, .code = BTN_RIGHT, .value = data.isDown ? DOWN : UP}; - injectThread_->InjectEvent(DEV_KEYBOARD, event); - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/hid_simulator.h b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/hid_simulator.h deleted file mode 100644 index 0a72c8a9f43e9412bfb6fb2ea1f5a50793b46378..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/hid_simulator.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef HID_SIMULATOR_H -#define HID_SIMULATOR_H - -#include "inject_thread.h" - -enum EventType { - EVENT_TYPE_INVALID, - EVENT_TYPE_KEY, - EVENT_TYPE_MOVE, - EVENT_TYPE_PEN_KEY, -}; - -struct EventData { - EventType type; - int32_t keyVal; - uint32_t absX{0}; - uint32_t absY{0}; - uint32_t pressVal{0}; - bool changed{false}; - bool isDown{false}; // 按键是否按下,手写笔是否接触 - void Reset() - { - type = EVENT_TYPE_INVALID; - keyVal = 0; - absX = 0; - absY = 0; - pressVal = 0; - changed = false; - isDown = false; - } -}; - -class HidSimulator { - public: - HidSimulator(); - virtual ~HidSimulator() = default; - - void StartWork(); - - void ConvertEventData(const EventData &data); - - void ConvertMoveEventData(const EventData &data); - - void ConvertPenKeyEventData(const EventData &data); - - void ConvertKeyEventData(const EventData &data); - - private: - std::unique_ptr injectThread_; - EventData eventData_; -}; - -#endif // handwriting-board_private_protocol_H diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/inject_thread.cpp b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/inject_thread.cpp deleted file mode 100644 index d6ae940b61862f37bc8c718f3dc7773ffc8460a2..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/inject_thread.cpp +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include -#include -#define LOG_TAG "testTag [NATIVE]" - -#include "inject_thread.h" -#include "data_parser.h" - -#include -#include - -std::mutex InjectThread::mutex_; -std::condition_variable InjectThread::conditionVariable_; -std::unordered_map> InjectThread::injectMap_; -std::unordered_map InjectThread::deviceMap_; - -InjectThread::InjectThread() -{ - isRunning_ = true; -} - -InjectThread::~InjectThread() -{ - isRunning_ = false; - conditionVariable_.notify_one(); -} - -void InjectThread::RunThread(void *param) -{ - InjectThread *thread = (InjectThread *)param; - thread->InjectFunc(); -} - -void InjectThread::Start() -{ - thread_ = std::thread(InjectThread::RunThread, this); - pthread_setname_np(thread_.native_handle(), "emitEvent"); - thread_.detach(); -} - -void InjectThread::InjectFunc() -{ - std::unique_lock uniqueLock(mutex_); - CreateAllDevice(); - while (isRunning_) { - conditionVariable_.wait(uniqueLock); - for (auto &item : injectMap_) { - if (item.second.size() == 0) { - continue; - } - - // [Start driver_hid1_step2] - // 向指定deviceId的设备发送事件,事件来源于物理外设,通过InjectEvent方法注入 - int32_t ret = OH_Hid_EmitEvent(item.first, item.second.data(), (uint16_t)item.second.size()); - if (ret != HID_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "OH_Hid_EmitEvent failed, deviceId:%{public}d", item.first); - } - // [End driver_hid1_step2] - } - for (auto &item : injectMap_) { - item.second.clear(); - } - } - - for (auto &item : injectMap_) { - OH_LOG_INFO(LOG_APP, "OH_Usb_DestroyDevice deviceId:%{public}d", item.first); - DestroyDevice(item.first); - item.second.clear(); - } - injectMap_.clear(); -} - -void InjectThread::InjectEvent(std::string deviceName, Hid_EmitItem &injectInputEvent) -{ - std::lock_guard lockGuard(mutex_); - auto pos = deviceMap_.find(deviceName); - if (pos == deviceMap_.end()) { - OH_LOG_ERROR(LOG_APP, "InjectEvent deviceName:%{public}s not found", deviceName.c_str()); - return; - } - injectMap_[pos->second].push_back(injectInputEvent); -} - -void InjectThread::Sync() -{ - for (auto &item : injectMap_) { - if (item.second.size() > 0) { - conditionVariable_.notify_one(); - } - } -} - -void InjectThread::CreateAllDevice() -{ - if (deviceMap_.size() > 0) { - return; - } - int32_t boardId = CreateKeyBoardDevice(DEV_KEYBOARD); - if (boardId < 0) { - OH_LOG_INFO(LOG_APP, "CreateKeyBoardDevice fail result:%{public}d", boardId); - return; - } - int32_t deviceId = CreateTouchPadDevice(DEV_TOUCH_PAD); - if (deviceId < 0) { - OH_LOG_INFO(LOG_APP, "CreateTouchPadDevice fail result:%{public}d", deviceId); - DestroyDevice(boardId); - deviceMap_.clear(); - } -} - -void InjectThread::DestroyDevice(int32_t deviceId) -{ - // [Start driver_hid1_step3] - // 销毁HID设备 - int32_t res = OH_Hid_DestroyDevice(deviceId); - // [End driver_hid1_step3] - OH_LOG_INFO(LOG_APP, "DestroyDevice deviceId:%{public}d, result:%{public}d", deviceId, res); -} - -int32_t InjectThread::CreateDevice(Hid_Device *hidDevice, Hid_EventProperties *hidEventProperties) -{ - int deviceId = OH_Hid_CreateDevice(hidDevice, hidEventProperties); - if (deviceId < 0) { - OH_LOG_ERROR(LOG_APP, "CreateDevice failed error:%{public}d, deviceName:%{public}s", deviceId, - hidDevice->deviceName); - } else { - deviceMap_.emplace(hidDevice->deviceName, deviceId); - std::vector items; - injectMap_.emplace(deviceId, items); - OH_LOG_INFO(LOG_APP, "CreateDevice success deviceId:%{public}d, deviceName:%{public}s", deviceId, - hidDevice->deviceName); - } - return deviceId; -} - -int32_t InjectThread::CreateKeyBoardDevice(std::string deviceName) -{ - // [Start driver_hid1_step1] - Hid_Device hidDevice = { - .deviceName = deviceName.c_str(), - .vendorId = 0x6006, - .productId = 0x6008, - .version = 1, - .bustype = BUS_USB - }; - std::vector eventType = {HID_EV_KEY}; - Hid_EventTypeArray eventTypeArray = {.hidEventType = eventType.data(), .length = (uint16_t)eventType.size()}; - std::vector keyCode = { - HID_KEY_1, HID_KEY_SPACE, HID_KEY_BACKSPACE, HID_KEY_ENTER, HID_KEY_ESC, HID_KEY_SYSRQ, - HID_KEY_LEFT_SHIFT, HID_KEY_RIGHT_SHIFT, HID_KEY_VOLUME_DOWN, HID_KEY_VOLUME_UP, HID_KEY_0, HID_KEY_2, - HID_KEY_3, HID_KEY_4, HID_KEY_5, HID_KEY_6, HID_KEY_7, HID_KEY_8, - HID_KEY_9, HID_KEY_A, HID_KEY_B, HID_KEY_C, HID_KEY_D, HID_KEY_E, - HID_KEY_F, HID_KEY_G, HID_KEY_H, HID_KEY_I, HID_KEY_J, HID_KEY_K, - HID_KEY_L, HID_KEY_M, HID_KEY_N, HID_KEY_O, HID_KEY_P, HID_KEY_Q, - HID_KEY_R, HID_KEY_S, HID_KEY_T, HID_KEY_U, HID_KEY_V, HID_KEY_W, - HID_KEY_X, HID_KEY_Y, HID_KEY_Z, HID_KEY_DELETE}; - Hid_KeyCodeArray keyCodeArray = {.hidKeyCode = keyCode.data(), .length = (uint16_t)keyCode.size()}; - Hid_EventProperties hidEventProp = {.hidEventTypes = eventTypeArray, .hidKeys = keyCodeArray}; - int deviceId = OH_Hid_CreateDevice(&hidDevice, &hidEventProp); - // [End driver_hid1_step1] - if (deviceId < 0) { - OH_LOG_ERROR(LOG_APP, "CreateDevice failed error:%{public}d, deviceName:%{public}s", deviceId, - hidDevice.deviceName); - return deviceId; - } - deviceMap_.emplace(hidDevice.deviceName, deviceId); - std::vector items; - injectMap_.emplace(deviceId, items); - OH_LOG_INFO(LOG_APP, "CreateDevice success deviceId:%{public}d, deviceName:%{public}s", deviceId, - hidDevice.deviceName); - return deviceId; -} - -int32_t InjectThread::CreateTouchPadDevice(std::string deviceName) -{ - std::vector deviceProp = {HID_PROP_DIRECT}; - Hid_Device hidDevice = { - .deviceName = deviceName.c_str(), - .vendorId = 0x6006, - .productId = 0x6006, - .version = 1, - .bustype = BUS_USB, - .properties = deviceProp.data(), - .propLength = (uint16_t)deviceProp.size() - }; - std::vector eventType = {HID_EV_ABS, HID_EV_KEY, HID_EV_SYN, HID_EV_MSC}; - Hid_EventTypeArray eventTypeArray = {.hidEventType = eventType.data(), .length = (uint16_t)eventType.size()}; - std::vector keyCode = {HID_BTN_TOOL_PEN, HID_BTN_TOOL_RUBBER, HID_BTN_TOUCH, HID_BTN_STYLUS, - HID_BTN_RIGHT}; - Hid_KeyCodeArray keyCodeArray = {.hidKeyCode = keyCode.data(), .length = (uint16_t)keyCode.size()}; - std::vector mscEvent = {HID_MSC_SCAN}; - Hid_MscEventArray mscEventArray = {.hidMscEvent = mscEvent.data(), .length = (uint16_t)mscEvent.size()}; - std::vector absAxes = {HID_ABS_X, HID_ABS_Y, HID_ABS_PRESSURE}; - Hid_AbsAxesArray absAxesArray = {.hidAbsAxes = absAxes.data(), .length = (uint16_t)absAxes.size()}; - Hid_EventProperties hidEventProp = { - .hidEventTypes = eventTypeArray, - .hidKeys = keyCodeArray, - .hidAbs = absAxesArray, - .hidMiscellaneous=mscEventArray - }; - int32_t maxX; - int32_t maxY; - int32_t maxPressure; - DataParser::GetInstance().GetAbsMax(maxX, maxY, maxPressure); - OH_LOG_INFO(LOG_APP, "OH_Usb_CreateDevice maxX:%{public}d, maxY:%{public}d, maxPressure:%{public}d", maxX, maxY, - maxPressure); - hidEventProp.hidAbsMin[HID_ABS_X] = 0; - hidEventProp.hidAbsMin[HID_ABS_Y] = 0; - hidEventProp.hidAbsMin[HID_ABS_PRESSURE] = 0; - hidEventProp.hidAbsMax[HID_ABS_X] = maxX; - hidEventProp.hidAbsMax[HID_ABS_Y] = maxY; - hidEventProp.hidAbsMax[HID_ABS_PRESSURE] = maxPressure; - return CreateDevice(&hidDevice, &hidEventProp); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/inject_thread.h b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/inject_thread.h deleted file mode 100644 index 6405f68bdf9b665c08396cbba48e92b2117aa22a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/inject_thread.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef INJECT_THREAD_H -#define INJECT_THREAD_H - -#include -#include -#include - -const std::string DEV_KEYBOARD = "VSoC keyboard"; -const std::string DEV_TOUCH_PAD = "VSoC touchpad"; - -class InjectThread { - public: - InjectThread(); - virtual ~InjectThread(); - void Start(); - void InjectEvent(std::string deviceName, Hid_EmitItem &injectInputEvent); - void Sync(); - int32_t CreateKeyBoardDevice(std::string deviceName); - int32_t CreateTouchPadDevice(std::string deviceName); - void DestroyDevice(int32_t deviceId); - void CreateAllDevice(); - -private: - static void RunThread(void *param); - void InjectFunc(); - int32_t CreateDevice(Hid_Device *hidDevice, Hid_EventProperties *hidEventProperties); - -private: - static std::mutex mutex_; - static std::condition_variable conditionVariable_; - static std::unordered_map> injectMap_; - static std::unordered_map deviceMap_; - bool isRunning_; - std::thread thread_; -}; - -#endif // INJECT_THREAD_H \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/key_code.h b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/key_code.h deleted file mode 100644 index 035fc58f08c7db83c4c29ec050ce015deef6d141..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/key_code.h +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef KEY_CODE_ENUM_H -#define KEY_CODE_ENUM_H - -enum KeyCode { - KEYCODE_FN = 0, - KEYCODE_UNKNOWN = -1, - KEYCODE_HOME = 1, - KEYCODE_BACK = 2, - KEYCODE_MEDIA_PLAY_PAUSE = 10, - KEYCODE_MEDIA_STOP = 11, - KEYCODE_MEDIA_NEXT = 12, - KEYCODE_MEDIA_PREVIOUS = 13, - KEYCODE_MEDIA_REWIND = 14, - KEYCODE_MEDIA_FAST_FORWARD = 15, - KEYCODE_VOLUME_UP = 16, - KEYCODE_VOLUME_DOWN = 17, - KEYCODE_POWER = 18, - KEYCODE_CAMERA = 19, - KEYCODE_VOLUME_MUTE = 22, - KEYCODE_MUTE = 23, - KEYCODE_BRIGHTNESS_UP = 40, - KEYCODE_BRIGHTNESS_DOWN = 41, - KEYCODE_0 = 2000, - KEYCODE_1 = 2001, - KEYCODE_2 = 2002, - KEYCODE_3 = 2003, - KEYCODE_4 = 2004, - KEYCODE_5 = 2005, - KEYCODE_6 = 2006, - KEYCODE_7 = 2007, - KEYCODE_8 = 2008, - KEYCODE_9 = 2009, - KEYCODE_STAR = 2010, - KEYCODE_POUND = 2011, - KEYCODE_DPAD_UP = 2012, - KEYCODE_DPAD_DOWN = 2013, - KEYCODE_DPAD_LEFT = 2014, - KEYCODE_DPAD_RIGHT = 2015, - KEYCODE_DPAD_CENTER = 2016, - KEYCODE_A = 2017, - KEYCODE_B = 2018, - KEYCODE_C = 2019, - KEYCODE_D = 2020, - KEYCODE_E = 2021, - KEYCODE_F = 2022, - KEYCODE_G = 2023, - KEYCODE_H = 2024, - KEYCODE_I = 2025, - KEYCODE_J = 2026, - KEYCODE_K = 2027, - KEYCODE_L = 2028, - KEYCODE_M = 2029, - KEYCODE_N = 2030, - KEYCODE_O = 2031, - KEYCODE_P = 2032, - KEYCODE_Q = 2033, - KEYCODE_R = 2034, - KEYCODE_S = 2035, - KEYCODE_T = 2036, - KEYCODE_U = 2037, - KEYCODE_V = 2038, - KEYCODE_W = 2039, - KEYCODE_X = 2040, - KEYCODE_Y = 2041, - KEYCODE_Z = 2042, - KEYCODE_COMMA = 2043, - KEYCODE_PERIOD = 2044, - KEYCODE_ALT_LEFT = 2045, - KEYCODE_ALT_RIGHT = 2046, - KEYCODE_SHIFT_LEFT = 2047, - KEYCODE_SHIFT_RIGHT = 2048, - KEYCODE_TAB = 2049, - KEYCODE_SPACE = 2050, - KEYCODE_SYM = 2051, - KEYCODE_EXPLORER = 2052, - KEYCODE_ENVELOPE = 2053, - KEYCODE_ENTER = 2054, - KEYCODE_DEL = 2055, - KEYCODE_GRAVE = 2056, - KEYCODE_MINUS = 2057, - KEYCODE_EQUALS = 2058, - KEYCODE_LEFT_BRACKET = 2059, - KEYCODE_RIGHT_BRACKET = 2060, - KEYCODE_BACKSLASH = 2061, - KEYCODE_SEMICOLON = 2062, - KEYCODE_APOSTROPHE = 2063, - KEYCODE_SLASH = 2064, - KEYCODE_AT = 2065, - KEYCODE_PLUS = 2066, - KEYCODE_MENU = 2067, - KEYCODE_PAGE_UP = 2068, - KEYCODE_PAGE_DOWN = 2069, - KEYCODE_ESCAPE = 2070, - KEYCODE_FORWARD_DEL = 2071, - KEYCODE_CTRL_LEFT = 2072, - KEYCODE_CTRL_RIGHT = 2073, - KEYCODE_CAPS_LOCK = 2074, - KEYCODE_SCROLL_LOCK = 2075, - KEYCODE_META_LEFT = 2076, - KEYCODE_META_RIGHT = 2077, - KEYCODE_FUNCTION = 2078, - KEYCODE_SYSRQ = 2079, - KEYCODE_BREAK = 2080, - KEYCODE_MOVE_HOME = 2081, - KEYCODE_MOVE_END = 2082, - KEYCODE_INSERT = 2083, - KEYCODE_FORWARD = 2084, - KEYCODE_MEDIA_PLAY = 2085, - KEYCODE_MEDIA_PAUSE = 2086, - KEYCODE_MEDIA_CLOSE = 2087, - KEYCODE_MEDIA_EJECT = 2088, - KEYCODE_MEDIA_RECORD = 2089, - KEYCODE_F1 = 2090, - KEYCODE_F2 = 2091, - KEYCODE_F3 = 2092, - KEYCODE_F4 = 2093, - KEYCODE_F5 = 2094, - KEYCODE_F6 = 2095, - KEYCODE_F7 = 2096, - KEYCODE_F8 = 2097, - KEYCODE_F9 = 2098, - KEYCODE_F10 = 2099, - KEYCODE_F11 = 2100, - KEYCODE_F12 = 2101, - KEYCODE_NUM_LOCK = 2102, - KEYCODE_NUMPAD_0 = 2103, - KEYCODE_NUMPAD_1 = 2104, - KEYCODE_NUMPAD_2 = 2105, - KEYCODE_NUMPAD_3 = 2106, - KEYCODE_NUMPAD_4 = 2107, - KEYCODE_NUMPAD_5 = 2108, - KEYCODE_NUMPAD_6 = 2109, - KEYCODE_NUMPAD_7 = 2110, - KEYCODE_NUMPAD_8 = 2111, - KEYCODE_NUMPAD_9 = 2112, - KEYCODE_NUMPAD_DIVIDE = 2113, - KEYCODE_NUMPAD_MULTIPLY = 2114, - KEYCODE_NUMPAD_SUBTRACT = 2115, - KEYCODE_NUMPAD_ADD = 2116, - KEYCODE_NUMPAD_DOT = 2117, - KEYCODE_NUMPAD_COMMA = 2118, - KEYCODE_NUMPAD_ENTER = 2119, - KEYCODE_NUMPAD_EQUALS = 2120, - KEYCODE_NUMPAD_LEFT_PAREN = 2121, - KEYCODE_NUMPAD_RIGHT_PAREN = 2122, - KEYCODE_VIRTUAL_MULTITASK = 2210, - KEYCODE_SLEEP = 2600, - KEYCODE_ZENKAKU_HANKAKU = 2601, - KEYCODE_102ND = 2602, - KEYCODE_RO = 2603, - KEYCODE_KATAKANA = 2604, - KEYCODE_HIRAGANA = 2605, - KEYCODE_HENKAN = 2606, - KEYCODE_KATAKANA_HIRAGANA = 2607, - KEYCODE_MUHENKAN = 2608, - KEYCODE_LINEFEED = 2609, - KEYCODE_MACRO = 2610, - KEYCODE_NUMPAD_PLUSMINUS = 2611, - KEYCODE_SCALE = 2612, - KEYCODE_HANGUEL = 2613, - KEYCODE_HANJA = 2614, - KEYCODE_YEN = 2615, - KEYCODE_STOP = 2616, - KEYCODE_AGAIN = 2617, - KEYCODE_PROPS = 2618, - KEYCODE_UNDO = 2619, - KEYCODE_COPY = 2620, - KEYCODE_OPEN = 2621, - KEYCODE_PASTE = 2622, - KEYCODE_FIND = 2623, - KEYCODE_CUT = 2624, - KEYCODE_HELP = 2625, - KEYCODE_CALC = 2626, - KEYCODE_FILE = 2627, - KEYCODE_BOOKMARKS = 2628, - KEYCODE_NEXT = 2629, - KEYCODE_PLAYPAUSE = 2630, - KEYCODE_PREVIOUS = 2631, - KEYCODE_STOPCD = 2632, - KEYCODE_CONFIG = 2634, - KEYCODE_REFRESH = 2635, - KEYCODE_EXIT = 2636, - KEYCODE_EDIT = 2637, - KEYCODE_SCROLLUP = 2638, - KEYCODE_SCROLLDOWN = 2639, - KEYCODE_NEW = 2640, - KEYCODE_REDO = 2641, - KEYCODE_CLOSE = 2642, - KEYCODE_PLAY = 2643, - KEYCODE_BASSBOOST = 2644, - KEYCODE_PRINT = 2645, - KEYCODE_CHAT = 2646, - KEYCODE_FINANCE = 2647, - KEYCODE_CANCEL = 2648, - KEYCODE_KBDILLUM_TOGGLE = 2649, - KEYCODE_KBDILLUM_DOWN = 2650, - KEYCODE_KBDILLUM_UP = 2651, - KEYCODE_SEND = 2652, - KEYCODE_REPLY = 2653, - KEYCODE_FORWARDMAIL = 2654, - KEYCODE_SAVE = 2655, - KEYCODE_DOCUMENTS = 2656, - KEYCODE_VIDEO_NEXT = 2657, - KEYCODE_VIDEO_PREV = 2658, - KEYCODE_BRIGHTNESS_CYCLE = 2659, - KEYCODE_BRIGHTNESS_ZERO = 2660, - KEYCODE_DISPLAY_OFF = 2661, - KEYCODE_BTN_MISC = 2662, - KEYCODE_GOTO = 2663, - KEYCODE_INFO = 2664, - KEYCODE_PROGRAM = 2665, - KEYCODE_PVR = 2666, - KEYCODE_SUBTITLE = 2667, - KEYCODE_FULL_SCREEN = 2668, - KEYCODE_KEYBOARD = 2669, - KEYCODE_ASPECT_RATIO = 2670, - KEYCODE_PC = 2671, - KEYCODE_TV = 2672, - KEYCODE_TV2 = 2673, - KEYCODE_VCR = 2674, - KEYCODE_VCR2 = 2675, - KEYCODE_SAT = 2676, - KEYCODE_CD = 2677, - KEYCODE_TAPE = 2678, - KEYCODE_TUNER = 2679, - KEYCODE_PLAYER = 2680, - KEYCODE_DVD = 2681, - KEYCODE_AUDIO = 2682, - KEYCODE_VIDEO = 2683, - KEYCODE_MEMO = 2684, - KEYCODE_CALENDAR = 2685, - KEYCODE_RED = 2686, - KEYCODE_GREEN = 2687, - KEYCODE_YELLOW = 2688, - KEYCODE_BLUE = 2689, - KEYCODE_CHANNELUP = 2690, - KEYCODE_CHANNELDOWN = 2691, - KEYCODE_LAST = 2692, - KEYCODE_RESTART = 2693, - KEYCODE_SLOW = 2694, - KEYCODE_SHUFFLE = 2695, - KEYCODE_VIDEOPHONE = 2696, - KEYCODE_GAMES = 2697, - KEYCODE_ZOOMIN = 2698, - KEYCODE_ZOOMOUT = 2699, - KEYCODE_ZOOMRESET = 2700, - KEYCODE_WORDPROCESSOR = 2701, - KEYCODE_EDITOR = 2702, - KEYCODE_SPREADSHEET = 2703, - KEYCODE_GRAPHICSEDITOR = 2704, - KEYCODE_PRESENTATION = 2705, - KEYCODE_DATABASE = 2706, - KEYCODE_NEWS = 2707, - KEYCODE_VOICEMAIL = 2708, - KEYCODE_ADDRESSBOOK = 2709, - KEYCODE_MESSENGER = 2710, - KEYCODE_BRIGHTNESS_TOGGLE = 2711, - KEYCODE_SPELLCHECK = 2712, - KEYCODE_COFFEE = 2713, - KEYCODE_MEDIA_REPEAT = 2714, - KEYCODE_IMAGES = 2715, - KEYCODE_BUTTONCONFIG = 2716, - KEYCODE_TASKMANAGER = 2717, - KEYCODE_JOURNAL = 2718, - KEYCODE_CONTROLPANEL = 2719, - KEYCODE_APPSELECT = 2720, - KEYCODE_SCREENSAVER = 2721, - KEYCODE_ASSISTANT = 2722, - KEYCODE_KBD_LAYOUT_NEXT = 2723, - KEYCODE_BRIGHTNESS_MIN = 2724, - KEYCODE_BRIGHTNESS_MAX = 2725, - KEYCODE_KBDINPUTASSIST_PREV = 2726, - KEYCODE_KBDINPUTASSIST_NEXT = 2727, - KEYCODE_KBDINPUTASSIST_PREVGROUP = 2728, - KEYCODE_KBDINPUTASSIST_NEXTGROUP = 2729, - KEYCODE_KBDINPUTASSIST_ACCEPT = 2730, - KEYCODE_KBDINPUTASSIST_CANCEL = 2731, - KEYCODE_FRONT = 2800, - KEYCODE_SETUP = 2801, - KEYCODE_WAKEUP = 2802, - KEYCODE_SENDFILE = 2803, - KEYCODE_DELETEFILE = 2804, - KEYCODE_XFER = 2805, - KEYCODE_PROG1 = 2806, - KEYCODE_PROG2 = 2807, - KEYCODE_MSDOS = 2808, - KEYCODE_SCREENLOCK = 2809, - KEYCODE_DIRECTION_ROTATE_DISPLAY = 2810, - KEYCODE_CYCLEWINDOWS = 2811, - KEYCODE_COMPUTER = 2812, - KEYCODE_EJECTCLOSECD = 2813, - KEYCODE_ISO = 2814, - KEYCODE_MOVE = 2815, - KEYCODE_F13 = 2816, - KEYCODE_F14 = 2817, - KEYCODE_F15 = 2818, - KEYCODE_F16 = 2819, - KEYCODE_F17 = 2820, - KEYCODE_F18 = 2821, - KEYCODE_F19 = 2822, - KEYCODE_F20 = 2823, - KEYCODE_F21 = 2824, - KEYCODE_F22 = 2825, - KEYCODE_F23 = 2826, - KEYCODE_F24 = 2827, - KEYCODE_PROG3 = 2828, - KEYCODE_PROG4 = 2829, - KEYCODE_DASHBOARD = 2830, - KEYCODE_SUSPEND = 2831, - KEYCODE_HP = 2832, - KEYCODE_SOUND = 2833, - KEYCODE_QUESTION = 2834, - KEYCODE_CONNECT = 2836, - KEYCODE_SPORT = 2837, - KEYCODE_SHOP = 2838, - KEYCODE_ALTERASE = 2839, - KEYCODE_SWITCHVIDEOMODE = 2841, - KEYCODE_BATTERY = 2842, - KEYCODE_BLUETOOTH = 2843, - KEYCODE_WLAN = 2844, - KEYCODE_UWB = 2845, - KEYCODE_WWAN_WIMAX = 2846, - KEYCODE_RFKILL = 2847, - KEYCODE_CHANNEL = 3001, - KEYCODE_BTN_0 = 3100, - KEYCODE_BTN_1 = 3101, - KEYCODE_BTN_2 = 3102, - KEYCODE_BTN_3 = 3103, - KEYCODE_BTN_4 = 3104, - KEYCODE_BTN_5 = 3105, - KEYCODE_BTN_6 = 3106, - KEYCODE_BTN_7 = 3107, - KEYCODE_BTN_8 = 3108, - KEYCODE_BTN_9 = 3109 -}; - -#endif // KEY_CODE_ENUM_H diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/parse_point_info.cpp b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/parse_point_info.cpp deleted file mode 100644 index 15f543992472104e4d3a371a8ae5d1817bb87c54..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/parse_point_info.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "parse_point_info.h" - -// return 执行结果,x轴坐标,y轴坐标,压力值 -std::tuple ParsePointInfo(const uint8_t* buffer) -{ - // 笔离开 - if (buffer[1] == 0x80) { - return {false, 0, 0, 0, false}; - } else if (buffer[1] == 0xC2) { - return {false, 0, 0, 0, true}; - } - - bool btnRight = ((buffer[1] & 0x04) != 0); - - uint32_t x = ((buffer[2] << 8) | buffer[3]); - uint32_t y = ((buffer[4] << 8) | buffer[5]); - // 压力值第2位 - uint8_t tmp2 = buffer[1] & 0x01; - // 压力值第1位 - uint8_t tmp1 = buffer[1] & 0x10; - uint32_t pressure = (((buffer[7] >> 6) | buffer[6] << 2) << 3) | (tmp2 << 2) | (tmp1 >> 3) | - ((buffer[1] & 0x08) >> 3); - return {true, x, y, pressure, btnRight}; -} diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/parse_point_info.h b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/parse_point_info.h deleted file mode 100644 index 80782c2ab58900c5113ce25e24c2300be8831080..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/parse_point_info.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef PARSE_POINT_INFO_H -#define PARSE_POINT_INFO_H -#include -std::tuple ParsePointInfo(const uint8_t* buffer); -#endif //PARSE_POINT_INFO_H diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 01d8f8b66f6d47a4764a83c170b849b6129e30f3..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -declare namespace testNapi { - function getProductDesc(deviceId: number):[string, number]; - function getBoardInput():Promise; - function releaseResource():void; - function setDisplayInfo(width:number, height:number):void; - function setButtonMapping(mappingInfo: Int32Array):void; - function setOneButtonMapping(index:number, value:number):void; - function setDirection(direction:number):void; - function getDirection():number; -} -export default testNapi; \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/AboutComponent.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/AboutComponent.ets deleted file mode 100644 index 344fb19d9490e8c85fcb93e2116d7b58f24c5509..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/AboutComponent.ets +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const TEXT_HEIGHT: number = 35; - -@Component -export struct AboutComponent { - @Link vendorId: string; - @Link productId: string; - @Link description: string; - - build() { - Column() { - Row() { - Text($r('app.string.about')) - }.height(60) - - Row() { - Column() { - Text('vendorId:') - .textAlign(TextAlign.End) - .height(TEXT_HEIGHT) - Text('productId:') - .textAlign(TextAlign.End) - .height(TEXT_HEIGHT) - } - .alignItems(HorizontalAlign.End) - - Column() { - Text(this.vendorId) - .height(TEXT_HEIGHT) - Text(this.productId) - .height(TEXT_HEIGHT) - } - .alignItems(HorizontalAlign.Start) - .margin({ left: 8 }) - } - }.alignItems(HorizontalAlign.Center) - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/KeyPressComponent.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/KeyPressComponent.ets deleted file mode 100644 index ebcf576d87a267f43ca5cafb45f942bcbcbfac1a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/KeyPressComponent.ets +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2025 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 { KeyCode } from '@kit.InputKit'; -import { preferences } from '@kit.ArkData'; -import RpcTool from '../tool/RpcTool'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -class StorageKey { - public key?: string - public default?: number -} -const STORAGE_KEY: StorageKey[] = [ - { key: 'key1', default: KeyCode.KEYCODE_SPACE }, - { key: 'key2', default: KeyCode.KEYCODE_ENTER }, - { key: 'key3', default: KeyCode.KEYCODE_BACK }, - { key: 'key4', default: KeyCode.KEYCODE_1 }]; -class MenuKey { - public code?: number - public value?: string - public note?: string -} -const MENU_KEY_LIST: MenuKey[] = [ - { code: KeyCode.KEYCODE_SPACE, value: 'Space', note: '空格' }, - { code: KeyCode.KEYCODE_ENTER, value: 'Enter', note: '换行' }, - { code: KeyCode.KEYCODE_BACK, value: 'Backspace', note: '回退' }, - { code: KeyCode.KEYCODE_DEL, value: 'Delete', note: '删除' }, - { code: KeyCode.KEYCODE_ESCAPE, value: 'Esc', note: '退出' }, - { code: KeyCode.KEYCODE_SYSRQ, value: 'PrtSc', note: '截屏' }, - { code: KeyCode.KEYCODE_SHIFT_LEFT, value: 'Left Shift', note: '左Shift' }, - { code: KeyCode.KEYCODE_SHIFT_RIGHT, value: 'Right Shift', note: '右Shift' }, - // { code: KeyCode.KEYCODE_BRIGHTNESS_DOWN, value: 'Bright Down', note: '亮度-' }, - // { code: KeyCode.KEYCODE_BRIGHTNESS_UP, value: 'Bright Up', note: '亮度+' }, - // { code: KeyCode.KEYCODE_MUTE, value: 'Mute', note: '静音' }, - { code: KeyCode.KEYCODE_VOLUME_DOWN, value: 'Vol Down', note: '音量-' }, - { code: KeyCode.KEYCODE_VOLUME_UP, value: 'Vol Up', note: '音量+' }, - { code: KeyCode.KEYCODE_0, value: '0', note: '数字' }, - { code: KeyCode.KEYCODE_1, value: '1', note: '数字' }, - { code: KeyCode.KEYCODE_2, value: '2', note: '数字' }, - { code: KeyCode.KEYCODE_3, value: '3', note: '数字' }, - { code: KeyCode.KEYCODE_4, value: '4', note: '数字' }, - { code: KeyCode.KEYCODE_5, value: '5', note: '数字' }, - { code: KeyCode.KEYCODE_6, value: '6', note: '数字' }, - { code: KeyCode.KEYCODE_7, value: '7', note: '数字' }, - { code: KeyCode.KEYCODE_8, value: '8', note: '数字' }, - { code: KeyCode.KEYCODE_9, value: '9', note: '数字' }, - { code: KeyCode.KEYCODE_A, value: 'A', note: '字母' }, - { code: KeyCode.KEYCODE_B, value: 'B', note: '字母' }, - { code: KeyCode.KEYCODE_C, value: 'C', note: '字母' }, - { code: KeyCode.KEYCODE_D, value: 'D', note: '字母' }, - { code: KeyCode.KEYCODE_E, value: 'E', note: '字母' }, - { code: KeyCode.KEYCODE_F, value: 'F', note: '字母' }, - { code: KeyCode.KEYCODE_G, value: 'G', note: '字母' }, - { code: KeyCode.KEYCODE_H, value: 'H', note: '字母' }, - { code: KeyCode.KEYCODE_I, value: 'I', note: '字母' }, - { code: KeyCode.KEYCODE_J, value: 'J', note: '字母' }, - { code: KeyCode.KEYCODE_K, value: 'K', note: '字母' }, - { code: KeyCode.KEYCODE_L, value: 'L', note: '字母' }, - { code: KeyCode.KEYCODE_M, value: 'M', note: '字母' }, - { code: KeyCode.KEYCODE_N, value: 'N', note: '字母' }, - { code: KeyCode.KEYCODE_O, value: 'O', note: '字母' }, - { code: KeyCode.KEYCODE_P, value: 'P', note: '字母' }, - { code: KeyCode.KEYCODE_Q, value: 'Q', note: '字母' }, - { code: KeyCode.KEYCODE_R, value: 'R', note: '字母' }, - { code: KeyCode.KEYCODE_S, value: 'S', note: '字母' }, - { code: KeyCode.KEYCODE_T, value: 'T', note: '字母' }, - { code: KeyCode.KEYCODE_U, value: 'U', note: '字母' }, - { code: KeyCode.KEYCODE_V, value: 'V', note: '字母' }, - { code: KeyCode.KEYCODE_W, value: 'W', note: '字母' }, - { code: KeyCode.KEYCODE_X, value: 'X', note: '字母' }, - { code: KeyCode.KEYCODE_Y, value: 'Y', note: '字母' }, - { code: KeyCode.KEYCODE_Z, value: 'Z', note: '字母' },]; - -@Component -@Preview -export struct KeyPressComponent { - @State private keyInfo: string[] = ['开启手写应用', '关闭手写应用', '上翻', '下翻']; - private keyPreference: preferences.Preferences | null = null; - - aboutToAppear() { - let filePath = getContext().filesDir; - hilog.info(0, 'testTag', `keyPressComponent aboutToAppear, filePath: ${filePath}`); - this.keyPreference = preferences.getPreferencesSync(getContext(this), {name: 'keyInfo'}); - STORAGE_KEY.forEach((value, index) => { - if(this.keyPreference) { - let storageKeyCode = this.keyPreference.getSync(value.key, value.default); - let searchInfo = MENU_KEY_LIST.filter(key => (key.code == storageKeyCode)); - if (searchInfo.length != 0) { - this.keyInfo[index] = `${searchInfo[0].note}: ${searchInfo[0].value}`; - } - } - }) - } - - @Builder - MyMenu(keyIndex: number) { - Menu() { - ForEach(MENU_KEY_LIST, (item: MenuKey) => { - MenuItem({ content: `${item.note}:${item.value}` }) - .onClick(() => { - hilog.info(0, 'testTag', `set key btn ${item.note}: ${item.value}`); - this.keyInfo[keyIndex] = `${item.note}: ${item.value}`; - if(this.keyPreference) { - this.keyPreference.putSync(STORAGE_KEY[keyIndex].key, item.code); - this.keyPreference.flushSync(); - if(item.code) { - RpcTool.getInstance().setKeyValue(keyIndex, item.code); - } - } - }) - }) - } - .borderStyle(BorderStyle.Dotted) - } - - build() { - Column() { - Stack() { - // 底层外边框 - Row() { - Blank() - .width(230) - Row() { - // 底层内边框 - Row() - .border({ width: 4, color: '#E1E1E1', radius: 10 }) - .layoutWeight(1) - .height(400) - .margin({ left: 80, right: 20, top: 20, bottom: 20 }) - } - .height(500) - .width(750) - .padding(10) - .borderRadius(40) - .border({ width: 12, color: '#E1E1E1' }) - .margin({ right: 30 }) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Center) - - Row() { - //左边导引区 - Column() { - ForEach(this.keyInfo, (item: string, index) => { - Row() { - Text(item) - .margin({ right: 10 }) - .width(140) - .textAlign(TextAlign.End) - Column() - .width(10) - .height(10) - .borderRadius(10) - .backgroundColor('#0A59F7') - Column() - .border({ width: 1, color: '#0A59F7' }) - .width(80) - .height(2) - Text() - .border({ width: 2, color: '#E1E1E1' }) - .height(85) - .aspectRatio(0.6) - .bindMenu(this.MyMenu(index)) - }.height(85) - .margin({ top: 5, bottom: 5 }) - }) - } - .justifyContent(FlexAlign.Center) - } - .height('100%') - .margin({ left: 20 }) - } - .width(1000) - .height(500) - .alignContent(Alignment.Start) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Center) - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/PensComponent.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/PensComponent.ets deleted file mode 100644 index fd10fad4844170d9d08bfc36efa9573800569013..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/PensComponent.ets +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -@Preview -@Component -export struct PensComponent { - @State value: number = 200; - - build() { - Column() { - Row() { - // 笔图片 - Column() { - Image($rawfile('pens.PNG')) - .height('80%') - }.height('100%') - .justifyContent(FlexAlign.Center) - // 左键右键 - Column() { - Row() { - Column() - .border({ width: 1, color: '#0A59F7' }) - .width(50) - .height(1) - Column() - .width(10) - .height(10) - .borderRadius(10) - .backgroundColor('#0A59F7') - Text($r('app.string.right')).margin({ left: 10 }) - }.margin({ bottom: 90 }) - - Row() { - Column() - .border({ width: 1, color: '#0A59F7' }) - .width(50) - .height(2) - Column() - .width(10) - .height(10) - .borderRadius(10) - .backgroundColor('#0A59F7') - Text($r('app.string.left')).margin({ left: 10 }) - } - .margin({ bottom: 50 }) - } - .height('100%') - .justifyContent(FlexAlign.End) - // 笔记效果体验区 - Column() { - Stack() { - Row() - .backgroundColor(Color.White) - .height('100%') - .width('100%') - Text($r('app.string.pen_try')) - .fontColor(Color.Gray) - .fontSize(30) - }.layoutWeight(1) - .margin({ bottom: 30, top: 30, right: 30, left: 50 }) - - Button($r('app.string.clear')) - .width(150) - .margin({ bottom: 15 }) - }.layoutWeight(1) - } - } - .width('100%') - .height('100%') - .alignItems(HorizontalAlign.Center) - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/RegionComponent.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/RegionComponent.ets deleted file mode 100644 index d57a218eb5c19f8c141677e236a475c0ca058be3..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/RegionComponent.ets +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2025 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 RpcTool from '../tool/RpcTool'; -import { preferences } from '@kit.ArkData'; - -const DIRECT_KEY = 'direction'; -class Region { - public direction?: string; - public val?: string; - public img?: string; -} - -@Component -export struct RegionComponent { - private regionList: Region[][] = [ - [{ direction: '向上', val: 'top', img: 'pic_handwriting_upxhdpi.png' }, - { direction: '向下', val: 'down', img: 'pic_handwriting_downxhdpi.png' }], - [{ direction: '向左', val: 'left', img: 'pic_handwriting_leftxhdpi.png' }, - { direction: '向右', val: 'right', img: 'pic_handwriting_rightxhdpi.png' }]]; - private titleList = ['上下旋转', '左右旋转']; - private previewRegionImg = [$rawfile('pic_scale_set_leftxhdpi.png'), - $rawfile('pic_scale_set_downxhdpi.png'), - $rawfile('pic_scale_set_rightxhdpi.png'), - $rawfile('pic_scale_set_upxhdpi.png')]; - @State private currDirection: string = 'left'; - @State private currDirectionNumber: number = 0; - private keyPreference: preferences.Preferences | null = null; - - setDirection(directionVal: string) { - let angle = 0; - if (directionVal == 'right') { - angle = 180; - } else if (directionVal == 'top') { - angle = 270; - } else if (directionVal == 'down') { - angle = 90; - } - hilog.info(0, 'testTag ui', 'set direction angle:' + angle); - let direction = angle / 90; - if (this.keyPreference != null) { - this.keyPreference.putSync(DIRECT_KEY, direction); - this.keyPreference.flushSync(); - } - this.currDirectionNumber = direction; - RpcTool.getInstance().setDirection(angle / 90); - } - - getDirection() { - if (this.keyPreference == null) { - let filePath = getContext().filesDir; - hilog.info(0, 'testTag', `RegionComponent getDirection, filePath: ${filePath}`); - this.keyPreference = preferences.getPreferencesSync(getContext(this), {name: 'keyInfo'}); - } - let direction = this.keyPreference?.getSync(DIRECT_KEY, 0); - switch (direction) { - case 0: - this.currDirection = 'left'; - this.currDirectionNumber = 0; - break; - case 1: - this.currDirection = 'down'; - this.currDirectionNumber = 1; - break; - case 2: - this.currDirection = 'right'; - this.currDirectionNumber = 2; - break; - case 3: - this.currDirection = 'up'; - this.currDirectionNumber = 3; - break; - default: - break; - } - } - - aboutToAppear() { - this.getDirection(); - } - - build() { - Column() { - // 内容 - Row() { - Column() { - Image(this.previewRegionImg[this.currDirectionNumber]) - .height(460) - }.padding({ right: 100 }) - - Column() { - ForEach(this.titleList, (title: string, index) => { - // 标题分割栏 上下旋转、左右旋转 - Row() { - Text(title) - .fontSize(20) - .width(110) - .fontWeight(FontWeight.Bold) - .textAlign(TextAlign.Center) - .border({ width: { left: 5 }, color: '#0A59F7' }) - }.padding({ bottom: 20 }) - // 向左、向右设置 - Row() { - ForEach(this.regionList[index], (set: Region) => { - Column() { - Image($rawfile(set.img)) - .height((index == 0) ? 100 : 60) - .padding({ left: 8 }) - Row() { - Radio({ value: set.val, group: 'radioGroup' }) - .checked(this.currDirection == set.val) - .onClick(() => { - if(set.val) { - this.setDirection(set.val) - } - }) - Text(set.direction) - }.padding({ top: 15, bottom: 25 }) - }.width(160) - .alignItems(HorizontalAlign.Start) - }) - }.padding({ left: 15 }) - }) - } - .alignItems(HorizontalAlign.Start) - }.layoutWeight(1) - .alignItems(VerticalAlign.Center) - - // 按钮 - Row() { - Button($r('app.string.set_region')) - .width(150) - .margin({ right: 40 }) - Button($r('app.string.auto_correction')) - .width(150) - .margin({ right: 40 }) - Button($r('app.string.fullscreen_mapping')) - .width(150) - }.justifyContent(FlexAlign.SpaceBetween) - .visibility(Visibility.None) - .margin({ bottom: 15 }) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Center) - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/TestTsInterface.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/TestTsInterface.ets deleted file mode 100644 index ffa73f99471b672461b21fbb693d3ff61cbb24d4..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/components/TestTsInterface.ets +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2025 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 { bundleManager } from '@kit.AbilityKit'; - -@Component -export struct TestTsInterface { - @State tokenId: number = -1; - @State data: string = ''; - - queryTokenId() { - try { - let flags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | - bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY; - bundleManager.getBundleInfoForSelf(flags).then(data => { - this.tokenId = data.appInfo.accessTokenId; - }) - - } catch (err) { - console.info('getBundleInfoForSelf failed'); - } - } - - build() { - Row() { - Column() { - Button($r('app.string.get_token')) - .onClick(() => { - this.queryTokenId(); - }) - Text(`${this.tokenId}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/driverability/driver.ts b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/driverability/driver.ts deleted file mode 100644 index a5a5a4654bac732e7cac65ff2bb252ae8c020d3a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/driverability/driver.ts +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2025 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 { rpc } from '@kit.IPCKit'; -import { DriverExtensionAbility } from '@kit.DriverDevelopmentKit'; -import { KeyCode } from '@ohos.multimodalInput.keyCode'; -import { display } from '@kit.ArkUI'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import testNapi from 'libentry.so'; -import { commonEventManager } from '@kit.BasicServicesKit'; -import { backgroundTaskManager } from '@kit.BackgroundTasksKit'; -import { preferences } from '@kit.ArkData'; -import { contextConstant } from '@kit.AbilityKit'; - -let defaultIndexMap : Int32Array= new Int32Array(4); - -let direction : number = 0; - -const STORAGE_KEY = [ - { key: 'key1', default: KeyCode.KEYCODE_SPACE }, - { key: 'key2', default: KeyCode.KEYCODE_ENTER }, - { key: 'key3', default: KeyCode.KEYCODE_BACK }, - { key: 'key4', default: KeyCode.KEYCODE_1 }]; - -async function GetData() { - hilog.info(0, 'testTag', 'GetData enter'); - try { - await testNapi.getBoardInput(); - } catch (e) { - hilog.info(0, 'testTag', 'get kbd input failed'); - } -} - -class FirstDriverAbilityStub extends rpc.RemoteObject { - constructor(des) { - if (typeof des === 'string') { - super(des); - } else { - return null; - } - } - onRemoteMessageRequest(code: number, - data: rpc.MessageSequence, - reply: rpc.MessageSequence, - options: rpc.MessageOption - ) { - hilog.info(0, 'testTag', `testtag driver extension onRemoteMessageRequest called ${code}`); - try{ - if (code == 1) { - let keyIndex = data.readInt(); - let keyValue = data.readInt(); - console.info(`testtag driver extension start setOneButtonMapping key:${keyIndex} val:${keyValue}`); - testNapi.setOneButtonMapping(keyIndex, keyValue); - console.info(`testtag driver extension setOneButtonMapping called key:${keyIndex} val:${keyValue}`); - reply.writeInt(keyIndex); - return true; - } else if (code == 2) { - let direction = data.readInt(); - console.info(`testtag driver start setDirection direction:${direction}`); - testNapi.setDirection(direction); - console.info(`testtag driver setDirection called`); - reply.writeInt(direction); - return true; - } else if (code == 3) { - let type = data.readInt(); - type = (globalThis?.connectStatus ? 1 : 0); - hilog.info(0, 'testTag', `testtag get connection status called status:${type}`); - reply.writeInt(type); - return true; - } - } catch (error) { - hilog.info(0, 'testTag', 'onRemoteMessageRequest exception'); - } - } - - sendDisconnect() { - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - hilog.info(0, 'testTag', `sendDisconnect`); - this.sendMessageRequest(0x99, dataSend, reply, option).then((ret) => { - let msg = reply.readInt(); - reply.writeInt(msg); - hilog.info(0, 'testTag', `sendDisconnect sendMessageRequest ret:${ret} msg:${msg}`); - }).catch((error) => { - hilog.info(0, 'testTag', 'sendDisconnect sendMessageRequest failed'); - }); - } -} - -export default class DriverExtAbility extends DriverExtensionAbility { - - private keyPreferences: preferences.Preferences | null = null; - - private initKeyPreference() { - hilog.info(0, 'testTag', `initKeyPreference stageMode: ${this.context.stageMode}`); - this.context.area = contextConstant.AreaMode.EL1; - hilog.info(0, 'testTag', `initKeyPreference area: ${this.context.area}`); - hilog.info(0, 'testTag', `initKeyPreference preferencesDir: ${this.context.preferencesDir}`); - this.keyPreferences = preferences.getPreferencesSync(this.context, {name: 'keyInfo'}); - } - - getKeyMapInfo() { - STORAGE_KEY.forEach((value, index) => { - defaultIndexMap[index] = this.keyPreferences?.getSync(value.key, value.default) as number; - }) - hilog.info(0, 'testTag', JSON.stringify(defaultIndexMap)); - } - - getDirectionInfo() { - direction = this.keyPreferences?.getSync('direction', 0) as number; - } - - async onInit(want): Promise { - hilog.info(0, 'testTag','DriverAbility OnInit, deviceId '+ want.parameters["deviceId"]); - let ret = testNapi.getProductDesc(want.parameters["deviceId"]); - if (ret != undefined) { - [globalThis.productDesc, globalThis.productId] = ret; - } - hilog.info(0, 'testTag','getProductDesc '+ ret); - this.initKeyPreference(); - this.getKeyMapInfo(); - hilog.info(0, 'testTag','getDirectionInfo'); - this.getDirectionInfo(); - hilog.info(0, 'testTag','getAllDisplays'); - // 获取屏幕分辨率 - try { - display.getAllDisplays((err, data:Array) => { - hilog.info(0, 'testTag', 'getAllDisplays callback'); - if (err && err.code) { - hilog.error(0, 'testTag','Failed to obtain all the display objects. Code: ' + JSON.stringify(err)); - testNapi.setDisplayInfo(2160, 1440); - } else { - hilog.info(0, 'testTag', 'Succeeded in obtaining all the display objects. Data: ' + JSON.stringify(data)); - testNapi.setDisplayInfo(data[0].width, data[0].height); - } - // 传递给native层 - testNapi.setButtonMapping(defaultIndexMap); - testNapi.setDirection(direction); - GetData(); - }); - } catch (error) { - hilog.info(0, 'testTag', 'found js exception'); - testNapi.setDisplayInfo(2160, 1440); - testNapi.setButtonMapping(defaultIndexMap); - testNapi.setDirection(direction); - GetData(); - } - } - onRelease() :void { - hilog.info(0, 'testTag', 'DriverAbility onRelease'); - // 释放底层资源 - testNapi.releaseResource(); - } - onConnect(want): rpc.RemoteObject { - hilog.info(0, 'testTag', 'DriverAbility onConnect'); - return new FirstDriverAbilityStub('remote'); - } - onDisconnect(want): void { - hilog.info(0, 'testTag', 'DriverAbility onDisconnect'); - } - onDump(params): Array { - hilog.info(0, 'testTag', 'DriverAbility onDump, params:' + JSON.stringify(params)); - return ['params']; - } -}; \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/entryability/EntryAbility.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 4e22f36213860f8f58bbbf488827e0e2b99f176c..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/pages/Index.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 2caa25d803caded7eb7a31d7189711f99fb5d921..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 2025 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 { PensComponent } from '../components/PensComponent'; -import { RegionComponent } from '../components/RegionComponent'; -import { KeyPressComponent } from '../components/KeyPressComponent'; -import { AboutComponent } from '../components/AboutComponent'; -import { TestTsInterface } from '../components/TestTsInterface'; -import { common } from '@kit.AbilityKit'; -import RpcTool from '../tool/RpcTool'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { prompt } from '@kit.ArkUI'; - -const IMAGE_WIDTH_HEIGHT: number = 60; // 图片宽高 -const IMAGE_INTERVAL: number = 30; // 图片与图片间距 -const IMAGE_TEXT_INTERVAL: number = 10; // 图片和文本间距 -const MARGIN_LEFT_RIGHT: number = 20; // 顶部菜单栏与屏幕边缘间隔 -const MARGIN_TOP_BOTTOM: number = 20; // 菜单栏上下间距 - -@Preview -@Entry -@Component -struct Index { - @State vendorId: string = ''; - @State productId: string = ''; - @State description: string = ''; - @State currentIndex: number = 0; - @State connectStatus: boolean = false; - saveMessage : string = `save config success`; - - private topMenu = [ - //['笔设置', $rawfile('ic_pen_set_normal.svg'), $rawfile('ic_pen_set_select.svg')], - ['按键设置', $rawfile('ic_keyboard_set_normal.svg'), $rawfile('ic_keyboard_set_select.svg')], - ['区域设置', $rawfile('ic_locale_set_normal.svg'), $rawfile('ic_locale_set_select.svg')], - ['关于', $rawfile('ic_about_normal.svg'), $rawfile('ic_about_select.svg')], - ['保存', $rawfile('ic_save_normal.svg'), $rawfile('ic_save_normal.svg')], - ['tokenID', $rawfile('ic_pen_set_normal.svg'), $rawfile('ic_pen_set_select.svg')], - ]; - private bottomMenu = [['退出', $rawfile('ic_quit_normal.svg'), $rawfile('ic_quit_normal.svg')]]; - private controller: TabsController = new TabsController(); - private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; - - async aboutToAppear() { - hilog.info(0, 'testTag ui', 'aboutToAppear enter'); - RpcTool.getInstance().init((vendorId: string, productId: string, description: string) => { - this.bindCallback(vendorId, productId, description); - }) - RpcTool.getInstance().bindDevice(); - } - - bindCallback(vendorId: string, productId: string, description: string) { - hilog.info(0, 'testTag ui', `bindCallback vendorId: ${vendorId} productId:${productId}`); - this.vendorId = vendorId; - this.productId = productId; - this.description = description; - if (vendorId.length == 0 || productId.length == 0) { - this.connectStatus = false; - } else { - this.connectStatus = true; - } - } - - getSaveMessage() { - if(!this.vendorId || this.vendorId.length == 0) { - return '当前设备未连接'; - } else { - return `save config success`; - } - } - - build() { - Stack() { - Column() { - // 侧边栏 - Row() { - Row() { - ForEach(this.topMenu, (item: string | Resource[], index) => { - Column() { - Image((this.currentIndex == index) ? item[2] : item[1]) - .width(IMAGE_WIDTH_HEIGHT) - .height(IMAGE_WIDTH_HEIGHT) - Text(item[0]) - .margin({ top: IMAGE_TEXT_INTERVAL }) - } - .justifyContent(FlexAlign.Center) - .onClick(() => { - if (item[0] == '保存') { - prompt.showToast({ message: this.getSaveMessage(), bottom: 100, duration: 1800 }); - } else { - this.currentIndex = index; - } - }) - }) - } - .margin({ left: MARGIN_LEFT_RIGHT, bottom: MARGIN_TOP_BOTTOM }) - - Row() { - ForEach(this.bottomMenu, (item: string | Resource[], index) => { - Column() { - Image(item[1]) - .width(IMAGE_WIDTH_HEIGHT) - .height(IMAGE_WIDTH_HEIGHT) - Text(item[0]) - .margin({ top: 10 }) - } - .justifyContent(FlexAlign.Center) - .onClick(() => { - if (item[0] === '退出') { - this.context.terminateSelf(); - } - }) - }) - } - .margin({ right: MARGIN_LEFT_RIGHT, bottom: MARGIN_TOP_BOTTOM }) - } - .width('100%') - .margin({ top: MARGIN_TOP_BOTTOM }) - .border({ width: { bottom: 0.5 }, color: Color.Gray }) - .justifyContent(FlexAlign.SpaceBetween) - - Stack() { - // 标题栏 - Row() { - Text(this.topMenu[this.currentIndex][0]) - .fontSize(30) - .fontWeight(FontWeight.Bold) - } - .alignSelf(ItemAlign.Start) - .width('100%') - .padding({ left: 20, top: 10, bottom: 10 }) - - // 主内容区域 - Row() { - Tabs({ controller: this.controller, index: this.currentIndex }) { - - TabContent() { - KeyPressComponent(); - } - - TabContent() { - RegionComponent(); - } - - TabContent() { - AboutComponent({ vendorId: $vendorId, productId: $productId, description: $description }); - } - TabContent() {} - TabContent() { - TestTsInterface(); - } - } - .barHeight(0) - .height('100%') - .scrollable(false) - } - .layoutWeight(1) - } - .alignContent(Alignment.TopStart) - .layoutWeight(1) - }.width('100%') - .height('100%') - .alignItems(HorizontalAlign.Center) - - Text(this.connectStatus ? $r('app.string.device_connect') : $r('app.string.device_disconnect')) - .fontColor(this.connectStatus ? Color.Black : Color.Red) - .margin({ right: 30, bottom: 20 }) - .fontSize(14) - }.width('100%') - .height('100%') - .alignContent(Alignment.BottomEnd) - } -} - -export {Index} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/tool/RpcTool.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/tool/RpcTool.ets deleted file mode 100644 index be731d8e37f6999ec1baf32f6236f5c6c1b0e40a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/ets/tool/RpcTool.ets +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (c) 2025 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 { rpc } from '@kit.IPCKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { deviceManager } from '@kit.DriverDevelopmentKit'; -import {Index} from '../pages/Index'; -import { BusinessError } from '@kit.BasicServicesKit'; - -const REQUEST_CODE_KEY_VALUE = 1; -const REQUEST_CODE_DIRECTION = 2; -const REQUEST_CODE_CONNECT_STATUS = 3; - -const VENDOR_ID: number = 2903; // 0B57 -const PRODUCT_ID_LIST = [41279, 41296, 41299]; // A13F A150 A153 - -export function sleep(ms: number): Promise { - return new Promise(res => setTimeout(res, ms)); -} - -class MyDeathRecipient { - private rpcTool: RpcTool; - - constructor(rpc: RpcTool) { - this.rpcTool = rpc; - } - - onRemoteDied() { - hilog.info(0, 'testTag ui', 'onRemoteDied'); - this.rpcTool?.resetStatus(); - this.rpcTool?.bindStateChanged(); - } -} - -export default class RpcTool { - private deviceId: number = -1; - private vendorId: number = 0; - private productId: number = 0; - private description: string = ''; - private message: string = ''; - private bindState: boolean = false; - private remote: rpc.RemoteObject | null = null; - private isQuerying : boolean = false; - private isBinding : boolean = false; - private callBack: ((vendorId: string, productId: string, description: string) => void) | null = null; - private connectStatusChanged = false; - public static instance: RpcTool; - - public resetStatus(): void { - this.remote = null; - this.bindState = false; - this.isBinding = false; - this.bindState = false; - this.callBack && this.callBack('', '', ''); - } - - public static getInstance(): RpcTool { - if (!RpcTool.instance) { - RpcTool.instance = new RpcTool(); - } - return RpcTool.instance; - } - - private query() { - hilog.info(0, 'testTag ui', 'query enter'); - if (this.isBinding || this.bindState) { - hilog.info(0, 'testTag ui', 'has bind. device id:' + this.deviceId); - return; - } - if (this.deviceId != -1) { - hilog.info(0, 'testTag ui', 'has query. device id:' + this.deviceId); - return; - } - this.isQuerying = true - try { - let devices: deviceManager.Device[] = deviceManager.queryDevices(deviceManager.BusType.USB); - for (let item of devices) { - let device = item as deviceManager.USBDevice; - hilog.info(0, 'testTag ui', 'querydevice id:' + device.deviceId + ',bustype:' + device.busType + ',vid:' + - device.vendorId + ',pid:' + device.productId + ', des:' + device.description); - let index = PRODUCT_ID_LIST.indexOf(device.productId); - if (index >= 0) { - this.deviceId = device.deviceId; - this.vendorId = device.vendorId; - this.productId = device.productId; - this.description = device.description; - break; - } - } - } catch (error) { - hilog.error(0, 'testTag ui', `Failed to query device. Code is ${error.code}, message is ${error.message}`); - } - this.message = this.deviceId.toString(); - this.isQuerying = false; - } - - async bindStateChanged() { - hilog.info(0, 'testTag ui', 'bindStateChanged enter'); - this.bindState == false; - this.remote = null; - this.deviceId = -1; - this.vendorId = 0; - this.productId = 0; - this.description = ''; - this.callBack && this.callBack(this.getVendorId(), this.getProductId(), this.description); - await sleep(1500); - await this.bindDevice(); - } - - private async bind() { - hilog.info(0, 'testTag ui', 'bind enter'); - if (this.deviceId == -1) { - hilog.error(0, 'testTag ui', 'deviceId is invalid!'); - return; - } - if (this.remote != null) { - hilog.info(0, 'testTag ui', 'has bind device. device id:' + this.deviceId); - return; - } - - if (this.isBinding) { - hilog.info(0, 'testTag ui', 'is binding now'); - return; - } - this.isBinding = true; - try { - hilog.info(0, 'testTag ui', 'bindDevice id is:' + this.deviceId); - let data: deviceManager.RemoteDeviceDriver = await deviceManager.bindDeviceDriver(this.deviceId, - async (err: BusinessError, id: number) => { - hilog.error(0, 'testTag ui', 'Device is disconnected:' + data); - this.bindState = false; - this.isBinding = false; - this.bindStateChanged(); - }); - - hilog.info(0, 'testTag ui', 'bindDevice success:' + data.deviceId); - - this.remote = data.remote as rpc.RemoteObject; - if (this.remote === null) { - hilog.error(0, 'testTag ui', 'create remote fail'); - this.bindState = false; - this.isBinding = false; - return; - } - - this.bindState = true; - this.isBinding = false; - hilog.info(0, 'testTag ui', 'create remote success'); - } catch (error) { - hilog.error(0, 'testTag ui', 'bindDevice fail. Code:' + error + ', message:' + error.message); - this.bindState = false; - this.isBinding = false; - } - } - - init(callback: (vendorId: string, productId: string, description: string) => void) { - this.callBack = callback; - } - - async bindDevice() { - if (this.isQuerying || this.isBinding) { - return; - } - hilog.info(0, 'testTag ui', 'bindDevice enter'); - while (this.remote == null) { - this.query(); - await this.bind(); - await sleep(1500); - hilog.info(0, 'testTag ui', 'timeOut'); - } - this.callBack && this.callBack(this.getVendorId(), this.getProductId(), this.description); - let deathRecipient = new MyDeathRecipient(this); - this.remote.registerDeathRecipient(deathRecipient, 0); - hilog.info(0, 'testTag ui', `vendorId:${this.vendorId} productId:${this.productId} descprtion:${this.description}`); - } - - getVendorId() { - if(this.vendorId == 0) { - return ''; - } else { - return `0x${this.vendorId.toString(16).toUpperCase()}`; - } - } - getProductId() { - if(this.productId == 0) { - return ''; - } else { - return `0x${this.productId.toString(16).toUpperCase()}`; - } - } - - setKeyValue(keyIndex: number, keyValue: number) { - hilog.info(0, 'testTag ui', `setKeyValue enter keyIndex:${keyIndex}, keyValue:${keyValue}`); - // 直接调用rpc的接口向服务端发送消息,客户端需自行对入参进行序列化,对返回值进行反序列化,操作繁琐 - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - dataSend.writeInt(keyIndex); - dataSend.writeInt(keyValue); - hilog.info(0, 'testTag ui', `send key value to remote keyIndex:${keyIndex} keyValue:${keyValue}`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `the remote is null`); - return; - } - this.remote.sendMessageRequest(REQUEST_CODE_KEY_VALUE, dataSend, reply, option).then((ret) => { - let msg = reply.readInt(); - hilog.info(0, 'testTag ui', `setKeyValue ret:${ret} msg:${msg}`); - }).catch(() => { - hilog.info(0, 'testTag ui', 'setKeyValue failed'); - }); - } - - setDirection(direction: number) { - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - dataSend.writeInt(direction); - hilog.info(0, 'testTag ui', `send key value to remote direction:${direction}`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `the remote is null`); - return; - } - this.remote.sendMessageRequest(REQUEST_CODE_DIRECTION, dataSend, reply, option).then((ret) => { - let msg = reply.readInt(); - hilog.info(0, 'testTag ui', `setDirection ret:${ret} msg:${msg}`); - }).catch(() => { - hilog.info(0, 'testTag ui', 'setDirection failed'); - }); - } - - async queryConnectStatus() { - hilog.info(0, 'testTag ui', 'queryConnectStatus enter'); - while(this.remote != null) { - await this.getConnectStatus(); - if(this.connectStatusChanged) { - this.connectStatusChanged = false; - this.bindStateChanged(); - break; - } - await sleep(3000); - } - } - - async getConnectStatus() { - let option = new rpc.MessageOption(); - let dataSend = rpc.MessageSequence.create(); - let reply = rpc.MessageSequence.create(); - hilog.info(0, 'testTag ui', `getConnectStatus`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `the remote is null`); - return; - } - try { - await this.remote.sendMessageRequest(REQUEST_CODE_CONNECT_STATUS, dataSend, reply, option); - let stat = reply.readInt(); - this.connectStatusChanged = (stat == 0 ? true : false); - hilog.info(0, 'testTag ui', `getConnectStatus ${stat}`); - } catch (error) { - this.connectStatusChanged = false; - hilog.info(0, 'testTag ui', 'getConnectStatus failed'); - } - - } -} - diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/module.json5 b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/module.json5 deleted file mode 100644 index a0ae3f1b9a3def841ffbb0e48945650475669f2a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/module.json5 +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "2in1" - ], - "requestPermissions": [ - { - "name": "ohos.permission.ACCESS_DDK_HID" - }, - { - "name": "ohos.permission.ACCESS_DDK_USB" - }, - { - "name": "ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER" - } - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:app_icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "DriverAbility", - "srcEntry": "./ets/driverability/driver.ts", - "icon": "$media:app_icon", - "exported": true, - "type": "driver", - "description": "extensionDescription", - "metadata": [ - { - "name": "bus", // 必填项,所属总线 - "value": "USB" - }, - { - "name": "desc", // 必填项,必要的驱动描述 - "value": "the sample of driverExtensionAbility" - }, - { - "name": "vendor", // 必填项,驱动厂商名称 - "value": "string" - }, - { - "name": "vid", // 支持 USB vendor id 列表,用逗号分隔,不可为空 - "value": "0x0B57" - }, - { - "name": "pid", // 支持的 USB product id 列表,用逗号分隔,不可为空 - "value": "0xA13F,0xA150" - } - ] - } - ] - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/element/color.json b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 08a19b28b96a7fd112a467a4e7b135131ada6239..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, { - "name": "main_color", - "value": "#fefefe" - }, { - "name": "navbar_color", - "value": "#999999" - }, { - "name": "border_color", - "value": "#666666" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/element/float.json b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/element/string.json b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e49ac9efb37b3bd607fa9b77b39188df72558a96..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "手写板" - }, - { - "name": "about", - "value": "关于" - }, - { - "name": "right", - "value": "右键" - }, - { - "name": "left", - "value": "左键" - }, - { - "name": "pen_try", - "value": "笔记效果体验区" - }, - { - "name": "clear", - "value": "清除笔迹" - }, - { - "name": "set_region", - "value": "区域设置" - }, - { - "name": "auto_correction", - "value": "自动矫正" - }, - { - "name": "fullscreen_mapping", - "value": "默认全屏映射" - }, - { - "name": "get_token", - "value": "获取当前应用TokenId" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - }, - { - "name": "keyboard_set", - "value": "按键设置" - }, - { - "name": "locale_set", - "value": "区域设置" - }, - { - "name": "save", - "value": "保存" - }, - { - "name": "quit", - "value": "退出" - } - - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/app_icon.jpg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/app_icon.jpg deleted file mode 100644 index 5161726841612eb3f9ffd5d86207f849c14bd7cb..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/app_icon.jpg and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/background.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/foreground.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/layered_image.json b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/startIcon.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/profile/backup_config.json b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/profile/main_pages.json b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/dark/element/color.json b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_about_normal.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_about_normal.svg deleted file mode 100644 index 3387f4c0237a0a0ab89f8f0693eef37f73fdf505..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_about_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_about_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_about_select.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_about_select.svg deleted file mode 100644 index 6ff81e52e7479add0160ec1854eb839293b2bb7f..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_about_select.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_about_select - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg deleted file mode 100644 index e6424755b97e7fa4d50c76a659b69f6858b3b3d8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_keyboard_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg deleted file mode 100644 index 60863085dd74ac26f9ad9113268d981fc58ca447..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_keyboard_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg deleted file mode 100644 index e33896c20c382c604d8417754a6d88e908d14c19..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_locale_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg deleted file mode 100644 index 8c9ee3b63c47c9355c04681a8c4ca07ce6f47114..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_locale_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_pen.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_pen.png deleted file mode 100644 index 9d959aeabe36bc25d7bdbcc4bb9aad9d530ac902..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_pen.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg deleted file mode 100644 index e878183476d1b9455531d53b2e56d308da5f10ba..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_pen_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg deleted file mode 100644 index 7a8acea71607f4d95f8ba9cc2fd6e0ab6e4f972e..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_pen_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg deleted file mode 100644 index 94d8f1301720fab6674660010a9c371e8467fbd0..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_quit_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_save_normal.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_save_normal.svg deleted file mode 100644 index 7868f7037dd42dc49eedb578956c7496b2e080d8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_save_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_save_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_set_normal.svg b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_set_normal.svg deleted file mode 100644 index 265b373f41b5a82dfaffc9e9721d91876b8ee4dc..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/ic_set_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_set_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pens.PNG b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pens.PNG deleted file mode 100644 index 13e2abe82a62533a429497071f6c336961a45285..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pens.PNG and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png deleted file mode 100644 index 84bd71a268b532582b680827b7b2c93a6436cf95..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png deleted file mode 100644 index d2b5097a2c9f3420908f6a203f2181a3d060a3f8..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png deleted file mode 100644 index d2db5a1b220d889e4536e46c15216d5c470445be..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png deleted file mode 100644 index b50f6e3d445c7ad2a5a13c722385a9dcc8e10a05..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png deleted file mode 100644 index b7d79bb8125b0bb51f3c2ebb57b6a092b125d3c7..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png deleted file mode 100644 index a3dff6a1663db6d344bac6f20b895c888635203f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png deleted file mode 100644 index 871236a32219b18f9e57a678513b006d4e51a087..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png b/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png deleted file mode 100644 index b8bc8e3b929000362bcea64a0629746145df8920..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/mock/Libentry.mock.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 133fac9027ff6bbdcccfe98838fdbb2dc34639ab..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const nativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default nativeMock; \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/mock/mock-config.json5 b/DriverDevelopmentKit/UsbDriverDemo/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index d5943388e057ba28e713817b2359f93a5bcd6977..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Level } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('testConnectState', 0, async (done: Function) => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - console.info('uitest: TestUiExample begin'); - // 初始化Driver对象 - const driver = Driver.create(); - const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - console.info('uitest: bundleName=', bundleName); - // 指定被测应用包名、ability名,请开发者替换为被测应用包名和ability名 - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - // 拉起被测应用 - await delegator.startAbility(want); - console.info('uitest: startAbility'); - // 等待应用拉起完成 - await driver.waitForIdle(500,1000); - // 确认当前应用顶部Ability为指定的ability - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - - // 依据指定文本“设备未连接”查找目标控件 - await driver.assertComponentExist(ON.text('设备未连接')); - // 点击目标控件 - await driver.waitForIdle(4000,5000); - await sleep(3000); - // 通过断言文本为“设备已连接”的控件存在,确认操作后页面变化符合预期 - await driver.assertComponentExist(ON.text('设备已连接')); - await driver.pressBack(); - done(); - }) - }) -} - -function sleep(ms: number): Promise { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/ohosTest/ets/test/List.test.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/ohosTest/module.json5 b/DriverDevelopmentKit/UsbDriverDemo/entry/src/ohosTest/module.json5 deleted file mode 100644 index 47add8875e8c0dec33880348af7ec65a52f30104..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/test/List.test.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/entry/src/test/LocalUnit.test.ets b/DriverDevelopmentKit/UsbDriverDemo/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/hvigor/hvigor-config.json5 b/DriverDevelopmentKit/UsbDriverDemo/hvigor/hvigor-config.json5 deleted file mode 100644 index b8fea3f097bd68b0bc4d87de986d2cb7732c1d9b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/DriverDevelopmentKit/UsbDriverDemo/hvigorfile.ts b/DriverDevelopmentKit/UsbDriverDemo/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/oh-package.json5 b/DriverDevelopmentKit/UsbDriverDemo/oh-package.json5 deleted file mode 100644 index 69cb43cba3addcee1840403c67405134a2a9102c..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/DriverDevelopmentKit/UsbDriverDemo/ohosTest.md b/DriverDevelopmentKit/UsbDriverDemo/ohosTest.md deleted file mode 100644 index 76bf01e3f925685bb49619f2180f1688b182e9d2..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbDriverDemo/ohosTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# USB类设备驱动测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 |测试结果| -|----------|---------------|--------------------|-----------------------------|------|--------------------------------| -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 |Pass| -| 设备识别 | 插入Usb外设(手写板) | 手动插入外设 | 连接状态显示已连接 | 否 |Pass| -| 手写板按键自定义 | 位于主页 | 点击左边4个按钮,修改按键值为“2” | 点击手写板的对应按钮,系统输入“2” | 否 |Pass| -| 手写板区域设置 | 位于区域设置页 | 选择对应关系 | 手写板在系统上显示对应关系与修改一致 | 否 |Pass| -| 手写板属性读取 | 位于关于页 | 点击“关于” | 能正确读取手写板的vendorId/productId | 否 |Pass| -| 保存 | 位于主页页 | 点击“保存” | 能保存修改的键值 | 否 |Pass| -| 退出 | 位于主页页 | 点击“退出” | 应用能正常退出 | 否 |Pass| \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbDriverDemo/screenshots/about.png b/DriverDevelopmentKit/UsbDriverDemo/screenshots/about.png deleted file mode 100644 index 66d33f0afc145de79583b04a615d6f0cd1e395fd..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/screenshots/about.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/screenshots/locale_set.png b/DriverDevelopmentKit/UsbDriverDemo/screenshots/locale_set.png deleted file mode 100644 index f0c8ef351446ae21d9f609885625f24ee01a2b2e..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/screenshots/locale_set.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/screenshots/main.png b/DriverDevelopmentKit/UsbDriverDemo/screenshots/main.png deleted file mode 100644 index 41017412a907db0f50b28ea9c6b8549d6f6e6f29..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/screenshots/main.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbDriverDemo/screenshots/token.png b/DriverDevelopmentKit/UsbDriverDemo/screenshots/token.png deleted file mode 100644 index 615593d08ffc529d204a325512046a68f7373a81..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbDriverDemo/screenshots/token.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/.gitignore b/DriverDevelopmentKit/UsbSerialDriverDemo/.gitignore deleted file mode 100644 index 8aa0419d18a172c1c7b91aa32994a07dc8eeb5a8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -**/oh-package-lock.json5 -/sign \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/AppScope/app.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/AppScope/app.json5 deleted file mode 100644 index a92b39313522654f371557bbb8b34afd94565e9e..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.usbserial_demo1", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/AppScope/resources/base/element/string.json b/DriverDevelopmentKit/UsbSerialDriverDemo/AppScope/resources/base/element/string.json deleted file mode 100644 index 73635ca6a61ca0459aedbcc8c464c16d8ce992ba..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "usbserial_demo1" - } - ] -} diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/AppScope/resources/base/media/app_icon.png b/DriverDevelopmentKit/UsbSerialDriverDemo/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/README_zh.md b/DriverDevelopmentKit/UsbSerialDriverDemo/README_zh.md deleted file mode 100644 index d3e957896e3f31e415e8d2f6d44fa2c7d58a8afb..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/README_zh.md +++ /dev/null @@ -1,85 +0,0 @@ -# 驱动开发服务 - -### 介绍 - -本示例主要展示了通过DriverDevelopmentKit开发套件中USB Serial DDK开发驱动服务,使用[@ohos.driver.deviceManager](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-driver-deviceManager.md) 、[@ohos.app.ability.DriverExtensionAbility](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/js-apis-app-ability-driverExtensionAbility.md) 、[@ohos.rpc](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ipc-kit/js-apis-rpc.md)、[USB Serial DDK](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-driverdevelopment-kit/capi-usb-serial-api-h.md) -等接口,实现了整个USB转串口设备驱动功能,包括USB转串口设备UI参数设置界面及驱动服务端。其中UI参数界面包括串口设备、温度显示,驱动服务端通过客户端绑定拉起,驱动服务端主要给UI参数界面提供接口及与物理设备通信; - -### 效果预览 - -| 主页(串口设置) | 温度显示 | -|--------------------------------|------------------------------------| -| ![image](screenshots/main.png) | ![image](screenshots/tem_show.png) | - -使用说明 - -1. 安装该示例应用后,当目标设备插入时,扩展外设驱动服务SA会拉起DriverExtensionAbility相关进程(即:驱动服务端) -2. 在主界面绘制完成后,会调用deviceManager的绑定接口,绑定驱动服务端,成功后主界面会显示“设备已连接”; -3. 主界面用户可以填USB Serial通信相关参数,打开设备; -4. 温度显示界面,用户可以设置超时时间,读取温度,界面会通过服务端与设备通信; -5. 退出按钮,退出驱动界面。 - -### 工程目录 - -给出项目中关键的目录结构并描述它们的作用,示例如下: - -``` -entry/src/main/ets -|---components -| |---SerialPortComponent.ets //“串口设置”部件页面构造 -| |---TempShowComponent.ets //“温度显示”部件页面构造 -|---DriverAbility -| |---driver.ts //主要重载了继承驱动扩展能力DriverExtensionAbility,Onit初始化USB接口等 -|---entryability -| |---EntryAbility.ets //界面ability -|---pages -| |---Index.ets //应用首页 -|---tool -| |---GlobalContext.ets //用于上下文存储单例对象工具 -| |---RpcTool.ets //主要封装了扩展外设相关接口,实现相关功能,如:查询设备,绑定设备,连接远程对象等 -| |---ObserverManager.ets //观察者管理类 -| |---SerialPortStatusManager.ets //串口状态管理类 -| |---TemperatureStatusManager.ets //温度显示管理类 -entry/src/main/cpp -|---types -| |---libentry //创建native c++工程,自动生成的文件目录 -|---hello.cpp //主要封装了UsbSerial驱动相关接口,实现相关功能,如:设置波特率、读写等功能 -|---data_parser.cpp //主要封装了UsbSerial物理设备与系统通信数据转换功能 -|---data_parser.h //申明UsbSerial物理设备与系统通信数据转换接口 -``` - -### 具体实现 - -* 驱动UI界面,功能包括查询设备列表、绑定设备驱动服务端、与设备驱动服务端通信,源码参考:[Index.ets](code/DocsSample/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/pages/Index.ets) - * 使用deviceManager.queryDevices来获取设备列表; - * 通过deviceManager.bindDeviceDriver来绑定设备驱动服务端,通过返回值拿到驱动服务端实例; - * 通过服务端实例调用sendMessageRequest与设备驱动服务端通信,并获取到服务端回应,将回应数据打印到主界面; - -* 驱动服务端,与驱动UI界面通信,源码参考:[driver.ts](code/DocsSample/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/DriverAbility/driver.ts) - * 当物理设备插入后,UI界面通过bindDeviceDriver接口获取到驱动服务端实例,再通过服务端实例与服务端通信; - * 驱动服务拉起后,会调用DriverExtAbility中onInit方法,可以在此方法中通过Napi接口调用CAPI,初始化USB DDK等 - * 驱动UI界面通过deviceManager调用绑定接口,会调用DriverExtAbility中onConnect返回服务端实例 - * 驱动UI界面通过服务端实例与服务端通信,服务端通过Napi接口调用CAPI,与物理设备通信 - -### 相关权限 - -[ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md) -[ohos.permission.ACCESS_DDK_USB_SERIAL](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md) - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568; -2. 本示例为Stage模型,仅支持API18版本SDK,SDK版本号(API Version 18),镜像版本号(5.1Release) -3. 本示例需要使用DevEco Studio 版本号(6.0Release)版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/DriverDevelopmentKit > .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/DriverDevelopmentKit/UsbSerialDriverDemo/build-profile.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/build-profile.json5 deleted file mode 100644 index 144376964ea59a56c76bb783c0fcc288f47b0b4d..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/build-profile.json5 +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS" - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - "signingConfigs": [ - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/code-linter.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/.gitignore b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/build-profile.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/build-profile.json5 deleted file mode 100644 index 2d8b081b615348a99aa197f90186f3d8891b7dc1..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a", - "x86_64" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/hvigorfile.ts b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/UsbSerialDriverDemo/entry/obfuscation-rules.txt b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/DriverDevelopmentKit/UsbSerialDriverDemo/entry/oh-package.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/CMakeLists.txt b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 0619d2e46f016b1ffbfd8d55c0794241a0cf357b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(usbserial_demo1) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -set(CMAKE_CXX_STANDARD 17) -set(LIB_DIR ${NATIVERENDER_ROOT_PATH}/../../../libs/) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include - ${LIB_DIR}/include) - -#add_library(libparse_point SHARED parse_point_info.cpp) -#add_library(libparse_point SHARED IMPORTED) -#set_target_properties(libparse_point PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/${OHOS_ARCH}/libparse_point.so) - -add_library(entry SHARED hello.cpp data_parser.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libusb_serial_ndk.z.so libhilog_ndk.z.so -lpthread) \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/data_parser.cpp b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/data_parser.cpp deleted file mode 100644 index 1c0d66d47a1c3942cd7f5d51cf83f96b0651aec9..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/data_parser.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "data_parser.h" -#include -#include -#include -#include -#include - -#define MAX_NUM 65536 -const int NUM_THREE = 3; -const int NUM_FOUR = 4; -const int NUM_EIGHT = 8; -const int NUM_TEN = 10; - -DataParser &DataParser::GetInstance() -{ - static DataParser parser; - return parser; -} - -uint64_t DataParser::KeyValueToDeviceID(char *keyValue) -{ - char *endptr; - uint64_t deviceID = strtoull(keyValue, &endptr, NUM_TEN); - // 检查转换是否成功以及是否整个字符串都被解析 - if (*endptr != '\0' || keyValue == endptr) { - OH_LOG_INFO(LOG_APP, "DeviceID must be a valid number string\n"); - return false; - } - return deviceID; -} - -uint32_t DataParser::KeyValueToUint32OrUint8(char *keyValue) -{ - char *end; - unsigned long configData = std::strtoul(keyValue, &end, NUM_TEN); - // Check if the whole string was consumed and it's within uint32_t range. - if (*end != '\0' || configData > UINT32_MAX) { - OH_LOG_INFO(LOG_APP, "parers must be a valid number string\n"); - } - return configData; -} - -uint8_t DataParser::KeyValueToParity(char *keyValue) -{ - if (strcmp(keyValue, "None") == 0) { - return NONE; - } else if (strcmp(keyValue, "Odd") == 0) { - return ODD; - } else if (strcmp(keyValue, "Even") == 0) { - return EVEN; - } - return NONE; -} - -void DataParser::UpdateKeyCodeMap(int key, char *keyValue) -{ - switch (key) { - case KEY_DEVICEID: - deviceID_ = KeyValueToDeviceID(keyValue); - break; - case KEY_BAUDRATE: - baudRate_ = KeyValueToUint32OrUint8(keyValue); - break; - case KEY_DATABITS: - nDataBits_ = KeyValueToUint32OrUint8(keyValue); - break; - case KEY_STOPBITS: - nStopBits_ = KeyValueToUint32OrUint8(keyValue); - break; - case KEY_PARITY: - parity_ = KeyValueToParity(keyValue); - break; - case KEY_FLOW_CONTROL: - flowControl_ = KeyValueToUint32OrUint8(keyValue); - break; - default: - OH_LOG_INFO(LOG_APP, "key:%{public}d is incorrect", key); - break; - } -} - -uint64_t DataParser::GetDeviceID() -{ - return deviceID_; -} - -uint32_t DataParser::GetBaudRate() -{ - return baudRate_; -} - -uint8_t DataParser::GetDataBits() -{ - return nDataBits_; -} - -uint8_t DataParser::GetStopBits() -{ - return nStopBits_; -} - -uint8_t DataParser::GetParity() -{ - return parity_; -} - -uint8_t DataParser::GetFlowControl() -{ - return flowControl_; -} - -UsbSerial_Device *DataParser::GetSerialObject() -{ - return serial_; -} - -void DataParser::SetSerialObject(UsbSerial_Device *devHandle) -{ - this->serial_ = devHandle; -} - -double DataParser::ParseData(const uint8_t *buff, uint32_t length) -{ - // 检查输入是否有效 - if (buff == nullptr) { - OH_LOG_INFO(LOG_APP, "buff is null\n"); - } - - // 提取第5位和第6位(即数组索引4和5) - uint8_t highByte = buff[NUM_THREE]; - uint8_t lowByte = buff[NUM_FOUR]; - OH_LOG_INFO(LOG_APP, "highByte=%{public}d lowByte=%{public}d\n", highByte, lowByte); - // 组合成16位整数 - int16_t temperatureRaw = (static_cast(highByte) << NUM_EIGHT) | lowByte; - // 判断正负 - if (highByte >= 0x08) { - // 负数处理 - temperatureRaw = temperatureRaw - MAX_NUM; - } - - // 将16进制转换为10进制并除以10得到温度值 - double temperature = static_cast(temperatureRaw) / TEMPERATURE_BASE; - return temperature; -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/data_parser.h b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/data_parser.h deleted file mode 100644 index 2b64fae65b63126a8facbf2ef2fdf6efe287f0a4..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/data_parser.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#ifndef DATA_PARSER_H -#define DATA_PARSER_H - -#include -#include - -enum KeyCode { - KEY_BAUDRATE = 0, - KEY_DATABITS, - KEY_STOPBITS, - KEY_PARITY, - KEY_FLOW_CONTROL, - KEY_DEVICEID, -}; - -enum ParityCode { - NONE = 0, - ODD, - EVEN, -}; - -const uint32_t TEMPERATURE_BASE = 10; - -class DataParser { -public: - DataParser() = default; - - virtual ~DataParser() = default; - - static DataParser &GetInstance(); - - // 解析数据 - double ParseData(const uint8_t *buffer, uint32_t length); - - // 设置keycode map - void UpdateKeyCodeMap(int key, char *keyValue); - - UsbSerial_Device *GetSerialObject(); - void SetSerialObject(UsbSerial_Device *devHandle); - uint64_t GetDeviceID(); - uint32_t GetBaudRate(); - uint8_t GetDataBits(); - uint8_t GetStopBits(); - uint8_t GetParity(); - uint8_t GetFlowControl(); - -private: - uint64_t KeyValueToDeviceID(char *keyValue); - uint32_t KeyValueToUint32OrUint8(char *keyValue); - uint8_t KeyValueToParity(char *keyValue); - -private: - uint64_t deviceID_; - uint32_t baudRate_; - uint8_t nDataBits_; - uint8_t nStopBits_; - uint8_t parity_; - uint8_t flowControl_; - UsbSerial_Device *serial_; -}; - -#endif // DATA_PARSER_H diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/hello.cpp b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/hello.cpp deleted file mode 100644 index cad37fd44d221746c3a9bcab5c4a5abcde5bf7dd..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/hello.cpp +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "data_parser.h" -#include "napi/native_api.h" -#include -#include -#include -#include -#include -#include - -#define LOG_TAG "thermometer [NATIVE]" -uint8_t g_writeCommand[] = {0x01, 0x03, 0x00, 0x00, 0x00, 0x01, 0x84, 0x0A}; -const int NUM_TWO = 2; -const int NUM_EIGHT = 8; -const int NUM_SIXTEEN = 16; -const int NUM_THIRTY_TWO = 32; -const int NUM_BAUDRATE = 9600; - -uint32_t StartWork() -{ - // 打开 USB 串口设备 - UsbSerial_Device *serial = nullptr; - uint32_t bInterfaceNum = 0x00; - // 打开deviceId和bInterfacenum指定的USB串口设备 - uint32_t ret = OH_UsbSerial_Open(DataParser::GetInstance().GetDeviceID(), bInterfaceNum, &serial); - if (ret != USB_SERIAL_DDK_SUCCESS) { - OH_UsbSerial_Close(&serial); - OH_LOG_ERROR(LOG_APP, "Failed to open USB serial device: %{public}d", ret); - return ret; - } - - DataParser::GetInstance().SetSerialObject(serial); - // 分配并初始化 UsbSerial_Params 结构体 - struct UsbSerial_Params *serialParams = (struct UsbSerial_Params *)malloc(sizeof(struct UsbSerial_Params)); - if (serialParams == nullptr) { - OH_LOG_ERROR(LOG_APP, "Failed to allocate memory for UsbSerial_Params"); - OH_UsbSerial_Close(&serial); - return ENOMEM; - } - // 初始化 UsbSerial_Params 成员变量 - serialParams->baudRate = DataParser::GetInstance().GetBaudRate(); - serialParams->nDataBits = DataParser::GetInstance().GetDataBits(); - serialParams->nStopBits = DataParser::GetInstance().GetStopBits(); - serialParams->parity = DataParser::GetInstance().GetParity(); - - OH_LOG_INFO(LOG_APP, "serialParams->baudRate:%{public}d, serialParams->nDataBits:%{public}d, " - "serialParams->nStopBits:%{public}d, serialParams->parity:%{public}d", - serialParams->baudRate, serialParams->nDataBits, serialParams->nStopBits, serialParams->parity); - - // 设置 USB 串口参数 - ret = OH_UsbSerial_SetParams(DataParser::GetInstance().GetSerialObject(), serialParams); - if (ret != USB_SERIAL_DDK_SUCCESS) { - OH_LOG_ERROR(LOG_APP, "Failed to set USB serial parameters: %d", ret); - free(serialParams); - OH_UsbSerial_Close(&serial); - return ret; - } - // 释放分配的内存 - free(serialParams); - - UsbSerial_FlowControl flowControl = UsbSerial_FlowControl(DataParser::GetInstance().GetFlowControl()); - OH_UsbSerial_SetFlowControl(DataParser::GetInstance().GetSerialObject(), flowControl); - OH_LOG_INFO(LOG_APP, "Set the flow control finished. \n"); - - OH_UsbSerial_Flush(DataParser::GetInstance().GetSerialObject()); - OH_LOG_INFO(LOG_APP, "Flush the input and output buffers finished. \n"); - - OH_UsbSerial_FlushInput(DataParser::GetInstance().GetSerialObject()); - OH_LOG_INFO(LOG_APP, "Flush the input buffer finished. \n"); - - OH_UsbSerial_FlushOutput(DataParser::GetInstance().GetSerialObject()); - OH_LOG_INFO(LOG_APP, "Flush the output buffer finished. \n"); - - return ret; -} - -static napi_value Config(napi_env env, napi_callback_info info) -{ - size_t argc = NUM_TWO; - napi_status status; - napi_value args[NUM_TWO]; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (argc < NUM_TWO) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - - uint32_t key = 0; - size_t strLen; - char *utf8Buf; - status = napi_get_value_uint32(env, args[0], &key); - if (status != napi_ok) { - OH_LOG_INFO(LOG_APP, "First argument must be a number\n"); - return nullptr; - } - - status = napi_get_value_string_utf8(env, args[1], nullptr, 0, &strLen); - if (status != napi_ok) { - OH_LOG_INFO(LOG_APP, "Second argument must be a string\n"); - return nullptr; - } - - if (strLen < 0 || strLen > INT16_MAX) { - OH_LOG_INFO(LOG_APP, "Invalid string length\n"); - return nullptr; - } - utf8Buf = (char *)malloc(strLen + 1); - if (utf8Buf == nullptr) { - OH_LOG_INFO(LOG_APP, "Failed to allocate memory for string\n"); - return nullptr; - } - - status = napi_get_value_string_utf8(env, args[1], utf8Buf, strLen + 1, &strLen); - if (status != napi_ok) { - free(utf8Buf); - OH_LOG_INFO(LOG_APP, "Failed to get string value\n"); - return nullptr; - } - utf8Buf[strLen] = '\0'; - DataParser::GetInstance().UpdateKeyCodeMap(key, utf8Buf); - if (utf8Buf != nullptr) { - free(utf8Buf); - } - uint32_t ret; - - ret = StartWork(); - OH_LOG_INFO(LOG_APP, "StartWork ret %{public}d", ret); - - napi_value result = nullptr; - napi_create_uint32(env, ret, &result); - return result; -} - -static napi_value ReadTemperature(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter ReadTemperature\n"); - // 调用 - uint8_t dataBuff[8]; - uint32_t bytesRead; - uint32_t bytesWritten; - UsbSerial_Device *serial = DataParser::GetInstance().GetSerialObject(); - if (DataParser::GetInstance().GetSerialObject() == nullptr) { - OH_LOG_INFO(LOG_APP, "fd is null\n"); - }; - - auto ret = OH_UsbSerial_Write(DataParser::GetInstance().GetSerialObject(), g_writeCommand, sizeof(g_writeCommand), - &bytesWritten); - if (ret != USB_SERIAL_DDK_SUCCESS) { - OH_LOG_INFO(LOG_APP, "write command fail,Actual bytes written = %{public}d", bytesWritten); - OH_UsbSerial_Close(&serial); - napi_value result = nullptr; - napi_create_uint32(env, ret, &result); - return result; - } - ret = OH_UsbSerial_Read(serial, dataBuff, sizeof(dataBuff), &bytesRead); - if (ret != USB_SERIAL_DDK_SUCCESS) { - OH_LOG_INFO(LOG_APP, "read temperature data fail Actual bytes read= %{public}d\n", bytesRead); - OH_UsbSerial_Close(&serial); - napi_value result = nullptr; - napi_create_uint32(env, ret, &result); - return result; - } - auto temperature = DataParser::GetInstance().ParseData(dataBuff, bytesRead); - napi_value result = nullptr; - napi_create_double(env, temperature, &result); - return result; -} - -static napi_value ReleaseResource(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter ReleaseResource\n"); - UsbSerial_Device *serial = DataParser::GetInstance().GetSerialObject(); - if (serial != nullptr) { - OH_LOG_INFO(LOG_APP, "function, serial != nullptr\n"); - } - // 调用ddk 关闭串口 - OH_UsbSerial_Close(&serial); - OH_UsbSerial_Release(); - return nullptr; -} - -void Test() -{ - // 1.初始化DDK。 - // 使用 usb_serial_api.h 的 OH_UsbSerial_Init 初始化DDK。 - - // [Start driver_serial_step1] - // 初始化USB Serial DDK - OH_UsbSerial_Init(); - // [End driver_serial_step1] - - // 2.打开USB串口设备。 - // 使用 usb_serial_api.h 的 OH_UsbSerial_Open 打开设备。 - - // [Start driver_serial_step2] - UsbSerial_Device *dev = NULL; - uint64_t deviceId = 1; - uint8_t interfaceIndex = 0; - // 打开deviceId和interfaceIndex指定的USB串口设备 - OH_UsbSerial_Open(deviceId, interfaceIndex, &dev); - // [End driver_serial_step2] - - // 3.设置USB串口设备的参数。 - // 使用 usb_serial_api.h 的 OH_UsbSerial_SetParams 接口设置串口参数,或者直接调用 OH_UsbSerial_SetBaudRate 设置波特率, - // 使用 OH_UsbSerial_SetTimeout 设置读取数据的超时时间。 - - // [Start driver_serial_step3] - UsbSerial_Params params; - params.baudRate = NUM_BAUDRATE; - params.nDataBits = NUM_EIGHT; - params.nStopBits = 1; - params.parity = 0; - // 设置串口参数 - OH_UsbSerial_SetParams(dev, ¶ms); - - // 设置波特率 - uint32_t baudRate = NUM_BAUDRATE; - OH_UsbSerial_SetBaudRate(dev, baudRate); - - // 设置超时时间 - int timeout = 500; - OH_UsbSerial_SetTimeout(dev, timeout); - // [End driver_serial_step3] - - // 4.设置流控、清空缓冲区。 - //使用 usb_serial_api.h 的 OH_UsbSerial_SetFlowControl 设置流控方式,使用 OH_UsbSerial_Flush 清空缓冲区, - //使用 OH_UsbSerial_FlushInput 清空输入缓冲区,使用 OH_UsbSerial_FlushOutput 清空输出缓冲区。 - - // [Start driver_serial_step4] - // 设置软件流控 - OH_UsbSerial_SetFlowControl(dev, USB_SERIAL_SOFTWARE_FLOW_CONTROL); - - // 清空缓冲区 - OH_UsbSerial_Flush(dev); - - // 清空输入缓冲区 - OH_UsbSerial_FlushInput(dev); - - // 清空输出缓冲区 - OH_UsbSerial_FlushOutput(dev); - // [End driver_serial_step4] - - //5.向USB串口设备写入/读取数据。 - // 使用 usb_serial_api.h 的 OH_UsbSerial_Write 给设备发送数据,并使用 OH_UsbSerial_Read 读取设备发送过来的数据。 - - // [Start driver_serial_step5] - uint32_t bytesWritten = 0; - // 测试设备读取指令,具体指令根据设备协议而定 - uint8_t writeBuff[NUM_EIGHT] = {0x01, 0x03, 0x00, 0x00, 0x00, 0x01, 0x84, 0xA}; - // 发送数据 - OH_UsbSerial_Write(dev, writeBuff, sizeof(writeBuff), &bytesWritten); - - // 接收数据 - uint8_t readBuff[100]; - uint32_t bytesRead = 0; - OH_UsbSerial_Read(dev, readBuff, sizeof(readBuff), &bytesRead); - // [End driver_serial_step5] - - // 6.关闭USB串口设备。 - // 在所有请求处理完毕,程序退出前,使用 usb_serial_api.h 的 OH_UsbSerial_Close 关闭设备。 - - // [Start driver_serial_step6] - // 关闭设备 - OH_UsbSerial_Close(&dev); - // [End driver_serial_step6] - - // 7.释放DDK。 - // 在关闭USB串口设备后,使用 usb_serial_api.h 的 OH_UsbSerial_Release 释放DDK。 - - // [Start driver_serial_step7] - // 释放USB Serial DDK - OH_UsbSerial_Release(); - // [End driver_serial_step7] -} - -static napi_value UsbSerialInit(napi_env env, napi_callback_info info) -{ - napi_value result = nullptr; - size_t argc = 1; - napi_status status; - napi_value args[1]; - status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - if (status != napi_ok || argc != 1) { - OH_LOG_ERROR(LOG_APP, "argc is invalid"); - return nullptr; - } - - uint32_t deviceId = 0; - status = napi_get_value_uint32(env, args[0], &deviceId); - if (status != napi_ok) { - OH_LOG_ERROR(LOG_APP, nullptr, "Failed to get uint32 value"); - return nullptr; - } - OH_LOG_INFO(LOG_APP, "deviceId = %{public}d\n", deviceId); - - uint32_t busNum = ((deviceId & 0xFFFF0000) >> NUM_SIXTEEN); - OH_LOG_INFO(LOG_APP, "busNum = %{public}d\n", busNum); - uint32_t deviceNum = deviceId & 0xFFFF; - OH_LOG_INFO(LOG_APP, "deviceNum = %{public}d\n", deviceNum); - uint64_t deviceId1 = (static_cast(busNum) << NUM_THIRTY_TWO) | deviceNum; - OH_LOG_INFO(LOG_APP, "deviceId1 = %{public}d\n", deviceId1); - - std::string devStr = std::to_string(deviceId1); - OH_LOG_INFO(LOG_APP, "devStr = %{public}s\n", devStr.c_str()); - DataParser::GetInstance().UpdateKeyCodeMap(KEY_DEVICEID, const_cast(devStr.c_str())); - - // 初始化USB Serial DDK - uint32_t ret = OH_UsbSerial_Init(); - OH_LOG_INFO(LOG_APP, "enter UsbSerialInit ret = %{public}d\n", ret); - - napi_create_int32(env, ret, &result); - return result; -} - -static napi_value Close(napi_env env, napi_callback_info info) -{ - UsbSerial_Device *serial = DataParser::GetInstance().GetSerialObject(); - OH_LOG_INFO(LOG_APP, "enter Close\n"); - uint32_t ret = OH_UsbSerial_Close(&serial); - napi_value result = nullptr; - napi_create_int32(env, ret, &result); - DataParser::GetInstance().SetSerialObject(serial); - OH_LOG_INFO(LOG_APP, "enter Close ret = %{public}d\n", ret); - return result; -} - -static napi_value SetTimeOut(napi_env env, napi_callback_info info) -{ - OH_LOG_INFO(LOG_APP, "enter SetTimeOut\n"); - size_t argc = 1; - napi_value args[1]; - int32_t timeOut; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - auto status = napi_get_value_int32(env, args[0], &timeOut); - if (status != napi_ok) { - OH_LOG_INFO(LOG_APP, "Timeout invalid\n"); - return nullptr; - } - int32_t ret = OH_UsbSerial_SetTimeout(DataParser::GetInstance().GetSerialObject(), timeOut); - napi_value result = nullptr; - napi_create_int32(env, ret, &result); - return result; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - {"config", nullptr, Config, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"readTemperature", nullptr, ReadTemperature, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"releaseResource", nullptr, ReleaseResource, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"usbSerialInit", nullptr, UsbSerialInit, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"close", nullptr, Close, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setTimeOut", nullptr, SetTimeOut, nullptr, nullptr, nullptr, napi_default, nullptr}}; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 8595c2a21e34f535b3fec7eee68ea7e42a6a3f2b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -declare namespace testNapi { - function usbSerialInit(deviceId:number):number; - function config(item:number, nData:string):number; - function readTemperature():number; - function close():number; - function releaseResource():void; - function setTimeOut(time:number):number; -} -export default testNapi; \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/DriverAbility/driver.ts b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/DriverAbility/driver.ts deleted file mode 100644 index b1a61fd3768f4aa0d4d47cde07ed017d5500e0cc..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/DriverAbility/driver.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2025 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 { DriverExtensionAbility } from '@kit.DriverDevelopmentKit'; -import { rpc } from '@kit.IPCKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import testNapi from 'libentry.so' - -const REQUEST_CODE = 1; // 与扩展外设客户端约定请求码,配置串口 -const READ_CODE = 5; // 与扩展外设客户端约定请求码,读取数据 -const CLOSE_CODE = 4; // 与扩展外设客户端约定请求码,关闭串口 -const SETTIMEOUT_CODE = 6; // 与扩展外设客户端约定请求码,设置超时时间 -const TOTAL_CONFIGURATION = 5; -let deviceId; - -class Temperature extends rpc.RemoteObject { - private currentNum: number = 100; - private let; - - // 接收应用传递过来的消息处理,以及将处理的结果返回给客户端 - onRemoteMessageRequest(code: number, data: rpc.MessageSequence, reply: rpc.MessageSequence, - option: rpc.MessageOption) { - let datasize = data.getSize(); - let ret = -1; - if (code === REQUEST_CODE) { - let i = 0; - let ret; - while (i < TOTAL_CONFIGURATION) { - i++; - let keyIndex = data.readInt(); // 取得数据项 - let keyValue = data.readString(); // 取得数据值 - hilog.info(0, 'testTag', `usbSerialInit successful, keyIndex:${keyIndex} keyValue:${keyValue}`); - ret = testNapi.config(keyIndex, keyValue); - } - reply.writeInt(ret); - return true; - } else if (code === READ_CODE) { - // 读取数据 - hilog.info(0, 'testTag ui', 'driver Read'); - let data = testNapi.readTemperature(); - hilog.info(0, 'testTag ui', `driver Read data : ${data}`); - reply.writeDouble(data); - return true; - } else if (code === CLOSE_CODE) { - // 关闭串口 - let ret = testNapi.close(); - hilog.info(0, 'testTag ui', `driver close,ret:${ret}`); - reply.writeInt(ret); - return true; - } else if (code == SETTIMEOUT_CODE) { - let timeout = data.readInt(); - let ret = testNapi.setTimeOut(timeout); - hilog.info(0, 'testTag ui', `setTimeOut successful, ret:${ret}`); - reply.writeInt(ret); - return true; - } - return true; - } -} - -export default class DriverExtAbility extends DriverExtensionAbility { - async onInit(want) { - hilog.info(0, 'testTag', 'DriverAbility OnInit'); - hilog.info(0, 'testTag', 'OnInit deviceId ' + want.parameters["deviceId"]); - deviceId = want.parameters["deviceId"]; - hilog.info(0, 'testTag ui', `OnInit want deviceId :${deviceId}`); - let ret = testNapi.usbSerialInit(deviceId); - hilog.info(0, 'testTag ui', `DriverAbility OnInit ret:${ret}`); - } - - onRelease() { - console.info('testTag', `onRelease`); - testNapi.releaseResource(); - } - - onConnect(want) { - console.info('testTag', `onConnect, want: ${want.abilityName}`); - return new Temperature("remote"); - } - - onDisconnect(want) { - console.info('testTag', `onDisconnect, want: ${want.abilityName}`); - } - - onDump(params: Array) { - console.info('testTag', `onDump, params:` + JSON.stringify(params)); - return ['params']; - } -} diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/components/SerialPortComponent.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/components/SerialPortComponent.ets deleted file mode 100644 index 73591dc1d4634c64dd6c7ec9c91252baf3dc5b31..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/components/SerialPortComponent.ets +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2025 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 RpcTool from '../tool/RpcTool'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { promptAction } from '@kit.ArkUI'; -import { SerialPortStatusManager } from '../tool/SerialPortStatusManager'; -import { TemperatureStatusManager } from '../tool/TemperatureStatusManager'; - -const TEXT_HEIGHT: number = 60; -const keyValuePairs = new Map(); - -interface Options { - value: string; -} - -@Component -export struct SerialPortComponent { - @State baudRateValue: string = ''; - @State baudRateIndex: number = 0; - @State dataBitValue: string = ''; - @State dataBitIndex: number = 1; - @State stopBitValue: string = ''; - @State stopBitIndex: number = 2; - @State parityBitValue: string = ''; - @State parityBitIndex: number = 3; - @State flowControlValue: string = ''; - @State flowControlIndex: number = 4; - @State isSerialPortStatus: boolean = false; //串口状态 - @State connectStatus: boolean = false; - // @Link msg:number; - @State isReadStatus: boolean = false; //监听温度显示的读取温度状态 - private onReadTemperatureStatusChange = (status: boolean) => { - hilog.info(0, 'testTag ui', `onReadTemperatureStatusChange status:${status}`); - this.isReadStatus = status; - }; - //定义波特率数组 - @State baudRates: Array = [{ value: '1200' }, { value: '2400' }, { value: '4800' }, { value: '9600' }, - { value: '19200' }, { value: '38400' }, { value: '57600' }, { value: '115200' }]; - //定义数据位数组 - @State dataBits: Array = [{ value: '8' }, { value: '7' }, { value: '6' }]; - //定义停止位数组 - @State stopBits: Array = [{ value: '1' }, { value: '2' }]; - //定义校验位 - @State parityBits: Array = [{ value: 'None' }, { value: 'Odd' }, { value: 'Even' }]; - //定义软件流控 - @State flowControls: Array = [{ value: '0' }, { value: '1' }, { value: '2' }]; - - async aboutToAppear() { - RpcTool.getInstance().initSerialPortComponent(this); - } - - bindStatusChange(vendorId: string, productId: string) { - hilog.info(0, 'testTag ui', `bindStatusChange vendorId: ${vendorId} productId:${productId}`); - if (vendorId.length == 0 || productId.length == 0) { - this.connectStatus = false; - } else { - this.connectStatus = true; - } - } - - build() { - Column({ space: 10 }) { - Row({ space: 10 }) { - Text($r('app.string.baud_rates')) - .padding({ left: 10 }) - Select(this.baudRates) - .selected(this.baudRateIndex) - .selectedOptionFont({ size: 13 }) - .optionFont({ size: 13 }) - .width('40%') - .margin({ left: 20 }) - .onSelect((index: number, text?: string | undefined) => { - hilog.info(0, 'testTag ui', `select baudRateIndex:${this.baudRateIndex}`); - if (text) { - this.baudRateValue = text; - hilog.info(0, 'testTag ui', `baudRateValue:${this.baudRateValue}`); - } - }) - }.width('100%') - .height(TEXT_HEIGHT) - - Row({ space: 10 }) { - Text($r('app.string.data_bits')) - .padding({ left: 10 }) - Select(this.dataBits) - .selected(this.dataBitIndex) - .selectedOptionFont({ size: 13 }) - .optionFont({ size: 13 }) - .width('40%') - .margin({ left: 20 }) - .onSelect((index: number, text?: string | undefined) => { - hilog.info(0, 'testTag ui', `select dataBitIndex:${this.dataBitIndex}`); - if (text) { - this.dataBitValue = text; - hilog.info(0, 'testTag ui', `dataBitValue:${this.dataBitValue}`); - } - }) - }.width('100%') - .height(TEXT_HEIGHT) - - Row({ space: 10 }) { - Text($r('app.string.stop_bits')) - .padding({ left: 10 }) - Select(this.stopBits) - .selected(this.stopBitIndex) - .selectedOptionFont({ size: 13 }) - .optionFont({ size: 13 }) - .width('40%') - .margin({ left: 20 }) - .onSelect((index: number, text?: string | undefined) => { - hilog.info(0, 'testTag ui', `select stopBitIndex:${this.stopBitIndex}`); - if (text) { - this.stopBitValue = text; - hilog.info(0, 'testTag ui', `stopBitValue:${this.stopBitValue}`); - } - }) - }.width('100%') - .height(TEXT_HEIGHT) - - Row({ space: 10 }) { - Text($r('app.string.parity_bits')) - .padding({ left: 10 }) - Select(this.parityBits) - .selected(this.parityBitIndex) - .selectedOptionFont({ size: 13 }) - .optionFont({ size: 13 }) - .width('40%') - .margin({ left: 20 }) - .onSelect((index: number, text?: string | undefined) => { - hilog.info(0, 'testTag ui', `select parityBitIndex:${this.parityBitIndex}`); - if (text) { - this.parityBitValue = text; - hilog.info(0, 'testTag ui', `parityBitValue:${this.parityBitValue}`); - } - }) - }.width('100%') - .height(TEXT_HEIGHT) - - Row({ space: 10 }) { - Text($r('app.string.flow_controls')) - .padding({ left: 10 }) - Select(this.flowControls) - .selected(this.flowControlIndex) - .selectedOptionFont({ size: 13 }) - .optionFont({ size: 13 }) - .width('40%') - .onSelect((index: number, text?: string | undefined) => { - hilog.info(0, 'testTag ui', `select flowControlIndex:${this.flowControlIndex}`); - if (text) { - this.flowControlValue = text; - hilog.info(0, 'testTag ui', `flowControlValue:${this.flowControlValue}`); - } - }) - }.width('100%') - .height(TEXT_HEIGHT) - - Row() { - Button(this.isSerialPortStatus ? $r('app.string.close_serial') : $r('app.string.open_serial')) - .enabled(this.connectStatus) - .width('40%') - .backgroundColor(this.isSerialPortStatus ? 'red' : '') - .onClick(() => { - if (this.baudRateValue != '' && this.dataBitValue != '' && this.stopBitValue != '' && - this.parityBitValue != '' && this.flowControlValue != '') { - this.isSerialPortStatus = !this.isSerialPortStatus; - if (this.isSerialPortStatus) { - SerialPortStatusManager.notify(this.isSerialPortStatus); - hilog.info(0, 'testTag ui', 'Open serial port successfully.'); - this.issueParameters(); - } else { - TemperatureStatusManager.subscribe(this.onReadTemperatureStatusChange) - if (this.isReadStatus == true) { - this.isSerialPortStatus = true; - SerialPortStatusManager.notify(this.isSerialPortStatus); - promptAction.showToast({ message: '正在读取温度,无法关闭串口.', duration: 2000 }); - hilog.info(0, 'testTag ui', 'Reading temperature, unable to close serial port.'); - } else { - SerialPortStatusManager.notify(this.isSerialPortStatus); - hilog.info(0, 'testTag ui', 'Close serial port'); - RpcTool.getInstance().closeConnection(); - } - } - } else { - promptAction.showToast({ message: '有未选择的选项.', duration: 2000 }); - hilog.info(0, 'testTag ui', 'There are options not selected.'); - } - }) - } - .height(TEXT_HEIGHT) - .alignItems(VerticalAlign.Center) - } - .width('100%') - .height('80%') - .margin({ top: 20 }) - } - - //下发波特率参数 - private issueParameters() { - keyValuePairs.set(this.baudRateIndex, this.baudRateValue); - keyValuePairs.set(this.dataBitIndex, this.dataBitValue); - keyValuePairs.set(this.stopBitIndex, this.stopBitValue); - keyValuePairs.set(this.parityBitIndex, this.parityBitValue); - keyValuePairs.set(this.flowControlIndex, this.flowControlValue); - RpcTool.getInstance().setKeyValue(keyValuePairs); - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/components/TempShowComponent.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/components/TempShowComponent.ets deleted file mode 100644 index 334d0d41a7cce70faa0dfa6c9b5e9ffc889fb987..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/components/TempShowComponent.ets +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025 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 RpcTool from '../tool/RpcTool'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { SerialPortStatusManager } from '../tool/SerialPortStatusManager'; -import { TemperatureStatusManager } from '../tool/TemperatureStatusManager'; -import { promptAction } from '@kit.ArkUI'; - -@Component -export struct TempShowComponent { - aboutToAppear() { - hilog.info(0, 'testTag ui', `aboutToAppear TempShowComponent subscribe`); - SerialPortStatusManager.subscribe(this.onSerialPortStatusChange); - } - - @Link temperatureData: string; - @State readButtonStatus: boolean = false; //读取温度的状态 - private intervalId: number | null = null; //存储定时器ID - @State serialPortStatus: boolean = false; //监听串口设置的串口状态 - @State timeoutData: string = ''; //用户输入的超时时间(毫秒) - @Link code: number; //设置超时时间 返回的code - private onSerialPortStatusChange = (status: boolean) => { - hilog.info(0, 'testTag ui', `onSerialPortStatusChange status:${status}`); - this.serialPortStatus = status; - hilog.info(0, 'testTag ui', `onSerialPortStatusChange serialPortStatus status:${this.serialPortStatus}`); - }; - - build() { - Column({ space: 60 }) { - //超时时间模块 - Row({ space: 8 }) { - Text($r('app.string.timeout')) - .padding({ left: 10 }) - TextInput({ text: this.timeoutData }) - .width(`160`) - .type(InputType.Number) - .onChange((value: string) => { - this.timeoutData = value; - hilog.info(0, 'testTag ui', `timeoutData value:${this.timeoutData}`); - }) - Text($r('app.string.millisecond')) - Button($r('app.string.setting')) - .width(`100`) - .onClick(async () => { - let setTimeout: number = parseFloat(this.timeoutData); - await RpcTool.getInstance().setTimeOut(setTimeout); - hilog.info(0, 'testTag ui', `setTimeout code:${this.code}`); - if (this.code == 31600000) { - promptAction.showToast({ message: '设置超时时间成功.', duration: 2000 }); - } else { - promptAction.showToast({ message: '设置超时时间失败.', duration: 2000 }); - } - }) - }.width('100%') - .margin({ top: 60 }) - - //温度读取模块 - Row({ space: 24 }) { - Text($r('app.string.temperature')) - .padding({ left: 10 }) - - Column({ space: 5 }) { - Text(this.temperatureData) - .width('30%') - .margin({ left: 20 }) - .textAlign(TextAlign.Center) - //下划线 - Text() - .width('30%') - .margin({ left: 20 }) - .textAlign(TextAlign.Center) - .borderStyle(BorderStyle.Solid) - .borderWidth({ bottom: 1 }) - .borderColor(Color.Black) - } - - Text('℃') - Button(this.readButtonStatus ? $r('app.string.close_read') : $r('app.string.read_temperature')) - .backgroundColor(this.readButtonStatus ? 'red' : '') - .onClick(() => { - SerialPortStatusManager.subscribe(this.onSerialPortStatusChange); - if (this.serialPortStatus == true) { - this.readButtonStatus = !this.readButtonStatus; - TemperatureStatusManager.notify(this.readButtonStatus); - this.toggleReadButton(); - } else { - promptAction.showToast({ message: '串口未打开.', duration: 2000 }); - } - }) - }.width('100%') - } - .width('100%') - .height('60%') - } - - //切换按钮状态,并启动或停止循环调用showTemperature - private toggleReadButton() { - if (this.serialPortStatus == true) { - hilog.info(0, 'testTag ui', `readButtonStatus:${this.readButtonStatus}`); - if (this.readButtonStatus) { - this.startPolling(); - } else { - this.stopPolling(); - } - } else { - hilog.info(0, 'testTag ui', `Serial port is not opened.`); - promptAction.showToast({ message: '未打开串口.', duration: 2000 }); - } - } - - //读取温度,启动循环调用showTemperature接口 - private startPolling() { - hilog.info(0, 'testTag ui', `enter startPolling`); - if (this.intervalId == null) { - this.intervalId = setInterval(() => { - hilog.info(0, 'testTag ui', `enter setInterval`); - RpcTool.getInstance().showTemperature(); - }, 500) //2s调用一次 - } - } - - //读取温度,停止循环调用showTemperature接口 - private stopPolling() { - hilog.info(0, 'testTag ui', `enter stopPolling`); - if (this.intervalId != null) { - clearInterval(this.intervalId); - this.intervalId = null; - } - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/entryability/EntryAbility.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index c5539bddd7a772710f55da0ddd7b5676305469de..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/pages/Index.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index e965881069b76cccaa0f746152f88c40f63ef30c..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2025 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 { SerialPortComponent } from '../components/SerialPortComponent'; -import { TempShowComponent } from '../components/TempShowComponent'; -import { common } from '@kit.AbilityKit'; -import RpcTool from '../tool/RpcTool'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { prompt } from '@kit.ArkUI'; - -const IMAGE_WIDTH_HEIGHT: number = 60; // 图片宽高 -const IMAGE_INTERVAL: number = 60; // 图片与图片间距 -const IMAGE_TEXT_INTERVAL: number = 10; // 图片和文本间距 -const MARGIN_LEFT_RIGHT: number = 20; // 顶部菜单栏与屏幕边缘间隔 -const MARGIN_TOP_BOTTOM: number = 20; // 菜单栏上下间距 - -@Preview -@Entry -@Component -struct Index { - @State vendorId: string = ''; - @State productId: string = ''; - @State description: string = ''; - @State currentIndex: number = 0; - @State connectStatus: boolean = false; - saveMessage: string = `save config success`; - @State temperatureData: string = ''; - @State msg: number = 0; - @State code: number = 0; - private topMenu = [ - ['串口设置', $rawfile('ic_keyboard_set_normal.svg'), $rawfile('ic_keyboard_set_select.svg')], - ['温度显示', $rawfile('ic_about_normal.svg'), $rawfile('ic_about_select.svg')] - ]; - private bottomMenu = [['退出', $rawfile('ic_quit_normal.svg'), $rawfile('ic_quit_normal.svg')]]; - private controller: TabsController = new TabsController(); - private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; - - async aboutToAppear() { - RpcTool.getInstance().init(this); - RpcTool.getInstance().bindDevice(); - } - - async aboutToDisappear() { - await RpcTool.getInstance().unbindDevice(); - } - - bindCallback(vendorId: string, productId: string, description: string) { - hilog.info(0, 'testTag ui', `bindCallback vendorId: ${vendorId} productId:${productId}`); - this.vendorId = vendorId; - this.productId = productId; - this.description = description; - if (vendorId.length == 0 || productId.length == 0) { - this.connectStatus = false; - } else { - this.connectStatus = true; - } - } - - temperatureCallback(temperatureData: string) { - hilog.info(0, 'testTag ui', `bindCallback temperature: ${temperatureData}`); - if (temperatureData != '401') { - this.temperatureData = temperatureData; - } - } - - //设置超时时间 驱动端返回的code - timeoutCallback(code: number) { - hilog.info(0, 'testTag ui', `timeoutCallback code: ${code}`); - this.code = code; - } - - getSaveMessage() { - if (!this.vendorId || this.vendorId.length == 0) { - return '当前设备未连接'; - } else { - return `save config success`; - } - } - - build() { - Stack() { - Column() { - // 侧边栏 - Row() { - Row() { - ForEach(this.topMenu, (item: string | Resource, index) => { - Column() { - Image((this.currentIndex == index) ? item[2] : item[1]) - .width(IMAGE_WIDTH_HEIGHT) - .height(IMAGE_WIDTH_HEIGHT) - Text(item[0]) - .margin({ top: IMAGE_TEXT_INTERVAL }) - } - .margin({ right: IMAGE_INTERVAL }) - .justifyContent(FlexAlign.Center) - .onClick(() => { - if (item[0] == '保存') { - prompt.showToast({ message: this.getSaveMessage(), bottom: 100, duration: 1800 }); - } else { - this.currentIndex = index; - } - }) - }) - } - .margin({ left: MARGIN_LEFT_RIGHT, bottom: MARGIN_TOP_BOTTOM }) - - Row() { - ForEach(this.bottomMenu, (item: (string | Resource)[], index) => { - Column() { - Image(item[1]) - .width(IMAGE_WIDTH_HEIGHT) - .height(IMAGE_WIDTH_HEIGHT) - Text(item[0]) - .margin({ top: 10 }) - } - .justifyContent(FlexAlign.Center) - .onClick(() => { - if (item[0] === '退出') { - this.context.terminateSelf(); - } - }) - }) - } - .margin({ right: MARGIN_LEFT_RIGHT, bottom: MARGIN_TOP_BOTTOM }) - } - .width('100%') - .margin({ top: MARGIN_TOP_BOTTOM }) - .border({ width: { bottom: 0.5 }, color: Color.Gray }) - .justifyContent(FlexAlign.SpaceBetween) - - Stack() { - // 标题栏 - Row() { - Text(this.topMenu[this.currentIndex][0]) - .fontSize(30) - .fontWeight(FontWeight.Bold) - } - .alignSelf(ItemAlign.Start) - .width('100%') - .padding({ left: 20, top: 10, bottom: 10 }) - - // 主内容区域 - Row() { - Tabs({ controller: this.controller, index: this.currentIndex }) { - TabContent() { - SerialPortComponent() - } - - TabContent() { - TempShowComponent({ temperatureData: $temperatureData, code: $code }) - } - } - .barHeight(0) - .height('100%') - .scrollable(false) - } - .layoutWeight(1) - } - .alignContent(Alignment.TopStart) - .layoutWeight(1) - }.width('100%') - .height('100%') - .alignItems(HorizontalAlign.Center) - - Text(this.connectStatus ? $r('app.string.device_connect') : $r('app.string.device_disconnect')) - .fontColor(this.connectStatus ? Color.Black : Color.Red) - .margin({ right: 30, bottom: 20 }) - .fontSize(14) - }.width('100%') - .height('100%') - .alignContent(Alignment.BottomEnd) - } -} - -export { Index } \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/GlobalContext.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/GlobalContext.ets deleted file mode 100644 index 14a302297267009414d30245f158469380330d86..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/GlobalContext.ets +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const TAG = 'GlobalContext'; - -export default class GlobalContext { - private constructor() { - } - - private static instance: GlobalContext; - private _objects = new Map(); - private isDebug: boolean = false; - - public static getContext(): GlobalContext { - if (GlobalContext.instance == null) { - GlobalContext.instance = new GlobalContext(); - } - return GlobalContext.instance; - } - - public getObject(key: string): Object | undefined { - let result = this._objects.get(key); - this.printLog('getObject: ' + key + ' -> ' + (result != null)); - return result; - } - - public hasObject(key: string): boolean { - return this._objects.has(key); - } - - public setObject(key: string, objectClass: Object): void { - this._objects.set(key, objectClass); - this.printLog('setObject: ' + key); - } - - public printLog(message: string): void { - if (!this.isDebug) { - return; - } - console.info(TAG, message); - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/ObserverManager.ts b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/ObserverManager.ts deleted file mode 100644 index d72e9925c6c8a77e3f60da379ef0a52226491b6a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/ObserverManager.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// ObserverManager.ts -export class ObserverManager { - private observers: Array<(value: T) => void> = []; - - public subscribe(observer: (value: T) => void) { - this.observers.push(observer); - } - - public unsubscribe(observer: (value: T) => void) { - const index = this.observers.indexOf(observer); - if (index > -1) { - this.observers.splice(index, 1); - } - } - - public notify(value: T) { - this.observers.forEach((observer) => observer(value)); - } -} - -// 创建一个具体的ObserverManager实例,用于管理boolean类型的状态 -export const SerialPortStatusManager = new ObserverManager(); \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/RpcTool.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/RpcTool.ets deleted file mode 100644 index 3d592a9dd57c2b82930705810210c1da2d8c8267..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/RpcTool.ets +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2025 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 { rpc } from '@kit.IPCKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { deviceManager } from '@kit.DriverDevelopmentKit'; -import { Index } from '../pages/Index'; -import { SerialPortComponent } from '../components/SerialPortComponent'; -import GlobalContext from './GlobalContext'; -import { BusinessError } from '@kit.BasicServicesKit'; - -const REQUEST_CODE_KEY_VALUE = 1; //与扩展外设驱动端约定请求码,配置串口 -const REQUEST_CODE_DIRECTION = 2; -const REQUEST_CODE_CONNECT_STATUS = 3; -const REQUEST_CODE_CLOSE_CONNECTION = 4; //与扩展外设驱动端约定请求码,关闭串口 -const REQUEST_CODE_READ_DATA = 5; //与扩展外设驱动端约定请求码,读取数据 -const REQUEST_CODE_SETTIMEOUT_DATA = 6; // 与扩展外设客户端约定请求码,设置超时时间 - -const VENDOR_ID: number = 9390; // 24AE -const PRODUCT_ID_LIST = [29987]; // 1871 - -export async function sleep(ms: number) { - return new Promise(res => setTimeout(res, ms)); -} - -class MyDeathRecipient { - private rpcTool: RpcTool; - - constructor(rpc: RpcTool) { - hilog.info(0, 'testTag ui', 'MyDeathRecipient constructor'); - this.rpcTool = rpc; - } - - onRemoteDied() { - hilog.info(0, 'testTag ui', 'MyDeathRecipient onRemoteDied'); - this.rpcTool.resetStatus(); - this.rpcTool.bindStateChanged(); - } -} - -export default class RpcTool { - private deviceId: number = -1; - private vendorId: number = 0; - private productId: number = 0; - private description: string = ''; - private message: string = ''; - private bindState: boolean = false; - private remote: rpc.RemoteObject | null = null; - private isQuerying: boolean = false; - private isBinding: boolean = false; - private indexUI?: Index; - private connectStatusChanged = false; - private static instance: RpcTool; - private msg: number = 0; - private serialPortComponent?: SerialPortComponent; - - public resetStatus(): void { - this.remote = null; - this.bindState = false; - this.isBinding = false; - } - - public static getInstance(): RpcTool { - if (!GlobalContext.getContext().hasObject('prcToolInstance')) { - GlobalContext.getContext().setObject('prcToolInstance', new RpcTool()); - } - return GlobalContext.getContext().getObject('prcToolInstance') as RpcTool; - } - - //查询方法 - private query() { - hilog.info(0, 'testTag ui', 'query enter'); - if (this.isBinding || this.bindState) { - hilog.info(0, 'testTag ui', 'has bind. device id:' + this.deviceId); - return; - } - if (this.deviceId != -1) { - hilog.info(0, 'testTag ui', 'has query. device id:' + this.deviceId); - return; - } - this.isQuerying = true; - try { - let devices: deviceManager.Device[] = deviceManager.queryDevices(deviceManager.BusType.USB); - for (let item of devices) { - let device = item as deviceManager.USBDevice; - hilog.info(0, 'testTag ui', 'querydevice id:' + device.deviceId + ',bustype:' + device.busType + - ',vid:' + device.vendorId + ',pid:' + device.productId + ', des:' + device.description); - let index = PRODUCT_ID_LIST.indexOf(device.productId); - if (index >= 0) { - this.deviceId = device.deviceId; - this.vendorId = device.vendorId; - this.productId = device.productId; - this.description = device.description; - break; - } - } - } catch (error) { - hilog.error(0, 'testTag ui', `Failed to query device. Code is ${error.code}, message is ${error.message}`); - } - this.message = this.deviceId.toString(); - this.isQuerying = false; - } - - async bindStateChanged() { - hilog.info(0, 'testTag ui', 'bindStateChanged enter'); - this.bindState == false; - this.remote = null; - this.deviceId = -1; - this.vendorId = 0; - this.productId = 0; - this.description = ''; - this.indexUI?.bindCallback(this.getVendorId(), this.getProductId(), this.description); - this.serialPortComponent?.bindStatusChange(this.getVendorId(), this.getProductId()); - await sleep(1500); - await this.bindDevice(); - } - - //绑定方法 - private async bind() { - hilog.info(0, 'testTag ui', 'bind enter'); - if (this.deviceId == -1) { - hilog.error(0, 'testTag ui', 'deviceId is invalid!'); - return; - } - if (this.remote != null) { - hilog.info(0, 'testTag ui', 'has bind device. device id:' + this.deviceId); - return; - } - - if (this.isBinding) { - hilog.info(0, 'testTag ui', 'is binding now'); - return; - } - this.isBinding = true; - try { - hilog.info(0, 'testTag ui', 'bindDevice id is:' + this.deviceId); - let data: deviceManager.RemoteDeviceDriver = await deviceManager.bindDeviceDriver(this.deviceId, - async (err: BusinessError, id: number) => { - hilog.error(0, 'testTag ui', 'Device is disconnected:' + data); - this.bindState = false; //若设备在绑定过程中,设备断连,需要重新绑定 - this.isBinding = false; - this.bindStateChanged(); - }); - - hilog.info(0, 'testTag ui', 'bindDevice success:' + data.deviceId); - - this.remote = data.remote as rpc.RemoteObject; - if (this.remote === null) { - hilog.error(0, 'testTag ui', 'create remote fail'); - this.bindState = false; - this.isBinding = false; - return; - } - let deathRecipient = new MyDeathRecipient(this); - this.remote.registerDeathRecipient(deathRecipient, 0); - this.bindState = true; - this.isBinding = false; - hilog.info(0, 'testTag ui', 'create remote success'); - } catch (error) { - hilog.error(0, 'testTag ui', 'bindDevice fail. Code:' + error + ', message:' + error.message); - this.bindState = false; - this.isBinding = false; - } - } - - //初始化 - init(indexUI: Index) { - this.indexUI = indexUI; - } - - initSerialPortComponent(serialPortComponent: SerialPortComponent) { - this.serialPortComponent = serialPortComponent; - } - - //绑定设备(包含了query和bind) - async bindDevice() { - //初始都为false,避免重复绑定 - if (this.isQuerying || this.isBinding) { - return; - } - hilog.info(0, 'testTag ui', 'bindDevice enter'); - while (this.remote == null) { - this.query(); - await this.bind(); - await sleep(1500); - hilog.info(0, 'testTag ui', 'timeOut'); - } - this.indexUI?.bindCallback(this.getVendorId(), this.getProductId(), this.description); - this.serialPortComponent?.bindStatusChange(this.getVendorId(), this.getProductId()); - // await this.queryConnectStatus() - hilog.info(0, 'testTag ui', `vendorId:${this.vendorId} productId:${this.productId} descprtion:${this.description}`); - } - - getVendorId() { - if (this.vendorId == 0) { - return ''; - } else { - return `0x${this.vendorId.toString(16).toUpperCase()}`; - } - } - - getProductId() { - if (this.productId == 0) { - return ''; - } else { - return `0x${this.productId.toString(16).toUpperCase()}`; - } - } - - async unbindDevice() { - hilog.info(0, 'testTag ui', 'unbind enter'); - if (this.deviceId == -1) { - hilog.error(0, 'testTag ui', 'deviceId is invalid!'); - return; - } - - try { - hilog.info(0, 'testTag ui', 'unbindDevice id is:' + this.deviceId); - await deviceManager.unbindDevice(this.deviceId, async (err: BusinessError) => { - if (err) { - hilog.error(0, 'testTag ui', 'Failed to unbind device: ' + err.message); - } else { - this.isBinding = false; - this.bindState = false; - hilog.info(0, 'testTag ui', 'Device is disconnected'); - } - }); - } catch (error) { - hilog.error(0, 'testTag ui', 'bindDevice fail. Code:' + error + ', message:' + error.message); - this.bindState = true; - this.isBinding = true; - } - } - - //设置串口参数 - setKeyValue(keyValuePairs: Map) { - hilog.info(0, 'testTag ui', 'enter setKetValue'); - let option = new rpc.MessageOption(); - let dataSend = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - keyValuePairs.forEach((keyValue, keyIndex) => { - dataSend.writeInt(keyIndex); - dataSend.writeString(keyValue); - }); - if (this.remote == null) { - hilog.error(0, 'testTag ui', 'the remote is null'); - return; - } - this.remote.sendMessageRequest(REQUEST_CODE_KEY_VALUE, dataSend, reply, option).then((ret) => { - hilog.info(0, 'testTag ui', 'sendMessageRequest success'); - this.msg = reply.readInt(); - hilog.info(0, 'testTag ui', `setKeyValue ret:${ret}`); - }).catch(() => { - hilog.info(0, 'testTag ui', `setKeyValue sendMessageRequest failed`); - }); - } - - async queryConnectStatus() { - hilog.info(0, 'testTag ui', 'queryConnectStatus enter'); - while (this.remote != null) { - await this.getConnectStatus(); - if (this.connectStatusChanged) { - this.connectStatusChanged = false; - this.bindStateChanged(); - break; - } - await sleep(3000); - } - } - - async getConnectStatus() { - let option = new rpc.MessageOption(); - let dataSend = rpc.MessageSequence.create(); - let reply = rpc.MessageSequence.create(); - hilog.info(0, 'testTag ui', `getConnectStatus`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', `the remote is null`); - return; - } - try { - await this.remote.sendMessageRequest(REQUEST_CODE_CONNECT_STATUS, dataSend, reply, option); - let stat = reply.readInt(); - this.connectStatusChanged = (stat == 0 ? true : false); - hilog.info(0, 'testTag ui', `getConnectStatus ${stat}`); - } catch (error) { - this.connectStatusChanged = false; - hilog.info(0, 'testTag ui', 'getConnectStatus failed'); - } - } - - //关闭连接 - async closeConnection() { - let option = new rpc.MessageOption(); - let dataSend = rpc.MessageSequence.create(); - let reply = rpc.MessageSequence.create(); - hilog.info(0, 'testTag ui', `closeConnection`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', 'the remote is null'); - return; - } - try { - await this.remote.sendMessageRequest(REQUEST_CODE_CLOSE_CONNECTION, dataSend, reply, option); - let result = reply.readInt(); - if (result == 31600000) { - hilog.info(0, 'testTag ui', `Connectioned closed successfully`); - } else { - hilog.info(0, 'testTag ui', `Failed to close connection,result code`, result); - } - } catch (error) { - hilog.info(0, 'testTag ui', `Failed to close the connection. Code is ${error.code}, message is ${error.message}`); - } - } - - //温度显示 - async showTemperature(): Promise { - let option = new rpc.MessageOption(); - let dataSend = rpc.MessageSequence.create(); - let reply = rpc.MessageSequence.create(); - hilog.info(0, 'testTag ui', `enter showTemperature`); - if (this.remote == null) { - hilog.error(0, 'testTag ui', 'the remote is null'); - return undefined; - } - try { - await this.remote.sendMessageRequest(REQUEST_CODE_READ_DATA, dataSend, reply, option); - hilog.info(0, 'testTag ui', `Temperature display successfully`); - let result = reply.readDouble(); - hilog.info(0, 'testTag ui', `Temperature data:${result}`); - this.indexUI?.temperatureCallback(result.toString()); - return result.toString(); - } catch (error) { - hilog.info(0, 'testTag ui', `Temperature display failed. Code is ${error.code}, message is ${error.message}`); - return undefined; - } - } - - //超时时间 - async setTimeOut(timeOut: number) { - let option = new rpc.MessageOption(); - let dataSend = rpc.MessageSequence.create(); - let reply = rpc.MessageSequence.create(); - hilog.info(0, 'testTag ui', `enter setTimeOut`); - dataSend.writeInt(timeOut); - if (this.remote == null) { - hilog.error(0, 'testTag ui', 'the remote is null'); - return; - } - try { - await this.remote.sendMessageRequest(REQUEST_CODE_SETTIMEOUT_DATA, dataSend, reply, option); - hilog.info(0, 'testTag ui', `setTimeOut successfully`); - let result = reply.readInt(); - hilog.info(0, 'testTag ui', `setTimeOut data:${result}`); - this.indexUI?.timeoutCallback(result); - } catch (error) { - hilog.info(0, 'testTag ui', `setTimeOut failed. Code is ${error.code}, message is ${error.message}`); - } - } -} - diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/SerialPortStatusManager.ts b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/SerialPortStatusManager.ts deleted file mode 100644 index f69ae6caff0e46e14b44af275224612f5af17dd1..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/SerialPortStatusManager.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// SerialPortStatusManager.ts -import { hilog } from '@kit.PerformanceAnalysisKit'; - -export class SerialPortStatusManager { - private static isSerialPortOpen: boolean = false; - private static listeners: Array<(status: boolean) => void> = []; - - public static subscribe(callback: (status: boolean) => void) { - this.listeners.push(callback); - callback(this.isSerialPortOpen); // 初始化时立即调用一次 - } - - public static unsubscribe(callback: (status: boolean) => void) { - this.listeners = this.listeners.filter(listener => listener !== callback); - } - - public static notify(status: boolean) { - this.isSerialPortOpen = status; - hilog.info(0, 'testTag ui', `notify isSerialPortOpen status:${this.isSerialPortOpen}`); - this.listeners.forEach(listener => listener(status)); - } - - public static getSerialPortStatus(): boolean { - return this.isSerialPortOpen; - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/TemperatureStatusManager.ts b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/TemperatureStatusManager.ts deleted file mode 100644 index 3e7e930f3d3d3f8ac6218791ce9e57c7679ff09c..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/ets/tool/TemperatureStatusManager.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// TemperatureStatusManager.ts -import { hilog } from '@kit.PerformanceAnalysisKit'; - -export class TemperatureStatusManager { - private static temperatureStatus: boolean = false; - private static listeners: Array<(status: boolean) => void> = []; - - public static subscribe(callback: (status: boolean) => void) { - this.listeners.push(callback); - callback(this.temperatureStatus); - } - - public static unsubscribe(callback: (status: boolean) => void) { - this.listeners = this.listeners.filter(listeners => listeners !== callback); - } - - public static notify(status: boolean) { - this.temperatureStatus = status; - hilog.info(0, 'testTag ui', `notify temperatureStatus status:${this.temperatureStatus}`); - this.listeners.forEach(listener => listener(status)); - } - - public static getTemperatureStatus(): boolean { - return this.temperatureStatus; - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/module.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/module.json5 deleted file mode 100644 index 421a2582da18797e801d97899a7d008c698146d6..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/module.json5 +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "2in1" - ], - "requestPermissions": [ - { - "name": "ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER" // 此处为扩展外设相关权限,必须配置 - }, - { - "name": "ohos.permission.ACCESS_DDK_USB_SERIAL" // 此处为扩展外设相关权限,必须配置 - } - ], - "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": "DriverExtAbility", - "icon": "$media:startIcon", - "description": "driver", - "type": "driver", - "exported": true, - "srcEntry": "./ets/DriverAbility/driver.ts", - "metadata": [ - { - "name": "bus", // 必填项,所属总线 - "value": "USB" - }, - { - "name": "desc", // 选填项,必要的驱动描述 - "value": "the sample of driverExtensionAbility" - }, - { - "name": "vendor", // 选填项,驱动厂商名称 - "value": "string" - }, - { - "name": "vid", // 支持 USB vendor id 列表,填写16进制,此处为4817的16进制 - "value": "0x1a86" - }, - { - "name": "pid", // 支持的 USB product id 列表,填写16进制,此处为4258的16进制 - "value": "0x7523" - }, - { - "name": "launchOnBind", - "value": "true" - } - ] - } - ] - } -} diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/element/color.json b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/element/string.json b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 0f74c4f44b3b8c240c7dc679d3b722a2f60a000c..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "baud_rates", - "value": "波特率:" - }, - { - "name": "data_bits", - "value": "数据位:" - }, - { - "name": "stop_bits", - "value": "停止位:" - }, - { - "name": "parity_bits", - "value": "校验位:" - }, - { - "name": "flow_controls", - "value": "软件流控:" - }, - { - "name": "close_serial", - "value": "关闭串口" - }, - { - "name": "open_serial", - "value": "打开串口" - }, - { - "name": "timeout", - "value": "超时时间:" - }, - { - "name": "millisecond", - "value": "毫秒" - }, - { - "name": "setting", - "value": "设置" - }, - { - "name": "temperature", - "value": "温度:" - }, - { - "name": "close_read", - "value": "关闭读取" - }, - { - "name": "read_temperature", - "value": "读取温度" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/background.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/foreground.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/layered_image.json b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/startIcon.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/profile/backup_config.json b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/profile/main_pages.json b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/en_US/element/string.json b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 0f74c4f44b3b8c240c7dc679d3b722a2f60a000c..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "baud_rates", - "value": "波特率:" - }, - { - "name": "data_bits", - "value": "数据位:" - }, - { - "name": "stop_bits", - "value": "停止位:" - }, - { - "name": "parity_bits", - "value": "校验位:" - }, - { - "name": "flow_controls", - "value": "软件流控:" - }, - { - "name": "close_serial", - "value": "关闭串口" - }, - { - "name": "open_serial", - "value": "打开串口" - }, - { - "name": "timeout", - "value": "超时时间:" - }, - { - "name": "millisecond", - "value": "毫秒" - }, - { - "name": "setting", - "value": "设置" - }, - { - "name": "temperature", - "value": "温度:" - }, - { - "name": "close_read", - "value": "关闭读取" - }, - { - "name": "read_temperature", - "value": "读取温度" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_about_normal.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_about_normal.svg deleted file mode 100644 index 3387f4c0237a0a0ab89f8f0693eef37f73fdf505..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_about_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_about_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_about_select.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_about_select.svg deleted file mode 100644 index 6ff81e52e7479add0160ec1854eb839293b2bb7f..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_about_select.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_about_select - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg deleted file mode 100644 index e6424755b97e7fa4d50c76a659b69f6858b3b3d8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_keyboard_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg deleted file mode 100644 index 60863085dd74ac26f9ad9113268d981fc58ca447..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_keyboard_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_keyboard_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg deleted file mode 100644 index e33896c20c382c604d8417754a6d88e908d14c19..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_locale_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg deleted file mode 100644 index 8c9ee3b63c47c9355c04681a8c4ca07ce6f47114..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_locale_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_locale_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_pen.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_pen.png deleted file mode 100644 index 9d959aeabe36bc25d7bdbcc4bb9aad9d530ac902..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_pen.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg deleted file mode 100644 index e878183476d1b9455531d53b2e56d308da5f10ba..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_pen_set_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg deleted file mode 100644 index 7a8acea71607f4d95f8ba9cc2fd6e0ab6e4f972e..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_pen_set_select.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_pen_set_select - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg deleted file mode 100644 index 94d8f1301720fab6674660010a9c371e8467fbd0..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_quit_normal.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - ic_quit_normal - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_save_normal.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_save_normal.svg deleted file mode 100644 index 7868f7037dd42dc49eedb578956c7496b2e080d8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_save_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_save_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_select.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_select.svg deleted file mode 100644 index a7bb34b5422711c01876da7d90b7313855054608..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_select.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_set_normal.svg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_set_normal.svg deleted file mode 100644 index 265b373f41b5a82dfaffc9e9721d91876b8ee4dc..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/ic_set_normal.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - ic_set_normal - - - - - - - - - - - \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/log102.jpeg b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/log102.jpeg deleted file mode 100644 index b67c2515d0fe85898836f42eb99c8c05bcbb7b93..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/log102.jpeg and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pens.PNG b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pens.PNG deleted file mode 100644 index 13e2abe82a62533a429497071f6c336961a45285..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pens.PNG and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png deleted file mode 100644 index 84bd71a268b532582b680827b7b2c93a6436cf95..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_downxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png deleted file mode 100644 index d2b5097a2c9f3420908f6a203f2181a3d060a3f8..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_leftxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png deleted file mode 100644 index d2db5a1b220d889e4536e46c15216d5c470445be..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_rightxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png deleted file mode 100644 index b50f6e3d445c7ad2a5a13c722385a9dcc8e10a05..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_handwriting_upxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png deleted file mode 100644 index b7d79bb8125b0bb51f3c2ebb57b6a092b125d3c7..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_downxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png deleted file mode 100644 index a3dff6a1663db6d344bac6f20b895c888635203f..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_leftxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png deleted file mode 100644 index 871236a32219b18f9e57a678513b006d4e51a087..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_rightxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png deleted file mode 100644 index b8bc8e3b929000362bcea64a0629746145df8920..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/rawfile/pic_scale_set_upxhdpi.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/zh_CN/element/string.json b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 6008ea010267bf6d9f2ec1b411d23c163c6e682b..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "baud_rates", - "value": "波特率:" - }, - { - "name": "data_bits", - "value": "数据位:" - }, - { - "name": "stop_bits", - "value": "停止位:" - }, - { - "name": "parity_bits", - "value": "校验位:" - }, - { - "name": "flow_controls", - "value": "软件流控:" - }, - { - "name": "close_serial", - "value": "关闭串口" - }, - { - "name": "open_serial", - "value": "打开串口" - }, - { - "name": "timeout", - "value": "超时时间:" - }, - { - "name": "millisecond", - "value": "毫秒" - }, - { - "name": "setting", - "value": "设置" - }, - { - "name": "temperature", - "value": "温度:" - }, - { - "name": "close_read", - "value": "关闭读取" - }, - { - "name": "read_temperature", - "value": "读取温度" - }, - { - "name": "device_connect", - "value": "设备已连接" - }, - { - "name": "device_disconnect", - "value": "设备未连接" - } - ] -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/mock/Libentry.mock.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 133fac9027ff6bbdcccfe98838fdbb2dc34639ab..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const nativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default nativeMock; \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/mock/mock-config.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 4308c4bc5a7e448d1cc004ec446aa725a63538bc..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Level } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; - -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('testConnectState', 0, async (done: Function) => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - console.info("uitest: TestUiExample begin"); - // 初始化Driver对象 - const driver = Driver.create(); - const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - console.info("uitest: bundleName=", bundleName); - // 指定被测应用包名、ability名,请开发者替换为被测应用包名和ability名 - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - } - // 拉起被测应用 - await delegator.startAbility(want); - console.info("uitest: startAbility"); - // 等待应用拉起完成 - await driver.waitForIdle(500,1000); - // 确认当前应用顶部Ability为指定的ability - const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info("get top ability"); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - - // 依据指定文本“设备未连接”查找目标控件 - await driver.assertComponentExist(ON.text('设备未连接')); - // 点击目标控件 - await driver.waitForIdle(4000,5000); - await sleep(3000); - // 通过断言文本为“设备已连接”的控件存在,确认操作后页面变化符合预期 - await driver.assertComponentExist(ON.text('设备已连接')); - await driver.pressBack(); - done(); - }) - }) -} - -function sleep(ms: number): Promise { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/ohosTest/ets/test/List.test.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/ohosTest/module.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/test/List.test.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/test/LocalUnit.test.ets b/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/hvigor/hvigor-config.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/UsbSerialDriverDemo/hvigorfile.ts b/DriverDevelopmentKit/UsbSerialDriverDemo/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/DriverDevelopmentKit/UsbSerialDriverDemo/oh-package.json5 b/DriverDevelopmentKit/UsbSerialDriverDemo/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/ohosTest.md b/DriverDevelopmentKit/UsbSerialDriverDemo/ohosTest.md deleted file mode 100644 index a65279440b6d41502100829d3986e0532e495ff8..0000000000000000000000000000000000000000 --- a/DriverDevelopmentKit/UsbSerialDriverDemo/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# USB转串口类设备驱动测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 |测试结果| -|------------|-----------------------|------------|-----------|------|--------------------------------| -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 |Pass| -| 设备识别 | 插入Usb转串口外设(usb串口温度计) | 手动插入外设 | 连接状态显示已连接 | 否 |Pass| -| 串口通信参数设置 | 位于主页 | 手动插入串口各项参数 | 能正常打开串口 | 否 |Pass| -| 温度计能正常读取数据 | 位于温度显示页 | 点击“读取温度”按钮 | 能正常读取环境文档 | 否 |Pass| \ No newline at end of file diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/screenshots/main.png b/DriverDevelopmentKit/UsbSerialDriverDemo/screenshots/main.png deleted file mode 100644 index ef4d18257941d0c237a7ff1072d0a22652d067a9..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/screenshots/main.png and /dev/null differ diff --git a/DriverDevelopmentKit/UsbSerialDriverDemo/screenshots/tem_show.png b/DriverDevelopmentKit/UsbSerialDriverDemo/screenshots/tem_show.png deleted file mode 100644 index 52793f3732e284b9b98e0c020ecad308b3723ce6..0000000000000000000000000000000000000000 Binary files a/DriverDevelopmentKit/UsbSerialDriverDemo/screenshots/tem_show.png and /dev/null differ diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/.gitignore b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/.gitignore deleted file mode 100644 index fbabf771011fe78f9919db0b1195ab6cadffc2b0..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/AppScope/app.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/AppScope/app.json5 deleted file mode 100644 index cea7a13cc28d01b878df19b20d74f21215373b04..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.example.avcodecsample2", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/AppScope/resources/base/element/string.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/AppScope/resources/base/element/string.json deleted file mode 100644 index c1f0ee9c3e781575636c33899c3d277e3e6f78a5..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "LowPowerAVSinkDemo" - } - ] -} diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/AppScope/resources/base/media/app_icon.png b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index cd45accb1dfd2fd0da16c732c72faa6e46b26521..0000000000000000000000000000000000000000 Binary files a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/README_zh.md b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/README_zh.md deleted file mode 100644 index 76c5959f1dca2cd42c39ad9d2f9c0f47f27ffbb5..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/README_zh.md +++ /dev/null @@ -1,85 +0,0 @@ -# LowPowerAVSinkSample - -### 介绍 -LowPoweAVSink 部件示例 Sample,提供基础的视频播放的功能。 -- 视频播放的主要流程是将视频文件通过解封装->解码->送显/播放。 -### 效果预览 - -![image-20250704144549540](screenshots/image-202507041445495401.png) - -### 使用说明 - -#### 播放 - -1. 点击选择视频按钮,从文件管理或从图库选取视频,点击确定。 -2. 点击准备,将进行播放前的准备 -3. 点击解码,将启动解码器 -4. 点击首帧,将解码器输出的首帧上屏 -5. 点击音视频,将进行视频播放 -6. 播放过程中可以点击暂停/继续,或者拖动进度条选择播放进度,设置倍速以及音量 -7. 停止播放,可以点击停止,重置,释放操作 - -### 目录 - -仓目录结构如下: - -``` -lpp_demo-sample/entry/src/main/ -├── cpp # Native层 -│ ├── capbilities # 能力接口和实现 -│ │ ├── include # 能力接口 -│ │ ├── demuxer.cpp # 解封装实现 -│ │ ├── lpp_audio_streamer.cpp # 低功耗音频流实现 -│ │ └── lpp_video_streamer.cpp # 低功耗视频流实现 -│ ├── common # 公共模块 -│ │ ├── dfx # 日志 -│ │ ├── lpp_callback.cpp # 低功耗音视频回调实现 -│ │ ├── lpp_callback.h # 低功耗音视频回调接口 -│ │ └── sample_info.h # 功能实现公共类 -│ ├── render # 送显模块接口和实现 * window player设置 -│ │ ├── include # 送显模块接口 -│ │ ├── egl_core.cpp # 送显参数设置 * -│ │ ├── plugin_manager.cpp # 送显模块管理实现 -│ │ └── plugin_render.cpp # 送显逻辑实现 -│ ├── sample # Native层 -│ │ ├── player # Native层播放接口和实现 -│ │ │ ├── Player.cpp # Native层播放功能调用逻辑的实现 -│ │ │ ├── Player.h # Native层播放功能调用逻辑的接口 -│ │ │ ├── PlayerNative.cpp # Native层 播放的入口 -│ │ │ └── PlayerNative.h # Native层暴露上来的接口 -│ ├── types # -│ │ └── libplayer # 播放模块暴露给UI层的接口 -│ └── CMakeLists.txt # 编译入口 -├── ets # UI层 -│ ├── common # 公共模块 -│ │ ├── utils # 共用的工具类 -│ │ │ ├── DateTimeUtils.ets # 获取当前时间 -│ │ │ └── Logger.ts # 日志工具 -│ | └───CommonConstants.ets # 参数常量 -│ ├── entryability # 应用的入口 -│ │ └── EntryAbility.ts # 申请权限弹窗实现 -│ ├── pages # EntryAbility 包含的页面 -│ │ └── Index.ets # 首页/播放页面 -├── resources # 用于存放应用所用到的资源文件 -│ ├── base # 该目录下的资源文件会被赋予唯一的ID -│ │ ├── element # 用于存放字体和颜色 -│ │ ├── media # 用于存放图片 -│ │ └── profile # 应用入口首页 -│ ├── en_US # 设备语言是美式英文时,优先匹配此目录下资源 -│ └── zh_CN # 设备语言是简体中文时,优先匹配此目录下资源 -└── module.json5 # 模块配置信息 -``` - -### 相关权限 -不涉及 - -### 依赖 -不涉及。 - -### 约束与限制 - -1.本示例仅支持在nashville芯片手机平台上运行; - -2.本示例仅支持 API20 及以上版本SDK, SDK版本号(API Version 20 Release); - -3.本示例需要使用DevEco Studio 5.0 才可编译运行。 \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/build-profile.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/build-profile.json5 deleted file mode 100644 index ea45c6ce0eebe8f83465a2e141146da8c50ff429..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/build-profile.json5 +++ /dev/null @@ -1,45 +0,0 @@ -{ - "app": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compatibleSdkVersion": "5.0.0(12)", - //指定HarmonyOS应用/服务兼容的最低版本。注意使用英文.和() - "targetSdkVersion": "5.0.0(12)", - //指定HarmonyOS应用/服务目标版本。若没有设置,默认为compatibleSdkVersion - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - //指定为HarmonyOS - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - "signingConfigs": [] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/.gitignore b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/build-profile.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/build-profile.json5 deleted file mode 100644 index 4284436e687906bbbacd940c3fc75e0b00088d16..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/build-profile.json5 +++ /dev/null @@ -1,20 +0,0 @@ -{ - "apiType": 'stageMode', - "buildOption": { - "externalNativeOptions": { - "abiFilters": ["arm64-v8a", "x86_64"], - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "targets": [ - { - "name": "default", - "runtimeOS": "HarmonyOS" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/hvigorfile.ts b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/hvigorfile.ts deleted file mode 100644 index 80e4ec5b81689f238c34614b167a0b9e9c83e8d9..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/oh-package-lock.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/oh-package-lock.json5 deleted file mode 100644 index 4e436cde504d82c4dcc9d47f65226dd915be485f..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/oh-package-lock.json5 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "meta": { - "stableOrder": true - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "libplayer.so@src/main/cpp/types/libplayer": "libplayer.so@src/main/cpp/types/libplayer" - }, - "packages": { - "libplayer.so@src/main/cpp/types/libplayer": { - "name": "libplayer.so", - "version": "1.0.0", - "resolved": "src/main/cpp/types/libplayer", - "registryType": "local" - } - } -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/oh-package.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/oh-package.json5 deleted file mode 100644 index c9793421bec94e68ffcbc5e3e569a53f86fd45f5..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/oh-package.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "license": "", - "devDependencies": {}, - "author": "", - "name": "entry", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": { - "libplayer.so": "file:./src/main/cpp/types/libplayer", - } -} diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/CMakeLists.txt b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 5b018f52a3a53d3a35d65a3a2c1d9218afdac882..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.4.1) -project(videoCodecSample) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/capbilities/include - ${NATIVERENDER_ROOT_PATH}/common - ${NATIVERENDER_ROOT_PATH}/common/dfx/err - ${NATIVERENDER_ROOT_PATH}/common/dfx/log - ${NATIVERENDER_ROOT_PATH}/render/include - ${NATIVERENDER_ROOT_PATH}/sample/player -) - -set(BASE_LIBRARY - libace_napi.z.so libEGL.so libGLESv3.so libace_ndk.z.so libuv.so libhilog_ndk.z.so - libnative_media_codecbase.so libnative_media_core.so libnative_media_vdec.so libnative_window.so - libnative_media_venc.so libnative_media_acodec.so libnative_media_avdemuxer.so libnative_media_avsource.so libnative_media_avmuxer.so - libohaudio.so - liblowpower_avsink.so -) -add_library(player SHARED sample/player/PlayerNative.cpp - sample/player/Player.cpp - capbilities/demuxer.cpp - capbilities/lpp_audio_streamer.cpp - capbilities/lpp_video_streamer.cpp - render/egl_core.cpp - render/plugin_render.cpp - render/plugin_manager.cpp - common/lppCallback.cpp -) - -target_link_libraries(player PUBLIC ${BASE_LIBRARY}) \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/demuxer.cpp b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/demuxer.cpp deleted file mode 100644 index c086dc873221cce6cea3860779c951fd5dd37707..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/demuxer.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#include "demuxer.h" - -#undef LOG_TAG -#define LOG_TAG "Demuxer" - -Demuxer::~Demuxer() -{ - Release(); -} - -int32_t Demuxer::Create(SampleInfo &info) -{ - source_ = OH_AVSource_CreateWithFD(info.inputFd, info.inputFileOffset, info.inputFileSize); - CHECK_AND_RETURN_RET_LOG(source_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, - "Create demuxer source failed, fd: %{public}d, offset: %{public}" PRId64 ", file size: %{public}" PRId64, - info.inputFd, info.inputFileOffset, info.inputFileSize); - demuxer_ = OH_AVDemuxer_CreateWithSource(source_); - CHECK_AND_RETURN_RET_LOG(demuxer_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Create demuxer failed"); - - auto sourceFormat = std::shared_ptr(OH_AVSource_GetSourceFormat(source_), OH_AVFormat_Destroy); - CHECK_AND_RETURN_RET_LOG(sourceFormat != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Get source format failed"); - - int32_t ret = GetTrackInfo(sourceFormat, info); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Get video track info failed"); - - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Demuxer::ReadSample(int32_t trackId, OH_AVBuffer *buffer, OH_AVCodecBufferAttr &attr) -{ - CHECK_AND_RETURN_RET_LOG(demuxer_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Demuxer is null"); - int32_t ret = OH_AVDemuxer_ReadSampleBuffer(demuxer_, trackId, buffer); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Read sample failed"); - ret = OH_AVBuffer_GetBufferAttr(buffer, &attr); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "GetBufferAttr failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Demuxer::Release() -{ - AVCODEC_SAMPLE_LOGI("====== Demuxer::Release ======"); - if (demuxer_ != nullptr) { - OH_AVDemuxer_Destroy(demuxer_); - demuxer_ = nullptr; - } - if (source_ != nullptr) { - OH_AVSource_Destroy(source_); - source_ = nullptr; - } - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Demuxer::GetTrackInfo(std::shared_ptr sourceFormat, SampleInfo &info) -{ - int32_t trackCount = 0; - OH_AVFormat_GetIntValue(sourceFormat.get(), OH_MD_KEY_TRACK_COUNT, &trackCount); - OH_AVFormat_GetLongValue(sourceFormat.get(), OH_MD_KEY_DURATION, &info.duration); -// AVCODEC_SAMPLE_LOGI("Seek over duration fem %{public}ld",info.duration); - for (int32_t index = 0; index < trackCount; index++) { - int trackType = -1; - auto trackFormat = - std::shared_ptr(OH_AVSource_GetTrackFormat(source_, index), OH_AVFormat_Destroy); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_TRACK_TYPE, &trackType); - if (trackType == MEDIA_TYPE_VID) { - info.format_video = OH_AVSource_GetTrackFormat(source_, index); - OH_AVDemuxer_SelectTrackByID(demuxer_, index); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_WIDTH, &info.videoWidth); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_HEIGHT, &info.videoHeight); - OH_AVFormat_GetDoubleValue(trackFormat.get(), OH_MD_KEY_FRAME_RATE, &info.frameRate); - OH_AVFormat_GetLongValue(trackFormat.get(), OH_MD_KEY_BITRATE, &info.bitrate); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_ROTATION, &info.rotation); - - char *videoCodecMime; - OH_AVFormat_GetStringValue(trackFormat.get(), - OH_MD_KEY_CODEC_MIME, const_cast(&videoCodecMime)); - info.videoCodecMime = videoCodecMime; - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_PROFILE, &info.hevcProfile); - videoTrackId_ = index; - - AVCODEC_SAMPLE_LOGI("====== Demuxer Video config ======"); - AVCODEC_SAMPLE_LOGI("Mime: %{public}s", videoCodecMime); - AVCODEC_SAMPLE_LOGI("%{public}d*%{public}d, %{public}.1ffps, %{public}" PRId64 "kbps", info.videoWidth, - info.videoHeight, info.frameRate, info.bitrate / 1024); - AVCODEC_SAMPLE_LOGI("====== Demuxer Video config ======"); - } else if (trackType == MEDIA_TYPE_AUD) { - info.format_audio = OH_AVSource_GetTrackFormat(source_, index); - OH_AVDemuxer_SelectTrackByID(demuxer_, index); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_AUDIO_SAMPLE_FORMAT, &info.audioSampleForamt); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_AUD_CHANNEL_COUNT, &info.audioChannelCount); - OH_AVFormat_GetLongValue(trackFormat.get(), OH_MD_KEY_CHANNEL_LAYOUT, &info.audioChannelLayout); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_AUD_SAMPLE_RATE, &info.audioSampleRate); - uint8_t *addr = nullptr; - OH_AVFormat_GetBuffer(trackFormat.get(), "codec_config", &addr, &info.audioCodecSize); - - if (addr != nullptr) { - if (info.audioCodecConfig != nullptr) { - delete[] info.audioCodecConfig; - } - info.audioCodecConfig = new uint8_t[info.audioCodecSize]; - memcpy((void *)info.audioCodecConfig, (void *)addr, info.audioCodecSize); - } - - char *audioCodecMime; - OH_AVFormat_GetStringValue(trackFormat.get(), - OH_MD_KEY_CODEC_MIME, const_cast(&audioCodecMime)); - info.audioCodecMime = audioCodecMime; - audioTrackId_ = index; - - AVCODEC_SAMPLE_LOGI("====== Demuxer Audio config ======"); - AVCODEC_SAMPLE_LOGI("Mime: %{public}s", audioCodecMime); - AVCODEC_SAMPLE_LOGI("audioMime:%{public}s sampleForamt:%{public}d " - "sampleRate:%{public}d channelCount:%{public}d channelLayout:%{public}d", info.audioCodecMime.c_str(), - info.audioSampleForamt, info.audioSampleRate, info.audioChannelCount, info.audioChannelLayout); - AVCODEC_SAMPLE_LOGI("====== Demuxer Audio config ======"); - } - } - - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Demuxer::GetVideoTrackId() -{ - return videoTrackId_; -} -int32_t Demuxer::GetAudioTrackId() -{ - return audioTrackId_; -} - -int32_t Demuxer::Seek(int64_t millisecond, OH_AVSeekMode mode) -{ - int32_t ret = OH_AVDemuxer_SeekToTime(demuxer_, millisecond, mode); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "seek failed"); - return AVCODEC_SAMPLE_ERR_OK; -} diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/include/demuxer.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/include/demuxer.h deleted file mode 100644 index 63dea6f880550f0fc442d701e6f9982c62627cb5..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/include/demuxer.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#ifndef DEMUXER_H -#define DEMUXER_H - -#include -#include "napi/native_api.h" -#include "multimedia/player_framework/native_avdemuxer.h" -#include "sample_info.h" -#include "dfx/error/av_codec_sample_error.h" -#include "av_codec_sample_log.h" - - -class Demuxer { -public: - Demuxer() = default; - ~Demuxer(); - int32_t Create(SampleInfo &sampleInfo); - int32_t ReadSample(int32_t trackId, OH_AVBuffer *buffer, OH_AVCodecBufferAttr &attr); - int32_t Release(); - int32_t GetVideoTrackId(); - int32_t GetAudioTrackId(); - int32_t Seek(int64_t millisecond, OH_AVSeekMode mode); - -private: - int32_t GetTrackInfo(std::shared_ptr sourceFormat, SampleInfo &info); - - OH_AVSource *source_; - OH_AVDemuxer *demuxer_; - int32_t videoTrackId_; - int32_t audioTrackId_; -}; - -#endif // DEMUXER_H \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/include/lpp_audio_streamer.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/include/lpp_audio_streamer.h deleted file mode 100644 index 9d5a1248d9e89e90e0666221316d288433862549..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/include/lpp_audio_streamer.h +++ /dev/null @@ -1,63 +0,0 @@ -// -// Created on 2025/2/26. -// -// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found, -// please include "napi/native_api.h". - -#ifndef AVCODECSAMPLE_MASTER_LPP_AUDIO_STREAMER_H -#define AVCODECSAMPLE_MASTER_LPP_AUDIO_STREAMER_H - -#include -#include -#include -// #include "multimedia/player_framework/native_avbuffer_info.h" -#include "dfx/error/av_codec_sample_error.h" -#include "av_codec_sample_log.h" -#include "sample_info.h" - -class LppAudioStreamer { -public: - LppAudioStreamer() = default; - ~LppAudioStreamer(); - - int32_t Create(const std::string &codecMime); - - int32_t SetCallback(LppUserData *lppUserData); - - int32_t Start(); - - int32_t SetParameter(const SampleInfo &sampleInfo); - - int32_t Prepare(); - - int32_t Resume(); - - int32_t Pause(); - - int32_t Flush(); - - int32_t Stop(); - - int32_t Reset(); - - int32_t Destroy(); - - int32_t SetVolume(const float volume); - - int32_t SetPlayBackSpeed(const float speed); - - int32_t Release(); - - - - int32_t returnFrames(LppUserData *lppUserData); - - - int32_t Configure(); - - bool isAVBufferMode_ = true; - OH_LowPowerAudioSink *lppAudioStreamer_; - OH_LowPowerAudioSinkCallback *lppAudioStreamerCallback_; -}; - -#endif //AVCODECSAMPLE_MASTER_LPP_AUDIO_STREAMER_H diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/include/lpp_video_streamer.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/include/lpp_video_streamer.h deleted file mode 100644 index e14c61df713562b9c74fe191556affa8d892feba..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/include/lpp_video_streamer.h +++ /dev/null @@ -1,68 +0,0 @@ -// -// Created on 2025/2/26. -// -// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found, -// please include "napi/native_api.h". - -#ifndef AVCODECSAMPLE_MASTER_LPP_VIDEO_STREAMER_H -#define AVCODECSAMPLE_MASTER_LPP_VIDEO_STREAMER_H - -// #include "multimedia/player_framework/native_avbuffer_info.h" -#include "dfx/error/av_codec_sample_error.h" -#include "av_codec_sample_log.h" -#include -#include -#include -#include "sample_info.h" - -class LppVideoStreamer { -public: - LppVideoStreamer() = default; - ~LppVideoStreamer(); - - int32_t Create(const std::string &codecMime); - - int32_t Configure(const SampleInfo &sampleInfo); - - int32_t SetParameter(const SampleInfo &sampleInfo); - - int32_t SetVideoSurface(const SampleInfo &sampleInfo); - - int32_t Prepare(); - - int32_t StartDecode(bool flag); - - int32_t StartRender(); - - int32_t Pause(); - - int32_t Resume(); - - int32_t Flush(); - - int32_t Stop(); - - int32_t Reset(); - - int32_t Destroy(); - - int32_t Release(); - - int32_t SetSyncAudioStreamer(OH_LowPowerAudioSink *audioStreamer); - - int32_t SetTargetStartFrame(const long framePts, OH_LowPowerVideoSink_OnTargetArrived OnTargetArrived, const long timeoutMs, LppUserData *lppUserData); - - int32_t SetPlaybackSpeed(const float speed); - - int32_t returnFrames(LppUserData *lppUserData); - - int32_t SetCallback(LppUserData *lppUserData); - - int32_t RenderFirstFrame(); - - bool isAVBufferMode_ = true; - OH_LowPowerVideoSink *lppVideoStreamer_; - OH_LowPowerVideoSinkCallback *lppVideoStreamerCallback_; -}; - -#endif //AVCODECSAMPLE_MASTER_LPP_AUDIO_STREAMER_H diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/lpp_audio_streamer.cpp b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/lpp_audio_streamer.cpp deleted file mode 100644 index 4ebab84236fdd1ec2fc5e20c37f47fe6d06314f5..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/lpp_audio_streamer.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#include "lpp_audio_streamer.h" -#include "lppCallback.h" -#include "multimedia/player_framework/lowpower_audio_sink_base.h" -#include "multimedia/player_framework/lowpower_audio_sink.h" - -#undef LOG_TAG -#define LOG_TAG "LppAudioStreamer" - -LppAudioStreamer::~LppAudioStreamer() -{ - if(lppAudioStreamer_!=nullptr){ - Release(); - } -} - -int32_t LppAudioStreamer::Create(const std::string &codecMime) -{ - lppAudioStreamer_ = OH_LowPowerAudioSink_CreateByMime(codecMime.c_str()); - AVCODEC_SAMPLE_LOGI("codecMime.c_str() %{public}s", codecMime.c_str()); - CHECK_AND_RETURN_RET_LOG(lppAudioStreamer_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Create failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::SetCallback(LppUserData *lppUserData) -{ - int32_t ret = AV_ERR_OK; - lppAudioStreamerCallback_ = OH_LowPowerAudioSinkCallback_Create(); - OH_LowPowerAudioSinkCallback_SetDataNeededListener(lppAudioStreamerCallback_, LppCallback::OnDataNeeded, lppUserData); - OH_LowPowerAudioSinkCallback_SetErrorListener(lppAudioStreamerCallback_, LppCallback::OnError, lppUserData); - OH_LowPowerAudioSinkCallback_SetPositionUpdateListener(lppAudioStreamerCallback_, LppCallback::OnPositionUpdated, lppUserData); - OH_LowPowerAudioSinkCallback_SetInterruptListener(lppAudioStreamerCallback_, LppCallback::OnInterrupted, lppUserData); - ret = OH_LowPowerAudioSink_RegisterCallback(lppAudioStreamer_, lppAudioStreamerCallback_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Set callback failed, ret: %{public}d", ret); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::Configure() -{ - OH_AVFormat *format = OH_AVFormat_Create(); - int ret = OH_LowPowerAudioSink_Configure(lppAudioStreamer_, format); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Configure failed, ret: %{public}d", ret); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::SetVolume(const float volume) -{ - int ret = OH_LowPowerAudioSink_SetVolume(lppAudioStreamer_, volume); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "SetVolume failed, ret: %{public}d", ret); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::SetPlayBackSpeed(const float speed) -{ - int ret = OH_LowPowerAudioSink_SetPlaybackSpeed(lppAudioStreamer_, speed); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "SetSpeed failed, ret: %{public}d", ret); - return AVCODEC_SAMPLE_ERR_OK; -} - - -int32_t LppAudioStreamer::Start() -{ - int ret = OH_LowPowerAudioSink_Start(lppAudioStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Start failed, ret: %{public}d", ret); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::returnFrames(LppUserData *lppUserData) -{ - OH_LowPowerAudioSink_ReturnSamples(lppAudioStreamer_, lppUserData->framePacket_); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::SetParameter(const SampleInfo &sampleInfo) -{ - OH_AVFormat *format = OH_AVFormat_Create(); - if (sampleInfo.audioCodecConfig != nullptr) { - OH_AVFormat_SetBuffer(format, "codec_config", sampleInfo.audioCodecConfig, sampleInfo.audioCodecSize); - } -// OH_AudioStreamBuilder_SetLatencyMode(builder_, AUDIOSTREAM_LATENCY_MODE_NORMAL); -// // 设置音频采样率 -// OH_AudioStreamBuilder_SetSamplingRate(builder_, sampleInfo_.audioSampleRate); -// // 设置音频声道 -// OH_AudioStreamBuilder_SetChannelCount(builder_, sampleInfo_.audioChannelCount); -// // 设置音频采样格式 -// OH_AudioStreamBuilder_SetSampleFormat(builder_, AUDIOSTREAM_SAMPLE_S16LE); -// // 设置音频流的编码类型 -// OH_AudioStreamBuilder_SetEncodingType(builder_, AUDIOSTREAM_ENCODING_TYPE_RAW); -// // 设置输出音频流的工作场景 -// OH_AudioStreamBuilder_SetRendererInfo(builder_, AUDIOSTREAM_USAGE_MUSIC); - -// Format format; -// (void)format.PutIntValue(PlayerKeys::STREAM_USAGE, streamUsage); -// (void)format.PutIntValue(PlayerKeys::CONTENT_TYPE, 0); -// (void)format.PutIntValue(PlayerKeys::RENDERER_FLAG, 0); -// 音频送显 -// OH_AVFormat_SetIntValue(format, "CONTENT_TYPE", 0); - // STREAM_USAGE_MOVIE = 10, -// OH_AVFormat_SetIntValue(format, "STREAM_USAGE", 10); -// OH_AVFormat_SetIntValue(format, "SAMPLE_RATE", sampleInfo.audioSampleRate); -// AVCODEC_SAMPLE_LOGI("audioSampleRate %{public}d", sampleInfo.audioSampleRate); -// OH_AVFormat_SetIntValue(format, "RENDERER_FLAG", 5); -// // ENCODING_PCM = 0, -// OH_AVFormat_SetIntValue(format, "ENCODING", 0); -// // SAMPLE_S16LE = 1, -// OH_AVFormat_SetIntValue(format, "SAMPLE_FORMAT", SAMPLE_S16LE); -// // CHANNEL_6 = 6, -// OH_AVFormat_SetIntValue(format, "CHANNEL", sampleInfo.audioChannelCount); - -// 音频解码 -// const char *OH_MD_KEY_AUDIO_SAMPLE_FORMAT = "audio_sample_format"; - OH_AVFormat_SetIntValue(format, "audio_sample_format", SAMPLE_S16LE); - OH_AVFormat_SetIntValue(format, "audio.raw.sample.format", 24); -// OH_AVFormat_SetIntValue(format, "audio_sample_format", sampleInfo.audioSampleForamt); -// const char *OH_MD_KEY_AUD_CHANNEL_COUNT = "channel_count"; - OH_AVFormat_SetIntValue(format, "channel_count", sampleInfo.audioChannelCount); - AVCODEC_SAMPLE_LOGI("audioChannelCount %{public}d", sampleInfo.audioChannelCount); -// const char *OH_MD_KEY_AUD_SAMPLE_RATE = "sample_rate"; - OH_AVFormat_SetIntValue(format, "sample_rate", sampleInfo.audioSampleRate); -// const char *OH_MD_KEY_CHANNEL_LAYOUT = "channel_layout"; - OH_AVFormat_SetLongValue(format, "channel_layout", sampleInfo.audioChannelLayout); - OH_LowPowerAudioSink_Configure(lppAudioStreamer_, format); -// OH_LowPowerAudioSink_SetParameter(lppAudioStreamer_, format); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::Prepare() -{ - auto ret = OH_LowPowerAudioSink_Prepare(lppAudioStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::Pause() -{ - auto ret = OH_LowPowerAudioSink_Pause(lppAudioStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Pause failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::Resume() -{ - auto ret = OH_LowPowerAudioSink_Resume(lppAudioStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Resume failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::Flush() -{ - auto ret = OH_LowPowerAudioSink_Flush(lppAudioStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Flush failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::Stop() -{ - auto ret = OH_LowPowerAudioSink_Stop(lppAudioStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Stop failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::Reset() -{ - AVCODEC_SAMPLE_LOGI("reset in3"); - auto ret = OH_LowPowerAudioSink_Reset(lppAudioStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Reset failed."); - AVCODEC_SAMPLE_LOGI("reset in6"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::Destroy() -{ - AVCODEC_SAMPLE_LOGI("====== LppAudioStreamer Destroy ======"); - auto ret = OH_LowPowerAudioSink_Destroy(lppAudioStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Destroy failed."); - lppAudioStreamer_ = nullptr; - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppAudioStreamer::Release() -{ - Stop(); - Destroy(); - return AVCODEC_SAMPLE_ERR_OK; -} - diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/lpp_video_streamer.cpp b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/lpp_video_streamer.cpp deleted file mode 100644 index 4e772a0ff7a947f209c3d8ac8bc5186ac9670dea..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/capbilities/lpp_video_streamer.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#include "lpp_video_streamer.h" -#include "lppCallback.h" -#include "multimedia/player_framework/lowpower_audio_sink_base.h" -#include "multimedia/player_framework/lowpower_audio_sink.h" -#include "multimedia/player_framework/lowpower_video_sink.h" -#include "multimedia/player_framework/lowpower_video_sink_base.h" -#include "multimedia/player_framework/lowpower_avsink_base.h" -// #include - -#undef LOG_TAG -#define LOG_TAG "LppVideoStreamer" - -LppVideoStreamer::~LppVideoStreamer() -{ - if(lppVideoStreamer_!=nullptr){ - Release(); - } -} - -int32_t LppVideoStreamer::Create(const std::string &codecMime) -{ - lppVideoStreamer_ = OH_LowPowerVideoSink_CreateByMime(codecMime.c_str()); - CHECK_AND_RETURN_RET_LOG(lppVideoStreamer_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Create failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::SetCallback(LppUserData *lppUserData) -{ - int32_t ret = AV_ERR_OK; - lppVideoStreamerCallback_ = OH_LowPowerVideoSinkCallback_Create(); - OH_LowPowerVideoSinkCallback_SetDataNeededListener(lppVideoStreamerCallback_, LppCallback::OnDataNeededVideo, lppUserData); - OH_LowPowerVideoSinkCallback_SetErrorListener(lppVideoStreamerCallback_, LppCallback::OnError, lppUserData); - OH_LowPowerVideoSinkCallback_SetStreamChangedListener(lppVideoStreamerCallback_, LppCallback::OH_LowPowerVideoSink_OnStreamChanged, lppUserData); - ret = OH_LowPowerVideoSink_RegisterCallback(lppVideoStreamer_, lppVideoStreamerCallback_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Set callback failed, ret: %{public}d", ret); - - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::Configure(const SampleInfo &sampleInfo) -{ - OH_AVFormat *format = OH_AVFormat_Create(); - CHECK_AND_RETURN_RET_LOG(format != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "AVFormat create failed"); - format = sampleInfo.format_video; - OH_AVFormat_SetIntValue(format, OH_MD_KEY_WIDTH, sampleInfo.videoWidth); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_HEIGHT, sampleInfo.videoHeight); - OH_AVFormat_SetDoubleValue(format, OH_MD_KEY_FRAME_RATE, sampleInfo.frameRate); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_PIXEL_FORMAT, sampleInfo.pixelFormat); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_ROTATION, sampleInfo.rotation); - OH_AVFormat_SetIntValue(format, "lpp", true); - AVCODEC_SAMPLE_LOGI("====== VideoDecoder config ======"); - AVCODEC_SAMPLE_LOGI("%{public}d*%{public}d, %{public}.1ffps, %{public}d,%{public}d", sampleInfo.videoWidth, sampleInfo.videoHeight, - sampleInfo.frameRate,sampleInfo.pixelFormat,sampleInfo.rotation); - AVCODEC_SAMPLE_LOGI("====== VideoDecoder config ======"); - int ret = OH_LowPowerVideoSink_Configure(lppVideoStreamer_, format); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Configure failed, ret: %{public}d", ret); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::returnFrames(LppUserData *lppUserData) -{ - auto ret = OH_LowPowerVideoSink_ReturnSamples(lppVideoStreamer_, lppUserData->framePacket_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "returnFrames failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::SetParameter(const SampleInfo &sampleInfo) -{ - - OH_AVFormat *format = OH_AVFormat_Create(); - CHECK_AND_RETURN_RET_LOG(format != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "AVFormat create failed"); - - OH_AVFormat_SetIntValue(format, OH_MD_KEY_WIDTH, sampleInfo.videoWidth); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_HEIGHT, sampleInfo.videoHeight); - OH_AVFormat_SetDoubleValue(format, OH_MD_KEY_FRAME_RATE, sampleInfo.frameRate); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_PIXEL_FORMAT, sampleInfo.pixelFormat); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_ROTATION, sampleInfo.rotation); - - AVCODEC_SAMPLE_LOGI("====== VideoDecoder config ======"); - AVCODEC_SAMPLE_LOGI("%{public}d*%{public}d, %{public}.1ffps", sampleInfo.videoWidth, sampleInfo.videoHeight, - sampleInfo.frameRate); - AVCODEC_SAMPLE_LOGI("====== VideoDecoder config ======"); - int ret = OH_LowPowerVideoSink_SetParameter(lppVideoStreamer_, format); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Configure failed, ret: %{public}d", ret); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::Prepare() -{ - auto ret = OH_LowPowerVideoSink_Prepare(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::Resume() -{ - auto ret = OH_LowPowerVideoSink_Resume(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::Flush() -{ - auto ret = OH_LowPowerVideoSink_Flush(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::Stop() -{ - auto ret = OH_LowPowerVideoSink_Stop(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::Reset() -{ -// AVCODEC_SAMPLE_LOGI("reset in4"); - auto ret = OH_LowPowerVideoSink_Reset(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); -// AVCODEC_SAMPLE_LOGI("reset in5"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::Destroy() -{ - auto ret = OH_LowPowerVideoSink_Destroy(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - lppVideoStreamer_ = nullptr; - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::StartDecode(bool flag) -{ - auto ret = OH_LowPowerVideoSink_StartDecoder(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::StartRender() -{ - auto ret = OH_LowPowerVideoSink_StartRenderer(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::Pause() -{ - auto ret = OH_LowPowerVideoSink_Pause(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::SetVideoSurface(const SampleInfo &sampleInfo) -{ -// sampleInfo.window = NativeXComponentSample::PluginManager::GetInstance()->pluginWindow_; - if (sampleInfo.window != nullptr) { - auto ret = OH_LowPowerVideoSink_SetVideoSurface(lppVideoStreamer_, sampleInfo.window); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - } - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::SetSyncAudioStreamer(OH_LowPowerAudioSink *audioStreamer) -{ - auto ret = OH_LowPowerVideoSink_SetSyncAudioSink(lppVideoStreamer_, audioStreamer); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::SetTargetStartFrame(const long framePts, OH_LowPowerVideoSink_OnTargetArrived onTargetArrived, const long timeoutMs, LppUserData *lppUserData) -{ - auto ret = OH_LowPowerVideoSink_SetTargetStartFrame(lppVideoStreamer_, framePts, onTargetArrived, timeoutMs, lppUserData); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::SetPlaybackSpeed(const float speed) -{ - auto ret = OH_LowPowerVideoSink_SetPlaybackSpeed(lppVideoStreamer_, speed); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::Release() -{ - Stop(); - Destroy(); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t LppVideoStreamer::RenderFirstFrame() -{ - auto ret = OH_LowPowerVideoSink_RenderFirstFrame(lppVideoStreamer_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Prepare failed."); - return AVCODEC_SAMPLE_ERR_OK; -} - -// int32_t LppVideoStreamer::StartDecode(bool flag) -// { -// OH_LowPowerVideoSink_StartDecode(lppVideoStreamer_, flag); -// } diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/dfx/error/av_codec_sample_error.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/dfx/error/av_codec_sample_error.h deleted file mode 100644 index 243380754cabfd20d5c35dedd32c18b335dd8870..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/dfx/error/av_codec_sample_error.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#ifndef AVCODEC_SAMPLE_ERROE_H -#define AVCODEC_SAMPLE_ERROE_H - -enum AVCodecSampleError : int { - AVCODEC_SAMPLE_ERR_OK = 0, - AVCODEC_SAMPLE_ERR_ERROR = -1, -}; - -#endif // AVCODEC_SAMPLE_ERROE_H \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/dfx/log/av_codec_sample_log.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/dfx/log/av_codec_sample_log.h deleted file mode 100644 index 6da1a6dc302ca88e713bd7c6044334437c2b78e7..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/dfx/log/av_codec_sample_log.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#ifndef AVCODEC_SAMPLE_LOG_H -#define AVCODEC_SAMPLE_LOG_H - -#include -#include - -#undef LOG_DOMAIN -#define LOG_DOMAIN 0x0002B66 - -#define AVCODEC_SAMPLE_LOG_FREQ_LIMIT(frequency) \ - if (1) { \ - thread_local uint64_t currentTimes = 0; \ - if (currentTimes++ % ((uint64_t)(frequency)) != 0) { \ - break; \ - } \ - } - -#define AVCODEC_SAMPLE_LOG(func, fmt, args...) \ - do { \ - (void)func(LOG_APP, "{%{public}s():%{public}d} " fmt, __FUNCTION__, __LINE__, ##args); \ - } while (0) - -#define AVCODEC_SAMPLE_LOGF(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_FATAL, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGE(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_ERROR, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGW(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_WARN, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGI(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_INFO, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGD(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_DEBUG, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGD_LIMIT(frequency, fmt, ...) \ - do { \ - AVCODEC_SAMPLE_LOG_FREQ_LIMIT(frequency); \ - AVCODEC_SAMPLE_LOGD(fmt, ##__VA_ARGS__); \ - } while (0) - -#define CHECK_AND_RETURN_RET_LOG(cond, ret, fmt, ...) \ - do { \ - if (!(cond)) { \ - AVCODEC_SAMPLE_LOGE(fmt, ##__VA_ARGS__); \ - return ret; \ - } \ - } while (0) - -#define CHECK_AND_RETURN_LOG(cond, fmt, ...) \ - do { \ - if (!(cond)) { \ - AVCODEC_SAMPLE_LOGE(fmt, ##__VA_ARGS__); \ - return; \ - } \ - } while (0) - -#define CHECK_AND_BREAK_LOG(cond, fmt, ...) \ - if (1) { \ - if (!(cond)) { \ - AVCODEC_SAMPLE_LOGW(fmt, ##__VA_ARGS__); \ - break; \ - } \ - } else void (0) - -#define CHECK_AND_CONTINUE_LOG(cond, fmt, ...) \ - if (1) { \ - if (!(cond)) { \ - AVCODEC_SAMPLE_LOGW(fmt, ##__VA_ARGS__); \ - continue; \ - } \ - } else void (0) - -#endif // AVCODEC_SAMPLE_LOG_H \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/lppCallback.cpp b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/lppCallback.cpp deleted file mode 100644 index 0a31eda78b7a78f5b3b5ed4739838ce20d704671..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/lppCallback.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#include "av_codec_sample_log.h" -#include "lppCallback.h" -#include "sample_info.h" - -namespace { -constexpr int LIMIT_LOGD_FREQUENCY = 50; -} - -#undef LOG_TAG -#define LOG_TAG "lppcallback" - -void LppCallback::OnDataNeeded(OH_LowPowerAudioSink *decoder, OH_AVSamplesBuffer *framePacket, void *userData) -{ -// AVCODEC_SAMPLE_LOGI("OnDataNeeded"); - LppUserData *lppUserData = static_cast(userData); - std::unique_lock lock(lppUserData->inputMutex); - if(lppUserData->framePacket_==nullptr) - { -// AVCODEC_SAMPLE_LOGI("ggggfd"); - } - lppUserData->framePacket_ = framePacket; - if(lppUserData->framePacket_==nullptr) - { -// AVCODEC_SAMPLE_LOGI("ggdfsd"); - } - lppUserData->count++; - lppUserData->returnFrame = true; - lppUserData->inputCond.notify_all(); - lock.unlock(); -} - -void LppCallback::OnPositionUpdated(OH_LowPowerAudioSink *decoder, long currentPosition, void *userData) -{ - AVCODEC_SAMPLE_LOGI("currentPosition %{public}ld",currentPosition); - LppUserData *lppUserData = static_cast(userData); - std::unique_lock lock(lppUserData->inputMutex); - lppUserData->position = currentPosition; - lock.unlock(); -} - -void LppCallback::OnError(OH_LowPowerAudioSink *decoder, OH_AVErrCode errCode, const char *errorMsg, void *userData) -{ - AVCODEC_SAMPLE_LOGI("errCode %{public}d",errCode); -} - -void LppCallback::OnInterrupted(OH_LowPowerAudioSink *decoder, OH_AudioInterrupt_ForceType type, OH_AudioInterrupt_Hint hint, void *userData) -{ - AVCODEC_SAMPLE_LOGI("callback OnInterrupted %{public}d", type); - LppUserData *lppUserData = static_cast(userData); - std::unique_lock lock(lppUserData->inputMutex); - lppUserData->audioCallback(lppUserData->audioCallbackData); - lock.unlock(); - -} - -void LppCallback::OnDeviceChanged(OH_LowPowerAudioSink *decoder, OH_AudioStream_DeviceChangeReason reason, void *userData) -{ - AVCODEC_SAMPLE_LOGI("reason %{public}d",reason); -} - -void LppCallback::OnEos(OH_LowPowerAudioSink *decoder, void * userData) -{ -// AVCODEC_SAMPLE_LOGI("reason %{public}d",reason); -} - -void LppCallback::OnDataNeededVideo(OH_LowPowerVideoSink *streamer, OH_AVSamplesBuffer *framePacket, void *userData) -{ - AVCODEC_SAMPLE_LOGI("OH_LowPowerVideoSink OnDataNeeded"); - LppUserData *lppUserData = static_cast(userData); - std::unique_lock lock(lppUserData->inputMutex); - if(lppUserData->framePacket_==nullptr) - { -// AVCODEC_SAMPLE_LOGI("ggggfd"); - } - lppUserData->framePacket_ = framePacket; - if(lppUserData->framePacket_==nullptr) - { -// AVCODEC_SAMPLE_LOGI("ggdfsd"); - } -// AVCODEC_SAMPLE_LOGI("OH_LowPowerVideoSink OnDataNeeded"); - lppUserData->count++; - lppUserData->returnFrame = true; - lppUserData->inputCond.notify_all(); -// AVCODEC_SAMPLE_LOGI("OH_LowPowerVideoSink OnDataNeeded notify"); -// AVCODEC_SAMPLE_LOGI("OH_LowPowerVideoSink num %{public}d",lppUserData->num); -} - -void LppCallback::OnAnchorUpdated(OH_LowPowerVideoSink *streamer, long *anchorPts, long *anchorClock, void *userData) -{ - -} - -void LppCallback::OnError(OH_LowPowerVideoSink *streamer, OH_AVErrCode errCode, const char *errMsg, void *userData) -{ - AVCODEC_SAMPLE_LOGI("errCode %{public}d",errCode); -} - -void LppCallback::OnTargetArrived(OH_LowPowerVideoSink *streamer, const long targetPts, const bool isTimeout, void *userData) -{ - LppUserData *lppUserData = static_cast(userData); - std::unique_lock lock(lppUserData->seekMutex_); - AVCODEC_SAMPLE_LOGI("OnTargetArrived accSeek"); - if(isTimeout){ - AVCODEC_SAMPLE_LOGI("OnTargetArrived timeout"); - } - lppUserData->inputCond.notify_all(); -} - -void LppCallback::OH_LowPowerVideoSink_OnStreamChanged(OH_LowPowerVideoSink *streamer, OH_AVFormat *format, void *userData) -{ - if(format == nullptr){ - AVCODEC_SAMPLE_LOGI("OnOutputFormatChanged format nullptr"); - return; - } - int32_t width = 0; - OH_AVFormat_GetIntValue(format, "video_picture_width", &width); - int32_t height = 0; - OH_AVFormat_GetIntValue(format, "video_picture_height", &height); - AVCODEC_SAMPLE_LOGI("OnOutputFormatChanged width= %{public}d height= %{public}d",width, height); -} - -void LppCallback::OnRenderStarted(OH_LowPowerVideoSink *streamer, void *userData) -{ - -} - -void LppCallback::OnEos(OH_LowPowerVideoSink *streamer, void *userData) -{ - -} - - diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/lppCallback.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/lppCallback.h deleted file mode 100644 index 2b24f5a3f68ad9606b4f07dbc86b95e4cc6b4d7c..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/lppCallback.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// Created on 2025/2/26. -// -// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found, -// please include "napi/native_api.h". - -#ifndef AVCODECSAMPLE_MASTER_LPPCALLBACK_H -#define AVCODECSAMPLE_MASTER_LPPCALLBACK_H - -#include -#include -#include -class LppCallback { -public: - static void OnDataNeeded(OH_LowPowerAudioSink *decoder, OH_AVSamplesBuffer *framePacket, void *userData); - - static void OnPositionUpdated(OH_LowPowerAudioSink *decoder, long currentPosition, void *userData); - - static void OnError(OH_LowPowerAudioSink *decoder, OH_AVErrCode errCode, const char *errorMsg, void *userData); - - static void OnInterrupted(OH_LowPowerAudioSink *decoder, OH_AudioInterrupt_ForceType type, OH_AudioInterrupt_Hint hint, void *userData); - - static void OnDeviceChanged(OH_LowPowerAudioSink *decoder, OH_AudioStream_DeviceChangeReason reason, void *userData); - - static void OnEos(OH_LowPowerAudioSink *decoder, void * userData); - - // - static void OnDataNeededVideo(OH_LowPowerVideoSink *streamer, OH_AVSamplesBuffer *framePacket, void *userData); - - static void OnAnchorUpdated(OH_LowPowerVideoSink *streamer, long *anchorPts, long *anchorClock, void *userData); - - static void OnError(OH_LowPowerVideoSink *streamer, OH_AVErrCode errCode, const char *errMsg, void *userData); - - static void OnTargetArrived(OH_LowPowerVideoSink *streamer, const long targetPts, const bool isTimeout, void *userData); - - static void OnRenderStarted(OH_LowPowerVideoSink *streamer, void *userData); - - static void OnEos(OH_LowPowerVideoSink *streamer, void *userData); - - static void OH_LowPowerVideoSink_OnStreamChanged(OH_LowPowerVideoSink *streamer, OH_AVFormat *format, void *userData); - -}; - -#endif //AVCODECSAMPLE_MASTER_LPPCALLBACK_H diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/sample_info.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/sample_info.h deleted file mode 100644 index adf2922064695bfc5d52095dae5a9762c2e37b06..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/common/sample_info.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#ifndef AVCODEC_SAMPLE_INFO_H -#define AVCODEC_SAMPLE_INFO_H -#include -#include -#include -#include -#include -#include -#include "multimedia/player_framework/native_avdemuxer.h" -#include -#include -#include -#include -#include -#include "multimedia/player_framework/native_avcodec_base.h" -#include "multimedia/player_framework/native_avbuffer.h" - -const std::string_view MIME_VIDEO_AVC = "video/avc"; -const std::string_view MIME_VIDEO_HEVC = "video/hevc"; -const std::string_view MIME_AUDIO_MPEG = "audio/mpeg"; - -constexpr int32_t BITRATE_10M = 10 * 1024 * 1024; // 10Mbps -constexpr int32_t BITRATE_20M = 20 * 1024 * 1024; // 20Mbps -constexpr int32_t BITRATE_30M = 30 * 1024 * 1024; // 30Mbps - -struct SampleInfo { - OH_AVFormat* format_audio; - OH_AVFormat* format_video; - int32_t inputFd = -1; - int32_t outputFd = -1; - int64_t inputFileOffset = 0; - int64_t inputFileSize = 0; - std::string inputFilePath; - std::string videoCodecMime = ""; - std::string audioCodecMime = ""; - int32_t videoWidth = 0; - int32_t videoHeight = 0; - double frameRate = 0.0; - int64_t bitrate = 10 * 1024 * 1024; // 10Mbps; - int64_t frameInterval = 0; - OH_AVPixelFormat pixelFormat = AV_PIXEL_FORMAT_NV12; - uint32_t bitrateMode = CBR; - int32_t iFrameInterval = 100; - int32_t rangFlag = 1; - - int32_t audioSampleForamt = 0; - int32_t audioSampleRate = 0; - int32_t audioChannelCount = 0; - int64_t audioChannelLayout = 0; - int64_t duration = 0; - uint8_t* audioCodecConfig = nullptr; - size_t audioCodecSize = 0; - bool isInit = false; - - - int32_t isHDRVivid = 0; - int32_t hevcProfile = HEVC_PROFILE_MAIN; - OH_ColorPrimary primary = COLOR_PRIMARY_BT2020; - OH_TransferCharacteristic transfer = TRANSFER_CHARACTERISTIC_HLG; - OH_MatrixCoefficient matrix = MATRIX_COEFFICIENT_BT2020_CL; - - int32_t rotation = 0; - OHNativeWindow *window = nullptr; - - void (*playDoneCallback)(void *context) = nullptr; - void (*audioCallback)(void *context) = nullptr; - void *playDoneCallbackData = nullptr; - void *audioCallbackData = nullptr; -}; - -struct CodecBufferInfo { - uint32_t bufferIndex = 0; - uintptr_t *buffer = nullptr; - uint8_t *bufferAddr = nullptr; - OH_AVCodecBufferAttr attr = {0, 0, 0, AVCODEC_BUFFER_FLAGS_NONE}; - - explicit CodecBufferInfo(uint8_t *addr) : bufferAddr(addr){}; - CodecBufferInfo(uint8_t *addr, int32_t bufferSize) - : bufferAddr(addr), attr({0, bufferSize, 0, AVCODEC_BUFFER_FLAGS_NONE}){}; - CodecBufferInfo(uint32_t argBufferIndex, OH_AVBuffer *argBuffer) - : bufferIndex(argBufferIndex), buffer(reinterpret_cast(argBuffer)) - { - OH_AVBuffer_GetBufferAttr(argBuffer, &attr); - }; -}; - -struct LppUserData { -public: - std::mutex inputMutex; - std::condition_variable inputCond; - std::condition_variable eosCond_; - std::mutex eosMutex; - std::mutex eosFlagMutex; - bool eosFlag_ {false}; - OH_AVSamplesBuffer *framePacket_ = nullptr; - std::queue cacheQueue; - bool returnFrame = false; - int32_t num = 0; - int32_t count = 0; - std::mutex seekMutex_; - std::condition_variable seekCond_; - bool seekReturn_ = false; - int64_t position = 0; - void (*audioCallback)(void *context) = nullptr; - void *audioCallbackData = nullptr; - -}; -#endif // AVCODEC_SAMPLE_INFO_H \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/egl_core.cpp b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/egl_core.cpp deleted file mode 100644 index b76ac01ca65e3fedda7c996091301a78c0e9a7f9..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/egl_core.cpp +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#include "egl_core.h" - -#include -#include -#include -#include -#include -#include - -#include "plugin_render.h" - -#undef LOG_TAG -#define LOG_TAG "EGLCORE" - -namespace NativeXComponentSample { -namespace { -constexpr uint32_t LOG_PRINT_DOMAIN = 0xFF00; -constexpr int32_t NUM_4 = 4; -/** - * Vertex shader. - */ -const char VERTEX_SHADER[] = "#version 300 es\n" - "layout(location = 0) in vec4 a_position;\n" - "layout(location = 1) in vec4 a_color; \n" - "out vec4 v_color; \n" - "void main() \n" - "{ \n" - " gl_Position = a_position; \n" - " v_color = a_color; \n" - "} \n"; - -/** - * Fragment shader. - */ -const char FRAGMENT_SHADER[] = "#version 300 es\n" - "precision mediump float; \n" - "in vec4 v_color; \n" - "out vec4 fragColor; \n" - "void main() \n" - "{ \n" - " fragColor = v_color; \n" - "} \n"; - -/** - * Background color #f4f4f4. - */ -const GLfloat BACKGROUND_COLOR[] = {244.0f / 255, 244.0f / 255, 244.0f / 255, 1.0f}; - -/** - * Draw color #7E8FFB. - */ -const GLfloat DRAW_COLOR[] = {126.0f / 255, 143.0f / 255, 251.0f / 255, 1.0f}; - -/** - * Change color #92D6CC. - */ -const GLfloat CHANGE_COLOR[] = {146.0f / 255, 214.0f / 255, 204.0f / 255, 1.0f}; - -/** - * Background area. - */ -const GLfloat BACKGROUND_RECTANGLE_VERTICES[] = { - -1.0f, 1.0f, - 1.0f, 1.0f, - 1.0f, -1.0f, - -1.0f, -1.0f}; - -/** - * Get context parameter count. - */ -const size_t GET_CONTEXT_PARAM_CNT = 1; - -/** - * Fifty percent. - */ -const float FIFTY_PERCENT = 0.5; - -/** - * Pointer size. - */ -const GLint POINTER_SIZE = 2; - -/** - * Triangle fan size. - */ -const GLsizei TRIANGLE_FAN_SIZE = 4; - -/** - * Egl red size default. - */ -const int EGL_RED_SIZE_DEFAULT = 8; - -/** - * Egl green size default. - */ -const int EGL_GREEN_SIZE_DEFAULT = 8; - -/** - * Egl blue size default. - */ -const int EGL_BLUE_SIZE_DEFAULT = 8; - -/** - * Egl alpha size default. - */ -const int EGL_ALPHA_SIZE_DEFAULT = 8; - -/** - * Default x position. - */ -const int DEFAULT_X_POSITION = 0; - -/** - * Default y position. - */ -const int DEFAULT_Y_POSITION = 0; - -/** - * Gl red default. - */ -const GLfloat GL_RED_DEFAULT = 0.0; - -/** - * Gl green default. - */ -const GLfloat GL_GREEN_DEFAULT = 0.0; - -/** - * Gl blue default. - */ -const GLfloat GL_BLUE_DEFAULT = 0.0; - -/** - * Gl alpha default. - */ -const GLfloat GL_ALPHA_DEFAULT = 1.0; - -/** - * Program error. - */ -const GLuint PROGRAM_ERROR = 0; - -/** - * Shape vertices size. - */ -const int SHAPE_VERTICES_SIZE = 8; - -/** - * Position handle name. - */ -const char POSITION_NAME[] = "a_position"; - -/** - * Position error. - */ -const GLint POSITION_ERROR = -1; - -/** - * Config attribute list. - */ -const EGLint ATTRIB_LIST[] = { - // Key,value. - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RED_SIZE, EGL_RED_SIZE_DEFAULT, - EGL_GREEN_SIZE, EGL_GREEN_SIZE_DEFAULT, - EGL_BLUE_SIZE, EGL_BLUE_SIZE_DEFAULT, - EGL_ALPHA_SIZE, EGL_ALPHA_SIZE_DEFAULT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - // End. - EGL_NONE}; - -/** - * Context attributes. - */ -const EGLint CONTEXT_ATTRIBS[] = { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE}; -} // namespace -bool EGLCore::EglContextInit(void* window, int width, int height) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "EglContextInit execute"); - if ((window == nullptr) || (width <= 0) || (height <= 0)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "EglContextInit: param error"); - return false; - } - - UpdateSize(width, height); - eglWindow_ = reinterpret_cast(window); - - // Init display. - eglDisplay_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (eglDisplay_ == EGL_NO_DISPLAY) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglGetDisplay: unable to get EGL display"); - return false; - } - - EGLint majorVersion; - EGLint minorVersion; - if (!eglInitialize(eglDisplay_, &majorVersion, &minorVersion)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglInitialize: unable to get initialize EGL display"); - return false; - } - - // Select configuration. - const EGLint maxConfigSize = 1; - EGLint numConfigs; - if (!eglChooseConfig(eglDisplay_, ATTRIB_LIST, &eglConfig_, maxConfigSize, &numConfigs)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglChooseConfig: unable to choose configs"); - return false; - } - - return CreateEnvironment(); -} - -bool EGLCore::CreateEnvironment() -{ - // Create surface. - if (!eglWindow_) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglWindow_ is null"); - return false; - } - eglSurface_ = eglCreateWindowSurface(eglDisplay_, eglConfig_, eglWindow_, NULL); - if (eglSurface_ == nullptr) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglCreateWindowSurface: unable to create surface"); - return false; - } - // Create context. - eglContext_ = eglCreateContext(eglDisplay_, eglConfig_, EGL_NO_CONTEXT, CONTEXT_ATTRIBS); - if (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglMakeCurrent failed"); - return false; - } - // Create program. - program_ = CreateProgram(VERTEX_SHADER, FRAGMENT_SHADER); - if (program_ == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "CreateProgram: unable to create program"); - return false; - } - return true; -} - -GLuint EGLCore::LoadShader(GLenum type, const char* shaderSrc) -{ - if ((type <= 0) || (shaderSrc == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCreateShader type or shaderSrc error"); - return PROGRAM_ERROR; - } - - GLuint shader = glCreateShader(type); - if (shader == 0) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCreateShader unable to load shader"); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glShaderSource(shader, 1, &shaderSrc, nullptr); - glCompileShader(shader); - - GLint compiled; - glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); - if (compiled != 0) { - return shader; - } - - GLint infoLen = 0; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen <= 1) { - glDeleteShader(shader); - return PROGRAM_ERROR; - } - - char* infoLog = (char*)malloc(sizeof(char) * (infoLen + 1)); - if (infoLog != nullptr) { - memset(infoLog, 0, infoLen + 1); - glGetShaderInfoLog(shader, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glCompileShader error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(shader); - return PROGRAM_ERROR; -} - -GLuint EGLCore::CreateProgram(const char* vertexShader, const char* fragShader) -{ - if ((vertexShader == nullptr) || (fragShader == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram: vertexShader or fragShader is null"); - return PROGRAM_ERROR; - } - - GLuint vertex = LoadShader(GL_VERTEX_SHADER, vertexShader); - if (vertex == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram vertex error"); - return PROGRAM_ERROR; - } - - GLuint fragment = LoadShader(GL_FRAGMENT_SHADER, fragShader); - if (fragment == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram fragment error"); - return PROGRAM_ERROR; - } - - GLuint program = glCreateProgram(); - if (program == PROGRAM_ERROR) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram program error"); - glDeleteShader(vertex); - glDeleteShader(fragment); - return PROGRAM_ERROR; - } - - // The gl function has no return value. - glAttachShader(program, vertex); - glAttachShader(program, fragment); - glLinkProgram(program); - - GLint linked; - glGetProgramiv(program, GL_LINK_STATUS, &linked); - if (linked != 0) { - glDeleteShader(vertex); - glDeleteShader(fragment); - return program; - } - - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "createProgram linked error"); - GLint infoLen = 0; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen > 1) { - char* infoLog = (char*)malloc(sizeof(char) * (infoLen + 1)); - memset(infoLog, 0, infoLen + 1); - glGetProgramInfoLog(program, infoLen, nullptr, infoLog); - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "glLinkProgram error = %s", infoLog); - free(infoLog); - infoLog = nullptr; - } - glDeleteShader(vertex); - glDeleteShader(fragment); - glDeleteProgram(program); - return PROGRAM_ERROR; -} - -void EGLCore::UpdateSize(int width, int height) -{ - width_ = width; - height_ = height; - if (width_ > 0) { - widthPercent_ = FIFTY_PERCENT * height_ / width_; - } -} - -void EGLCore::Release() -{ - if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (!eglDestroySurface(eglDisplay_, eglSurface_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroySurface failed"); - } - - if ((eglDisplay_ == nullptr) || (eglContext_ == nullptr) || (!eglDestroyContext(eglDisplay_, eglContext_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroyContext failed"); - } - - if ((eglDisplay_ == nullptr) || (!eglTerminate(eglDisplay_))) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglTerminate failed"); - } -} -} // namespace NativeXComponentSample diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/include/egl_core.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/include/egl_core.h deleted file mode 100644 index 3f3980f6a299283952c7b2f1f52544861a662ac5..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/include/egl_core.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ -#ifndef NATIVE_XCOMPONENT_EGL_CORE_H -#define NATIVE_XCOMPONENT_EGL_CORE_H - -#include -#include -#include - -namespace NativeXComponentSample { -class EGLCore { -public: - explicit EGLCore() {}; - ~EGLCore() {} - bool EglContextInit(void* window, int width, int height); - bool CreateEnvironment(); - void Release(); - void UpdateSize(int width, int height); - -private: - GLuint LoadShader(GLenum type, const char* shaderSrc); - GLuint CreateProgram(const char* vertexShader, const char* fragShader); - -private: - EGLNativeWindowType eglWindow_; - EGLDisplay eglDisplay_ = EGL_NO_DISPLAY; - EGLConfig eglConfig_ = EGL_NO_CONFIG_KHR; - EGLSurface eglSurface_ = EGL_NO_SURFACE; - EGLContext eglContext_ = EGL_NO_CONTEXT; - GLuint program_; - bool flag_ = false; - int width_; - int height_; - GLfloat widthPercent_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_EGL_CORE_H diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/include/plugin_manager.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/include/plugin_manager.h deleted file mode 100644 index 92e61fa460a5ee5100532c7e2ca9e9bd4e7109cd..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/include/plugin_manager.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ -#ifndef NATIVE_XCOMPONENT_PLUGIN_MANAGER_H -#define NATIVE_XCOMPONENT_PLUGIN_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include "native_window/external_window.h" - -#include "plugin_render.h" - -namespace NativeXComponentSample { -class PluginManager { -public: - ~PluginManager(); - - static PluginManager* GetInstance() - { - return &PluginManager::pluginManager_; - } - - static napi_value GetContext(napi_env env, napi_callback_info info); - - void SetNativeXComponent(std::string& id, OH_NativeXComponent* nativeXComponent); - PluginRender* GetRender(std::string& id); - void Export(napi_env env, napi_value exports); - OHNativeWindow *pluginWindow_; - -private: - static PluginManager pluginManager_; - - std::unordered_map nativeXComponentMap_; - std::unordered_map pluginRenderMap_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/include/plugin_render.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/include/plugin_render.h deleted file mode 100644 index 28883e38d62aeb033d4c74bb0fdf45197a113d9d..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/include/plugin_render.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ -#ifndef NATIVE_XCOMPONENT_PLUGIN_RENDER_H -#define NATIVE_XCOMPONENT_PLUGIN_RENDER_H - -#include -#include -#include -#include - -#include "egl_core.h" - -namespace NativeXComponentSample { -class PluginRender { -public: - explicit PluginRender(std::string& id); - ~PluginRender() - { - if (eglCore_ != nullptr) { - eglCore_->Release(); - delete eglCore_; - eglCore_ = nullptr; - } - } - static PluginRender* GetInstance(std::string& id); - static void Release(std::string& id); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent* component, void* window); - void OnTouchEvent(OH_NativeXComponent* component, void* window); - void RegisterCallback(OH_NativeXComponent* nativeXComponent); - -public: - static std::unordered_map instance_; - EGLCore* eglCore_; - std::string id_; - static int32_t hasDraw_; - static int32_t hasChangeColor_; - -private: - OH_NativeXComponent_Callback renderCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; -}; -} // namespace NativeXComponentSample -#endif // NATIVE_XCOMPONENT_PLUGIN_RENDER_H diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/plugin_manager.cpp b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/plugin_manager.cpp deleted file mode 100644 index 26bdd7d3a75f86efa5e71305c7e2bbb695978c91..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/plugin_manager.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#include "plugin_manager.h" - -#include -#include -#include -#include -#include - -#undef LOG_TAG -#define LOG_TAG "PLUGINMANAGER" - -namespace NativeXComponentSample { -constexpr uint32_t LOG_PRINT_DOMAIN = 0xFF00; -PluginManager PluginManager::pluginManager_; - -PluginManager::~PluginManager() -{ - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "~PluginManager"); - for (auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for (auto iter = pluginRenderMap_.begin(); iter != pluginRenderMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - pluginRenderMap_.clear(); -} - -napi_value PluginManager::GetContext(napi_env env, napi_callback_info info) -{ - if ((env == nullptr) || (info == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "GetContext env or info is null"); - return nullptr; - } - - size_t argCnt = 1; - napi_value args[1] = { nullptr }; - if (napi_get_cb_info(env, info, &argCnt, args, nullptr, nullptr) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "GetContext napi_get_cb_info failed"); - } - - if (argCnt != 1) { - napi_throw_type_error(env, NULL, "Wrong number of arguments"); - return nullptr; - } - - napi_valuetype valuetype; - if (napi_typeof(env, args[0], &valuetype) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_typeof failed"); - return nullptr; - } - - if (valuetype != napi_number) { - napi_throw_type_error(env, NULL, "Wrong type of arguments"); - return nullptr; - } - - int64_t value; - if (napi_get_value_int64(env, args[0], &value) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_get_value_int64 failed"); - return nullptr; - } - - napi_value exports; - if (napi_create_object(env, &exports) != napi_ok) { - napi_throw_type_error(env, NULL, "napi_create_object failed"); - return nullptr; - } - - return exports; -} - -void PluginManager::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: env or exports is null"); - return; - } - - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: napi_get_named_property fail"); - return; - } - - OH_NativeXComponent* nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: napi_unwrap fail"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "Export: OH_NativeXComponent_GetXComponentId fail"); - return; - } - - std::string id(idStr); - auto context = PluginManager::GetInstance(); - if ((context != nullptr) && (nativeXComponent != nullptr)) { - context->SetNativeXComponent(id, nativeXComponent); - auto render = context->GetRender(id); - if (render != nullptr) { - render->RegisterCallback(nativeXComponent); - render->Export(env, exports); - } - } -} - -void PluginManager::SetNativeXComponent(std::string& id, OH_NativeXComponent* nativeXComponent) -{ - if (nativeXComponent == nullptr) { - return; - } - - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent* tmp = nativeXComponentMap_[id]; - delete tmp; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -PluginRender* PluginManager::GetRender(std::string& id) -{ - if (pluginRenderMap_.find(id) == pluginRenderMap_.end()) { - PluginRender* instance = PluginRender::GetInstance(id); - pluginRenderMap_[id] = instance; - return instance; - } - - return pluginRenderMap_[id]; -} -} // namespace NativeXComponentSample diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/plugin_render.cpp b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/plugin_render.cpp deleted file mode 100644 index 8792110813700c7be1942d7493c9086834f6841f..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/render/plugin_render.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#include -#include -#include -#include -#include - -#include "plugin_manager.h" -#include "plugin_render.h" - -#undef LOG_TAG -#define LOG_TAG "PLUGINRENDER" - -namespace NativeXComponentSample { -namespace { -constexpr uint32_t LOG_PRINT_DOMAIN = 0xFF00; - -void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - uint64_t width; - uint64_t height; - int32_t xSize = OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - if ((xSize == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) && (render != nullptr)) { - if (render->eglCore_->EglContextInit(window, width, height)) { - auto context = PluginManager::GetInstance(); - context->pluginWindow_ = (OHNativeWindow *)window; - OH_NativeWindow_NativeWindowSetScalingModeV2(context->pluginWindow_, OH_SCALING_MODE_SCALE_FIT_V2); - uint8_t metadataType = OH_VIDEO_HDR_HLG; - (void)OH_NativeWindow_SetMetadataValue(context->pluginWindow_, OH_HDR_METADATA_TYPE, sizeof(uint8_t), &metadataType); - OH_NativeBuffer_ColorSpace colorSpace = OH_COLORSPACE_BT2020_HLG_LIMIT; - (void)OH_NativeWindow_SetColorSpace(context->pluginWindow_, colorSpace); - } - } -} - -void OnSurfaceChangedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChangedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "surface changed"); - } -} - -void OnSurfaceDestroyedCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - PluginRender::Release(id); -} - -void DispatchTouchEventCB(OH_NativeXComponent* component, void* window) -{ - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); - if ((component == nullptr) || (window == nullptr)) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: component or window is null"); - return; - } - - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - PluginRender* render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } -} -} // namespace - -std::unordered_map PluginRender::instance_; -int32_t PluginRender::hasDraw_ = 0; -int32_t PluginRender::hasChangeColor_ = 0; - -PluginRender::PluginRender(std::string& id) -{ - this->id_ = id; - this->eglCore_ = new EGLCore(); -} - -PluginRender* PluginRender::GetInstance(std::string& id) -{ - if (instance_.find(id) == instance_.end()) { - PluginRender* instance = new PluginRender(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } -} - -void PluginRender::Export(napi_env env, napi_value exports) -{ - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "Export: env or exports is null"); - return; - } - - napi_property_descriptor desc[] = {}; - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginRender", "Export: napi_define_properties failed"); - } -} - -void PluginRender::Release(std::string& id) -{ - PluginRender* render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->eglCore_->Release(); - delete render->eglCore_; - render->eglCore_ = nullptr; - delete render; - render = nullptr; - instance_.erase(instance_.find(id)); - } -} - -void PluginRender::OnSurfaceChanged(OH_NativeXComponent* component, void* window) -{ - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceChanged: Unable to get XComponent id"); - return; - } - - std::string id(idStr); - PluginRender* render = PluginRender::GetInstance(id); - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OH_NativeXComponent_GetXComponentOffset", - "offsetX = %{public}lf, offsetY = %{public}lf", offsetX, offsetY); - uint64_t width; - uint64_t height; - OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - if (render != nullptr) { - render->eglCore_->UpdateSize(width, height); - } -} - -void PluginRender::OnTouchEvent(OH_NativeXComponent* component, void* window) -{ - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print( - LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB: Unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = - OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", - "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, tiltY); -} - -void PluginRender::RegisterCallback(OH_NativeXComponent *nativeXComponent) -{ - renderCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - renderCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - renderCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - renderCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &renderCallback_); -} -} // namespace NativeXComponentSample diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/Player.cpp b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/Player.cpp deleted file mode 100644 index 469e6d628b6719bab9cef8f615f7097185e0e7c1..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/Player.cpp +++ /dev/null @@ -1,631 +0,0 @@ -#include "Player.h" -#include -#include -#include -#include "av_codec_sample_log.h" -#include "dfx/error/av_codec_sample_error.h" -#include "lppCallback.h" - -#undef LOG_TAG -#define LOG_TAG "playerDemo" - -namespace { -constexpr int BALANCE_VALUE = 5; -using namespace std::chrono_literals; -static const int MS_TO_S = 1000; -constexpr int64_t WAIT_TIME_US_THRESHOLD_WARNING = -1 * 40 * 1000; // warning threshold 40ms -constexpr int64_t WAIT_TIME_US_THRESHOLD = 1 * 1000 * 1000; // max sleep time 1s -constexpr int64_t SINK_TIME_US_THRESHOLD = 100000; // max sink time 100ms -constexpr int32_t BYTES_PER_SAMPLE_2 = 2; // 2 bytes per sample -constexpr double VSYNC_TIME = 1000 / 60; // frame time -constexpr double LIP_SYNC_BALANCE_VALUE = 2; // the balance value of sync sound and picture -constexpr int32_t MAX_BUFFER_SIZE = 2*1024*1024; -constexpr int32_t WAIT_OUT_TIME = 50000; // 等待时间MS -constexpr int32_t VIDEO_FRAME_COUNT = 1; //视频聚包帧数 -constexpr int32_t AUDIO_FRAME_COUNT = 10; //视频聚包帧数 -} // namespace - -Player::~Player() -{ - Player::StartRelease(); -} - -bool Player::Intercept() -{ - if(demuxer_ == nullptr || lppVideoStreamer_ == nullptr || lppAudioStreamer_ == nullptr){ - return true; - } - return false; -} - -int32_t Player::CreateLppAudioStreamer() -{ - AVCODEC_SAMPLE_LOGW("CreateLppAudioStreamer IN"); - if(lppAudioStreamer_ == nullptr){ - AVCODEC_SAMPLE_LOGE("lppAudioStreamer_ is Release, should init"); - return -1; - } - auto ret = lppAudioStreamer_->Create(sampleInfo_.audioCodecMime); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK , AVCODEC_SAMPLE_ERR_ERROR, "CreateLppAudioStreamer failed."); - lppContext_ = new LppUserData; - lppContext_->audioCallback = sampleInfo_.audioCallback; - lppContext_->audioCallbackData = sampleInfo_.audioCallbackData; - ret = lppAudioStreamer_->SetCallback(lppContext_); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK , AVCODEC_SAMPLE_ERR_ERROR, "SetCallback failed."); - ret = lppAudioStreamer_->SetParameter(sampleInfo_); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK , AVCODEC_SAMPLE_ERR_ERROR, "SetParameter failed."); - AVCODEC_SAMPLE_LOGW("CreateLppAudioStreamer OUT"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Player::CreateLppVideoStreamer() -{ - AVCODEC_SAMPLE_LOGI("CreateLppVideoStreamer IN"); - if(lppVideoStreamer_ == nullptr){ - AVCODEC_SAMPLE_LOGE("lppVideoStreamer_ is Release, should init"); - return -1; - } - AVCODEC_SAMPLE_LOGI("FORMAT : %{public}s", sampleInfo_.videoCodecMime.c_str()); - sampleInfo_.window = NativeXComponentSample::PluginManager::GetInstance()->pluginWindow_; -// video/avc - lppVideoStreamer_->Create(sampleInfo_.videoCodecMime.c_str()); - lppVideoContext_ = new LppUserData; - lppVideoContext_->num = 100012; - lppVideoStreamer_->SetCallback(lppVideoContext_); - OH_AVFormat *format = OH_AVFormat_Create(); - lppVideoStreamer_->Configure(sampleInfo_); - lppVideoStreamer_->SetVideoSurface(sampleInfo_); - AVCODEC_SAMPLE_LOGI("CreateLppVideoStreamer OUT"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Player::Init(SampleInfo &sampleInfo) -{ - Stop(); - Reset(); - StartRelease(); - std::unique_lock lock(mutex_); - CHECK_AND_RETURN_RET_LOG(!isStarted_, AVCODEC_SAMPLE_ERR_ERROR, "Already started."); - sampleInfo_ = sampleInfo; - sampleInfo_.isInit = true; - CHECK_AND_RETURN_RET_LOG(demuxer_ == nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Already started."); - demuxer_ = std::make_unique(); - AVCODEC_SAMPLE_LOGI("Create lppAudioStreamer_ SUCC"); - lppAudioStreamer_ = std::make_shared(); - lppVideoStreamer_ = std::make_shared(); - isReleased_ = false; - AVCODEC_SAMPLE_LOGI("Succeed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Player::Prepare() -{ - AVCODEC_SAMPLE_LOGW("Prepare IN"); - if(!sampleInfo_.isInit){ - return 0; - } - std::unique_lock lock(mutex_); - if (demuxer_ == nullptr){ - demuxer_ = std::make_unique(); - } - int32_t ret = demuxer_->Create(sampleInfo_); - - ret = CreateLppAudioStreamer(); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK , AVCODEC_SAMPLE_ERR_ERROR, "CreateLppAudioStreamer failed."); - - ret = CreateLppVideoStreamer(); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK , AVCODEC_SAMPLE_ERR_ERROR, "CreateLppVideoStreamer failed."); - - lppVideoStreamer_->SetSyncAudioStreamer(lppAudioStreamer_->lppAudioStreamer_); - lppVideoStreamer_->Prepare(); - lppAudioStreamer_->Prepare(); - - isReleased_ = false; - isStarted_ = true; - if(lppVideoContext_){ - if (lppVideoDataNeededThread_ == nullptr){ - lppVideoDataNeededThread_ = std::make_unique(&Player::LppVideoDataNeededThread, this); - } - } - if(lppContext_){ - if (LppDataNeededThread_ == nullptr){ - LppDataNeededThread_ = std::make_unique(&Player::LppDataNeededThread1, this); - } - } - AVCODEC_SAMPLE_LOGW("Prepare OUT"); - return 0; -} - -int32_t Player::StartDecoder() -{ - isStarted_ = true; - state_ = PLAYING; - CHECK_AND_RETURN_RET_LOG(lppVideoContext_ != nullptr , AVCODEC_SAMPLE_ERR_ERROR, "CreateLppAudioStreamer failed."); - return lppVideoStreamer_->StartDecode(true); -} - -int32_t Player::RenderFirstFrame() -{ - CHECK_AND_RETURN_RET_LOG(lppVideoContext_ != nullptr && lppVideoStreamer_ != nullptr , AVCODEC_SAMPLE_ERR_ERROR, "lppVideoStreamer_ nullptr."); - return lppVideoStreamer_->RenderFirstFrame(); -} - -int32_t Player::StartRender() -{ - isStarted_ = true; - state_ = PLAYING; - CHECK_AND_RETURN_RET_LOG(lppVideoContext_ != nullptr && lppVideoStreamer_ != nullptr , AVCODEC_SAMPLE_ERR_ERROR, "lppVideoStreamer_ nullptr."); - return lppVideoStreamer_->StartRender(); -} - -int32_t Player::StartAudio() -{ - isStarted_ = true; - state_ = PLAYING; - CHECK_AND_RETURN_RET_LOG(lppContext_ != nullptr && lppAudioStreamer_ != nullptr , AVCODEC_SAMPLE_ERR_ERROR, "lppAudioStreamer_ nullptr."); - return lppAudioStreamer_->Start(); -} - -int32_t Player::Stop() -{ - std::unique_lock lock(mutex_); - CHECK_AND_RETURN_RET_LOG(!Intercept(), AVCODEC_SAMPLE_ERR_ERROR, "Intercept nullptr."); - AVCODEC_SAMPLE_LOGI("stop in"); - isStarted_ = false; - if (lppAudioStreamer_ != nullptr) { - lppAudioStreamer_->Stop(); - } - if (lppVideoStreamer_ != nullptr) { - lppVideoStreamer_->Stop(); - } - AVCODEC_SAMPLE_LOGI("stop out"); - lock.unlock(); - return 0; -} - -int32_t Player::Reset() -{ - std::unique_lock lock(mutex_); - CHECK_AND_RETURN_RET_LOG(!Intercept(), AVCODEC_SAMPLE_ERR_ERROR, "Intercept nullptr."); - isStarted_ = false; - ReleaseThread(); - AVCODEC_SAMPLE_LOGD("reset in"); - if (demuxer_ != nullptr) { - demuxer_->Release(); - demuxer_.reset(); - } - if (lppAudioStreamer_ != nullptr) { - lppAudioStreamer_->Reset(); - } - if (lppVideoStreamer_ != nullptr) { - lppVideoStreamer_->Reset(); - } - AVCODEC_SAMPLE_LOGD("reset out"); - lock.unlock(); - return 0; -} - -int32_t Player::Pause() -{ - std::unique_lock lock(mutex_); - CHECK_AND_RETURN_RET_LOG(!Intercept(), AVCODEC_SAMPLE_ERR_ERROR, "Intercept nullptr."); - AVCODEC_SAMPLE_LOGD("Pause in"); - if (lppAudioStreamer_ != nullptr) { - lppAudioStreamer_->Pause(); - } - if (lppVideoStreamer_ != nullptr) { - lppVideoStreamer_->Pause(); - } - AVCODEC_SAMPLE_LOGD("Pause out"); - lock.unlock(); - return 0; -} - -int32_t Player::Resume() -{ - std::unique_lock lock(mutex_); - CHECK_AND_RETURN_RET_LOG(!Intercept(), AVCODEC_SAMPLE_ERR_ERROR, "Intercept nullptr."); - state_ = PLAYING; - if (lppAudioStreamer_ != nullptr) { - lppAudioStreamer_->Resume(); - } - if (lppVideoStreamer_ != nullptr) { - lppVideoStreamer_->Resume(); - } - lock.unlock(); - return 0; -} - -int32_t Player::Flush() -{ - std::unique_lock lock(mutex_); - CHECK_AND_RETURN_RET_LOG(!Intercept(), AVCODEC_SAMPLE_ERR_ERROR, "Intercept nullptr."); - state_ = PAUSE; - if (lppAudioStreamer_ != nullptr) { - lppAudioStreamer_->Flush(); - } - if (lppVideoStreamer_ != nullptr) { - lppVideoStreamer_->Flush(); - } - lock.unlock(); - return 0; -} - -int32_t Player::SetSpeed(double speed) -{ - std::unique_lock lock(mutex_); - CHECK_AND_RETURN_RET_LOG(!Intercept(), AVCODEC_SAMPLE_ERR_ERROR, "Intercept nullptr."); - if (lppAudioStreamer_ != nullptr) { - lppAudioStreamer_->SetPlayBackSpeed(speed); - } - if (lppVideoStreamer_ != nullptr) { - lppVideoStreamer_->SetPlaybackSpeed(speed); - } - lock.unlock(); - return 0; -} - -int32_t Player::SetSurface(int64_t surfaceId) -{ - std::unique_lock lock(mutex_); - CHECK_AND_RETURN_RET_LOG(!Intercept(), AVCODEC_SAMPLE_ERR_ERROR, "Intercept nullptr."); - AVCODEC_SAMPLE_LOGD("SetSurface in %{public}d", surfaceId); - if (lppVideoStreamer_ != nullptr) { - OHNativeWindow *oHNativeWindow; - OH_NativeWindow_CreateNativeWindowFromSurfaceId(surfaceId,&oHNativeWindow); - sampleInfo_.window = oHNativeWindow; - lppVideoStreamer_->SetVideoSurface(sampleInfo_); - } - AVCODEC_SAMPLE_LOGD("SetSurface out"); - lock.unlock(); - return 0; -} - -int32_t Player::SetVolume(double volume) -{ - std::unique_lock lock(mutex_); - CHECK_AND_RETURN_RET_LOG(!Intercept(), AVCODEC_SAMPLE_ERR_ERROR, "Intercept nullptr."); - CHECK_AND_RETURN_RET_LOG(lppAudioStreamer_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "lppAudioStreamer_ nullptr."); - if (lppAudioStreamer_ != nullptr) { - lppAudioStreamer_->SetVolume(volume); - } - lock.unlock(); - return 0; -} - -// pause/flush/seek/resume -int32_t Player::Seek(int64_t seekTime, int32_t mode, bool acc) -{ - std::unique_lock seekLock(SeekMutex); - auto start = std::chrono::high_resolution_clock::now(); - CHECK_AND_RETURN_RET_LOG(!Intercept(), AVCODEC_SAMPLE_ERR_ERROR, "Intercept nullptr."); - lppContext_->position = -1; - if(sampleInfo_.duration(mode); - AVCODEC_SAMPLE_LOGI("OH_AVSeekMode %{public}d", mode); - int32_t aa = demuxer_->Seek(seekTime, enumNum); - if (aa != 0){ - AVCODEC_SAMPLE_LOGD("Seek failed."); - demuxer_->Seek(seekTime, SEEK_MODE_CLOSEST_SYNC); - } - // Seek后唤醒 - { - std::unique_lock eosFlagMutexLock(lppContext_->eosFlagMutex); - lppContext_->eosFlag_ = false; - lppContext_->returnFrame = false; - AVCODEC_SAMPLE_LOGI("AUDIO eosFlag_ %{public}d",lppContext_->eosFlag_); - lppContext_->eosCond_.notify_all(); - eosFlagMutexLock.unlock(); - } - { - std::unique_lock eosFlagMutexLock(lppVideoContext_->eosFlagMutex); - lppVideoContext_->eosFlag_ = false; - lppVideoContext_->returnFrame = false; - AVCODEC_SAMPLE_LOGI("VIDEO eosFlag_ %{public}d",lppContext_->eosFlag_); - lppVideoContext_->eosCond_.notify_all(); - eosFlagMutexLock.unlock(); - } - Flush(); - StartDecoder(); - StartRender(); - StartAudio(); - auto end = std::chrono::high_resolution_clock::now(); - auto duration = std::chrono::duration_cast(end - start).count(); - AVCODEC_SAMPLE_LOGI("seek duration %lld",duration); - return 0; -} - -int64_t Player::ReadToAudioTargetPts(int64_t targetPts) -{ - - OH_AVBuffer * avbuffer = OH_AVBuffer_Create(MAX_BUFFER_SIZE); - CodecBufferInfo bufferInfo(11, avbuffer); - while (true) - { - demuxer_->ReadSample(demuxer_->GetAudioTrackId(), reinterpret_cast(bufferInfo.buffer), - bufferInfo.attr); - if(targetPts<=bufferInfo.attr.pts) - { - break; - } - if(bufferInfo.attr.flags & AVCODEC_BUFFER_FLAGS_EOS){ - break; - } - } - AVCODEC_SAMPLE_LOGI("ReadToAudioTargetPts Last pts is %{public}ld",bufferInfo.attr.pts); - return bufferInfo.attr.pts; -} - -void Player::SeekInner(int64_t seekTime, int32_t mode) -{ - AVCODEC_SAMPLE_LOGI("============== Seek ACC IN ==============="); - int64_t targetPts = seekTime*1000; - AVCODEC_SAMPLE_LOGI("SetTargetStartFrame %{public}ld",targetPts); - //暂停 - Pause(); - { - std::unique_lock eosFlagMutexLock(lppContext_->eosFlagMutex); - lppContext_->eosFlag_ = false; - lppContext_->returnFrame = false; - AVCODEC_SAMPLE_LOGI("AUDIO eosFlag_ %{public}d",lppContext_->eosFlag_); - lppContext_->eosCond_.notify_all(); - eosFlagMutexLock.unlock(); - } - { - std::unique_lock eosFlagMutexLock(lppVideoContext_->eosFlagMutex); - lppVideoContext_->eosFlag_ = false; - lppVideoContext_->returnFrame = false; - AVCODEC_SAMPLE_LOGI("VIDEO eosFlag_ %{public}d",lppContext_->eosFlag_); - lppVideoContext_->eosCond_.notify_all(); - eosFlagMutexLock.unlock(); - } - Flush(); - demuxer_->Seek(seekTime, SEEK_MODE_PREVIOUS_SYNC); - //音频读取到对应帧 - ReadToAudioTargetPts(targetPts); - //给视频设置回调和TargetPts - if (lppVideoStreamer_ != nullptr) { - lppVideoStreamer_->SetTargetStartFrame(targetPts, LppCallback::OnTargetArrived, WAIT_OUT_TIME, lppVideoContext_); - StartDecoder(); - StartRender(); - } - //等待返回 - std::unique_lock lock(lppVideoContext_->seekMutex_); -// lppVideoContext_->seekCond_.wait_for(lock, 10000s, [this]() { return lppVideoContext_->seekReturn_; }); - usleep(50*1000); - lppVideoContext_->seekReturn_ = false; - lock.unlock(); - //返回成功,启动音频 - if (lppAudioStreamer_ != nullptr) { - lppAudioStreamer_->Start(); - } - AVCODEC_SAMPLE_LOGI("============== Seek ACC OUT ==============="); -} - -void Player::StartRelease() -{ - CHECK_AND_RETURN_LOG(!Intercept(), "Intercept nullptr."); - std::unique_lock lock(doneMutex); - if (!isReleased_) { - isReleased_ = true; - Release(); - } - lock.unlock(); -} - -int64_t Player::GetDurationTime() -{ - AVCODEC_SAMPLE_LOGD("GetDurationTime %{public}ld",sampleInfo_.duration); - return sampleInfo_.duration; -} - -int64_t Player::GetProgressTime() -{ - std::unique_lock seekLock(SeekMutex); - if(lppContext_ == nullptr || lppContext_->position == -1){ - return 0; - } - AVCODEC_SAMPLE_LOGD("GetProgressTime position %{public}ld",lppContext_->position); - int64_t tmp = sampleInfo_.duration/1000000 < (lppContext_->position / 1000) ? sampleInfo_.duration : ( (lppContext_->position /1000) * 1000000); - return tmp; -} - -void Player::ReleaseThread() -{ - if(lppContext_){ - std::unique_lock eosFlagMutexLock(lppContext_->eosFlagMutex); - lppContext_->eosFlag_ = false; - lppContext_->eosCond_.notify_all(); - eosFlagMutexLock.unlock(); - std::unique_lock lock(lppContext_->inputMutex); - lppContext_->returnFrame =true; - lppContext_->inputCond.notify_all(); - lock.unlock(); - } - - if(lppVideoContext_){ - std::unique_lock eosFlagMutexLock(lppVideoContext_->eosFlagMutex); - lppVideoContext_->eosFlag_ = false; - lppVideoContext_->eosCond_.notify_all(); - eosFlagMutexLock.unlock(); - std::unique_lock lockVideo(lppVideoContext_->inputMutex); - lppVideoContext_->returnFrame = true; - lppVideoContext_->inputCond.notify_all(); - lockVideo.unlock(); - } - - if (LppDataNeededThread_ && LppDataNeededThread_->joinable()) { - LppDataNeededThread_->join(); - LppDataNeededThread_.reset(); - } - if (lppVideoDataNeededThread_ && lppVideoDataNeededThread_->joinable()) { - lppVideoDataNeededThread_->join(); - lppVideoDataNeededThread_.reset(); - } -} - -void Player::Release() -{ - std::lock_guard lock(mutex_); - isStarted_ = false; - isAudioDone = false; - isVideoDone = false; - ReleaseThread(); - if (demuxer_ != nullptr) { - demuxer_->Release(); - demuxer_.reset(); - } - if (lppAudioStreamer_ != nullptr) { - lppAudioStreamer_->Release(); - lppAudioStreamer_.reset(); - } - if (lppContext_ != nullptr) { - delete lppContext_; - lppContext_ = nullptr; - } - if (lppVideoStreamer_ != nullptr) { - lppVideoStreamer_->Release(); - lppVideoStreamer_.reset(); - } - if (lppVideoContext_ != nullptr) { - delete lppVideoContext_; - lppVideoContext_ = nullptr; - } - doneCond_.notify_all(); - // 触发回调 - if(sampleInfo_.playDoneCallback != nullptr){ - sampleInfo_.playDoneCallback(sampleInfo_.playDoneCallbackData); - } - AVCODEC_SAMPLE_LOGI("Succeed"); -} - -void Player::LppDataNeededThread1() -{ - int32_t total_size = 4467270; - AVCODEC_SAMPLE_LOGI("====== AVBUFFER1234 CREATE ======"); - OH_AVBuffer * avbuffer = OH_AVBuffer_Create(total_size); - while (true) { - CHECK_AND_BREAK_LOG(isStarted_, "Decoder input thread out"); - // 到达EOS帧后不再送数据,直到Seek - std::unique_lock eosLock(lppContext_->eosMutex); - lppContext_->eosCond_.wait_for( - eosLock, 150000s, [this]() { return !lppContext_->eosFlag_; }); - eosLock.unlock(); - // 等待数据回调到达 - std::unique_lock lock(lppContext_->inputMutex); - lppContext_->inputCond.wait_for( - lock, 150000s, [this]() { return lppContext_->returnFrame; }); - lppContext_->returnFrame = false; - - CHECK_AND_BREAK_LOG(isStarted_, "VD Decoder output thread out"); - - lppContext_->count = 1; - // 聚包数量 - int count = AUDIO_FRAME_COUNT; - while (count>0) - { - CHECK_AND_BREAK_LOG(!lppContext_->eosFlag_, "AUDIO is EOS"); - count--; - CodecBufferInfo bufferInfo(11, avbuffer); - demuxer_->ReadSample(demuxer_->GetAudioTrackId(), reinterpret_cast(bufferInfo.buffer), - bufferInfo.attr); - this->progress = bufferInfo.attr.pts; - int32_t remain = OH_AVSamplesBuffer_GetRemainedCapacity(lppContext_->framePacket_); - AVCODEC_SAMPLE_LOGD("AUDIO pts %{public}ld",bufferInfo.attr.pts); - // EOS帧置位 - if ((bufferInfo.attr.flags & AVCODEC_BUFFER_FLAGS_EOS)){ - AVCODEC_SAMPLE_LOGI("Catch EOS, audio thread out"); - OH_AVBuffer_SetBufferAttr(reinterpret_cast(bufferInfo.buffer), &bufferInfo.attr); - std::unique_lock eosFlagMutexLock(lppContext_->eosFlagMutex); - lppContext_->eosFlag_ = true; - eosFlagMutexLock.unlock(); - } - OH_AVSamplesBuffer_AppendOneBuffer(lppContext_->framePacket_, reinterpret_cast(bufferInfo.buffer)); - } - if(count == AUDIO_FRAME_COUNT){ - continue; - } - if(state_ == PLAYING){ - lppAudioStreamer_->returnFrames(lppContext_); - } - // 一次回调处理完再下一次 - lock.unlock(); - } - AVCODEC_SAMPLE_LOGI("====== AVBUFFER DESTROY ======"); - OH_AVBuffer_Destroy(avbuffer); -} - -void Player::LppVideoDataNeededThread() -{ - bool eosFlag = 0; - int32_t total_size = 4467270; - AVCODEC_SAMPLE_LOGI("====== AVBUFFER1234 CREATE1 ======"); - OH_AVBuffer * avbuffer = OH_AVBuffer_Create(total_size); - while (true) { - CHECK_AND_BREAK_LOG(isStarted_, "Decoder input thread out"); - - std::unique_lock eosLock(lppVideoContext_->eosMutex); - lppVideoContext_->eosCond_.wait_for( - eosLock, 150000s, [this]() { return !lppVideoContext_->eosFlag_; }); - - std::unique_lock lock(lppVideoContext_->inputMutex); - lppVideoContext_->inputCond.wait_for( - lock, 150000s, [this]() { return lppVideoContext_->returnFrame; }); - CHECK_AND_BREAK_LOG(isStarted_, "VD Decoder output thread out"); - lppVideoContext_->returnFrame = false; - CHECK_AND_BREAK_LOG(isStarted_, "Work done, thread out"); - - - lppVideoContext_->count = VIDEO_FRAME_COUNT; - AVCODEC_SAMPLE_LOGI("LppVideoDataNeededThread count %{public}d", lppVideoContext_->count); - while (lppVideoContext_->count>0) - { - CHECK_AND_BREAK_LOG(!lppVideoContext_->eosFlag_, "VIDEO is EOS"); - CodecBufferInfo bufferInfo(11, avbuffer); - if(seekFlag_){ - seekFlag_ = false; - bufferInfo = videoBufferInfo_.front(); - videoBufferInfo_.pop(); - } - else{ - demuxer_->ReadSample(demuxer_->GetVideoTrackId(), reinterpret_cast(bufferInfo.buffer), - bufferInfo.attr); - } - AVCODEC_SAMPLE_LOGI("LppVideoDataNeededThread size %{public}d",bufferInfo.attr.size); - AVCODEC_SAMPLE_LOGI("LppVideoDataNeededThread ptsacc %{public}ld",bufferInfo.attr.pts); - AVCODEC_SAMPLE_LOGI("LppVideoDataNeededThread isIFrame %u",bufferInfo.attr.flags & AVCODEC_BUFFER_FLAGS_SYNC_FRAME); - int32_t remain = OH_AVSamplesBuffer_GetRemainedCapacity(lppVideoContext_->framePacket_); - if ((bufferInfo.attr.flags & AVCODEC_BUFFER_FLAGS_EOS)){ - AVCODEC_SAMPLE_LOGI("Catch EOS, video thread out"); - OH_AVBuffer_SetBufferAttr(reinterpret_cast(bufferInfo.buffer), &bufferInfo.attr); - std::unique_lock eosFlagMutexLock(lppVideoContext_->eosFlagMutex); - lppVideoContext_->eosFlag_ = true; - AVCODEC_SAMPLE_LOGI("VIDEO eosFlag_ %{public}d",lppContext_->eosFlag_); - eosFlagMutexLock.unlock(); - } - OH_AVSamplesBuffer_AppendOneBuffer(lppVideoContext_->framePacket_, reinterpret_cast(bufferInfo.buffer)); - lppVideoContext_->count--; - AVCODEC_SAMPLE_LOGI("LppVideoDataNeededThread count %{public}d", lppVideoContext_->count); - } - AVCODEC_SAMPLE_LOGI("LppVideoDataNeededThread count %{public}d", lppVideoContext_->count); - if(lppVideoContext_->count == VIDEO_FRAME_COUNT){ - continue; - } - if(state_ == PLAYING){ - lppVideoStreamer_->returnFrames(lppVideoContext_); - } - AVCODEC_SAMPLE_LOGD("LppVideoDataNeededThread returnFrames end"); - lock.unlock(); - } - AVCODEC_SAMPLE_LOGI("====== AVBUFFER1234 DESTROY1 ======"); - OH_AVBuffer_Destroy(avbuffer); -} - diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/Player.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/Player.h deleted file mode 100644 index 1400c29986f9c94da5769ef01f41d11341a6cae4..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/Player.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - */ -/* - * 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. - */ - -#ifndef VIDEO_CODEC_PLAYER_H -#define VIDEO_CODEC_PLAYER_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lpp_audio_streamer.h" -#include "lpp_video_streamer.h" -#include "multimedia/player_framework/native_avbuffer.h" -#include "demuxer.h" -#include "sample_info.h" -#include "plugin_manager.h" -enum AVSinkState { - IDLE, - INIT, - PREPARED, - PLAYING, - PAUSE, - STOP, -}; -class Player { -public: - Player(){}; - ~Player(); - - static Player& GetInstance() - { - static Player player; - return player; - } - - int32_t Init(SampleInfo &sampleInfo); - int32_t Stop(); - int32_t Reset(); - int32_t Pause(); - int32_t Resume(); - int32_t SetSpeed(double speed); - int32_t SetSurface(int64_t surfaceId); - int32_t SetVolume(double volume); - int32_t Flush(); - int32_t Seek(int64_t seekTime, int32_t mode, bool acc); - int32_t Prepare(); - int32_t StartDecoder(); - int32_t RenderFirstFrame(); - int32_t StartRender(); - int32_t StartAudio(); - void Release(); - void StartRelease(); - int64_t GetDurationTime(); - int64_t GetProgressTime(); - -private: - void LppDataNeededThread1(); - void LppVideoDataNeededThread(); - void SeekInner(int64_t seekTime, int32_t mode); - void ReleaseThread(); - int32_t CreateLppAudioStreamer(); - int32_t CreateLppVideoStreamer(); - bool Intercept(); - - int64_t ReadToAudioTargetPts(int64_t pts); - - std::shared_ptr lppAudioStreamer_ = nullptr; - std::shared_ptr lppVideoStreamer_ = nullptr; - std::unique_ptr demuxer_ = nullptr; - - std::mutex mutex_; - std::atomic isStarted_ { false }; - std::atomic isReleased_ { false }; - std::atomic isAudioDone { false }; - std::atomic isVideoDone { false }; - std::condition_variable doneCond_; - std::mutex doneMutex; - SampleInfo sampleInfo_; - - LppUserData *lppContext_ = nullptr; - // 等回调消费数据 - std::unique_ptr LppDataNeededThread_ = nullptr; - // 生产数据,Max - std::unique_ptr LppDataProducerThread_ = nullptr; - - LppUserData *lppVideoContext_ = nullptr; - std::unique_ptr lppVideoDataNeededThread_ = nullptr; - std::unique_ptr lppSeekThread_ = nullptr; - - int64_t progress = 0; - int64_t nowTimeStamp = 0; - int64_t audioTimeStamp = 0; - int64_t writtenSampleCnt = 0; - int64_t audioBufferPts = 0; - std::mutex SeekMutex; - OH_AVBuffer *audioBuffer_ = nullptr; - OH_AVBuffer *videoBuffer_ = nullptr; - std::queue videoBufferInfo_; - bool seekFlag_ = false; - AVSinkState state_ = IDLE; - static constexpr int64_t MICROSECOND_TO_S = 1000000; - static constexpr int64_t NANO_TO_S = 1000000000; -}; - -#endif // VIDEO_CODEC_PLAYER_H \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/PlayerNative.cpp b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/PlayerNative.cpp deleted file mode 100644 index 3ac41d075b0534c225808a3440cf6c0700569402..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/PlayerNative.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved. - */ -/* - * Copyright (C) 2025 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. - */ - -#include "PlayerNative.h" -#include - -#undef LOG_DOMAIN -#undef LOG_TAG -#define LOG_DOMAIN 0xFF00 -#define LOG_TAG "playerNative" - -struct CallbackContext { - napi_env env = nullptr; - napi_ref callbackRef = nullptr; -}; - -void Callback(void *asyncContext) -{ - uv_loop_s *loop = nullptr; - CallbackContext *context = (CallbackContext *)asyncContext; - napi_get_uv_event_loop(context->env, &loop); - uv_work_t *work = new uv_work_t; - work->data = context; - uv_queue_work( - loop, work, [](uv_work_t *work) {}, - [](uv_work_t *work, int status) { - CallbackContext *context = (CallbackContext *)work->data; - napi_handle_scope scope = nullptr; - // 管理 napi_value 的生命周期,防止内存泄露 - napi_open_handle_scope(context->env, &scope); - napi_value callback = nullptr; - napi_get_reference_value(context->env, context->callbackRef, &callback); - // 回调至UI侧 - napi_call_function(context->env, nullptr, callback, 0, nullptr, nullptr); - napi_close_handle_scope(context->env, scope); - delete work; - }); -} - -napi_value PlayerNative::Play(napi_env env, napi_callback_info info) -{ - SampleInfo sampleInfo; - size_t argc = 5; // 参数个数,这里ArkTS往native测传递了两个参数,故此处赋值为4 - napi_value args[5] = {nullptr}; // napi_value类型数组,用于存储接收的ArkTS侧参数 - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); // 从info中获取参数信息到参数数组args[] - - int32_t two = 2; - int32_t three = 3; - napi_get_value_int32(env, args[0], &sampleInfo.inputFd); - napi_get_value_int64(env, args[1], &sampleInfo.inputFileOffset); - napi_get_value_int64(env, args[two], &sampleInfo.inputFileSize); - - AVCODEC_SAMPLE_LOGI("inputFilePath %{public}s",sampleInfo.inputFilePath.c_str()); - AVCODEC_SAMPLE_LOGI("inputFilePath %{public}ld",sampleInfo.inputFileSize); - - auto asyncContext = new CallbackContext(); - asyncContext->env = env; - napi_create_reference(env, args[three], 1, &asyncContext->callbackRef); - - sampleInfo.playDoneCallback = &Callback; - sampleInfo.playDoneCallbackData = asyncContext; - auto asyncContextB = new CallbackContext(); - asyncContextB->env = env; - napi_create_reference(env, args[4], 1, &asyncContextB->callbackRef); - sampleInfo.audioCallback = &Callback; - sampleInfo.audioCallbackData = asyncContextB; - int32_t ret = Player::GetInstance().Init(sampleInfo); - return nullptr; -} - -napi_value PlayerNative::Stop(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGD("NativeStop"); - Player::GetInstance().Stop(); - AVCODEC_SAMPLE_LOGD("NativeStop1"); - return nullptr; -} - -napi_value PlayerNative::Release(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGD("NativeRelease in"); - Player::GetInstance().StartRelease(); - AVCODEC_SAMPLE_LOGD("NativeRelease out"); - return nullptr; -} - -napi_value PlayerNative::Reset(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGD("resetNative in"); - Player::GetInstance().Reset(); - AVCODEC_SAMPLE_LOGD("resetNative out"); - return nullptr; -} - -napi_value PlayerNative::Pause(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGD("PauseNative in"); - Player::GetInstance().Pause(); - AVCODEC_SAMPLE_LOGD("PauseNative out"); - return nullptr; -} - -napi_value PlayerNative::Resume(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGD("ResumeNative in"); - Player::GetInstance().Resume(); - AVCODEC_SAMPLE_LOGD("ResumeNative out"); - return nullptr; -} - -napi_value PlayerNative::Speed(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - double speed = 1.0; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - napi_get_value_double(env, args[0], &speed); - AVCODEC_SAMPLE_LOGD("ResumeNative in"); - Player::GetInstance().SetSpeed(speed); - AVCODEC_SAMPLE_LOGD("ResumeNative out"); - return nullptr; -} - -napi_value PlayerNative::SetSurface(napi_env env, napi_callback_info info) -{ - size_t argc = 1; - napi_value args[1] = {nullptr}; - char surfaceId[30] = ""; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - napi_get_value_string_utf8(env, args[0], surfaceId, 30, 0); - char* endptr; - int64_t value = std::strtoll(surfaceId, &endptr, 10); - AVCODEC_SAMPLE_LOGD("SetSurface In %{public}ld %{public}s", value, surfaceId); - Player::GetInstance().SetSurface(value); - AVCODEC_SAMPLE_LOGD("SetSurface out"); - return nullptr; -} - -napi_value PlayerNative::Seek(napi_env env, napi_callback_info info) -{ - int32_t seekTime = 0; - int32_t mode = 0; - bool acc = false; - size_t seekArgc = 3; // 参数个数,这里ArkTS往native测传递了两个参数,故此处赋值为4 - napi_value seekArgs[3] = {nullptr}; // napi_value类型数组,用于存储接收的ArkTS侧参数 - napi_get_cb_info(env, info, &seekArgc, seekArgs, nullptr, nullptr); // 从info中获取参数信息到参数数组args[] - napi_get_value_int32(env, seekArgs[0], &seekTime); - napi_get_value_int32(env, seekArgs[1], &mode); - napi_get_value_bool(env, seekArgs[0], &acc); - AVCODEC_SAMPLE_LOGI("Seek in"); - Player::GetInstance().Seek(seekTime, mode, acc); - AVCODEC_SAMPLE_LOGI("Seek out"); - return nullptr; -} - -napi_value PlayerNative::Prepare(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGI("Prepare in"); - napi_value result; - int32_t ret = Player::GetInstance().Prepare(); - napi_create_int32(env, ret, &result); - AVCODEC_SAMPLE_LOGI("Prepare out"); - return result; -} - -napi_value PlayerNative::StartDecoder(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGI("StartDecoder in"); - Player::GetInstance().StartDecoder(); - AVCODEC_SAMPLE_LOGI("StartDecoder out"); - return nullptr; -} -napi_value PlayerNative::RenderFirstFrame(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGI("RenderFirstFrame in"); - Player::GetInstance().RenderFirstFrame(); - AVCODEC_SAMPLE_LOGI("RenderFirstFrame out"); - return nullptr; -} -napi_value PlayerNative::StartRender(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGI("StartRender in"); - Player::GetInstance().StartRender(); - AVCODEC_SAMPLE_LOGI("StartRender out"); - return nullptr; -} -napi_value PlayerNative::StartAudio(napi_env env, napi_callback_info info) -{ - AVCODEC_SAMPLE_LOGI("StartAudio in"); - Player::GetInstance().StartAudio(); - AVCODEC_SAMPLE_LOGI("StartAudio out"); - return nullptr; -} - -napi_value PlayerNative::GetDurationTime(napi_env env, napi_callback_info info) { - napi_value result; - int64_t duration = Player::GetInstance().GetDurationTime(); - napi_create_int64(env, duration, &result); - return result; -} - -napi_value PlayerNative::GetProgressTime(napi_env env, napi_callback_info info) { - napi_value result; - int64_t progress = Player::GetInstance().GetProgressTime(); - napi_create_int64(env, progress, &result); - return result; -} - -napi_value PlayerNative::SetVolume(napi_env env, napi_callback_info info) { - size_t argc = 1; - napi_value args[1] = {nullptr}; - double volume = 0; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - napi_get_value_double(env, args[0], &volume); - AVCODEC_SAMPLE_LOGD("SetVolume in"); - Player::GetInstance().SetVolume(volume); - AVCODEC_SAMPLE_LOGD("SetVolume out"); - return nullptr; -} -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) { - napi_property_descriptor classProp[] = { - {"playNative", nullptr, PlayerNative::Play, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"stopNative", nullptr, PlayerNative::Stop, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"releaseNative", nullptr, PlayerNative::Release, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"resetNative", nullptr, PlayerNative::Reset, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"pauseNative", nullptr, PlayerNative::Pause, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"resumeNative", nullptr, PlayerNative::Resume, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"speedNative", nullptr, PlayerNative::Speed, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setSurfaceNative", nullptr, PlayerNative::SetSurface, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"seekNative", nullptr, PlayerNative::Seek, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"getDurationTime", nullptr, PlayerNative::GetDurationTime, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"getProgressTime", nullptr, PlayerNative::GetProgressTime, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"prepareNative", nullptr, PlayerNative::Prepare, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"startDecoderNative", nullptr, PlayerNative::StartDecoder, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"renderFirstFrameNative", nullptr, PlayerNative::RenderFirstFrame, nullptr, nullptr, nullptr, napi_default, - nullptr}, - {"startRenderNative", nullptr, PlayerNative::StartRender, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"startAudioNative", nullptr, PlayerNative::StartAudio, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"setVolumeNative", nullptr, PlayerNative::SetVolume, nullptr, nullptr, nullptr, napi_default, nullptr}, - }; - - NativeXComponentSample::PluginManager::GetInstance()->Export(env, exports); - napi_define_properties(env, exports, sizeof(classProp) / sizeof(classProp[0]), classProp); - return exports; -} -EXTERN_C_END - -static napi_module PlayerModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "player", - .nm_priv = ((void *)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterPlayerModule(void) -{ - napi_module_register(&PlayerModule); -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/PlayerNative.h b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/PlayerNative.h deleted file mode 100644 index eb007684aa5a756cf19ca11e3206517f97bd046d..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/sample/player/PlayerNative.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved. - */ -/* - * 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. - */ - -#ifndef LPP_SAMPLE_PLAYER_NATIVE_H -#define LPP_SAMPLE_PLAYER_NATIVE_H - -#include -#include -#include -#include -#include "napi/native_api.h" -#include "Player.h" -#include "dfx/error/av_codec_sample_error.h" -#include "av_codec_sample_log.h" -#include "plugin_manager.h" - -class PlayerNative { -public: - static napi_value Play(napi_env env, napi_callback_info info); - static napi_value Stop(napi_env env, napi_callback_info info); - static napi_value Release(napi_env env, napi_callback_info info); - static napi_value Reset(napi_env env, napi_callback_info info); - static napi_value Pause(napi_env env, napi_callback_info info); - static napi_value Resume(napi_env env, napi_callback_info info); - static napi_value Speed(napi_env env, napi_callback_info info); - static napi_value SetSurface(napi_env env, napi_callback_info info); - static napi_value Seek(napi_env env, napi_callback_info info); - static napi_value SetVolume(napi_env env, napi_callback_info info); - static napi_value Prepare(napi_env env, napi_callback_info info); - static napi_value StartDecoder(napi_env env, napi_callback_info info); - static napi_value RenderFirstFrame(napi_env env, napi_callback_info info); - static napi_value StartRender(napi_env env, napi_callback_info info); - static napi_value StartAudio(napi_env env, napi_callback_info info); - static napi_value GetDurationTime(napi_env env, napi_callback_info info); - static napi_value GetProgressTime(napi_env env, napi_callback_info info); -}; -#endif // LPP_SAMPLE_PLAYER_NATIVE_H \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/types/libplayer/index.d.ts b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/types/libplayer/index.d.ts deleted file mode 100644 index 93c4d627eed4830943fb4905d14e129c677ab140..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/types/libplayer/index.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -export const playNative: ( - inputFileFd: number, - inputFileOffset: number, - inputFileSize: number, - cbFn: () => void, - audioCbFn: () => void -) => void; - -export const stopNative: () => void - -export const releaseNative: () => void - -export const resetNative: () => void - -export const pauseNative: () => void - -export const resumeNative: () => void - -export const speedNative: ( - speed: number -) => void - -export const setSurfaceNative: ( - surfaceId: string -) => void - -export const seekNative: ( - seekTime: number, - mode: number, - acc: boolean, -) => void - -export const setVolumeNative: ( - volume: number, -) => void - -export const getDurationTime: ( -) => number - -export const getProgressTime: ( -) => number - -export const startNative: () => void - -export const prepareNative: () => number - -export const startDecoderNative: () => void - -export const renderFirstFrameNative: () => void - -export const startRenderNative: () => void - -export const startAudioNative: () => void - - - - diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/types/libplayer/oh-package.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/types/libplayer/oh-package.json5 deleted file mode 100644 index 31f8de6b1f5a2dd14e1514cba2ad0a50f8b44a80..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/cpp/types/libplayer/oh-package.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "libplayer.so", - "types": "./index.d.ts", - "version": "1.0.0", - "decription": "Player interface." -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/common/CommonConstants.ets b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/common/CommonConstants.ets deleted file mode 100644 index 6fa05947281e73436f8ab7cf2203f8dc263d46d4..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/common/CommonConstants.ets +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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 { camera } from '@kit.CameraKit'; - -export class CommonConstants { - /** - * Full size. - */ - static readonly FULL_SIZE: string = '100%' - /** - * Default width. - */ - static readonly DEFAULT_WIDTH: number = 1920 - /** - * Default height. - */ - static readonly DEFAULT_HEIGHT: number = 1080 - /** - * Button width. - */ - static readonly BUTTON_WIDTH: number = 100 - /** - * Duration. - */ - static readonly DURATION: number = 2000 - /** - * The distance between toast dialog box and the bottom of screen. - */ - static readonly BOTTOM: number = 200 - /** - * Image width. - */ - static readonly IMAGE_WIDTH: number = 50 - /** - * Image height. - */ - static readonly IMAGE_HEIGHT: number = 50 - /** - * Video mime type. - */ - static readonly VIDEO_MIMETYPE: string[] = ['HDRVivid', 'H264', 'H265'] - /** - * Video resolution. - */ - static readonly VIDEO_RESOLUTION: string[] = ['4K', '1080P', '720P'] - /** - * Video framerate. - */ - static readonly VIDEO_FRAMERATE: string[] = ['30Fps', '60Fps'] - /** - * Video recorderInfo. - */ - static readonly RECORDER_INFO: string[][] = [ - CommonConstants.VIDEO_MIMETYPE, CommonConstants.VIDEO_RESOLUTION, CommonConstants.VIDEO_FRAMERATE - ] - /** - * Default value. - */ - static readonly DEFAULT_VALUE: number = 0 - /** - * Video avc mime type. - */ - static readonly MIME_VIDEO_AVC: string = 'video/avc' - /** - * Video hevc mime type. - */ - static readonly MIME_VIDEO_HEVC: string = 'video/hevc' - /** - * 10M bitrate. - */ - static readonly BITRATE_VIDEO_10M: number = 10 * 1024 * 1024 - /** - * 20M bitrate. - */ - static readonly BITRATE_VIDEO_20M: number = 20 * 1024 * 1024 - /** - * 30M bitrate. - */ - static readonly BITRATE_VIDEO_30M: number = 30 * 1024 * 1024 - /** - * 30 FPS. - */ - static readonly FRAMERATE_VIDEO_30FPS: number = 30 - /** - * 60 FPS. - */ - static readonly FRAMERATE_VIDEO_60FPS: number = 60 - /** - * Row space. - */ - static readonly ROW_SPACE: number = 10 - /** - * Default picker item height. - */ - static readonly DEFAULT_PICKER_ITEM_HEIGHT: number = 30 - /** - * Selected text style font size. - */ - static readonly SELECTED_TEXT_STYLE_FONT_SIZE: number = 15 - /** - * The number corresponding to true. - */ - static readonly TRUE: number = 1 - /** - * The number corresponding to false. - */ - static readonly FALSE: number = 0 - /** - * 4K video width. - */ - static readonly VIDEO_WIDTH_4K: number = 3840 - /** - * 1080P video width. - */ - static readonly VIDEO_WIDTH_1080P: number = 1920 - /** - * 720P video width. - */ - static readonly VIDEO_WIDTH_720P: number = 1280 - /** - * 4K video height. - */ - static readonly VIDEO_HEIGHT_4K: number = 2160 - /** - * 1080P video height. - */ - static readonly VIDEO_HEIGHT_1080P: number = 1080 - /** - * 720P video height. - */ - static readonly VIDEO_HEIGHT_720P: number = 720 - /** - * Album, photo, video, and camera switch icons size. - */ - static readonly ICON_SIZE: number = 200; - /** - * Bottom position. - */ - static readonly BOTTOM_POSITION: number = 0.8 - /** - * PX. - */ - static readonly PX: string = 'px'; - /** - * Default profile. - */ - static readonly DEFAULT_PROFILE: camera.Profile = { - format: camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP, - size: { - width: 1920, - height: 1080 - } - }; -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/common/utils/DateTimeUtils.ets b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/common/utils/DateTimeUtils.ets deleted file mode 100644 index 2f0a95d6c5db9557371c5beb8ce6e8b4a9d427ef..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/common/utils/DateTimeUtils.ets +++ /dev/null @@ -1,55 +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. - */ - -export default class DateTimeUtil { - getTime(): string { - const DATETIME = new Date(); - return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()) - } - - getDate(): string { - const DATETIME = new Date(); - return this.concatDate(DATETIME.getFullYear(), DATETIME.getMonth() + 1, DATETIME.getDate()) - } - - fill(value: number): string { - return (value > 9 ? '' : '0') + value; - } - - concatDate(year: number, month: number, date: number): string { - return `${year}${month}${date}`; - } - - concatTime(hour: number, minute: number, second: number): string { - return `${this.fill(hour)}${this.fill(minute)}${this.fill(second)}`; - } -} - -export function getShownTimer(ms: number): string { - let seconds: number = Math.round(ms / 1000); - let sec: number = seconds % 60; - let min: number = (seconds - sec) / 60; - let secStr = (sec >= 0 && sec < 10) ? ('0' + sec) : sec; - let minStr = (min >= 0 && min < 10) ? ('0' + min) : min; - return (minStr + ':' + secStr); -} - -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 - let s = second < 10 ? '0' + second : second - return m + ':' + s; -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/common/utils/Logger.ets b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/common/utils/Logger.ets deleted file mode 100644 index 149765ff21ecd016d6bc3e7da1b632e1906fa543..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/common/utils/Logger.ets +++ /dev/null @@ -1,45 +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. - */ - -import hilog from '@ohos.hilog' - -class Logger { - private domain: number - private prefix: string - private format: string = '%{public}s, %{public}s' - - constructor(prefix: string) { - this.prefix = prefix - this.domain = 0xFF00 - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args) - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args) - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args) - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args) - } -} - -export default new Logger('AVRecorderSample') \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/entryability/EntryAbility.ets b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6d32df7f25b0139349469f9dc403e1f0d56eebb6..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,95 +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. - */ - -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit' -import { BusinessError } from '@kit.BasicServicesKit' -import { window } from '@kit.ArkUI' -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import Logger from '../common/utils/Logger' -import { hilog } from '@kit.PerformanceAnalysisKit' - -const TAG: string = 'EntryAbility' - -function requestPre() { - let atManager = abilityAccessCtrl.createAtManager() - try { - atManager.requestPermissionsFromUser(globalThis.context, - ['ohos.permission.CAMERA',]) - .then((data) => { - Logger.info("requestPre() data: " + JSON.stringify(data)) - }).catch((err:BusinessError) => { - Logger.info("requestPre() data: " + JSON.stringify(err)) - }) - } catch (err) { - Logger.error("requestPre() data: " + JSON.stringify(err)) - } -} - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { - Logger.info('Ability onCreate') - globalThis.context = this.context - requestPre() - } - - onDestroy() { - Logger.info('Ability onDestroy') - } - - onWindowStageCreate(windowStage: window.WindowStage) { - // Main window is created, set main page for this ability - Logger.info('Ability onWindowStageCreate') - - windowStage.getMainWindowSync().setWindowKeepScreenOn(true) - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - Logger.error('Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '') - return - } - Logger.info('Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '') - }) - let windowClass: window.Window = windowStage.getMainWindowSync() // 获取应用主窗口 - // Set the window to full screen - let isLayoutFullScreen = true - windowClass.setWindowLayoutFullScreen(isLayoutFullScreen) - .then(() => { - hilog.info(0x0000, TAG, 'Succeeded in setting the window layout to full-screen mode. Data: %{public}s') - }) - .catch((err: BusinessError) => { - hilog.error(0x0000, TAG, 'Failed to set the window layout to full-screen mode. Cause: %{public}s', - JSON.stringify(err) ?? '') - }) - // Set the font color of the status bar. - let SystemBarProperties: window.SystemBarProperties = { - statusBarContentColor: '#FFFFFF' - } - windowStage.getMainWindowSync().setWindowSystemBarProperties(SystemBarProperties) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - Logger.info('Ability onWindowStageDestroy') - } - - onForeground() { - // Ability has brought to foreground - Logger.info('Ability onForeground') - } - - onBackground() { - // Ability has back to background - Logger.info('Ability onBackground') - } -} diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/pages/Index.ets b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 3b3bf57fa7220af781688a81d97e8f50aa56e30c..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,685 +0,0 @@ -import { fileIo } from '@kit.CoreFileKit'; -import { display, promptAction, router, window } from '@kit.ArkUI'; -import { photoAccessHelper } from '@kit.MediaLibraryKit'; -import player from 'libplayer.so'; -import Logger from '../common/utils/Logger'; -import { CommonConstants as Const } from '../common/CommonConstants'; -import picker from '@ohos.file.picker' -import { common } from '@kit.AbilityKit'; - -const TAG: string = 'Sample_Player' -const PLAY_STATUS = ['initial', 'selected', 'prepared', 'ready', 'playing', 'pausing'] - - -@Entry -@Component -export struct Player { - private surfaceId1: string = ''; - private surfaceId2: string = ''; - @StorageProp('topRectHeight') - topRectHeight: number = 0; - @State duration:string = '--:--:--' - @State progress:string = '--:--:--' - @State progressBarNumber:number = 0; - @State surfaceWidth:string = "100%" - @State surfaceHeight:string = "400" - @State speedMode:number = 1.0; - @State playStatus:string = 'initial'; - @State isPausing:boolean = false; - @State xComponentStatus:Visibility = Visibility.Visible; - @State controlStatus:Visibility = Visibility.Hidden; - @State surfaceId:string = "1"; - private intervalId:number = -1; - private showIntervalId:number = -1; - private selectFilePath: string | null = null; - private sourcePath: string[] = ['从文件管理选取', '从图库选取'] - private durationTime:number = 0; - private progressTime:number = 0; - private volume:number = 100; - private touchX:number = -1; - private seekMode:number = 0; - private xComponentController: XComponentController = new XComponentController(); - private xComponentController2: XComponentController = new XComponentController(); - private scroller = new Scroller() - private operationRet:number = 0; - private seekFlag:number = 0; - private context = getContext(this) as common.AbilityStageContext; - - selectFile() { - TextPickerDialog.show({ - range: this.sourcePath, - canLoop: false, - selected: 0, - onAccept: (value: TextPickerResult) => { - clearInterval(this.intervalId); - switch (value.value) { - case '从文件管理选取': - this.selectDocFile() - break - case '从图库选取': - this.selectAlbumFile() - break - default: - this.selectAlbumFile() - break - } - } - }) - } - - selectDocFile() { - let documentSelectOptions = new picker.DocumentSelectOptions - let documentViewPicker = new picker.DocumentViewPicker - documentViewPicker.select(documentSelectOptions) - .then((documentSelectResult) => { - this.selectFilePath = documentSelectResult[0] - if (this.selectFilePath == null) { - promptAction.showToast({ - message: $r('app.string.alert'), - duration: Const.DURATION, - bottom: Const.BOTTOM - }); - } else { - this.play(); - Logger.info(TAG, 'documentViewPicker.select to file succeed and URI is:' + this.selectFilePath); - } - }) - } - - selectAlbumFile() { - let photoPicker = new photoAccessHelper.PhotoViewPicker(); - photoPicker.select({ - MIMEType: photoAccessHelper.PhotoViewMIMETypes.VIDEO_TYPE, - maxSelectNumber: 1 - }) - .then((photoSelectResult) => { - this.selectFilePath = photoSelectResult.photoUris[0]; - if (this.selectFilePath == null) { - promptAction.showToast({ - message: $r('app.string.alert'), - duration: Const.DURATION, - bottom: Const.BOTTOM - }); - } else { - this.play(); - Logger.info(TAG, 'documentViewPicker.select to file succeed and URI is:' + this.selectFilePath); - } - }) - } - - formatDuration(durationInMicroseconds: number): string { - const totalSeconds = Math.floor(durationInMicroseconds / 1000000); - const hours = Math.floor(totalSeconds / 3600); - const minutes = Math.floor((totalSeconds % 3600) / 60); - const seconds = totalSeconds % 60; - return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`; - } - - - play() { - let inputFile = fileIo.openSync(this.selectFilePath, fileIo.OpenMode.READ_ONLY); - if (!inputFile) { - Logger.error(TAG, 'player inputFile is null'); - } - let inputFileState = fileIo.statSync(inputFile.fd); - if (inputFileState.size <= 0) { - Logger.error(TAG, 'player inputFile size is 0'); - } - player.playNative(inputFile.fd, Const.DEFAULT_VALUE, inputFileState.size, - () => { - Logger.info(TAG, 'player JSCallback'); - fileIo.close(inputFile); - }, - () => { - Logger.info(TAG, 'audio JSCallback'); - player.pauseNative(); - this.playStatus = 'pausing'; - }) - this.playStatus = 'selected'; - } - - playTest() { - let filesDir = this.context.resourceDir; - Logger.info(TAG, 'documentViewPicker.select to file succeed and URI is2:' + filesDir); - let inputFile = fileIo.openSync(filesDir+"/fuzztest.mp4", fileIo.OpenMode.READ_ONLY); - Logger.info(TAG, 'documentViewPicker.select to file succeed and URI is2:' + inputFile); - if (!inputFile) { - return; - } - let inputFileState = fileIo.statSync(inputFile.fd); - if (inputFileState.size <= 0) { - return; - } - player.playNative(inputFile.fd, Const.DEFAULT_VALUE, inputFileState.size, - () => { - Logger.info(TAG, 'player JSCallback'); - fileIo.close(inputFile); - }, - () => { - Logger.info(TAG, 'audio JSCallback'); - player.pauseNative(); - this.playStatus = 'pausing'; - }) - player.prepareNative(); - player.startDecoderNative(); - setTimeout(() => { - player.renderFirstFrameNative(); - player.startRenderNative(); - player.startAudioNative(); - this.playStatus = "playing" - }, 300); - } - - - updateProgress(progressTime:number){ - this.progressTime = progressTime; - this.progress = this.formatDuration(this.progressTime); - this.progressBarNumber = 260*(this.progressTime/this.durationTime); - } - - onPageShow() { - player.resumeNative(); - } - - onPageHide() { - player.pauseNative(); - } - setOrientation(flag: boolean) { - if(this.surfaceHeight == "400"){ - window.getLastWindow(getContext(this)).then((win) => { - win.setPreferredOrientation(window.Orientation.LANDSCAPE); - this.surfaceHeight = "100%"; - }) - } else { - window.getLastWindow(getContext(this)).then((win) => { - win.setPreferredOrientation(window.Orientation.PORTRAIT); - this.surfaceHeight = "400"; - }) - } - } - - - build() { - Scroll(this.scroller) { - Column() { - Row() { - XComponent({ - id: 'player', - type: XComponentType.SURFACE, - libraryname: 'player', - controller: this.xComponentController - }) - .height(Const.FULL_SIZE) - .width(Const.FULL_SIZE) - .visibility(this.surfaceId == "1" ? this.xComponentStatus : Visibility.None) - .onLoad(() => { - this.surfaceId1 = this.xComponentController.getXComponentSurfaceId(); - }) - XComponent({ - id: 'player2', - type: XComponentType.SURFACE, - libraryname: 'player', - controller: this.xComponentController2 - }) - .height(Const.FULL_SIZE) - .width(Const.FULL_SIZE) - .visibility(this.surfaceId == "2" ? this.xComponentStatus : Visibility.None) - .onLoad(() => { - this.surfaceId2 = this.xComponentController2.getXComponentSurfaceId(); - }) - Text(this.surfaceId) - .height(18) - .fontSize(25) - .fontColor("white") - .position({ "left": 20, "bottom": 20 }) - .onClick(() => { - if (this.surfaceId == "1") { - player.setSurfaceNative(this.surfaceId2); - this.surfaceId = "2"; - } else { - player.setSurfaceNative(this.surfaceId1); - this.surfaceId = "1"; - } - }) - Image($r("app.media.full")) - .height(18) - .position({ "right": 10, "bottom": 10 }) - .visibility(this.controlStatus) - .onClick(() => { - this.setOrientation(true); - }) - } - .id("screen") - .width(this.surfaceWidth) - .height(this.surfaceHeight) - // .aspectRatio(16/9) - // .backgroundColor('black') - .onTouch((event: TouchEvent) => { - const type: TouchType = event.type; - if (type == TouchType.Down) { - const x: number = event.touches[0].x; - this.touchX = x; - } - if (type == TouchType.Up) { - const x: number = event.touches[0].x; - if (x > this.touchX) { - let seekTime = this.progressTime / 1000 + 10000 - if (seekTime > this.durationTime / 1000) { - seekTime = this.durationTime / 1000; - } - player.seekNative(seekTime, this.seekMode, false); - } else if (x < this.touchX) { - let seekTime = this.progressTime / 1000 - 10000 - if (seekTime < 0) { - seekTime = 0; - } - player.seekNative(seekTime, this.seekMode, false); - } - } - }) - .onClick(() => { - clearInterval(this.showIntervalId); - this.showIntervalId = -1; - if (this.playStatus == "playing" || this.playStatus == 'pausing') { - this.controlStatus = Visibility.Visible; - this.showIntervalId = setTimeout(() => { - this.controlStatus = Visibility.Hidden; - }, 3000) - } - }) - - Row() { - Row() { - } - .width(260) - .height(8) - .backgroundColor('white') - .position({ left: 6, top: 12 }) - .onTouch((event: TouchEvent) => { - const type: TouchType = event.type; - if (type == TouchType.Move) { - const x: number = event.touches[0].x; - clearInterval(this.intervalId); - this.intervalId = -1; - this.progressTime = Math.floor(this.durationTime * (x / 260)) - this.progress = this.formatDuration(this.progressTime); - this.progressBarNumber = Math.floor(260 * (this.progressTime / this.durationTime)); - } - if (type == TouchType.Up) { - const x: number = event.touches[0].x; - const seekTime = Math.floor(this.durationTime * (x / 260) / 1000) - player.seekNative(seekTime, this.seekMode, false); - if (this.intervalId == -1) { - this.intervalId = setInterval(() => { - this.progressTime = player.getProgressTime(); - this.progress = this.formatDuration(this.progressTime); - this.progressBarNumber = Math.floor(260 * (this.progressTime / this.durationTime)); - }, 500); - } - } - }) - - Row() { - } - .id('Slider') - .width(this.progressBarNumber) - .height(8) - .backgroundColor('red') - .position({ left: 4, top: 12 }) - .onTouch((event: TouchEvent) => { - const type: TouchType = event.type; - if (type == TouchType.Move) { - const x: number = event.touches[0].x; - clearInterval(this.intervalId); - this.intervalId = -1; - this.progressTime = Math.floor(this.durationTime * (x / 260)) - this.progress = this.formatDuration(this.progressTime); - this.progressBarNumber = Math.floor(260 * (this.progressTime / this.durationTime)); - } - if (type == TouchType.Up) { - const x: number = event.touches[0].x; - const seekTime = Math.floor(this.durationTime * (x / 260) / 1000) - player.seekNative(seekTime, this.seekMode, false); - if (this.intervalId == -1) { - this.intervalId = setInterval(() => { - this.progressTime = player.getProgressTime(); - this.progress = this.formatDuration(this.progressTime); - this.progressBarNumber = Math.floor(260 * (this.progressTime / this.durationTime)); - }, 500); - } - } - }) - - Text(this.progress + "/" + this.duration) { - } - .align(Alignment.End) - .fontSize(12) - .fontColor("white") - .position({ right: 4, top: 8 }) - } - .width("100%") - .height("30") - .backgroundColor('black') - .margin({ top: 20 }) - - Row() { - Row() { - Text("0.5x") { - } - .fontColor(this.speedMode == 0.5 ? 'red' : 'white') - .margin({ left: 20 }) - .fontSize(18) - .onClick(() => { - if (!(this.playStatus == 'playing')) { - return; - } - player.speedNative(0.5); - this.speedMode = 0.5; - }) - - Text("1x") { - } - .fontColor(this.speedMode == 1.0 ? 'red' : 'white') - .margin({ left: 20 }) - .fontSize(18) - .onClick(() => { - if (!(this.playStatus == 'playing')) { - return; - } - player.speedNative(1.0); - this.speedMode = 1.0; - }) - - Text("2x") { - } - .fontColor(this.speedMode == 2.0 ? 'red' : 'white') - .margin({ left: 20 }) - .fontSize(18) - .onClick(() => { - if (!(this.playStatus == 'playing')) { - return; - } - player.speedNative(2.0); - this.speedMode = 2.0; - }) - - Text("4x") { - } - .fontColor(this.speedMode == 4.0 ? 'red' : 'white') - .margin({ left: 20 }) - .fontSize(18) - .onClick(() => { - if (!(this.playStatus == 'playing')) { - return; - } - player.speedNative(4.0); - this.speedMode = 4.0; - }) - } - .width("70%") - .height("100%") - - Row() { - Button('选择视频') - .onClick(() => { - this.selectFile(); - }) - .width('90%') - .height("80%") - .backgroundColor('#FF4500') - } - .width("30%") - .height("100%") - } - .width("100%") - .height("30") - .backgroundColor('black') - .margin({ top: 20 }) - - Row() { - Column() { - Button('准备') - .enabled(this.playStatus == 'selected') - .onClick(() => { - player.prepareNative(); - this.playStatus = 'prepared' - }) - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - - Column() { - Button('解码') - .enabled(this.playStatus == 'prepared') - .onClick(() => { - player.startDecoderNative(); - this.durationTime = player.getDurationTime(); - this.duration = this.formatDuration(this.durationTime); - this.playStatus = 'ready' - }) - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - - Column() { - Button('首帧') - .enabled(this.playStatus == 'prepared' || this.playStatus == 'ready') - .onClick(() => { - player.renderFirstFrameNative(); - this.durationTime = player.getDurationTime(); - this.duration = this.formatDuration(this.durationTime); - // this.xComponentStatus = Visibility.Visible; - this.playStatus = 'ready' - }) - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - - Column() { - Select([ - { value: '视频' }, - { value: '音频' }, - { value: '音视频' }, - ]) - .value('播放') - .controlSize(ControlSize.SMALL) - .enabled(this.playStatus == 'ready') - .backgroundColor('#FF4500') - .onSelect((index: number, text?: string | undefined) => { - console.info('Select:' + index) - // this.xComponentStatus = Visibility.Visible; - if (index === 0) { - player.startRenderNative() - } else if (index === 1) { - player.startAudioNative() - } else if (index === 2) { - player.startRenderNative() - player.startAudioNative() - } - this.intervalId = setInterval(() => { - this.progressTime = player.getProgressTime(); - this.progress = this.formatDuration(this.progressTime); - this.progressBarNumber = Math.floor(260 * (this.progressTime / this.durationTime)); - }, 300); - this.playStatus = 'playing' - }) - } - .width('25%') - .height('100%') - } - .width("100%") - .height("30") - .margin({ top: 20 }) - - Row() { - Column() { - Button(this.playStatus == 'pausing' ? '继续' : '暂停') - .enabled(this.playStatus == 'playing' || this.playStatus == 'pausing') - .id('Pause') - .onClick(() => { - if (this.playStatus == 'pausing') { - setTimeout(() => { - player.resumeNative(); - this.playStatus = 'playing'; - }, 0) - } else if (this.playStatus == 'playing') { - setTimeout(() => { - player.pauseNative(); - this.playStatus = 'pausing' - }, 0) - } - }) - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - - Column() { - Button('重置') - .enabled(this.playStatus == 'playing' || this.playStatus == 'pausing') - .id('Reset') - .onClick(() => { - // this.xComponentStatus = Visibility.Hidden; - player.resetNative(); - }) - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - - Column() { - Button('释放') - .enabled(this.playStatus == 'playing' || this.playStatus == 'pausing') - .id('Release') - .onClick(() => { - // this.xComponentStatus = Visibility.Hidden; - player.releaseNative(); - }) - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - - Column() { - Button('停止') - .enabled(this.playStatus == 'playing' || this.playStatus == 'pausing') - .onClick(() => { - player.stopNative(); - }) - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - } - .width("100%") - .height("30") - .margin({ top: 20 }) - - Row() { - Column() { - Button('音量-') - .enabled(this.playStatus == 'playing' || this.playStatus == 'pausing') - .onClick(() => { - this.volume = this.volume - 10; - if (this.volume <= 0) { - this.volume = 0; - } - player.setVolumeNative(this.volume / 100); - }) - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - - Column() { - Button('音量+') - .enabled(this.playStatus == 'playing' || this.playStatus == 'pausing') - .onClick(() => { - this.volume = this.volume + 10; - if (this.volume >= 100) { - this.volume = 100; - } - player.setVolumeNative(this.volume / 100); - }) - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - - Column() { - Select([ - { value: '前向关键帧' }, - { value: '后向关键帧' }, - { value: '最近关键帧' }, - ]) - .value('前向关键帧') - .controlSize(ControlSize.SMALL) - .backgroundColor('#FF4500') - .onSelect((index: number, text?: string | undefined) => { - console.info('Select:' + index) - if (index === 0) { - this.seekMode = 1; //前向 - } else if (index === 1) { - this.seekMode = 0; //后向 - } else if (index === 2) { - this.seekMode = 2; //最近 - } - }) - } - .width('25%') - .height('100%') - Column() { - Button('启动播放') - .onClick(() => { - this.playTest(); - }) - .id('Start') - .width('80%') - .height("80%") - .backgroundColor('#FF4500') - .margin({ top: 3 }) - } - .width('25%') - .height('100%') - } - .width("100%") - .height("30") - .margin({ top: 20 }) - } - } - // .backgroundColor('white') - .width('100%') - .height('100%') - .padding({top: px2vp(this.topRectHeight)}) - } -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/module.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/module.json5 deleted file mode 100644 index 1f65dfe0ac41a9f456aa2d04ca86b26c233741e1..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/module.json5 +++ /dev/null @@ -1,37 +0,0 @@ -{ - "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:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - } -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/element/color.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 0d98b5c17780f121191f2768bdf0cd0bc6e9b9e7..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "button_background", - "value": "#FFFFFF" - }, - { - "name": "homepage_background", - "value": "#F1F3F5" - }, - { - "name": "title_color", - "value": "#000000" - }, - { - "name": "button_color", - "value": "#007DFF" - }, - { - "name": "divider_color", - "value": "#182431" - } - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/element/float.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 9dbe4cf7ee7fd4fc771a44ede454e93f6555caa2..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "float": [ - { - "name": "font_size", - "value": "20vp" - }, - { - "name": "button_height", - "value": "50vp" - }, - { - "name": "button_margin_1", - "value": "30vp" - }, - { - "name": "button_margin_2", - "value": "10vp" - }, - { - "name": "image_margin_1", - "value": "30vp" - }, - { - "name": "set_row_height", - "value": "40vp" - }, - { - "name": "set_row_margin_top", - "value": "8vp" - }, - { - "name": "button_margin_bottom", - "value": "12vp" - }, - { - "name": "index_button_height", - "value": "40vp" - }, - { - "name": "index_column_height", - "value": "200vp" - } - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/element/string.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 80997951e39aff74dc45094cc68c03e91eba7706..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "This module template implements List functions." - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AVCodec" - }, - { - "name": "ability_desc", - "value": "This ability loads ListPage" - }, - { - "name": "reason", - "value": "label" - }, - { - "name": "playing", - "value": "playing" - }, - { - "name": "play", - "value": "play" - }, - { - "name": "alert", - "value": "None video selected" - }, - { - "name": "alert1", - "value": "This device camera does not support this type of video stream, it will switch to the default configuration" - }, - { - "name": "record", - "value": "record" - }, - { - "name": "saveButtonNote", - "value": "Allow AVCodecVideo to save captured video to gallery?" - }, - { - "name": "saveButtonCancel", - "value": "Cancel" - }, - { - "name": "saveButtonTitle", - "value": "Confirm the video storage location" - }, - { - "name": "full_width", - "value": "100%" - }, - { - "name": "full_height", - "value": "100%" - } - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/media/full.png b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/media/full.png deleted file mode 100644 index cb2367f53dcce6ef769917447aed7783e8d5b3cc..0000000000000000000000000000000000000000 Binary files a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/media/full.png and /dev/null differ diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/media/icon.png b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 8a354ba394b7575c510700847d6473ecd0b1e740..0000000000000000000000000000000000000000 Binary files a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/media/setting.png b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/media/setting.png deleted file mode 100644 index 9e8dd39f05f6572ddf85cd9984f17e5ddd4eeb60..0000000000000000000000000000000000000000 Binary files a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/media/setting.png and /dev/null differ diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/profile/main_pages.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 55c3f007f87b7ce5206d325f968cc56f2f79441f..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/en_US/element/string.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 2128c8d33bd5b565b2d6dc91887bc7297a55a564..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "This module template implements List functions." - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AVCodec" - }, - { - "name": "reason", - "value": "label" - }, - { - "name": "playing", - "value": "playing" - }, - { - "name": "play", - "value": "play" - }, - { - "name": "alert", - "value": "None video selected" - }, - { - "name": "alert1", - "value": "This device camera does not support this type of video stream, it will switch to the default configuration" - }, - { - "name": "record", - "value": "record" - }, - { - "name": "saveButtonNote", - "value": "Allow AVCodecVideo to save captured video to gallery?" - }, - { - "name": "saveButtonCancel", - "value": "Cancel" - }, - { - "name": "saveButtonTitle", - "value": "Confirm the video storage location" - }, - { - "name": "full_width", - "value": "100%" - }, - { - "name": "full_height", - "value": "100%" - } - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/zh_CN/element/string.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index f12ac6d66fc83f474254454f627a3be5802d0287..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "该模板实现了列表页的功能" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AVCodec" - }, - { - "name": "reason", - "value": "label" - }, - { - "name": "playing", - "value": "重新选择资源(Release后" - }, - { - "name": "play", - "value": "初始化资源" - }, - { - "name": "alert", - "value": "未选择视频!" - }, - { - "name": "alert1", - "value": "本设备相机不支持此类型录像流,将切换至默认配置" - }, - { - "name": "record", - "value": "录制" - }, - { - "name": "saveButtonNote", - "value": "是否允许AVCodecVideo保存拍摄的视频到图库?" - }, - { - "name": "saveButtonCancel", - "value": "取消" - }, - { - "name": "saveButtonTitle", - "value": "视频保存位置确认" - }, - { - "name": "full_width", - "value": "100%" - }, - { - "name": "full_height", - "value": "100%" - } - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/ets/test/Ability.test.ets b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index d3e8a2d54fd2e7a6b604ebc73a82762b6b15349a..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; -import { Driver, ON } from '@ohos.UiTest'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -export default function abilityTest() { - const TAG = '[Sample_LowPowerAVSink]'; - const DOMAIN = 0xF811; - const driver = Driver.create(); - const abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - const bundleName = AbilityDelegatorRegistry.getArguments().bundleName; - - describe('ActsAbilityTest', () => { - - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - - - /** - * 打开应用 - */ - it('StartAbility_001', 0, async (done: Function) => { - console.info(TAG, 'StartAbility_001 begin'); - - try { - await abilityDelegator.startAbility({ - bundleName: bundleName, - abilityName: 'EntryAbility' - }); - } catch (exception) { - hilog.error(DOMAIN, TAG, `StartAbility_001 exception = ${JSON.stringify(exception)}`); - expect().assertFail(); - } - await driver.delayMs(3000); - done(); - console.info(TAG, 'StartAbility_001 end'); - }) - - /** - * 播放、暂停、继续 - */ - it('Play_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, 'Play_001 begin'); - - await driver.delayMs(3000); - - // 点播放 - await driver.assertComponentExist(ON.id('Start')); - let stack = await driver.findComponent(ON.id('Start')); - await stack.click(); - await driver.delayMs(3000); - - // 暂停 - await driver.assertComponentExist(ON.id('Pause')); - let pause = await driver.findComponent(ON.id('Pause')); - await pause.click(); - await driver.delayMs(3000); - - // 继续 - await driver.assertComponentExist(ON.id('Pause')); - let resume = await driver.findComponent(ON.id('Pause')); - await resume.click(); - await driver.delayMs(3000); - - done(); - hilog.info(DOMAIN, TAG, 'Play_001 end'); - }) - - /** - * 暂停并退出 - */ - it('Exit_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, 'Exit_001 begin'); - - // 暂停 - await driver.delayMs(8000); - await driver.assertComponentExist(ON.id('Reset')); - let reset = await driver.findComponent(ON.id('Reset')); - await reset.click(); - await driver.delayMs(2000); - - await driver.assertComponentExist(ON.id('Release')); - let release = await driver.findComponent(ON.id('Release')); - await release.click(); - await driver.delayMs(2000); - - done(); - hilog.info(DOMAIN, TAG, 'Exit_001 end'); - }) - }) -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/ets/test/List.test.ets b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index c64e0b06938d246ce044186d4b2d02b500a89e14..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/module.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 8825ebe3b87a1cfae3f6acf12444d808395c4145..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/element/color.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/element/string.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/media/icon.png b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/profile/test_pages.json b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/hvigor/hvigor-config.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/hvigor/hvigor-config.json5 deleted file mode 100644 index f70ecd4112d94f9aa555adf898d53f18bf58f3e9..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "modelVersion": "5.0.0", - "dependencies": { - } -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/hvigor/hvigor-wrapper.js b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/hvigor/hvigor-wrapper.js deleted file mode 100644 index 372eae8eb4a124095936f9cd78df5c6756746f3f..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var u=require("path"),D=require("os"),e=require("fs"),t=require("crypto"),r=require("child_process"),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={},C={},F=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(C,"__esModule",{value:!0}),C.maxPathLength=C.isMac=C.isLinux=C.isWindows=void 0;const E=F(D),A="Windows_NT",o="Darwin";function a(){return E.default.type()===A}function c(){return E.default.type()===o}C.isWindows=a,C.isLinux=function(){return"Linux"===E.default.type()},C.isMac=c,C.maxPathLength=function(){return c()?1016:a()?259:4095},function(e){var t=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),r=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),i=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&t(D,u,e);return r(D,u),D};Object.defineProperty(e,"__esModule",{value:!0}),e.WORK_SPACE=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.PROJECT_CACHES=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 F=i(D),E=i(u),A=C;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,A.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,A.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=E.resolve(F.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=E.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.PROJECT_CACHES="project_caches",e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=E.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=E.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=E.resolve(e.HVIGOR_USER_HOME,e.PROJECT_CACHES),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_WRAPPER_HOME=E.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.WORK_SPACE="workspace"}(i);var s={},l={};Object.defineProperty(l,"__esModule",{value:!0}),l.logInfoPrintConsole=l.logErrorAndExit=void 0,l.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)},l.logInfoPrintConsole=function(u){console.log(u)};var B=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),d=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),f=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&B(D,u,e);return d(D,u),D};Object.defineProperty(s,"__esModule",{value:!0});var _=s.executeBuild=void 0;const p=f(e),O=f(u),h=l;_=s.executeBuild=function(u){const D=O.resolve(u,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const u=p.realpathSync(D);require(u)}catch(e){(0,h.logErrorAndExit)(`Error: ENOENT: no such file ${D},delete ${u} and retry.`)}};var P={},v={};!function(u){var D=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(u,"__esModule",{value:!0}),u.hashFile=u.hash=u.createHash=void 0;const r=D(t),i=D(e);u.createHash=(u="MD5")=>r.default.createHash(u);u.hash=(D,e)=>(0,u.createHash)(e).update(D).digest("hex");u.hashFile=(D,e)=>{if(i.default.existsSync(D))return(0,u.hash)(i.default.readFileSync(D,"utf-8"),e)}}(v);var g={},m={},R={};Object.defineProperty(R,"__esModule",{value:!0}),R.Unicode=void 0;class y{}R.Unicode=y,y.SPACE_SEPARATOR=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,y.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]/,y.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(m,"__esModule",{value:!0}),m.JudgeUtil=void 0;const I=R;m.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&I.Unicode.SPACE_SEPARATOR.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||I.Unicode.ID_START.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||I.Unicode.ID_CONTINUE.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var N=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(g,"__esModule",{value:!0}),g.parseJsonText=g.parseJsonFile=void 0;const b=N(e),S=N(D),w=N(u),H=m;var x;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(x||(x={}));let M,T,V,G,j,J,W="start",U=[],L=0,$=1,k=0,K=!1,z="default",q="'",Z=1;function X(u,D=!1){T=String(u),W="start",U=[],L=0,$=1,k=0,G=void 0,K=D;do{M=Q(),nu[W]()}while("eof"!==M.type);return G}function Q(){for(z="default",j="",q="'",Z=1;;){J=Y();const u=Du[z]();if(u)return u}}function Y(){if(T[L])return String.fromCodePoint(T.codePointAt(L))}function uu(){const u=Y();return"\n"===u?($++,k=0):u?k+=u.length:k++,u&&(L+=u.length),u}g.parseJsonFile=function(u,D=!1,e="utf-8"){const t=b.default.readFileSync(w.default.resolve(u),{encoding:e});try{return X(t,D)}catch(D){if(D instanceof SyntaxError){const e=D.message.split("at");if(2===e.length)throw new Error(`${e[0].trim()}${S.default.EOL}\t at ${u}:${e[1].trim()}`)}throw new Error(`${u} is not in valid JSON/JSON5 format.`)}},g.parseJsonText=X;const Du={default(){switch(J){case"/":return uu(),void(z="comment");case void 0:return uu(),eu("eof")}if(!H.JudgeUtil.isIgnoreChar(J)&&!H.JudgeUtil.isSpaceSeparator(J))return Du[W]();uu()},start(){z="value"},beforePropertyName(){switch(J){case"$":case"_":return j=uu(),void(z="identifierName");case"\\":return uu(),void(z="identifierNameStartEscape");case"}":return eu("punctuator",uu());case'"':case"'":return q=J,uu(),void(z="string")}if(H.JudgeUtil.isIdStartChar(J))return j+=uu(),void(z="identifierName");throw Eu(x.Char,uu())},afterPropertyName(){if(":"===J)return eu("punctuator",uu());throw Eu(x.Char,uu())},beforePropertyValue(){z="value"},afterPropertyValue(){switch(J){case",":case"}":return eu("punctuator",uu())}throw Eu(x.Char,uu())},beforeArrayValue(){if("]"===J)return eu("punctuator",uu());z="value"},afterArrayValue(){switch(J){case",":case"]":return eu("punctuator",uu())}throw Eu(x.Char,uu())},end(){throw Eu(x.Char,uu())},comment(){switch(J){case"*":return uu(),void(z="multiLineComment");case"/":return uu(),void(z="singleLineComment")}throw Eu(x.Char,uu())},multiLineComment(){switch(J){case"*":return uu(),void(z="multiLineCommentAsterisk");case void 0:throw Eu(x.Char,uu())}uu()},multiLineCommentAsterisk(){switch(J){case"*":return void uu();case"/":return uu(),void(z="default");case void 0:throw Eu(x.Char,uu())}uu(),z="multiLineComment"},singleLineComment(){switch(J){case"\n":case"\r":case"\u2028":case"\u2029":return uu(),void(z="default");case void 0:return uu(),eu("eof")}uu()},value(){switch(J){case"{":case"[":return eu("punctuator",uu());case"n":return uu(),tu("ull"),eu("null",null);case"t":return uu(),tu("rue"),eu("boolean",!0);case"f":return uu(),tu("alse"),eu("boolean",!1);case"-":case"+":return"-"===uu()&&(Z=-1),void(z="numerical");case".":case"0":case"I":case"N":return void(z="numerical");case'"':case"'":return q=J,uu(),j="",void(z="string")}if(void 0===J||!H.JudgeUtil.isDigitWithoutZero(J))throw Eu(x.Char,uu());z="numerical"},numerical(){switch(J){case".":return j=uu(),void(z="decimalPointLeading");case"0":return j=uu(),void(z="zero");case"I":return uu(),tu("nfinity"),eu("numeric",Z*(1/0));case"N":return uu(),tu("aN"),eu("numeric",NaN)}if(void 0!==J&&H.JudgeUtil.isDigitWithoutZero(J))return j=uu(),void(z="decimalInteger");throw Eu(x.Char,uu())},zero(){switch(J){case".":case"e":case"E":return void(z="decimal");case"x":case"X":return j+=uu(),void(z="hexadecimal")}return eu("numeric",0)},decimalInteger(){switch(J){case".":case"e":case"E":return void(z="decimal")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimal(){switch(J){case".":j+=uu(),z="decimalFraction";break;case"e":case"E":j+=uu(),z="decimalExponent"}},decimalPointLeading(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalFraction");throw Eu(x.Char,uu())},decimalFraction(){switch(J){case"e":case"E":return j+=uu(),void(z="decimalExponent")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimalExponent(){switch(J){case"+":case"-":return j+=uu(),void(z="decimalExponentSign")}if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentSign(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentInteger(){if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},hexadecimal(){if(H.JudgeUtil.isHexDigit(J))return j+=uu(),void(z="hexadecimalInteger");throw Eu(x.Char,uu())},hexadecimalInteger(){if(!H.JudgeUtil.isHexDigit(J))return eu("numeric",Z*Number(j));j+=uu()},identifierNameStartEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":break;default:if(!H.JudgeUtil.isIdStartChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},identifierName(){switch(J){case"$":case"_":case"‌":case"‍":return void(j+=uu());case"\\":return uu(),void(z="identifierNameEscape")}if(!H.JudgeUtil.isIdContinueChar(J))return eu("identifier",j);j+=uu()},identifierNameEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!H.JudgeUtil.isIdContinueChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},string(){switch(J){case"\\":return uu(),void(j+=function(){const u=Y(),D=function(){switch(Y()){case"b":return uu(),"\b";case"f":return uu(),"\f";case"n":return uu(),"\n";case"r":return uu(),"\r";case"t":return uu(),"\t";case"v":return uu(),"\v"}return}();if(D)return D;switch(u){case"0":if(uu(),H.JudgeUtil.isDigit(Y()))throw Eu(x.Char,uu());return"\0";case"x":return uu(),function(){let u="",D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());if(u+=uu(),D=Y(),!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());return u+=uu(),String.fromCodePoint(parseInt(u,16))}();case"u":return uu(),ru();case"\n":case"\u2028":case"\u2029":return uu(),"";case"\r":return uu(),"\n"===Y()&&uu(),""}if(void 0===u||H.JudgeUtil.isDigitWithoutZero(u))throw Eu(x.Char,uu());return uu()}());case'"':case"'":if(J===q){const u=eu("string",j);return uu(),u}return void(j+=uu());case"\n":case"\r":case void 0:throw Eu(x.Char,uu());case"\u2028":case"\u2029":!function(u){console.warn(`JSON5: '${Fu(u)}' in strings is not valid ECMAScript; consider escaping.`)}(J)}j+=uu()}};function eu(u,D){return{type:u,value:D,line:$,column:k}}function tu(u){for(const D of u){if(Y()!==D)throw Eu(x.Char,uu());uu()}}function ru(){let u="",D=4;for(;D-- >0;){const D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());u+=uu()}return String.fromCodePoint(parseInt(u,16))}const nu={start(){if("eof"===M.type)throw Eu(x.EOF);iu()},beforePropertyName(){switch(M.type){case"identifier":case"string":return V=M.value,void(W="afterPropertyName");case"punctuator":return void Cu();case"eof":throw Eu(x.EOF)}},afterPropertyName(){if("eof"===M.type)throw Eu(x.EOF);W="beforePropertyValue"},beforePropertyValue(){if("eof"===M.type)throw Eu(x.EOF);iu()},afterPropertyValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforePropertyName");case"}":Cu()}},beforeArrayValue(){if("eof"===M.type)throw Eu(x.EOF);"punctuator"!==M.type||"]"!==M.value?iu():Cu()},afterArrayValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforeArrayValue");case"]":Cu()}},end(){}};function iu(){const u=function(){let u;switch(M.type){case"punctuator":switch(M.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=M.value}return u}();if(K&&"object"==typeof u&&(u._line=$,u._column=k),void 0===G)G=u;else{const D=U[U.length-1];Array.isArray(D)?K&&"object"!=typeof u?D.push({value:u,_line:$,_column:k}):D.push(u):D[V]=K&&"object"!=typeof u?{value:u,_line:$,_column:k}:u}!function(u){if(u&&"object"==typeof u)U.push(u),W=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Cu(){U.pop();const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function Fu(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return`\\x${`00${D}`.substring(D.length)}`}return u}function Eu(u,D){let e="";switch(u){case x.Char:e=void 0===D?`JSON5: invalid end of input at ${$}:${k}`:`JSON5: invalid character '${Fu(D)}' at ${$}:${k}`;break;case x.EOF:e=`JSON5: invalid end of input at ${$}:${k}`;break;case x.Identifier:k-=5,e=`JSON5: invalid identifier character at ${$}:${k}`}const t=new Au(e);return t.lineNumber=$,t.columnNumber=k,t}class Au extends SyntaxError{}var ou={},au=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),cu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),su=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&au(D,u,e);return cu(D,u),D},lu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ou,"__esModule",{value:!0}),ou.isFileExists=ou.offlinePluginConversion=ou.executeCommand=ou.getNpmPath=ou.hasNpmPackInPaths=void 0;const Bu=r,du=lu(e),fu=su(u),_u=i,pu=l;ou.hasNpmPackInPaths=function(u,D){try{return require.resolve(u,{paths:[...D]}),!0}catch(u){return!1}},ou.getNpmPath=function(){const u=process.execPath;return fu.join(fu.dirname(u),_u.NPM_TOOL)},ou.executeCommand=function(u,D,e){0!==(0,Bu.spawnSync)(u,D,e).status&&(0,pu.logErrorAndExit)(`Error: ${u} ${D} execute failed.See above for details.`)},ou.offlinePluginConversion=function(u,D){return D.startsWith("file:")||D.endsWith(".tgz")?fu.resolve(u,_u.HVIGOR,D.replace("file:","")):D},ou.isFileExists=function(u){return du.default.existsSync(u)&&du.default.statSync(u).isFile()};var Ou=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),hu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),Pu=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&Ou(D,u,e);return hu(D,u),D},vu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(P,"__esModule",{value:!0});var gu=P.initProjectWorkSpace=void 0;const mu=Pu(e),Ru=vu(D),yu=Pu(u),Iu=v,Nu=i,bu=g,Su=l,wu=ou;let Hu,xu,Mu;function Tu(u,D,e){return void 0!==e.dependencies&&(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,D.dependencies[u])===yu.normalize(e.dependencies[u])}function Vu(){const u=yu.join(Mu,Nu.WORK_SPACE);if((0,Su.logInfoPrintConsole)("Hvigor cleaning..."),!mu.existsSync(u))return;const D=mu.readdirSync(u);if(!D||0===D.length)return;const e=yu.resolve(Mu,"node_modules","@ohos","hvigor","bin","hvigor.js");mu.existsSync(e)&&(0,wu.executeCommand)(process.argv[0],[e,"--stop-daemon"],{});try{D.forEach((D=>{mu.rmSync(yu.resolve(u,D),{recursive:!0})}))}catch(D){(0,Su.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${u}.`)}}gu=P.initProjectWorkSpace=function(){if(Hu=function(){const u=yu.resolve(Nu.HVIGOR_PROJECT_WRAPPER_HOME,Nu.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);mu.existsSync(u)||(0,Su.logErrorAndExit)(`Error: Hvigor config file ${u} does not exist.`);return(0,bu.parseJsonFile)(u)}(),Mu=function(u){let D;D=function(u){let D=u.hvigorVersion;if(D.startsWith("file:")||D.endsWith(".tgz"))return!1;const e=u.dependencies,t=Object.getOwnPropertyNames(e);for(const u of t){const D=e[u];if(D.startsWith("file:")||D.endsWith(".tgz"))return!1}if(1===t.length&&"@ohos/hvigor-ohos-plugin"===t[0])return D>"2.5.0";return!1}(u)?function(u){let D=`${Nu.HVIGOR_ENGINE_PACKAGE_NAME}@${u.hvigorVersion}`;const e=u.dependencies;if(e){Object.getOwnPropertyNames(e).sort().forEach((u=>{D+=`,${u}@${e[u]}`}))}return(0,Iu.hash)(D)}(u):(0,Iu.hash)(process.cwd());return yu.resolve(Ru.default.homedir(),".hvigor","project_caches",D)}(Hu),xu=function(){const u=yu.resolve(Mu,Nu.WORK_SPACE,Nu.DEFAULT_PACKAGE_JSON);return mu.existsSync(u)?(0,bu.parseJsonFile)(u):{dependencies:{}}}(),!(0,wu.hasNpmPackInPaths)(Nu.HVIGOR_ENGINE_PACKAGE_NAME,[yu.join(Mu,Nu.WORK_SPACE)])||(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion)!==xu.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]||!function(){function u(u){const D=null==u?void 0:u.dependencies;return void 0===D?0:Object.getOwnPropertyNames(D).length}const D=u(Hu),e=u(xu);if(D+1!==e)return!1;for(const u in null==Hu?void 0:Hu.dependencies)if(!(0,wu.hasNpmPackInPaths)(u,[yu.join(Mu,Nu.WORK_SPACE)])||!Tu(u,Hu,xu))return!1;return!0}()){Vu();try{!function(){(0,Su.logInfoPrintConsole)("Hvigor installing...");for(const u in Hu.dependencies)Hu.dependencies[u]&&(Hu.dependencies[u]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.dependencies[u]));const u={dependencies:{...Hu.dependencies}};u.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion);const D=yu.join(Mu,Nu.WORK_SPACE);try{mu.mkdirSync(D,{recursive:!0});const e=yu.resolve(D,Nu.DEFAULT_PACKAGE_JSON);mu.writeFileSync(e,JSON.stringify(u))}catch(u){(0,Su.logErrorAndExit)(u)}(function(){const u=["config","set","store-dir",Nu.HVIGOR_PNPM_STORE_PATH],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)})(),function(){const u=["install"],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)}(),(0,Su.logInfoPrintConsole)("Hvigor install success.")}()}catch(u){Vu()}}return Mu};var Gu={};!function(t){var C=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),F=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),E=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&C(D,u,e);return F(D,u),D},A=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.executeInstallPnpm=t.isPnpmInstalled=t.environmentHandler=t.checkNpmConifg=t.PNPM_VERSION=void 0;const o=r,a=E(e),c=A(D),s=E(u),B=i,d=l,f=ou;t.PNPM_VERSION="7.30.0",t.checkNpmConifg=function(){const u=s.resolve(B.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),D=s.resolve(c.default.homedir(),".npmrc");if((0,f.isFileExists)(u)||(0,f.isFileExists)(D))return;const e=(0,f.getNpmPath)(),t=(0,o.spawnSync)(e,["config","get","prefix"],{cwd:B.HVIGOR_PROJECT_ROOT_DIR});if(0!==t.status||!t.stdout)return void(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const r=s.resolve(`${t.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,f.isFileExists)(r)||(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},t.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},t.isPnpmInstalled=function(){return!!a.existsSync(B.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,f.hasNpmPackInPaths)("pnpm",[B.HVIGOR_WRAPPER_TOOLS_HOME])},t.executeInstallPnpm=function(){(0,d.logInfoPrintConsole)(`Installing pnpm@${t.PNPM_VERSION}...`);const u=(0,f.getNpmPath)();!function(){const u=s.resolve(B.HVIGOR_WRAPPER_TOOLS_HOME,B.DEFAULT_PACKAGE_JSON);try{a.existsSync(B.HVIGOR_WRAPPER_TOOLS_HOME)||a.mkdirSync(B.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const D={dependencies:{}};D.dependencies[B.PNPM]=t.PNPM_VERSION,a.writeFileSync(u,JSON.stringify(D))}catch(D){(0,d.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,f.executeCommand)(u,["install","pnpm"],{cwd:B.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,d.logInfoPrintConsole)("Pnpm install success.")}}(Gu),function(){Gu.checkNpmConifg(),Gu.environmentHandler(),Gu.isPnpmInstalled()||Gu.executeInstallPnpm();const D=gu();_(u.join(D,i.WORK_SPACE))}(); \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/hvigorfile.ts b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/hvigorfile.ts deleted file mode 100644 index 6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/oh-package-lock.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/oh-package-lock.json5 deleted file mode 100644 index 0eb15ad13647e2b5a8027cca619f6496b59e5e3d..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/oh-package-lock.json5 +++ /dev/null @@ -1,20 +0,0 @@ -{ - "meta": { - "stableOrder": true - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hypium@1.0.11": "@ohos/hypium@1.0.11" - }, - "packages": { - "@ohos/hypium@1.0.11": { - "name": "@ohos/hypium", - "version": "1.0.11", - "integrity": "sha512-KawcLnv43C3QIYv1UbDnKCFX3MohtDxGuFvzlUxT/qf2DBilR56Ws6zrj90LdH6PjloJQwOPESuBQIHBACAK7w==", - "resolved": "https://mirrors.tools.huawei.com/ohpm/@ohos/hypium/-/@ohos/hypium-1.0.11.har", - "shasum": "fa799d273fa7d921701578c5e7084849354a4af0", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/oh-package.json5 b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/oh-package.json5 deleted file mode 100644 index aaba9ce31628886c0b1f79ce108a19cb771522be..0000000000000000000000000000000000000000 --- a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/oh-package.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "modelVersion": "5.0.0", - "license": "", - "devDependencies": { - "@ohos/hypium": "1.0.11" - }, - "author": "", - "name": "avcodecsample", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} \ No newline at end of file diff --git a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/screenshots/image-202507041445495401.png b/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/screenshots/image-202507041445495401.png deleted file mode 100644 index 91c98b538198766a6d8dd9366fed935a3a5bef9d..0000000000000000000000000000000000000000 Binary files a/MediaKit/LowPowerAVSInk/lowPowerAVSinkSample/screenshots/image-202507041445495401.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/.gitignore b/MindSporeLiteKit/MindSporeLiteArkTSDemo/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/app.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/app.json5 deleted file mode 100644 index d8706540a712304e5a8118a645e2813103bfa358..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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.samples.mindsporelitearktsdemo", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/element/string.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/element/string.json deleted file mode 100644 index d26dc6c578f005f74a3c1d3fc0fe88664577a541..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MindSporeLiteArkTSDemo" - } - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/app_icon.png b/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 1090fe07135c34ccf8875f73595ad0ddad9f66e1..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/background.png b/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/foreground.png b/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/layered_image.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/README_zh.md b/MindSporeLiteKit/MindSporeLiteArkTSDemo/README_zh.md deleted file mode 100644 index aabc989ba49234915f0c6b23f622b9bf4001d664..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/README_zh.md +++ /dev/null @@ -1,76 +0,0 @@ -# **基于ArkTS接口的MindSpore Lite应用开发** - -### 介绍 - -本文基于MindSpore Lite提供的ArkTS API,实现“端侧图像分类”示例程序,来演示端侧部署的流程。 - -1. 选择图像分类模型。 -2. 将模型转换成MindSpore Lite模型格式。 -3. 在端侧使用MindSpore Lite推理模型,显示出可能的分类结果。 - -### 效果预览 - -| 主页 | -|-----------------------------------------------------| -| | - -#### 使用说明 - -1. 在主界面,可以点击photo按钮,进入相册选择图片界面; -2. 在相册界面,选择图片,点击确定按钮; -3. 自动进行选择图片的图像分类模型推理,部分推理结果显示在主界面。 - -### 工程目录 - -``` -entry -├── src/main -│   ├── etc# -|   |   └── pages -|   |       └── Index.ets // 首页,获取图片及预处理 -|   |       └── model.ets // 推理 -│   ├── resources // 资源文件 -|   |   └── rawfile -|   |       └── mobilenetv2.ms // 存放的模型文件 -``` - -### 具体实现 - -* 本示例程序中使用的终端图像分类模型文件为mobilenetv2.ms,放置在entry\src\main\resources\rawfile工程目录下。 - - 注:开发者可按需手工下载[MindSpore Model Zoo中图像分类模型](https://download.mindspore.cn/model_zoo/official/lite/mobilenetv2_openimage_lite/1.5/mobilenetv2.ms)。 - -* 调用[@ohos.file.picker](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-picker.md) (图片文件选择)、[@ohos.multimedia.image](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md) (图片处理效果)、[@ohos.file.fs](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md) (基础文件操作) 等API实现相册图片获取及图片处理。完整代码请参见Index.ets - -* 调用[@ohos.ai.mindSporeLite](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-mindspore-lite-kit/js-apis-mindSporeLite.md) (推理能力) API实现端侧推理。完整代码请参见model.ets - -* 调用推理函数并处理结果。完整代码请参见Index.ets - -### 相关权限 - -ohos.permission.READ_IMAGEVIDEO - -### 依赖 - -无。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:RK3568; - -2.本示例为Stage模型,已适配API version 11版本SDK; - -3.本示例需要使用DevEco Studio 4.1 Release及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo MindSporeLiteKit/MindSporeLiteArkTSDemo/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` - diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/build-profile.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/build-profile.json5 deleted file mode 100644 index c8d37de18b638b34dcd8738db696e230eaa5fd66..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* -* 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/code-linter.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/.gitignore b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/build-profile.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/build-profile.json5 deleted file mode 100644 index 9edfdf8c4a72db3313433e7366df25b6beb1c3a7..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/hvigorfile.ts b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/hvigorfile.ts deleted file mode 100644 index b0e3a1ab98a91bc918d6404b2413111a5011f14a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/obfuscation-rules.txt b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/oh-package.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/oh-package.json5 deleted file mode 100644 index 691f697c4aecdd29d069f77ac22ec956a329cba4..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2024-2025 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/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/entryability/EntryAbility.ets b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index fb75f1465efd57dd5a3748789ef5cf4bfb4693c1..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2024-2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 8e4de99282050bad799ac892eb85ac5449364a51..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,16 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/pages/Index.ets b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 3e905daf41b412f23934596d3dac1660a7b63e28..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,351 +0,0 @@ -/* -* Copyright (c) 2024-2025 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. -*/ - -// [Start index_image_classification] -import modelPredict from './model'; -import { photoAccessHelper } from '@kit.MediaLibraryKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { image } from '@kit.ImageKit'; -import { fileIo } from '@kit.CoreFileKit'; -import { abilityAccessCtrl, Permissions } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const PERMISSIONS: Permissions[] = ['ohos.permission.READ_IMAGEVIDEO']; - -@Entry -@Component -struct Index { - @State modelPredict: string = 'MindSporeLite ArkTS Demo'; - @State modelName: string = 'mobilenetv2.ms'; - @State modelInputHeight: number = 224; - @State modelInputWidth: number = 224; - @State uris: Array = []; - @State max: number = 0; - @State maxIndex: number = 0; - @State maxArray: Array = []; - @State maxIndexArray: Array = []; - // [StartExclude index_image_classification] - @State labelsNameMap: string[] = [ - 'Herd', 'Safari', 'Bangle', 'Cushion', 'Countertop', - 'Prom', 'Branch', 'Sports', 'Sky', 'Community', - 'Wheel', 'Cola', 'Tuxedo', 'Flowerpot', 'Team', - 'Computer', 'Unicycle', 'Brig', 'Aerospace engineering', 'Scuba diving', - 'Goggles', 'Fruit', 'Badminton', 'Horse', 'Sunglasses', - 'Fun', 'Prairie', 'Poster', 'Flag', 'Speedboat', - 'Eyelash', 'Veil', 'Mobile phone', 'Wheelbarrow', 'Saucer', - 'Leather', 'Drawer', 'Paper', 'Pier', 'Waterfowl', - 'Tights', 'Rickshaw', 'Vegetable', 'Handrail', 'Ice', - 'Metal', 'Flower', 'Wing', 'Silverware', 'Event', - 'Skyline', 'Money', 'Comics', 'Handbag', 'Porcelain', - 'Rodeo', 'Curtain', 'Tile', 'Human mouth', 'Army', - 'Menu', 'Boat', 'Snowboarding', 'Cairn terrier', 'Net', - 'Pasteles', 'Cup', 'Rugby', 'Pho', 'Cap', - 'Human hair', 'Surfing', 'Loveseat', 'Museum', 'Shipwreck', - 'Trunk (Tree)', 'Plush', 'Monochrome', 'Volcano', 'Rock', - 'Pillow', 'Presentation', 'Nebula', 'Subwoofer', 'Lake', - 'Sledding', 'Bangs', 'Tablecloth', 'Necklace', 'Swimwear', - 'Standing', 'Jeans', 'Carnival', 'Softball', 'Centrepiece', - 'Skateboarder', 'Cake', 'Dragon', 'Aurora', 'Skiing', - 'Bathroom', 'Dog', 'Needlework', 'Umbrella', 'Church', - 'Fire', 'Piano', 'Denim', 'Bridle', 'Cabinetry', - 'Lipstick', 'Ring', 'Television', 'Roller', 'Seal', - 'Concert', 'Product', 'News', 'Fast food', 'Horn (Animal)', - 'Tattoo', 'Bird', 'Bridegroom', 'Love', 'Helmet', - 'Dinosaur', 'Icing', 'Miniature', 'Tire', 'Toy', - 'Icicle', 'Jacket', 'Coffee', 'Mosque', 'Rowing', - 'Wetsuit', 'Camping', 'Underwater', 'Christmas', 'Gelato', - 'Whiteboard', 'Field', 'Ragdoll', 'Construction', 'Lampshade', - 'Palace', 'Meal', 'Factory', 'Cage', 'Clipper (Boat)', - 'Gymnastics', 'Turtle', 'Human foot', 'Marriage', 'Web page', - 'Human beard', 'Fog', 'Wool', 'Cappuccino', 'Lighthouse', - 'Lego', 'Sparkler', 'Sari', 'Model', 'Temple', - 'Beanie', 'Building', 'Waterfall', 'Penguin', 'Cave', - 'Stadium', 'Smile', 'Human hand', 'Park', 'Desk', - 'Shetland sheepdog', 'Bar', 'Eating', 'Neon', 'Dalmatian', - 'Crocodile', 'Wakeboarding', 'Longboard', 'Road', 'Race', - 'Kitchen', 'Odometer', 'Cliff', 'Fiction', 'School', - 'Interaction', 'Bullfighting', 'Boxer', 'Gown', 'Aquarium', - 'Superhero', 'Pie', 'Asphalt', 'Surfboard', 'Cheeseburger', - 'Screenshot', 'Supper', 'Laugh', 'Lunch', 'Party ', - 'Glacier', 'Bench', 'Grandparent', 'Sink', 'Pomacentridae', - 'Blazer', 'Brick', 'Space', 'Backpacking', 'Stuffed toy', - 'Sushi', 'Glitter', 'Bonfire', 'Castle', 'Marathon', - 'Pizza', 'Beach', 'Human ear', 'Racing', 'Sitting', - 'Iceberg', 'Shelf', 'Vehicle', 'Pop music', 'Playground', - 'Clown', 'Car', 'Rein', 'Fur', 'Musician', - 'Casino', 'Baby', 'Alcohol', 'Strap', 'Reef', - 'Balloon', 'Outerwear', 'Cathedral', 'Competition', 'Joker', - 'Blackboard', 'Bunk bed', 'Bear', 'Moon', 'Archery', - 'Polo', 'River', 'Fishing', 'Ferris wheel', 'Mortarboard', - 'Bracelet', 'Flesh', 'Statue', 'Farm', 'Desert', - 'Chain', 'Aircraft', 'Textile', 'Hot dog', 'Knitting', - 'Singer', 'Juice', 'Circus', 'Chair', 'Musical instrument', - 'Room', 'Crochet', 'Sailboat', 'Newspaper', 'Santa claus', - 'Swamp', 'Skyscraper', 'Skin', 'Rocket', 'Aviation', - 'Airliner', 'Garden', 'Ruins', 'Storm', 'Glasses', - 'Balance', 'Nail (Body part)', 'Rainbow', 'Soil ', 'Vacation ', - 'Moustache', 'Doily', 'Food', 'Bride ', 'Cattle', - 'Pocket', 'Infrastructure', 'Train', 'Gerbil', 'Fireworks', - 'Pet', 'Dam', 'Crew', 'Couch', 'Bathing', - 'Quilting', 'Motorcycle', 'Butterfly', 'Sled', 'Watercolor paint', - 'Rafting', 'Monument', 'Lightning', 'Sunset', 'Bumper', - 'Shoe', 'Waterskiing', 'Sneakers', 'Tower', 'Insect', - 'Pool', 'Placemat', 'Airplane', 'Plant', 'Jungle', - 'Armrest', 'Duck', 'Dress', 'Tableware', 'Petal', - 'Bus', 'Hanukkah', 'Forest', 'Hat', 'Barn', - 'Tubing', 'Snorkeling', 'Cool', 'Cookware and bakeware', 'Cycling', - 'Swing (Seat)', 'Muscle', 'Cat', 'Skateboard', 'Star', - 'Toe', 'Junk', 'Bicycle', 'Bedroom', 'Person', - 'Sand', 'Canyon', 'Tie', 'Twig', 'Sphynx', - 'Supervillain', 'Nightclub', 'Ranch', 'Pattern', 'Shorts', - 'Himalayan', 'Wall', 'Leggings', 'Windsurfing', 'Deejay', - 'Dance', 'Van', 'Bento', 'Sleep', 'Wine', - 'Picnic', 'Leisure', 'Dune', 'Crowd', 'Kayak', - 'Ballroom', 'Selfie', 'Graduation', 'Frigate', 'Mountain', - 'Dude', 'Windshield', 'Skiff', 'Class', 'Scarf', - 'Bull', 'Soccer', 'Bag', 'Basset hound', 'Tractor', - 'Swimming', 'Running', 'Track', 'Helicopter', 'Pitch', - 'Clock', 'Song', 'Jersey', 'Stairs', 'Flap', - 'Jewellery', 'Bridge', 'Cuisine', 'Bread', 'Caving', - 'Shell', 'Wreath', 'Roof', 'Cookie', 'Canoe']; - - aboutToAppear() { - abilityAccessCtrl.createAtManager().requestPermissionsFromUser(this.getUIContext().getHostContext(), - PERMISSIONS).then((data) => { - if (data.authResults[0] === 0) { - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', 'request permission success'); - } else { - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', 'user rejected'); - } - }).catch((err: BusinessError) => { - hilog.error(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `request permission failed, error message: ${(err as BusinessError).message}`); - }); - } - // [EndExclude index_image_classification] - - build() { - Row() { - Column() { - Text(this.modelPredict) - // [StartExclude index_image_classification] - .focusable(true) - .fontSize(30) - .fontWeight(FontWeight.Bold) - - //图片显示 - Image(this.uris[0]).width(320).height(540).margin(15) - //显示分类最大值 - if (this.max) { - Text(this.labelsNameMap[this.maxIndexArray[0]] + - ': ' + - (this.maxArray[0] / 100).toString() + - '%\n' + - this.labelsNameMap[this.maxIndexArray[1]] + - ': ' + - (this.maxArray[1] / 100).toString() + - '%\n' + - this.labelsNameMap[this.maxIndexArray[2]] + - ': ' + - (this.maxArray[2] / 100).toString() + - '%\n' + - this.labelsNameMap[this.maxIndexArray[3]] + - ': ' + - (this.maxArray[3] / 100).toString() + - '%').focusable(true).fontSize(20) - } - // [EndExclude index_image_classification] - Button() { - Text('photo') - .fontSize(30) - .fontWeight(FontWeight.Bold) - } - // [StartExclude index_image_classification] - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('40%') - .height('5%') - // [EndExclude index_image_classification] - .onClick(() => { - let resMgr = this.getUIContext()?.getHostContext()?.getApplicationContext().resourceManager; - if (resMgr === null || resMgr === undefined){ - hilog.error(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', `MS_LITE_ERR: get resMgr failed.`); - return - } - resMgr?.getRawFileContent(this.modelName).then(modelBuffer => { - - // 获取相册图片 - // 1.创建图片文件选择实例 - let photoSelectOptions = new photoAccessHelper.PhotoSelectOptions(); - - // 2.设置选择媒体文件类型为IMAGE,设置选择媒体文件的最大数目 - photoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE; // 过滤选择媒体文件类型为IMAGE - photoSelectOptions.maxSelectNumber = 1; // 选择媒体文件的最大数目 - - // 3.创建图库选择器实例,调用select()接口拉起图库界面进行文件选择。文件选择成功后,返回photoSelectResult结果集。 - let photoPicker = new photoAccessHelper.PhotoViewPicker(); - photoPicker.select(photoSelectOptions, async ( - err: BusinessError, photoSelectResult: photoAccessHelper.PhotoSelectResult) => { - if (err) { - hilog.error(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_ERR: PhotoViewPicker.select failed with err: ${JSON.stringify(err)}`); - return; - } - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: PhotoViewPicker.select successfully, uri: ${JSON.stringify(photoSelectResult)}`); - this.uris = photoSelectResult.photoUris; - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', `MS_LITE_LOG: uri: ${this.uris}`); - - // 预处理图片数据 - try { - // 1.使用fileIo.openSync接口,通过uri打开这个文件得到fd - let file = fileIo.openSync(this.uris[0], fileIo.OpenMode.READ_ONLY); - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', `MS_LITE_LOG: file fd: ${file.fd}`); - - // 2.通过fd使用fileIo.readSync接口读取这个文件内的数据 - let inputBuffer = new ArrayBuffer(4096000); - let readLen = fileIo.readSync(file.fd, inputBuffer); - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: readSync data to file succeed and inputBuffer size is: ${readLen}`); - - // 3.通过PixelMap预处理 - let imageSource = image.createImageSource(file.fd); - if (imageSource === undefined) { - hilog.error(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', `MS_LITE_ERR: createImageSource failed.`); - return - } - imageSource.createPixelMap().then((pixelMap) => { - pixelMap.getImageInfo().then((info) => { - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: info.width = ${info.size.width}`); - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: info.height = ${info.size.height}`); - - // 4.根据模型输入的尺寸,将图片裁剪为对应的size,获取图片buffer数据readBuffer - pixelMap.scale(256.0 / info.size.width, 256.0 / info.size.height).then(() => { - pixelMap.crop( - { x: 16, y: 16, size: { height: this.modelInputHeight, width: this.modelInputWidth } } - ).then(async () => { - let info = await pixelMap.getImageInfo(); - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: crop info.width = ${info.size.width}`); - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: crop info.height = ${info.size.height}`); - - // 需要创建的像素buffer大小 - let readBuffer = new ArrayBuffer(this.modelInputHeight * this.modelInputWidth * 4); - await pixelMap.readPixelsToBuffer(readBuffer); - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: Succeeded in reading image pixel data, buffer: ${readBuffer.byteLength}`); - // 处理readBuffer,转换成float32格式,并进行标准化处理 - const imageArr = new Uint8Array( - readBuffer.slice(0, this.modelInputHeight * this.modelInputWidth * 4)); - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: imageArr length: ${imageArr.length}`); - - let means = [0.485, 0.456, 0.406]; - let stds = [0.229, 0.224, 0.225]; - let float32View = new Float32Array(this.modelInputHeight * this.modelInputWidth * 3); - let index = 0; - for (let i = 0; i < imageArr.length; i++) { - if ((i + 1) % 4 === 0) { - float32View[index] = (imageArr[i - 3] / 255.0 - means[0]) / stds[0]; // B - float32View[index+1] = (imageArr[i - 2] / 255.0 - means[1]) / stds[1]; // G - float32View[index+2] = (imageArr[i - 1] / 255.0 - means[2]) / stds[2]; // R - index += 3; - } - } - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: float32View length: ${float32View.length}`); - let printStr = 'float32View data:'; - for (let i = 0; i < 20; i++) { - printStr += ' ' + float32View[i]; - } - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: float32View data: ${printStr}`); - - let inputs: ArrayBuffer[] = [float32View.buffer]; - - // predict - modelPredict(modelBuffer.buffer.slice(0), inputs).then(outputs => { - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `=========MS_LITE_LOG: MS_LITE predict success=====`); - - // 结果打印 - for (let i = 0; i < outputs.length; i++) { - let out = new Float32Array(outputs[i].getData()); - - let printStr = outputs[i].name + ':'; - for (let j = 0; j < out.length; j++) { - printStr += out[j].toString() + ','; - } - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', `MS_LITE_LOG: ${printStr}`); - - // 取分类占比的最大值top5 - this.max = 0; - this.maxIndex = 0; - this.maxArray = []; - this.maxIndexArray = []; - let newArray = out.filter(value => value !== this.max) - for (let n = 0; n < 5; n++) { - this.max = out[0]; - this.maxIndex = 0; - // 取最大值 - for (let m = 0; m < newArray.length; m++) { - if (newArray[m] > this.max) { - this.max = newArray[m]; - this.maxIndex = m; - } - } - this.maxArray.push(Math.round(this.max * 10000)); - this.maxIndexArray.push(this.maxIndex); - // filter数组过滤函数 - newArray = newArray.filter(value => value !== this.max) - } - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: max: ${this.maxArray}`); - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_LOG: maxIndex: ${this.maxIndexArray}`); - } - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `=========MS_LITE_LOG END=========`); - }) - }).catch((error: BusinessError) => { - hilog.error(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_ERR: getRawFileContent promise error is: ${error}`); - }) - }) - }) - }) - - // 5.关闭文件 - fileIo.closeSync(file); - } catch (err) { - hilog.error(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', - `MS_LITE_ERR: uri: open file fd failed. ${err}`); - } - }) - }) - }) - } - .width('100%') - } - .height('100%') - } -} -// [End index_image_classification] \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/pages/model.ets b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/pages/model.ets deleted file mode 100644 index 47a91d5f79203ac58c5ee16d73389df46aaa550f..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/ets/pages/model.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2024-2025 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. -*/ - -// [Start model_image_classification] -import { mindSporeLite } from '@kit.MindSporeLiteKit' -import { hilog } from '@kit.PerformanceAnalysisKit'; - -export default async function modelPredict( - modelBuffer: ArrayBuffer, inputsBuffer: ArrayBuffer[]): Promise { - - // 1.创建上下文,设置线程数、设备类型等参数。本样例模型,不支持配置context.target = ["nnrt"]。 - let context: mindSporeLite.Context = {}; - context.target = ['cpu']; - context.cpu = {} - context.cpu.threadNum = 2; - context.cpu.threadAffinityMode = 1; - context.cpu.precisionMode = 'enforce_fp32'; - - // 2.从内存加载模型。 - let msLiteModel: mindSporeLite.Model = await mindSporeLite.loadModelFromBuffer(modelBuffer, context); - - // 3.设置输入数据。 - let modelInputs: mindSporeLite.MSTensor[] = msLiteModel.getInputs(); - for (let i = 0; i < inputsBuffer.length; i++) { - let inputBuffer = inputsBuffer[i]; - if (inputBuffer != null) { - modelInputs[i].setData(inputBuffer as ArrayBuffer); - } - } - - // 4.执行推理。 - hilog.info(0xFF00, 'MindSporeLiteArkTSDemo', '%{public}s', `=========MS_LITE_LOG: MS_LITE predict start=====`); - let modelOutputs: mindSporeLite.MSTensor[] = await msLiteModel.predict(modelInputs); - return modelOutputs; -} -// [End model_image_classification] - diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/module.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/module.json5 deleted file mode 100644 index f73ac7fcc3291d45993d97d83d7dd580a63a9cac..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/module.json5 +++ /dev/null @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2024-2025 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": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:startIcon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.READ_IMAGEVIDEO", - "reason": "$string:read_image_video_permission", - "usedScene": { - "when": "inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/element/color.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/element/float.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/element/string.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 3923bded3d5b9a7e7bf9ed37031adc41332023f4..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "MindSporeLite" - }, - { - "name": "read_image_video_permission", - "value": "读取用户公共目录的图片或视频文件" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/background.png b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/foreground.png b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/layered_image.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/startIcon.png b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 1090fe07135c34ccf8875f73595ad0ddad9f66e1..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/profile/backup_config.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/profile/main_pages.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/dark/element/color.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/rawfile/mobilenetv2.ms b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/rawfile/mobilenetv2.ms deleted file mode 100644 index a0f6a8d9fc5660977abae6d8600019c817677440..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/main/resources/rawfile/mobilenetv2.ms +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2e92f251021d17ed29f0d4484f050285534873b644e7dfa4cbd4e26ce999d94 -size 11447840 diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/mock/mock-config.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2417dae33e86618dcf41b9c0c0f2835b30e47b34..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2025 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/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/test/Ability.test.ets b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 743b733fa34eb385d7a11c4d54544ceead83cbf5..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,118 +0,0 @@ -/* -* Copyright (c) 2024-2025 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 { describe, it, expect } from '@ohos/hypium'; -import Want from '@ohos.app.ability.Want'; -import Base from '@ohos.base'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; -import { getString } from '../utils/ResourceUtil'; - -const BUNDLE = 'MindSporeLiteArkTSDemo_'; -const TAG = 'abilityTest'; -const domain: number = 0xF811; - -export default function abilityTest() { - let driver: Driver = Driver.create(); - describe('MindSporeLiteArkTSDemoTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - /* - * @tc.number: MindSporeLiteArkTSDemoTest_000 - * @tc.name: Start Ability - * @tc.desc: Start Ability - * @tc.size: MediumTest - * @tc.type: Function - * @tc.level Level 1 - */ - it('EntryAbility', 0, async (done: Function) => { - hilog.info(domain, TAG, BUNDLE + 'EntryAbility_001 begin'); - // 开启应用 - let want: Want = { - bundleName: 'com.samples.mindsporelitearktsdemo', - abilityName: 'EntryAbility' - }; - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - abilityDelegator.startAbility(want, (err: Base.BusinessError) => { - hilog.info(domain, TAG, 'StartAbility get err ' + JSON.stringify(err)); - expect(err).assertNull(); - }) - await driver.delayMs(3000); - // 用户授权 - await driver.assertComponentExist(ON.text( - await abilityDelegator.getAppContext().resourceManager.getStringValue($r('app.string.allow')))); - let permissionAllowBtn = await driver.findComponent(ON.text( - await abilityDelegator.getAppContext().resourceManager.getStringValue($r('app.string.allow')))); - await permissionAllowBtn.click(); - await driver.delayMs(1000); - hilog.info(domain, TAG, BUNDLE + 'EntryAbility_001 end'); - done(); - }) - /** - * @tc.number : MindSporeLiteArkTSDemoTest_001 - * @tc.name : open photo - * @tc.desc : open photo - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('IfExists', 0, async (done: Function) => { - hilog.info(domain, TAG, BUNDLE + 'IfExists_001 begin'); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('MindSporeLite ArkTS Demo')); - await driver.assertComponentExist(ON.text('photo')); - expect(true).assertTrue(); - hilog.info(domain, TAG, BUNDLE + 'IfExists_001 end'); - done(); - }) - - /** - * @tc.number : MindSporeLiteArkTSDemoTest_002 - * @tc.name : open photo and predict - * @tc.desc : open photo and predict - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('PhotoPredict', 0, async (done: Function) => { - hilog.info(domain, TAG, BUNDLE + 'PhotoPredict_001 begin'); - await driver.delayMs(1000); - // 点击photo按钮 - hilog.info(domain, TAG, BUNDLE + 'PhotoPredict_001 click photo button'); - await driver.assertComponentExist(ON.text('photo')); - let msPhoto = await driver.findComponent(ON.text('photo')); - await msPhoto.click(); - await driver.delayMs(5000); - // 点击照片,选中一张照片 - let gridItems = await driver.findComponents(ON.type('GridItem')); - await gridItems[1].click(); - await driver.delayMs(5000); - // 点击完成 - let tipCompleted: string = getString($r('app.string.completed')); - await driver.assertComponentExist(ON.text(tipCompleted)); - let finish = await driver.findComponent(ON.text(tipCompleted)); - await driver.delayMs(5000); - await finish.click(); - await driver.delayMs(5000); - // 进行图片推理 - await driver.assertComponentExist(ON.text('MindSporeLite ArkTS Demo')); - await driver.assertComponentExist(ON.text('%', 1)); - await driver.delayMs(5000); - expect(true).assertTrue(); - hilog.info(domain, TAG, BUNDLE + 'PhotoPredict_001 end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/test/List.test.ets b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/utils/Logger.ts b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/utils/Logger.ts deleted file mode 100644 index efdf004b93e46d9c135e0f775f2b9b20b5fd3688..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/utils/Logger.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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 '@ohos.hilog'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s, %{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('Sample_Image'); \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/utils/ResourceUtil.ets b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/utils/ResourceUtil.ets deleted file mode 100644 index a5f19f17d97dee413b528183febf96400b217dfc..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/ets/utils/ResourceUtil.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2025 Hunan OpenValley Digital Industry Development 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = AbilityDelegatorRegistry.getAbilityDelegator(); - -export function getString(resourceData: Resource): string { - let manage = delegator.getAppContext().resourceManager - return manage.getStringSync(resourceData) -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/module.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/module.json5 deleted file mode 100644 index 40da0d8af6ff44622b93a5bff3a40217be575687..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/element/color.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/element/string.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 5955cede45230a0d21762a57af8717d6955ded40..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "completed", - "value": "完成" - }, - { - "name": "allow", - "value": "允许" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/media/icon.png b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/profile/test_pages.json b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/test/List.test.ets b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/test/LocalUnit.test.ets b/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/hvigor/hvigor-config.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/hvigor/hvigor-config.json5 deleted file mode 100644 index 9eb45235574eb082ecb2c5cc16aaecd4db0c0f02..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/MindSporeLiteKit/MindSporeLiteArkTSDemo/hvigorfile.ts b/MindSporeLiteKit/MindSporeLiteArkTSDemo/hvigorfile.ts deleted file mode 100644 index 47113e2e36ecefde41c136272a0bd6ff745cffe4..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/oh-package.json5 b/MindSporeLiteKit/MindSporeLiteArkTSDemo/oh-package.json5 deleted file mode 100644 index 4d1c4c5ca3f3467260e9eefdc92ebcf79758729e..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/ohosTest.md b/MindSporeLiteKit/MindSporeLiteArkTSDemo/ohosTest.md deleted file mode 100644 index 095f1d955b756cf4d5d8467da601f845698789e5..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteArkTSDemo/ohosTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# MindSporeLiteArkTSDemo 测试用例归档 - -## 用例表 - -|测试功能|预置条件|输入|预期输出|是否自动|测试结果| -|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------| -|拉起应用| 设备正常运行| |成功拉起应用|是|Pass| -|查看预览界面Text和Button| 进入预览界面 | |预览界面存在Text和Button|是|Pass| -|选取图片推理功能测试| 进入预览界面 | 点击photo按钮 |选取图片后进行推理|是|Pass| \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteArkTSDemo/screenshots/MindSporeLiteArkTSDemo.png b/MindSporeLiteKit/MindSporeLiteArkTSDemo/screenshots/MindSporeLiteArkTSDemo.png deleted file mode 100644 index 23be4d2c55f79620fc4206b5a1e3da400547e12b..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteArkTSDemo/screenshots/MindSporeLiteArkTSDemo.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/.gitignore b/MindSporeLiteKit/MindSporeLiteCDemo/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/app.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/app.json5 deleted file mode 100644 index 89d7b154e10b91213259760cb49d65ee24ffd43a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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.samples.mindsporelitecdemo", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/element/string.json b/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/element/string.json deleted file mode 100644 index 8621f2cb1ffab4ad01f456206c2dc8be37bf0e25..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MindSporeLiteCDemo" - } - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/app_icon.png b/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 1090fe07135c34ccf8875f73595ad0ddad9f66e1..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/background.png b/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/foreground.png b/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/layered_image.json b/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/README_zh.md b/MindSporeLiteKit/MindSporeLiteCDemo/README_zh.md deleted file mode 100644 index 1410af9304afdf118ebdd179824f631eed66c1f9..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/README_zh.md +++ /dev/null @@ -1,85 +0,0 @@ -# **基于**Native**接口的MindSpore Lite应用开发** - -### 介绍 - -本文基于MindSpore Lite提供的[Native API](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-mindspore-lite-kit/_mind_spore.md),实现“图像分类”示例程序,来演示端侧部署的流程。 - -1. 选择图像分类模型。 -2. 将模型转换成MindSpore Lite模型格式。 -3. 使用MindSpore Lite推理模型,显示出可能的分类结果。 - -### 效果预览 - -| 主页 | -| -------------------------------------------------- | -| | - -#### 使用说明 - -1. 在主界面,可以点击photo按钮,进入相册选择图片界面; -2. 在相册界面,选择图片,点击确定按钮; -3. 自动进行选择图片的图像分类模型推理,部分推理结果显示在主界面。 - -### 工程目录 - -``` -entry -├── src/main -│   ├── etc -|   |   └── pages -|   |       └── Index.ets // 首页,获取图片及预处理 -│   ├── cpp -|   |   └── mslite_napi.cpp // 推理函数 -|   |   └── CMakeLists.txt // 编译脚本 -|   |   └── types -|   |   └── libentry -|   |       └── Index.t.ts // 将C++动态库封装成JS模块 -│   ├── resources // 资源文件 -|   |   └── rawfile -|   |       └── mobilenetv2.ms // 存放的模型文件 -``` - -### 具体实现 - -* 本示例程序中使用的终端图像分类模型文件为mobilenetv2.ms,放置在entry\src\main\resources\rawfile工程目录下。 - - 注:开发者可按需手工下载[MindSpore Model Zoo中图像分类模型](https://download.mindspore.cn/model_zoo/official/lite/mobilenetv2_openimage_lite/1.5/mobilenetv2.ms)。 - -* 调用[@ohos.file.picker](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-picker.md) (图片文件选择)、[@ohos.multimedia.image](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md) (图片处理效果)、[@ohos.file.fs](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md) (基础文件操作) 等API实现相册图片获取及图片处理。完整代码请参见Index.ets。 - -* 调用[MindSpore Lite Native API](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-mindspore-lite-kit/_mind_spore.md)实现推理。完整代码请参见mslite_napi.cpp。 - -* 编写CMake脚本。链接MindSpore Lite动态库,完整代码请参见CMakeLists.txt。 - -* 使用N-API将C++动态库封装成JS模块。在 entry/src/main/cpp/types/libentry/index.d.ts,定义JS接口`runDemo()` 。 - -* 调用推理函数并处理结果。完整代码请参见Index.ets - -### 相关权限 - -ohos.permission.READ_IMAGEVIDEO - -### 依赖 - -无。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行,测试设备:RK3568; - -2.本示例为Stage模型,已适配API version 11版本SDK; - -3.本示例需要使用DevEco Studio 4.1 Release及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo MindSporeLiteKit/MindSporeLiteCDemo/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` - diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/build-profile.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/build-profile.json5 deleted file mode 100644 index 9214abc40163dbffa0cfee906b31c4c590422e82..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* -* 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", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/code-linter.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/.gitignore b/MindSporeLiteKit/MindSporeLiteCDemo/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/build-profile.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/entry/build-profile.json5 deleted file mode 100644 index 0f77fc965a7cc28e01f0acabadcc7e658f23e356..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "abiFilters": ['arm64-v8a', 'x86_64'], - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/hvigorfile.ts b/MindSporeLiteKit/MindSporeLiteCDemo/entry/hvigorfile.ts deleted file mode 100644 index b0e3a1ab98a91bc918d6404b2413111a5011f14a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/obfuscation-rules.txt b/MindSporeLiteKit/MindSporeLiteCDemo/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/MindSporeLiteKit/MindSporeLiteCDemo/entry/oh-package.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/entry/oh-package.json5 deleted file mode 100644 index da81bc43377ea5d7ec40e9328286121c18c79b93..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2024-2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/CMakeLists.txt b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 5c31122cb155a013382938784386219950197ce0..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(MindSporeLiteCDemo) - -set(NATIVERENDER_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_PATH} - ${NATIVERENDER_PATH}/include) - -add_library(entry SHARED mslite_napi.cpp) -target_link_libraries(entry PUBLIC mindspore_lite_ndk) -target_link_libraries(entry PUBLIC hilog_ndk.z) -target_link_libraries(entry PUBLIC rawfile.z) -target_link_libraries(entry PUBLIC ace_napi.z) \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/mslite_napi.cpp b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/mslite_napi.cpp deleted file mode 100644 index 21d70441845522f9b6cbd801bf5fd8777c128627..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/mslite_napi.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start napi_image_classification_headers] -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "napi/native_api.h" -// [End napi_image_classification_headers] - -// [Start napi_image_classification_log] -#define LOGI(...) ((void)OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "[MSLiteNapi]", __VA_ARGS__)) -#define LOGD(...) ((void)OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, "[MSLiteNapi]", __VA_ARGS__)) -#define LOGW(...) ((void)OH_LOG_Print(LOG_APP, LOG_WARN, LOG_DOMAIN, "[MSLiteNapi]", __VA_ARGS__)) -#define LOGE(...) ((void)OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, "[MSLiteNapi]", __VA_ARGS__)) -// [End napi_image_classification_log] - -// [Start napi_image_classification_print_num] -constexpr int K_NUM_PRINT_OF_OUT_DATA = 20; -// [End napi_image_classification_print_num] - -// [Start napi_image_classification_FillInputTensor] -// 设置模型输入数据 -int FillInputTensor(OH_AI_TensorHandle input, std::vector input_data) -{ - if (OH_AI_TensorGetDataType(input) == OH_AI_DATATYPE_NUMBERTYPE_FLOAT32) { - float *data = (float *)OH_AI_TensorGetMutableData(input); - for (size_t i = 0; i < OH_AI_TensorGetElementNum(input); i++) { - data[i] = input_data[i]; - } - return OH_AI_STATUS_SUCCESS; - } else { - return OH_AI_STATUS_LITE_ERROR; - } -} -// [End napi_image_classification_FillInputTensor] - -// [Start napi_image_classification_ReadModelFile] -void *ReadModelFile(NativeResourceManager *nativeResourceManager, const std::string &modelName, size_t *modelSize) -{ - auto rawFile = OH_ResourceManager_OpenRawFile(nativeResourceManager, modelName.c_str()); - if (rawFile == nullptr) { - LOGE("MS_LITE_ERR: Open model file failed"); - OH_ResourceManager_CloseRawFile(rawFile); - return nullptr; - } - long fileSize = OH_ResourceManager_GetRawFileSize(rawFile); - if (fileSize <= 0) { - LOGE("MS_LITE_ERR: FileSize not correct"); - } - void *modelBuffer = malloc(fileSize); - if (modelBuffer == nullptr) { - LOGE("MS_LITE_ERR: malloc failed"); - } - int ret = OH_ResourceManager_ReadRawFile(rawFile, modelBuffer, fileSize); - if (ret == 0) { - LOGE("MS_LITE_ERR: OH_ResourceManager_ReadRawFile failed"); - OH_ResourceManager_CloseRawFile(rawFile); - return nullptr; - } - OH_ResourceManager_CloseRawFile(rawFile); - *modelSize = fileSize; - return modelBuffer; -} -// [End napi_image_classification_ReadModelFile] - -// [Start napi_image_classification_context] -void DestroyModelBuffer(void **buffer) -{ - if (buffer == nullptr) { - return; - } - free(*buffer); - *buffer = nullptr; -} - -OH_AI_ContextHandle CreateMSLiteContext(void *modelBuffer) -{ - // Set executing context for model. - auto context = OH_AI_ContextCreate(); - if (context == nullptr) { - DestroyModelBuffer(&modelBuffer); - LOGE("MS_LITE_ERR: Create MSLite context failed.\n"); - return nullptr; - } - // 本样例模型,不支持配置OH_AI_DeviceInfoCreate(OH_AI_DEVICETYPE_NNRT) - auto cpu_device_info = OH_AI_DeviceInfoCreate(OH_AI_DEVICETYPE_CPU); - - OH_AI_DeviceInfoSetEnableFP16(cpu_device_info, true); - OH_AI_ContextAddDeviceInfo(context, cpu_device_info); - - LOGI("MS_LITE_LOG: Build MSLite context success.\n"); - return context; -} - -OH_AI_ModelHandle CreateMSLiteModel(void *modelBuffer, size_t modelSize, OH_AI_ContextHandle context) -{ - // Create model - auto model = OH_AI_ModelCreate(); - if (model == nullptr) { - DestroyModelBuffer(&modelBuffer); - LOGE("MS_LITE_ERR: Allocate MSLite Model failed.\n"); - return nullptr; - } - - // Build model object - auto build_ret = OH_AI_ModelBuild(model, modelBuffer, modelSize, OH_AI_MODELTYPE_MINDIR, context); - DestroyModelBuffer(&modelBuffer); - if (build_ret != OH_AI_STATUS_SUCCESS) { - OH_AI_ModelDestroy(&model); - LOGE("MS_LITE_ERR: Build MSLite model failed.\n"); - return nullptr; - } - LOGI("MS_LITE_LOG: Build MSLite model success.\n"); - return model; -} -// [End napi_image_classification_context] - -// [Start napi_image_classification_RunMSLiteModel] -// 执行模型推理 -int RunMSLiteModel(OH_AI_ModelHandle model, std::vector input_data) -{ - // Set input data for model. - auto inputs = OH_AI_ModelGetInputs(model); - auto ret = FillInputTensor(inputs.handle_list[0], input_data); - if (ret != OH_AI_STATUS_SUCCESS) { - LOGE("MS_LITE_ERR: RunMSLiteModel set input error.\n"); - return OH_AI_STATUS_LITE_ERROR; - } - - // Get model output. - auto outputs = OH_AI_ModelGetOutputs(model); - - // Predict model. - auto predict_ret = OH_AI_ModelPredict(model, inputs, &outputs, nullptr, nullptr); - if (predict_ret != OH_AI_STATUS_SUCCESS) { - LOGE("MS_LITE_ERR: MSLite Predict error.\n"); - return OH_AI_STATUS_LITE_ERROR; - } - LOGI("MS_LITE_LOG: Run MSLite model Predict success.\n"); - - // Print output tensor data. - LOGI("MS_LITE_LOG: Get model outputs:\n"); - for (size_t i = 0; i < outputs.handle_num; i++) { - auto tensor = outputs.handle_list[i]; - LOGI("MS_LITE_LOG: - Tensor %{public}d name is: %{public}s.\n", static_cast(i), - OH_AI_TensorGetName(tensor)); - LOGI("MS_LITE_LOG: - Tensor %{public}d size is: %{public}d.\n", static_cast(i), - (int)OH_AI_TensorGetDataSize(tensor)); - LOGI("MS_LITE_LOG: - Tensor data is:\n"); - auto out_data = reinterpret_cast(OH_AI_TensorGetData(tensor)); - std::stringstream outStr; - for (int i = 0; (i < OH_AI_TensorGetElementNum(tensor)) && (i <= K_NUM_PRINT_OF_OUT_DATA); i++) { - outStr << out_data[i] << " "; - } - LOGI("MS_LITE_LOG: %{public}s", outStr.str().c_str()); - } - return OH_AI_STATUS_SUCCESS; -} -// [End napi_image_classification_RunMSLiteModel] - -// [Start napi_image_classification_RunDemo] -static napi_value RunDemo(napi_env env, napi_callback_info info) -{ - // run demo - napi_value error_ret; - napi_create_int32(env, -1, &error_ret); - // 传入数据处理 - size_t argc = 2; - napi_value argv[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - bool isArray = false; - napi_is_array(env, argv[0], &isArray); - uint32_t length = 0; - // 获取数组的长度 - napi_get_array_length(env, argv[0], &length); - LOGI("MS_LITE_LOG: argv array length = %{public}d", length); - std::vector input_data; - double param = 0; - for (int i = 0; i < length; i++) { - napi_value value; - napi_get_element(env, argv[0], i, &value); - napi_get_value_double(env, value, ¶m); - input_data.push_back(static_cast(param)); - } - std::stringstream outstr; - for (int i = 0; i < K_NUM_PRINT_OF_OUT_DATA; i++) { - outstr << input_data[i] << " "; - } - LOGI("MS_LITE_LOG: input_data = %{public}s", outstr.str().c_str()); - // Read model file - const std::string modelName = "mobilenetv2.ms"; - LOGI("MS_LITE_LOG: Run model: %{public}s", modelName.c_str()); - size_t modelSize; - auto resourcesManager = OH_ResourceManager_InitNativeResourceManager(env, argv[1]); - auto modelBuffer = ReadModelFile(resourcesManager, modelName, &modelSize); - if (modelBuffer == nullptr) { - LOGE("MS_LITE_ERR: Read model failed"); - return error_ret; - } - LOGI("MS_LITE_LOG: Read model file success"); - - auto context = CreateMSLiteContext(modelBuffer); - if (context == nullptr) { - LOGE("MS_LITE_ERR: MSLiteFwk Build context failed.\n"); - return error_ret; - } - auto model = CreateMSLiteModel(modelBuffer, modelSize, context); - if (model == nullptr) { - OH_AI_ContextDestroy(&context); - LOGE("MS_LITE_ERR: MSLiteFwk Build model failed.\n"); - return error_ret; - } - int ret = RunMSLiteModel(model, input_data); - if (ret != OH_AI_STATUS_SUCCESS) { - OH_AI_ModelDestroy(&model); - OH_AI_ContextDestroy(&context); - LOGE("MS_LITE_ERR: RunMSLiteModel failed.\n"); - return error_ret; - } - napi_value out_data; - napi_create_array(env, &out_data); - auto outputs = OH_AI_ModelGetOutputs(model); - OH_AI_TensorHandle output_0 = outputs.handle_list[0]; - float *output0Data = reinterpret_cast(OH_AI_TensorGetMutableData(output_0)); - for (size_t i = 0; i < OH_AI_TensorGetElementNum(output_0); i++) { - napi_value element; - napi_create_double(env, static_cast(output0Data[i]), &element); - napi_set_element(env, out_data, i, element); - } - OH_AI_ModelDestroy(&model); - OH_AI_ContextDestroy(&context); - LOGI("MS_LITE_LOG: Exit runDemo()"); - return out_data; -} -// [End napi_image_classification_RunDemo] - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = {{"runDemo", nullptr, RunDemo, nullptr, nullptr, nullptr, napi_default, nullptr}}; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/types/libentry/Index.d.ts b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 9ce29ddba4f9f41b6b70481c6097301785e89ef0..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -// [Start index_image_classification_runDemo] -export const runDemo: (a: number[], b:Object) => Array; -// [End index_image_classification_runDemo] \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/types/libentry/oh-package.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 45de8340cb802473bc93a22563c87a0c0f284f00..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2024-2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "MindSpore Lite inference module" -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/ets/entryability/EntryAbility.ets b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index fb75f1465efd57dd5a3748789ef5cf4bfb4693c1..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2024-2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 8e4de99282050bad799ac892eb85ac5449364a51..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,16 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/ets/pages/Index.ets b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 43afbd0a2b973b4593e09031fdb94e1276131e94..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,338 +0,0 @@ -/* -* Copyright (c) 2024-2025 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. -*/ - -// [Start index_image_classification] -import msliteNapi from 'libentry.so'; -import { photoAccessHelper } from '@kit.MediaLibraryKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { image } from '@kit.ImageKit'; -import { fileIo } from '@kit.CoreFileKit'; -import { abilityAccessCtrl, Permissions } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const TAG = 'MindSporeLite'; -const PERMISSIONS: Permissions[] = ['ohos.permission.READ_IMAGEVIDEO']; - -@Entry -@Component -struct Index { - @State message: string = 'MindSporeLite C Demo'; - @State modelName: string = 'mobilenetv2.ms'; - @State modelInputHeight: number = 224; - @State modelInputWidth: number = 224; - @State uris: Array = []; - @State max: number = 0; - @State maxIndex: number = 0; - @State maxArray: Array = []; - @State maxIndexArray: Array = []; - // [StartExclude index_image_classification] - @State labelsNameMap: string[] = [ - 'Herd', 'Safari', 'Bangle', 'Cushion', 'Countertop', - 'Prom', 'Branch', 'Sports', 'Sky', 'Community', - 'Wheel', 'Cola', 'Tuxedo', 'Flowerpot', 'Team', - 'Computer', 'Unicycle', 'Brig', 'Aerospace engineering', 'Scuba diving', - 'Goggles', 'Fruit', 'Badminton', 'Horse', 'Sunglasses', - 'Fun', 'Prairie', 'Poster', 'Flag', 'Speedboat', - 'Eyelash', 'Veil', 'Mobile phone', 'Wheelbarrow', 'Saucer', - 'Leather', 'Drawer', 'Paper', 'Pier', 'Waterfowl', - 'Tights', 'Rickshaw', 'Vegetable', 'Handrail', 'Ice', - 'Metal', 'Flower', 'Wing', 'Silverware', 'Event', - 'Skyline', 'Money', 'Comics', 'Handbag', 'Porcelain', - 'Rodeo', 'Curtain', 'Tile', 'Human mouth', 'Army', - 'Menu', 'Boat', 'Snowboarding', 'Cairn terrier', 'Net', - 'Pasteles', 'Cup', 'Rugby', 'Pho', 'Cap', - 'Human hair', 'Surfing', 'Loveseat', 'Museum', 'Shipwreck', - 'Trunk (Tree)', 'Plush', 'Monochrome', 'Volcano', 'Rock', - 'Pillow', 'Presentation', 'Nebula', 'Subwoofer', 'Lake', - 'Sledding', 'Bangs', 'Tablecloth', 'Necklace', 'Swimwear', - 'Standing', 'Jeans', 'Carnival', 'Softball', 'Centrepiece', - 'Skateboarder', 'Cake', 'Dragon', 'Aurora', 'Skiing', - 'Bathroom', 'Dog', 'Needlework', 'Umbrella', 'Church', - 'Fire', 'Piano', 'Denim', 'Bridle', 'Cabinetry', - 'Lipstick', 'Ring', 'Television', 'Roller', 'Seal', - 'Concert', 'Product', 'News', 'Fast food', 'Horn (Animal)', - 'Tattoo', 'Bird', 'Bridegroom', 'Love', 'Helmet', - 'Dinosaur', 'Icing', 'Miniature', 'Tire', 'Toy', - 'Icicle', 'Jacket', 'Coffee', 'Mosque', 'Rowing', - 'Wetsuit', 'Camping', 'Underwater', 'Christmas', 'Gelato', - 'Whiteboard', 'Field', 'Ragdoll', 'Construction', 'Lampshade', - 'Palace', 'Meal', 'Factory', 'Cage', 'Clipper (Boat)', - 'Gymnastics', 'Turtle', 'Human foot', 'Marriage', 'Web page', - 'Human beard', 'Fog', 'Wool', 'Cappuccino', 'Lighthouse', - 'Lego', 'Sparkler', 'Sari', 'Model', 'Temple', - 'Beanie', 'Building', 'Waterfall', 'Penguin', 'Cave', - 'Stadium', 'Smile', 'Human hand', 'Park', 'Desk', - 'Shetland sheepdog', 'Bar', 'Eating', 'Neon', 'Dalmatian', - 'Crocodile', 'Wakeboarding', 'Longboard', 'Road', 'Race', - 'Kitchen', 'Odometer', 'Cliff', 'Fiction', 'School', - 'Interaction', 'Bullfighting', 'Boxer', 'Gown', 'Aquarium', - 'Superhero', 'Pie', 'Asphalt', 'Surfboard', 'Cheeseburger', - 'Screenshot', 'Supper', 'Laugh', 'Lunch', 'Party ', - 'Glacier', 'Bench', 'Grandparent', 'Sink', 'Pomacentridae', - 'Blazer', 'Brick', 'Space', 'Backpacking', 'Stuffed toy', - 'Sushi', 'Glitter', 'Bonfire', 'Castle', 'Marathon', - 'Pizza', 'Beach', 'Human ear', 'Racing', 'Sitting', - 'Iceberg', 'Shelf', 'Vehicle', 'Pop music', 'Playground', - 'Clown', 'Car', 'Rein', 'Fur', 'Musician', - 'Casino', 'Baby', 'Alcohol', 'Strap', 'Reef', - 'Balloon', 'Outerwear', 'Cathedral', 'Competition', 'Joker', - 'Blackboard', 'Bunk bed', 'Bear', 'Moon', 'Archery', - 'Polo', 'River', 'Fishing', 'Ferris wheel', 'Mortarboard', - 'Bracelet', 'Flesh', 'Statue', 'Farm', 'Desert', - 'Chain', 'Aircraft', 'Textile', 'Hot dog', 'Knitting', - 'Singer', 'Juice', 'Circus', 'Chair', 'Musical instrument', - 'Room', 'Crochet', 'Sailboat', 'Newspaper', 'Santa claus', - 'Swamp', 'Skyscraper', 'Skin', 'Rocket', 'Aviation', - 'Airliner', 'Garden', 'Ruins', 'Storm', 'Glasses', - 'Balance', 'Nail (Body part)', 'Rainbow', 'Soil ', 'Vacation ', - 'Moustache', 'Doily', 'Food', 'Bride ', 'Cattle', - 'Pocket', 'Infrastructure', 'Train', 'Gerbil', 'Fireworks', - 'Pet', 'Dam', 'Crew', 'Couch', 'Bathing', - 'Quilting', 'Motorcycle', 'Butterfly', 'Sled', 'Watercolor paint', - 'Rafting', 'Monument', 'Lightning', 'Sunset', 'Bumper', - 'Shoe', 'Waterskiing', 'Sneakers', 'Tower', 'Insect', - 'Pool', 'Placemat', 'Airplane', 'Plant', 'Jungle', - 'Armrest', 'Duck', 'Dress', 'Tableware', 'Petal', - 'Bus', 'Hanukkah', 'Forest', 'Hat', 'Barn', - 'Tubing', 'Snorkeling', 'Cool', 'Cookware and bakeware', 'Cycling', - 'Swing (Seat)', 'Muscle', 'Cat', 'Skateboard', 'Star', - 'Toe', 'Junk', 'Bicycle', 'Bedroom', 'Person', - 'Sand', 'Canyon', 'Tie', 'Twig', 'Sphynx', - 'Supervillain', 'Nightclub', 'Ranch', 'Pattern', 'Shorts', - 'Himalayan', 'Wall', 'Leggings', 'Windsurfing', 'Deejay', - 'Dance', 'Van', 'Bento', 'Sleep', 'Wine', - 'Picnic', 'Leisure', 'Dune', 'Crowd', 'Kayak', - 'Ballroom', 'Selfie', 'Graduation', 'Frigate', 'Mountain', - 'Dude', 'Windshield', 'Skiff', 'Class', 'Scarf', - 'Bull', 'Soccer', 'Bag', 'Basset hound', 'Tractor', - 'Swimming', 'Running', 'Track', 'Helicopter', 'Pitch', - 'Clock', 'Song', 'Jersey', 'Stairs', 'Flap', - 'Jewellery', 'Bridge', 'Cuisine', 'Bread', 'Caving', - 'Shell', 'Wreath', 'Roof', 'Cookie', 'Canoe' - ]; - - aboutToAppear() { - abilityAccessCtrl.createAtManager().requestPermissionsFromUser(this.getUIContext().getHostContext(), - PERMISSIONS).then((data) => { - if (data.authResults[0] === 0) { - hilog.info(0xFF00, TAG, '%{public}s', 'request permission success'); - } else { - hilog.info(0xFF00, TAG, '%{public}s', 'user rejected'); - } - }).catch((err: BusinessError) => { - hilog.error(0xFF00, TAG, '%{public}s', - `request permission failed, error message: ${(err as BusinessError).message}`); - }); - } - // [EndExclude index_image_classification] - - build() { - Row() { - Column() { - Text(this.message) - // [StartExclude index_image_classification] - .fontSize(30) - .fontWeight(FontWeight.Bold); - //图片显示 - Image(this.uris[0]).width(320).height(540).margin(15) - //显示分类最大值 - if (this.max) { - Text(this.labelsNameMap[this.maxIndexArray[0]] + - ': ' + - (this.maxArray[0] / 100).toString() + - '%\n' + - this.labelsNameMap[this.maxIndexArray[1]] + - ': ' + - (this.maxArray[1] / 100).toString() + - '%\n' + - this.labelsNameMap[this.maxIndexArray[2]] + - ': ' + - (this.maxArray[2] / 100).toString() + - '%\n' + - this.labelsNameMap[this.maxIndexArray[3]] + - ': ' + - (this.maxArray[3] / 100).toString() + - '%').focusable(true).fontSize(20) - } - // [EndExclude index_image_classification] - Button() { - Text('photo') - .fontSize(30) - .fontWeight(FontWeight.Bold) - } - // [StartExclude index_image_classification] - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('40%') - .height('5%') - // [EndExclude index_image_classification] - .onClick(() => { - let resMgr = this.getUIContext()?.getHostContext()?.getApplicationContext().resourceManager; - if (resMgr === null || resMgr === undefined){ - hilog.error(0xFF00, TAG, '%{public}s', `MS_LITE_ERR: get resMgr failed.`); - return - } - - // 获取相册图片 - // 1.创建图片文件选择实例 - let photoSelectOptions = new photoAccessHelper.PhotoSelectOptions(); - - // 2.设置选择媒体文件类型为IMAGE,设置选择媒体文件的最大数目 - photoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE; - photoSelectOptions.maxSelectNumber = 1; - - // 3.创建图库选择器实例,调用select()接口拉起图库界面进行文件选择。文件选择成功后,返回photoSelectResult结果集。 - let photoPicker = new photoAccessHelper.PhotoViewPicker(); - photoPicker.select(photoSelectOptions, - async (err: BusinessError, photoSelectResult: photoAccessHelper.PhotoSelectResult) => { - if (err) { - hilog.error(0xFF00, TAG, '%{public}s', - `MS_LITE_ERR: PhotoViewPicker.select failed with err: ${JSON.stringify(err)}`); - return; - } - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: PhotoViewPicker.select successfully, uri: ${JSON.stringify(photoSelectResult)}`); - this.uris = photoSelectResult.photoUris; - hilog.info(0xFF00, TAG, '%{public}s', `MS_LITE_LOG: uri: ${this.uris}`); - - // 预处理图片数据 - try { - // 1.使用fileIo.openSync接口,通过uri打开这个文件得到fd - let file = fileIo.openSync(this.uris[0], fileIo.OpenMode.READ_ONLY); - hilog.info(0xFF00, TAG, '%{public}s', `MS_LITE_LOG: file fd: ${file.fd}`); - - // 2.通过fd使用fileIo.readSync接口读取这个文件内的数据 - let inputBuffer = new ArrayBuffer(4096000); - let readLen = fileIo.readSync(file.fd, inputBuffer); - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: readSync data to file succeed and inputBuffer size is: ${readLen}`); - - // 3.通过PixelMap预处理 - let imageSource = image.createImageSource(file.fd); - if (imageSource === undefined) { - hilog.error(0xFF00, TAG, '%{public}s', `MS_LITE_ERR: createImageSource failed.`); - return - } - imageSource.createPixelMap({ editable: true }).then((pixelMap) => { - pixelMap.getImageInfo().then((info) => { - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: info.width = ${info.size.width}`); - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: info.height = ${info.size.height}`); - - // 4.根据模型输入的尺寸,将图片裁剪为对应的size,获取图片buffer数据readBuffer - pixelMap.scale(256.0 / info.size.width, 256.0 / info.size.height).then(() => { - pixelMap.crop({ - x: 16, - y: 16, - size: { height: this.modelInputHeight, width: this.modelInputWidth } - }).then(async () => { - let info = await pixelMap.getImageInfo(); - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: crop info.width = ${info.size.width}`); - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: crop info.height = ${info.size.height}`); - // 需要创建的像素buffer大小 - let readBuffer = new ArrayBuffer(this.modelInputHeight * this.modelInputWidth * 4); - await pixelMap.readPixelsToBuffer(readBuffer); - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: Succeeded in reading image pixel data, buffer: ${readBuffer.byteLength}`); - // 处理readBuffer,转换成float32格式,并进行标准化处理 - const imageArr = - new Uint8Array(readBuffer.slice(0, this.modelInputHeight * this.modelInputWidth * 4)); - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: imageArr length: ${imageArr.length}`); - - let means = [0.485, 0.456, 0.406]; - let stds = [0.229, 0.224, 0.225]; - let float32View = new Float32Array(this.modelInputHeight * this.modelInputWidth * 3); - let index = 0; - for (let i = 0; i < imageArr.length; i++) { - if ((i + 1) % 4 === 0) { - float32View[index] = (imageArr[i - 3] / 255.0 - means[0]) / stds[0]; // B - float32View[index+1] = (imageArr[i - 2] / 255.0 - means[1]) / stds[1]; // G - float32View[index+2] = (imageArr[i - 1] / 255.0 - means[2]) / stds[2]; // R - index += 3; - } - } - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: float32View length: ${float32View.length}`); - let printStr = 'float32View data:'; - for (let i = 0; i < 20; i++) { - printStr += ' ' + float32View[i]; - } - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: float32View data: ${printStr}`); - - // 调用c++的runDemo - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: *** Start MSLite Demo ***`); - - let output: Array = msliteNapi.runDemo(Array.from(float32View), resMgr); - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_WARN: output length = ${output.length}, value = ${output.slice(0, 20)}`); - - // 取分类占比的最大值top5 - this.max = 0; - this.maxIndex = 0; - this.maxArray = []; - this.maxIndexArray = []; - let newArray = output.filter(value => value !== this.max); - for (let n = 0; n < 5; n++) { - this.max = output[0]; - this.maxIndex = 0; - // 取最大值 - for (let m = 0; m < newArray.length; m++) { - if (newArray[m] > this.max) { - this.max = newArray[m]; - this.maxIndex = m; - } - } - this.maxArray.push(Math.round(this.max * 10000)); - this.maxIndexArray.push(this.maxIndex); - // filter数组过滤函数 - newArray = newArray.filter(value => value !== this.max); - } - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: max: ${this.maxArray}`); - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: maxIndex: ${this.maxIndexArray}`); - - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: *** Finished MSLite Demo ***`); - }).catch((error: BusinessError) => { - hilog.error(0xFF00, TAG, '%{public}s', - `MS_LITE_ERR: getRawFileContent promise error is: ${error}`); - }) - }) - // 5.关闭文件 - fileIo.closeSync(file); - }) - }) - } catch (err) { - hilog.error(0xFF00, TAG, '%{public}s', - `MS_LITE_ERR: uri: open file fd failed. ${err}`); - } - }) - }) - }.width('100%') - } - .height('100%') - } -} -// [End index_image_classification] \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/module.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/module.json5 deleted file mode 100644 index f73ac7fcc3291d45993d97d83d7dd580a63a9cac..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/module.json5 +++ /dev/null @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2024-2025 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": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:startIcon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.READ_IMAGEVIDEO", - "reason": "$string:read_image_video_permission", - "usedScene": { - "when": "inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/element/color.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/element/float.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/element/string.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 94723c4c5ab9609f947571a8bb87ae82bebaab03..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "MindSporeLiteC" - }, - { - "name": "completed", - "value": "完成" - }, - { - "name": "read_image_video_permission", - "value": "读取用户公共目录的图片或视频文件" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/background.png b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/foreground.png b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/layered_image.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/startIcon.png b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 1090fe07135c34ccf8875f73595ad0ddad9f66e1..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/profile/backup_config.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/profile/main_pages.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/dark/element/color.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/rawfile/mobilenetv2.ms b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/rawfile/mobilenetv2.ms deleted file mode 100644 index a0f6a8d9fc5660977abae6d8600019c817677440..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/main/resources/rawfile/mobilenetv2.ms +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2e92f251021d17ed29f0d4484f050285534873b644e7dfa4cbd4e26ce999d94 -size 11447840 diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/mock/Libentry.mock.ets b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index c2171716d040a605ef6af71e90b937a945f2677d..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,7 +0,0 @@ -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/mock/mock-config.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/mock/mock-config.json5 deleted file mode 100644 index 4c32bc5586f947333b9f955ac40b098f2ab2b04c..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/test/Ability.test.ets b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 18c0d12f2cb483b2fb1b1f942b124b5b932f93b1..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,118 +0,0 @@ -/* -* Copyright (c) 2024-2025 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 { describe, it, expect } from '@ohos/hypium'; -import Want from '@ohos.app.ability.Want'; -import Base from '@ohos.base'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; -import { getString } from '../utils/ResourceUtil'; - -const BUNDLE = 'MindSporeLiteCDemo_'; -const TAG = 'abilityTest'; -const DOMAIN: number = 0xF811; - -export default function abilityTest() { - let driver: Driver = Driver.create(); - describe('MindSporeLiteCDemoTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - /* - * @tc.number: MindSporeLiteCDemoTest_000 - * @tc.name: Start Ability - * @tc.desc: Start Ability - * @tc.size: MediumTest - * @tc.type: Function - * @tc.level Level 1 - */ - it('EntryAbility', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'EntryAbility_001 begin'); - // Start Ability - let want: Want = { - bundleName: 'com.samples.mindsporelitecdemo', - abilityName: 'EntryAbility' - }; - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - abilityDelegator.startAbility(want, (err: Base.BusinessError) => { - hilog.info(DOMAIN, TAG, 'StartAbility get err ' + JSON.stringify(err)); - expect(err).assertNull(); - }) - await driver.delayMs(3000); - // 用户授权 - await driver.assertComponentExist(ON.text( - await abilityDelegator.getAppContext().resourceManager.getStringValue($r('app.string.allow')))); - let permissionAllowBtn = await driver.findComponent(ON.text( - await abilityDelegator.getAppContext().resourceManager.getStringValue($r('app.string.allow')))); - await permissionAllowBtn.click(); - await driver.delayMs(1000); - hilog.info(DOMAIN, TAG, BUNDLE + 'EntryAbility_001 end'); - done(); - }) - /** - * @tc.number : MindSporeLiteCDemoTest_001 - * @tc.name : open photo - * @tc.desc : open photo - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('IfExists', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'IfExists_001 begin'); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('MindSporeLite C Demo')); - await driver.assertComponentExist(ON.text('photo')); - expect(true).assertTrue(); - hilog.info(DOMAIN, TAG, BUNDLE + 'IfExists_001 end'); - done(); - }) - - /** - * @tc.number : MindSporeLiteCDemoTest_002 - * @tc.name : open photo and predict - * @tc.desc : open photo and predict - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('PhotoPredict', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'PhotoPredict_001 begin'); - await driver.delayMs(1000); - // click MindSporeLite C Demo - hilog.info(DOMAIN, TAG, BUNDLE + 'PhotoPredict_001 click photo button'); - await driver.assertComponentExist(ON.text('photo')); - let msPhoto = await driver.findComponent(ON.text('photo')); - await msPhoto.click(); - await driver.delayMs(5000); - // chose a photo - let gridItems = await driver.findComponents(ON.type('GridItem')); - await gridItems[1].click(); - await driver.delayMs(5000); - // click complete - let tipCompleted: string = getString($r('app.string.completed')); - await driver.assertComponentExist(ON.text(tipCompleted)); - let finish = await driver.findComponent(ON.text(tipCompleted)); - await driver.delayMs(5000); - await finish.click(); - await driver.delayMs(5000); - // predict - await driver.assertComponentExist(ON.text('MindSporeLite C Demo')); - await driver.assertComponentExist(ON.text('%', 1)); - await driver.delayMs(5000); - expect(true).assertTrue(); - hilog.info(DOMAIN, TAG, BUNDLE + 'PhotoPredict_001 end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/test/List.test.ets b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/utils/Logger.ts b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/utils/Logger.ts deleted file mode 100644 index efdf004b93e46d9c135e0f775f2b9b20b5fd3688..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/utils/Logger.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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 '@ohos.hilog'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s, %{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('Sample_Image'); \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/utils/ResourceUtil.ets b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/utils/ResourceUtil.ets deleted file mode 100644 index a5f19f17d97dee413b528183febf96400b217dfc..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/ets/utils/ResourceUtil.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2025 Hunan OpenValley Digital Industry Development 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -const delegator = AbilityDelegatorRegistry.getAbilityDelegator(); - -export function getString(resourceData: Resource): string { - let manage = delegator.getAppContext().resourceManager - return manage.getStringSync(resourceData) -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/module.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/module.json5 deleted file mode 100644 index 40da0d8af6ff44622b93a5bff3a40217be575687..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/element/color.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/element/string.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 5955cede45230a0d21762a57af8717d6955ded40..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "completed", - "value": "完成" - }, - { - "name": "allow", - "value": "允许" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/media/icon.png b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/profile/test_pages.json b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/test/List.test.ets b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/test/LocalUnit.test.ets b/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/hvigor/hvigor-config.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/hvigor/hvigor-config.json5 deleted file mode 100644 index 9eb45235574eb082ecb2c5cc16aaecd4db0c0f02..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2025 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.1.1", - "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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/MindSporeLiteKit/MindSporeLiteCDemo/hvigorfile.ts b/MindSporeLiteKit/MindSporeLiteCDemo/hvigorfile.ts deleted file mode 100644 index 47113e2e36ecefde41c136272a0bd6ff745cffe4..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/oh-package.json5 b/MindSporeLiteKit/MindSporeLiteCDemo/oh-package.json5 deleted file mode 100644 index 4d1c4c5ca3f3467260e9eefdc92ebcf79758729e..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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.1.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/ohosTest.md b/MindSporeLiteKit/MindSporeLiteCDemo/ohosTest.md deleted file mode 100644 index 4adddf549920776d178c4c37f63bdade7e813000..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemo/ohosTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# MindSporeLiteCDemo 测试用例归档 - -## 用例表 - -|测试功能|预置条件|输入|预期输出|是否自动|测试结果| -|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------| -|拉起应用| 设备正常运行| |成功拉起应用|是|Pass| -|查看预览界面Text和Button| 进入预览界面 | |预览界面存在Text和Button|是|Pass| -|选取图片推理功能测试| 进入预览界面 | 点击photo按钮 |选取图片后进行推理|是|Pass| \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemo/screenshots/MindSporeLiteCDemoPic.png b/MindSporeLiteKit/MindSporeLiteCDemo/screenshots/MindSporeLiteCDemoPic.png deleted file mode 100644 index bd3250477ab961d139918a2f5f72e7d56bbd0dc6..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemo/screenshots/MindSporeLiteCDemoPic.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/.gitignore b/MindSporeLiteKit/MindSporeLiteCDemoASR/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/MindSporeLiteKit/MindSporeLiteCDemoASR/AppScope/app.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/AppScope/app.json5 deleted file mode 100644 index d2af04ffc3fcfc818bf02a6349c57fc91c6d9e4f..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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.samples.mindsporelitecdemoasr", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/AppScope/resources/base/element/string.json b/MindSporeLiteKit/MindSporeLiteCDemoASR/AppScope/resources/base/element/string.json deleted file mode 100644 index 9fabe320efdb4265f28ce8e0adcec47285aa6459..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "CDemo_test" - } - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/AppScope/resources/base/media/app_icon.png b/MindSporeLiteKit/MindSporeLiteCDemoASR/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemoASR/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/README_zh.md b/MindSporeLiteKit/MindSporeLiteCDemoASR/README_zh.md deleted file mode 100644 index 9bc749bf756f41bfefad8008b197b1cf8ef8e4d2..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/README_zh.md +++ /dev/null @@ -1,84 +0,0 @@ -# **基于**Native**接口的MindSpore Lite ASR 应用开发** - -### 介绍 - -本文基于MindSpore Lite提供的[Native API](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-mindspore-lite-kit/_mind_spore.md),实现“自动语音识别 ASR”示例程序,来演示端侧部署的流程。 - -### 效果预览 - -| 主页 | -| -------------------------------------------------- | -| | - -#### 使用说明 - -1. 在主界面点击“播放示例音频”按钮,即可播放音频文件; -2. 在主界面点击“识别示例音频”按钮,即可显示出音频的识别结果; - -### 工程目录 - -``` -entry -├── src/main -│   ├── ets -|   |   └── pages -|   |       └── Index.ets // 首页 -|   |       └── player.ets // 音频播放 -│   ├── cpp -|   |   └── mslite_napi.cpp // 推理函数 -|   |   └── CMakeLists.txt // 编译脚本 -|   |   └── third_party -|   |   └── librosa // 音频特征提取库 -|   |   └── libsamplerate // 音频重采样库 -|   |   └── types -|   |   └── libentry -|   |       └── Index.t.ts // 将C++动态库封装成JS模块 -│   ├── resources // 资源文件 -|   |   └── rawfile -|   |       └── tiny-encoder.ms // 存放的模型文件1 -|   |       └── tiny-decoder-main.ms // 存放的模型文件2 -|   |       └── tiny-decoder-loop.ms // 存放的模型文件3 -``` - -### 具体实现 - -* 本示例程序中使用的终端图像分类模型文件为[tiny-encoder.ms](entry\src\main\resources\rawfile\tiny-encoder.ms)、[tiny-decoder-main.ms](entry\src\main\resources\rawfile\tiny-decoder-main.ms)、[tiny-decoder-loop.ms](entry\src\main\resources\rawfile\tiny-decoder-loop.ms)。 - -* 调用[MindSpore Lite Native API](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-mindspore-lite-kit/_mind_spore.md)实现推理。完整代码请参见mslite_napi.cpp。 - - 说明:需要用户下载三方库,其中librosa来源是[LibrosaCpp](https://github.com/ewan-xu/LibrosaCpp),libsamplerate来源是[libsamplerate](https://github.com/libsndfile/libsamplerate),下载后置于[third_party](entry/src/main/cpp/third_party)目录下。AudioFile.h、base64.h、base64.cc来源是[whisper.axera](https://github.com/ml-inory/whisper.axera/tree/main/cpp/src),下载后置于[src](entry/src/main/cpp/src)目录下。 - -* 编写CMake脚本。链接MindSpore Lite动态库,完整代码请参见CMakeLists.txt。 - -* 使用N-API将C++动态库封装成JS模块,在[index.d.ts](entry/src/main/cpp/types/libentry/index.d.ts) 定义JS接口`runDemo()` 。 - -* 调用推理函数并处理结果。完整代码请参见Index.ets。 - -### 相关权限 - -无。 - -### 依赖 - -无。 - -### 约束与限制 - -1.本示例仅支持 HarmonyOS 5.0.0 及以上运行,测试设备:Phone; - -2.本示例为Stage模型,已适配API version 14版本SDK; - -3.本示例需要使用DevEco Studio 5.0.2Release及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo MindSporeLiteKit/MindSporeLiteCDemoASR/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` - diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/build-profile.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/build-profile.json5 deleted file mode 100644 index eea235ef425eebccc6655469376c25e845852fe2..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/build-profile.json5 +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "5.1.1(19)", - "compatibleSdkVersion": "5.1.1(19)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/code-linter.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/code-linter.json5 deleted file mode 100644 index e933bb7e85b32c303c78b409b44abe8e2f198645..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/.gitignore b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/.gitignore deleted file mode 100644 index 36cebc08fed900e5cecb39b110736acf00dd5598..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/build-profile.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/build-profile.json5 deleted file mode 100644 index a652b8ad69ccb8464bccf482096a72729fa94802..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/build-profile.json5 +++ /dev/null @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/hvigorfile.ts b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/hvigorfile.ts deleted file mode 100644 index 98d52319cb1dee60511b5716dba03b76e68a6d8b..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2025 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/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/obfuscation-rules.txt b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/oh-package.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/oh-package.json5 deleted file mode 100644 index 9c75ea3643ed82d16f84edf78024be9f08c43904..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2025 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": "MindSpore Lite inference module", - "main": "", - "author": "", - "license": "", - "dependencies": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/CMakeLists.txt b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index e673aceb5746cb0b074b60d1f131444cbb8dfef3..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(test) -# AudioFile.h -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(NATIVERENDER_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_PATH} - ${NATIVERENDER_PATH}/include) - -# libsamplerate -set(LIBSAMPLERATE_DIR ${NATIVERENDER_PATH}/third_party/libsamplerate) -include_directories(${LIBSAMPLERATE_DIR}/include) -add_subdirectory(${LIBSAMPLERATE_DIR}) - -include_directories(${NATIVERENDER_PATH}/third_party/opencc/include/opencc) -# src -aux_source_directory(src SRC_DIR) -include_directories(${NATIVERENDER_PATH}/src) - -include_directories(${CMAKE_SOURCE_DIR}/third_party) - -file(GLOB SRC src/*.cc) - - -add_library(entry SHARED mslite_napi.cpp ${SRC}) -target_link_libraries(entry PUBLIC samplerate) -target_link_libraries(entry PUBLIC mindspore_lite_ndk) -target_link_libraries(entry PUBLIC hilog_ndk.z) -target_link_libraries(entry PUBLIC rawfile.z) -target_link_libraries(entry PUBLIC ace_napi.z) \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/mslite_napi.cpp b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/mslite_napi.cpp deleted file mode 100644 index 85d711ef9acb12de263d62703cfb80e67523d7a5..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/mslite_napi.cpp +++ /dev/null @@ -1,632 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start napi_asr_headers] -#include "AudioFile.h" -#include "base64.h" -#include "napi/native_api.h" -#include "utils.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// [End napi_asr_headers] - -// [Start napi_asr_log] -#define LOGI(...) ((void)OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "[MSLiteNapi]", __VA_ARGS__)) -#define LOGD(...) ((void)OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, "[MSLiteNapi]", __VA_ARGS__)) -#define LOGW(...) ((void)OH_LOG_Print(LOG_APP, LOG_WARN, LOG_DOMAIN, "[MSLiteNapi]", __VA_ARGS__)) -#define LOGE(...) ((void)OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, "[MSLiteNapi]", __VA_ARGS__)) -// [End napi_asr_log] - -// [Start napi_asr_constants] -const float NEG_INF = -std::numeric_limits::infinity(); -const int WHISPER_SOT = 50258; -const int WHISPER_TRANSCRIBE = 50359; -const int WHISPER_TRANSLATE = 50358; -const int WHISPER_NO_TIMESTAMPS = 50363; -const int WHISPER_EOT = 50257; -const int WHISPER_BLANK = 220; -const int WHISPER_NO_SPEECH = 50362; -const int WHISPER_N_TEXT_CTX = 448; -const int WHISPER_N_TEXT_STATE = 384; // for tiny -constexpr int WHISPER_SAMPLE_RATE = 16000; -// [End napi_asr_constants] - -// [Start napi_print_num] -constexpr int K_NUM_PRINT_OF_OUT_DATA = 20; -// [End napi_print_num] - -// [Start napi_asr_BinBuffer] -using BinBuffer = std::pair; -// [End napi_asr_BinBuffer] - -// [Start napi_asr_FillInputTensor] -int FillInputTensor(OH_AI_TensorHandle input, const BinBuffer &bin) -{ - if (OH_AI_TensorGetDataSize(input) != bin.second) { - return OH_AI_STATUS_LITE_INPUT_PARAM_INVALID; - } - char *data = (char *)OH_AI_TensorGetMutableData(input); - memcpy(data, (const char *)bin.first, OH_AI_TensorGetDataSize(input)); - return OH_AI_STATUS_SUCCESS; -} -// [End napi_asr_FillInputTensor] - -// [Start napi_asr_read_file] -BinBuffer ReadBinFile(NativeResourceManager *nativeResourceManager, const std::string &modelName) -{ - auto rawFile = OH_ResourceManager_OpenRawFile(nativeResourceManager, modelName.c_str()); - if (rawFile == nullptr) { - LOGE("MS_LITE_ERR: Open model file failed"); - return BinBuffer(nullptr, 0); - } - long fileSize = OH_ResourceManager_GetRawFileSize(rawFile); - if (fileSize <= 0) { - LOGE("MS_LITE_ERR: FileSize not correct"); - return BinBuffer(nullptr, 0); - } - void *buffer = malloc(fileSize); - if (buffer == nullptr) { - LOGE("MS_LITE_ERR: OH_ResourceManager_ReadRawFile failed"); - return BinBuffer(nullptr, 0); - } - int ret = OH_ResourceManager_ReadRawFile(rawFile, buffer, fileSize); - if (ret == 0) { - LOGE("MS_LITE_ERR: OH_ResourceManager_ReadRawFile failed"); - OH_ResourceManager_CloseRawFile(rawFile); - return BinBuffer(nullptr, 0); - } - OH_ResourceManager_CloseRawFile(rawFile); - return BinBuffer(buffer, fileSize); -} - -BinBuffer ReadTokens(NativeResourceManager *nativeResourceManager, const std::string &modelName) -{ - auto rawFile = OH_ResourceManager_OpenRawFile(nativeResourceManager, modelName.c_str()); - if (rawFile == nullptr) { - LOGE("MS_LITE_ERR: Open model file failed"); - return BinBuffer(nullptr, 0); - } - long fileSize = OH_ResourceManager_GetRawFileSize(rawFile); - if (fileSize <= 0) { - LOGE("MS_LITE_ERR: FileSize not correct"); - return BinBuffer(nullptr, 0); - } - void *buffer = malloc(fileSize); - if (buffer == nullptr) { - LOGE("MS_LITE_ERR: OH_ResourceManager_ReadRawFile failed"); - return BinBuffer(nullptr, 0); - } - int ret = OH_ResourceManager_ReadRawFile(rawFile, buffer, fileSize); - if (ret == 0) { - LOGE("MS_LITE_ERR: OH_ResourceManager_ReadRawFile failed"); - OH_ResourceManager_CloseRawFile(rawFile); - return BinBuffer(nullptr, 0); - } - OH_ResourceManager_CloseRawFile(rawFile); - BinBuffer res(buffer, fileSize); - return res; -} -// [End napi_asr_read_file] - -// [Start napi_asr_context] -void DestroyModelBuffer(void **buffer) -{ - if (buffer == nullptr) { - return; - } - free(*buffer); - *buffer = nullptr; -} - -OH_AI_ModelHandle CreateMSLiteModel(BinBuffer &bin) -{ - // Set executing context for model. - auto context = OH_AI_ContextCreate(); - if (context == nullptr) { - DestroyModelBuffer(&bin.first); - LOGE("MS_LITE_ERR: Create MSLite context failed.\n"); - return nullptr; - } - auto cpu_device_info = OH_AI_DeviceInfoCreate(OH_AI_DEVICETYPE_CPU); - OH_AI_DeviceInfoSetEnableFP16(cpu_device_info, false); - OH_AI_ContextAddDeviceInfo(context, cpu_device_info); - - // Create model - auto model = OH_AI_ModelCreate(); - if (model == nullptr) { - DestroyModelBuffer(&bin.first); - LOGE("MS_LITE_ERR: Allocate MSLite Model failed.\n"); - return nullptr; - } - - // Build model object - auto build_ret = OH_AI_ModelBuild(model, bin.first, bin.second, OH_AI_MODELTYPE_MINDIR, context); - DestroyModelBuffer(&bin.first); - if (build_ret != OH_AI_STATUS_SUCCESS) { - OH_AI_ModelDestroy(&model); - LOGE("MS_LITE_ERR: Build MSLite model failed.\n"); - return nullptr; - } - LOGI("MS_LITE_LOG: Build MSLite model success.\n"); - return model; -} -// [End napi_asr_context] - -template -void PrintBinAs(const BinBuffer &bin, const std::string &name = "Vector", const size_t nVisible = 10) -{ - size_t n_elem = bin.second / sizeof(T); - std::stringstream ss; - const T *data = reinterpret_cast(bin.first); - for (size_t i = 0; i < bin.second / sizeof(T) && i < nVisible; i++) { - ss << data[i] << " "; - } - LOGD("MS_LITE_LOG: bin name: %{public}s, n_elem: %{public}zu, data: [%{public}s]", name.c_str(), n_elem, - ss.str().c_str()); -} - -void SaveToBinaryFile(const std::vector& data, const std::string& filename) -{ - // 打开文件,以二进制格式写入 - std::ofstream outFile(filename, std::ios::binary); - if (!outFile) { - throw std::runtime_error("无法打开文件进行写入!"); - } - // 写入数据到文件 - outFile.write(reinterpret_cast(data.data()), data.size() * sizeof(float)); - // 关闭文件 - outFile.close(); - std::cout << "数据已成功保存为二进制文件: " << filename << std::endl; -} - -// [Start napi_asr_RunMSLiteModel] -int RunMSLiteModel(OH_AI_ModelHandle model, std::vector inputBins) -{ - // Set input data for model. - auto inputs = OH_AI_ModelGetInputs(model); - for(int i = 0; i < inputBins.size(); i++) - { - auto ret = FillInputTensor(inputs.handle_list[i], inputBins[i]); - if (ret != OH_AI_STATUS_SUCCESS) { - LOGE("MS_LITE_ERR: set input %{public}d error.\n", i); - return OH_AI_STATUS_LITE_ERROR; - } - } - - // Get model output. - auto outputs = OH_AI_ModelGetOutputs(model); - - // Predict model. - auto predict_ret = OH_AI_ModelPredict(model, inputs, &outputs, nullptr, nullptr); - if (predict_ret != OH_AI_STATUS_SUCCESS) { - OH_AI_ModelDestroy(&model); - LOGE("MS_LITE_ERR: MSLite Predict error.\n"); - return OH_AI_STATUS_LITE_ERROR; - } - LOGD("MS_LITE_LOG: Run MSLite model Predict success.\n"); - - // Print output tensor data. - LOGD("MS_LITE_LOG: Get model outputs:\n"); - for (size_t i = 0; i < outputs.handle_num; i++) { - auto tensor = outputs.handle_list[i]; - LOGD("MS_LITE_LOG: - Tensor %{public}d name is: %{public}s.\n", static_cast(i), - OH_AI_TensorGetName(tensor)); - LOGD("MS_LITE_LOG: - Tensor %{public}d size is: %{public}d.\n", static_cast(i), - (int)OH_AI_TensorGetDataSize(tensor)); - LOGD("MS_LITE_LOG: - Tensor data is:\n"); - auto out_data = reinterpret_cast(OH_AI_TensorGetData(tensor)); - std::stringstream outStr; - for (int i = 0; (i < OH_AI_TensorGetElementNum(tensor)) && (i <= K_NUM_PRINT_OF_OUT_DATA); i++) { - outStr << out_data[i] << " "; - } - LOGD("MS_LITE_LOG: %{public}s", outStr.str().c_str()); - } - return OH_AI_STATUS_SUCCESS; -} -// [End napi_asr_RunMSLiteModel] - -std::vector ConvertIntVectorToFloat(const std::vector& vec) -{ - std::vector floatVec(vec.size()); - float* floatPtr = reinterpret_cast(const_cast(vec.data())); - for (size_t i = 0; i < vec.size(); ++i) { - floatVec[i] = *(floatPtr + i); - } - return floatVec; -} - -// [Start napi_asr_GetMSOutput] -BinBuffer GetMSOutput(OH_AI_TensorHandle output) -{ - float *outputData = reinterpret_cast(OH_AI_TensorGetMutableData(output)); - size_t size = OH_AI_TensorGetDataSize(output); - return {outputData, size}; -} -// [End napi_asr_GetMSOutput] - -std::vector GetVecOutput(OH_AI_TensorHandle output) -{ - float *outputData = reinterpret_cast(OH_AI_TensorGetMutableData(output)); - size_t len = OH_AI_TensorGetElementNum(output); - std::vector res(outputData, outputData + len); - return res; -} - -// [Start napi_asr_SuppressTokens] -void SuppressTokens(BinBuffer &logits, bool isInitial) -{ - auto logits_data = static_cast(logits.first); - if (isInitial) { - // 假设这两个值在 logits 中的索引位置 - logits_data[WHISPER_EOT] = NEG_INF; - logits_data[WHISPER_BLANK] = NEG_INF; - } - - // 其他令牌的抑制 - logits_data[WHISPER_NO_TIMESTAMPS] = NEG_INF; - logits_data[WHISPER_SOT] = NEG_INF; - logits_data[WHISPER_NO_SPEECH] = NEG_INF; - logits_data[WHISPER_TRANSLATE] = NEG_INF; -} -// [End napi_asr_SuppressTokens] - -template -void CompareVectorHelper(const T *data_a, const T *data_b, const std::string &label, size_t n, float rtol = 1e-3, - float atol = 5e-3) -{ - LOGD("MS_LITE_LOG: ==== 精度校验 ===="); - LOGD("MS_LITE_LOG: 比较 %{public}s", label.c_str()); - - bool all_close = true; - float max_diff = 0.0f; - - for (size_t i = 0; i < n; i++) { - const float diff = std::abs(data_a[i] - data_b[i]); - max_diff = std::max(max_diff, diff); - - // 精度容差校验 - if (diff > (atol + rtol * std::abs(data_b[i]))) { - all_close = false; - } - } - - LOGD("MS_LITE_LOG: 最大差值: %{public}.6f", max_diff); - LOGD("MS_LITE_LOG: all_close = %{public}d", all_close); - - if (!all_close) { - LOGD("MS_LITE_LOG: --- 数据不匹配详情 ---"); - - // 仅输出前5个差异元素 - constexpr int MAX_SHOW = 30; - int show_count = 0; - for (size_t i = 0; i < n && show_count < MAX_SHOW; ++i) { - float diff = data_a[i] - data_b[i]; - if (std::abs(diff) > (atol + rtol * std::abs(data_b[i])) && data_a[i] != 0.0f) { - LOGD("MS_LITE_LOG: 索引[%{public}zu]: %{public}.6f vs %{public}.6f (Δ=%{public}.6f)", i, data_a[i], - data_b[i], diff); - ++show_count; - } - } - LOGD("MS_LITE_LOG: === 数据不匹配,校验结束 ==="); - } - return; -} - -void CompareFloatVector(const BinBuffer &a, const BinBuffer &b, const std::string &label, float rtol = 1e-3, - float atol = 5e-3) -{ - // 检查数据尺寸 - assert(a.second == b.second); - const float *data_a = (const float *)a.first; - const float *data_b = (const float *)b.first; - CompareVectorHelper(data_a, data_b, label, b.second / sizeof(float), rtol, atol); -} - -void CompareFloatVector(const std::vector &fp_a, const BinBuffer &b, const std::string &label, float rtol = 1e-3, - float atol = 5e-3) -{ - // 检查数据尺寸 - assert(fp_a.size() * sizeof(float) == b.second); - - const float *data_a = (const float *)fp_a.data(); - const float *data_b = (const float *)b.first; - - CompareVectorHelper(data_a, data_b, label, b.second / sizeof(float), rtol, atol); -} - -void CompareIntVector(const BinBuffer &a, const BinBuffer &b, const std::string &label, float rtol = 1e-3, - float atol = 5e-3) -{ - // 检查数据尺寸 - assert(a.second == b.second); - - const int *data_a = (const int *)a.first; - const int *data_b = (const int *)b.first; - - CompareVectorHelper(data_a, data_b, label, b.second / sizeof(float), rtol, atol); -} - -// [Start napi_asr_predict] -std::vector LoopPredict(const OH_AI_ModelHandle model, const BinBuffer &n_layer_cross_k, - const BinBuffer &n_layer_cross_v, const BinBuffer &logits_init, - BinBuffer &out_n_layer_self_k_cache, BinBuffer &out_n_layer_self_v_cache, - const BinBuffer &data_embedding, const int loop, const int offset_init) -{ - // logits - BinBuffer logits{nullptr, 51865 * sizeof(float)}; - logits.first = malloc(logits.second); - if (!logits.first) { - LOGE("MS_LITE_ERR: Fail to malloc!\n"); - return {}; - } - void *logits_init_src = static_cast(logits_init.first) + 51865 * 3 * sizeof(float); - memcpy(logits.first, logits_init_src, logits.second); - SuppressTokens(logits, true); - - std::vector output_token; - float *logits_data = static_cast(logits.first); - int max_token_id = 0; - float max_token = logits_data[0]; - for (int i = 0; i < logits.second / sizeof(float); i++) { - if (logits_data[i] > max_token) { - max_token_id = i; - max_token = logits_data[i]; - } - } - - int offset = offset_init; - BinBuffer slice{nullptr, 0}; - slice.second = WHISPER_N_TEXT_STATE * sizeof(float); - slice.first = malloc(slice.second); - if (!slice.first) { - LOGE("MS_LITE_ERR: Fail to malloc!\n"); - return {}; - } - - auto out_n_layer_self_k_cache_new = out_n_layer_self_k_cache; - auto out_n_layer_self_v_cache_new = out_n_layer_self_v_cache; - - for (size_t i = 0; i < loop; i++) { - if (max_token_id == WHISPER_EOT) { - break; - } - output_token.push_back(max_token_id); - std::vector mask(WHISPER_N_TEXT_CTX, 0.0f); - for (size_t i = 0; i < WHISPER_N_TEXT_CTX - offset - 1; ++i) { - mask[i] = NEG_INF; - } - BinBuffer tokens{&max_token_id, sizeof(int)}; - - void *data_embedding_src = - static_cast(data_embedding.first) + offset * WHISPER_N_TEXT_STATE * sizeof(float); - memcpy(slice.first, data_embedding_src, slice.second); - // out_n_layer_self_k_cache - // out_n_layer_self_v_cache - // n_layer_cross_k - // n_layer_cross_v - // slice - // token - BinBuffer mask_bin(mask.data(), mask.size() * sizeof(float)); - int ret = RunMSLiteModel(model, {tokens, out_n_layer_self_k_cache_new, out_n_layer_self_v_cache_new, - n_layer_cross_k, n_layer_cross_v, slice, mask_bin}); - - auto outputs = OH_AI_ModelGetOutputs(model); - logits = GetMSOutput(outputs.handle_list[0]); - out_n_layer_self_k_cache_new = GetMSOutput(outputs.handle_list[1]); - out_n_layer_self_v_cache_new = GetMSOutput(outputs.handle_list[2]); - offset++; - SuppressTokens(logits, false); - logits_data = static_cast(logits.first); - max_token = logits_data[0]; - - for (int j = 0; j < logits.second / sizeof(float); j++) { - if (logits_data[j] > max_token) { - max_token_id = j; - max_token = logits_data[j]; - } - } - LOGI("MS_LITE_LOG: run decoder loop %{public}d ok!\n token = %{public}d", i, max_token_id); - } - return output_token; -} - -std::vector ProcessDataLines(const BinBuffer token_txt) -{ - void *data_ptr = token_txt.first; - size_t data_size = token_txt.second; - std::vector tokens; - - const char *char_data = static_cast(data_ptr); - std::stringstream ss(std::string(char_data, char_data + data_size)); - std::string line; - while (std::getline(ss, line)) { - size_t space_pos = line.find(' '); - tokens.push_back(line.substr(0, space_pos)); - } - return tokens; -} - -static napi_value RunDemo(napi_env env, napi_callback_info info) -{ - // run demo - napi_value error_ret; - napi_create_int32(env, -1, &error_ret); - size_t argc = 1; - napi_value argv[1] = {nullptr}; - napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - auto resourcesManager = OH_ResourceManager_InitNativeResourceManager(env, argv[0]); - - // preprocess - AudioFile audioFile; - std::string filePath = "zh.wav"; - auto audioBin = ReadBinFile(resourcesManager, filePath); - if (audioBin.first == nullptr) { - LOGE("MS_LITE_ERR: Fail to read %{public}s!", filePath.c_str()); - return error_ret; - } - size_t dataSize = audioBin.second; - uint8_t *dataBuffer = (uint8_t *)audioBin.first; - bool ok = audioFile.loadFromMemory(std::vector(dataBuffer, dataBuffer + dataSize)); - if (!ok) { - LOGE("MS_LITE_ERR: Fail to read %{public}s!", filePath.c_str()); - return error_ret; - } - std::vector data(audioFile.samples[0]); - ResampleAudio(data, audioFile.getSampleRate(), WHISPER_SAMPLE_RATE, 1, SRC_SINC_BEST_QUALITY); - std::vector audio(data); - - int padding = 480000; - int sr = 16000; - int n_fft = 480; - int n_hop = 160; - int n_mel = 80; - int fmin = 0; // Minimum frequency, default value is 0.0 Hz - int fmax = - sr / - 2.0; // Maximum frequency, default value is half of the sampling rate (sr / 2.0), i.e., the Nyquist frequency. - audio.insert(audio.end(), padding, 0.0f); - std::vector> mels_T = - librosa::Feature::melspectrogram(audio, sr, n_fft, n_hop, "hann", true, "reflect", 2.f, n_mel, fmin, fmax); - std::cout << "mels: " << std::endl; - - std::vector> mels = TransposeMel(mels_T); - ProcessMelSpectrogram(mels); - - std::vector inputMels(mels.size() * mels[0].size(), 0); - for (int i = 0; i < mels.size(); i++) { - std::copy(mels[i].begin(), mels[i].end(), inputMels.begin() + i * mels[0].size()); - } - - BinBuffer inputMelsBin(inputMels.data(), inputMels.size() * sizeof(float)); - - // tiny-encoder.ms predict - auto encoderBin = ReadBinFile(resourcesManager, "tiny-encoder.ms"); - if (encoderBin.first == nullptr) { - free(dataBuffer); - dataBuffer = nullptr; - return error_ret; - } - - auto encoder = CreateMSLiteModel(encoderBin); - - int ret = RunMSLiteModel(encoder, {inputMelsBin}); - if (ret != OH_AI_STATUS_SUCCESS) { - OH_AI_ModelDestroy(&encoder); - return error_ret; - } - LOGI("MS_LITE_LOG: run encoder ok!\n"); - - auto outputs = OH_AI_ModelGetOutputs(encoder); - auto n_layer_cross_k = GetMSOutput(outputs.handle_list[0]); - auto n_layer_cross_v = GetMSOutput(outputs.handle_list[1]); - - // tiny-decoder-main.ms predict - std::vector SOT_SEQUENCE = {WHISPER_SOT, - WHISPER_SOT + 1 + 1, // wait to modify - WHISPER_TRANSCRIBE, WHISPER_NO_TIMESTAMPS}; - BinBuffer sotSequence(SOT_SEQUENCE.data(), SOT_SEQUENCE.size() * sizeof(int)); - - const std::string decoder_main_path = "tiny-decoder-main.ms"; - auto decoderMainBin = ReadBinFile(resourcesManager, decoder_main_path); - if (decoderMainBin.first == nullptr) { - OH_AI_ModelDestroy(&encoder); - return error_ret; - } - auto decoder_main = CreateMSLiteModel(decoderMainBin); - int ret2 = RunMSLiteModel(decoder_main, {sotSequence, n_layer_cross_k, n_layer_cross_v}); - - if (ret2 != OH_AI_STATUS_SUCCESS) { - OH_AI_ModelDestroy(&decoder_main); - return error_ret; - } - LOGI("MS_LITE_LOG: run decoder_main ok!\n"); - - auto decoderMainOut = OH_AI_ModelGetOutputs(decoder_main); - auto logitsBin = GetMSOutput(decoderMainOut.handle_list[0]); - auto out_n_layer_self_k_cache_Bin = GetMSOutput(decoderMainOut.handle_list[1]); - auto out_n_layer_self_v_cache_Bin = GetMSOutput(decoderMainOut.handle_list[2]); - - // tiny-decoder-loop.ms predict - const std::string modelName3 = "tiny-decoder-loop.ms"; - auto modelBuffer3 = ReadBinFile(resourcesManager, modelName3); - auto decoder_loop = CreateMSLiteModel(modelBuffer3); - - const std::string dataName_embedding = "tiny-positional_embedding.bin"; // read input data - auto data_embedding = ReadBinFile(resourcesManager, dataName_embedding); - if (data_embedding.first == nullptr) { - OH_AI_ModelDestroy(&encoder); - OH_AI_ModelDestroy(&decoder_main); - OH_AI_ModelDestroy(&decoder_loop); - return error_ret; - } - - int loop_times = WHISPER_N_TEXT_CTX - SOT_SEQUENCE.size(); - int offset_init = SOT_SEQUENCE.size(); - auto output_tokens = - LoopPredict(decoder_loop, n_layer_cross_k, n_layer_cross_v, logitsBin, out_n_layer_self_k_cache_Bin, - out_n_layer_self_v_cache_Bin, data_embedding, loop_times, offset_init); - - std::vector token_tables = ProcessDataLines(ReadTokens(resourcesManager, "tiny-tokens.txt")); - std::string result; - for (const auto i : output_tokens) { - char str[1024]; - base64_decode((const uint8 *)token_tables[i].c_str(), (uint32)token_tables[i].size(), str); - result += str; - } - LOGI("MS_LITE_LOG: result is -> %{public}s", result.c_str()); - - OH_AI_ModelDestroy(&encoder); - OH_AI_ModelDestroy(&decoder_main); - OH_AI_ModelDestroy(&decoder_loop); - - napi_value out_data; - napi_create_string_utf8(env, result.c_str(), result.length(), &out_data); - return out_data; -} -// [End napi_asr_predict] - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = {{"runDemo", nullptr, RunDemo, nullptr, nullptr, nullptr, napi_default, nullptr}}; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/src/utils.cc b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/src/utils.cc deleted file mode 100644 index 3768f72033626b102da86e70fb95abf659203956..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/src/utils.cc +++ /dev/null @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -#include "utils.h" -#include -#include - -std::vector> TransposeMel(const std::vector>& mels) { - if (mels.empty()) return {}; - - size_t rows = mels.size(); - size_t cols = mels[0].size(); - - std::vector> result(cols, std::vector(rows)); - - for (size_t i = 0; i < rows; ++i) { - for (size_t j = 0; j < cols; ++j) { - result[j][i] = mels[i][j]; - } - } - return result; -} - -std::vector ResampleAudio( - const std::vector& input_data, - int input_sample_rate, - int output_sample_rate, - int channel, - int converter -) { - if (input_data.empty() || input_sample_rate <= 0 || output_sample_rate <= 0) { - throw std::invalid_argument("Invalid input parameters"); - } - - double ratio = static_cast(output_sample_rate) / input_sample_rate; - - size_t output_size = static_cast(input_data.size() * ratio + 0.5); - std::vector output_data(output_size); - - SRC_DATA src_data; - src_data.data_in = input_data.data(); - src_data.input_frames = input_data.size(); - src_data.data_out = output_data.data(); - src_data.output_frames = output_size; - src_data.src_ratio = ratio; - src_data.end_of_input = 1; - - int error = src_simple(&src_data, converter, 1); - if (error) { - std::cout << "error src_simple filed " << std::endl; - } - - return output_data; -} - -void ProcessMelSpectrogram(std::vector>& mels) { - // log_spec = np.log10(np.maximum(mel, 1e-10)) - for (auto& row : mels) { - for (auto& val : row) { - val = std::log10(std::max(val, 1e-10f)); - } - } - // log_spec = np.maximum(log_spec, log_spec.max() - 8.0) - float max_val = -std::numeric_limits::infinity(); - for (const auto& row : mels) { - for (const auto& val : row) { - if (val > max_val){ - max_val = val; - } - } - } - std::vector>& log_spec = mels; - const float threshold = max_val - 8.0f; - for (auto& row : mels) { - for (auto& val : row) { - val = (std::max(val, threshold) + 4.0f) /4.0f; - } - } - - size_t target = 3000; - int current_cols = mels[0].size(); - if (current_cols > target) { - for (auto& row : mels) { - row.resize(target); - } - for (auto& row : mels) { - int start_zero = std::max(0, static_cast(row.size()) - 50); - std::fill(row.begin() + start_zero, row.end(), 0.0f); - } - } else if (current_cols < target) { - int padding = target - current_cols; - for (auto& row : mels) { - row.insert(row.end(), padding, 0.0f); - } - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/src/utils.h b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/src/utils.h deleted file mode 100644 index eda54d17225958fcb207f4cdbfe9b02d5d273e88..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/src/utils.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -#include -#include -#include "AudioFile.h" -#include "samplerate.h" - -std::vector> TransposeMel(const std::vector>& mels); -std::vector ResampleAudio( - const std::vector& input_data, - int input_sample_rate, - int output_sample_rate, - int channels, - int converter -); -void ProcessMelSpectrogram(std::vector>& mels); - - diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/third_party/.gitkeep b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/third_party/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/types/libentry/Index.d.ts b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 20ac82a447306bb61579b8aa35347fa8c6b0ed6b..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start index_asr_runDemo] -export const runDemo: (a: Object) => string; -// [Start index_asr_runDemo] \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/types/libentry/oh-package.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index ce8db2ffad3172a4cf0ecd76db460ea6740bb3ff..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "MindSpore Lite inference module." -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/entryability/EntryAbility.ets b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index ea20748099f5052b9f7b3c24624ca7237dec2561..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2025 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/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index aabb65eafe1c29fedba130aa050d7ac23656c1b3..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/pages/Index.ets b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index c6cf5594e346eae44fb45c224f9311427b40892b..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -// [Start index_asr] -import msliteNapi from 'libentry.so' -import AVPlayerDemo from './player'; -import { transverter, TransverterType, TransverterLanguage } from "@nutpi/chinese_transverter" -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const TAG = 'MindSporeLite'; - -@Entry -@Component -struct Index { - @State message: string = 'MSLite Whisper Demo'; - @State wavName: string = 'zh.wav'; - @State content: string = ''; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(30) - .fontWeight(FontWeight.Bold); - Button() { - Text($r('app.string.play')) - .fontSize(20) - .fontWeight(FontWeight.Medium) - } - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('40%') - .height('5%') - .onClick(async () =>{ - // 通过实例调用类中的函数 - hilog.info(0xFF00, TAG, '%{public}s', `MS_LITE_LOG: begin to play wav.`); - let myClass = new AVPlayerDemo(); - myClass.avPlayerFdSrcDemo(); - }) - Button() { - Text($r('app.string.asr')) - .fontSize(20) - .fontWeight(FontWeight.Medium) - } - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('40%') - .height('5%') - .onClick(() => { - let resMgr = this.getUIContext()?.getHostContext()?.getApplicationContext().resourceManager; - if (resMgr === undefined || resMgr === null) { - hilog.error(0xFF00, TAG, '%{public}s', `MS_LITE_ERR: get resourceManager failed.`); - return - } - // 调用封装的runDemo函数 - hilog.info(0xFF00, TAG, '%{public}s', `MS_LITE_LOG: *** Start MSLite Demo ***`); - let output = msliteNapi.runDemo(resMgr); - if (output === null || output.length === 0) { - hilog.error(0xFF00, TAG, '%{public}s', `MS_LITE_ERR: runDemo failed.`); - return - } - hilog.info(0xFF00, TAG, '%{public}s', - `MS_LITE_LOG: output length = ${output.length}; value = ${output.slice(0, 20)}`); - this.content = output; - hilog.info(0xFF00, TAG, '%{public}s', `MS_LITE_LOG: *** Finished MSLite Demo ***`); - }) - - // 显示识别内容 - if (this.content) { - Text('识别内容: \n' + transverter({ - type: TransverterType.SIMPLIFIED, - str: this.content, - language: TransverterLanguage.ZH_CN - }) + '\n').focusable(true).fontSize(20).height('20%') - } - }.width('100%') - } - .height('100%') - } -} -// [End index_asr] diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/pages/player.ets b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/pages/player.ets deleted file mode 100644 index 99f06bf1ac7ad85e46c7ae33b97dc39092eb0bce..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/ets/pages/player.ets +++ /dev/null @@ -1,111 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -// [Start player_asr] -import { media } from '@kit.MediaKit'; -import { common } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { audio } from '@kit.AudioKit'; -import { UIContext } from '@kit.ArkUI'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const TAG = 'MindSporeLite'; - -export default class AVPlayerDemo { - private isSeek: boolean = false; // 用于区分模式是否支持seek操作。 - // 注册avplayer回调函数。 - setAVPlayerCallback(avPlayer: media.AVPlayer) { - // seek操作结果回调函数。 - avPlayer.on('seekDone', (seekDoneTime: number) => { - hilog.info(0xFF00, TAG, '%{public}s', `MS_LITE_LOG: AVPlayer seek succeeded, seek time is ${seekDoneTime}`); - }); - // error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程。 - avPlayer.on('error', (err: BusinessError) => { - hilog.error(0xFF00, TAG, '%{public}s', - `MS_LITE_ERR: Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`); - avPlayer.reset(); // 调用reset重置资源,触发idle状态。 - }); - // 状态机变化回调函数。 - avPlayer.on('stateChange', async (state: string, reason: media.StateChangeReason) => { - switch (state) { - case 'idle': // 成功调用reset接口后触发该状态机上报。 - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer state idle called.'); - avPlayer.release(); // 调用release接口销毁实例对象。 - break; - case 'initialized': // avplayer 设置播放源后触发该状态上报。 - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer state initialized called.'); - avPlayer.audioRendererInfo = { - usage: audio.StreamUsage.STREAM_USAGE_MUSIC, // 音频流使用类型:音乐。根据业务场景配置。 - rendererFlags: 0 // 音频渲染器标志。 - }; - avPlayer.prepare(); - break; - case 'prepared': // prepare调用成功后上报该状态机。 - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer state prepared called.'); - avPlayer.play(); // 调用播放接口开始播放。 - break; - case 'playing': // play成功调用后触发该状态机上报。 - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer state playing called.'); - if (this.isSeek) { - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer start to seek.'); - avPlayer.seek(0); // 将播放位置移动到音频的开始。 - } else { - // 当播放模式不支持seek操作时继续播放到结尾。 - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer wait to play end.'); - } - break; - case 'paused': // pause成功调用后触发该状态机上报。 - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer state paused called.'); - setTimeout(() => { - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer paused wait to play again'); - avPlayer.play(); // 暂停3s后再次调用播放接口开始播放。 - }, 3000); - break; - case 'completed': // 播放结束后触发该状态机上报。 - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer state completed called.'); - avPlayer.stop(); // 调用播放结束接口。 - break; - case 'stopped': // stop接口成功调用后触发该状态机上报。 - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer state stopped called.'); - avPlayer.reset(); // 调用reset接口初始化avplayer状态。 - break; - case 'released': - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer state released called.'); - break; - default: - hilog.info(0xFF00, TAG, '%{public}s', 'MS_LITE_LOG: AVPlayer state unknown called.'); - break; - } - }); - } - - // 使用资源管理接口获取音频文件并通过fdSrc属性进行播放。 - async avPlayerFdSrcDemo() { - // 创建avPlayer实例对象。 - let avPlayer: media.AVPlayer = await media.createAVPlayer(); - // 创建状态机变化回调函数。 - this.setAVPlayerCallback(avPlayer); - // 通过UIAbilityContext的resourceManager成员的getRawFd接口获取媒体资源播放地址。 - // 返回类型为{fd,offset,length},fd为HAP包fd地址,offset为媒体资源偏移量,length为播放长度。 - let context = new UIContext().getHostContext() as common.UIAbilityContext; - let fileDescriptor = await context.resourceManager.getRawFd('zh.wav'); - let avFileDescriptor: media.AVFileDescriptor = - { fd: fileDescriptor.fd, offset: fileDescriptor.offset, length: fileDescriptor.length }; - this.isSeek = true; // 支持seek操作。 - // 为fdSrc赋值触发initialized状态机上报。 - avPlayer.fdSrc = avFileDescriptor; - } -} -// [End player_asr] \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/module.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/module.json5 deleted file mode 100644 index 076e9444c2635d54158c63e9e1be5fc07cf76e8d..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* -* Copyright (c) 2025 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" - } - ] - } - ] - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/element/color.json b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/element/float.json b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/element/string.json b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/element/string.json deleted file mode 100644 index cd71fed952e3dc5eea8d5ad3ad597072ee602146..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "mindsporeliteASR" - }, - { - "name": "play", - "value": "播放示例音频" - }, - { - "name": "asr", - "value": "识别示例音频" - } - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/background.png b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/foreground.png b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4754b3324b53a2ae129edd9d4a8ea504c5010758..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/layered_image.json b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/startIcon.png b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/profile/backup_config.json b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/profile/main_pages.json b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/dark/element/color.json b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/.gitattributes b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/.gitattributes deleted file mode 100644 index 5a5812a5473929abf77a6718acf0fdc410c16f7f..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -tiny-encoder.ms filter=lfs diff=lfs merge=lfs -text -tiny-decoder-main.ms filter=lfs diff=lfs merge=lfs -text -tiny-decoder-loop.ms filter=lfs diff=lfs merge=lfs -text diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/tiny-positional_embedding.bin b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/tiny-positional_embedding.bin deleted file mode 100644 index 22bd89e5e8e9cd31591e64b3e6455876a49b828c..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/tiny-positional_embedding.bin and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/tiny-tokens.txt b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/tiny-tokens.txt deleted file mode 100644 index a4edf0b719c10d28cd83f8c294449f99ff5d5dc0..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/tiny-tokens.txt +++ /dev/null @@ -1,50257 +0,0 @@ -IQ== 0 -Ig== 1 -Iw== 2 -JA== 3 -JQ== 4 -Jg== 5 -Jw== 6 -KA== 7 -KQ== 8 -Kg== 9 -Kw== 10 -LA== 11 -LQ== 12 -Lg== 13 -Lw== 14 -MA== 15 -MQ== 16 -Mg== 17 -Mw== 18 -NA== 19 -NQ== 20 -Ng== 21 -Nw== 22 -OA== 23 -OQ== 24 -Og== 25 -Ow== 26 -PA== 27 -PQ== 28 -Pg== 29 -Pw== 30 -QA== 31 -QQ== 32 -Qg== 33 -Qw== 34 -RA== 35 -RQ== 36 -Rg== 37 -Rw== 38 -SA== 39 -SQ== 40 -Sg== 41 -Sw== 42 -TA== 43 -TQ== 44 -Tg== 45 -Tw== 46 -UA== 47 -UQ== 48 -Ug== 49 -Uw== 50 -VA== 51 -VQ== 52 -Vg== 53 -Vw== 54 -WA== 55 -WQ== 56 -Wg== 57 -Ww== 58 -XA== 59 -XQ== 60 -Xg== 61 -Xw== 62 -YA== 63 -YQ== 64 -Yg== 65 -Yw== 66 -ZA== 67 -ZQ== 68 -Zg== 69 -Zw== 70 -aA== 71 -aQ== 72 -ag== 73 -aw== 74 -bA== 75 -bQ== 76 -bg== 77 -bw== 78 -cA== 79 -cQ== 80 -cg== 81 -cw== 82 -dA== 83 -dQ== 84 -dg== 85 -dw== 86 -eA== 87 -eQ== 88 -eg== 89 -ew== 90 -fA== 91 -fQ== 92 -fg== 93 -oQ== 94 -og== 95 -ow== 96 -pA== 97 -pQ== 98 -pg== 99 -pw== 100 -qA== 101 -qQ== 102 -qg== 103 -qw== 104 -rA== 105 -rg== 106 -rw== 107 -sA== 108 -sQ== 109 -sg== 110 -sw== 111 -tA== 112 -tQ== 113 -tg== 114 -tw== 115 -uA== 116 -uQ== 117 -ug== 118 -uw== 119 -vA== 120 -vQ== 121 -vg== 122 -vw== 123 -wA== 124 -wQ== 125 -wg== 126 -ww== 127 -xA== 128 -xQ== 129 -xg== 130 -xw== 131 -yA== 132 -yQ== 133 -yg== 134 -yw== 135 -zA== 136 -zQ== 137 -zg== 138 -zw== 139 -0A== 140 -0Q== 141 -0g== 142 -0w== 143 -1A== 144 -1Q== 145 -1g== 146 -1w== 147 -2A== 148 -2Q== 149 -2g== 150 -2w== 151 -3A== 152 -3Q== 153 -3g== 154 -3w== 155 -4A== 156 -4Q== 157 -4g== 158 -4w== 159 -5A== 160 -5Q== 161 -5g== 162 -5w== 163 -6A== 164 -6Q== 165 -6g== 166 -6w== 167 -7A== 168 -7Q== 169 -7g== 170 -7w== 171 -8A== 172 -8Q== 173 -8g== 174 -8w== 175 -9A== 176 -9Q== 177 -9g== 178 -9w== 179 -+A== 180 -+Q== 181 -+g== 182 -+w== 183 -/A== 184 -/Q== 185 -/g== 186 -/w== 187 -AA== 188 -AQ== 189 -Ag== 190 -Aw== 191 -BA== 192 -BQ== 193 -Bg== 194 -Bw== 195 -CA== 196 -CQ== 197 -Cg== 198 -Cw== 199 -DA== 200 -DQ== 201 -Dg== 202 -Dw== 203 -EA== 204 -EQ== 205 -Eg== 206 -Ew== 207 -FA== 208 -FQ== 209 -Fg== 210 -Fw== 211 -GA== 212 -GQ== 213 -Gg== 214 -Gw== 215 -HA== 216 -HQ== 217 -Hg== 218 -Hw== 219 -IA== 220 -fw== 221 -gA== 222 -gQ== 223 -gg== 224 -gw== 225 -hA== 226 -hQ== 227 -hg== 228 -hw== 229 -iA== 230 -iQ== 231 -ig== 232 -iw== 233 -jA== 234 -jQ== 235 -jg== 236 -jw== 237 -kA== 238 -kQ== 239 -kg== 240 -kw== 241 -lA== 242 -lQ== 243 -lg== 244 -lw== 245 -mA== 246 -mQ== 247 -mg== 248 -mw== 249 -nA== 250 -nQ== 251 -ng== 252 -nw== 253 -oA== 254 -rQ== 255 -IHQ= 256 -IGE= 257 -IHRo 258 -aW4= 259 -ZXI= 260 -IHc= 261 -IHM= 262 -b3U= 263 -IHRoZQ== 264 -cmU= 265 -b24= 266 -YXQ= 267 -ZW4= 268 -IGM= 269 -aXQ= 270 -aXM= 271 -IGI= 272 -bmQ= 273 -IGQ= 274 -IG0= 275 -IGg= 276 -IG8= 277 -aW5n 278 -ZXM= 279 -IHA= 280 -IHRv 281 -YW4= 282 -IGY= 283 -b3I= 284 -bGw= 285 -IEk= 286 -IGw= 287 -IHk= 288 -YXI= 289 -IGc= 290 -IHlvdQ== 291 -ZWQ= 292 -IGFuZA== 293 -IGlu 294 -IG9m 295 -YXM= 296 -IG4= 297 -b20= 298 -aWM= 299 -IHRoYXQ= 300 -dXM= 301 -ZXQ= 302 -dmU= 303 -YWw= 304 -b3c= 305 -bGU= 306 -IGlz 307 -IGU= 308 -IGl0 309 -b3Q= 310 -J3M= 311 -IGJl 312 -aW9u 313 -IFQ= 314 -IHdo 315 -IEE= 316 -ZW50 317 -IFM= 318 -IHJl 319 -YXk= 320 -IHdl 321 -IG9u 322 -ZXJl 323 -IGhh 324 -dXQ= 325 -YWM= 326 -aWQ= 327 -aWc= 328 -b3M= 329 -a2U= 330 -dmVy 331 -aW0= 332 -INA= 333 -IFRo 334 -YW0= 335 -YWxs 336 -IGZvcg== 337 -ZWw= 338 -Y2g= 339 -cm8= 340 -IHRoaXM= 341 -IHN0 342 -IFc= 343 -IHU= 344 -YWQ= 345 -b3V0 346 -aXI= 347 -bGQ= 348 -Y3Q= 349 -IGs= 350 -aWY= 351 -IGdv 352 -Li4= 353 -0L4= 354 -aXRo 355 -bHk= 356 -aHQ= 357 -cXU= 358 -IC0= 359 -IGRv 360 -IGo= 361 -IGhhdmU= 362 -IEI= 363 -IGFu 364 -IHdpdGg= 365 -IGFyZQ== 366 -IHI= 367 -IGRl 368 -IHNl 369 -IHNv 370 -IHY= 371 -c3Q= 372 -aWxs 373 -dXI= 374 -IGxp 375 -IE0= 376 -ZXN0 377 -b2Q= 378 -YWxseQ== 379 -J3Q= 380 -dXN0 381 -IGFz 382 -IEM= 383 -Y2U= 384 -IG1l 385 -0LA= 386 -0LU= 387 -aWw= 388 -IEg= 389 -IHdhcw== 390 -dGVy 391 -dGg= 392 -IGNhbg== 393 -YW50 394 -IGNvbQ== 395 -b3Vy 396 -aWdodA== 397 -IFk= 398 -YXRpb24= 399 -IEFuZA== 400 -b2w= 401 -IHNo 402 -0YI= 403 -b3A= 404 -c2U= 405 -IG5vdA== 406 -IFNv 407 -IG5l 408 -dW4= 409 -IGFi 410 -IGxpa2U= 411 -IGF0 412 -IEQ= 413 -aWU= 414 -IGhl 415 -IGNvbg== 416 -IGNo 417 -b3Jl 418 -IGFs 419 -IG9y 420 -IHF1 421 -IE8= 422 -b21l 423 -cmE= 424 -dWw= 425 -IE4= 426 -cHA= 427 -IHlvdXI= 428 -b3VsZA== 429 -IFA= 430 -IGZy 431 -Z2U= 432 -ZXJz 433 -J3Jl 434 -0Lg= 435 -IHRoZXk= 436 -IHdoYXQ= 437 -dXNl 438 -IGFsbA== 439 -IFRoZQ== 440 -IEw= 441 -ZXNz 442 -ZW0= 443 -IGtu 444 -IGp1c3Q= 445 -YXJ0 446 -IHBybw== 447 -dmVyeQ== 448 -dW0= 449 -IGxv 450 -IOw= 451 -IG15 452 -b2s= 453 -IGV4 454 -YWI= 455 -IHRoZXJl 456 -IGJ1dA== 457 -IGtub3c= 458 -IHN1 459 -IEc= 460 -0YE= 461 -IEU= 462 -IG1h 463 -0L7Q 464 -IGVu 465 -IGFib3V0 466 -IEl0 467 -aXN0 468 -IHdvcg== 469 -cmk= 470 -aW5k 471 -IG9uZQ== 472 -YXRl 473 -YW5k 474 -aW5r 475 -IGxl 476 -b3J0 477 -J20= 478 -IEY= 479 -aWNo 480 -0YA= 481 -aWRl 482 -IGdldA== 483 -IG91dA== 484 -Li4u 485 -IHdpbGw= 486 -44E= 487 -aXZl 488 -0L0= 489 -IGZyb20= 490 -YWlu 491 -IFdl 492 -IHVw 493 -cGU= 494 -cmVz 495 -Y2E= 496 -IFI= 497 -IGlm 498 -IHBs 499 -IGRvbg== 500 -YWNr 501 -IDE= 502 -ICI= 503 -IHRy 504 -IHVz 505 -IFdo 506 -aXR5 507 -IEo= 508 -IFlvdQ== 509 -IGhlcmU= 510 -aGVy 511 -IHNvbWU= 512 -b3Vn 513 -YWs= 514 -YXJk 515 -IGdvaW5n 516 -IHVu 517 -bWVudA== 518 -IHRoaW5r 519 -IHBl 520 -ZW5k 521 -ICg= 522 -Y2F1c2U= 523 -IHRpbQ== 524 -YXN0 525 -w6k= 526 -IG91cg== 527 -IHdhbnQ= 528 -YW1l 529 -aWVz 530 -IOs= 531 -dWQ= 532 -aW5l 533 -IHJlYWxseQ== 534 -IHRl 535 -IHNlZQ== 536 -Y2k= 537 -IGJ5 538 -c28= 539 -dXJl 540 -b3Nl 541 -IFs= 542 -YXJl 543 -IG1vcmU= 544 -YWg= 545 -b25l 546 -Y2s= 547 -b3BsZQ== 548 -0LDQ 549 -IHRoZW4= 550 -IHRoaW5n 551 -IHRoZW0= 552 -dmVu 553 -b3VuZA== 554 -b3N0 555 -b25n 556 -ZWN0 557 -IHJpZ2h0 558 -YWc= 559 -IGludA== 560 -IHBlb3BsZQ== 561 -IHdoZW4= 562 -b3Vz 563 -cGw= 564 -IHRpbWU= 565 -IGlt 566 -IHdobw== 567 -IDI= 568 -YXA= 569 -IGJlY2F1c2U= 570 -aGluZw== 571 -IG5v 572 -aWNl 573 -IGxvb2s= 574 -IGhhcw== 575 -IHdvdWxk 576 -IGhvdw== 577 -YWN0 578 -IGZl 579 -bnQ= 580 -b3VnaA== 581 -IHBy 582 -IEJ1dA== 583 -IHNheQ== 584 -0YM= 585 -IG5vdw== 586 -IG1hbg== 587 -IHZlcnk= 588 -IHdvcms= 589 -aXo= 590 -IEs= 591 -aXY= 592 -aXR0 593 -IGFy 594 -ZXA= 595 -IGNs 596 -IHdoaWNo 597 -IGNv 598 -YW5z 599 -J3Zl 600 -IHNh 601 -ZmY= 602 -J2xs 603 -IGFueQ== 604 -IGFjdA== 605 -IHll 606 -YmVy 607 -YWNo 608 -YWdl 609 -cGVy 610 -IGFsc28= 611 -ZmVy 612 -IHRoZXNl 613 -IGFk 614 -0LXQ 615 -dGhlcg== 616 -YWNl 617 -aWNr 618 -YWtl 619 -cmVhdA== 620 -aXJl 621 -dWU= 622 -IGFn 623 -IFU= 624 -dWNo 625 -aW9ucw== 626 -cnk= 627 -MDA= 628 -bmE= 629 -IGRpZA== 630 -IHF1ZQ== 631 -IGhhZA== 632 -IGV2ZXJ5 633 -IEhl 634 -IGxh 635 -IHdheQ== 636 -IHNw 637 -Ymxl 638 -IFRoaXM= 639 -YXNz 640 -IHRoZWly 641 -aXRl 642 -IG5lZWQ= 643 -IHBhcnQ= 644 -IHdlcmU= 645 -IGJhY2s= 646 -aXA= 647 -b3du 648 -b21ldA== 649 -YmU= 650 -YXNl 651 -IG1ha2U= 652 -aXJzdA== 653 -aWE= 654 -ZW5jZQ== 655 -YW5n 656 -YW5r 657 -IGdvdA== 658 -IHByZQ== 659 -IGNvbnQ= 660 -IG90aGVy 661 -cHQ= 662 -IFRoYXQ= 663 -b2c= 664 -IGdvb2Q= 665 -IGludG8= 666 -YWxr 667 -IGJlZW4= 668 -IGFt 669 -IG92ZXI= 670 -dWFsbHk= 671 -IOI= 672 -7J0= 673 -IHVuZA== 674 -aGU= 675 -d2F5 676 -IGdy 677 -0Yw= 678 -IGRpZg== 679 -IHBlcg== 680 -0Y8= 681 -IElu 682 -IHR3 683 -b25k 684 -YXJz 685 -aW50 686 -b3Jt 687 -IGxvdA== 688 -IHdoZXJl 689 -IMM= 690 -IFY= 691 -IHNvbWV0 692 -0Ls= 693 -ZW5z 694 -IGd1 695 -IGFj 696 -dWc= 697 -0Ys= 698 -xLE= 699 -IGZpcnN0 700 -cmVl 701 -IGhpcw== 702 -aXR0bGU= 703 -IGltcA== 704 -IG1v 705 -YXY= 706 -IGxpdHRsZQ== 707 -IFdoYXQ= 708 -IG11Y2g= 709 -IHo= 710 -IOo= 711 -YWJsZQ== 712 -INC/ 713 -IHBv 714 -IGNvbXA= 715 -bmU= 716 -IGRpcw== 717 -IGxldA== 718 -YW5jZQ== 719 -IGhlcg== 720 -IHRoaW5ncw== 721 -IHN0YXJ0 722 -dWx0 723 -IGFwcA== 724 -IHJlcw== 725 -IGZv 726 -IGNvdWxk 727 -IGludGVy 728 -IHRob3Nl 729 -IGRlcw== 730 -IHdlbGw= 731 -IHR3bw== 732 -IGtpbmQ= 733 -eHQ= 734 -cmVzcw== 735 -ZWx5 736 -w6Q= 737 -IGJy 738 -IHRocg== 739 -INCy 740 -IGk= 741 -aXNo 742 -IGRpZmZlcg== 743 -IHJv 744 -IFN0 745 -IHNvbWV0aGluZw== 746 -IHRha2U= 747 -IGJv 748 -eXM= 749 -IHNoZQ== 750 -IHRhbGs= 751 -bG8= 752 -0Yc= 753 -IGV2ZW4= 754 -0Lo= 755 -44A= 756 -INC9 757 -IGJ1 758 -IElm 759 -IGRvd24= 760 -IENo 761 -YWRl 762 -YXRpb25z 763 -IHVzZQ== 764 -b3Jk 765 -IG9mZg== 766 -IGFjdHVhbGx5 767 -IHNwZQ== 768 -ZHU= 769 -YXRlZA== 770 -YXRlcg== 771 -b3Nz 772 -bmluZw== 773 -w7w= 774 -IGRvZXM= 775 -INGB 776 -IG5ldw== 777 -IGJldA== 778 -dmVs 779 -Y2Vzcw== 780 -cGxl 781 -IGhhcHA= 782 -dGluZw== 783 -b25uYQ== 784 -IGVz 785 -IGRheQ== 786 -IG9ubHk= 787 -aWdu 788 -a2F5 789 -c2Vs 790 -ZW50cw== 791 -b3VudA== 792 -aWxk 793 -aWxl 794 -IHNj 795 -IGhpbQ== 796 -IGFnYWlu 797 -dmluZw== 798 -IGdvbm5h 799 -IGNvbW0= 800 -IGhlbA== 801 -b3RoZXI= 802 -IGtl 803 -aWNhbA== 804 -IDM= 805 -IGVs 806 -IHRocm91Z2g= 807 -IGNvbWU= 808 -YXJr 809 -ZGF5 810 -aWVy 811 -w7M= 812 -IHRoYW4= 813 -IFRoZXk= 814 -IG1heQ== 815 -IHNlcg== 816 -7ZU= 817 -IGNhbGw= 818 -IGRpZmZlcmVudA== 819 -IHNob3VsZA== 820 -IFRoZXJl 821 -YXJ5 822 -IE5vdw== 823 -44I= 824 -dGhpbmc= 825 -d2U= 826 -b3J5 827 -ZnRlcg== 828 -IHB1dA== 829 -b3Jz 830 -aWFs 831 -64s= 832 -IHVuZGVy 833 -IGluYw== 834 -IFll 835 -dWI= 836 -Zm9ybQ== 837 -IHZpZGU= 838 -4Lg= 839 -dmVycw== 840 -IGZlZWw= 841 -w6E= 842 -b2R5 843 -ZnQ= 844 -Zm9yZQ== 845 -IGVt 846 -Z2V0 847 -IHNhaWQ= 848 -aXRpb24= 849 -IHJlYw== 850 -aW91cw== 851 -YXRjaA== 852 -IHRyeQ== 853 -IGhlbHA= 854 -IHNob3c= 855 -0LQ= 856 -IGJpdA== 857 -dWxs 858 -0LI= 859 -0YLQvg== 860 -Z3I= 861 -IHBsYXk= 862 -aWZl 863 -YWls 864 -IFllYWg= 865 -IHF1ZXN0 866 -IG1hbnk= 867 -IHBlcnM= 868 -IGdyZWF0 869 -w60= 870 -IGVzdA== 871 -bmc= 872 -IOKZ 873 -dHk= 874 -bGE= 875 -IE9o 876 -INc= 877 -4K4= 878 -IEJl 879 -YWR5 880 -IG1vc3Q= 881 -Y3Rpb24= 882 -IE5v 883 -IGRvaW5n 884 -IGJlaW5n 885 -IHRvbw== 886 -Y2Vz 887 -IGJs 888 -LiI= 889 -IHJlbQ== 890 -aXNz 891 -b25z 892 -Pj4= 893 -cnU= 894 -d24= 895 -b250 896 -aWI= 897 -ZWxs 898 -IHNt 899 -b3Ro 900 -dWFs 901 -ID4+ 902 -IHBo 903 -bGVz 904 -b2M= 905 -ZnVs 906 -IHNlYw== 907 -aXNl 908 -IGFkZA== 909 -aWdo 910 -ZXJ0 911 -IHNhbWU= 912 -4oA= 913 -IG1lYW4= 914 -IGZpbmQ= 915 -ZWs= 916 -IGVuZA== 917 -LS0= 918 -0Lw= 919 -IHN0aWxs 920 -YXo= 921 -ICc= 922 -IG1pbg== 923 -IHllYXJz 924 -dXJu 925 -IGFyb3VuZA== 926 -c2VsZg== 927 -IHdy 928 -YnM= 929 -b3VnaHQ= 930 -IOKZqg== 931 -IGZs 932 -YW5nZQ== 933 -IGFmdGVy 934 -IHBvaW50 935 -bWVy 936 -dmVk 937 -IGxvbmc= 938 -b3k= 939 -5Lg= 940 -IGNy 941 -d2F5cw== 942 -IHN5 943 -IHRyYQ== 944 -IDIw 945 -YXZl 946 -IGNoZQ== 947 -IGVudA== 948 -IGJlZm9yZQ== 949 -cGg= 950 -IGF0dA== 951 -aWFu 952 -aWx5 953 -IHBlcnNvbg== 954 -IGJpZw== 955 -IHNjaA== 956 -IHJlYWw= 957 -IG5leHQ= 958 -IGxvdmU= 959 -IHZpZGVv 960 -IExldA== 961 -IGZpbg== 962 -IG1haw== 963 -aWJsZQ== 964 -IHRvZGF5 965 -ZXJt 966 -IEFs 967 -b3dlcg== 968 -YW5u 969 -aXg= 970 -IHBhcg== 971 -IHN0dWQ= 972 -w7Y= 973 -IGltcG9ydA== 974 -dGU= 975 -IGdpdmU= 976 -dmVz 977 -IGRpZQ== 978 -IGRlYw== 979 -IHRlbGw= 980 -INC6 981 -0YHRgg== 982 -IHdoeQ== 983 -aWNhbGx5 984 -aWN0 985 -cmVk 986 -IGJhcw== 987 -IHN1cmU= 988 -IGJlbA== 989 -YXRpbmc= 990 -IHRhaw== 991 -IHNldA== 992 -IGxpZmU= 993 -IGRpZG4= 994 -2Kc= 995 -b2I= 996 -dW5k 997 -YXRo 998 -IG9w 999 -INC+ 1000 -YWl0 1001 -IHdvcmxk 1002 -IHN1cHA= 1003 -aW8= 1004 -IGNvdXI= 1005 -INC4 1006 -d2FyZA== 1007 -0LXQvQ== 1008 -IGFsd2F5cw== 1009 -dXA= 1010 -IGhhbmQ= 1011 -IEhvdw== 1012 -Y2lhbA== 1013 -IGNvbnM= 1014 -INE= 1015 -IGluZA== 1016 -IDQ= 1017 -IEFz 1018 -IGZ1bg== 1019 -amVjdA== 1020 -IGltcG9ydGFudA== 1021 -IHN1cg== 1022 -ZXc= 1023 -YXRlcw== 1024 -IDU= 1025 -IGRp 1026 -IG1hZGU= 1027 -IGlucw== 1028 -IGFzaw== 1029 -IGV0 1030 -IG51bQ== 1031 -IGNhcg== 1032 -IE9rYXk= 1033 -IHNpbQ== 1034 -aWs= 1035 -IGxhc3Q= 1036 -IEdv 1037 -IG11cw== 1038 -IHJlbA== 1039 -dWxhcg== 1040 -tOw= 1041 -IFdlbGw= 1042 -cGVjdA== 1043 -IFRoYW5r 1044 -IHRocmVl 1045 -w6M= 1046 -44M= 1047 -IGludg== 1048 -IGdlbg== 1049 -bGlj 1050 -IGhhcHBlbg== 1051 -64o= 1052 -aWVu 1053 -ZXZlcg== 1054 -0L7Qsg== 1055 -IHN0cg== 1056 -IEFsbA== 1057 -IGluc3Q= 1058 -IOKA 1059 -IGRlZg== 1060 -IHNs 1061 -IG1pZ2h0 1062 -dW5n 1063 -IHllYXI= 1064 -IG93bg== 1065 -IGtlZXA= 1066 -Ym9keQ== 1067 -ZGVy 1068 -INGC 1069 -INC0 1070 -IGFub3RoZXI= 1071 -IG1vZA== 1072 -IGV2 1073 -IGd1eXM= 1074 -IGFibGU= 1075 -w6Nv 1076 -cXVl 1077 -aWRlbnQ= 1078 -IFllcw== 1079 -IGl0cw== 1080 -IHBsYWNl 1081 -IHByb2R1 1082 -YXJu 1083 -INC8 1084 -IHJlcA== 1085 -IGV4cGVy 1086 -IGZhbQ== 1087 -aXRpZXM= 1088 -aWZpYw== 1089 -IGhpZ2g= 1090 -aWVk 1091 -b29s 1092 -aWV3 1093 -0LXRgg== 1094 -cmVu 1095 -IGRvbmU= 1096 -IC4uLg== 1097 -64qU 1098 -c3RlbQ== 1099 -IFNl 1100 -IGJldHRlcg== 1101 -Y29tZQ== 1102 -IGRlbA== 1103 -IHR5 1104 -IHVt 1105 -IGhv 1106 -IEFu 1107 -IG1vbg== 1108 -aW5ncw== 1109 -IHNr 1110 -IG9i 1111 -Y29t 1112 -YmxlbQ== 1113 -b3Bl 1114 -c3RhbmQ= 1115 -J2Q= 1116 -bWVudHM= 1117 -IGVsZQ== 1118 -IElz 1119 -IGRh 1120 -IHJlZw== 1121 -bGVhc2U= 1122 -aWtl 1123 -YWxz 1124 -aXpl 1125 -6rA= 1126 -IGNhcmU= 1127 -IG5ldmVy 1128 -7J20 1129 -ZXNl 1130 -IG1ldA== 1131 -b2xvZw== 1132 -IFdoZW4= 1133 -dWNr 1134 -0LXRgA== 1135 -IMOp 1136 -IGRhdA== 1137 -w6c= 1138 -IGV4YW0= 1139 -aWxpdHk= 1140 -IGRldA== 1141 -Y3Jp 1142 -IHVzZWQ= 1143 -IERv 1144 -IHRyYW5z 1145 -ZWc= 1146 -dGVu 1147 -0Y4= 1148 -Y3Vz 1149 -IHNlY29uZA== 1150 -IGJlc3Q= 1151 -IGhhcmQ= 1152 -IGlkZQ== 1153 -IHByb2JsZW0= 1154 -6rM= 1155 -IFVu 1156 -0YU= 1157 -IM4= 1158 -IHdhdGNo 1159 -IFNo 1160 -YXR0ZXI= 1161 -IHByZXQ= 1162 -IGRlcg== 1163 -IGNvdXJzZQ== 1164 -xZ8= 1165 -YXRpdmU= 1166 -aWNz 1167 -IHF1ZXN0aW9u 1168 -dXRl 1169 -7Jc= 1170 -IEZvcg== 1171 -YXRoZXI= 1172 -IGNvbA== 1173 -aWVuZA== 1174 -IO0= 1175 -IFo= 1176 -IGRvZXNu 1177 -YXJjaA== 1178 -IGludGVyZXN0 1179 -IHBvbA== 1180 -IGNvcg== 1181 -aWVuY2U= 1182 -IHByZXM= 1183 -IGVhY2g= 1184 -IHN5c3RlbQ== 1185 -IGZhY3Q= 1186 -aWVs 1187 -YWJseQ== 1188 -IGVy 1189 -IHJ1bg== 1190 -IOyd 1191 -IHRvcA== 1192 -bmVy 1193 -IHRob3VnaHQ= 1194 -IGVhcw== 1195 -aWVudA== 1196 -IGNyZQ== 1197 -0Yg= 1198 -IGNvbW11bg== 1199 -eWU= 1200 -cmVhZHk= 1201 -bGxvdw== 1202 -IGV2ZXJ5dGhpbmc= 1203 -b21t 1204 -IG1lZA== 1205 -mpQ= 1206 -IGNvdW50 1207 -aXRz 1208 -IGNvbXBs 1209 -aGlw 1210 -2YQ= 1211 -b29r 1212 -IHRvZ2V0 1213 -IHRvZ2V0aGVy 1214 -YW1w 1215 -IGdhbWU= 1216 -IGFscmVhZHk= 1217 -0LDQuw== 1218 -IGNhbGxlZA== 1219 -YWxl 1220 -xYI= 1221 -IE15 1222 -IHVuZGVyc3RhbmQ= 1223 -IGRy 1224 -IG1vbQ== 1225 -aXRlZA== 1226 -0L7Quw== 1227 -IHVzaW5n 1228 -enk= 1229 -IG51bWJlcg== 1230 -44CB 1231 -Y2Vk 1232 -IGNsZQ== 1233 -0L3Qvg== 1234 -64uk 1235 -aW5jZQ== 1236 -IGxvb2tpbmc= 1237 -IHByZXR0eQ== 1238 -IHByb2I= 1239 -IFNoZQ== 1240 -IHZl 1241 -IGdldHRpbmc= 1242 -IHdlZWs= 1243 -IGVmZg== 1244 -dWZm 1245 -YWly 1246 -dWVz 1247 -ZXJu 1248 -IFE= 1249 -b3Vw 1250 -ZW50aW9u 1251 -IHNpZGU= 1252 -0L7QvA== 1253 -IGZvcm0= 1254 -IGJ1cw== 1255 -IGFzcw== 1256 -IGVk 1257 -YXNvbg== 1258 -d2Vlbg== 1259 -4oCm 1260 -IHR1cm4= 1261 -IGN1cg== 1262 -IGNvbGw= 1263 -IGRpcmU= 1264 -IEdvZA== 1265 -IDEw 1266 -IGVxdQ== 1267 -INCx 1268 -IG9wZW4= 1269 -IHN1Y2g= 1270 -aXJk 1271 -0LDQug== 1272 -IGVhcg== 1273 -xJk= 1274 -Z2Fu 1275 -IHBhcnRpYw== 1276 -IGZyaWVuZA== 1277 -IGV4cA== 1278 -IGV4dA== 1279 -IGhvbWU= 1280 -IHdhdGVy 1281 -IE9u 1282 -0YLRjA== 1283 -b3Jr 1284 -INC/0YA= 1285 -IG1vdmU= 1286 -bmVzcw== 1287 -ZW5zZQ== 1288 -aG8= 1289 -IGNoYXI= 1290 -Y28= 1291 -aW5z 1292 -IGJvdGg= 1293 -IDE5 1294 -IGdyYQ== 1295 -IGJldHdlZW4= 1296 -4bs= 1297 -IOyV 1298 -YXNo 1299 -IFJl 1300 -YWk= 1301 -YWx0aA== 1302 -dXJlcw== 1303 -ZW1iZXI= 1304 -IGF2 1305 -IHZlcg== 1306 -w6o= 1307 -b25leQ== 1308 -IHRoYW5r 1309 -IG1heWJl 1310 -dWM= 1311 -aW1l 1312 -6rOg 1313 -IGF3YXk= 1314 -IG5hbWU= 1315 -b3VzZQ== 1316 -IGFjYw== 1317 -IG11c2lj 1318 -IGNoYW5nZQ== 1319 -IHBhc3M= 1320 -Z2Vy 1321 -IGJ1aWxk 1322 -IHZhbA== 1323 -aW5lc3M= 1324 -YW55 1325 -IGZldw== 1326 -tOs= 1327 -dGE= 1328 -IGxpc3Q= 1329 -w6U= 1330 -IG9sZA== 1331 -IOye 1332 -IHNvcnQ= 1333 -IG1lbQ== 1334 -IGNh 1335 -Y2VwdA== 1336 -IGdlbmVy 1337 -IHllYWg= 1338 -IHdoaWxl 1339 -IGFueXRoaW5n 1340 -cmlj 1341 -Z3JhbQ== 1342 -IGVpbg== 1343 -Y3k= 1344 -dXJpbmc= 1345 -IERl 1346 -IHBvd2Vy 1347 -IGNvbWluZw== 1348 -IHdvcmQ= 1349 -IC0t 1350 -IGJlbGll 1351 -IGZvdW5k 1352 -dG8= 1353 -0L8= 1354 -IG1lYW5z 1355 -IGluZm9ybQ== 1356 -INg= 1357 -INGH 1358 -IHNtYWxs 1359 -MDAw 1360 -IGNhbWU= 1361 -IO2V 1362 -d2g= 1363 -IHdvcmtpbmc= 1364 -IGV4YW1wbGU= 1365 -IHBvcw== 1366 -IGRlcA== 1367 -6rI= 1368 -5Lo= 1369 -b3Rl 1370 -IGRlbQ== 1371 -7Kc= 1372 -dHM= 1373 -IHZhcg== 1374 -YXV0 1375 -IHRyaQ== 1376 -Y2hu 1377 -IGhlYWQ= 1378 -IHdob2xl 1379 -15k= 1380 -emU= 1381 -IHRyeWluZw== 1382 -IHRlbQ== 1383 -IGNvdQ== 1384 -ZXRz 1385 -IDY= 1386 -IGZpbA== 1387 -dmVsb3A= 1388 -IGNhc2U= 1389 -4K8= 1390 -IHByb2JhYmx5 1391 -IG9rYXk= 1392 -IHBsYW4= 1393 -IHNpdA== 1394 -IHNjaG9vbA== 1395 -IFRoZW4= 1396 -uOs= 1397 -bWU= 1398 -IHByb2Nlc3M= 1399 -IGZhcg== 1400 -IHJlYWQ= 1401 -IHBvc3M= 1402 -IGJyZQ== 1403 -IHNvbA== 1404 -aWNodA== 1405 -IHN1cHBvcnQ= 1406 -IFRv 1407 -ZXJ0YWlu 1408 -IHN0YXJ0ZWQ= 1409 -IGNhcA== 1410 -IGxlZnQ= 1411 -IGRhdGE= 1412 -IHRpbWVz 1413 -0LXQuw== 1414 -IHdhbnRlZA== 1415 -0LDQvQ== 1416 -IHRhbGtpbmc= 1417 -IGlzdA== 1418 -IGhhdmluZw== 1419 -dW1w 1420 -IGNvbnRpbg== 1421 -IHN1Yg== 1422 -INC3 1423 -cHI= 1424 -64uI 1425 -aW5h 1426 -xbw= 1427 -IGNyZWF0 1428 -b2Rl 1429 -15U= 1430 -5pg= 1431 -ISE= 1432 -IHRlcm0= 1433 -aXNt 1434 -0L7QtA== 1435 -IEJlY2F1c2U= 1436 -IHdlbnQ= 1437 -aWRlcg== 1438 -IHByb3Y= 1439 -IGNoaWxk 1440 -IGRlbg== 1441 -IGxpZ2h0 1442 -YnI= 1443 -s9C+ 1444 -b2g= 1445 -IGJvb2s= 1446 -INk= 1447 -dXRpb24= 1448 -IEp1c3Q= 1449 -ZW5l 1450 -IGZvdXI= 1451 -IHZpcw== 1452 -6rCA 1453 -IGhvcGU= 1454 -IG1ha2luZw== 1455 -IExl 1456 -7JU= 1457 -IG9wcA== 1458 -YXU= 1459 -IG1vbmV5 1460 -IHByb2dyYW0= 1461 -w6g= 1462 -IHN0YW5k 1463 -SU4= 1464 -IHNpZ24= 1465 -IGxlYXJu 1466 -w6A= 1467 -IERvbg== 1468 -IHRlYW0= 1469 -INC90LA= 1470 -bHVk 1471 -IHJlc3Q= 1472 -aWNlcw== 1473 -5pw= 1474 -INGA 1475 -IGF1dA== 1476 -IGxlYWQ= 1477 -YXRpb25hbA== 1478 -ZGU= 1479 -Z3k= 1480 -IG5pY2U= 1481 -IGRhcw== 1482 -IGRpc3Q= 1483 -IGh1bQ== 1484 -IE9uZQ== 1485 -5og= 1486 -IGNvbWVz 1487 -IGpv 1488 -IGNlbnQ= 1489 -IGV4cGw= 1490 -IG1hcms= 1491 -cmVlbg== 1492 -bGVk 1493 -Z2lu 1494 -7JqU 1495 -IGxldmVs 1496 -IGNvbmY= 1497 -dXNo 1498 -IGRldmVsb3A= 1499 -IHRlc3Q= 1500 -ZW5n 1501 -dmlvdXM= 1502 -YXR1cmU= 1503 -0LXQvA== 1504 -cmV0 1505 -IGpl 1506 -IHN0dWZm 1507 -IGNsYXNz 1508 -b3dz 1509 -IOq3 1510 -IHNp 1511 -IGxlcw== 1512 -cm9w 1513 -55o= 1514 -IHBvcg== 1515 -IHdhcg== 1516 -7JeQ 1517 -IGV2ZXJ5b25l 1518 -IGdl 1519 -IGNoZWNr 1520 -b3R0 1521 -IHNpbmc= 1522 -IGFydA== 1523 -IGZvbGxvdw== 1524 -IDIwMQ== 1525 -IEZy 1526 -YWlz 1527 -7JY= 1528 -zrE= 1529 -5bA= 1530 -IMOg 1531 -aW1lcw== 1532 -IHJldA== 1533 -IGNoYW5n 1534 -IHB1Yg== 1535 -IGluZg== 1536 -IHRlY2hu 1537 -YWRh 1538 -aXZlcw== 1539 -IGJlaA== 1540 -5piv 1541 -IGxvb2tz 1542 -44CC 1543 -0Lc= 1544 -IFdoeQ== 1545 -55qE 1546 -IGVub3VnaA== 1547 -IGJyYQ== 1548 -aXRjaA== 1549 -5Ls= 1550 -IGFkdg== 1551 -0LE= 1552 -IHdpdGhvdXQ= 1553 -d2Vy 1554 -bWVyaWM= 1555 -ZGVu 1556 -IGNvbXBsZXQ= 1557 -IGlkZWE= 1558 -dGVycw== 1559 -b2Nr 1560 -IGRlZmlu 1561 -IGV2ZXI= 1562 -IGds 1563 -IG9uY2U= 1564 -IGJyaW5n 1565 -IHNheWluZw== 1566 -IGFucw== 1567 -IGhlYXI= 1568 -bmVjdA== 1569 -IGxlc3M= 1570 -Z28= 1571 -cmVhbQ== 1572 -YWRv 1573 -7J4= 1574 -IG1pbmQ= 1575 -ZW50ZQ== 1576 -IGZ1bGw= 1577 -IGJhZA== 1578 -IHdvbQ== 1579 -IHNvbWVvbmU= 1580 -IGR1 1581 -IHdvbg== 1582 -IGNvbnRybw== 1583 -b3J0dW4= 1584 -IGhlYWx0aA== 1585 -IGNobw== 1586 -IEFy 1587 -IGNvbmM= 1588 -IGluZm9ybWF0aW9u 1589 -IHN0b3A= 1590 -YXR0 1591 -YXRlbHk= 1592 -5L0= 1593 -IGdyb3Vw 1594 -INGD 1595 -IHF1aXRl 1596 -IHJlc3A= 1597 -RVI= 1598 -dWdodA== 1599 -6rg= 1600 -bWFu 1601 -aXplZA== 1602 -IEJy 1603 -IHJlbWVtYmVy 1604 -IGZhbWlseQ== 1605 -IGJ1c2luZXNz 1606 -YXc= 1607 -IHNwZWM= 1608 -IGF1 1609 -IE9y 1610 -xIU= 1611 -IHNlZW4= 1612 -IGxhcg== 1613 -IDc= 1614 -Z2c= 1615 -YmVycw== 1616 -IGRyYQ== 1617 -IG1vbnRo 1618 -IHNheXM= 1619 -IGlzcw== 1620 -IGxpdmU= 1621 -IGxpbmU= 1622 -IG1vbWVudA== 1623 -IGV4Yw== 1624 -ZWxz 1625 -IHNvdW5k 1626 -IGNvb2w= 1627 -IGxvYw== 1628 -IGNlcnRhaW4= 1629 -IGRyaQ== 1630 -0L7Rgg== 1631 -YW1lcw== 1632 -IG11c3Q= 1633 -bnk= 1634 -0LjRgg== 1635 -IGtpZA== 1636 -IGluY2x1ZA== 1637 -7J2E 1638 -YXRvcg== 1639 -xJ8= 1640 -aGE= 1641 -YXJlZA== 1642 -IHNlZW0= 1643 -0Lk= 1644 -7IQ= 1645 -IGVsc2U= 1646 -IOyg 1647 -aXJs 1648 -IDg= 1649 -IHZv 1650 -IHF1ZXN0aW9ucw== 1651 -aW5lcw== 1652 -ZWU= 1653 -5oiR 1654 -w7xy 1655 -IEFtZXJpYw== 1656 -IHN0b3J5 1657 -IHNlcnY= 1658 -dmVybg== 1659 -YWdlcw== 1660 -bGFuZA== 1661 -IOKAkw== 1662 -ZXJh 1663 -IENhbg== 1664 -IHBvcA== 1665 -ZXRoZXI= 1666 -IG5h 1667 -IG9yZGVy 1668 -IG1ha2Vz 1669 -IHNpbmNl 1670 -Y29u 1671 -Y3Rvcg== 1672 -IHRob3VnaA== 1673 -IHByb2R1Y3Q= 1674 -0LvQuA== 1675 -IGxlZw== 1676 -IG1lZXQ= 1677 -YWxm 1678 -0YHRjw== 1679 -dW5jaA== 1680 -aXRlcg== 1681 -b3Zl 1682 -15XX 1683 -aWV0 1684 -0LDQvA== 1685 -aXRhbA== 1686 -IHN1cGVy 1687 -bGluZw== 1688 -IHBheQ== 1689 -IHBhcmE= 1690 -IGpvYg== 1691 -IEhlcmU= 1692 -IHN3 1693 -a3M= 1694 -cHRpb24= 1695 -bWE= 1696 -IGJlbGlldmU= 1697 -rOs= 1698 -IHdhaXQ= 1699 -0L7QuQ== 1700 -IHVudA== 1701 -IHF1aWNr 1702 -aHI= 1703 -INGN 1704 -IFBybw== 1705 -IG1lbg== 1706 -4Lk= 1707 -IGRheXM= 1708 -IGdvZXM= 1709 -IHNwZWFr 1710 -IEF0 1711 -ZW1lbnQ= 1712 -IG1pc3M= 1713 -IGF3 1714 -IGRlc2lnbg== 1715 -IHByb2plY3Q= 1716 -0L7RgA== 1717 -aWo= 1718 -YW50cw== 1719 -YXRz 1720 -IENocg== 1721 -IDk= 1722 -IGN1dA== 1723 -IHJlcXU= 1724 -INC90LU= 1725 -IE5vdA== 1726 -YXN0ZXI= 1727 -IG1pbGw= 1728 -IHBhcnRpY3VsYXI= 1729 -IHBpZQ== 1730 -IHN0dWRlbnRz 1731 -IGZpdmU= 1732 -b3Vu 1733 -IE5l 1734 -IGdp 1735 -IHBhcw== 1736 -IGZyZWU= 1737 -IFNw 1738 -bGljaA== 1739 -IHByb2Y= 1740 -IGVuZw== 1741 -IHByb3Q= 1742 -IExpa2U= 1743 -b3NlZA== 1744 -IGNvbm5lY3Q= 1745 -YXBw 1746 -IOun 1747 -aXRpbmc= 1748 -IGJsbw== 1749 -IGxvcw== 1750 -aXN0cw== 1751 -IGV4cGVyaWVuY2U= 1752 -cmVudA== 1753 -IHN0YXk= 1754 -IGZvb2Q= 1755 -dG9u 1756 -cnVjdA== 1757 -IGhpc3Q= 1758 -dmlldw== 1759 -aW5pbmc= 1760 -bW9zdA== 1761 -aXZlcnM= 1762 -Ym8= 1763 -44GE 1764 -IFRy 1765 -Z2Vu 1766 -IHBsZWFzZQ== 1767 -IGNvbW11bml0eQ== 1768 -IGNl 1769 -QU4= 1770 -bm8= 1771 -IGJvZHk= 1772 -IGhvdXI= 1773 -IHZlcnM= 1774 -4bo= 1775 -Y2Vy 1776 -IOqw 1777 -IHJlYXNvbg== 1778 -IFJpZ2h0 1779 -IGxhdGVy 1780 -z4Q= 1781 -IGhvdXNl 1782 -IFg= 1783 -0L7QvQ== 1784 -IHN0YXRl 1785 -Zmlj 1786 -5aQ= 1787 -xZs= 1788 -aWVsZA== 1789 -IHByaQ== 1790 -IHBhc3Q= 1791 -IHdhbGs= 1792 -b2xvZ3k= 1793 -ZXJpbmc= 1794 -YW5uYQ== 1795 -IHRlcg== 1796 -IGhvbGQ= 1797 -IG9yZ2Fu 1798 -YmVu 1799 -zr8= 1800 -w7Nu 1801 -IGVmZmVjdA== 1802 -IHlvdXJzZWxm 1803 -IHBsdXM= 1804 -YWo= 1805 -YW5kbw== 1806 -dXJhbA== 1807 -IHJvb20= 1808 -bGVjdA== 1809 -6rKM 1810 -PyI= 1811 -c2lkZQ== 1812 -IGJlY29tZQ== 1813 -0YY= 1814 -IMI= 1815 -b29k 1816 -IGNvbnN0 1817 -IG5pZ2h0 1818 -dXRlcw== 1819 -0LY= 1820 -IGJyZWFr 1821 -IHBhaW4= 1822 -IHN0ZXA= 1823 -aXJlZA== 1824 -IG5vdGhpbmc= 1825 -IHVudGls 1826 -0ZY= 1827 -0LDQsg== 1828 -2Yo= 1829 -IGR1cmluZw== 1830 -7KeA 1831 -bGVzcw== 1832 -b2xs 1833 -0L3Riw== 1834 -zrk= 1835 -ZmVjdA== 1836 -aXZlcg== 1837 -j4Q= 1838 -aXRoZXI= 1839 -eWluZw== 1840 -IGJlZ2lu 1841 -15nX 1842 -aXZpZA== 1843 -IMOn 1844 -IHNhbA== 1845 -IHRh 1846 -IHBvdA== 1847 -ICQ= 1848 -IG1hcg== 1849 -IGNsZWFy 1850 -IGZhY2U= 1851 -IGdyb3c= 1852 -ICo= 1853 -IGluc2lkZQ== 1854 -IGZyaWVuZHM= 1855 -IGxlYXZl 1856 -ZW5u 1857 -IGVhc3k= 1858 -IGFyZWE= 1859 -YWxpdHk= 1860 -b3Vk 1861 -IGVhdA== 1862 -2YY= 1863 -IHB1cg== 1864 -b3Ju 1865 -IHNhdw== 1866 -IGFuc3dlcg== 1867 -IGZyb250 1868 -IGJlYXV0 1869 -vOs= 1870 -IG1hdHRlcg== 1871 -IHNvbg== 1872 -IE5ldw== 1873 -IHJlc3VsdA== 1874 -aWRlcw== 1875 -Y2hl 1876 -IGZ1dA== 1877 -cHM= 1878 -IGZvY3Vz 1879 -IGludGVyZXN0aW5n 1880 -5aU= 1881 -IGFw 1882 -Ii4= 1883 -IGNyZWF0ZQ== 1884 -0L7RgQ== 1885 -IHByZXNz 1886 -cm9zcw== 1887 -IHBpY2s= 1888 -bGluZQ== 1889 -IHRvb2s= 1890 -IE1heQ== 1891 -cm93 1892 -IGljaA== 1893 -mOs= 1894 -IHJlZg== 1895 -IG1vcg== 1896 -cmFjdA== 1897 -YXJlbnQ= 1898 -QVI= 1899 -IGV4YWN0 1900 -IHNwYWNl 1901 -d29yaw== 1902 -0L3QuA== 1903 -IGJpcg== 1904 -IGRldg== 1905 -0LM= 1906 -IHRvbGQ= 1907 -IHB1YmxpYw== 1908 -Y2lhbGx5 1909 -IHZpZXc= 1910 -IEhleQ== 1911 -bWVk 1912 -bGxv 1913 -Y2M= 1914 -IGZhYw== 1915 -IGNvdXBsZQ== 1916 -IGhlYXJ0 1917 -bGVy 1918 -IHJlYWR5 1919 -IGFsbW9zdA== 1920 -YXJpbmc= 1921 -IGhhbGY= 1922 -IE1l 1923 -YXZvcg== 1924 -aXF1ZQ== 1925 -IGNoYXJhYw== 1926 -IHByYWN0 1927 -T04= 1928 -YW5l 1929 -IGls 1930 -0L3QsA== 1931 -IHZp 1932 -bGlzaA== 1933 -aGVhZA== 1934 -IGxlYXN0 1935 -IGJhc2ljYWxseQ== 1936 -YXNlZA== 1937 -cmlnaHQ= 1938 -IHlldA== 1939 -IHRha2luZw== 1940 -IGNvdW50cnk= 1941 -IHdpbg== 1942 -IGlzbg== 1943 -IHBvc3NpYmxl 1944 -IGNhbQ== 1945 -IGluY3Jl 1946 -IHBhdA== 1947 -IHdhbm5h 1948 -IGNvbnNpZGVy 1949 -IGFicw== 1950 -IHdpdGhpbg== 1951 -IGh1bWFu 1952 -IHRoaW5raW5n 1953 -IG9o 1954 -oZw= 1955 -IHF1aQ== 1956 -YXNlcw== 1957 -IDA= 1958 -aXRlbHk= 1959 -5LiN 1960 -IGtpbGw= 1961 -IG1pbA== 1962 -IGludmVzdA== 1963 -aXN0ZXI= 1964 -IHN1Yw== 1965 -aW9uYWw= 1966 -ZWxm 1967 -IHdoZXRoZXI= 1968 -IGNvbnRyb2w= 1969 -IGFnYWluc3Q= 1970 -b3Rz 1971 -64uI64uk 1972 -aW9y 1973 -IHByZXNlbnQ= 1974 -INin 1975 -IHdhdGNoaW5n 1976 -dWJl 1977 -ZXJ2 1978 -IG5pY2h0 1979 -IGdvdmVybg== 1980 -IFRoZXNl 1981 -IDo= 1982 -dWl0 1983 -dWdo 1984 -IHdvcmtz 1985 -b28= 1986 -IHdpcg== 1987 -IGFpcg== 1988 -IFRl 1989 -0LDQtw== 1990 -aXNpb24= 1991 -d2hlcmU= 1992 -IHRvdA== 1993 -am95 1994 -7Is= 1995 -IHZvbA== 1996 -INC1 1997 -IGNsb3Nl 1998 -IEFk 1999 -0Yk= 2000 -aW5lZA== 2001 -IHVuYQ== 2002 -IOq3uOs= 2003 -sOs= 2004 -b3JyeQ== 2005 -IGJybw== 2006 -IGZpbG0= 2007 -aWZ0 2008 -MjA= 2009 -IHR5cGU= 2010 -IGhhcHBlbmVk 2011 -IEFt 2012 -IGdpcmw= 2013 -IEFyZQ== 2014 -d2FyZHM= 2015 -IHBvdXI= 2016 -IGNvbG9y 2017 -ZWx0 2018 -0LDRgQ== 2019 -IHNlbnNl 2020 -bGV4 2021 -IFdpdGg= 2022 -dXNz 2023 -cmli 2024 -IHJlc2U= 2025 -IG5vcm0= 2026 -IGZ1dHVyZQ== 2027 -IGRlYWw= 2028 -ZW5kaW5n 2029 -ZXk= 2030 -IHg= 2031 -ZXJv 2032 -IENs 2033 -dWs= 2034 -IHdoYXRldmVy 2035 -c2VsdmVz 2036 -IHlvdW5n 2037 -7Io= 2038 -IE1hcg== 2039 -IENocmlzdA== 2040 -IGd1ZXNz 2041 -IHBlcmZvcm0= 2042 -IGVuZXI= 2043 -cm9u 2044 -IGhpdA== 2045 -IHdvbmQ= 2046 -IGRpcmVjdA== 2047 -IEV2ZXJ5 2048 -IG9mdGVu 2049 -IGZh 2050 -IGFsb25n 2051 -IGNsaWNr 2052 -IExvb2s= 2053 -IHNpdHU= 2054 -IGhhcHB5 2055 -ZWFk 2056 -IGFnbw== 2057 -IGVuYw== 2058 -IG15c2VsZg== 2059 -IGNvdmVy 2060 -0L7QsQ== 2061 -IG1pZA== 2062 -IGNvc3Q= 2063 -IHRlbg== 2064 -IFNjaA== 2065 -IGV4cGVjdA== 2066 -IHdhc24= 2067 -IHN0cm9uZw== 2068 -aWZ1bA== 2069 -IG9wcG9ydHVu 2070 -aW5hbA== 2071 -eWxl 2072 -IHNoYXJl 2073 -IHRydWU= 2074 -IGFwcHJv 2075 -IGNoYWxs 2076 -IG1pbnV0ZXM= 2077 -IGNoYW5u 2078 -IOuC 2079 -zrU= 2080 -bGk= 2081 -IG1lc3M= 2082 -b3JpZXM= 2083 -cGVjaWFsbHk= 2084 -IHdyb25n 2085 -IHllcw== 2086 -IOyX 2087 -aXJvbg== 2088 -IGFsbG93 2089 -IHN1YnM= 2090 -IGZvcmU= 2091 -IGZpZ2h0 2092 -IHNvY2lhbA== 2093 -IGNyYQ== 2094 -YW5h 2095 -IGFmZg== 2096 -IGVzcw== 2097 -IHdheXM= 2098 -IHNob3J0 2099 -IGZhbGw= 2100 -IGxhdw== 2101 -IFdobw== 2102 -IGVuam95 2103 -IGNhbA== 2104 -IGFjY2Vzcw== 2105 -ZmU= 2106 -IG5vbg== 2107 -IGFjcm9zcw== 2108 -ZXJ5 2109 -dmlvdXNseQ== 2110 -IEV4 2111 -aWRlZA== 2112 -IGxpbms= 2113 -IFBy 2114 -IHRlcm1z 2115 -YWNlcw== 2116 -IGxhbmQ= 2117 -YXppbmc= 2118 -IDE1 2119 -IG11bHQ= 2120 -IHNwZWNpYWw= 2121 -5YA= 2122 -aXZpbmc= 2123 -7J2A 2124 -IHR5cA== 2125 -IHN0ZQ== 2126 -IMQ= 2127 -IGZvcndhcmQ= 2128 -5Y8= 2129 -IGZyZQ== 2130 -5aW9 2131 -IHJlc2VhcmNo 2132 -4K+N 2133 -0LDRgg== 2134 -IG1haW4= 2135 -IHJlY29yZA== 2136 -IGh1 2137 -IGRlZmluaXRlbHk= 2138 -IGVpdGhlcg== 2139 -IGxpc3Rlbg== 2140 -IGtleQ== 2141 -IG1hcmtldA== 2142 -INGH0YLQvg== 2143 -aXphdGlvbg== 2144 -IHZpZGVvcw== 2145 -IGd1eQ== 2146 -IGZpZw== 2147 -IHN0cmE= 2148 -IFBs 2149 -dWxseQ== 2150 -YW1vcw== 2151 -IG1lbnRpb24= 2152 -IHNvbmc= 2153 -IGludGVybg== 2154 -cmFs 2155 -dXJz 2156 -IGhvbg== 2157 -IHZhbHVl 2158 -IGJhcg== 2159 -Y2xl 2160 -0L7Qtg== 2161 -xIc= 2162 -nOs= 2163 -IHp1 2164 -0LjQvA== 2165 -5L2g 2166 -IHNpbmdsZQ== 2167 -IGF1Y2g= 2168 -Y3Vzcw== 2169 -IGdldHM= 2170 -IHNvbWV0aW1lcw== 2171 -5b4= 2172 -YW1i 2173 -bW0= 2174 -Y2luZw== 2175 -IHBlcmZlY3Q= 2176 -IEJs 2177 -b3V0aA== 2178 -7KA= 2179 -IHNjaQ== 2180 -cGFy 2181 -IHJlZA== 2182 -IHBvc3Q= 2183 -IG1vdA== 2184 -IGVsZWN0 2185 -IEV1 2186 -aXRpdmU= 2187 -IFNvbWU= 2188 -IGRlc2NyaQ== 2189 -IGN1cnJlbnQ= 2190 -w6lz 2191 -IHRyZQ== 2192 -IEVu 2193 -IG1pdA== 2194 -RU4= 2195 -iOs= 2196 -aXVt 2197 -IGhlYXJk 2198 -IHNpbXBsZQ== 2199 -bGFy 2200 -IGV2ZXJ5Ym9keQ== 2201 -aWxhcg== 2202 -IG5lZWRz 2203 -IGRpZmZpYw== 2204 -IEdvb2Q= 2205 -dW1lbnQ= 2206 -Y2VudA== 2207 -IG9wZXI= 2208 -0LDRgtGM 2209 -ZXR5 2210 -IGJsYWNr 2211 -IGdpdmVu 2212 -b25lcw== 2213 -IHdlbA== 2214 -6YA= 2215 -IOyVhA== 2216 -IDMw 2217 -QVQ= 2218 -IHN0YXQ= 2219 -b3VjaA== 2220 -IE1y 2221 -0LDRgA== 2222 -IHNobw== 2223 -IGNvbmQ= 2224 -15Q= 2225 -bXk= 2226 -IGNoaWxkcmVu 2227 -IGV1 2228 -0LXQtA== 2229 -7JWE 2230 -dGVybg== 2231 -IHVo 2232 -IGhhcg== 2233 -IHByb20= 2234 -IHB1bGw= 2235 -cmV3 2236 -IGNvbXBhbnk= 2237 -IGJlYXV0aWZ1bA== 2238 -dXN0b20= 2239 -7ZWY 2240 -0LrQuA== 2241 -IHN0cmU= 2242 -IGFtYXppbmc= 2243 -cmllcw== 2244 -IHN1Y2Nlc3M= 2245 -IG1hY2g= 2246 -bm90 2247 -IGRpc2N1c3M= 2248 -IG5hdA== 2249 -pqw= 2250 -IHVuZQ== 2251 -IGRpZmZpY3VsdA== 2252 -IHJpcw== 2253 -zr0= 2254 -IGNhbXA= 2255 -IGJ1eQ== 2256 -5LiA 2257 -IG1hZw== 2258 -cG8= 2259 -IFlvdXI= 2260 -IGJlaGluZA== 2261 -aWNh 2262 -xLFu 2263 -IE9L 2264 -IGxhbmc= 2265 -IHdvbWVu 2266 -IGVudg== 2267 -IHJlY2U= 2268 -IGNoYW5uZWw= 2269 -aWFsbHk= 2270 -dWxl 2271 -IDEy 2272 -dGhlcnM= 2273 -IGJvdHQ= 2274 -IHJlcG9ydA== 2275 -ZW50bHk= 2276 -ZnVsbHk= 2277 -VGhl 2278 -IHNlbnQ= 2279 -IGV2ZW50 2280 -IGVuZXJneQ== 2281 -bHQ= 2282 -IHdvcmRz 2283 -YXJy 2284 -ZGxl 2285 -IGFoZWFk 2286 -YXJkcw== 2287 -2LE= 2288 -5LqG 2289 -IHRvb2w= 2290 -Y29ub20= 2291 -0LXRgQ== 2292 -IGV4YWN0bHk= 2293 -IGZhdm9y 2294 -IGxvdw== 2295 -IHByb3Blcg== 2296 -IOyeiA== 2297 -ICE= 2298 -IHJlbGF0aW9ucw== 2299 -IG1hcw== 2300 -IGtpZHM= 2301 -IGVudGlyZQ== 2302 -dWRl 2303 -2YU= 2304 -IFdoZXJl 2305 -IG9uZXM= 2306 -IGNpdHk= 2307 -b2x1dA== 2308 -IHNpeA== 2309 -YWJpbGl0eQ== 2310 -w7Zy 2311 -aWxp 2312 -IEVz 2313 -IGhhcHBlbnM= 2314 -YWlucw== 2315 -IG1vZGVs 2316 -IHBpY3Q= 2317 -IGVzcGVjaWFsbHk= 2318 -IDEwMA== 2319 -a3Q= 2320 -IHNvb24= 2321 -Ynk= 2322 -cm9kdQ== 2323 -IGFubg== 2324 -IHN1YnNjcmk= 2325 -IFF1 2326 -IGF2YWls 2327 -aW1lbnQ= 2328 -IHZvYw== 2329 -a2E= 2330 -IDIwMA== 2331 -YXBlcg== 2332 -IEluZA== 2333 -IOyn 2334 -aG9y 2335 -jbA= 2336 -am9y 2337 -0LjQuw== 2338 -IHNxdQ== 2339 -QVU= 2340 -YXJuaW5n 2341 -INCz 2342 -SVM= 2343 -INC7 2344 -0LXQuQ== 2345 -eWVz 2346 -5YU= 2347 -INCS 2348 -IG9yaWc= 2349 -0L7Qs9C+ 2350 -IGFza2Vk 2351 -aWx0 2352 -0L7Qsw== 2353 -IGNvbnRpbnVl 2354 -IOyY 2355 -cmFt 2356 -IG90aGVycw== 2357 -RVM= 2358 -b2hu 2359 -IGxheQ== 2360 -IGJhc2Vk 2361 -IHB1 2362 -IGFwcGU= 2363 -IGxpbQ== 2364 -IHByb3A= 2365 -gOs= 2366 -bWlu 2367 -IGhvdA== 2368 -IExh 2369 -IGZhc3Q= 2370 -IHByb3RlY3Q= 2371 -IGFtb3VudA== 2372 -IGFxdQ== 2373 -IGZ1bmQ= 2374 -IGN1c3RvbQ== 2375 -IGN1bHQ= 2376 -IGhhbmRz 2377 -IGhhdmVu 2378 -IGF1ZA== 2379 -IG91dHNpZGU= 2380 -IEFmdGVy 2381 -YXBz 2382 -IGFuaW0= 2383 -cGxveQ== 2384 -IGhhdA== 2385 -IEZpcnN0 2386 -IHRyZWF0 2387 -IGVw 2388 -IG1hdGVy 2389 -IGJ1aWxkaW5n 2390 -IOuw 2391 -5ZA= 2392 -7ISc 2393 -emE= 2394 -dWdodGVy 2395 -IFBl 2396 -bmV5 2397 -ZXRlcg== 2398 -YXRpYw== 2399 -IGVkdWM= 2400 -6riw 2401 -IG1vdg== 2402 -k6Q= 2403 -YW1h 2404 -cmF0aW9u 2405 -IHNu 2406 -2Yg= 2407 -IHN1bQ== 2408 -IHBob3Q= 2409 -INCd 2410 -IC4= 2411 -5pyJ 2412 -IGZpbmlzaA== 2413 -aXR0aW5n 2414 -5a4= 2415 -IGxhcmdl 2416 -IOyW 2417 -IHdoaXRl 2418 -YXJh 2419 -IG1haXM= 2420 -IEhp 2421 -IGRhbQ== 2422 -INin2YQ= 2423 -IGJveA== 2424 -IEhlbGxv 2425 -IHNsZQ== 2426 -IG9wdA== 2427 -cmllZA== 2428 -pbw= 2429 -IGFjdGl2 2430 -IG7Do28= 2431 -IENvbQ== 2432 -IHBsYXlpbmc= 2433 -VGg= 2434 -IGF2YWlsYWJsZQ== 2435 -IHBvcnQ= 2436 -5Yg= 2437 -IEFo 2438 -IGxhcw== 2439 -IGVhcmx5 2440 -IHdvbmRlcg== 2441 -sbA= 2442 -IDE4 2443 -Y3Vs 2444 -IGZ1bmN0aW9u 2445 -IG1vcm5pbmc= 2446 -bGxl 2447 -aWVudHM= 2448 -dXg= 2449 -IGNpcg== 2450 -aXRpb25z 2451 -IGRlZXA= 2452 -IHBvbGl0 2453 -eW9y 2454 -bXA= 2455 -YWtpbmc= 2456 -jOs= 2457 -IE1hbg== 2458 -IG1pbGxpb24= 2459 -IC8= 2460 -IGluZGl2aWQ= 2461 -IHBhbg== 2462 -IGdvdmVybm1lbnQ= 2463 -IHdyaXRl 2464 -IFRvZA== 2465 -YW1lbnQ= 2466 -IM8= 2467 -IHdpbmQ= 2468 -IEVuZw== 2469 -Y2hlbg== 2470 -V2g= 2471 -7Jw= 2472 -IGlkZW50 2473 -44Gn 2474 -dmVudA== 2475 -dXJjaA== 2476 -IGh5 2477 -IHlh 2478 -IHRyYWQ= 2479 -IHJlbGF0aW9uc2hpcA== 2480 -w7o= 2481 -IGRvdQ== 2482 -T1I= 2483 -IHN3ZQ== 2484 -IG5lZw== 2485 -aW5hdGlvbg== 2486 -IHRleHQ= 2487 -aXBw 2488 -IGZpbmU= 2489 -w6Fz 2490 -IERy 2491 -IENvbWU= 2492 -IG1vbnRocw== 2493 -LCI= 2494 -0LXQvdC4 2495 -IGhvdXJz 2496 -IHBvZA== 2497 -aXJ0 2498 -IGludm9s 2499 -IGNvbGxlY3Q= 2500 -IGF1Zg== 2501 -IHBh 2502 -IGhpc3Rvcnk= 2503 -bWI= 2504 -aWZ5 2505 -ID8= 2506 -IGJlbG93 2507 -YXN1cmU= 2508 -YWJ5 2509 -IGxhbmd1 2510 -IGFudA== 2511 -IGNvbWI= 2512 -YXRv 2513 -IGV4aXN0 2514 -IOuL 2515 -IHRha2Vz 2516 -IGNoYXJhY3Rlcg== 2517 -YWZm 2518 -IGZpZWxk 2519 -IGVjb25vbQ== 2520 -aWVm 2521 -IHBpZWNl 2522 -5Zw= 2523 -IHJlYWNo 2524 -IOqy 2525 -b255 2526 -IG1hdGVyaWFs 2527 -IGRpZw== 2528 -IHBoeXM= 2529 -IGltcHJv 2530 -IHNpbWlsYXI= 2531 -SUM= 2532 -IG5ldA== 2533 -eW4= 2534 -IHBvc2l0aW9u 2535 -w58= 2536 -IGJlbmU= 2537 -cmVhZA== 2538 -IGxlYXJuaW5n 2539 -dW1l 2540 -IGNsZWFu 2541 -0YLQvtGA 2542 -IGNvb2s= 2543 -IHNlZW1z 2544 -IG9s 2545 -IFVT 2546 -IEplcw== 2547 -IOCu 2548 -ZW50aWFs 2549 -aXZlcnNpdHk= 2550 -YWN5 2551 -INGP 2552 -b2x1dGVseQ== 2553 -cmVjdA== 2554 -IFBsZWFzZQ== 2555 -IHJlcHJlcw== 2556 -IHRvdWNo 2557 -bWVu 2558 -INCw 2559 -acOzbg== 2560 -IFRoYW5rcw== 2561 -IGFuZw== 2562 -IG1ham9y 2563 -IGl0c2VsZg== 2564 -aWxscw== 2565 -Iiw= 2566 -aWFucw== 2567 -IHNjcmVlbg== 2568 -IGhvcg== 2569 -IGtub3du 2570 -IGVudmlyb24= 2571 -IGZpbmFs 2572 -IGZpZ3VyZQ== 2573 -IFR3 2574 -IGV5ZXM= 2575 -IGltYWc= 2576 -IHNlZWluZw== 2577 -IGhhaXI= 2578 -cmVt 2579 -IGFwcGxpYw== 2580 -ZW5kcw== 2581 -cHV0 2582 -IG5ld3M= 2583 -IGNvbXBsZXRlbHk= 2584 -dWdocw== 2585 -IGtuZXc= 2586 -aWZpZWQ= 2587 -IEpl 2588 -IERpZA== 2589 -IHNpdHVhdGlvbg== 2590 -IGZsbw== 2591 -bXM= 2592 -IHBob25l 2593 -IGJhbGw= 2594 -ZG8= 2595 -IHBhcmVudA== 2596 -IHNvcnJ5 2597 -dXJ5 2598 -0LjQvQ== 2599 -aXBz 2600 -0LDQtA== 2601 -IGluc3RlYWQ= 2602 -IGh1Z2U= 2603 -IHR1 2604 -IOOB 2605 -IEdy 2606 -IGRldGFpbA== 2607 -INCf 2608 -IGluZGl2aWR1YWw= 2609 -IGZpcmU= 2610 -IGNsb3M= 2611 -IHdlcg== 2612 -dW5l 2613 -IHJ1bm5pbmc= 2614 -IGNvbnZlcnM= 2615 -IHJlY29tbQ== 2616 -IGNvbW8= 2617 -IHNvbWVib2R5 2618 -IEpvaG4= 2619 -IOydtA== 2620 -IE91cg== 2621 -cGxlcw== 2622 -IFBo 2623 -IGFuYWw= 2624 -IDUw 2625 -IG9mZmVy 2626 -IDw= 2627 -aXRpb25hbA== 2628 -Z2VzdA== 2629 -IHZvdXM= 2630 -bGV0 2631 -aWN5 2632 -IGZlZWxpbmc= 2633 -TEU= 2634 -cm9z 2635 -IHRoaXJk 2636 -0L7Qug== 2637 -IHNlcmllcw== 2638 -IEFueQ== 2639 -aXNlZA== 2640 -b2xk 2641 -IGRyYXc= 2642 -IHNlcnZpY2U= 2643 -IGNhbm5vdA== 2644 -YmFs 2645 -44GG 2646 -IGxpdmluZw== 2647 -xLFt 2648 -IGRpZmZlcmVuY2U= 2649 -IG9wcG9ydHVuaXR5 2650 -IG5lYXI= 2651 -b3J0aA== 2652 -a2Vu 2653 -IGxvY2Fs 2654 -2Ko= 2655 -IENvbg== 2656 -IG9iamVjdA== 2657 -IGRhc3M= 2658 -44GZ 2659 -kNc= 2660 -IHF1aWNrbHk= 2661 -cmFwaA== 2662 -IGlzc3Vlcw== 2663 -6YCZ 2664 -IEFtZXJpY2Fu 2665 -IHByZXA= 2666 -ZW5jZXM= 2667 -IHByb2Zlc3M= 2668 -bGxpbmc= 2669 -b2Y= 2670 -IGZvb3Q= 2671 -YnJl 2672 -IHVzdWFsbHk= 2673 -IGdlbmVyYWw= 2674 -ZGE= 2675 -YW5jZXM= 2676 -IGRlc3Q= 2677 -IG9jYw== 2678 -IG1lbWJlcnM= 2679 -IGRhbnM= 2680 -IGVxdWFs 2681 -enQ= 2682 -IGJlY29t 2683 -IG1vdmluZw== 2684 -IHNwZWNpZmlj 2685 -w61h 2686 -IGZ1cg== 2687 -IG5lY2Vzcw== 2688 -IGNvbW1vbg== 2689 -IGF0dGFjaw== 2690 -INGN0YLQvg== 2691 -IFRvZGF5 2692 -IHVucw== 2693 -IEd1 2694 -aW9k 2695 -IGFjY291bnQ= 2696 -IGdyYW5k 2697 -IHNlbGY= 2698 -IEVs 2699 -IHRhc3Q= 2700 -IGNvbnRlbnQ= 2701 -IGN1 2702 -hOs= 2703 -IE1heWJl 2704 -IEplc3Vz 2705 -b3Jlcw== 2706 -cG9ydA== 2707 -qbQ= 2708 -IGdpdmVz 2709 -IG5vcm1hbA== 2710 -0YDRgw== 2711 -IGltcGFjdA== 2712 -w6Ry 2713 -IGRpZXM= 2714 -IGxhYg== 2715 -c2g= 2716 -aW9z 2717 -IFByZXM= 2718 -IFVuZA== 2719 -IE9m 2720 -IGZpbmFsbHk= 2721 -IGRvbGw= 2722 -IHZvY8Oq 2723 -cGx5 2724 -IEFn 2725 -IHRha2Vu 2726 -IGdyb3VuZA== 2727 -Zm9ydA== 2728 -IGdhdmU= 2729 -IEluc3Q= 2730 -IGxvc3Q= 2731 -IHdvcmtlZA== 2732 -IGxpdGVy 2733 -IGlzc3Vl 2734 -IGluZHVzdA== 2735 -IHJldHVybg== 2736 -IGhhcHBlbmluZw== 2737 -IHdhbnRz 2738 -0LjQsg== 2739 -IHByb2JsZW1z 2740 -IENhcg== 2741 -nbw= 2742 -IEFsc28= 2743 -IHNpemU= 2744 -IG9idmlvdXNseQ== 2745 -IFN1 2746 -IFNj 2747 -IHJlY29tbWVuZA== 2748 -b3VyY2Vz 2749 -YXN0aWM= 2750 -Li4uLg== 2751 -IG1p 2752 -bGllcg== 2753 -IEV2ZW4= 2754 -Y2lh 2755 -IGh1cg== 2756 -dmE= 2757 -IG1hc3M= 2758 -IHdvdWxkbg== 2759 -dW50 2760 -Y2tz 2761 -IGZlbHQ= 2762 -b3Nw 2763 -bGlnaHQ= 2764 -0L7Qu9GM 2765 -bmll 2766 -IGJvdHRvbQ== 2767 -INCx0Ys= 2768 -b3JlZA== 2769 -aXNvbg== 2770 -IGdyYWQ= 2771 -IHVtYQ== 2772 -IHZh 2773 -IOyC 2774 -cmVzc2lvbg== 2775 -dWxhdGlvbg== 2776 -SUQ= 2777 -aWRlbmNl 2778 -IGJ1cg== 2779 -IGdvbmU= 2780 -bHU= 2781 -7Ja07A== 2782 -IHJlZHU= 2783 -IGph 2784 -7J2Y 2785 -aXRh 2786 -IHNvZnQ= 2787 -IMOnYQ== 2788 -aWNv 2789 -ZXJhbA== 2790 -w7E= 2791 -YWY= 2792 -IHBvaW50cw== 2793 -Z3U= 2794 -IGTDqQ== 2795 -YXB0 2796 -YXg= 2797 -IEFscmlnaHQ= 2798 -IGNhbWVyYQ== 2799 -IGFjaA== 2800 -INC/0L4= 2801 -IHNldmVy 2802 -NTA= 2803 -IHNpZQ== 2804 -z4E= 2805 -IG1hbA== 2806 -IGNvbXB1dA== 2807 -IG1pZGRsZQ== 2808 -IGNvdWxkbg== 2809 -bWluZw== 2810 -IOyL 2811 -IEhpcw== 2812 -IGdhbWVz 2813 -IGludHJvZHU= 2814 -IGNlbGw= 2815 -cG9y 2816 -IHNsZWVw 2817 -IOuz 2818 -aWRpbmc= 2819 -IG91 2820 -IGRlZw== 2821 -IGRyaW5r 2822 -IGVudmlyb25tZW50 2823 -IFVuaXRlZA== 2824 -IHRhbGtlZA== 2825 -IGNob29zZQ== 2826 -IGpvdXI= 2827 -ZWdl 2828 -IE1pbg== 2829 -IGludGU= 2830 -IHJhdGhlcg== 2831 -IG9mZmlj 2832 -0LrQsA== 2833 -YWNoaW5n 2834 -IG1lbnRpb25lZA== 2835 -IGZpbGw= 2836 -IHRyYWNr 2837 -IG5pZQ== 2838 -IHV0 2839 -INCy0Ys= 2840 -aWJpbGl0eQ== 2841 -IHZhYw== 2842 -IHJhZA== 2843 -IHBhY2s= 2844 -IHNlbmQ= 2845 -IERhcw== 2846 -IEFi 2847 -IGVuZ2luZQ== 2848 -44GX 2849 -IGNvbXBldA== 2850 -w7Q= 2851 -INCy0YE= 2852 -IGRvb3I= 2853 -IGxvbmdlcg== 2854 -5bCN 2855 -IGxhbmd1YWdl 2856 -IGV4dHJh 2857 -cGxheQ== 2858 -IHdlYnM= 2859 -dW1i 2860 -cm9vbQ== 2861 -55w= 2862 -IGJlZ2lubmluZw== 2863 -IHJlZmVy 2864 -QU0= 2865 -bmVu 2866 -aWdoZXI= 2867 -ZmFjZQ== 2868 -ZXJj 2869 -IGZvcmdldA== 2870 -IGNvbW1lbnQ= 2871 -0LXQug== 2872 -0LvRjw== 2873 -cm9y 2874 -xbxl 2875 -IEdl 2876 -IGRhcms= 2877 -IGFueW9uZQ== 2878 -YW50ZQ== 2879 -Z2Vz 2880 -7Iq1 2881 -0ZE= 2882 -YmVk 2883 -amU= 2884 -cnVjdHVyZQ== 2885 -IHByaW0= 2886 -aWRh 2887 -6KY= 2888 -44G+ 2889 -IG1peA== 2890 -IHN0YXJ0aW5n 2891 -IOydtOs= 2892 -IHByb3ZpZGU= 2893 -YWN0aW9u 2894 -IG1vdGhlcg== 2895 -IHBlcmlvZA== 2896 -IHN0aWNr 2897 -IFlvdVQ= 2898 -IHRlY2hub2xvZ3k= 2899 -6rk= 2900 -IGJlZA== 2901 -IGdpdmluZw== 2902 -IGV4cGxhaW4= 2903 -emVu 2904 -aW1hdGU= 2905 -IHJlcHJlc2VudA== 2906 -bG9hZA== 2907 -IEhvd2V2ZXI= 2908 -IGxpdmVz 2909 -dXRo 2910 -aXJpdA== 2911 -b2du 2912 -IGxpaw== 2913 -IHJlc3BvbnM= 2914 -IHByaXY= 2915 -IHRvbQ== 2916 -w6fDo28= 2917 -aWFt 2918 -IGV4Y2l0ZWQ= 2919 -IGNhcmQ= 2920 -Z3JvdW5k 2921 -INeU 2922 -IHNlbnM= 2923 -IHRlYWNo 2924 -aWRv 2925 -aG9k 2926 -IGVwaXM= 2927 -IHdlbGNvbWU= 2928 -IHdhbGw= 2929 -5Lk= 2930 -IGNoYW5jZQ== 2931 -aGVu 2932 -INCh 2933 -IMSR 2934 -IHNpbXBseQ== 2935 -INGC0LDQug== 2936 -cmluZw== 2937 -amE= 2938 -Ym9vaw== 2939 -IHNldmVyYWw= 2940 -c3Rl 2941 -IGNyZWF0ZWQ= 2942 -INC+0YI= 2943 -IHB1c2g= 2944 -PT0= 2945 -IGhpZ2hlcg== 2946 -dWY= 2947 -b3VyY2U= 2948 -b2tl 2949 -IG9ubGluZQ== 2950 -IHJlbGU= 2951 -IHRvbg== 2952 -ZW5zaXZl 2953 -IGZhdm9yaXRl 2954 -0YPQtA== 2955 -IGxvb2tlZA== 2956 -IHZvbg== 2957 -4oCU 2958 -IGbDvHI= 2959 -IGJ1dHRvbg== 2960 -IGJpbGw= 2961 -IGNoYW5nZXM= 2962 -ISI= 2963 -IHNsb3c= 2964 -YWJsZXM= 2965 -IGRlYXRo 2966 -YW5kcw== 2967 -YXRlZw== 2968 -IHRoZW1zZWx2ZXM= 2969 -44Gj 2970 -IGNvcA== 2971 -44Gu 2972 -IHBlcnNvbmFs 2973 -dWdoaW5n 2974 -IDEx 2975 -Z2Fy 2976 -YWRlcw== 2977 -IG5lZWRlZA== 2978 -IHN0dWR5 2979 -YWdlZA== 2980 -0YHRgtCy 2981 -aW5v 2982 -IGRpc2M= 2983 -a2k= 2984 -IGFkZHJlc3M= 2985 -16g= 2986 -aXR0ZW4= 2987 -ZXNvbWU= 2988 -INC2 2989 -pOs= 2990 -dXJh 2991 -IG11 2992 -IGNvbnRpbnU= 2993 -Zm9y 2994 -IG1hdGNo 2995 -44Gm 2996 -IHN0cmFpZ2h0 2997 -kOs= 2998 -bmVycw== 2999 -IGRvZw== 3000 -IGRlYg== 3001 -IENP 3002 -IG9z 3003 -Z2Vk 3004 -Y2FtZQ== 3005 -IGNvcnJlY3Q= 3006 -ZXR0ZQ== 3007 -IFNlZQ== 3008 -IGluY2x1ZGluZw== 3009 -IEV1cm8= 3010 -ZXN0ZXI= 3011 -IGp1bXA= 3012 -IFdoaWNo 3013 -INC60LDQug== 3014 -c29u 3015 -eWE= 3016 -SU5H 3017 -IGVpbmU= 3018 -b3No 3019 -ZW5jeQ== 3020 -IG1lZGlh 3021 -IHN1YnNjcmliZQ== 3022 -6YI= 3023 -IHByaW4= 3024 -IGhhYg== 3025 -IFBlcg== 3026 -IFdhcw== 3027 -IHBhZ2U= 3028 -aXRvcg== 3029 -IHRvd2FyZHM= 3030 -IHRyaWVk 3031 -ZW5nZQ== 3032 -YXJ0bWVudA== 3033 -IHZhcmk= 3034 -IHBhcGVy 3035 -IHBpY3R1cmU= 3036 -IHZlcnNpb24= 3037 -IGJyb3VnaHQ= 3038 -d2FyZQ== 3039 -IFN0YXRlcw== 3040 -IHNpY2g= 3041 -bGVkZ2U= 3042 -IHBlcmNlbnQ= 3043 -IGdvZA== 3044 -ZWM= 3045 -IENvbW0= 3046 -IGRlY2lkZWQ= 3047 -IHNlbGVjdA== 3048 -7ZWc 3049 -KS4= 3050 -dXJpdHk= 3051 -IGZ1cnRoZXI= 3052 -IGNvbW1lbnRz 3053 -bGVtZW50 3054 -IGRyZWFt 3055 -IGNlbnRlcg== 3056 -bWk= 3057 -IGNhcw== 3058 -IHdvbWFu 3059 -IHJvYWQ= 3060 -IGZhaWw= 3061 -IGJlY2FtZQ== 3062 -bHVz 3063 -aWxpdGllcw== 3064 -44Gv 3065 -IENv 3066 -IG1hbmFnZQ== 3067 -IHJlY29nbg== 3068 -IGFjdGlvbg== 3069 -IGJlbmVm 3070 -IGVhcmxpZXI= 3071 -15w= 3072 -IHNwZWVk 3073 -IG1lbnQ= 3074 -IHNvY2k= 3075 -IHNob290 3076 -dWk= 3077 -IMOk 3078 -IGFwcGx5 3079 -dm8= 3080 -eGlt 3081 -IGNhdXNl 3082 -IHN1cnBy 3083 -IGhhYmVu 3084 -REk= 3085 -IGZhdGhlcg== 3086 -IE5leHQ= 3087 -IFlvdVR1YmU= 3088 -IGNvZGU= 3089 -IHJvbGU= 3090 -Z3Jlc3M= 3091 -IGdyZWVu 3092 -ZXR0 3093 -IGJ1aWx0 3094 -IGZsb3c= 3095 -IGJhc2U= 3096 -IHRyYWluaW5n 3097 -IHJvdW5k 3098 -IFdpbGw= 3099 -IHBhdGg= 3100 -IFJv 3101 -IGludGVyZXN0ZWQ= 3102 -7Ja0 3103 -IHJlc3BlY3Q= 3104 -IGNoYW5nZWQ= 3105 -aXNzaW9u 3106 -IHN0dWRlbnQ= 3107 -b2dyYXBo 3108 -IGFwcHJvYWNo 3109 -IHNob3dz 3110 -5bCx 3111 -IHRhcg== 3112 -IGNyaXQ= 3113 -IGdsbw== 3114 -7Iq164uI64uk 3115 -IGRlYWQ= 3116 -IFByZXNpZGVudA== 3117 -IHRob3Vz 3118 -IGJhbA== 3119 -c3Rlcg== 3120 -ZXg= 3121 -IGFic29sdXRlbHk= 3122 -IG1pYw== 3123 -IHByYWN0aWNl 3124 -IHF1YWxpdHk= 3125 -IGxvd2Vy 3126 -b2dsZQ== 3127 -IHNlcGFy 3128 -YmFsbA== 3129 -bWVkaQ== 3130 -IHJldmlldw== 3131 -IEFwcA== 3132 -IG9r 3133 -4oCL 3134 -IGV4cGVyaWVu 3135 -IGNvbmNlcm4= 3136 -ZW50aWFsbHk= 3137 -bW9yZQ== 3138 -IEpv 3139 -YXBhbg== 3140 -IEljaA== 3141 -aXN0aWM= 3142 -IGZhaXI= 3143 -IHdlYnNpdGU= 3144 -aXJlcw== 3145 -IEJ5 3146 -IHRyYXZlbA== 3147 -IHJpc2s= 3148 -IG1pcg== 3149 -IGJvYXJk 3150 -IHNlbg== 3151 -IHBhcmVudHM= 3152 -IFdvdw== 3153 -IGZlZWQ= 3154 -IHNhdmU= 3155 -IHNlcmlvdXM= 3156 -IGluaXQ= 3157 -RUw= 3158 -dW5kcmVk 3159 -QVM= 3160 -IHZhbg== 3161 -b3Jyb3c= 3162 -IHdvcnRo 3163 -IHNlYXJjaA== 3164 -IDE2 3165 -IHBhcnRz 3166 -0YHRgtGM 3167 -IGNvbXBhbg== 3168 -IG1vdmll 3169 -IG1ldGhvZA== 3170 -IGlsbA== 3171 -IHdpc2g= 3172 -ZHk= 3173 -IGl0ZW0= 3174 -IG1pbnVz 3175 -YW5nZXI= 3176 -IHZvaWNl 3177 -IHNraW4= 3178 -IGFyZWFz 3179 -IGVpZ2h0 3180 -IG9icw== 3181 -ICw= 3182 -0LDQuQ== 3183 -IG9pbA== 3184 -IGN5 3185 -IGJhYnk= 3186 -c3k= 3187 -IGVtcGxveQ== 3188 -IEtl 3189 -IHBsYWNlcw== 3190 -IGZpeA== 3191 -IGVzdMOh 3192 -44Go 3193 -aXZlZA== 3194 -IGxvdHM= 3195 -IHNlYXNvbg== 3196 -dW5r 3197 -YWx0 3198 -IHRhYmxl 3199 -INCi 3200 -w6I= 3201 -IGF0dGVudGlvbg== 3202 -44Gq 3203 -IEhlcg== 3204 -IGFnZQ== 3205 -IHByYQ== 3206 -YmFjaw== 3207 -Y2ls 3208 -IG5ldHdvcms= 3209 -cml0 3210 -IGRvYw== 3211 -IGFyZW4= 3212 -aWdlbg== 3213 -IOuE 3214 -2K8= 3215 -ZW5kZXI= 3216 -IHRvdGFs 3217 -IHByaWNl 3218 -IGNyYXp5 3219 -7Jo= 3220 -aXF1 3221 -dGhvdWdo 3222 -WW91 3223 -2Yc= 3224 -44KT 3225 -z4U= 3226 -IHNhdA== 3227 -IGJp 3228 -IERpZQ== 3229 -IHNoYQ== 3230 -IHRoYW5rcw== 3231 -dWg= 3232 -IHN0YWdl 3233 -0LDQtg== 3234 -IEZs 3235 -IGxlYXY= 3236 -IGJveQ== 3237 -IGFm 3238 -w7Zu 3239 -IEdldA== 3240 -IGFjY2VwdA== 3241 -IGVudGVy 3242 -IHR1cg== 3243 -IHNpxJk= 3244 -IGhvbmVzdA== 3245 -44CM 3246 -IHNhbQ== 3247 -IHJlcGw= 3248 -Z2luZw== 3249 -IGRldmVsb3BtZW50 3250 -IEFjdA== 3251 -b3Jh 3252 -44CN 3253 -5L4= 3254 -IGtub3dz 3255 -IGltYWdl 3256 -IExvcmQ= 3257 -0LjRgtGM 3258 -IHdlZWtz 3259 -IHNleA== 3260 -lOs= 3261 -IGh1bmRyZWQ= 3262 -IHNvdW5kcw== 3263 -IGxlYXJuZWQ= 3264 -IGJ1ZA== 3265 -INGB0YI= 3266 -IGluY3JlZA== 3267 -4pk= 3268 -IG5vcw== 3269 -IGRyb3A= 3270 -IGJlbg== 3271 -INCY 3272 -IHNhZmU= 3273 -YXRh 3274 -IGZ1Y2s= 3275 -c29jaQ== 3276 -IGRhbg== 3277 -IGNyb3Nz 3278 -MTA= 3279 -bW8= 3280 -dmVydA== 3281 -IDE3 3282 -emll 3283 -5ZU= 3284 -IGRvbQ== 3285 -IEJv 3286 -IHNldHRpbmc= 3287 -IGludm9sdmVk 3288 -YXJpbHk= 3289 -IHNpbmQ= 3290 -IHN1cw== 3291 -IHdvcnJ5 3292 -ZXRo 3293 -6rmM 3294 -IHN1bg== 3295 -IGhpZXI= 3296 -IGNlcnRhaW5seQ== 3297 -b3Vs 3298 -b3J0cw== 3299 -IEVy 3300 -IFVt 3301 -IGNhdXM= 3302 -IG5hdHVyYWw= 3303 -IMO8 3304 -IGNyeQ== 3305 -IFNlYw== 3306 -IHNvbQ== 3307 -5rI= 3308 -IGVkdWNhdGlvbg== 3309 -0LDQtdGC 3310 -IG11bHRpcA== 3311 -IGFsb25l 3312 -IGV5ZQ== 3313 -IHJhdGU= 3314 -IEV1cm9wZQ== 3315 -6L8= 3316 -bW9u 3317 -IGZpdA== 3318 -aXppbmc= 3319 -cHBlZA== 3320 -IHByZXNzdXJl 3321 -dGhl 3322 -0LjRgQ== 3323 -aXRlcw== 3324 -IEFm 3325 -cmVjaQ== 3326 -YXR0bGU= 3327 -IHNlcnZpY2Vz 3328 -IEdvb2dsZQ== 3329 -6YE= 3330 -IGNhc2Vz 3331 -IGRyaXZl 3332 -IGNoYWxsZW5n 3333 -dXo= 3334 -IE1v 3335 -7Jy86w== 3336 -dmFs 3337 -5YCL 3338 -IGZvbA== 3339 -IOyi 3340 -ZmZpYw== 3341 -IHJh 3342 -IHNpbg== 3343 -IGJsdWU= 3344 -IGFmZmVjdA== 3345 -IG1pcw== 3346 -IHNob3Q= 3347 -INC+0LE= 3348 -YXNpbmc= 3349 -IHNpZ25pZmlj 3350 -IENoZQ== 3351 -IOqz 3352 -IHBvc2l0aXZl 3353 -7KM= 3354 -IHdpZQ== 3355 -IDQw 3356 -b3JkaW5n 3357 -IEZyb20= 3358 -6rU= 3359 -IGJyYW5k 3360 -IHRydXN0 3361 -IHBsZQ== 3362 -IGNvbW11bmlj 3363 -IHdlaWdodA== 3364 -IGFza2luZw== 3365 -IHRheA== 3366 -IEphcGFu 3367 -44Gf 3368 -IO2VmA== 3369 -b3Bz 3370 -z4I= 3371 -IHB1dHRpbmc= 3372 -IHJvbGw= 3373 -IEFtZXJpY2E= 3374 -cmVn 3375 -ntc= 3376 -YXR1cmVz 3377 -ZW5zaW9u 3378 -IFNvbWV0 3379 -IG9yaWdpbmFs 3380 -cGluZw== 3381 -IMWf 3382 -IHByb2R1Y3Rz 3383 -44O8 3384 -IGNvbnRhY3Q= 3385 -b2x1dGlvbg== 3386 -IGdvYWw= 3387 -IHBvdw== 3388 -IHBlcmZvcm1hbmNl 3389 -IGJsb29k 3390 -YXRvcnM= 3391 -IE1pY2g= 3392 -IHRlbXBlcg== 3393 -IERhbg== 3394 -IHN1Z2c= 3395 -0YLQuA== 3396 -IGltbQ== 3397 -IG9mZmljZQ== 3398 -IGFycmk= 3399 -IGNvbWZvcnQ= 3400 -INCU 3401 -IHN1Z2dlc3Q= 3402 -IHBsYXQ= 3403 -gpg= 3404 -MTk= 3405 -IG9t 3406 -IHNldmVu 3407 -IENlbnQ= 3408 -aWxsZQ== 3409 -IGNvbmNlcHQ= 3410 -IGJhZw== 3411 -w7xu 3412 -aXZlbHk= 3413 -IGRpdg== 3414 -bW9z 3415 -5ok= 3416 -IGZlZWxz 3417 -IGly 3418 -YWtlcw== 3419 -bGV5 3420 -IHBhcnRpY2lw 3421 -INCa 3422 -Zmw= 3423 -anVzdA== 3424 -IHNpbA== 3425 -IFBh 3426 -QUw= 3427 -IGdvdHRh 3428 -IGZhbg== 3429 -IGNoYWxsZW5nZQ== 3430 -IGNvbXBhbmllcw== 3431 -IFBlb3BsZQ== 3432 -PC8= 3433 -0L7Qtw== 3434 -IHBlbg== 3435 -aXNpbmc= 3436 -IGF1cw== 3437 -ZW1pYw== 3438 -YW1lbnRl 3439 -IG1lZXRpbmc= 3440 -IHZpc2l0 3441 -IHN1cHBvc2Vk 3442 -IE9uY2U= 3443 -0LTQsA== 3444 -b3JsZA== 3445 -MzA= 3446 -VVM= 3447 -IHZpb2w= 3448 -IG5vdGljZQ== 3449 -INCQ 3450 -aGFu 3451 -cGVk 3452 -7Jg= 3453 -aGg= 3454 -IHRyb3U= 3455 -IG1pbnV0ZQ== 3456 -IFBhcg== 3457 -cmF5 3458 -IHRpdA== 3459 -IHVwZA== 3460 -IGJsb2Nr 3461 -IGR1ZQ== 3462 -YXVy 3463 -IGZvcmNl 3464 -IGNvdW4= 3465 -IOKAlA== 3466 -IHR5cGVz 3467 -66c= 3468 -IGxhdGU= 3469 -IGltcHJvdmU= 3470 -IOyI 3471 -IGF2ZQ== 3472 -dWxlcw== 3473 -Y2w= 3474 -YW1lZA== 3475 -IGF3ZXNvbWU= 3476 -IE9r 3477 -IHZvdA== 3478 -IG1hY2hpbmU= 3479 -IGZvbGxvd2luZw== 3480 -IG1lYXN1cmU= 3481 -YWNpw7Nu 3482 -dWVs 3483 -Y2hhbg== 3484 -IGFiaWxpdHk= 3485 -IHRvdXQ= 3486 -IGlkZWFz 3487 -IGluY3JlYXNl 3488 -IGVucw== 3489 -INGF 3490 -IOuq 3491 -IGplc3Q= 3492 -INCc 3493 -IHRydXRo 3494 -aHk= 3495 -IHNwZW5k 3496 -IHNjaWVuY2U= 3497 -ZXRl 3498 -IDE0 3499 -IGVwaXNvZGU= 3500 -IGFsZw== 3501 -ZW5kZWQ= 3502 -44GT 3503 -YXJp 3504 -bGxh 3505 -IGZpc2g= 3506 -IHRocm93 3507 -bWl0 3508 -5bk= 3509 -IGNpcmM= 3510 -IENhbA== 3511 -IHRvdXI= 3512 -IGRpcmVjdGlvbg== 3513 -IG5vY2g= 3514 -0LXQsg== 3515 -w6lu 3516 -IGNvdW50cmllcw== 3517 -IGluZHVzdHJ5 3518 -aW55 3519 -aWNsZQ== 3520 -IGZlZXQ= 3521 -SXQ= 3522 -IGxlYWRlcnM= 3523 -ZXR6dA== 3524 -IHN0YWZm 3525 -55Q= 3526 -IHB1cnA= 3527 -aXRv 3528 -PyE= 3529 -IEph 3530 -IHN0b3Jl 3531 -ZXRpYw== 3532 -IENoaW5h 3533 -IOuQ 3534 -IFVuaXZlcnNpdHk= 3535 -ICM= 3536 -IGRlY2lzaW9u 3537 -IGFjaGll 3538 -IGFjdHVhbA== 3539 -dWx5 3540 -IHNlY3Rpb24= 3541 -IHJlc3VsdHM= 3542 -IHN0YXI= 3543 -IG1pc3Q= 3544 -aWJseQ== 3545 -IGRhZA== 3546 -IG51bWJlcnM= 3547 -b21i 3548 -6Ko= 3549 -IFNwZQ== 3550 -IG1lcg== 3551 -IDI1 3552 -IGF1dG9t 3553 -IGNvbGQ= 3554 -2Kg= 3555 -hJw= 3556 -YWdlcg== 3557 -IFRW 3558 -IFNpZQ== 3559 -IEhhdmU= 3560 -IMW8ZQ== 3561 -dWdn 3562 -YWluZWQ= 3563 -IHVwb24= 3564 -IGxvZw== 3565 -IGNvbXBsZXRl 3566 -IGJyYWlu 3567 -YWdpbmc= 3568 -IE11cw== 3569 -b3Zlcg== 3570 -IGVhc2llcg== 3571 -IGludGVncg== 3572 -IG3DoXM= 3573 -IHR1cm5lZA== 3574 -IHN0cmk= 3575 -aXZhbA== 3576 -IGhlYXY= 3577 -IFRI 3578 -IHdyaXRpbmc= 3579 -0YDQsA== 3580 -5Zyo 3581 -5aSn 3582 -IGNsYQ== 3583 -ZGluZw== 3584 -IHRlbGxpbmc= 3585 -0LjQtA== 3586 -aWNhdGVk 3587 -5Lul 3588 -YWNodA== 3589 -44GC 3590 -aGFwcw== 3591 -IFN0ZQ== 3592 -IHJlc291cmNlcw== 3593 -IGRhbm4= 3594 -IHBhcnR5 3595 -IM+E 3596 -IHNhZg== 3597 -aXNlcw== 3598 -dHJl 3599 -b2ludA== 3600 -IGtub3dsZWRnZQ== 3601 -IGFueW1vcmU= 3602 -IGZseQ== 3603 -IG1haW50 3604 -0LjQug== 3605 -5ZE= 3606 -IHNlbGw= 3607 -bGF1Z2hz 3608 -IFlvcms= 3609 -IGJpZW4= 3610 -IG9k 3611 -IGVhc2lseQ== 3612 -IHJhbmdl 3613 -IG9wdGlvbg== 3614 -2Lk= 3615 -IGFwcHJlY2k= 3616 -b2Ny 3617 -IGRldGVybQ== 3618 -0YQ= 3619 -IG1lYW5pbmc= 3620 -IHNpdGU= 3621 -IGRpc2Nv 3622 -dmVyYWdl 3623 -IGxvc2U= 3624 -IGluc3RhbGw= 3625 -IGVtb3Q= 3626 -YW50bHk= 3627 -w6R0 3628 -IHRhbWI= 3629 -IFdhcg== 3630 -IEhv 3631 -IEdlbg== 3632 -ZW15 3633 -0LXQtw== 3634 -IFBvbA== 3635 -IG1lc3NhZ2U= 3636 -IG5vdGU= 3637 -jIA= 3638 -IGhldA== 3639 -IGltbWVkaQ== 3640 -IGF2bw== 3641 -IGJvb2tz 3642 -IGJlY29tZXM= 3643 -cmVzaA== 3644 -w6hz 3645 -YXNvbnM= 3646 -IGhpbXNlbGY= 3647 -dXRz 3648 -IGp1 3649 -IGF3YXJl 3650 -IHJlcXVpcmU= 3651 -IHN5c3RlbXM= 3652 -IEhhcg== 3653 -IGFtb25n 3654 -IGhvbQ== 3655 -IGJyZWF0 3656 -IHdlaXJk 3657 -IOu2 3658 -zrs= 3659 -2Kk= 3660 -aWZm 3661 -b3Jpbmc= 3662 -IHBsYXRmb3Jt 3663 -IFRha2U= 3664 -IGhlbHBz 3665 -dXRpb25z 3666 -IGZvcmc= 3667 -IGx1Y2s= 3668 -IEVuZ2xpc2g= 3669 -IHdlYg== 3670 -IG5lZ2F0aXZl 3671 -IHR1dA== 3672 -IGFib3Zl 3673 -bmd0aA== 3674 -IOqxsA== 3675 -IHN0b3JpZXM= 3676 -IGxvYWQ= 3677 -IGJhY2tncm91bmQ= 3678 -IHN3aXRjaA== 3679 -Z2E= 3680 -IHByaW5jaQ== 3681 -IGZpbmFu 3682 -IHZhcmlvdXM= 3683 -IGzDoA== 3684 -IGtpbmRz 3685 -YWluaW5n 3686 -IG5hdHVyZQ== 3687 -INCe 3688 -Y3o= 3689 -IHByYXk= 3690 -IGdhcg== 3691 -aXJt 3692 -ICY= 3693 -IOyD 3694 -bnM= 3695 -IFJlcA== 3696 -IEZl 3697 -IHJldg== 3698 -cmFuZA== 3699 -IGxpa2VseQ== 3700 -IHVuZGVyc3RhbmRpbmc= 3701 -xLFy 3702 -44GL 3703 -IGZhbA== 3704 -IDEz 3705 -0YbQuA== 3706 -IHN1ZA== 3707 -IGJyb3RoZXI= 3708 -IHBsYW50 3709 -IHRocm91Z2hvdXQ= 3710 -d2lzZQ== 3711 -cHJl 3712 -IGN1bHR1cmU= 3713 -INmF 3714 -IHdvbmRlcmZ1bA== 3715 -IGFo 3716 -cHBlcg== 3717 -IHNvbGQ= 3718 -IHN0YXJ0cw== 3719 -IHdyaXR0ZW4= 3720 -zq8= 3721 -bmk= 3722 -INeU1w== 3723 -IERhdg== 3724 -IHVsdA== 3725 -IGFybQ== 3726 -IHJvY2s= 3727 -IHdlYXI= 3728 -642w 3729 -YW5v 3730 -cmFn 3731 -IHNxdWFyZQ== 3732 -0LDQvdC4 3733 -Y2FzdA== 3734 -bGVicg== 3735 -IGxpdGVyYWxseQ== 3736 -IHBsYXllZA== 3737 -IGhlYXQ= 3738 -b25zZQ== 3739 -cmljdA== 3740 -IGluc3A= 3741 -aWRz 3742 -IHBvcHVsYXI= 3743 -64+E 3744 -IGNhdGNo 3745 -IG1vdW50 3746 -IGp1ZA== 3747 -V2hhdA== 3748 -0LXQsQ== 3749 -UkE= 3750 -YXVk 3751 -0LrQvg== 3752 -IHN1cmZhY2U= 3753 -IGNvbnY= 3754 -IHBpZWNlcw== 3755 -T2g= 3756 -5oA= 3757 -IHN0eWxl 3758 -cHBpbmc= 3759 -IHJlYWRpbmc= 3760 -IGNvbnZlcnNhdGlvbg== 3761 -0L7Qvw== 3762 -5L6G 3763 -IEFnYWlu 3764 -IGJhbms= 3765 -dGltZQ== 3766 -0YPRgg== 3767 -ZXJ2ZQ== 3768 -IEdyZWF0 3769 -IGNhcHQ= 3770 -0LDQsQ== 3771 -YXlz 3772 -IEZpbg== 3773 -aWZpY2F0aW9u 3774 -IMOkcg== 3775 -0LDRjg== 3776 -IGVnZw== 3777 -IFdlbA== 3778 -IHRhcmdldA== 3779 -dWxh 3780 -Y2hlcw== 3781 -YW5p 3782 -T08= 3783 -aWNpb3Vz 3784 -bm93 3785 -z4M= 3786 -Ym9hcmQ= 3787 -IGdlbnRl 3788 -IGRybw== 3789 -IEV0 3790 -IGRpbg== 3791 -IGNvcw== 3792 -IGF1dGhvcg== 3793 -2LM= 3794 -IG9jaA== 3795 -IGVtYWls 3796 -IHNwaXJpdA== 3797 -IHNpdHRpbmc= 3798 -bWFz 3799 -IHN0cmVuZ3Ro 3800 -IGJpZ2dlcg== 3801 -IFdhaXQ= 3802 -IG1hdA== 3803 -IHBvbGljZQ== 3804 -cmVzc2Vk 3805 -IHdhaXRpbmc= 3806 -aXNoaW5n 3807 -IGRvbGxhcnM= 3808 -aG9vZA== 3809 -c3M= 3810 -IGltYWdpbmU= 3811 -aW5p 3812 -IG1lcw== 3813 -IGRpc2U= 3814 -aWRnZQ== 3815 -YWJvcg== 3816 -IHBldA== 3817 -IGhvcA== 3818 -IEtpbmc= 3819 -IGNvbXB1dGVy 3820 -IGdvbGQ= 3821 -IG51 3822 -IGZpbmc= 3823 -KSw= 3824 -IHNlY3VyaXR5 3825 -cnVjdGlvbg== 3826 -IHNvbHV0aW9u 3827 -ZXh0 3828 -IHBhdHRlcg== 3829 -aWNrZW4= 3830 -dXJlZA== 3831 -IHN0YW5kYXJk 3832 -7Iuc 3833 -IGRvdWJsZQ== 3834 -zrc= 3835 -IHdpZmU= 3836 -aXNh 3837 -IGRpcmVjdGx5 3838 -YWNlZA== 3839 -IGJ1bmNo 3840 -IMK/ 3841 -0LDQu9GM 3842 -IHJlZ2FyZA== 3843 -IHN3ZWV0 3844 -IHVuaXF1ZQ== 3845 -IOKZqw== 3846 -IHRyYWlu 3847 -IEdlcm0= 3848 -zqw= 3849 -UkU= 3850 -IGJlaGF2 3851 -IHByZWQ= 3852 -7IM= 3853 -c2V0 3854 -IGRlc2NyaXB0aW9u 3855 -w6ll 3856 -IGNhdA== 3857 -5ZM= 3858 -IGNvbGxlZ2U= 3859 -7Js= 3860 -IGFwcGxpY2F0aW9u 3861 -IFNlbg== 3862 -YXNr 3863 -IGNyZWQ= 3864 -dWJsaWM= 3865 -IG11bHRpcGxl 3866 -IG5p 3867 -IHByZXNpZGVudA== 3868 -IGFkZGVk 3869 -IHJvYg== 3870 -IGFxdWk= 3871 -IGhvc3A= 3872 -IHRvb2xz 3873 -IGd1bg== 3874 -IGJhc2lj 3875 -IGxpbmVz 3876 -IHN0cnVjdHVyZQ== 3877 -IFJ1c3M= 3878 -IHRvdGFsbHk= 3879 -IGJpZ2dlc3Q= 3880 -IGVlbg== 3881 -IGFyZw== 3882 -INec 3883 -IHBhcms= 3884 -IERlcw== 3885 -IGNlbGVicg== 3886 -IGZhaXQ= 3887 -0LXQvdGM 3888 -IHN1ZmY= 3889 -IHJlZ3VsYXI= 3890 -qOs= 3891 -IG1pbmU= 3892 -IEtvcmU= 3893 -IHByZXZpb3Vz 3894 -IHBp 3895 -IHNlZw== 3896 -IHBvbGljeQ== 3897 -INC60L4= 3898 -IFRydW1w 3899 -IHZhY2M= 3900 -w7N3 3901 -IFN5 3902 -0LjRhw== 3903 -aXR0ZXI= 3904 -IHBvbGl0aWNhbA== 3905 -cmFz 3906 -IGFscw== 3907 -0LXQu9GM 3908 -IHNoYXBl 3909 -YW56 3910 -IG9udG8= 3911 -IGFyY2g= 3912 -IGFtYg== 3913 -YWdyYW0= 3914 -IFNt 3915 -Y3Rpb25z 3916 -IGpvaW4= 3917 -Ym9y 3918 -5Zs= 3919 -IGZyYW1l 3920 -oIc= 3921 -IGNob2ljZQ== 3922 -4K+B 3923 -0YPRjg== 3924 -IENvcg== 3925 -IFN3 3926 -SVQ= 3927 -IHRlbmQ= 3928 -IEVhcg== 3929 -IHRvcg== 3930 -IGV2ZW50cw== 3931 -IGNsYWlt 3932 -IERh 3933 -IE1hcms= 3934 -IGdyb3Vwcw== 3935 -IGVhdGluZw== 3936 -IFdvcmxk 3937 -IHJlY2VudGx5 3938 -IHRhc3Rl 3939 -IHN1cnY= 3940 -4KQ= 3941 -IHNraWxscw== 3942 -INC40Lc= 3943 -aXR0ZWQ= 3944 -IHNob3A= 3945 -7J207A== 3946 -IGVzdGFi 3947 -IOuCmA== 3948 -IHNlY29uZHM= 3949 -IFRob3Nl 3950 -IEVudA== 3951 -IOyE 3952 -ZXJzb24= 3953 -IHRvd24= 3954 -IGNhbmQ= 3955 -IG9wdGlvbnM= 3956 -IGluZw== 3957 -VklE 3958 -IGVuY291cg== 3959 -IHLDqQ== 3960 -4pmq 3961 -IGVudHJl 3962 -IG1vdmVtZW50 3963 -IEJlbg== 3964 -IGJpcnRo 3965 -IHdoZQ== 3966 -IGhhbmc= 3967 -IEVt 3968 -aWdl 3969 -cm9sbA== 3970 -IHVuZg== 3971 -7II= 3972 -IHJpZA== 3973 -IHNwcmVhZA== 3974 -IGhvc3Q= 3975 -YWxk 3976 -IEVk 3977 -IGNvbnN1bQ== 3978 -VU4= 3979 -IG9waW4= 3980 -aXRhcg== 3981 -IE1lZA== 3982 -IHN1YmplY3Q= 3983 -IHBhbA== 3984 -IGNhcnJ5 3985 -IGFncmVl 3986 -IFdoaWxl 3987 -IGNhcmVlcg== 3988 -IHNjaWVudA== 3989 -IHN1ZGRlbg== 3990 -IGZpbGU= 3991 -emk= 3992 -IGV4Y2VwdA== 3993 -6bo= 3994 -IHBvdGVudGlhbA== 3995 -IEFub3RoZXI= 3996 -IGNvbXBsZXg= 3997 -IFNpbQ== 3998 -ZW5kbw== 3999 -IHJhaXM= 4000 -IHBoeXNpY2Fs 4001 -IGRhdGU= 4002 -YWtlcg== 4003 -IENvbA== 4004 -IHBvd2VyZnVs 4005 -IG1lbWJlcg== 4006 -cmFw 4007 -IHNwb3Q= 4008 -IHNvdXJjZQ== 4009 -IGZlbQ== 4010 -w6lt 4011 -IGVtcA== 4012 -amk= 4013 -aWV0eQ== 4014 -IGluZmx1 4015 -IGRyeQ== 4016 -IGxvY2s= 4017 -IHplcm8= 4018 -IFVo 4019 -IHJvdXQ= 4020 -IHBvcnF1ZQ== 4021 -IDI0 4022 -IHRhbA== 4023 -IGZvbGtz 4024 -IGxhdW5jaA== 4025 -IGNvbXBvbg== 4026 -IFdlbGNvbWU= 4027 -IGthbm4= 4028 -w6Ru 4029 -INGN0YI= 4030 -ZWVz 4031 -INmI 4032 -IGFueXdheQ== 4033 -IGF1ZGllbmNl 4034 -5Lq6 4035 -IHNsaWdodA== 4036 -b25h 4037 -IHVy 4038 -IHJlbGln 4039 -IGV4dHJlbQ== 4040 -xLF6 4041 -IE1h 4042 -zrw= 4043 -IMO2 4044 -IGFsbG93cw== 4045 -IGZhdA== 4046 -IEZhY2U= 4047 -IG5hdGlvbmFs 4048 -IGludGVydmlldw== 4049 -IE1j 4050 -w6l0 4051 -IGN1dGU= 4052 -ZWxh 4053 -IHNlY3JldA== 4054 -IFdlc3Q= 4055 -IERlcA== 4056 -IGV4ZXJj 4057 -IGhpc3Rvcg== 4058 -IHByaW9y 4059 -IDYw 4060 -YXZh 4061 -YWNoZXI= 4062 -eW9uZA== 4063 -IEhh 4064 -IGVzdGU= 4065 -aW5hcnk= 4066 -IE5vcnRo 4067 -b25zdA== 4068 -IHNtYXJ0 4069 -YW1z 4070 -0LDQu9C4 4071 -IGRhcg== 4072 -ZXJlZA== 4073 -IGZ1bm55 4074 -IE9i 4075 -IEJsYWNr 4076 -IHJlbGF0ZWQ= 4077 -IEJ1 4078 -IHNvbWV3aGVyZQ== 4079 -IFJlbQ== 4080 -bmVz 4081 -bWVudGU= 4082 -IFJlYWxseQ== 4083 -IGNyZWF0aW5n 4084 -IGZhbWls 4085 -IHNvY2lldHk= 4086 -IGdlbA== 4087 -IHRyYW5zZm9ybQ== 4088 -xIM= 4089 -IGluY2x1ZGU= 4090 -IGhvbA== 4091 -bGlrZQ== 4092 -a28= 4093 -YWlycw== 4094 -INC/0L7QtA== 4095 -IHBlcnNwZWN0 4096 -IGJlcw== 4097 -IHBhcnRpY3VsYXJseQ== 4098 -IHNob3dpbmc= 4099 -IFBhcnQ= 4100 -IHF1YWw= 4101 -bG9jaw== 4102 -IHJlYWxpdHk= 4103 -aG9sZA== 4104 -aWN0aW9u 4105 -b29u 4106 -IHZpcg== 4107 -44Gr 4108 -aXRhcnk= 4109 -IGRydWc= 4110 -IGZlYXR1cmU= 4111 -IHJlYXNvbnM= 4112 -INep 4113 -IHdyb3Rl 4114 -IGZhbnQ= 4115 -IGJhbmQ= 4116 -2YM= 4117 -ZW5h 4118 -a2V5 4119 -IGVhcnRo 4120 -ZG9t 4121 -IGZlYXR1cmVz 4122 -IGZsb29y 4123 -IHNwZWFraW5n 4124 -IHRpcA== 4125 -IEF1c3Q= 4126 -IHN0b2Nr 4127 -IGNodXJjaA== 4128 -IHJhYw== 4129 -7Jy866Gc 4130 -4LiZ 4131 -44KM 4132 -a3k= 4133 -IHJlc3BvbnNl 4134 -24w= 4135 -dWxhdGlvbnM= 4136 -IHNsaWRl 4137 -IGdyYWR1 4138 -Y2lvdXM= 4139 -IG1lYW50 4140 -ID09 4141 -INeQ1w== 4142 -44U= 4143 -IGtpbmRh 4144 -IHNjZW5l 4145 -IG11aXQ= 4146 -IOqwgA== 4147 -cmFzdA== 4148 -cmVzdA== 4149 -IHBsYXllcnM= 4150 -d2E= 4151 -IGJyb2Fk 4152 -IHRvbW9ycm93 4153 -b2NvbA== 4154 -INGB0LI= 4155 -IEJhcg== 4156 -xLFr 4157 -IHNlYQ== 4158 -IHJlbW92ZQ== 4159 -IHJlbWluZA== 4160 -0L7QvNGD 4161 -IFNpbmNl 4162 -IGF2ZWM= 4163 -Y2VsbA== 4164 -0LjRhQ== 4165 -IGRvY3VtZW50 4166 -IOq3uOuf 4167 -IG5laWdo 4168 -YmVhdA== 4169 -IHDDpQ== 4170 -IGFzcGVjdA== 4171 -IGRlZA== 4172 -bGlzaGVk 4173 -aWxz 4174 -IG91cnNlbHZlcw== 4175 -dWNl 4176 -IGhleQ== 4177 -INC/0YDQvg== 4178 -ZW50eQ== 4179 -IGFzc29jaQ== 4180 -YWRvcw== 4181 -dW1iZXI= 4182 -IF0= 4183 -6YKj 4184 -bm92 4185 -IOyZ 4186 -0YPRhw== 4187 -IGNvbmRpdGlvbg== 4188 -64qU642w 4189 -IHZhbHVlcw== 4190 -IHNjZW4= 4191 -bWluaXN0 4192 -IGNhc3Q= 4193 -IGdyb3dpbmc= 4194 -IHVzZXI= 4195 -IHJlc3BvbmQ= 4196 -bGlt 4197 -w6ly 4198 -eW0= 4199 -55yL 4200 -b3Nlcw== 4201 -c3ljaA== 4202 -INGA0LDQtw== 4203 -IGFwcGVhcg== 4204 -IHByb2dyZXNz 4205 -ZW5ndGg= 4206 -IGphaw== 4207 -IERpcw== 4208 -IHBhdGllbnRz 4209 -IFNlcg== 4210 -IGdhcw== 4211 -w6hyZQ== 4212 -7Ja07JqU 4213 -IHJlY2k= 4214 -7J24 4215 -IHNjYQ== 4216 -ZXBlbmQ= 4217 -0YHQug== 4218 -0LDQvw== 4219 -IGJhdHRlcg== 4220 -IHZlaA== 4221 -8J8= 4222 -IGFjY29t 4223 -IGJlYXQ= 4224 -IHBhaW50 4225 -IGNvbnRyaWI= 4226 -IHNhZA== 4227 -xrA= 4228 -YWxlcw== 4229 -IHRyZWU= 4230 -YmE= 4231 -IGJvcm4= 4232 -aWNlZA== 4233 -4K6V 4234 -YmFuZA== 4235 -IG1lY2hhbg== 4236 -IERldA== 4237 -IGNhcGl0YWw= 4238 -IGRlbGl2ZXI= 4239 -IGZlYXI= 4240 -npg= 4241 -IFNvdXRo 4242 -IGJvdWdodA== 4243 -IHN0cmVzcw== 4244 -IHZvcg== 4245 -Pz8= 4246 -aWg= 4247 -7JW8 4248 -IGVyYQ== 4249 -7J206w== 4250 -0LDRjw== 4251 -aXNpb25z 4252 -aXZpdHk= 4253 -IGhlbHBlZA== 4254 -IGFzc2lzdA== 4255 -IHBsYXllcg== 4256 -cmFu 4257 -IGltbWVkaWF0ZWx5 4258 -IG1vdmVk 4259 -Y2ll 4260 -6rE= 4261 -IGFubm91bg== 4262 -5b8= 4263 -7J6Q 4264 -IHByb2R1Y3Rpb24= 4265 -IHN1bW1lcg== 4266 -IHR1bg== 4267 -IHByb2dyYW1z 4268 -R0g= 4269 -YWxpbmc= 4270 -aXJh 4271 -ZWxlc3M= 4272 -Lik= 4273 -IGF2ZXJhZ2U= 4274 -6KaB 4275 -IGdsYXNz 4276 -b21hbg== 4277 -aWZpY2FsbHk= 4278 -IOuLpA== 4279 -IENvbmc= 4280 -IFZlcg== 4281 -IHRyaWNr 4282 -IGJlZ2Fu 4283 -IHZpbGw= 4284 -6rGw 4285 -aG93 4286 -5q0= 4287 -IHRpbGw= 4288 -IDkw 4289 -YmVydA== 4290 -IOq4 4291 -IHRlbXBlcmF0dXJl 4292 -w7I= 4293 -4LmI 4294 -IGdyYXBo 4295 -IOq3uA== 4296 -IHJvdA== 4297 -IG1vYg== 4298 -QVk= 4299 -YWVs 4300 -IHJlcGU= 4301 -IGRldmljZQ== 4302 -IDE5OQ== 4303 -IHRlbGU= 4304 -IGtlcHQ= 4305 -cGE= 4306 -5pY= 4307 -dmVyc2U= 4308 -IHN0cmVhbQ== 4309 -0LXRhw== 4310 -ZXNzaW9u 4311 -IHN0cnVnZw== 4312 -eno= 4313 -IGRlZ3JlZQ== 4314 -IGhlbHBpbmc= 4315 -IHNtZWxs 4316 -IHBlcmhhcHM= 4317 -cHJv 4318 -IGNvbnRleHQ= 4319 -IGlr 4320 -INC/0LXRgA== 4321 -IGNhbGN1bA== 4322 -6bq8 4323 -YmluZw== 4324 -IHJlYWxpemU= 4325 -bGFt 4326 -IENoYXI= 4327 -eXQ= 4328 -IOydtOw= 4329 -IGRhbmdlcg== 4330 -IElt 4331 -YWE= 4332 -IGxvdmVk 4333 -IHB1cnBvc2U= 4334 -IGZpbmlzaGVk 4335 -IHBlYWNl 4336 -IG90 4337 -IGdsb2JhbA== 4338 -z4A= 4339 -IGFiZXI= 4340 -log= 4341 -IGNoYXJhY3RlcnM= 4342 -IG51cg== 4343 -IGRhbWFnZQ== 4344 -IGVtZXI= 4345 -IHByZWM= 4346 -IFdpcg== 4347 -IGluc3RpdA== 4348 -kdc= 4349 -IGFsbG93ZWQ= 4350 -Ym9u 4351 -IHRvZA== 4352 -0LXQs9C+ 4353 -IGpldHp0 4354 -IG1lZGlj 4355 -IHNtYWxsZXI= 4356 -Y2VlZA== 4357 -IGxldmVscw== 4358 -IGludGVsbA== 4359 -V2U= 4360 -IHNlbQ== 4361 -IGN1cnJlbnRseQ== 4362 -IG1vZGVybg== 4363 -IGNvbnRyYWN0 4364 -IGRldGFpbHM= 4365 -b3J0dW5hdGVseQ== 4366 -T1M= 4367 -IHN0YXRlcw== 4368 -IGFkanVzdA== 4369 -YW50YWdl 4370 -ZXo= 4371 -IFZlcnk= 4372 -IHNjYWxl 4373 -IHJlbGVhc2U= 4374 -IGZheg== 4375 -IGlj 4376 -aXR1ZGU= 4377 -QUM= 4378 -IFBhdA== 4379 -aWRlbg== 4380 -rZA= 4381 -IHByZWZlcg== 4382 -b2xvZ2ljYWw= 4383 -IEZhY2Vib29r 4384 -IOqwmQ== 4385 -IC4u 4386 -IE1ha2U= 4387 -INC60L7RgtC+0YA= 4388 -IERhdmlk 4389 -IEFmcmlj 4390 -IG1vZGU= 4391 -IENpdHk= 4392 -IHNoYWxs 4393 -INGE 4394 -aW1pbg== 4395 -INC30LA= 4396 -cm9t 4397 -dWE= 4398 -IGJleW9uZA== 4399 -IGRpc3RyaWI= 4400 -0LrRgw== 4401 -IERvZXM= 4402 -IHZpY3Q= 4403 -cmF0ZQ== 4404 -IHZhaQ== 4405 -IHN1Y2Nlc3NmdWw= 4406 -IGhvdXM= 4407 -YWhh 4408 -ZXN0cw== 4409 -IEVzdA== 4410 -IGRpc2NvdmVy 4411 -IHRoZXJlZm9yZQ== 4412 -Y2hh 4413 -IGN1cA== 4414 -IHBvcHVsYXRpb24= 4415 -IEls 4416 -c2M= 4417 -IHNwZW50 4418 -cmVs 4419 -IHVzZWZ1bA== 4420 -IHRhYg== 4421 -5p0= 4422 -IMU= 4423 -IOygnA== 4424 -IGNvbnNl 4425 -IHF1YW50 4426 -YXlh 4427 -IGJvbg== 4428 -5Y+v 4429 -IENoaW4= 4430 -IOqygw== 4431 -b3VuZHM= 4432 -0LXRiA== 4433 -ZWxsZQ== 4434 -IGljZQ== 4435 -MjE= 4436 -IGtpY2s= 4437 -5LiL 4438 -IHN0ZXBz 4439 -IHRvbmlnaHQ= 4440 -0L3Ri9C5 4441 -cmVuY2g= 4442 -Lic= 4443 -IGdyYWI= 4444 -IGltcGxlbWVudA== 4445 -IOyImA== 4446 -IG1pc3Npb24= 4447 -IGNsZWFybHk= 4448 -IGFwcHJlY2lhdGU= 4449 -6IA= 4450 -IGZyZXNo 4451 -YXJt 4452 -IFR3bw== 4453 -IGV4ZWM= 4454 -IHByb2plY3Rz 4455 -IGNvbW11bml0aWVz 4456 -cmlibGU= 4457 -IHJlZ2lvbg== 4458 -IGZyZXF1 4459 -cm95 4460 -IGhvd2V2ZXI= 4461 -IHBhcnRuZXJz 4462 -YW5j 4463 -IG1pbmlt 4464 -IGxhdA== 4465 -IGZhbWlsaWVz 4466 -IGV2aWRlbmNl 4467 -IHB1bg== 4468 -cmFmdA== 4469 -IGxvc3M= 4470 -IG1hcA== 4471 -IGFueWJvZHk= 4472 -IGNoYW5naW5n 4473 -IHJ1bGVz 4474 -IG9yZ2FuaXphdGlvbg== 4475 -IGVzc2VudGlhbGx5 4476 -IFJlZA== 4477 -IGVsZW1lbnQ= 4478 -5pc= 4479 -IHZpcnQ= 4480 -cmF0 4481 -IHByaW50 4482 -YW5kZXI= 4483 -YXJlbg== 4484 -ZW1vcw== 4485 -zr/PhQ== 4486 -IGNvbmRpdGlvbnM= 4487 -YWJl 4488 -IGRhbmNl 4489 -0LjRgA== 4490 -IGRvcw== 4491 -0L7Rhw== 4492 -IFF1ZQ== 4493 -IHdhbGtpbmc= 4494 -IHRybw== 4495 -IGlk 4496 -IGFkZGl0aW9uYWw= 4497 -IGZ1bGx5 4498 -IGZhbnM= 4499 -IGFkZGl0aW9u 4500 -IGxpa2Vk 4501 -IMO8YmVy 4502 -IGJvdw== 4503 -ZGk= 4504 -IG1hc3Rlcg== 4505 -b2Zm 4506 -KTo= 4507 -bWJlcg== 4508 -IOus 4509 -5a8= 4510 -5Yiw 4511 -bGF1c2U= 4512 -IG9kZXI= 4513 -IHNhZmV0eQ== 4514 -IHJlYWN0 4515 -4K6/ 4516 -YnQ= 4517 -IGRpc2FwcA== 4518 -IGdpcmxz 4519 -U3Q= 4520 -IEFuZw== 4521 -IGZhaXRo 4522 -IHR1cm5z 4523 -IHRpZ2h0 4524 -IG1vdXRo 4525 -YW1p 4526 -emVy 4527 -IHdlYXA= 4528 -INCx0YPQtA== 4529 -IGhvc3BpdGFs 4530 -cmFpZA== 4531 -IG1pY3Jv 4532 -IFN0YXRl 4533 -IE1vc3Q= 4534 -YWdu 4535 -IGRlY2lkZQ== 4536 -IHBhdGllbnQ= 4537 -IGNvcm5lcg== 4538 -IGRpZWQ= 4539 -Tm8= 4540 -IFN0dWQ= 4541 -cmVuZA== 4542 -ZW1wdA== 4543 -IGxpZQ== 4544 -IGxpZg== 4545 -IEJlZm9yZQ== 4546 -dMOz 4547 -IFN1cGVy 4548 -IGJlbGw= 4549 -NjA= 4550 -IHByaXZhdGU= 4551 -IFBhdWw= 4552 -IGdpYg== 4553 -IGFncmU= 4554 -tOyEnA== 4555 -IHNpZw== 4556 -IGludmVzdGln 4557 -0Y/Rgg== 4558 -ZW5pbmc= 4559 -IGRpc3RhbmNl 4560 -IHdhcm0= 4561 -IGRpZ2l0YWw= 4562 -5b6I 4563 -aW5lcg== 4564 -IHBhbmQ= 4565 -IENPVklE 4566 -0LPQvg== 4567 -Z24= 4568 -IHJhY2U= 4569 -IHByb3Vk 4570 -IHRlYWNoaW5n 4571 -INGC0L4= 4572 -7J6l 4573 -IEFsbGFo 4574 -SW4= 4575 -IHdvb2Q= 4576 -IGNvbG9ycw== 4577 -IHdpcmQ= 4578 -dWo= 4579 -aWRhZA== 4580 -IGN1c3RvbWVycw== 4581 -IGNvbm5lY3RlZA== 4582 -IGxheWVy 4583 -IGFjaGlldmU= 4584 -IHBlcnNwZWN0aXZl 4585 -IENvbGw= 4586 -2YI= 4587 -IGNsb3Vk 4588 -ISEh 4589 -IGVuZGVk 4590 -oIfqsow= 4591 -IG1hbmFnZW1lbnQ= 4592 -IHJpY2g= 4593 -IHN1YnN0 4594 -IHJlbW8= 4595 -IHNlcnZl 4596 -IHJlc2lzdA== 4597 -IHRob3VnaHRz 4598 -IGdyb3d0aA== 4599 -aWxpYXI= 4600 -IHJpZ2h0cw== 4601 -IGNoYXJnZQ== 4602 -IGNvbnNpc3Q= 4603 -IHdlcmRlbg== 4604 -IGVtYg== 4605 -YW5kb20= 4606 -IGh1cnQ= 4607 -IGthbg== 4608 -aWFz 4609 -0LvQvg== 4610 -IHNoaXQ= 4611 -IGJlZw== 4612 -IHJlY2VpdmVk 4613 -aXRhdGlvbg== 4614 -IG1lYXQ= 4615 -IGlzc28= 4616 -ZmZlZQ== 4617 -IGZhbW91cw== 4618 -IGNvbWZvcnRhYmxl 4619 -SUw= 4620 -IEJ5ZQ== 4621 -6Kqq 4622 -5YCR 4623 -b3RoZXM= 4624 -IG1lZGljYWw= 4625 -IGVuam95ZWQ= 4626 -IGhlYWx0aHk= 4627 -IHd5 4628 -Y2llcw== 4629 -IGVmZm9ydA== 4630 -IGRvY3Rvcg== 4631 -IG1pbGl0YXJ5 4632 -TEFV 4633 -IGdybw== 4634 -IGJhdHRsZQ== 4635 -IGZlZA== 4636 -IGNhcGFj 4637 -IGFmcmFpZA== 4638 -aXZpbA== 4639 -INCy0YHQtQ== 4640 -IGxlbmd0aA== 4641 -eXNpcw== 4642 -IGJlaQ== 4643 -pO0= 4644 -IG9yZ2FuaXo= 4645 -b3Jn 4646 -aW5j 4647 -IGludGVyYWN0 4648 -IENoaW5lc2U= 4649 -IGFjY29yZGluZw== 4650 -IGluY3JlZGlibGU= 4651 -IGtpbGxlZA== 4652 -IGRhdWdodGVy 4653 -IM+A 4654 -0YvQsg== 4655 -IHNjaG9vbHM= 4656 -IMKr 4657 -bGxlcg== 4658 -IHNob3VsZG4= 4659 -bmFs 4660 -IGNyaXM= 4661 -IGNoaWNrZW4= 4662 -IGZhc3Rlcg== 4663 -IGV4dHJlbWVseQ== 4664 -IG9wcG9z 4665 -IG5vdXM= 4666 -ICs= 4667 -cmlh 4668 -IGZpbmFuY2lhbA== 4669 -IGV4Y2l0aW5n 4670 -IGpvdXJuZXk= 4671 -15nXnQ== 4672 -oOs= 4673 -IGRpc3BsYXk= 4674 -IG1lbW9yeQ== 4675 -IGhlYXZ5 4676 -0L3QtQ== 4677 -IHBhc3NlZA== 4678 -0YDQuA== 4679 -aWxlcw== 4680 -IHBzeWNo 4681 -IHNwZWNpZmljYWxseQ== 4682 -IGVuZ2FnZQ== 4683 -IGxlZA== 4684 -b3JnZQ== 4685 -IERlbQ== 4686 -b3JkZXI= 4687 -IDgw 4688 -IGNyZWFt 4689 -ZXN0ZXJkYXk= 4690 -IGVkZ2U= 4691 -INC/0L7Quw== 4692 -IGJ1bGw= 4693 -IGluZGlj 4694 -IGt0w7M= 4695 -IGhvcGVmdWxseQ== 4696 -dW1lbnRz 4697 -YWdlbg== 4698 -0L3QvtCz0L4= 4699 -IGhhdGU= 4700 -Y2h0 4701 -ODA= 4702 -IGVmZmlj 4703 -IOyngA== 4704 -IGludGVybmV0 4705 -IGJ1ZGdldA== 4706 -IHByb3BlcnR5 4707 -aWRheQ== 4708 -IOya 4709 -INC80L7Qtg== 4710 -b2xh 4711 -IHNob3dlZA== 4712 -IE1vbg== 4713 -IHRob3VzYW5k 4714 -QVA= 4715 -IHBvb3I= 4716 -dXNlZA== 4717 -IEphY2s= 4718 -IHPDpQ== 4719 -g70= 4720 -IGVzYw== 4721 -IHNvZnR3YXJl 4722 -IHF1YXI= 4723 -INio 4724 -IG5lY2Vzc2FyaWx5 4725 -b21lbg== 4726 -aXk= 4727 -IGV2ZW50dWFsbHk= 4728 -aXNoZWQ= 4729 -IGJyaWdodA== 4730 -RUQ= 4731 -IHNwbA== 4732 -IGRlbWFuZA== 4733 -IHRocmVhdA== 4734 -IHNpcg== 4735 -IHJlbGVhc2Vk 4736 -Y2tldA== 4737 -IOKAqw== 4738 -IHJlcXVpcmVk 4739 -IHZvdGU= 4740 -7Lk= 4741 -4K6k 4742 -IGRldmVsb3BlZA== 4743 -IOyCrA== 4744 -YXRvcnk= 4745 -IGRpcg== 4746 -Y2FwZQ== 4747 -IHNsaWdodGx5 4748 -w6w= 4749 -4LmJ 4750 -cmVldA== 4751 -IGRpc2Vhc2U= 4752 -IGNvdXJ0 4753 -IGl0ZW1z 4754 -IEVhcnRo 4755 -0YHRgtC4 4756 -0LbQtQ== 4757 -7LI= 4758 -IGNoYWxsZW5nZXM= 4759 -IEJyaXQ= 4760 -IGRlc2lnbmVk 4761 -MTI= 4762 -IGhlYXJpbmc= 4763 -IGxpc3RlbmluZw== 4764 -em8= 4765 -INGB0Ls= 4766 -44Gn44GZ 4767 -IHBlcm8= 4768 -IHdlYXJpbmc= 4769 -cGxpYw== 4770 -IGNoZW0= 4771 -IGJhbGFuY2U= 4772 -IGJh 4773 -IHJlY2VpdmU= 4774 -aW1h 4775 -IHNpZ25pZmljYW50 4776 -INC80Ys= 4777 -YW5jaA== 4778 -IENy 4779 -IENvdW4= 4780 -6riI 4781 -IGpvYnM= 4782 -IG9mZmljaWFs 4783 -IHBlcm0= 4784 -b21z 4785 -IG9wcG9ydHVuaXRpZXM= 4786 -IG92ZXJhbGw= 4787 -IGh1cw== 4788 -b2Rlcw== 4789 -IG5hdGlvbg== 4790 -IFJlZw== 4791 -IG9yZA== 4792 -IHJlc3RhdXI= 4793 -IOyG 4794 -IG1lbA== 4795 -dmlu 4796 -IHdlbm4= 4797 -IGvDtm4= 4798 -5oM= 4799 -IG9waW5pb24= 4800 -44KC 4801 -6Kw= 4802 -IFNvbWV0aW1lcw== 4803 -54I= 4804 -0YnQtQ== 4805 -YXNj 4806 -T1U= 4807 -IDIwMjA= 4808 -IGRlbGljaW91cw== 4809 -aWdlcg== 4810 -IOyViA== 4811 -b2xl 4812 -IGhhbmRsZQ== 4813 -IGNpdA== 4814 -IO2VnA== 4815 -IGbDtnI= 4816 -b290aA== 4817 -IG5lY2Vzc2FyeQ== 4818 -IGluZGVwZW5k 4819 -5oQ= 4820 -aXN0ZW4= 4821 -aGFt 4822 -IMOpdA== 4823 -44Oz 4824 -IG11bHRp 4825 -z4w= 4826 -Pyk= 4827 -IGNhbXB1cw== 4828 -IHRvcGlj 4829 -IHJhaW4= 4830 -IHBhbmVs 4831 -IFNhbQ== 4832 -IGxhcmdlcg== 4833 -YXVkaWVuY2U= 4834 -IHBhaWQ= 4835 -IGVjb25vbWlj 4836 -b2x0 4837 -IHN0cmVldA== 4838 -IENvbnQ= 4839 -IGRyaXZpbmc= 4840 -IOyggA== 4841 -IGhheQ== 4842 -IHByb2Zlc3Npb25hbA== 4843 -IEludGVybg== 4844 -5bg= 4845 -IGlucHV0 4846 -IGNhdGVn 4847 -IGNybw== 4848 -IGxs 4849 -RVQ= 4850 -0YvQuQ== 4851 -Kio= 4852 -IFpl 4853 -QkxF 4854 -IOyk 4855 -cmVlcw== 4856 -INCv 4857 -ZWRl 4858 -aWVydA== 4859 -IGZvbGQ= 4860 -IGR1cg== 4861 -IE5hdGlvbmFs 4862 -IOyWtOs= 4863 -YW5jZWQ= 4864 -IGZhaXJl 4865 -dXRlZA== 4866 -IGtpbmc= 4867 -IHdpbGQ= 4868 -b2k= 4869 -dXBiZWF0 4870 -IHByZXZlbnQ= 4871 -aXVz 4872 -IMOo 4873 -IHdpZGU= 4874 -IHJpbmc= 4875 -IHRpdGxl 4876 -IHN0YW5kaW5n 4877 -IGFsdGhvdWdo 4878 -IGhp 4879 -IHNhdWNl 4880 -IHNpZGVz 4881 -IGFuaW1hbHM= 4882 -aWxpbmc= 4883 -YXRpdmVz 4884 -7JeQ7ISc 4885 -IE92ZXI= 4886 -IGRlc3A= 4887 -IGNvbnNpZGVyZWQ= 4888 -YXJpZXM= 4889 -aWVycw== 4890 -IGVpbmVu 4891 -IHNpc3Rlcg== 4892 -IOuV 4893 -IFN1cmU= 4894 -44KL 4895 -cmllbmQ= 4896 -YWlnbg== 4897 -IHNob3du 4898 -IHNhYw== 4899 -IHNvbnQ= 4900 -IGNlbnR1cnk= 4901 -IHRpZW4= 4902 -IM66 4903 -IFNU 4904 -5ZWK 4905 -IG9sZGVy 4906 -aWVt 4907 -IHRydWx5 4908 -IFNp 4909 -IHdpbmRvdw== 4910 -aXF1ZXM= 4911 -YXJpbw== 4912 -5rKS 4913 -IGxvY2F0aW9u 4914 -zro= 4915 -IOyc 4916 -dmk= 4917 -YWd1ZQ== 4918 -IFNvcnJ5 4919 -IGRpc3A= 4920 -IGhlbGw= 4921 -IMOJ 4922 -IHRyYWRl 4923 -IGNyaXRpY2Fs 4924 -IOqx 4925 -IG5hbWVk 4926 -IHByZXBhcmVk 4927 -IEhvdXNl 4928 -YWx1 4929 -IHRvdWdo 4930 -IHRyaXA= 4931 -IHNhbmQ= 4932 -Y2Vs 4933 -w7x6 4934 -IFB1dA== 4935 -IGFwYXJ0 4936 -aXNm 4937 -dmlz 4938 -IGxpYnI= 4939 -YXZlbg== 4940 -IHZpZQ== 4941 -IGVmZmVjdGl2ZQ== 4942 -4Liy 4943 -IG1hZ24= 4944 -IG11aXRv 4945 -IOq1 4946 -aGFs 4947 -IGxpbWl0 4948 -IG5pbmU= 4949 -IHdpbGxpbmc= 4950 -xLHFnw== 4951 -c3A= 4952 -0LXQsw== 4953 -aGk= 4954 -IGFsdA== 4955 -IEphbg== 4956 -IG9yaWdpbg== 4957 -IFVz 4958 -IGVsZW1lbnRz 4959 -IHVzZXM= 4960 -IGhlbHBmdWw= 4961 -IGZsYXQ= 4962 -IGZhbWlsaWFy 4963 -IFBhcms= 4964 -IGNvcmU= 4965 -IGNsb3Nlcg== 4966 -IGFjdGl2ZQ== 4967 -IGFkbWluaXN0 4968 -Q0U= 4969 -0L3Ri9C1 4970 -54Q= 4971 -IHJlbGF0aXZl 4972 -IG1lbnRhbA== 4973 -IHJhbmRvbQ== 4974 -IHBhcnRuZXI= 4975 -IHV0aWw= 4976 -cGhvbmU= 4977 -IHJ1bGU= 4978 -d3c= 4979 -IOyglQ== 4980 -IHNjaG9u 4981 -IGNvZmZlZQ== 4982 -SEE= 4983 -IGNvbm5lY3Rpb24= 4984 -IHVuaXQ= 4985 -bGF1Z2hpbmc= 4986 -bG9n 4987 -IGFwcGw= 4988 -0LvQsA== 4989 -dXNpYw== 4990 -IEJyYQ== 4991 -IGFueXdoZXJl 4992 -QVVESQ== 4993 -IHNlcGFyYXRl 4994 -Ym94 4995 -IGRpdmlk 4996 -IHRlc3Rpbmc= 4997 -IHNpY2s= 4998 -IHdlcmVu 4999 -5LuW 5000 -INec1w== 5001 -IGFkdmFudGFnZQ== 5002 -IHRyYW5zZmVy 5003 -Jy4= 5004 -IOu5 5005 -IGZpbmRpbmc= 5006 -0L3QvtC5 5007 -IOyiiw== 5008 -IGZvcnQ= 5009 -IGVjb25vbXk= 5010 -IGxhY2s= 5011 -IGxlYXZpbmc= 5012 -IGRpbQ== 5013 -5Y4= 5014 -IFJlcw== 5015 -2K0= 5016 -IGRpc2N1c3Npb24= 5017 -0LXQvw== 5018 -IGdlcw== 5019 -ZHVjdA== 5020 -IGNoYWlu 5021 -IHVzZXJz 5022 -ZWNo 5023 -xYJh 5024 -IGRpc2g= 5025 -IGNhcmVmdWw= 5026 -IHRlYWNoZXI= 5027 -IG9wdGlt 5028 -IGZsdQ== 5029 -YXRpY2FsbHk= 5030 -IHJlZmxlY3Q= 5031 -IHRyZWF0bWVudA== 5032 -ZWVk 5033 -acSZ 5034 -w7k= 5035 -4K6+ 5036 -IGVxdWlw 5037 -IHBsYW5uaW5n 5038 -IHNvbHZl 5039 -44Gd 5040 -IFRvbQ== 5041 -IGF2b2lk 5042 -IHBvdQ== 5043 -IGdyZWF0ZXI= 5044 -bGlu 5045 -T0w= 5046 -IEx1 5047 -IE1vcmU= 5048 -IGF0dHJhY3Q= 5049 -w6pu 5050 -dW5h 5051 -IHBob3Rv 5052 -ZXJhdGlvbg== 5053 -IHBsYW5ldA== 5054 -IGNvcHk= 5055 -IHZpc3VhbA== 5056 -aXJpbmc= 5057 -IGludGVybmF0aW9uYWw= 5058 -IGxhdWdoaW5n 5059 -IHRoaWNr 5060 -IGhvbGRpbmc= 5061 -IGJyaW5naW5n 5062 -IGxldHRlcg== 5063 -IGJ1cm4= 5064 -IGVmZmVjdHM= 5065 -aXTDqQ== 5066 -b3Vycw== 5067 -T1Q= 5068 -w6ptZQ== 5069 -IFNjaG9vbA== 5070 -15XXqg== 5071 -cm9wcmk= 5072 -bGln 5073 -zrHOuQ== 5074 -IGFkdWx0 5075 -IHN1Z2Fy 5076 -IHJpZGU= 5077 -IGhpZ2hsaWdodA== 5078 -IG5vYm9keQ== 5079 -IDIx 5080 -IGNoYXQ= 5081 -INC/0YDQuA== 5082 -IGlubm92 5083 -dW5nZW4= 5084 -IGF0dGFjaA== 5085 -ZWRvbQ== 5086 -5Yo= 5087 -eWw= 5088 -IGxlZ2Fs 5089 -IHJpY2U= 5090 -IGNvbGxhYm9y 5091 -a2luZw== 5092 -ZG93bg== 5093 -5pk= 5094 -44KK 5095 -IGlo 5096 -IEFj 5097 -b3VzbHk= 5098 -IHJhcA== 5099 -IHNvbGlk 5100 -IGdlbmVyYWxseQ== 5101 -IHBhdHRlcm4= 5102 -YWxp 5103 -4Lit 5104 -IHRyYW5zbA== 5105 -aW50ZXI= 5106 -YXVsdA== 5107 -IOuo 5108 -IGV4cHJlc3M= 5109 -IGV4YW1wbGVz 5110 -IGNob3Nl 5111 -IHRlbGxz 5112 -w61z 5113 -YWludA== 5114 -IFRlbGw= 5115 -IE1pY2hhZWw= 5116 -5qg= 5117 -IE51bWJlcg== 5118 -IHRhcA== 5119 -IGV4cGVyaW1lbnQ= 5120 -IGJlbmVmaXQ= 5121 -IOyw 5122 -IHNlcXU= 5123 -IGV4cGVuc2l2ZQ== 5124 -IGdlbmVyYXRpb24= 5125 -IE1hbnk= 5126 -IGFkZGluZw== 5127 -IGtpbA== 5128 -IGNhbXBhaWdu 5129 -IEFudA== 5130 -cmF3 5131 -b21tZW4= 5132 -IHNvdWw= 5133 -am8= 5134 -IEFjdHVhbGx5 5135 -YW1t 5136 -6rKg 5137 -IG1heGlt 5138 -IHNhbHQ= 5139 -IGNydQ== 5140 -IGNhbGxpbmc= 5141 -44GM 5142 -IGJhc2lz 5143 -YmFu 5144 -IGtlZXBpbmc= 5145 -IE1vcg== 5146 -ZWRz 5147 -7IY= 5148 -IHRvZG8= 5149 -0LDQvNC4 5150 -0L3Rjw== 5151 -IGxpdmVk 5152 -IER1 5153 -44KJ 5154 -5a62 5155 -Zm9yY2U= 5156 -5bm0 5157 -ZmVyZW5jZQ== 5158 -YWxh 5159 -IG9jY3Vy 5160 -c2s= 5161 -IHJlY2VudA== 5162 -IGNhcnM= 5163 -IHRyYWRpdGlvbmFs 5164 -ZW50bGU= 5165 -sog= 5166 -IGhlbGQ= 5167 -IG5hY2g= 5168 -IENlbnRlcg== 5169 -ZXJlbg== 5170 -IGJpbg== 5171 -2YE= 5172 -IGNvbW1l 5173 -IHJldmU= 5174 -IOyYpA== 5175 -IGV4cGVjdGVk 5176 -YWJpbA== 5177 -IGZvY3VzZWQ= 5178 -b3Y= 5179 -IGlQ 5180 -b3JpYWw= 5181 -aXJv 5182 -IGV0Yw== 5183 -YW1pbmc= 5184 -IFNvbg== 5185 -IHllc3RlcmRheQ== 5186 -IHN0cmF0ZQ== 5187 -INGG 5188 -IOuP 5189 -cGVz 5190 -IGFjdGl2aXR5 5191 -IGFkdmljZQ== 5192 -IG9wZW5pbmc= 5193 -Zmlu 5194 -IHJlbGE= 5195 -6ZY= 5196 -IGluc3RhbmNl 5197 -IEV2ZXJ5b25l 5198 -Ymw= 5199 -cGVu 5200 -IHZpc2lvbg== 5201 -IEFsZXg= 5202 -aWZvcm4= 5203 -IHRpY2s= 5204 -SGU= 5205 -IHN0cmF0ZWd5 5206 -IGtvbQ== 5207 -UEU= 5208 -IEds 5209 -IGVsZWN0cmlj 5210 -MTU= 5211 -IGRhaWx5 5212 -IGh1c2JhbmQ= 5213 -IHN0YXRpb24= 5214 -IGFuYWx5c2lz 5215 -eW5hbQ== 5216 -IGF0dGVtcHQ= 5217 -IGJpbGxpb24= 5218 -dmFudA== 5219 -IGZvcnRo 5220 -IG1hdGg= 5221 -YWx5 5222 -IGJlaGF2aW9y 5223 -IE1hcw== 5224 -a2Fu 5225 -IERheQ== 5226 -IGJsZXNz 5227 -IGd1dA== 5228 -IEhpZ2g= 5229 -b3g= 5230 -IGRyZXNz 5231 -IGplZA== 5232 -6K8= 5233 -5ZY= 5234 -IGV4cGVyaWVuY2Vz 5235 -aXN0YQ== 5236 -IGZpZ2h0aW5n 5237 -5bc= 5238 -INGB0Lo= 5239 -IG1vc3RseQ== 5240 -YXVzZQ== 5241 -IHBpY3R1cmVz 5242 -0LXQvdGC 5243 -IG1hZA== 5244 -IG1vZGVscw== 5245 -0YjQtQ== 5246 -IENvdW50 5247 -xYQ= 5248 -xYJv 5249 -ZXB0 5250 -T00= 5251 -IEFO 5252 -IHRyb3VibGU= 5253 -NDA= 5254 -IGJpcmQ= 5255 -dWxhdGU= 5256 -IG11cg== 5257 -IHByb2R1Y2U= 5258 -IG1hcnJpZWQ= 5259 -Yml0 5260 -IHRoZW9yeQ== 5261 -7Zg= 5262 -IGxlYWRlcg== 5263 -IExhc3Q= 5264 -QUE= 5265 -6LU= 5266 -IGltYWdlcw== 5267 -IGV4cGFuZA== 5268 -IFBvcg== 5269 -IHB1cmNo 5270 -IFNhbg== 5271 -IENocmlzdG1hcw== 5272 -IEF1c3RyYWw= 5273 -IHdpZA== 5274 -IE1pc3M= 5275 -IGtub3dpbmc= 5276 -IHpl 5277 -c2hpcA== 5278 -a3U= 5279 -0YXQvtC0 5280 -IEluc3RhZ3JhbQ== 5281 -IEluZGlh 5282 -IGVzdGE= 5283 -IENhbGlmb3Ju 5284 -IDcw 5285 -IGRyYWc= 5286 -IGJydXNo 5287 -IG5hbWVz 5288 -QW5k 5289 -IHlv 5290 -aWxsYQ== 5291 -IHNjaGVk 5292 -IGRlc3Ryb3k= 5293 -eWVhcg== 5294 -IHZhbW9z 5295 -INmE 5296 -w6dh 5297 -IGZvcmdvdA== 5298 -0LjQtQ== 5299 -IHJhaXNl 5300 -cmVtZQ== 5301 -7ZW0 5302 -IEdpdmU= 5303 -IGNvbnRhaW4= 5304 -cmFi 5305 -IGdpZnQ= 5306 -INGB0L8= 5307 -IHJlcXVlc3Q= 5308 -IHNodXQ= 5309 -IGRlZ3JlZXM= 5310 -IGJlbmVmaXRz 5311 -0YvQtQ== 5312 -IHN0dWRpZXM= 5313 -IGVuZHM= 5314 -IGV2ZXJ5d2hlcmU= 5315 -IGhlcm8= 5316 -b3Bo 5317 -ZXJyeQ== 5318 -IG1hdGVyaWFscw== 5319 -ZW5lZA== 5320 -TkE= 5321 -5Y0= 5322 -IG11eQ== 5323 -IHdvcnNl 5324 -5LuA 5325 -IE1hZA== 5326 -IGRlY2lzaW9ucw== 5327 -aW9uZQ== 5328 -IGZvcmVpZ24= 5329 -bGF1Z2h0ZXI= 5330 -aWJlcg== 5331 -0LXQvdC40Y8= 5332 -44WL 5333 -IHJlYWxpemVk 5334 -IGlnbg== 5335 -IHdlYWs= 5336 -IM68 5337 -IHNjYXJlZA== 5338 -IGFzc3Vt 5339 -QUs= 5340 -778= 5341 -77+9 5342 -IGNvdmVyZWQ= 5343 -IFNhdA== 5344 -INC+0L0= 5345 -IGluZGl2aWR1YWxz 5346 -IGNvbXBhcmVk 5347 -MTE= 5348 -IEFkZA== 5349 -aWNsZXM= 5350 -IGNlcnQ= 5351 -cmFy 5352 -IGJyaWVm 5353 -IGFjdGl2aXRpZXM= 5354 -IGZhYg== 5355 -YmFy 5356 -IGFzdA== 5357 -IE90aGVy 5358 -IGNsYXNzZXM= 5359 -IG9n 5360 -IG1pc3Npbmc= 5361 -44Gg 5362 -6Z0= 5363 -d2Vycw== 5364 -16k= 5365 -IGludHJvZHVjZQ== 5366 -IGVxdWF0aW9u 5367 -44G+44GZ 5368 -IG5vbQ== 5369 -IHBhaW50aW5n 5370 -dXNoaW5n 5371 -IEFQ 5372 -IGVuY291cmFnZQ== 5373 -IHNoaXA= 5374 -aXR0ZWU= 5375 -aXZlcnNl 5376 -b3Rh 5377 -bmFt 5378 -44O7 5379 -IGV4ZXJjaXNl 5380 -INCt 5381 -IG5hcw== 5382 -IHRob3VzYW5kcw== 5383 -IENhbGlmb3JuaWE= 5384 -IHNlcw== 5385 -IHJvdw== 5386 -nog= 5387 -IHBhbmRlbWlj 5388 -IHNraWxs 5389 -YmVs 5390 -IGRpcmVjdG9y 5391 -IG1pbGs= 5392 -IG51dA== 5393 -IG1vdGlvbg== 5394 -IGNsb3NlZA== 5395 -6Kg= 5396 -IGNyZWRpdA== 5397 -YWhy 5398 -IGNoZWVzZQ== 5399 -IGFsdGVybg== 5400 -aW1hdGVseQ== 5401 -IHN1c3Q= 5402 -IFRyYQ== 5403 -IGdsYWQ= 5404 -IGhpZ2hseQ== 5405 -IHdh 5406 -IHJlZHVjZQ== 5407 -IGJsZQ== 5408 -YWRvcg== 5409 -aW5hdGVk 5410 -aW9uZXM= 5411 -Y2llbnQ= 5412 -IGRlcGVuZGluZw== 5413 -IHNoYXJpbmc= 5414 -IGNhdWdodA== 5415 -cmFlbA== 5416 -IG1laHI= 5417 -IHBhc3Npb24= 5418 -55s= 5419 -IHJ1 5420 -IGZhcm0= 5421 -VEk= 5422 -YXZlcw== 5423 -IFJvYg== 5424 -IEJybw== 5425 -IG1vdGl2 5426 -cmV0Y2g= 5427 -cnVwdA== 5428 -IEJpZw== 5429 -IGFsbGU= 5430 -IGV0dA== 5431 -dWJz 5432 -IEphcGFuZXNl 5433 -IEhhbGw= 5434 -0LjQu9C4 5435 -QVVESUJMRQ== 5436 -56w= 5437 -IGNlbGxz 5438 -aWth 5439 -ZWxpbmU= 5440 -aWxlcg== 5441 -IOyj 5442 -IHNreQ== 5443 -SU5BVURJQkxF 5444 -ZW5kZQ== 5445 -YXB0ZXI= 5446 -IHBpbg== 5447 -IGdhdGhlcg== 5448 -aG9s 5449 -bGVjdGlvbg== 5450 -IHN5bg== 5451 -IHBsdWc= 5452 -cm91bmQ= 5453 -IHVuaXZlcnNpdHk= 5454 -aGli 5455 -IGZhbnRhc3RpYw== 5456 -a24= 5457 -IGhvbGU= 5458 -IFJlbWVtYmVy 5459 -aW5jdA== 5460 -YWtz 5461 -Q0g= 5462 -IGJyb2tlbg== 5463 -IHN0cmF0ZWc= 5464 -IGFsaXZl 5465 -IHRhbms= 5466 -IGNhcnQ= 5467 -cmF0ZWQ= 5468 -cmll 5469 -IFN0ZXA= 5470 -IEV2ZXJ5dGhpbmc= 5471 -IGJvdW5k 5472 -IHNvYnJl 5473 -IGN1c3RvbWVy 5474 -oYw= 5475 -dXJn 5476 -IEJpbGw= 5477 -TGE= 5478 -d2hhdA== 5479 -IHJlYWN0aW9u 5480 -IHNlc3Npb24= 5481 -IHBsYW5z 5482 -IOydtOugh+qyjA== 5483 -IGRvd25sb2Fk 5484 -7Jk= 5485 -dWVy 5486 -IGNhYg== 5487 -IGluc3Ry 5488 -aWZ5aW5n 5489 -IE5pY2U= 5490 -IHRlYW1z 5491 -xLFs 5492 -IGdvYWxz 5493 -aXNjaA== 5494 -IHRyYW5zcG9ydA== 5495 -IGFuaW1hbA== 5496 -IGNvc3Rz 5497 -IGNhbGxz 5498 -IHNlaHI= 5499 -7Ig= 5500 -cmlhbg== 5501 -IGRpYWw= 5502 -IHdlYXRoZXI= 5503 -4LmA 5504 -INCy0L7Rgg== 5505 -IFBsYXk= 5506 -IHNoYXJlZA== 5507 -IHNtb290aA== 5508 -YWJh 5509 -IGxlYXZlcw== 5510 -4K6p 5511 -IGNvbmNlbnQ= 5512 -IHNoaWZ0 5513 -IOuQmA== 5514 -IEdvdmVybg== 5515 -IGRlbW9uc3Q= 5516 -IGJ1dHRlcg== 5517 -IOyXrA== 5518 -IHNhdGlzZg== 5519 -iOus 5520 -IHJlY29nbml6ZQ== 5521 -IEZyZW5jaA== 5522 -IHZvbHVtZQ== 5523 -w6RuZA== 5524 -0YPQvA== 5525 -IOynhA== 5526 -IEtlZXA= 5527 -b3dh 5528 -aXBwZWQ= 5529 -0YHRgtGA 5530 -IGRldGVjdA== 5531 -IM+D 5532 -IGxpZnQ= 5533 -IGNsb3RoZXM= 5534 -IFN0b3A= 5535 -w7U= 5536 -bWV0 5537 -IGNsaW4= 5538 -IGFycg== 5539 -ZnJpZW5k 5540 -IHN0dWNr 5541 -WWU= 5542 -aGFuZA== 5543 -dW1h 5544 -IHNjcmk= 5545 -IGZ1Y2tpbmc= 5546 -Y3RvcnM= 5547 -16o= 5548 -IGpvaW5pbmc= 5549 -IGNldHRl 5550 -INij 5551 -IFdoaXRl 5552 -IGlocg== 5553 -zq0= 5554 -44Gt 5555 -IGluY2x1ZGVk 5556 -ZXNzbw== 5557 -IGFjYWQ= 5558 -YnVt 5559 -IHNhYg== 5560 -INC00LvRjw== 5561 -6L+Z 5562 -dWZhY3Q= 5563 -IFJlcHVibGlj 5564 -cmlt 5565 -IHllbGxvdw== 5566 -IGxpbWl0ZWQ= 5567 -VEVS 5568 -IFR5 5569 -IG5vdGVz 5570 -dmVzdA== 5571 -0LjQtw== 5572 -YWxlZA== 5573 -IHBoYXNl 5574 -YW5kYQ== 5575 -IE1vbQ== 5576 -Ukk= 5577 -IGltbWVy 5578 -bWFs 5579 -IGluag== 5580 -IHlhbmc= 5581 -dWRpYmxl 5582 -0LDQsw== 5583 -IHNldHQ= 5584 -IG1hZ2lj 5585 -IGVuc3VyZQ== 5586 -IHNwcmluZw== 5587 -IHNob2Nr 5588 -IHdoZWVs 5589 -0L7Qs9C00LA= 5590 -44KI 5591 -IGNhbmNlcg== 5592 -IHJvb3Q= 5593 -0JA= 5594 -Z2VuY3k= 5595 -IOuN 5596 -aWk= 5597 -IG91dHB1dA== 5598 -IGNvbW1pdA== 5599 -IHdvcmtlcnM= 5600 -7JWE7JqU 5601 -INGB0LDQvA== 5602 -dmV5 5603 -IHBldQ== 5604 -IGNpdmls 5605 -aXNj 5606 -IGJyaW5ncw== 5607 -0YDQsNCy 5608 -YW5pYQ== 5609 -xIE= 5610 -Y3JhZnQ= 5611 -bWJvbA== 5612 -IGludGVsbGln 5613 -Ymk= 5614 -YWNpbmc= 5615 -eW91 5616 -IGJlY29taW5n 5617 -IERlcg== 5618 -ZW1h 5619 -5bCx5piv 5620 -IGluZ3JlZA== 5621 -IGNvbW1hbmQ= 5622 -IHVwZGF0ZQ== 5623 -IHByZW0= 5624 -IG9wZW5lZA== 5625 -hKQ= 5626 -0LXQvdC40LU= 5627 -IGdhcmQ= 5628 -IHN0YXRlbWVudA== 5629 -IHNjcmV3 5630 -IHByb3Rl 5631 -IGNhcmRz 5632 -IHRhc2s= 5633 -IGV2ZW5pbmc= 5634 -IHN0aXRjaA== 5635 -aW5lbg== 5636 -IEJlcg== 5637 -bWFyaw== 5638 -IERhZA== 5639 -INC10YHRgtGM 5640 -INee1w== 5641 -7JeI 5642 -IGJhbg== 5643 -IGNsaW0= 5644 -IGZyZWVkb20= 5645 -IG5vcm1hbGx5 5646 -0LXRgdGM 5647 -5aY= 5648 -IHByb3ZpZGVk 5649 -IOyekA== 5650 -IOyVhOuLiA== 5651 -IEtpbQ== 5652 -aWVkZXI= 5653 -7J2M 5654 -IGNpdGl6 5655 -IGJpa2U= 5656 -IGJhaw== 5657 -IG5vaXNl 5658 -IGNsaW1hdGU= 5659 -aXplcw== 5660 -5b6M 5661 -IGluY3JlYXNpbmc= 5662 -IFRIRQ== 5663 -IGxpcXU= 5664 -IHBlcnNvbmFsbHk= 5665 -ZWY= 5666 -cmVzcA== 5667 -IGxlZ3M= 5668 -aW5kZXI= 5669 -IHBlZA== 5670 -IOunjg== 5671 -IGRlcGVuZA== 5672 -IHZhcmlldHk= 5673 -IElzcmFlbA== 5674 -IHdhc2g= 5675 -5YY= 5676 -IHF1aWV0 5677 -IEphbWVz 5678 -IEpldw== 5679 -IGZvcmV2ZXI= 5680 -IEludA== 5681 -IGNvdW50ZXI= 5682 -dXJhbmNl 5683 -IEFueXdheQ== 5684 -Y2FyZQ== 5685 -IE9ubHk= 5686 -Y2nDs24= 5687 -YWRp 5688 -IEV2 5689 -64uI6rmM 5690 -IM6x 5691 -IHNsb3dseQ== 5692 -INC+0LQ= 5693 -IG5vdGljZWQ= 5694 -aWVyZW4= 5695 -IGZlbGw= 5696 -INCR 5697 -IG3Dqm1l 5698 -IHdoZW5ldmVy 5699 -ISk= 5700 -IEh5 5701 -5bw= 5702 -b3Jkcw== 5703 -dXNpb24= 5704 -IFN0YXI= 5705 -IO2Y 5706 -IE1hYw== 5707 -5LiK 5708 -aXZlbg== 5709 -IOyLnA== 5710 -IOyXhg== 5711 -IFR1cg== 5712 -IGdlcg== 5713 -cmlz 5714 -IHZleg== 5715 -INC70Y4= 5716 -IHZlcnN1cw== 5717 -2KfY 5718 -b2NvbGF0ZQ== 5719 -IHBsYW5l 5720 -IHpv 5721 -IHN1aXQ= 5722 -VGhpcw== 5723 -IG5lcnY= 5724 -IEFjYw== 5725 -0YPQtg== 5726 -7IKs 5727 -bmg= 5728 -ZW1l 5729 -IGF1c3M= 5730 -IG1lYXM= 5731 -IHRyw6hz 5732 -z4k= 5733 -0YHQu9C4 5734 -IEFydA== 5735 -IFNlY29uZA== 5736 -0L7Qu9GM0LrQvg== 5737 -Y2hv 5738 -aXRlY3Q= 5739 -0LXRgdGC 5740 -IGJvc3M= 5741 -IGluY29tZQ== 5742 -oKQ= 5743 -IHNoYWQ= 5744 -IGFwcHJvcHJp 5745 -IE1hbA== 5746 -b3B0 5747 -IGFydGlzdA== 5748 -IHBsYXlz 5749 -b3RoZXJz 5750 -IEludGVy 5751 -IHZpcnVz 5752 -IGh1bmc= 5753 -IGNvbnN0YW50 5754 -IHNjcmlwdA== 5755 -IHNub3c= 5756 -dWxm 5757 -a2V0 5758 -IGRldmljZXM= 5759 -IG1ldGFs 5760 -aWdodHM= 5761 -7IS4 5762 -IHNhbGVz 5763 -IHZlZ2V0 5764 -IGNvbGxlY3Rpb24= 5765 -IHZpYQ== 5766 -a2Vy 5767 -IGdvdHRlbg== 5768 -T1c= 5769 -acOpbg== 5770 -IGFjY3Vy 5771 -IHdhdmU= 5772 -dWx0eQ== 5773 -IEFpcg== 5774 -IGxlYWRpbmc= 5775 -aWNpbmc= 5776 -IGNlbnRyYWw= 5777 -IENocmlzdGlhbg== 5778 -ZnI= 5779 -IEFsdGhvdWdo 5780 -IHNvbmdz 5781 -IGZpZg== 5782 -0L3Ri9GF 5783 -IGJlbG9uZw== 5784 -b3NzaWJsZQ== 5785 -7LA= 5786 -IHBob3Rvcw== 5787 -aXNs 5788 -IHJlbGF4 5789 -c2E= 5790 -VVNJQw== 5791 -6rc= 5792 -IG1hbnVmYWN0 5793 -IFR3aXR0ZXI= 5794 -IGRhbmdlcm91cw== 5795 -IGh5ZA== 5796 -bGVhcg== 5797 -aWFudA== 5798 -IOKApg== 5799 -IHN1ZGRlbmx5 5800 -IGxhdWdo 5801 -IGFuZ2xl 5802 -IEdvdA== 5803 -IHdvcnJpZWQ= 5804 -0L7QtQ== 5805 -IHBhcA== 5806 -IE1hcnQ= 5807 -ZW5v 5808 -IGJhdHRlcnk= 5809 -INC/0L7RgQ== 5810 -IGxpZ2h0cw== 5811 -IGFybXM= 5812 -IEFicw== 5813 -bWVz 5814 -4oCT 5815 -dXNldW0= 5816 -IHRlYQ== 5817 -IE1pYw== 5818 -IGZvcm1lcg== 5819 -b2dyYXBoeQ== 5820 -IGFwcGxpY2F0aW9ucw== 5821 -IERpcmU= 5822 -54S2 5823 -IGZlZWRiYWNr 5824 -aXRjaGVu 5825 -eW9ydW0= 5826 -dWVk 5827 -aWd0 5828 -xrDhuw== 5829 -b3NpdGlvbg== 5830 -IERlbA== 5831 -IO2VmOs= 5832 -IEJhY2s= 5833 -YWRz 5834 -IHByaW1l 5835 -7KO8 5836 -7KOg 5837 -15E= 5838 -IG11dA== 5839 -XS4= 5840 -INCX 5841 -bG9j 5842 -a2lu 5843 -IGV4cGVydA== 5844 -IGFscmlnaHQ= 5845 -dW5ncw== 5846 -IHN1cHBseQ== 5847 -IGxlYWRlcnNoaXA= 5848 -IEZyYQ== 5849 -IHR5cGljYWxseQ== 5850 -IHNlbA== 5851 -IHRyZWVz 5852 -IDIy 5853 -aGFy 5854 -IHdvcnN0 5855 -IGJ1c3k= 5856 -YW50bw== 5857 -IFVw 5858 -IEJhcw== 5859 -IHByZXNlbnRhdGlvbg== 5860 -IHN0cmFuZ2U= 5861 -IHRoaW4= 5862 -0YLQtQ== 5863 -IHZlaGljbGU= 5864 -INC00L4= 5865 -Y2VsbGVudA== 5866 -NzA= 5867 -IHRpcmVk 5868 -IGNyaXNpcw== 5869 -IHRpbnk= 5870 -YXN5 5871 -IHJhbg== 5872 -6Yc= 5873 -IGZvcmNlcw== 5874 -INC+0Yc= 5875 -IGlkZW50aWZ5 5876 -IGFzc2Vzcw== 5877 -0LjRgtC1 5878 -U0U= 5879 -IGNyZWF0aXZl 5880 -558= 5881 -IGRlcGFydG1lbnQ= 5882 -IGluaXRpYWw= 5883 -5oiR5YCR 5884 -IERhbQ== 5885 -YWt0 5886 -dmVyZQ== 5887 -IGluZmVjdA== 5888 -IHB1bXA= 5889 -4bqh 5890 -IHZpZWw= 5891 -IHJhcmU= 5892 -IGRvdA== 5893 -YXNoaW9u 5894 -ZW1wbA== 5895 -IGZsZXg= 5896 -IGtvbg== 5897 -IHRydWNr 5898 -IGxlY3Q= 5899 -IHBsYXN0aWM= 5900 -bGF3 5901 -IGxpa2Vz 5902 -IHJvdWdo 5903 -IE1BVA== 5904 -7Z6I 5905 -IGNvbW1lcg== 5906 -IGFzc2U= 5907 -IGNha2U= 5908 -IGFjdGlvbnM= 5909 -IGFkbQ== 5910 -IG90aGVyd2lzZQ== 5911 -IEhlYWx0aA== 5912 -IGNvbGxl 5913 -4LmA4Lg= 5914 -IHJ1Yg== 5915 -5b6X 5916 -5pQ= 5917 -IHNjcg== 5918 -IHp1bQ== 5919 -IEhpbQ== 5920 -IGNoYW1w 5921 -IGNvbmNlcm5lZA== 5922 -IDUwMA== 5923 -IHBsYXRl 5924 -IE91dA== 5925 -IGRvbmM= 5926 -IGVxdWlwbWVudA== 5927 -IHRhdWdodA== 5928 -bGxlZA== 5929 -IO2Z 5930 -aXZh 5931 -IG1vdG9y 5932 -wrs= 5933 -IGd1aWRl 5934 -5Yk= 5935 -IHN0b3BwZWQ= 5936 -IHJhdA== 5937 -IGxhYm9y 5938 -IGFpbQ== 5939 -IHByZXBhcmU= 5940 -INGI 5941 -IHNob290aW5n 5942 -YW5uZWQ= 5943 -Y3JpcHQ= 5944 -IGVuZW15 5945 -IGRlcGVuZHM= 5946 -IG5hdg== 5947 -IGJlcg== 5948 -IGxhbmRz 5949 -IHVuaXZlcnM= 5950 -aXU= 5951 -IGZhY3Rvcg== 5952 -b2tpbmc= 5953 -IGNhcmJvbg== 5954 -YnV0 5955 -IExvdmU= 5956 -ZWxk 5957 -IM61 5958 -IGdh 5959 -IMOpcw== 5960 -IGJyZWFk 5961 -IHZvbHQ= 5962 -7Yo= 5963 -IHdhc3Rl 5964 -IGtlZXBz 5965 -5omA 5966 -IHN0b3I= 5967 -IGhvbm9y 5968 -IHVubGVzcw== 5969 -IGNvbHVt 5970 -IOuMgA== 5971 -IHBsYW50cw== 5972 -WWVhaA== 5973 -IGluY2x1ZGVz 5974 -5Lit 5975 -IG94 5976 -IHBldXQ= 5977 -66eM 5978 -7IOB 5979 -aXN0cnk= 5980 -4Lix 5981 -IERlcGFydG1lbnQ= 5982 -YW50YQ== 5983 -IGZpbmdlcg== 5984 -IHN0cmV0Y2g= 5985 -IHN5bWJvbA== 5986 -IG5laWdoYm9y 5987 -5qw= 5988 -6rCE 5989 -fn4= 5990 -INGC0Ys= 5991 -IEFiZXI= 5992 -a2Vz 5993 -IG1hc3NpdmU= 5994 -IENI 5995 -IFNhbA== 5996 -16A= 5997 -44KS 5998 -IGR5bmFt 5999 -YWNoZQ== 6000 -IFByZQ== 6001 -IG1vbml0b3I= 6002 -ZW50ZWQ= 6003 -RU8= 6004 -IHJhaXNlZA== 6005 -aXN0aWNz 6006 -2qk= 6007 -IHZvdQ== 6008 -aXRlbg== 6009 -obA= 6010 -IGJ1c2luZXNzZXM= 6011 -IGVhcm4= 6012 -IG1vYmlsZQ== 6013 -aWRhZGU= 6014 -IGhhYmU= 6015 -eXI= 6016 -bGljdA== 6017 -IGNvbmR1Y3Q= 6018 -IGZlZGVyYWw= 6019 -IHdv 6020 -YnU= 6021 -IG5vbmU= 6022 -IHRlYWNoZXJz 6023 -INin2YTY 6024 -6YGT 6025 -aWRlbnRz 6026 -2KfZhA== 6027 -IHRyZW5k 6028 -0LXQtg== 6029 -IGFsYnVt 6030 -IG1pY2g= 6031 -YmFzZWQ= 6032 -4Li1 6033 -IHRyYW5zaXRpb24= 6034 -INC90L4= 6035 -w7Vlcw== 6036 -aG9zdA== 6037 -ZWR5 6038 -IFByb2Y= 6039 -cGFu 6040 -aWpu 6041 -IGNhcGFjaXR5 6042 -dW5kbw== 6043 -INeR1w== 6044 -IGJyZWF0aA== 6045 -INC80LXQvQ== 6046 -IG3DvA== 6047 -7Zk= 6048 -IEF1dA== 6049 -aGluZ3Rvbg== 6050 -IG5vcg== 6051 -IGdhaW4= 6052 -cG9pbnQ= 6053 -WWVz 6054 -INiq 6055 -IE5h 6056 -w6Vy 6057 -IGnDpw== 6058 -IE1hcnk= 6059 -IHNwaW4= 6060 -IGFudGk= 6061 -5ZCn 6062 -IHNvbWVob3c= 6063 -IGxhd3M= 6064 -IG1vbWVudHM= 6065 -IGdyZQ== 6066 -IG1vdmVz 6067 -IFdvdWxk 6068 -IHByZWRpY3Q= 6069 -IHZyYQ== 6070 -IDIwMTk= 6071 -toQ= 6072 -IGZ1bmRhbWVudA== 6073 -MjU= 6074 -IHB1cmU= 6075 -IHdvdw== 6076 -IGlzbGFuZA== 6077 -IGludmVzdG1lbnQ= 6078 -IGJhdGg= 6079 -IFlh 6080 -IGhhcmRlcg== 6081 -IHRpcHM= 6082 -5Zc= 6083 -IGVsZWN0cm9u 6084 -IEJvYg== 6085 -IGJvbmQ= 6086 -b2RpZXM= 6087 -IEF1Zw== 6088 -IGdpYnQ= 6089 -IGNoYWly 6090 -IHR3aWNl 6091 -d29vZA== 6092 -IGNsYXI= 6093 -IG1hc2s= 6094 -IGhvbmVzdGx5 6095 -IDIwMTg= 6096 -dGllcw== 6097 -Jyw= 6098 -IHBlbnM= 6099 -IHN1cnByaXNlZA== 6100 -IGNvbW11bmljYXRpb24= 6101 -44Gj44Gm 6102 -IHNwcg== 6103 -IHdob3Nl 6104 -IHN0YXJz 6105 -15DX 6106 -IOKAiw== 6107 -IHByb3Blcmx5 6108 -IGdyZXc= 6109 -b3Npbmc= 6110 -IGRpdmVycw== 6111 -QUQ= 6112 -IGVtcHQ= 6113 -IGV4cHJlc3Npb24= 6114 -4bq/ 6115 -IFBhbA== 6116 -44GK 6117 -IGp1c3RpY2U= 6118 -IHBhaXI= 6119 -d28= 6120 -IHNlYXQ= 6121 -b3J0ZXI= 6122 -IGxpbmtz 6123 -IE1lcg== 6124 -IHJlbmQ= 6125 -0L3QvtC1 6126 -dXBpZA== 6127 -IEhlbA== 6128 -IE1hcmNo 6129 -IExv 6130 -0YHRjA== 6131 -IGhhc24= 6132 -IGV2YWx1 6133 -44GP 6134 -5aSp 6135 -aWxvcw== 6136 -IGZ1bmRpbmc= 6137 -IHZlbg== 6138 -dWFu 6139 -IE1hc3Rlcg== 6140 -IE9s 6141 -IEZyZQ== 6142 -IHlhcA== 6143 -IFNpcg== 6144 -c2No 6145 -IG1pc3Rha2U= 6146 -YW1hbg== 6147 -IGRpbm5lcg== 6148 -IFdhc2hpbmd0b24= 6149 -IG9yZ2FuaXphdGlvbnM= 6150 -INC20LU= 6151 -YXZpbmc= 6152 -IHbDrQ== 6153 -IGJpcnRoZGF5 6154 -IGJlYXI= 6155 -INmB 6156 -IGFmZm9yZA== 6157 -IHJldmVu 6158 -IHJlbGF0aW9uc2hpcHM= 6159 -cm91Z2g= 6160 -IFRpbWU= 6161 -IHRhZw== 6162 -IFN1bg== 6163 -dWFyeQ== 6164 -IFBv 6165 -Y2Fy 6166 -YWJpbGl0aWVz 6167 -IHByaXNvbg== 6168 -IGxpYw== 6169 -7KCV 6170 -aWRkZW4= 6171 -IHNwZWNpZXM= 6172 -6bs= 6173 -IGZpcm0= 6174 -IHNjb3Jl 6175 -IGRpdA== 6176 -IHNwZWN0 6177 -IHBlbA== 6178 -IGNvbXBsaWNhdGVk 6179 -5qij 6180 -IHJhbms= 6181 -IG9wcG9zaXRl 6182 -IHBpY2tlZA== 6183 -INC60L7QvQ== 6184 -ZWxlcg== 6185 -IG1pZw== 6186 -IFNs 6187 -IE5ldA== 6188 -IG5lY2s= 6189 -IEZyYW5jZQ== 6190 -IHRlY2huaWNhbA== 6191 -4Lih 6192 -IG1pbGVz 6193 -IHByaW1hcnk= 6194 -IHNlaW4= 6195 -c2Vz 6196 -IGxhdWdocw== 6197 -YnJh 6198 -xZtjaQ== 6199 -cmlhZ2U= 6200 -IG5pYw== 6201 -ZXRlcnM= 6202 -IMOq 6203 -b2xvZ2llcw== 6204 -IElT 6205 -cmFk 6206 -dWRv 6207 -xLFuZA== 6208 -bWFy 6209 -IGV4Y2g= 6210 -IGNvbXBldGl0aW9u 6211 -IGF1c3Np 6212 -IFNlcnY= 6213 -IHJlbnQ= 6214 -IGNob2NvbGF0ZQ== 6215 -IHdpZWRlcg== 6216 -IG5lYXJseQ== 6217 -IHNwZWVjaA== 6218 -IHVuYw== 6219 -IHBhcmFt 6220 -IEJyaXRpc2g= 6221 -IHJlbWFpbg== 6222 -4LiB 6223 -dXJ0 6224 -INi5 6225 -IGNyYWNr 6226 -YWlscw== 6227 -IHByb21pc2U= 6228 -IHBheWluZw== 6229 -acOf 6230 -IGFkYXB0 6231 -0LDQu9Cw 6232 -IG1vdmllcw== 6233 -IHdpcmU= 6234 -n6w= 6235 -5pyD 6236 -IHRlcnJpYmxl 6237 -IHPDsw== 6238 -IHBlcmZlY3RseQ== 6239 -5ZGi 6240 -b3JkaW4= 6241 -IGrDoQ== 6242 -IGltcG9zc2libGU= 6243 -IFRocmVl 6244 -IG5o 6245 -IHR1cm5pbmc= 6246 -cnVt 6247 -IEJlbA== 6248 -aWdn 6249 -IHJlc3BvbnNpYmxl 6250 -0LjQuQ== 6251 -IGluY3JlZGlibHk= 6252 -d2k= 6253 -aWFubw== 6254 -IGh1bWFucw== 6255 -IMOH 6256 -IHNldHRpbmdz 6257 -IGpveQ== 6258 -b290 6259 -IGRlYWxpbmc= 6260 -aWxsZWQ= 6261 -IHN1cnJvdW5k 6262 -IGZvbGxvd2Vk 6263 -IHBvc3NpYmx5 6264 -IGluaXRp 6265 -c3Rlbg== 6266 -IHByb3M= 6267 -IGNhbmRpZA== 6268 -IGFzc2lnbg== 6269 -IHZpb2xlbmNl 6270 -V2VsbA== 6271 -IHJpc2U= 6272 -UFM= 6273 -IHRhbWLDqW0= 6274 -IOuTpA== 6275 -aWFuY2U= 6276 -eWFu 6277 -IGF1ZGlv 6278 -IEJldA== 6279 -IEFtZXJpY2Fucw== 6280 -IEFzcw== 6281 -aXNjaGVu 6282 -7J6F 6283 -IHVsdGltYXRlbHk= 6284 -IHBvbGlj 6285 -IG1ham9yaXR5 6286 -6YCZ5YCL 6287 -IEZpbmFsbHk= 6288 -ZXJhcA== 6289 -IGd1YXJk 6290 -IE1BVFQ= 6291 -IGJyb3du 6292 -0LzQuA== 6293 -IGNoYQ== 6294 -IEhvbHk= 6295 -IG5lcnZvdXM= 6296 -aXBwaW5n 6297 -xJlk 6298 -IFNh 6299 -k5zr 6300 -toA= 6301 -bGll 6302 -55yf 6303 -IG51Yw== 6304 -IEFwcg== 6305 -6Zs= 6306 -IEtvcmVh 6307 -ZWdv 6308 -IENhbmFkYQ== 6309 -IGvDtm5uZW4= 6310 -IGNvbXBhcg== 6311 -IGdhbno= 6312 -IE1haXM= 6313 -IHRoZW1l 6314 -IGtp 6315 -IGRyYXdpbmc= 6316 -YXpvbg== 6317 -IE9mZg== 6318 -dHQ= 6319 -IFdpbmQ= 6320 -IHRvZG9z 6321 -IG9idmlvdXM= 6322 -0L3QsNGP 6323 -SU0= 6324 -INCg 6325 -d2VsbA== 6326 -IGJsb3c= 6327 -IGhvb2s= 6328 -IGNpcmNsZQ== 6329 -IOuztA== 6330 -IGFyY2hpdGVjdA== 6331 -IEty 6332 -IGPDsw== 6333 -IHByb3RlY3Rpb24= 6334 -ZWdh 6335 -5Yc= 6336 -IHdhdGNoZWQ= 6337 -IGFuc3dlcnM= 6338 -IGRpZXQ= 6339 -aXZv 6340 -IHBvd2Rlcg== 6341 -IHlvdXJz 6342 -IGhpZ2hlc3Q= 6343 -54K6 6344 -RkY= 6345 -5bo= 6346 -IGJveXM= 6347 -w7Z5bGU= 6348 -IGx1bmNo 6349 -6Kyd 6350 -IElJ 6351 -IHNldHM= 6352 -IG1vbGU= 6353 -24E= 6354 -IHdpbnRlcg== 6355 -IGx1Y2t5 6356 -IHJlc3BvbnNpYmlsaXR5 6357 -IHNpZ25hbA== 6358 -IHdvbmRlcmluZw== 6359 -IGF4 6360 -IGNvb2tpbmc= 6361 -0L7QstC+0YA= 6362 -bGVn 6363 -INC/0L7Rgg== 6364 -IHN1cnByaXNl 6365 -IGRlbW9jcg== 6366 -IGxvb3A= 6367 -IGphZw== 6368 -IGN1cmlvdXM= 6369 -IG1hcmtldGluZw== 6370 -0J0= 6371 -YXJvbg== 6372 -IEFwcGxl 6373 -IHZpcnR1YWw= 6374 -IDE5OA== 6375 -bm9vbg== 6376 -IE1ldA== 6377 -0L7RgdGC0L4= 6378 -0L7QsdGL 6379 -aXR1 6380 -IEF3 6381 -IGJ1eWluZw== 6382 -IHJlc3RhdXJhbnQ= 6383 -IEJ1ZA== 6384 -IGRvdWJ0 6385 -IGdyYW50 6386 -IHZlcmQ= 6387 -IGNhc2g= 6388 -IGZhY3VsdHk= 6389 -VGhhdA== 6390 -IEVpbg== 6391 -5aSa 6392 -IHdlZA== 6393 -aXRuZXNz 6394 -IE1hZw== 6395 -bmVs 6396 -IG5hcnI= 6397 -IGFjY2lkZW50 6398 -IG1lZGl1bQ== 6399 -ZW1lbnRz 6400 -IGNyb3c= 6401 -bmlnaHQ= 6402 -7J28 6403 -5Lmf 6404 -IGxpYnJhcnk= 6405 -0LDRjtGC 6406 -IHRhbWJpw6lu 6407 -IHJlZmVyZW5jZQ== 6408 -IGZvdXJ0aA== 6409 -aG91c2U= 6410 -dmVudGlvbg== 6411 -IGZpbGxlZA== 6412 -IENvdXI= 6413 -aWJy 6414 -IG5n 6415 -IGRldmVsb3Bpbmc= 6416 -IHByb3ZpZGVz 6417 -IHBvbGw= 6418 -IHRyYWZmaWM= 6419 -YXJlbnRseQ== 6420 -4K6f 6421 -IGZvcm1z 6422 -IGNsaWVudA== 6423 -IGdlbnRsZQ== 6424 -IG11c3M= 6425 -IENvbmdyZXNz 6426 -IEluZGlhbg== 6427 -Y2Vhbg== 6428 -IHBpbA== 6429 -IGN6eQ== 6430 -c3Rvb2Q= 6431 -dXR5 6432 -IG7DpA== 6433 -IHNwZW5kaW5n 6434 -IGNvbnN0cnVjdGlvbg== 6435 -aW5hdWRpYmxl 6436 -IOuniA== 6437 -iOustA== 6438 -IOyDnQ== 6439 -b21h 6440 -b3Nlbg== 6441 -YWdv 6442 -IGxhcmdlc3Q= 6443 -44WL44WL 6444 -IHVuaXZlcnNl 6445 -YmVz 6446 -b3Nh 6447 -INC10LPQvg== 6448 -IGR1ZGU= 6449 -IE1BUg== 6450 -IGluZGVlZA== 6451 -zrXOuQ== 6452 -IG1hbmFnZWQ= 6453 -IFNob3VsZA== 6454 -U28= 6455 -IGFwcGxpZWQ= 6456 -IGZhaXJseQ== 6457 -IERlbg== 6458 -IGFuYWx5 6459 -IGNvbnN0YW50bHk= 6460 -0YHQvw== 6461 -SG93 6462 -IFNheQ== 6463 -ZW5jaWVz 6464 -IFBD 6465 -IGVnZ3M= 6466 -4K6w 6467 -IGV0aA== 6468 -IEVudMOjbw== 6469 -aW5hcg== 6470 -aW90 6471 -IGN6 6472 -IEV1cm9wZWFu 6473 -44GI 6474 -IEFN 6475 -IGPDoQ== 6476 -IHJhZGlv 6477 -p4w= 6478 -IGhpZGU= 6479 -5LuK 6480 -IFN0YXJ0 6481 -IGNsdWI= 6482 -IEhvcGU= 6483 -IGVmZm9ydHM= 6484 -bHVzaW9u 6485 -IGNpdGllcw== 6486 -aG9uZQ== 6487 -IHJlYWNoZWQ= 6488 -IGd1aWQ= 6489 -cm9pZA== 6490 -IGhhcm0= 6491 -IGN1dHRpbmc= 6492 -IGJ1bA== 6493 -MTg= 6494 -aWVzdA== 6495 -IE1leA== 6496 -IGlyb24= 6497 -55+l 6498 -IGFmdGVybm9vbg== 6499 -IGhhbGw= 6500 -IHByenk= 6501 -IGdvc2g= 6502 -IGluZmx1ZW5jZQ== 6503 -INCy0LjQtA== 6504 -IGluY3JlYXNlZA== 6505 -IE1pbmlzdGVy 6506 -IGRpc2Np 6507 -IFBldGVy 6508 -IHZlcnQ= 6509 -IG1lbnU= 6510 -IHNlbGxpbmc= 6511 -dXJhbGx5 6512 -IHF1b3Rl 6513 -IMKh 6514 -IGNvbnRpbnVlcw== 6515 -bXByZQ== 6516 -IMWfZXk= 6517 -aXR1dGlvbg== 6518 -INC90LDRgQ== 6519 -Y2xlcw== 6520 -IEdlcm1hbg== 6521 -Y3p5 6522 -INCj 6523 -QmU= 6524 -IGtpdGNoZW4= 6525 -IFRyeQ== 6526 -aXBl 6527 -IGljb24= 6528 -YXJw 6529 -IHByb3ZpZGluZw== 6530 -IFRyYW5z 6531 -IHRlY2huaXF1ZQ== 6532 -IGjDpHI= 6533 -IGluZnJhc3Q= 6534 -IHN1c3A= 6535 -w7xjaw== 6536 -aWNpcA== 6537 -INCV 6538 -IGNpbg== 6539 -7Ja06w== 6540 -IHByeg== 6541 -IGNvbXBvbmVudA== 6542 -IGJ5ZQ== 6543 -IEJpYmxl 6544 -aXplcg== 6545 -Q2g= 6546 -IHNvbHV0aW9ucw== 6547 -IGFjY29tcGw= 6548 -IDIwMTY= 6549 -SUU= 6550 -IFRh 6551 -IGFzc3VtZQ== 6552 -IGxpcXVpZA== 6553 -IOuouQ== 6554 -IHF1YXJ0ZXI= 6555 -IGZlbWFsZQ== 6556 -IFRoaW5r 6557 -IHN0YXR1cw== 6558 -aXR1dGU= 6559 -IGNvYWNo 6560 -IHJlaW4= 6561 -IGNvbWJpbmF0aW9u 6562 -6Lc= 6563 -IFRlcg== 6564 -IG9iamVjdHM= 6565 -IGRpc3RyaWN0 6566 -IG1ha2V1cA== 6567 -IG11cmRlcg== 6568 -d2Fz 6569 -ZmVu 6570 -IGJvd2w= 6571 -IHB1Ymxpc2hlZA== 6572 -IHNwb3J0cw== 6573 -44Gh 6574 -IGlkZW50aXR5 6575 -IHNlZW1lZA== 6576 -IGFjdGluZw== 6577 -0LvRjg== 6578 -cml4 6579 -IHVwbG9hZA== 6580 -IGhhc3Q= 6581 -IGJvYXQ= 6582 -IE1vZA== 6583 -cmlv 6584 -ID0= 6585 -IGN5Y2xl 6586 -r7g= 6587 -IGxvdWQ= 6588 -dXN0ZWQ= 6589 -Y29taW5n 6590 -IDIwMTc= 6591 -IG9udA== 6592 -IGxlZ2lzbA== 6593 -IHN0cnVjdA== 6594 -IFNvbWV0aGluZw== 6595 -IGNvbmZsaWN0 6596 -IHVwcGVy 6597 -IG1hbmFnZXI= 6598 -IG1vcnQ= 6599 -IGZyYQ== 6600 -IMSw 6601 -IE1pa2U= 6602 -IFdvcms= 6603 -IG7Dsw== 6604 -cGhlcmU= 6605 -IOyCrOs= 6606 -IExhbmQ= 6607 -IGZpbHRlcg== 6608 -IHByb21vdA== 6609 -5rA= 6610 -5pmC 6611 -lbw= 6612 -IHJlY29yZGluZw== 6613 -150= 6614 -IGFzc29jaWF0ZWQ= 6615 -IGZ1ZWw= 6616 -dW5kZXI= 6617 -IGVsZWN0aW9u 6618 -IGVtcGxveWVlcw== 6619 -IENvbXA= 6620 -0YDRg9Cz 6621 -IFdv 6622 -cm9s 6623 -IHNhdmVk 6624 -IEhvbg== 6625 -IFZp 6626 -5YiG 6627 -YWNh 6628 -cHJldA== 6629 -IHdldA== 6630 -IHN0dXBpZA== 6631 -IGxhZA== 6632 -IGZlc3Q= 6633 -IHdha2U= 6634 -INC40L0= 6635 -IGdyZWF0ZXN0 6636 -IEppbQ== 6637 -IHNlcmlvdXNseQ== 6638 -IOy5 6639 -IGZlZWxpbmdz 6640 -IDMwMA== 6641 -aWF0aW9u 6642 -IGJlYXV0eQ== 6643 -IOyemA== 6644 -IHNhbg== 6645 -k6A= 6646 -IC0o 6647 -IGNvbnNjaW91cw== 6648 -INC00LXQuw== 6649 -Ynll 6650 -55k= 6651 -TWFu 6652 -IGxldHM= 6653 -IHNob2Vz 6654 -eWQ= 6655 -5LmI 6656 -IGRpc2FwcGU= 6657 -IENvdW50eQ== 6658 -IFNjb3R0 6659 -IGJ1dHQ= 6660 -IGFxdcOt 6661 -IGNvbmZpZw== 6662 -cmVzcG9uZA== 6663 -TEFVR0g= 6664 -qeuLiOuLpA== 6665 -IGRpdmlkZWQ= 6666 -IGFjcXU= 6667 -IHpvbmU= 6668 -IGtvbW0= 6669 -YcOnw6Nv 6670 -7Kec 6671 -Y3V0 6672 -IDIz 6673 -IG1heGltdW0= 6674 -cm9n 6675 -IHJ1bnM= 6676 -IGNvbXBvbmVudHM= 6677 -IGFycml2ZWQ= 6678 -IGNvbmZpZGVudA== 6679 -0YDQvtCy 6680 -IGhlaWdodA== 6681 -IHByb2NlZA== 6682 -RU0= 6683 -INCt0YLQvg== 6684 -IE1lbg== 6685 -IHRhbGtz 6686 -IGNvbmZpZGVuY2U= 6687 -IENocmlz 6688 -IGxlYWRz 6689 -IG5vc2U= 6690 -ZmFsbA== 6691 -YmI= 6692 -IE5vdGhpbmc= 6693 -aXNlcg== 6694 -IGluZGVwZW5kZW50 6695 -IG1pbm9y 6696 -IHN5bQ== 6697 -bGVu 6698 -Y2llbmNl 6699 -IGZhc2hpb24= 6700 -IHNleHVhbA== 6701 -IGJ1bg== 6702 -aGVyZQ== 6703 -IHNvaWw= 6704 -IGRpZXNl 6705 -IHNoYXA= 6706 -IGVtcHR5 6707 -IGpvdXJuYWw= 6708 -YWdvbg== 6709 -IFRoZWly 6710 -IHdlZWtlbmQ= 6711 -w610 6712 -IGVycm9y 6713 -IG5hcg== 6714 -w7g= 6715 -6Kk= 6716 -YW5jeQ== 6717 -IOyVig== 6718 -IGZvcmVzdA== 6719 -IGhhY2Vy 6720 -IG1pc3NlZA== 6721 -44GV 6722 -5Y+v5Lul 6723 -IGV2aWw= 6724 -IHN0b3JhZ2U= 6725 -IHNpbmdpbmc= 6726 -aW5oYQ== 6727 -IGtub2Nr 6728 -IGltcHJlc3M= 6729 -INC+0YfQtdC90Yw= 6730 -IEdvbGQ= 6731 -IFN1cg== 6732 -IFBvcnQ= 6733 -5Y67 6734 -IExvbmQ= 6735 -IGZhemVy 6736 -b3R5 6737 -b3Rv 6738 -IGFueA== 6739 -IFdpbGxpYW0= 6740 -IGV4aXN0aW5n 6741 -cGxhY2U= 6742 -IENE 6743 -zrM= 6744 -IENvbGxlZ2U= 6745 -bG9y 6746 -IEVhc3Q= 6747 -c2Vu 6748 -ZmFjaA== 6749 -b2Z0 6750 -IGV4cGVyaWVuY2Vk 6751 -IGxvdmVz 6752 -aW1t 6753 -IHBvbHk= 6754 -IGVzc2U= 6755 -7KQ= 6756 -IEdyYW5k 6757 -6Kc= 6758 -Y2hlcg== 6759 -IHZpY3RpbQ== 6760 -IEdlcw== 6761 -0LvRjA== 6762 -dmlzaW9u 6763 -IHRhbGw= 6764 -IGxlbnM= 6765 -INC30L3QsA== 6766 -IEJvdGg= 6767 -IOyy 6768 -IHN1c3RhaW4= 6769 -IGFyZ3VtZW50 6770 -IGZhY3RvcnM= 6771 -IGF1dG9tYXRpY2FsbHk= 6772 -IGZydWl0 6773 -IGxpYmVy 6774 -IGFsZQ== 6775 -IFByZXNz 6776 -IEJh 6777 -INCz0L4= 6778 -IGh1bmRyZWRz 6779 -dGhhdA== 6780 -IFJpY2g= 6781 -IHJlY2lwZQ== 6782 -IElU 6783 -6Ic= 6784 -4bql 6785 -IGRlc2NyaWJl 6786 -IGRyaXZlcg== 6787 -IE9jdA== 6788 -IE1hdA== 6789 -0LTQtQ== 6790 -IG1lYWw= 6791 -IGxhdGVzdA== 6792 -IHRoZXJhcA== 6793 -IGNvbXBhcmU= 6794 -IEFtYXpvbg== 6795 -IOyigA== 6796 -IFJ1c3NpYQ== 6797 -IHN0cmluZw== 6798 -IGth 6799 -IENvbW11bg== 6800 -IGRpYQ== 6801 -SXM= 6802 -IG1pbGxpb25z 6803 -IGNvcnBvcg== 6804 -IGNvcnJlc3BvbmQ= 6805 -IGZpeGVk 6806 -IEpvZQ== 6807 -2Y4= 6808 -IHZpZXdz 6809 -IHJpdmVy 6810 -IHN0dWRpbw== 6811 -aWdnZXI= 6812 -IGZsYXZvcg== 6813 -IHByZXNlbmNl 6814 -IHVuaXRz 6815 -IHNhdmluZw== 6816 -YXZvdXI= 6817 -IHBlc3Nv 6818 -b3JpdGg= 6819 -IGhlcnM= 6820 -IE5hdA== 6821 -YXNpb24= 6822 -IEZyYW5r 6823 -0L7RiA== 6824 -xYJ5 6825 -7YQ= 6826 -IGVpbmVt 6827 -IGZ1bmN0aW9ucw== 6828 -dW1hbg== 6829 -IG5vcnRo 6830 -IOyghA== 6831 -IGhvcnNl 6832 -dmlk 6833 -IHBsZWFzdXJl 6834 -0LDRiA== 6835 -w6llcw== 6836 -aW5kYQ== 6837 -IHRhaWw= 6838 -IGV4cGxvcmU= 6839 -U1Q= 6840 -IGNvbW1lcmNpYWw= 6841 -IER1cmluZw== 6842 -YXJs 6843 -XTo= 6844 -Zml0 6845 -IHJhdGVz 6846 -5rM= 6847 -TVVTSUM= 6848 -IGhvdXNpbmc= 6849 -IGVpbmVy 6850 -IHNpdHVhdGlvbnM= 6851 -5os= 6852 -IGRlY3Jl 6853 -IGFwcHJvcHJpYXRl 6854 -0LXQvdC90L4= 6855 -JS4= 6856 -IGJhYw== 6857 -IHdhdA== 6858 -ZW5zaXR5 6859 -w6Ro 6860 -a25vd24= 6861 -aXR6 6862 -IGVtb3Rpb25hbA== 6863 -ZXJ2YXRpb24= 6864 -IGJsaW5k 6865 -MTY= 6866 -7YM= 6867 -5aSn5a62 6868 -IGpvaW5lZA== 6869 -IGxvY2F0ZWQ= 6870 -INGB0Lw= 6871 -YWRhcw== 6872 -YmVyZw== 6873 -IGRlc3M= 6874 -IGRlYXI= 6875 -ZWRlbg== 6876 -Y29z 6877 -IGFkb3B0 6878 -MTAw 6879 -b3dl 6880 -IENoZWNr 6881 -aXNtbw== 6882 -IHNpbXBs 6883 -IGFuZ3J5 6884 -INC80LXQvdGP 6885 -IENhbQ== 6886 -IHBhZA== 6887 -IGF0dGVuZA== 6888 -IHNhbXBsZQ== 6889 -5pel 6890 -IOyb 6891 -IElO 6892 -dWxvdXM= 6893 -IFNhcg== 6894 -IFNob3c= 6895 -IGluZnJhc3RydWN0dXJl 6896 -IEF1Z3VzdA== 6897 -IGxlc3Nvbg== 6898 -IG5pZXQ= 6899 -5o4= 6900 -IGZvaQ== 6901 -IGJyb2tl 6902 -dHI= 6903 -55U= 6904 -IDQ1 6905 -IGdldw== 6906 -0YPQvw== 6907 -YXRp 6908 -IG1haW50YWlu 6909 -IGFydGlzdHM= 6910 -aW5nZXI= 6911 -5p2l 6912 -ZXJ2ZWQ= 6913 -SUE= 6914 -IGVxdWFscw== 6915 -IG9wZXJhdGlvbg== 6916 -aWxseQ== 6917 -IOuCtA== 6918 -IGNyb3dk 6919 -IGludGVybmFs 6920 -IHRlc3Rz 6921 -IFJvY2s= 6922 -IENvbnM= 6923 -IOuEiOustA== 6924 -d2Fy 6925 -IHNvdQ== 6926 -IGNoYXJ0 6927 -IEp1bmU= 6928 -IEFwcmls 6929 -Z2VudA== 6930 -IHZlbnQ= 6931 -IHF1YW5k 6932 -IEtvcmVhbg== 6933 -aW1v 6934 -54k= 6935 -aWRlcnM= 6936 -IG1vdW50YWlu 6937 -0YHRgtCw0LI= 6938 -5pyI 6939 -aWpr 6940 -IGRpc2NvdmVyZWQ= 6941 -IFN1bmQ= 6942 -IFNpbA== 6943 -IHNvbG8= 6944 -wrQ= 6945 -IHNjaG9s 6946 -IEVhY2g= 6947 -57U= 6948 -IGJhcmU= 6949 -IO2M 6950 -IHbDrWRl 6951 -IGluZ3JlZGllbnRz 6952 -IEl0cw== 6953 -nbzqs6A= 6954 -IOyK 6955 -z40= 6956 -IExlZQ== 6957 -IHNjYXJ5 6958 -IHByaW5jaXA= 6959 -IHNwaXJpdHVhbA== 6960 -7IU= 6961 -IEhvbGQ= 6962 -5rKS5pyJ 6963 -IGRlZmluZQ== 6964 -IExlcw== 6965 -IE5vcg== 6966 -IEVuZA== 6967 -IGJsb2c= 6968 -IEdyZWVu 6969 -0LDQtdGC0YHRjw== 6970 -cGFydA== 6971 -ZWxlcw== 6972 -5LqL 6973 -IFVuZGVy 6974 -IHBhcnRl 6975 -IDM1 6976 -IHNlY3Rvcg== 6977 -IFNlcHQ= 6978 -IGF1dGg= 6979 -4K6u 6980 -b21pbg== 6981 -IGNsaWVudHM= 6982 -IGNp 6983 -IEZyaWRheQ== 6984 -ZXJhcw== 6985 -IHR3ZQ== 6986 -dWxhdGVk 6987 -IGN1bHR1cmFs 6988 -INGB0LLQvg== 6989 -IOuNlA== 6990 -IMO6 6991 -IHBhcmNl 6992 -4K6y 6993 -IHRyYWRpdGlvbg== 6994 -IGp1ZGdl 6995 -IEdlbmVyYWw= 6996 -IGRldGVybWluZQ== 6997 -IElzbg== 6998 -IFBM 6999 -bmVhdGg= 7000 -IG1hdHRlcnM= 7001 -7ZW07A== 7002 -IV0= 7003 -0LDRhQ== 7004 -IHBvb2w= 7005 -IHZhcmlhYmxl 7006 -IHZhY2NpbmU= 7007 -IGNhdXNlZA== 7008 -IHdlc3Q= 7009 -IFllcA== 7010 -ZmFzdA== 7011 -IHBoaWxvcw== 7012 -aG9yYQ== 7013 -IGNvbnRpbnVlZA== 7014 -IHVuZm9ydHVuYXRlbHk= 7015 -44GN 7016 -5pU= 7017 -IGZsaWdodA== 7018 -IHdyYXA= 7019 -IGh1aA== 7020 -IEFic29sdXRlbHk= 7021 -IHBpbms= 7022 -IHJlbWFpbnM= 7023 -IG7DqQ== 7024 -IGZsZQ== 7025 -IFNvbA== 7026 -IGxvc2luZw== 7027 -IGFsZ29yaXRo 7028 -IHJlcXVpcmVz 7029 -IGZvdW5kYXRpb24= 7030 -IEJ1cg== 7031 -IHByb2Zlc3Npb24= 7032 -IE1pZA== 7033 -IOutkA== 7034 -Y2Fu 7035 -IE1pbA== 7036 -IHlvdW5nZXI= 7037 -IGFwcGVhcnM= 7038 -dGVybQ== 7039 -7ZWY6rOg 7040 -YWNsZQ== 7041 -IExvbmRvbg== 7042 -IGVuZ2luZWVyaW5n 7043 -4Lii 7044 -IGFkdmVudA== 7045 -7IS47JqU 7046 -IOq4sA== 7047 -IE1hag== 7048 -0YDQtdC8 7049 -aW5ndQ== 7050 -IFVL 7051 -dXJv 7052 -c3Bl 7053 -IHRlbnQ= 7054 -IHJlcG9ydGVk 7055 -IEFM 7056 -SGV5 7057 -IOunkA== 7058 -IGRlbnQ= 7059 -IEF1c3RyYWxpYQ== 7060 -IEphbnVhcnk= 7061 -s7Q= 7062 -YWd1ZXM= 7063 -YXJzaA== 7064 -cmln 7065 -IHRpZW5l 7066 -4Lij 7067 -zq4= 7068 -IG1hY2hlbg== 7069 -dW50ZQ== 7070 -0YPRgQ== 7071 -IGVsZWN0cg== 7072 -IHR1dG9yaWFs 7073 -IHBsYWNlZA== 7074 -IOydtOqxsA== 7075 -IENvdW5jaWw= 7076 -7ZaI 7077 -sOumrA== 7078 -YWhyZW4= 7079 -IOq3uOuemA== 7080 -IHByb3Zl 7081 -Zm9s 7082 -IHF1ZXI= 7083 -IGNoZWFw 7084 -IEZhdGhlcg== 7085 -IFBvd2Vy 7086 -k5w= 7087 -IHB1cnM= 7088 -IGVzcA== 7089 -IEJyZQ== 7090 -6riw6w== 7091 -b21hcw== 7092 -5oOz 7093 -0LjQu9GM 7094 -IGdlaHQ= 7095 -b3N0ZXI= 7096 -6rO8 7097 -IGZpbGVz 7098 -INCn 7099 -YmVsbA== 7100 -IHdob20= 7101 -IOuY 7102 -IGV4Y2VsbGVudA== 7103 -IGRhdGFi 7104 -IGfDtg== 7105 -IOynhOynnA== 7106 -IGJlbGllZg== 7107 -amV0 7108 -IGphY2s= 7109 -IHN3aW0= 7110 -cmlhbA== 7111 -dW1pbg== 7112 -YXVj 7113 -IHNvbGw= 7114 -IGVzc2VudGlhbA== 7115 -7ZWY64qU 7116 -IGV2b2w= 7117 -Y2hhZnQ= 7118 -YWluZQ== 7119 -dGhsZXQ= 7120 -IGluY29y 7121 -IHJlcG9ydHM= 7122 -IGRlZmluaXRpb24= 7123 -a2Vs 7124 -IGNpcmN1bQ== 7125 -IHByb2R1Y2Vk 7126 -INeb 7127 -YW50aWM= 7128 -bmV0 7129 -IGF3YXJk 7130 -IGR1cmNo 7131 -IHRyYW5zcA== 7132 -IG1hbGU= 7133 -pqzr 7134 -IG1vb24= 7135 -IEdlb3JnZQ== 7136 -IGZseWluZw== 7137 -acOz 7138 -IHNvdXJjZXM= 7139 -IHBsZW50eQ== 7140 -IERlbW9jcg== 7141 -Uk8= 7142 -IDAw 7143 -IHNlY3VyZQ== 7144 -IEJpcg== 7145 -cmFpbg== 7146 -IHp1cg== 7147 -IGVmZmljaWVudA== 7148 -IHJlcGVhdA== 7149 -IG1ldGhvZHM= 7150 -IGNhbG0= 7151 -IGRpc2N1c3NlZA== 7152 -IOyeiOuKlA== 7153 -IHNlcnZlcg== 7154 -YW5pZQ== 7155 -IEluc3RlYWQ= 7156 -IGlkZWFs 7157 -IGNvbnZlbg== 7158 -IGhvcGluZw== 7159 -IFRvcg== 7160 -IGRlcHRo 7161 -IGhlYXZlbg== 7162 -RU5DRQ== 7163 -IGhhYml0 7164 -Z3JhZA== 7165 -IGZsYWc= 7166 -IGluZQ== 7167 -IGto 7168 -IExJ 7169 -IGZhY2luZw== 7170 -IEFV 7171 -IFRpbQ== 7172 -IGdlbQ== 7173 -IEp1bA== 7174 -IGVsYQ== 7175 -aXp6YQ== 7176 -IGZlbGxvdw== 7177 -IHF1ZWw= 7178 -IHNwb2tl 7179 -IGNpdGl6ZW5z 7180 -dWdl 7181 -6YO9 7182 -IHBhZ2Vz 7183 -IGZhc2M= 7184 -IHJlbGlnaW91cw== 7185 -YXRlbg== 7186 -IGNoYXB0ZXI= 7187 -IFZhbA== 7188 -IGNvbnN1bHQ= 7189 -IE1pbGw= 7190 -Z2w= 7191 -b3Blcg== 7192 -IGluZmlu 7193 -IG1hcnJpYWdl 7194 -IG1lZGljaW5l 7195 -INC00LI= 7196 -IGRvZ3M= 7197 -IGluc3RydW1lbnQ= 7198 -IEV4YWN0 7199 -w6Fu 7200 -IDIwMjE= 7201 -IGZlcg== 7202 -IHdlYWx0aA== 7203 -IGdyYWRl 7204 -0YvRhQ== 7205 -IGNyaW1l 7206 -IHRocmVhZA== 7207 -IGVzc2E= 7208 -IHdpbmU= 7209 -Y29ob2w= 7210 -cGhh 7211 -4LiH 7212 -b2d1ZQ== 7213 -IGluc3VyYW5jZQ== 7214 -YXJyYXRvcg== 7215 -IFNlcHRlbWJlcg== 7216 -IHZpZA== 7217 -IFNwaXJpdA== 7218 -IGdlc3Q= 7219 -IFJ1c3NpYW4= 7220 -IHByb3BlcnRpZXM= 7221 -IGFydGljbGU= 7222 -IHVuZGVybmVhdGg= 7223 -eWVy 7224 -IGpvaW50 7225 -IHJlbGF0aXZlbHk= 7226 -IGluY2g= 7227 -IGRlc3BpdGU= 7228 -IEdyZWU= 7229 -IGNsYXNzaWM= 7230 -IHN1cHBvcnRpbmc= 7231 -IGluc3RydWN0 7232 -bHVzaXZl 7233 -IGRpYWdu 7234 -5oo= 7235 -IGFkbWluaXN0cmF0aW9u 7236 -0LDQsdC+0YI= 7237 -IE9wZW4= 7238 -5omA5Lul 7239 -INC/0L7Qug== 7240 -IGRvbGxhcg== 7241 -IGNvbnNlcXU= 7242 -b2Jlcg== 7243 -IEdlcm1hbnk= 7244 -IHRlcnI= 7245 -IFFV 7246 -INCT 7247 -574= 7248 -IHN0cm9uZ2Vy 7249 -yZk= 7250 -INmK 7251 -IGlQaG9uZQ== 7252 -IGZhYnJpYw== 7253 -w7xo 7254 -IGVuZW0= 7255 -5q8= 7256 -IHN1YnQ= 7257 -RUU= 7258 -b25kZQ== 7259 -IGNyZXc= 7260 -IHJlbW92ZWQ= 7261 -IGxhZHk= 7262 -IHBvdGVudGlhbGx5 7263 -INCd0L4= 7264 -eWFs 7265 -IHN5bXB0 7266 -IGFybXk= 7267 -IGludHJvZHVjZWQ= 7268 -dGVz 7269 -IGFzcGVjdHM= 7270 -MTQ= 7271 -IExvdQ== 7272 -ICk= 7273 -IGRlcGxveQ== 7274 -cGV0 7275 -IGhhbg== 7276 -IFdhdGNo 7277 -IHdlYXBvbnM= 7278 -IHBoZW4= 7279 -IHJlZ2lzdGVy 7280 -IGVpbmZhY2g= 7281 -IHNwb3J0 7282 -IGJyaWRnZQ== 7283 -IGlubmVy 7284 -IG1pbmltdW0= 7285 -IHdpdG5lc3M= 7286 -IGVzbw== 7287 -IHZpbGxhZ2U= 7288 -IG93bmVy 7289 -pqzqs6A= 7290 -IHNjcmVhbQ== 7291 -aWxlZA== 7292 -IHBpdGNo 7293 -YnJ1 7294 -IGFkdmFuY2U= 7295 -5LiN5piv 7296 -IHN1cHBvc2U= 7297 -IEF0dA== 7298 -0LXRgtGB0Y8= 7299 -IGRpZmZlcmVuY2Vz 7300 -YWtlZA== 7301 -IGludGVycHJldA== 7302 -w6Y= 7303 -aWVuZG8= 7304 -IGFic29s 7305 -INCx0YPQtNC10YI= 7306 -IOuy 7307 -IHRyaWFs 7308 -IHRoaW5rcw== 7309 -bHlpbmc= 7310 -Y2VwdGlvbg== 7311 -IEFmcmljYW4= 7312 -IGNoZW1pY2Fs 7313 -IHRhcGU= 7314 -IGNvbnZlcnNhdGlvbnM= 7315 -IGRpc3RyaWJ1dGlvbg== 7316 -dGk= 7317 -IEFJ 7318 -IGZsYXNo 7319 -IHVuZGVyc3Rvb2Q= 7320 -IEdvdmVybm1lbnQ= 7321 -5bCP 7322 -IT8= 7323 -IFNr 7324 -6rGw6w== 7325 -cmllcg== 7326 -VFM= 7327 -IEFjY29yZGluZw== 7328 -0Y7Rgg== 7329 -IHNwb25z 7330 -0YLQvtCx0Ys= 7331 -IHZhbHU= 7332 -ZXJlbQ== 7333 -aWNodGln 7334 -IHJlc2lzdGFuY2U= 7335 -IEdhbA== 7336 -Z2VyeQ== 7337 -IGJlZ2lucw== 7338 -IGFkdmFuY2Vk 7339 -IHJlbGV2YW50 7340 -IHBvbGl0aWNz 7341 -IEZhbQ== 7342 -IMOnb2s= 7343 -IE5ldmVy 7344 -aWxsaW5n 7345 -IGZvb3RiYWxs 7346 -0LjQuA== 7347 -IElE 7348 -IEFmcmljYQ== 7349 -IGZpbmdlcnM= 7350 -INCx0L7Qu9GM 7351 -IMOh 7352 -IGNsaXA= 7353 -IExhdA== 7354 -44KE 7355 -IOyngOq4iA== 7356 -ZXNzZQ== 7357 -IHZvb3I= 7358 -IGFzaWRl 7359 -5p4= 7360 -IHRvd2FyZA== 7361 -IGJhdA== 7362 -IHZhbGlk 7363 -IE1lbnM= 7364 -IGNvbXBsZXRlZA== 7365 -xLHEnw== 7366 -IHBvZGNhc3Q= 7367 -IEJvbg== 7368 -25I= 7369 -IEp1bHk= 7370 -aWxh 7371 -IHBhY2thZ2U= 7372 -IHB1bGxlZA== 7373 -Y2hhcg== 7374 -IE1lbA== 7375 -b2lz 7376 -IHNvdXRo 7377 -IOuU 7378 -IGltcG9ydGFuY2U= 7379 -IHB1c2hpbmc= 7380 -IGlzb2w= 7381 -IHN0YW5kcw== 7382 -Y2lsbA== 7383 -5Lw= 7384 -IPCf 7385 -b3Jp 7386 -6rCB 7387 -IGhvbWVz 7388 -IGNvbmNlcm5z 7389 -IGJpeg== 7390 -5b0= 7391 -Ymll 7392 -IGJpcw== 7393 -IGdlYXI= 7394 -IE1T 7395 -IGh1bg== 7396 -IE1hdHQ= 7397 -4bqj 7398 -c2V5 7399 -IFNlY3JldA== 7400 -IG9kZA== 7401 -IE1heA== 7402 -b2xseQ== 7403 -Zm9yZA== 7404 -IFNI 7405 -IHJlcGxhY2U= 7406 -IG5hdmln 7407 -IGluaQ== 7408 -0LjRjw== 7409 -IGdpYW50 7410 -IG1hbmQ= 7411 -IEhhcHA= 7412 -VElPTg== 7413 -Z3Vu 7414 -aWFtbw== 7415 -7J6F64uI64uk 7416 -IGdhcA== 7417 -IMOqdHJl 7418 -IGNsYXNzcm9vbQ== 7419 -IGh5cA== 7420 -YWtp 7421 -6K4= 7422 -aXN0ZXJz 7423 -YWNrcw== 7424 -INGB0L4= 7425 -IGJ1Zw== 7426 -IGdyYXY= 7427 -YW1pbg== 7428 -IGV2ZXJ5ZGF5 7429 -IOyhsA== 7430 -IGdhcmRlbg== 7431 -Y2VtYmVy 7432 -IGVzdG8= 7433 -5ZeO 7434 -2Kw= 7435 -n7A= 7436 -5YE= 7437 -IHJvbQ== 7438 -IOygnOqwgA== 7439 -IGZhbGxpbmc= 7440 -IGZhdWx0 7441 -ZWxseQ== 7442 -IGNoZXN0 7443 -INC70Lg= 7444 -IHBvdGF0bw== 7445 -IGJ1aWxkaW5ncw== 7446 -IG9wZXJhdGluZw== 7447 -IHBhcmU= 7448 -d3I= 7449 -RG9u 7450 -IEZvdXI= 7451 -IHZ1bA== 7452 -IGzDoQ== 7453 -IGZydXN0 7454 -IERhbm4= 7455 -b2xlcw== 7456 -bnlh 7457 -IOy2 7458 -INGA0LDRgQ== 7459 -15s= 7460 -IGHDrQ== 7461 -d29yZA== 7462 -IHdlYXBvbg== 7463 -IG9idA== 7464 -IEZhbGw= 7465 -IFN0ZXZl 7466 -IG1peGVk 7467 -IHBvZGU= 7468 -IEFT 7469 -IExlZw== 7470 -IGRlc2M= 7471 -IHNwbGl0 7472 -IGVtZXJnZW5jeQ== 7473 -IFNpbmc= 7474 -IHByb2ZpdA== 7475 -IHR5cGljYWw= 7476 -IERvbmM= 7477 -IGFubm91bmNl 7478 -IFRleA== 7479 -IHNhY3I= 7480 -dGVybmFs 7481 -IGNvbW1pdHRlZQ== 7482 -aWdv 7483 -IGRpYW0= 7484 -cGhhcw== 7485 -IGRlZmU= 7486 -IFByb2Zlc3M= 7487 -IGRlY2w= 7488 -0YPRgA== 7489 -MjI= 7490 -b2xm 7491 -IE1vbmQ= 7492 -dXk= 7493 -IGF5 7494 -IGxlbQ== 7495 -IGxvdmVseQ== 7496 -IENvdWxk 7497 -IGd1YXI= 7498 -SEg= 7499 -IGNhcmVmdWxseQ== 7500 -IExpc3Rlbg== 7501 -INC60YA= 7502 -IHlvdXRo 7503 -IFRoZXJlZm9yZQ== 7504 -IGRyZWFtcw== 7505 -IEplZmY= 7506 -P10= 7507 -IOuI 7508 -REE= 7509 -IGJvZGllcw== 7510 -YXV4 7511 -IHRlY2huaXF1ZXM= 7512 -IG1lY2hhbmlzbQ== 7513 -15M= 7514 -INC+0L3QuA== 7515 -IGRlc2lyZQ== 7516 -w64= 7517 -IFZv 7518 -cXVlcw== 7519 -INGD0LbQtQ== 7520 -IFdob2E= 7521 -IEdhbWU= 7522 -IGhhbA== 7523 -YW5pc2g= 7524 -IHByYWN0aWNlcw== 7525 -NTAw 7526 -IHNvcnRz 7527 -dXBz 7528 -YXRlZnVs 7529 -IGhlcnNlbGY= 7530 -IGd1aXRhcg== 7531 -IHByb3Bvcw== 7532 -IHNpdGVz 7533 -IGJlYWNo 7534 -INei 7535 -56ys 7536 -0L3Rgw== 7537 -IGRyYW0= 7538 -IE5vdmU= 7539 -VkU= 7540 -cmFudA== 7541 -IHBsb3Q= 7542 -IOyXrOq4sA== 7543 -IENh 7544 -IGVzdGFibGlzaGVk 7545 -IDIwMTU= 7546 -IGluc3BpcmVk 7547 -IGFubm91bmNlZA== 7548 -5Liq 7549 -INGC0YA= 7550 -IDI2 7551 -IHZveQ== 7552 -IHRlY2g= 7553 -7KCB 7554 -IHByb2Nlc3Nlcw== 7555 -b250bw== 7556 -IFBhbg== 7557 -IHJhcGlk 7558 -aXN0YW4= 7559 -IDE5Nw== 7560 -IHJlbGlnaW9u 7561 -IDI4 7562 -IHNtaWxl 7563 -IGJhYg== 7564 -INqp 7565 -IFZpcg== 7566 -IHNjaGVkdWxl 7567 -IGV4ZWN1dA== 7568 -IHByb24= 7569 -0Y0= 7570 -INCd0YM= 7571 -bXVzaWM= 7572 -7JuQ 7573 -IGdhbg== 7574 -7Iug 7575 -IGRlZmF1bHQ= 7576 -IGJlbQ== 7577 -2Yk= 7578 -IGZvcmNlZA== 7579 -IE9idmlvdXNseQ== 7580 -IHN0b25l 7581 -IHRpZQ== 7582 -IGRyaW5raW5n 7583 -IHNlcnZlZA== 7584 -Q2F1c2U= 7585 -IGNvbmZlcmVuY2U= 7586 -IEV4YWN0bHk= 7587 -44OI 7588 -oJw= 7589 -7JmA 7590 -IFJh 7591 -IGZha2U= 7592 -IGRpZmY= 7593 -44Gp 7594 -IGNoYWxsZW5naW5n 7595 -IOykkQ== 7596 -z4c= 7597 -5LuA6bq8 7598 -IGludGVsbGlnZW5jZQ== 7599 -cmV0ZQ== 7600 -IHN0dWR5aW5n 7601 -IGFwcG9pbnQ= 7602 -IHRhbg== 7603 -INC40Lw= 7604 -IGN1cnZl 7605 -IFRlYW0= 7606 -IEF6 7607 -INC30LQ= 7608 -IE11c2lj 7609 -ZmllbGQ= 7610 -aXJhdGlvbg== 7611 -IGZhaWxlZA== 7612 -IG5vdmVs 7613 -IGRpZmZlcmVudGx5 7614 -IGVzY2FwZQ== 7615 -IFlv 7616 -IE9jdG9iZXI= 7617 -xLF5b3I= 7618 -IGRlc2NyaWJlZA== 7619 -IGNvbnZlcnQ= 7620 -YWNlbWVudA== 7621 -IGhvdGVs 7622 -aXNhdGlvbg== 7623 -IHN1aXM= 7624 -44GR 7625 -5a2Q 7626 -5oCO 7627 -IHdhbGtlZA== 7628 -MjAw 7629 -IG5laWdoYm9yaG9vZA== 7630 -aXNw 7631 -IExvcw== 7632 -IGhpZGRlbg== 7633 -IDI3 7634 -0LvQtQ== 7635 -IHBocg== 7636 -IElzbGFuZA== 7637 -IFN0cmVldA== 7638 -ZW5kYQ== 7639 -aGlwcw== 7640 -b3N1cmU= 7641 -IGRlZmluZWQ= 7642 -4Lin 7643 -IHZpZGE= 7644 -IGxhYmVs 7645 -IEV2ZXJ5Ym9keQ== 7646 -IGpva2U= 7647 -aWFv 7648 -2KfZhg== 7649 -IGF0aGxldA== 7650 -Li4uIg== 7651 -IEZpcmU= 7652 -RG8= 7653 -IGRlZmVuc2U= 7654 -IGVudGVydGFpbg== 7655 -w6F0 7656 -IHBvbGljaWVz 7657 -IGFsY29ob2w= 7658 -IEVuZ2luZQ== 7659 -IGdhbA== 7660 -IEp1ZA== 7661 -IHZvbHVudGU= 7662 -aWNrcw== 7663 -ZXRh 7664 -YWd0 7665 -INeV 7666 -IG3Dtg== 7667 -MTM= 7668 -IGVuY291bg== 7669 -IGVo 7670 -IG9yYW5nZQ== 7671 -IGFic29y 7672 -IHNwYWNlcw== 7673 -IE5vdmVtYmVy 7674 -6rWs 7675 -aWF0 7676 -IHRhbQ== 7677 -Y2tub3c= 7678 -IHN0b3Jt 7679 -IERpcmVjdG9y 7680 -IHByZWdu 7681 -IOydvA== 7682 -INC+0L8= 7683 -IHJlc291cmNl 7684 -IGJhcmQ= 7685 -bmV3 7686 -IERlY2VtYmVy 7687 -dWl0cw== 7688 -IHdlaWw= 7689 -IGNvbnN0cnVjdA== 7690 -c2k= 7691 -bmlj 7692 -IGZsb3Vy 7693 -IHJlc3RyaWN0 7694 -w7x0 7695 -IGVudGlyZWx5 7696 -IGJyZWFraW5n 7697 -ZW50bGljaA== 7698 -IHR3ZW50eQ== 7699 -IGNhdXNlcw== 7700 -IGVsZXY= 7701 -IFNwcg== 7702 -IEludGVybmV0 7703 -IGtpc3M= 7704 -IG9wZXJhdGlvbnM= 7705 -c3p5 7706 -IOuK 7707 -IHNjaWVudGlzdHM= 7708 -IGdyb3du 7709 -IG93bmVycw== 7710 -b3V0cw== 7711 -IGNvdXJzZXM= 7712 -IHVzdWFs 7713 -IGlubg== 7714 -IHRyYW5zbQ== 7715 -w7Fv 7716 -IG51ZXN0 7717 -0LrQvtCy 7718 -IGNhdGVnb3J5 7719 -IExpZmU= 7720 -IFBsdXM= 7721 -IGF0bW9z 7722 -d2hpbGU= 7723 -IHJlY29yZHM= 7724 -IGRlxJ8= 7725 -64uk6rOg 7726 -IOyCrOue 7727 -IHJlcXVpcmVtZW50cw== 7728 -aW5u 7729 -IGltbWln 7730 -IGRlZXBlcg== 7731 -57Q= 7732 -IGFwcHM= 7733 -IGNvbGxlYWd1ZXM= 7734 -xbx5 7735 -IG9mZmVycw== 7736 -IHTDoQ== 7737 -IGNvbHVtbg== 7738 -bGF1ZA== 7739 -SVI= 7740 -IE1z 7741 -IGV4Y2hhbmdl 7742 -bGFz 7743 -IExhdw== 7744 -IEpvbg== 7745 -aXNzZQ== 7746 -cm9nZW4= 7747 -IG1vaQ== 7748 -15c= 7749 -IHNlbmRpbmc= 7750 -IGhlbGxv 7751 -0LXQtQ== 7752 -xZvEhw== 7753 -IHN1Y2NlZWQ= 7754 -IHN1ZmZlcmluZw== 7755 -IGFkdmVydA== 7756 -IOyjvA== 7757 -55+l6YGT 7758 -IHJlY28= 7759 -xLFuxLE= 7760 -INC60L7QvA== 7761 -YWxsZXk= 7762 -IGZhaWx1cmU= 7763 -aWVq 7764 -IOuVjA== 7765 -IGRydWdz 7766 -IGN1YW5kbw== 7767 -IOyWtOuW 7768 -IEFib3V0 7769 -IHF1YW5kbw== 7770 -OTA= 7771 -IEZlZA== 7772 -MTc= 7773 -U2g= 7774 -aW5obw== 7775 -IFN1bmRheQ== 7776 -IFBoaWw= 7777 -IGFjYWRlbWlj 7778 -IEluYw== 7779 -IG1haW50ZW4= 7780 -5Ye6 7781 -IHJld2FyZA== 7782 -ZXJk 7783 -IGNvbW1pdHRlZA== 7784 -7Iqk 7785 -0LPRgA== 7786 -IHN0YW5kYXJkcw== 7787 -IGthbA== 7788 -IGludGVudGlvbg== 7789 -IFpo 7790 -IGFja25vdw== 7791 -5L8= 7792 -ID09PQ== 7793 -b2d5 7794 -5ac= 7795 -IGZpbG1z 7796 -aXNr 7797 -IHRlZXRo 7798 -IHN0cnVnZ2xl 7799 -cmQ= 7800 -dWVu 7801 -IGRpc3M= 7802 -IERhcg== 7803 -YW15 7804 -IGVuZW1pZXM= 7805 -IHZlbG9j 7806 -IENhbGw= 7807 -dW1icw== 7808 -0LjRgtC10LvRjA== 7809 -IG9jZWFu 7810 -w6lk 7811 -7Jqw 7812 -IHRyZW0= 7813 -aWVudG8= 7814 -0LXRiNGM 7815 -ZmZpY2llbnQ= 7816 -IGJvdHRsZQ== 7817 -IGluc3RpdHV0aW9u 7818 -ZXN0eQ== 7819 -IEhhbg== 7820 -aGFi 7821 -64qY 7822 -IGFycmVzdA== 7823 -6YKE 7824 -IGxldHRlcnM= 7825 -b3VuY2U= 7826 -7Yw= 7827 -QW4= 7828 -IGNyZWF0ZXM= 7829 -IGNsb2Nr 7830 -IGRlYnQ= 7831 -IGFuY2llbnQ= 7832 -aWZpY2F0aW9ucw== 7833 -Z2k= 7834 -QnV0 7835 -IFR1 7836 -a2w= 7837 -IGJvcmRlcg== 7838 -IG9vaw== 7839 -IEJheQ== 7840 -ZXN0YQ== 7841 -IOuztOw= 7842 -IHdyYQ== 7843 -cHJlbmU= 7844 -IOqyjA== 7845 -YW5nbGU= 7846 -IGJlbGlldmVk 7847 -aWVuY3k= 7848 -YWth 7849 -IGNyaXRpYw== 7850 -IGJvbWI= 7851 -IGhhbQ== 7852 -INCb 7853 -6rWt 7854 -IEd1eXM= 7855 -cm9zb2Z0 7856 -IGNyaW0= 7857 -ZXRjaA== 7858 -QVJS 7859 -IHNpZ2h0 7860 -0LjQvdCw 7861 -IGFpbg== 7862 -4buR 7863 -aXNjaGU= 7864 -IGF1eA== 7865 -IG51bWVy 7866 -IHN1cnZpdmU= 7867 -QWxs 7868 -QkM= 7869 -IHN6 7870 -n6zr 7871 -IGphbQ== 7872 -IENvdXJ0 7873 -IGFsbGVz 7874 -IHRyaWdnZXI= 7875 -0J4= 7876 -IGZvcm1hdA== 7877 -IGRlY2FkZXM= 7878 -IGNlcw== 7879 -IHNpZ25z 7880 -IHJvYm90 7881 -IENodXJjaA== 7882 -IGF6 7883 -IHNvdXA= 7884 -IFRleGFz 7885 -dXRlbg== 7886 -INGH0YLQvtCx0Ys= 7887 -IG5laWdoYg== 7888 -lteU 7889 -IGNvbW11bmljYXRl 7890 -xaE= 7891 -IGVsaW1pbg== 7892 -IGZyZXF1ZW5jeQ== 7893 -aGVybg== 7894 -aWRvcw== 7895 -IGVtcGhhcw== 7896 -IG1lc3NhZ2Vz 7897 -IGdlbmRlcg== 7898 -IFdlbm4= 7899 -INCy0L4= 7900 -IHByaWNlcw== 7901 -b2xv 7902 -INC/0L7QvQ== 7903 -d2luZw== 7904 -IEZpbA== 7905 -0LDQtdC8 7906 -IEN1cg== 7907 -IGZhbHNl 7908 -IGZpZWxkcw== 7909 -IHPDqQ== 7910 -MjQ= 7911 -IG1hYw== 7912 -dcWf 7913 -IGxheWVycw== 7914 -IGFkdm9j 7915 -d2Fu 7916 -IGthcg== 7917 -IMWe 7918 -IGRlY29y 7919 -IHdhbGxz 7920 -b2U= 7921 -aXNzaW9ucw== 7922 -IHJlc29s 7923 -16I= 7924 -IENhcm9s 7925 -IFZpZGU= 7926 -bGVlcA== 7927 -IFlPVQ== 7928 -IGZsaXA= 7929 -IHN1cmdlcnk= 7930 -IGNob3A= 7931 -VVI= 7932 -Liw= 7933 -IGFnZW5jeQ== 7934 -IHdhbnRpbmc= 7935 -IHNvbGFy 7936 -IGhvcml6 7937 -IEFkYW0= 7938 -IHN0YXlpbmc= 7939 -b2xpYw== 7940 -IGdyYXRlZnVs 7941 -IHJlbWFyaw== 7942 -IHRlY2hub2xvZ2llcw== 7943 -IHByb3RlaW4= 7944 -5b+D 7945 -0LTQtdC7 7946 -IE1vbnQ= 7947 -IHNob3VsZGVy 7948 -IHph 7949 -cmV5 7950 -IE9vaA== 7951 -IHN0eQ== 7952 -aWNhcg== 7953 -0L7RgtGA 7954 -IHJvdXRl 7955 -IFR1cm4= 7956 -IGJvbQ== 7957 -IGRlYmF0ZQ== 7958 -IHBvc3NpYmlsaXR5 7959 -IO2VtOw= 7960 -YXBh 7961 -IGludmVudA== 7962 -w7xybGljaA== 7963 -IHByb2ZpbGU= 7964 -IHNlbmlvcg== 7965 -cHB5 7966 -dmFz 7967 -IG11bmRv 7968 -YXRldmVy 7969 -IGFwcGFyZW50bHk= 7970 -ZW5lcg== 7971 -15A= 7972 -560= 7973 -IHByZWNpcw== 7974 -IGFsaWdu 7975 -IGtuaWZl 7976 -IFJvYmVydA== 7977 -5Ys= 7978 -IGZvb2w= 7979 -IGludml0ZQ== 7980 -dXNpbmc= 7981 -IGNpcmN1bXN0 7982 -IGNhcHR1cmU= 7983 -IGRvdWdo 7984 -IFNhbmQ= 7985 -IHNldQ== 7986 -IE5ld3M= 7987 -IGJpdGU= 7988 -IG5ldXQ= 7989 -d2lkZQ== 7990 -IGxlY3R1cmU= 7991 -IOuYkA== 7992 -IG9yaWdpbmFsbHk= 7993 -IGNob2ljZXM= 7994 -IEdhcg== 7995 -IHZlcnNl 7996 -IGxpdA== 7997 -IDE5Ng== 7998 -7ZWg 7999 -IG1lYXN1cmVz 8000 -w6fDtWVz 8001 -d2F0ZXI= 8002 -cml2ZQ== 8003 -IHppam4= 8004 -7YE= 8005 -IEJ1cw== 8006 -IGhlYg== 8007 -0LXRhQ== 8008 -IEthcg== 8009 -IE7Do28= 8010 -IGtpbGxpbmc= 8011 -4K6q 8012 -IG1pcnJvcg== 8013 -bW9k 8014 -IG1vbA== 8015 -IGNyZWF0aW9u 8016 -IGVzdGlt 8017 -IGF0bW9zcGhlcmU= 8018 -IGdhbQ== 8019 -IHRhYmxlcw== 8020 -aXNp 8021 -IExpdHRsZQ== 8022 -IHRhcw== 8023 -IEVsZQ== 8024 -w6ls 8025 -IHNjZW5lcw== 8026 -IHRvbmU= 8027 -IGFmZmVjdGVk 8028 -IEFVREk= 8029 -IEJyb3du 8030 -SWY= 8031 -INmH 8032 -IERhbmllbA== 8033 -55yf55qE 8034 -cXVlcg== 8035 -Y2hp 8036 -7ZWY6w== 8037 -IG1pc3Rha2Vz 8038 -IHNsYQ== 8039 -44Kk 8040 -IGVudHI= 8041 -INC10YHQu9C4 8042 -IHNob3V0 8043 -IHBvcnRpb24= 8044 -0Zc= 8045 -IHByZXZpb3VzbHk= 8046 -4buZ 8047 -INC/0YDQtdC0 8048 -0L7RgdGM 8049 -IGhlYWRz 8050 -544= 8051 -5a0= 8052 -5ZyL 8053 -IGdyYXNz 8054 -4Liw 8055 -Y3JpYmU= 8056 -IHF1w6k= 8057 -IFNwYW5pc2g= 8058 -IG9mZmVyZWQ= 8059 -INCx0YvQu9C+ 8060 -IENsb3Vk 8061 -IHZlY3Rvcg== 8062 -IEh1aA== 8063 -IGthZA== 8064 -aWZ0cw== 8065 -IM69 8066 -IGh1bmdyeQ== 8067 -0KE= 8068 -IHBhcmFsbA== 8069 -QU5E 8070 -IHbDrWRlbw== 8071 -aXp6 8072 -IG9jY3Vw 8073 -IO2U 8074 -IHNlZWs= 8075 -aGVz 8076 -IGRvb3Jz 8077 -IGhvdXNlcw== 8078 -IGNvbnNpZGVyaW5n 8079 -IGdyYWR1YXRl 8080 -IGZ1bGY= 8081 -6KGM 8082 -6KM= 8083 -IGV4dHJlbWU= 8084 -IGZsb3dlcnM= 8085 -aXRhdGU= 8086 -IFByaQ== 8087 -IGZ1bmRhbWVudGFs 8088 -0YfQsNGB 8089 -6K+0 8090 -IHRleHR1cmU= 8091 -jZg= 8092 -IEFORA== 8093 -4K6x 8094 -IFRlbQ== 8095 -IG5hZGE= 8096 -7KeE 8097 -IGNlbGVicmF0ZQ== 8098 -dW1z 8099 -IHBpbGw= 8100 -INC40LvQuA== 8101 -Z29pbmc= 8102 -IGhpcA== 8103 -IHN1cHBvcnRlZA== 8104 -IHBlcm1hbg== 8105 -IGFncmVlbWVudA== 8106 -IHR5bQ== 8107 -IOuR 8108 -k6TsnbQ= 8109 -IHB1cmNoYXNl 8110 -7ZQ= 8111 -IFBsYW4= 8112 -ZWdlbg== 8113 -IHJlY292ZXI= 8114 -UFU= 8115 -IE1pY3Jvc29mdA== 8116 -ZHVj 8117 -IGhvbGVz 8118 -IGRyb3BwZWQ= 8119 -IHBpZw== 8120 -IGVuZGluZw== 8121 -IGF0dGFja3M= 8122 -YmVj 8123 -IHJlbg== 8124 -IHJhcHA= 8125 -IOyasOumrA== 8126 -IHRlcnJvcg== 8127 -INeZ 8128 -IGVkaXQ= 8129 -IGFv 8130 -Ljwv 8131 -IDIwMDA= 8132 -IFVuaW9u 8133 -IHNjaWVudGlmaWM= 8134 -IHB1bmNo 8135 -b3J0aW9u 8136 -IHB1dHM= 8137 -IE1vbmRheQ== 8138 -IEplcg== 8139 -RUM= 8140 -IG1hdHJpeA== 8141 -IGluc3RpdHV0aW9ucw== 8142 -IG1vbnQ= 8143 -IGV4aGli 8144 -IHNwZWFrZXI= 8145 -IG1ldGVycw== 8146 -Ll0= 8147 -IHNlcnZpbmc= 8148 -IGRhdGFiYXNl 8149 -IExBVQ== 8150 -IGRhbW4= 8151 -IHBvZGVy 8152 -ISEhIQ== 8153 -IO2WiA== 8154 -IEFVRElFTkNF 8155 -IGp1bg== 8156 -IEFD 8157 -IEl0YWw= 8158 -c2Vj 8159 -IFlvdW5n 8160 -cnVjaw== 8161 -b3V2ZQ== 8162 -4LiE 8163 -54g= 8164 -IOunjOs= 8165 -YWRpbmc= 8166 -dXJhdGlvbg== 8167 -IFBT 8168 -0Jo= 8169 -IFVuZg== 8170 -6IE= 8171 -b3JpYQ== 8172 -IG1hbmlm 8173 -IHNlbnRlbmNl 8174 -IHNpZ25lZA== 8175 -QlM= 8176 -IHByb29m 8177 -IE11c2xpbQ== 8178 -IG51Y2xlYXI= 8179 -INCz0L7QstC+0YA= 8180 -IHdvbGw= 8181 -IGZhdm91cg== 8182 -IFdI 8183 -IHZ1bG5lcg== 8184 -IGNsb3NlbHk= 8185 -IGluZGV4 8186 -0YLQtdGA 8187 -YWNoZWw= 8188 -IGNhcGFibGU= 8189 -IEJlcw== 8190 -IGNyb2No 8191 -ZWt0 8192 -IHNoZWV0 8193 -IHNlZXM= 8194 -IG5hdHVyYWxseQ== 8195 -IEVuZ2xhbmQ= 8196 -IHBhcnRpY2lwYXRl 8197 -IGV4aXN0cw== 8198 -IHNoYXJw 8199 -cHk= 8200 -IGJyZWFrZmFzdA== 8201 -Ym93 8202 -IHR3aXN0 8203 -56c= 8204 -aW5hdGluZw== 8205 -b3Rp 8206 -IEZvdW5k 8207 -IGRldXg= 8208 -IHNlbGVjdGVk 8209 -7KCE 8210 -b3Npcw== 8211 -IHByZXNlbnRlZA== 8212 -IGxpbmVhcg== 8213 -IOq0 8214 -IGt1bg== 8215 -6bue 8216 -w7RuZw== 8217 -IGLEmWQ= 8218 -IHRlbXBvcg== 8219 -IGNhYmxl 8220 -INC/0YDQvtGB0YLQvg== 8221 -0LrQtQ== 8222 -INGC0LDQvA== 8223 -IHdpbm5pbmc= 8224 -6IO9 8225 -mOuPhA== 8226 -IDIwMTQ= 8227 -IOyXrOs= 8228 -IFVO 8229 -IENsaWNr 8230 -IHByZXBhcg== 8231 -IFRP 8232 -IHN1YQ== 8233 -IEhhbQ== 8234 -IGzDpA== 8235 -IGFic29sdXRl 8236 -IGVuZ2FnZWQ= 8237 -5aaC 8238 -IEhtbQ== 8239 -IGRhc2g= 8240 -VEE= 8241 -w7Fvcw== 8242 -IHNwbw== 8243 -55Sf 8244 -KV0= 8245 -IHRlc3RlZA== 8246 -IGJsYW5r 8247 -IHJlamVjdA== 8248 -IGFzc2lt 8249 -IHJlYXI= 8250 -IFN0cg== 8251 -IGNyYXNo 8252 -INC90LDRiA== 8253 -0LjRgtGB0Y8= 8254 -IGNvbG9u 8255 -IFVudA== 8256 -IENl 8257 -IGFjaWQ= 8258 -6Zc= 8259 -IGtpdA== 8260 -aWJpbGl0aWVz 8261 -dXRv 8262 -IHZhbHVhYmxl 8263 -bGlzdA== 8264 -IHBhcnRpZXM= 8265 -IE1t 8266 -IGNvbG91cg== 8267 -IGNoYW0= 8268 -IHN0ZWVs 8269 -IEltcA== 8270 -IGZ1bmRz 8271 -IEROQQ== 8272 -IEtlbg== 8273 -aW5kZQ== 8274 -7ZW07ISc 8275 -44OD 8276 -IEhhcHB5 8277 -IFVzZQ== 8278 -IExpZ2h0 8279 -IGxpcA== 8280 -IGF1dGhvcml0eQ== 8281 -IExvbmc= 8282 -IElyYW4= 8283 -IGVsbA== 8284 -IGNvb3JkaW4= 8285 -IHN1Ym0= 8286 -IHJlY29yZGVk 8287 -0YPRiA== 8288 -IGRlbHRh 8289 -IHJlZm9ybQ== 8290 -IFN0aWxs 8291 -IG9wcG9u 8292 -IGFsbG93aW5n 8293 -IHBhdHRlcm5z 8294 -IGxldHRpbmc= 8295 -IHNsZWVwaW5n 8296 -T2theQ== 8297 -IHBpenph 8298 -IMWb 8299 -INC00L7Quw== 8300 -IHRhbGVudA== 8301 -ZW5zaW9ucw== 8302 -IGVudmlyb25tZW50YWw= 8303 -IHByb2Zlc3Nvcg== 8304 -IHNob3Rz 8305 -IGNvbnRhaW5z 8306 -dWdhcg== 8307 -eW8= 8308 -j5k= 8309 -IHNlcXVlbmNl 8310 -zrnOsQ== 8311 -YWRlcg== 8312 -6aA= 8313 -0LDRhw== 8314 -2YbYpw== 8315 -IElr 8316 -IHRvdXM= 8317 -dXJpZXM= 8318 -IHBvdW5kcw== 8319 -IGV4dGVybmFs 8320 -aW1lbnRz 8321 -IHZyYWltZW50 8322 -7Iuk 8323 -IGhhcHBpbmVzcw== 8324 -IHByemU= 8325 -ZXN0aWM= 8326 -IGVzdGFibGlzaA== 8327 -IEZsb3I= 8328 -IHJpZw== 8329 -IGhvbmV5 8330 -IHB1bA== 8331 -IHN5bXB0b21z 8332 -IGJyb3dz 8333 -0LXQu9C4 8334 -IM+Ezr8= 8335 -IHNoaXJ0 8336 -IFRlY2hu 8337 -IFByb2dyYW0= 8338 -0LXQvNGD 8339 -IHVwc2V0 8340 -IGd1ZXN0 8341 -YnVyZw== 8342 -IHVubGlrZQ== 8343 -IHNvbWV3aGF0 8344 -IGhhbmdpbmc= 8345 -YWU= 8346 -IHJ1bQ== 8347 -IHBob3RvZ3JhcGg= 8348 -IExp 8349 -5Zue 8350 -IHN0YWJsZQ== 8351 -IHZvbHRhZ2U= 8352 -IEVsbA== 8353 -IGVudHJlcHJlbmU= 8354 -dXNlcw== 8355 -YXNzZW4= 8356 -rLg= 8357 -IOunjuydtA== 8358 -IGdob3N0 8359 -IHNhZ2Vu 8360 -IGNvbWJhdA== 8361 -IGfDtnI= 8362 -IENhcA== 8363 -IHPDo28= 8364 -IEthdA== 8365 -IGZvcm1h 8366 -IHN1bW0= 8367 -IG1hcmNo 8368 -IHZhc3Q= 8369 -w7xr 8370 -IGNvbW1pdG1lbnQ= 8371 -aW1vcw== 8372 -TGV0 8373 -IGRlZGljYXRlZA== 8374 -aXN0ZQ== 8375 -bGF5 8376 -6YCZ5qij 8377 -IHRvcGljcw== 8378 -IG1hY2hpbmVz 8379 -IFBhcmlz 8380 -IOydtOufsA== 8381 -IG1pbmk= 8382 -IG1hcmtldHM= 8383 -IGtv 8384 -zrQ= 8385 -dmlsbGU= 8386 -IGdvb2RuZXNz 8387 -IGZyYW1ld29yaw== 8388 -dWx0dXJl 8389 -IGJhc2tldA== 8390 -ZXNzYQ== 8391 -0LDRhtC4 8392 -dXN0ZXI= 8393 -IOq5 8394 -5L2G 8395 -IGV4dGVudA== 8396 -IE1lbnNjaGVu 8397 -IGNvbnNpc3RlbnQ= 8398 -IGF1dG8= 8399 -cmlw 8400 -IG1lcmU= 8401 -4K+I 8402 -0ZQ= 8403 -IGVsbGU= 8404 -jIDr 8405 -b2tlbg== 8406 -IHB1bGxpbmc= 8407 -IGNvdw== 8408 -b3V0aGVybg== 8409 -IG1lZXRpbmdz 8410 -IGNhZGE= 8411 -0L3Ri9C8 8412 -aWVudGU= 8413 -IGJhc3Q= 8414 -YW5pbmc= 8415 -IGZvY3VzaW5n 8416 -cm9hZA== 8417 -IHJvb2Y= 8418 -IFByb2Zlc3Nvcg== 8419 -IFNQ 8420 -0YDQsNC3 8421 -IG5vb2Q= 8422 -IDQwMA== 8423 -IOydtOygnA== 8424 -7J6I 8425 -IE1vdW50 8426 -0LXQudGH0LDRgQ== 8427 -INeQ 8428 -V2h5 8429 -154= 8430 -xLFuZGE= 8431 -IHBvc2l0aW9ucw== 8432 -w6htZQ== 8433 -548= 8434 -INC00YDRg9Cz 8435 -aXlvcg== 8436 -IHBhc3Npbmc= 8437 -IGFzc2VtYg== 8438 -IHNtb2tl 8439 -IHRpbA== 8440 -IG11c2V1bQ== 8441 -0JQ= 8442 -IFBlcnNvbg== 8443 -0L3QuNC8 8444 -bGVpY2g= 8445 -IGludGVudA== 8446 -IHNxdWU= 8447 -IGNyYWZ0 8448 -7IiY 8449 -b3JzdW4= 8450 -IDE1MA== 8451 -IGJyb3RoZXJz 8452 -dm9y 8453 -IFNwZWFrZXI= 8454 -aWNpYW5z 8455 -IG9mZmljZXI= 8456 -IGnDp2lu 8457 -INGC0LXQsQ== 8458 -IHNjcmF0Y2g= 8459 -IGdlbmVyYXRl 8460 -eWk= 8461 -IGVtb3Rpb25z 8462 -YXVz 8463 -7LmY 8464 -NDU= 8465 -IExpbms= 8466 -IFJlYWw= 8467 -IGF0ZQ== 8468 -INC90LDQtA== 8469 -IG5hdGl2ZQ== 8470 -4buH 8471 -xLF5 8472 -IGVub3Jt 8473 -IGJsb2Nrcw== 8474 -IGZhY2Vz 8475 -YWNj 8476 -aXZlbmVzcw== 8477 -IGluY2hlcw== 8478 -dWlz 8479 -aGVpdA== 8480 -IHN0cmVldHM= 8481 -IHByb2JhYmlsaXR5 8482 -YXNp 8483 -IGltcGw= 8484 -IOCk 8485 -dXJkYXk= 8486 -IGZhdXQ= 8487 -b215 8488 -IHBpcA== 8489 -IGlsbHVzdA== 8490 -4K6v 8491 -IEp1bg== 8492 -IGx5aW5n 8493 -OTk= 8494 -IG1lbW9yaWVz 8495 -IHByYWN0aWNhbA== 8496 -aWFuYQ== 8497 -b25jZXM= 8498 -IHZpZXdlcnM= 8499 -IFRob21hcw== 8500 -5ow= 8501 -IEdpcmw= 8502 -IFdoZXRoZXI= 8503 -IGlubm92YXRpb24= 8504 -IGRpc2FwcG9pbnQ= 8505 -TXk= 8506 -IHdpbm5lcg== 8507 -IGln 8508 -IHJhdGlv 8509 -IEJsdWU= 8510 -IFN1Yg== 8511 -IGRvY3VtZW50cw== 8512 -IGZvcm11bGE= 8513 -IOup 8514 -0Yo= 8515 -IGFwcGVhcmVk 8516 -dmFy 8517 -YW5kb24= 8518 -IHNwcmF5 8519 -bWFr 8520 -IFFVRVM= 8521 -S0U= 8522 -IHdlZGRpbmc= 8523 -UmU= 8524 -0LDRgtGM0YHRjw== 8525 -IHVubw== 8526 -IGdhbGw= 8527 -7YSw 8528 -Y2lv 8529 -Y2Vycw== 8530 -INC80L3QtQ== 8531 -IHBlcHBlcg== 8532 -44GX44Gf 8533 -IEZlYnJ1 8534 -IGFsdGVybmF0aXZl 8535 -IGZ1 8536 -IEJhc2ljYWxseQ== 8537 -IFNtaXRo 8538 -IGdhdGU= 8539 -IFRhbQ== 8540 -IFdoYXRldmVy 8541 -IGFwcHJveGlt 8542 -IGNvbmNlcnQ= 8543 -IGp1aWNl 8544 -IEVzcGVjaWFsbHk= 8545 -IGR5bmFtaWM= 8546 -UXU= 8547 -b25kZXI= 8548 -aXZlcnk= 8549 -IGJhbmc= 8550 -IHJ1bA== 8551 -IFBhcnR5 8552 -IHNjaG9sYXJz 8553 -IGNyeWluZw== 8554 -asSF 8555 -0KI= 8556 -IFFVRVNUSU9O 8557 -cmlk 8558 -IGFjY3VyYXRl 8559 -w6dv 8560 -IENvb2w= 8561 -Y29pbg== 8562 -IOyDgQ== 8563 -IEZv 8564 -IHByw7M= 8565 -IFJvbWFu 8566 -INCf0YA= 8567 -IGNoZWNraW5n 8568 -Pyc= 8569 -IGF0dGFjaGVk 8570 -IElzbGFt 8571 -IGV4cGVydHM= 8572 -16c= 8573 -IENvbnN0 8574 -0YDQsNC9 8575 -IHNoYWRvdw== 8576 -IGRlbGF5 8577 -0JI= 8578 -IG9yaWVudA== 8579 -64I= 8580 -ZWxsZW4= 8581 -IGFzw60= 8582 -0LrQuNC5 8583 -IGhpc3RvcmljYWw= 8584 -IHVuY29t 8585 -b21w 8586 -aG0= 8587 -IGJpbA== 8588 -IHBsYW5uZWQ= 8589 -IFVuZm9ydHVuYXRlbHk= 8590 -IFdpbmRvd3M= 8591 -2LQ= 8592 -IGVuY291bnRlcg== 8593 -IOyDneqwgQ== 8594 -IHJlZ2FyZGluZw== 8595 -YXJyYXNz 8596 -IHJlY292ZXJ5 8597 -IEh1cg== 8598 -IEVtcA== 8599 -IHPDrQ== 8600 -7ZWY6rKM 8601 -IGRlZmVuZA== 8602 -IGNldA== 8603 -YXNzZQ== 8604 -64uo 8605 -b2tlcw== 8606 -IHJlbW90ZQ== 8607 -INiz 8608 -IGFydHM= 8609 -aXNjbw== 8610 -YXVjb3Vw 8611 -IE1leGljbw== 8612 -INC/0L7QvA== 8613 -IGNob3Nlbg== 8614 -ZW1hdA== 8615 -b2Rpbmc= 8616 -IGZsb3dlcg== 8617 -c3RhbmRpbmc= 8618 -IEFzc29jaQ== 8619 -dW1teQ== 8620 -SUxM 8621 -IGNhbWVyYXM= 8622 -5YaN 8623 -IOaIkQ== 8624 -IEFyYWI= 8625 -IFN1bQ== 8626 -IHRlZ28= 8627 -IGNyaW1pbmFs 8628 -aWZvcm0= 8629 -IHN0YWNr 8630 -7ISx 8631 -IERvbmFsZA== 8632 -IE9sZA== 8633 -IGR1c3Q= 8634 -IEpvc2U= 8635 -IGhlbQ== 8636 -IGluY3JlYXNlcw== 8637 -b3N0YQ== 8638 -IGR5aW5n 8639 -IFJpdmVy 8640 -IG1vaXN0 8641 -0YLQvtCy 8642 -YXJlcw== 8643 -IGRpc2NpcGw= 8644 -cmFpdA== 8645 -IEhhcw== 8646 -eWdlbg== 8647 -IFRyZQ== 8648 -IOu0 8649 -IGxhbmd1YWdlcw== 8650 -IEhlbg== 8651 -IDM2 8652 -IERpc25leQ== 8653 -aW50cw== 8654 -IGFsZ28= 8655 -IGZvb2Rz 8656 -IHNldHVw 8657 -bGFu 8658 -IGVmZmVjdGl2ZWx5 8659 -IHdoZXJldmVy 8660 -5pyA 8661 -IHVudGVy 8662 -Zm9ybWF0aW9u 8663 -IGhpdHM= 8664 -IHByaW5jaXBsZQ== 8665 -IHRhc3Rlcw== 8666 -p4g= 8667 -IHRyZWF0ZWQ= 8668 -IHJlc29sdXRpb24= 8669 -IHByaXZpbGU= 8670 -IElQ 8671 -67A= 8672 -IHRlcnJpdA== 8673 -IHBvd2Vycw== 8674 -IO2D 8675 -IFZpY3Q= 8676 -IGJvdGhlcg== 8677 -IENoYWly 8678 -IG11c2NsZQ== 8679 -IHNhbGU= 8680 -IGRlY2VudA== 8681 -IGNvdXA= 8682 -IFNxdQ== 8683 -IGNvYXN0 8684 -IHJvZA== 8685 -IEZyYW5j 8686 -IGJhdGhyb29t 8687 -IHNob3BwaW5n 8688 -INC80L7QttC10YI= 8689 -IGnFnw== 8690 -IFN0YXk= 8691 -Z3JhZGU= 8692 -IGZvcm1lZA== 8693 -IGJhxZ8= 8694 -IGJyaWxs 8695 -am91cg== 8696 -7ZY= 8697 -5Zug 8698 -d2ll 8699 -aWNhdGU= 8700 -IOKAi+KAiw== 8701 -IE5vcm0= 8702 -4KU= 8703 -IG1haW5seQ== 8704 -IFNwYWNl 8705 -IHRyZW1lbmQ= 8706 -aXRp 8707 -4K61 8708 -VVQ= 8709 -TXVzaWM= 8710 -IEZlYnJ1YXJ5 8711 -IGNvbnRyYXN0 8712 -5a+5 8713 -ZXN0aW5n 8714 -IM60 8715 -aW5naW5n 8716 -INmG 8717 -c3Nlbg== 8718 -IEhvbWU= 8719 -IHNoZWxs 8720 -IEhheQ== 8721 -IGFsbGVy 8722 -IEFw 8723 -IFdlc3Rlcm4= 8724 -IFdvcmQ= 8725 -IFBMQVk= 8726 -IOuF 8727 -IEFxdQ== 8728 -IGVudHJ5 8729 -IGxhdW5jaGVk 8730 -IE1lbQ== 8731 -IFBvdXI= 8732 -IHp3ZQ== 8733 -IFNvbWVvbmU= 8734 -aW5nZQ== 8735 -IFByb2I= 8736 -bWJsZQ== 8737 -IFJlbA== 8738 -dXJ1 8739 -IHJoeQ== 8740 -IGdpZw== 8741 -IGVuZ2FnZW1lbnQ= 8742 -w7zFnw== 8743 -44KH 8744 -IG9mZmVyaW5n 8745 -d2hlbA== 8746 -IGFjdG9y 8747 -IOWwjQ== 8748 -QVBQ 8749 -d2VzdA== 8750 -IFJveQ== 8751 -IHJldHVybmVk 8752 -IHNpbHZlcg== 8753 -cmF0aW5n 8754 -IGVzdGFy 8755 -IHNrZQ== 8756 -IHRp 8757 -aWNhdGlvbg== 8758 -IGFubm95 8759 -IGRlZXBseQ== 8760 -7Jqp 8761 -IG5hdMO8cmxpY2g= 8762 -RUxM 8763 -IENhdGg= 8764 -IHJhaWw= 8765 -0L3QvtCy 8766 -IHByYXllcg== 8767 -Y29s 8768 -R0I= 8769 -INCi0LDQug== 8770 -IGdsYQ== 8771 -IFdhdGVy 8772 -0Y/RgtGM 8773 -IE5vbg== 8774 -w7R0 8775 -YWdlcnM= 8776 -IGh1Zw== 8777 -IGRvY3RvcnM= 8778 -YW5jaW5n 8779 -IFRhbGs= 8780 -emluZw== 8781 -IGhhZG4= 8782 -IGx1aQ== 8783 -IGF0w6k= 8784 -IOq3uOumrOqzoA== 8785 -6rmM7KeA 8786 -aWNp 8787 -IGluY29ycG9y 8788 -IERp 8789 -emls 8790 -YW55YQ== 8791 -qoU= 8792 -IMK7 8793 -MzU= 8794 -IGJlZXI= 8795 -IGJlYXVjb3Vw 8796 -IE1D 8797 -IGVhcnM= 8798 -b2dlbg== 8799 -IFF1ZXN0 8800 -ZWRh 8801 -5pys 8802 -IFNhdHVyZGF5 8803 -IGZhbGxz 8804 -c3Rvbg== 8805 -Ymxlcw== 8806 -IHRodXM= 8807 -IOuEpA== 8808 -4LmE 8809 -IHRoZXJt 8810 -IGRpdmVyc2l0eQ== 8811 -IHNveQ== 8812 -YXp1 8813 -aW1w 8814 -IHRlbGV2aXNpb24= 8815 -6YGO 8816 -INep15w= 8817 -IHd1cg== 8818 -IGVkZ2Vz 8819 -IGxlc3NvbnM= 8820 -IEF1ZA== 8821 -44GX44Gm 8822 -dm9pcg== 8823 -YW1lbnRv 8824 -IGV4cGxhaW5lZA== 8825 -INC+0L3QsA== 8826 -IHRlbXBz 8827 -z44= 8828 -VGhleQ== 8829 -IHN1cnByaXNpbmc= 8830 -0LDQvdC40Y8= 8831 -IERyYWc= 8832 -6Z2i 8833 -IENsZQ== 8834 -IG5hbQ== 8835 -INC70Y7QtA== 8836 -IGhhcmR3YXJl 8837 -IHRodW1icw== 8838 -IM66zrHOuQ== 8839 -IFRvcA== 8840 -IMOl 8841 -6Zk= 8842 -15XXqA== 8843 -IOq3uOuemOyEnA== 8844 -IEJ1ZGQ= 8845 -dGhlcm4= 8846 -IGludGVyZXN0cw== 8847 -2LA= 8848 -IGRldmVsb3BlcnM= 8849 -IGhpdHRpbmc= 8850 -IG9wcG9zZWQ= 8851 -IGhlYXJ0cw== 8852 -IEFuZHJvaWQ= 8853 -IEhhbmQ= 8854 -IHJlcHJlc2VudHM= 8855 -Z2xpY2g= 8856 -7Yq4 8857 -IDMy 8858 -IGRvbWlu 8859 -IEFubg== 8860 -5LiA5LiL 8861 -IMOpdMOp 8862 -IHpvb20= 8863 -IGt0w7NyZQ== 8864 -IGFkdWx0cw== 8865 -IG9yZGVyZWQ= 8866 -IHBpY2tpbmc= 8867 -IEhvbmc= 8868 -IGZpbG1pbmc= 8869 -5oCd 8870 -IHNlZWQ= 8871 -IEFU 8872 -IGNhbGN1bGF0ZQ== 8873 -INC60L7Qs9C00LA= 8874 -IE9z 8875 -aWNpdA== 8876 -IHJlbWFpbmluZw== 8877 -IHNlZ3U= 8878 -w7s= 8879 -IOyYpOuKmA== 8880 -IGFycml2ZQ== 8881 -IGNvbmdy 8882 -IGdyYW5kZQ== 8883 -IGhlYWx0aGNhcmU= 8884 -INC80L7QttC90L4= 8885 -U0E= 8886 -ZXN0ZQ== 8887 -IGF3YXJlbmVzcw== 8888 -IHNxdWFyZWQ= 8889 -eHR1cmU= 8890 -IEJlaW5n 8891 -IHNvbGRpZXJz 8892 -0YPQsQ== 8893 -IHJldm9sdXRpb24= 8894 -IHRyYWluZWQ= 8895 -ZW5kZW4= 8896 -6LA= 8897 -IGRhbmNpbmc= 8898 -IGluc3RhbGxlZA== 8899 -cHJpc2U= 8900 -IHZldGVy 8901 -IG1lbm9z 8902 -bmVsbA== 8903 -IEJyb3RoZXI= 8904 -IG51bg== 8905 -IGltcG9ydGFudGx5 8906 -YWxsZWQ= 8907 -aWHFgg== 8908 -YWJsZWQ= 8909 -IFN5c3RlbQ== 8910 -IFZvbA== 8911 -IGVsZA== 8912 -IGVtb3Rpb24= 8913 -aWNhbg== 8914 -IEJhbms= 8915 -aWtlcw== 8916 -IHZsb2c= 8917 -INCy0L7Qtw== 8918 -IHB1ZWRl 8919 -7Jik 8920 -IHRlZW4= 8921 -IHNldmVyZQ== 8922 -JSw= 8923 -IGNsZWFuaW5n 8924 -esSF 8925 -l5A= 8926 -IFRocm91Z2g= 8927 -IFNldA== 8928 -RVA= 8929 -Ij8= 8930 -IE1vdGhlcg== 8931 -IGZpZ3VyZWQ= 8932 -IG11ZA== 8933 -INGW 8934 -IE9mZmljZQ== 8935 -IHJhdw== 8936 -IGRlc3Ryb3llZA== 8937 -ZW50YQ== 8938 -IGFnZ3Jlc3M= 8939 -INC+0YE= 8940 -IOuqqOs= 8941 -w6TDpA== 8942 -IEFS 8943 -IGNvcnJlY3RseQ== 8944 -5YmN 8945 -IHN0aXI= 8946 -IGV4dHJhY3Q= 8947 -IHZlaGljbGVz 8948 -6ZaL 8949 -IFJ1bg== 8950 -INCy0YDQtdC8 8951 -IHBhcmFsbGVs 8952 -IGxhZw== 8953 -anU= 8954 -IGRhcmU= 8955 -IE1vdA== 8956 -b25v 8957 -IGJlaW5ncw== 8958 -IHN0cm8= 8959 -IGV4Y3VzZQ== 8960 -IGFscGhh 8961 -IGFza3M= 8962 -IHBvY2tldA== 8963 -Li4uPw== 8964 -IGtpdGE= 8965 -w7xt 8966 -IGFwcGVhcmFuY2U= 8967 -b3JkYW4= 8968 -IGluc2VydA== 8969 -INC90LDRhw== 8970 -m2k= 8971 -IHRlbXBv 8972 -IGZhY2lsaXR5 8973 -IHZpc2libGU= 8974 -5ZI= 8975 -IFNjaWVuY2U= 8976 -dXJvcw== 8977 -INmB2Yo= 8978 -IFZhbg== 8979 -IHRlbnNpb24= 8980 -IO2VoA== 8981 -IGRlbGl2ZXJ5 8982 -IHN0aW0= 8983 -IHN1cnZleQ== 8984 -IEdyYQ== 8985 -IGJvbA== 8986 -5qA= 8987 -IHdlaXRlcg== 8988 -w59lbg== 8989 -5LiA5YCL 8990 -IHByb2NlZWQ= 8991 -IGltcHJlc3NpdmU= 8992 -IFZvYw== 8993 -aW91c2x5 8994 -INC00LA= 8995 -aGFsZQ== 8996 -b2No 8997 -IGdsdWU= 8998 -cGhldA== 8999 -Y29udA== 9000 -IGZpdHM= 9001 -IGJveGVz 9002 -IGNvbnRyb2xz 9003 -IENoaWxk 9004 -IHNjZW5hcmlv 9005 -IHRyb3A= 9006 -IHByb2Nlc3Npbmc= 9007 -INGC0L7Qu9GM0LrQvg== 9008 -IGJpcmRz 9009 -IENoaWM= 9010 -INC90LDQvw== 9011 -IDIwMTM= 9012 -IG3DvHNzZW4= 9013 -IEphZw== 9014 -IHPEhQ== 9015 -IHBlcmNl 9016 -cmVo 9017 -IEZvcmU= 9018 -IGNvbmZ1c2Vk 9019 -YWlyZQ== 9020 -IGFjY29tcGxpc2g= 9021 -IGNhc2E= 9022 -Y2xvY2s= 9023 -IGluZmx1ZW4= 9024 -IFJP 9025 -IGJvbmU= 9026 -aWNpYW4= 9027 -IFND 9028 -IHN0cmF0ZWdpZXM= 9029 -Z2g= 9030 -0LTRgw== 9031 -IGl0dQ== 9032 -IHBlcnNvbmFsaXR5 9033 -IGJhcmR6bw== 9034 -IGFjY2VwdGVk 9035 -IHN0b20= 9036 -aWV2 9037 -IEhpc3Q= 9038 -IEF1cw== 9039 -IOuwlOs= 9040 -QVRPUg== 9041 -5oSP 9042 -b2ly 9043 -IG1hZ2F6 9044 -IGV4cGxhbg== 9045 -IGNvcm4= 9046 -IGlscw== 9047 -IGNpcmN1aXQ= 9048 -IGdheQ== 9049 -aG9w 9050 -44KD 9051 -IGVxdWl2YWw= 9052 -IGRpZXNlcg== 9053 -ZXJ2ZXM= 9054 -Y29tZXM= 9055 -a2xpY2g= 9056 -IOuVjOs= 9057 -YWJldA== 9058 -IGV4aGE= 9059 -IG1hbm5lcg== 9060 -IOKZquKZqg== 9061 -w6lj 9062 -w6Rs 9063 -IGNvbmZpcm0= 9064 -IGVudGVyZWQ= 9065 -ZW1wbG8= 9066 -IEZhcg== 9067 -IG/DuQ== 9068 -ZXNzaW9ucw== 9069 -IG51cnM= 9070 -IGVudMOjbw== 9071 -IGFiYW5kb24= 9072 -bGlmZQ== 9073 -IHdpcw== 9074 -TmFycmF0b3I= 9075 -IOyWtA== 9076 -VGhlcmU= 9077 -IFJhbQ== 9078 -YXN0ZQ== 9079 -IGF0dHJpYg== 9080 -IEF5 9081 -IG1lc21v 9082 -IM69zrE= 9083 -6as= 9084 -ZW5zZXM= 9085 -IGNyb3A= 9086 -INC30LTQtdGB0Yw= 9087 -IFVudGls 9088 -c3RlaW4= 9089 -IG92ZW4= 9090 -IHN1c3BlY3Q= 9091 -aGV0 9092 -IHB1aXM= 9093 -IGNhcnJpZWQ= 9094 -w6ln 9095 -IERldg== 9096 -ZW1z 9097 -cmVlbnM= 9098 -YmVycnk= 9099 -IHRlbXBs 9100 -IEJpdA== 9101 -IHZhcmlhYmxlcw== 9102 -IG92ZXJ3aGVs 9103 -zrzOtQ== 9104 -IGluaXRpYWxseQ== 9105 -7JWY 9106 -b3RoaW5n 9107 -0LXRgtGM 9108 -IEhpbGw= 9109 -IGRlcGFydA== 9110 -IG15c3Q= 9111 -YXp6 9112 -IGZsdWlk 9113 -IERD 9114 -IGNsaW5pY2Fs 9115 -IFJ5YW4= 9116 -IEZsb3JpZGE= 9117 -IFRhaw== 9118 -IGFueGlldHk= 9119 -YnJv 9120 -IGNpcmN1bXN0YW5jZXM= 9121 -INmD 9122 -IGV4aXN0ZW5jZQ== 9123 -IHRvbmc= 9124 -IDIwMTI= 9125 -IFNlY3JldGFyeQ== 9126 -IHNwaWN5 9127 -IFso 9128 -IFdpdGhvdXQ= 9129 -IGZhY3Rz 9130 -IHRvbnM= 9131 -QXBw 9132 -IFN0YW5k 9133 -IGxpZXM= 9134 -IEFE 9135 -d2lu 9136 -z4TOtQ== 9137 -YXBwbGF1c2U= 9138 -SVA= 9139 -c3Rh 9140 -IFN1cA== 9141 -cGhvbmVz 9142 -npE= 9143 -cGll 9144 -IFBvdA== 9145 -IE5P 9146 -6LW3 9147 -INee 9148 -INCU0LA= 9149 -aWNhcw== 9150 -IEly 9151 -IHB1c2hlZA== 9152 -IHVuY2xl 9153 -INmF2YY= 9154 -IGxvbg== 9155 -IHByaW5jaXBsZXM= 9156 -IEludGVybmF0aW9uYWw= 9157 -IMOW 9158 -xb4= 9159 -IHNheWE= 9160 -IOqzoA== 9161 -IHJpYg== 9162 -IHBhc3Rl 9163 -IHdhcm5pbmc= 9164 -IG11c2ljYWw= 9165 -IGFncmVlZA== 9166 -0L7RgNC8 9167 -IGdhcmxpYw== 9168 -IG94eWdlbg== 9169 -7JiI 9170 -QWw= 9171 -IOunng== 9172 -ZWxpbmVz 9173 -TEFVU0U= 9174 -576O 9175 -Z3lwdA== 9176 -R0U= 9177 -Y2tlcg== 9178 -dHU= 9179 -IHNoZWw= 9180 -IHN0YXllZA== 9181 -INCz0L7QtA== 9182 -IGxhcHQ= 9183 -IE1hcnRpbg== 9184 -IGludml0ZWQ= 9185 -IGNvbmZpcg== 9186 -IGVtYmFycmFzcw== 9187 -YWNpb25lcw== 9188 -IENhbXA= 9189 -IGhvbGRz 9190 -YXh5 9191 -IGRpdmU= 9192 -dWNrbGVz 9193 -IGJvb3N0 9194 -IHfDvHI= 9195 -c3RhbA== 9196 -INGA0LDQsdC+0YI= 9197 -IGTDqWM= 9198 -IG9mZmljZXJz 9199 -IOyVhOs= 9200 -b2xvZ2lzdA== 9201 -157X 9202 -IHNlZWRz 9203 -IGJ1ZmY= 9204 -IHVwZGF0ZXM= 9205 -44KP 9206 -ZGVk 9207 -IGZyaWVuZGx5 9208 -IGNvdW5jaWw= 9209 -IFByb2JhYmx5 9210 -IHBpYW5v 9211 -IHJlZHVjZWQ= 9212 -z4TOsQ== 9213 -IGF1dGhlbnQ= 9214 -IGV4cGxvcw== 9215 -cGFzcw== 9216 -IEhpdA== 9217 -anVk 9218 -IE5hdg== 9219 -b21p 9220 -IGNvbW1pc3Npb24= 9221 -IGd5bQ== 9222 -0J8= 9223 -IHBvbg== 9224 -0YDQvtGB 9225 -IGludGVyZmFjZQ== 9226 -IHN0cnVjdHVyZXM= 9227 -IEplbg== 9228 -IHlvaw== 9229 -IG1ldQ== 9230 -7KeA66eM 9231 -bmVk 9232 -IFdpZQ== 9233 -IGlkZW50aWZpZWQ= 9234 -IGNoYW5uZWxz 9235 -xLFuYQ== 9236 -IHBoaWxvc29w 9237 -a2VpdA== 9238 -IGJpdHM= 9239 -ZW50ZXM= 9240 -IGZyYWc= 9241 -IEtpbmQ= 9242 -IGRvY2g= 9243 -IHNuZQ== 9244 -aW5kaW5n 9245 -IEpld2lzaA== 9246 -0L7RgNC+0Yg= 9247 -IGZ1ZQ== 9248 -5pa5 9249 -IO2P 9250 -IG3EsQ== 9251 -IGtlaW5l 9252 -IGxvY2F0aW9ucw== 9253 -55So 9254 -IG1ldGVy 9255 -IGJlZWY= 9256 -44GY 9257 -IG1hbmlw 9258 -IHNvbm8= 9259 -enpsZQ== 9260 -57Y= 9261 -IHBlcw== 9262 -IGhvcnJpYmxl 9263 -IFNu 9264 -IGZhY3Rvcnk= 9265 -IGZpZnRo 9266 -IGNvb2tlZA== 9267 -IG1vb2Q= 9268 -IHZlbG9jaXR5 9269 -IG9ibGln 9270 -IGNvbm5lY3Rpb25z 9271 -xJ9pbQ== 9272 -IOqztQ== 9273 -IGRvbWFpbg== 9274 -IGFwcGx5aW5n 9275 -IHJpZGlj 9276 -IGNlbA== 9277 -IGNoaWxkaG9vZA== 9278 -IFRlc3Q= 9279 -cmF0dWxhdGlvbnM= 9280 -IFZpcmdpbg== 9281 -IENFTw== 9282 -INC/0Ls= 9283 -IGFsZ29yaXRobQ== 9284 -IGludGVyYWN0aW9u 9285 -YWdh 9286 -IGtpZGRpbmc= 9287 -IHRvbWF0bw== 9288 -IGNvbnRpbnVpbmc= 9289 -bGFk 9290 -c3RyZWFt 9291 -0L7QttC1 9292 -IOyYgQ== 9293 -0LXQu9C+0LI= 9294 -QkE= 9295 -IG5hcA== 9296 -IE5vYm9keQ== 9297 -IHRodW1i 9298 -IE9O 9299 -IHJ1c2g= 9300 -RFI= 9301 -IHN0cmlrZQ== 9302 -IGV2b2x1dGlvbg== 9303 -aWNoZQ== 9304 -IOy7 9305 -IOq3uOufsA== 9306 -2KfYqg== 9307 -IGFr 9308 -IHdpbmRvd3M= 9309 -IGV4Y2Vzcw== 9310 -44Gq44GE 9311 -IGNvbmNsdWQ= 9312 -IGVwaXNvZGVz 9313 -IHN0cnVnZ2xpbmc= 9314 -IERhdA== 9315 -nbzr 9316 -IGtleXM= 9317 -IGtsZQ== 9318 -5p6c 9319 -IHZlZ2V0YWJsZXM= 9320 -eXN0ZW0= 9321 -w6puY2lh 9322 -cmljaw== 9323 -IHJldmVudWU= 9324 -IEhhdw== 9325 -IGxhbg== 9326 -YW50ZXM= 9327 -aW5peg== 9328 -44GT44KM 9329 -0LjRgdGC 9330 -IHN1cA== 9331 -qbTshJw= 9332 -IG1vbWVudG8= 9333 -aXN0bw== 9334 -44Gk 9335 -IEVyaWM= 9336 -aW9ycw== 9337 -YmFq 9338 -IGludHJvZHVjdGlvbg== 9339 -aXJ0eQ== 9340 -IGRlY2s= 9341 -cmVhbA== 9342 -IE1hcmlv 9343 -IGxvdmluZw== 9344 -4LiU 9345 -IHN1cHBvcnRz 9346 -0LjRh9C10YE= 9347 -IGluY2lkZW50 9348 -dXRjaA== 9349 -dXY= 9350 -IGJvb20= 9351 -0LXRgNGM 9352 -INC90YPQtg== 9353 -IGNvbWJpbmVk 9354 -IExpbg== 9355 -MjM= 9356 -b3JhdGlvbg== 9357 -bnRl 9358 -IHNvcg== 9359 -IGRpcnR5 9360 -aWZlcg== 9361 -IEFQSQ== 9362 -IGNvbGxhYm9yYXRpb24= 9363 -aWFibGU= 9364 -IHByaW9yaXR5 9365 -IEFsZQ== 9366 -IFByaW4= 9367 -IEV4Yw== 9368 -IHZhaXM= 9369 -IGdyYW4= 9370 -IHN0b29k 9371 -IHJlY3J1 9372 -IE11cg== 9373 -ZXNpcw== 9374 -YXNw 9375 -IGxvY2tlZA== 9376 -IFBlcm8= 9377 -IEhhcnJ5 9378 -IHR1ZG8= 9379 -IFRlbg== 9380 -2LU= 9381 -Zm9yY2VtZW50 9382 -KSk= 9383 -b2xp 9384 -IOyduA== 9385 -IHN1cHBs 9386 -IGNyb2NoZXQ= 9387 -IHBoZW5vbWVu 9388 -bG9z 9389 -YXRoYW4= 9390 -IFN1cHA= 9391 -IGVtYnI= 9392 -IGJlaw== 9393 -IFplaXQ= 9394 -Z2VuZA== 9395 -IHJvb21z 9396 -qr0= 9397 -VkVS 9398 -bnljaA== 9399 -IGRvbnQ= 9400 -IGNhYmlu 9401 -IGFjY291bnRz 9402 -IEVhc3Rlcg== 9403 -15XXnA== 9404 -44Or 9405 -IGZhY2lsaXRpZXM= 9406 -YmVpdA== 9407 -IGxpbmtlZA== 9408 -IEdlcg== 9409 -IHByb2dyYW1taW5n 9410 -b3RpYw== 9411 -IGRyYW1h 9412 -IDI5 9413 -IO2B 9414 -IGluc3RydWN0aW9ucw== 9415 -IGltcG9ydGFudGU= 9416 -IHdhdmVz 9417 -IGFpZA== 9418 -Q0s= 9419 -6rKg7Iq164uI64uk 9420 -IE1pcg== 9421 -IHRpZA== 9422 -IEhvdA== 9423 -IGFycmFuZ2U= 9424 -IEJhYnk= 9425 -IHRhY2s= 9426 -INGJ 9427 -7Z0= 9428 -IHZlcnRpY2Fs 9429 -IGhlZWw= 9430 -IEN1dA== 9431 -IG5hcnJvdw== 9432 -IEFyaQ== 9433 -IGtuZWU= 9434 -IEJyYXppbA== 9435 -IEZpdmU= 9436 -IHBvc3RlZA== 9437 -VUQ= 9438 -IHJvbGxpbmc= 9439 -zrg= 9440 -IGNsYWltcw== 9441 -IElucw== 9442 -T0s= 9443 -44GE44GG 9444 -dWlu 9445 -IEluc3RpdHV0ZQ== 9446 -IGludGVuc2U= 9447 -aWFy 9448 -IE5pY2s= 9449 -IHNlbGVjdGlvbg== 9450 -IGxlZ2VuZA== 9451 -IHVuaWZvcm0= 9452 -w7pu 9453 -IHN0dWRpZWQ= 9454 -5aSq 9455 -INCl 9456 -IOyVjA== 9457 -Z2Vycw== 9458 -IGRvdw== 9459 -IENT 9460 -IGFnZW50 9461 -IEF1Zg== 9462 -6Ka6 9463 -IGpvZw== 9464 -IGFpcmNyYWZ0 9465 -64uY 9466 -IHZpdA== 9467 -dWxz 9468 -IHNlZ21lbnQ= 9469 -IG9yZGVycw== 9470 -IENsYXNz 9471 -IGFwb2xvZw== 9472 -IHBsYXRmb3Jtcw== 9473 -IG15dGg= 9474 -0LDQttC1 9475 -IEJvb2s= 9476 -IHNlbnNpdGl2ZQ== 9477 -INC/0L7Qu9GD0Yc= 9478 -IGRhbWl0 9479 -IENhcHQ= 9480 -c29sZQ== 9481 -IGFyY2hpdGVjdHVyZQ== 9482 -IFdpbA== 9483 -IGluaGVy 9484 -Y2Fw 9485 -IEJveQ== 9486 -5qyh 9487 -IGJ1cm5pbmc= 9488 -IFB1YmxpYw== 9489 -IGJlaGFsZg== 9490 -IOychA== 9491 -IHRoZXJhcHk= 9492 -dWJzY3JpYmU= 9493 -IGludm9sdmU= 9494 -IGV4cG9zZWQ= 9495 -acWf 9496 -5Lus 9497 -w6p0cmU= 9498 -IHRvaWw= 9499 -IHNpbms= 9500 -cGly 9501 -5YM= 9502 -SUk= 9503 -IGFnZW5jaWVz 9504 -IHE= 9505 -IERvd24= 9506 -YXVm 9507 -IOunmw== 9508 -44O744O7 9509 -IHByb2M= 9510 -b2tlZA== 9511 -IHN0b3Jlcw== 9512 -cG93ZXI= 9513 -IFRoaW5ncw== 9514 -IGFjY2Vzc2libGU= 9515 -IHRlxbw= 9516 -IEVkdWM= 9517 -IHNwZWFrZXJz 9518 -IFNhcmFo 9519 -lJQ= 9520 -IGRpdmVyc2U= 9521 -7J6W 9522 -IFVsdA== 9523 -w6B5 9524 -IENoaWNhZ28= 9525 -U2hl 9526 -YXRoeQ== 9527 -IGVuYWJsZQ== 9528 -IHRyYWRpbmc= 9529 -IG11c2NsZXM= 9530 -5ps= 9531 -IENhcmU= 9532 -IFVy 9533 -IFNjb3Q= 9534 -IHBocmFzZQ== 9535 -RU5U 9536 -IOqyvQ== 9537 -IEphYw== 9538 -cGFjaw== 9539 -IGRldGVybWluZWQ= 9540 -w7xuZA== 9541 -IG5lZ290aQ== 9542 -IHZpZMOp 9543 -IHJveg== 9544 -IFN1cw== 9545 -IHJpZGluZw== 9546 -aG1lbg== 9547 -IERlZg== 9548 -IENyZQ== 9549 -44K5 9550 -IFdhbGw= 9551 -aWdhbg== 9552 -IHNlbXByZQ== 9553 -0ZbQtA== 9554 -IGRyaXZlbg== 9555 -IGZvb3RhZ2U= 9556 -IGZvbmQ= 9557 -IFdheQ== 9558 -w6Rt 9559 -IE9iYW1h 9560 -IFNlcnZpY2U= 9561 -IDc1 9562 -IERhcms= 9563 -IOq3vOs= 9564 -IENhdA== 9565 -2Lc= 9566 -6Yw= 9567 -IGp1Zw== 9568 -IGV0d2Fz 9569 -IGJyZWF0aGluZw== 9570 -4buD 9571 -5YW2 9572 -IFdlYg== 9573 -5LmL 9574 -6LWw 9575 -IGZvaXM= 9576 -IGxpZ2h0aW5n 9577 -IERB 9578 -IG9ic3Q= 9579 -IGxldXI= 9580 -54++ 9581 -IEVneXB0 9582 -IEFybXk= 9583 -aWNpZGU= 9584 -0LDRgtC4 9585 -IOuLpOs= 9586 -IGFwYXJ0bWVudA== 9587 -IGNoaWVm 9588 -IFdlZA== 9589 -IG5ldHdvcmtz 9590 -IGJhdHQ= 9591 -5rg= 9592 -IEx1Yw== 9593 -IG5pY2VseQ== 9594 -IHZlcmI= 9595 -4Li0 9596 -7LY= 9597 -b3NpdA== 9598 -IHJldmVhbGVk 9599 -IHRhdA== 9600 -IHRpZWQ= 9601 -4buB 9602 -IGFuaW1hdGlvbg== 9603 -IHJvbGVz 9604 -7Iqk7Q== 9605 -IHZlcnNpb25z 9606 -0YfQuNGC 9607 -IHRhc2tz 9608 -r7w= 9609 -IHJlc2M= 9610 -c2hl 9611 -IGxvb3Nl 9612 -IGPhuw== 9613 -IGNvaXNh 9614 -IGFsZXJ0 9615 -IG5pbg== 9616 -IFNBTQ== 9617 -IHRyYWJhag== 9618 -aXJ1cw== 9619 -VEg= 9620 -xqE= 9621 -b2dldGhlcg== 9622 -IFRhaQ== 9623 -IGZpZ3VyZXM= 9624 -INeQ16o= 9625 -IGNyZWVw 9626 -IGludmVzdGlnYXRpb24= 9627 -IHJlY29tbWVuZGVk 9628 -IEFr 9629 -IHJlc2lkZW50cw== 9630 -0YHRgtCy0L4= 9631 -c2VjdA== 9632 -0LDQvdC40LU= 9633 -IG1pbmRz 9634 -dWluZw== 9635 -5bE= 9636 -b3dpbmc= 9637 -IG5vZw== 9638 -IHJheg== 9639 -2KfYsQ== 9640 -IHF1b3Q= 9641 -INC40YU= 9642 -IHNlZA== 9643 -IGFwcGxhdWQ= 9644 -IGNvdmVyYWdl 9645 -dm9s 9646 -IFJlYw== 9647 -xJs= 9648 -INCy0YHRkQ== 9649 -IGV4cGVjdGluZw== 9650 -IG9wZXJhdGU= 9651 -IGNvbnZlcg== 9652 -IFN1Y2g= 9653 -IFJhZA== 9654 -IFByaW1l 9655 -IHB1cnBsZQ== 9656 -IDIwMTA= 9657 -IOyViOs= 9658 -IGV4ZW0= 9659 -IGNvbXBhcmlzb24= 9660 -IGxhbmRzY2FwZQ== 9661 -IG5laXRoZXI= 9662 -IEVo 9663 -64U= 9664 -IHN0b21hY2g= 9665 -IGNhc28= 9666 -w6Ju 9667 -IHBlcmNlbnRhZ2U= 9668 -d2ljaA== 9669 -aXRhbg== 9670 -IGts 9671 -IGV4cGFucw== 9672 -INin2YTZhQ== 9673 -IG9jY2FzaW9u 9674 -cmV0cw== 9675 -aWduaW5n 9676 -IGtpbG9tZXQ= 9677 -6Lef 9678 -IGd1c3Q= 9679 -Y3pl 9680 -IHVyYmFu 9681 -IGFncmlj 9682 -IGFzc2lzdGFuY2U= 9683 -IHN1cmY= 9684 -aW1ldGVy 9685 -IHBldGl0 9686 -IGFzc2Vzc21lbnQ= 9687 -IG1hbnVhbA== 9688 -IGltcHJvdmVk 9689 -YnN0 9690 -IHBpbG90 9691 -IE1hcnM= 9692 -IHZpZWxl 9693 -IENvbmdyYXR1bGF0aW9ucw== 9694 -IGFyZ3Vl 9695 -IHdpcmtsaWNo 9696 -IGNsaWNraW5n 9697 -UklT 9698 -IGxvZ28= 9699 -IG91dGNvbWU= 9700 -IENlbnRyYWw= 9701 -IEpp 9702 -IGdhbWluZw== 9703 -IGNvbnNlcnY= 9704 -IHVsdGltYXRl 9705 -IFZl 9706 -IFdhbA== 9707 -YXJv 9708 -5oSf 9709 -c3Rhcg== 9710 -IGNvbnN1bWVy 9711 -IHRyYXZlbGluZw== 9712 -aW1lcg== 9713 -IDEwMDA= 9714 -0L3QuNC6 9715 -IHByaW5jaXBhbA== 9716 -IHNha2U= 9717 -0ZbQsg== 9718 -IG1vdXNl 9719 -YXJpb3M= 9720 -IHJlbGF0aW9u 9721 -6Ieq 9722 -IG1vcmFs 9723 -5ZWm 9724 -IHRoZXRh 9725 -d3k= 9726 -IGthbQ== 9727 -IGVpZw== 9728 -IGdvbGRlbg== 9729 -16Q= 9730 -IGFtcGw= 9731 -IHZ1 9732 -c3Ry 9733 -cm9ycw== 9734 -IHdoZXJlYXM= 9735 -aXphcg== 9736 -IGFkbWluaXN0cg== 9737 -IG7Ds3M= 9738 -IFByZXQ= 9739 -IEFjYWQ= 9740 -YW5naW5n 9741 -YmFnZQ== 9742 -w6l0YWl0 9743 -dXJp 9744 -IGhlYWxpbmc= 9745 -IHRpcG8= 9746 -IG1hcnJ5 9747 -0YPQsg== 9748 -IGVzdGF0ZQ== 9749 -dXU= 9750 -7JQ= 9751 -IEJlc3Q= 9752 -IHN1ZmZlcg== 9753 -IDE5NA== 9754 -IGJhY3Rlcg== 9755 -INCS0L7Rgg== 9756 -IE9t 9757 -IGR6 9758 -6LY= 9759 -7KY= 9760 -IG9sZHU= 9761 -IHBoeXNpY2FsbHk= 9762 -IExvdWlz 9763 -ZXRpbWU= 9764 -Y2FzZQ== 9765 -IHBpZXI= 9766 -7KCc 9767 -dmFu 9768 -IGFzc2V0cw== 9769 -IOuB 9770 -dmV0 9771 -0LjQsQ== 9772 -IHByb21vdGU= 9773 -IGNvbmdyYXQ= 9774 -dWVzZGF5 9775 -IGR1dHk= 9776 -IFZpZGVv 9777 -2K4= 9778 -IEpvaG5zb24= 9779 -a3Rpb24= 9780 -IFZvY8Oq 9781 -44CL 9782 -IGFp 9783 -IGFubnVhbA== 9784 -IEpvc2g= 9785 -aXR0ZQ== 9786 -IEpP 9787 -IHNsaWRlcw== 9788 -IGFuYw== 9789 -uYQ= 9790 -dGVlbg== 9791 -IGNhcnJ5aW5n 9792 -bHltcA== 9793 -ZWRpbmc= 9794 -IGZybw== 9795 -IGFkbWl0 9796 -cmVy 9797 -IG9mZmljaWFscw== 9798 -cHRpb25z 9799 -Z2Fs 9800 -IGhldXRl 9801 -IHZvaWNlcw== 9802 -IGJhbGxz 9803 -IGd1ZXN0cw== 9804 -YW5uZXI= 9805 -44CK 9806 -aXNoZXI= 9807 -IE1S 9808 -IFJpY2hhcmQ= 9809 -IHJvdWdobHk= 9810 -bMSx 9811 -IHZpY3Rvcnk= 9812 -IGFsZ3Vu 9813 -IE1ycw== 9814 -xZtjaWU= 9815 -IFVr 9816 -IGV5 9817 -IFdhcnM= 9818 -IGJyYW5jaA== 9819 -YXN0eQ== 9820 -IFByaW5jZQ== 9821 -0LXQutGC 9822 -IHJlY29nbml6ZWQ= 9823 -IG11Y2hv 9824 -IExlYXZl 9825 -Y29ubmVjdA== 9826 -IHNwZWxs 9827 -IHRvdWNoZWQ= 9828 -IGFnZW5kYQ== 9829 -6L4= 9830 -YXJpYQ== 9831 -IEtvbmc= 9832 -b2dh 9833 -IHBhcmFtZXRlcnM= 9834 -64uk6w== 9835 -IGluc3RhbnQ= 9836 -IHJlZ3Vs 9837 -Q29u 9838 -IGVkaXRvcg== 9839 -IERpc3Q= 9840 -IHVua25vd24= 9841 -IHB1bmlzaA== 9842 -IGV4cGVjdGF0aW9ucw== 9843 -IGNyeXB0 9844 -IGRpdmlkZQ== 9845 -YWtlbg== 9846 -IE1lc3M= 9847 -IGh5cGVy 9848 -IFByb2plY3Q= 9849 -aWtp 9850 -IGFnb3Jh 9851 -IGFidXNl 9852 -IGNhdXNpbmc= 9853 -IGNvbnZpbg== 9854 -IExB 9855 -IGNvbmNlbnRyYXRpb24= 9856 -IGJyZWFrcw== 9857 -dXJlcg== 9858 -IGNvbmNyZXRl 9859 -IGZvcm1hbA== 9860 -IGJldGE= 9861 -aXRvcnM= 9862 -IENoYW1w 9863 -IGhlYWRpbmc= 9864 -IEJsbw== 9865 -IHByZW5k 9866 -IFNlbmF0ZQ== 9867 -IGFkdmVudHVyZQ== 9868 -b3Nv 9869 -IG9wZW5z 9870 -IFBMQVlJTkc= 9871 -IFNV 9872 -dXJlbg== 9873 -aWt0 9874 -INC70Y7QsQ== 9875 -IEZvbGxvdw== 9876 -IEJpZGVu 9877 -ZWxu 9878 -IFNreQ== 9879 -ZXRpbmc= 9880 -IEV4dA== 9881 -0L3Rg9GO 9882 -IOyZnA== 9883 -IHNocg== 9884 -ZWxsYQ== 9885 -IERpdg== 9886 -IHRyYW5zZm9ybWF0aW9u 9887 -IGhvdXNlaG9sZA== 9888 -ZXRyeQ== 9889 -6KE= 9890 -IERlc3A= 9891 -IGNvdXJhZ2U= 9892 -IHBhcmtpbmc= 9893 -IGV0dMOk 9894 -Y2Fs 9895 -bHlu 9896 -IGxhaWQ= 9897 -IHRyaWVz 9898 -aXJ0cw== 9899 -aWdh 9900 -IHJlY2FsbA== 9901 -aWZpZXI= 9902 -z4HOsQ== 9903 -IGFhbg== 9904 -IGJ1dHRvbnM= 9905 -IHJlYWNoaW5n 9906 -IOq3vOuNsA== 9907 -IHNwYXJr 9908 -IFNvY2lhbA== 9909 -INC10YnQtQ== 9910 -IGNhbmFs 9911 -IGNyaXRlcg== 9912 -IGt0w7NyeQ== 9913 -IHRlbmVtb3M= 9914 -gqw= 9915 -INC90LXRgg== 9916 -IHR1YmU= 9917 -YWNsZXM= 9918 -0LjRiA== 9919 -IGRlxJ9pbA== 9920 -IHN0YW1w 9921 -IGluZmw= 9922 -IGFob3Jh 9923 -IHRyYWls 9924 -IG1peHR1cmU= 9925 -IFJvbGw= 9926 -IHJvdXRpbmU= 9927 -IGNvdW50eQ== 9928 -IGVuam95aW5n 9929 -0L3QvtGB0YLRjA== 9930 -ZXJlcw== 9931 -IHB1cnBvc2Vz 9932 -IFNhbnRh 9933 -IGJyZWFzdA== 9934 -w6RuZw== 9935 -IHdyaXRlcg== 9936 -5Yw= 9937 -0YDQvg== 9938 -IG5lbQ== 9939 -aWNvcw== 9940 -0LDRgdGC 9941 -IGRldGFpbGVk 9942 -IHJldmVyc2U= 9943 -IFJlYWR5 9944 -IGRpc3RyYWN0 9945 -IEFsb3Jz 9946 -dXR0ZXI= 9947 -IGRlc2VydmU= 9948 -IFJvbg== 9949 -0L3QvtC8 9950 -IG9ic2Vydg== 9951 -IGxvZ2lj 9952 -IFB5 9953 -IEtldmlu 9954 -44Gd44GG 9955 -pbQ= 9956 -2YrZhg== 9957 -IHNrYQ== 9958 -IHRhY3Q= 9959 -IGhvbGlkYXk= 9960 -IGJ1bXA= 9961 -INC80L7Qsw== 9962 -IGRlaXg= 9963 -7YU= 9964 -IHdvcnNoaXA= 9965 -Q2w= 9966 -IHN1Y2s= 9967 -INGB0LXQsQ== 9968 -IGFwcGxhdXNl 9969 -IEVw 9970 -INC80L4= 9971 -IHBhdGNo 9972 -4bqt 9973 -IGxhZGllcw== 9974 -IGJyb2FkY2FzdA== 9975 -IGlsbGVn 9976 -IG5hcnJhdGl2ZQ== 9977 -b3NzYQ== 9978 -QVJSQVRPUg== 9979 -IHNhbmc= 9980 -IG1vdmVtZW50cw== 9981 -IHBhcnRuZXJzaGlw 9982 -IG9yZ2FuaXplZA== 9983 -IG5vZGU= 9984 -ZXN0eWxl 9985 -IE1lZw== 9986 -IGluZHVzdHJpYWw= 9987 -IGdvbA== 9988 -IGJvcmluZw== 9989 -5Yqg 9990 -44GU 9991 -IGN1dHM= 9992 -IHJlY29u 9993 -YXNh 9994 -IGltcHJlc3Npb24= 9995 -7Jq0 9996 -Z2ll 9997 -TUE= 9998 -hrU= 9999 -IGVkaXRpbmc= 10000 -cm9udA== 10001 -IGZvbGxvd3M= 10002 -IEl0YWxpYW4= 10003 -0YDQvtC0 10004 -IOqwmeydgA== 10005 -IOuwqQ== 10006 -IHBhcnRpY2xlcw== 10007 -IEJvYXJk 10008 -15nXqg== 10009 -anVu 10010 -cm9uaWM= 10011 -IGVq 10012 -IM+Ezrc= 10013 -15XXkw== 10014 -Y2lvbg== 10015 -aXR0eQ== 10016 -IFR1ZXNkYXk= 10017 -dW1lcw== 10018 -IFByb3Q= 10019 -ZWRlcg== 10020 -IHBlc3NvYXM= 10021 -INC90L7Qsg== 10022 -IHNraXA= 10023 -IG9iamVjdGl2ZQ== 10024 -w61hcw== 10025 -IGRlc2s= 10026 -IExvb2tz 10027 -dW5kZW4= 10028 -IHByaW1hcmlseQ== 10029 -aW1lbnRv 10030 -IHJlcG9ydGluZw== 10031 -IGhhY2U= 10032 -IGNoZWNrZWQ= 10033 -6Zg= 10034 -IOuztOs= 10035 -IHNtZWxscw== 10036 -IGFjdG9ycw== 10037 -IEFzaWE= 10038 -aWzDoA== 10039 -IHJlY2VpdmluZw== 10040 -IHRheGVz 10041 -IGdyYWNl 10042 -IGNvbXBldGl0aXZl 10043 -IGRpdmlzaW9u 10044 -IGVzcGVy 10045 -IHdoZWVscw== 10046 -IGtvbW10 10047 -IHRyZW1lbmRvdXM= 10048 -IGVzcGU= 10049 -Li4uKQ== 10050 -IOyehQ== 10051 -IGxpc3RlZA== 10052 -w6RsbA== 10053 -IHVudXM= 10054 -IEhvbGx5 10055 -IGd1aWRhbmNl 10056 -IGN1Yg== 10057 -IGludGVsbGVjdA== 10058 -INCx0YvQuw== 10059 -IHJlZ2FyZGxlc3M= 10060 -IFN0YW4= 10061 -5rKh 10062 -IGNvbmNsdXNpb24= 10063 -YWNhxJ8= 10064 -IGxvbA== 10065 -IEJhdA== 10066 -IG1hbmlmZXN0 10067 -IENoaWVm 10068 -IHNoYW1l 10069 -IG91dGNvbWVz 10070 -IG1haWw= 10071 -IGt1cg== 10072 -zrnOug== 10073 -ZXR6 10074 -IHByZXBhcmluZw== 10075 -Mjc= 10076 -IFF1ZWVu 10077 -4K6z 10078 -IOu5hA== 10079 -IHRpc3M= 10080 -IGNvbnNjaW91c25lc3M= 10081 -IHBhbnRz 10082 -IG1lbHQ= 10083 -dWNodA== 10084 -aW5o 10085 -7JuM 10086 -IHZvdHJl 10087 -IG1vZHVsZQ== 10088 -b3d5 10089 -IG1vbnN0ZXI= 10090 -IOuG 10091 -IGVsZWN0cm9uaWM= 10092 -IGNlbnRyZQ== 10093 -IHN0b3Bz 10094 -IHRvdQ== 10095 -IOut 10096 -IGxhbWI= 10097 -IGNvbnNlcXVlbmNlcw== 10098 -IHN0cmF3 10099 -IGltcGVy 10100 -IGV4dGVuZA== 10101 -44Gj44Gf 10102 -IGFuc3dlcmVk 10103 -IE1haA== 10104 -IExBVVJB 10105 -aWZ0aW5n 10106 -dWF0ZQ== 10107 -5YWI 10108 -IFVTQg== 10109 -IEFuZHJldw== 10110 -44Kr 10111 -IEZyZWQ= 10112 -IERF 10113 -IEdlb3Jn 10114 -57s= 10115 -w6xuaA== 10116 -IGRyYXdu 10117 -IGxpcHM= 10118 -Ymly 10119 -IG1heW9y 10120 -aW1p 10121 -IGVuY29yZQ== 10122 -5ZCD 10123 -Zm9ydGFibGU= 10124 -dXJzZGF5 10125 -IEZvcm0= 10126 -IGJsYW1l 10127 -IHNob3dlcg== 10128 -IGNvbnRhaW5lcg== 10129 -c3RlcnM= 10130 -dWRlcw== 10131 -IFRheQ== 10132 -4Lil 10133 -IOyYiA== 10134 -IHZvbQ== 10135 -IGJhc3M= 10136 -IExhYg== 10137 -aXNzYQ== 10138 -IGRpbWVuc2lvbg== 10139 -IGV4ZWN1dGl2ZQ== 10140 -IFJvbQ== 10141 -6rKM7JqU 10142 -IERvY3Rvcg== 10143 -IGRlbGl2ZXJlZA== 10144 -IGdhbmc= 10145 -IGNlcg== 10146 -IHBpdA== 10147 -ZWxp 10148 -IGV4dHJhb3Jk 10149 -amFy 10150 -IGRlcml2 10151 -IGlsbG5lc3M= 10152 -IGd1bnM= 10153 -IDIwMTE= 10154 -IGFpcnBvcnQ= 10155 -0JU= 10156 -IGF0dGl0dWRl 10157 -IGdyYXQ= 10158 -IFdy 10159 -IE5BUlJBVE9S 10160 -IOyalA== 10161 -IHJlbmV3 10162 -IGNvc2E= 10163 -IGNvbnRyb2xsZWQ= 10164 -b21teQ== 10165 -b25kcw== 10166 -IGVzZQ== 10167 -w6RjaA== 10168 -IHZlbmQ= 10169 -ZGFt 10170 -IGFyZ3U= 10171 -IGFjY2VsZXI= 10172 -IG5haWw= 10173 -aWVuZQ== 10174 -7IOd 10175 -IGVuY29udA== 10176 -ZXNlYXJjaA== 10177 -6aE= 10178 -IGdvb2Rz 10179 -IGZpc2hpbmc= 10180 -QVBQTEFVU0U= 10181 -IE5BUw== 10182 -ZWN0aW9u 10183 -IHRlbXBsZQ== 10184 -bGljaGU= 10185 -IGtleWJvYXJk 10186 -562J 10187 -IGRlc2Rl 10188 -IGVkdWNhdGlvbmFs 10189 -IE5pZ2h0 10190 -MzM= 10191 -IGJyZWF0aGU= 10192 -bGljaGVu 10193 -dGht 10194 -acOocmU= 10195 -4Lia 10196 -bGFyxLE= 10197 -IGFsaQ== 10198 -IGNvbXBvcw== 10199 -IHNlbnNvcg== 10200 -IOu2gOs= 10201 -IG5ld3Nw 10202 -IEJ1bmQ= 10203 -IE1p 10204 -IHBlcmZvcm1pbmc= 10205 -IGRydW0= 10206 -QkU= 10207 -IHBvcms= 10208 -IGNvYWw= 10209 -ZW5nZXI= 10210 -IHJhbQ== 10211 -IOuyiA== 10212 -54S25b6M 10213 -0LjRgNC+0LI= 10214 -IFBvcA== 10215 -IHBob25lcw== 10216 -IGZhY2ls 10217 -IHRyYWNrcw== 10218 -b250ZQ== 10219 -IG9yZ2FuaWM= 10220 -IGRpYWxvZ3Vl 10221 -IEhhdmluZw== 10222 -IFBvc3Q= 10223 -IHBheW1lbnQ= 10224 -IGFycmF5 10225 -IGludGVuZGVk 10226 -w7pz 10227 -IGJhcnM= 10228 -IHJldmlld3M= 10229 -bGFuZHM= 10230 -IGtpbmdkb20= 10231 -IHN0YWdlcw== 10232 -IG1vdW50YWlucw== 10233 -IGR1bg== 10234 -IGRlY2ly 10235 -xI0= 10236 -IGJhbmtz 10237 -IHRocm93aW5n 10238 -IOuquw== 10239 -IGFuZ2Vy 10240 -INGB0LXQudGH0LDRgQ== 10241 -IGRpc3R1cg== 10242 -IGh1bWFuaXR5 10243 -IGVsZXM= 10244 -IHNob3VsZGVycw== 10245 -IFBlcmZlY3Q= 10246 -IGZhbmN5 10247 -IGJyaWxsaWFudA== 10248 -IGluc3BpcmF0aW9u 10249 -aG1t 10250 -5b+r 10251 -IGxpZA== 10252 -VUw= 10253 -IG3DpQ== 10254 -aW5kaQ== 10255 -6Ig= 10256 -IHNoaWVsZA== 10257 -IOyYpOs= 10258 -Q1Q= 10259 -YWdpbmU= 10260 -dWJlcg== 10261 -IEJS 10262 -IHF1ZXN0bw== 10263 -INC30LDQug== 10264 -IEtub3c= 10265 -IHRhbmc= 10266 -7ZWp64uI64uk 10267 -IGJhcmVseQ== 10268 -IFNF 10269 -IG1hcmdpbg== 10270 -cmVp 10271 -0LDRgtC10LvRjA== 10272 -IGNvbnRy 10273 -IHbDoA== 10274 -IGxlZ2l0 10275 -0Jg= 10276 -a2lucw== 10277 -0YDQtdC0 10278 -IEFzaA== 10279 -IGFkdmlz 10280 -IEdyZWVr 10281 -0YPQug== 10282 -IHNoYWtl 10283 -aWRhZGVz 10284 -0LDRgdGM 10285 -IGNvbnZlbnRpb24= 10286 -IGNvbnRlc3Q= 10287 -TVM= 10288 -IFllYXI= 10289 -IHJlcHJlc2VudGF0aW9u 10290 -aW5kZW4= 10291 -ZW5kYXI= 10292 -IHByb3N0 10293 -IEh1bWFu 10294 -IEN5 10295 -YW5nZWQ= 10296 -UEE= 10297 -IGF4aXM= 10298 -IHRoZW9yZQ== 10299 -YXR6 10300 -IO2VmOqzoA== 10301 -IGVscw== 10302 -IFJlc2VhcmNo 10303 -IGJlbmVmaWM= 10304 -IGRlbnNpdHk= 10305 -aW5kbw== 10306 -7Jy8 10307 -aW1kaQ== 10308 -IHJlc2VhcmNoZXJz 10309 -6rGw65Og 10310 -aWdocw== 10311 -ZGFu 10312 -IGRpY2U= 10313 -IG1hYXI= 10314 -IHN1Ym1pdA== 10315 -IGR1bWI= 10316 -IGJpag== 10317 -YXdheQ== 10318 -IFBhc3M= 10319 -IGV4dGVuc2lvbg== 10320 -IGNydXNo 10321 -IGNvdmVyaW5n 10322 -ZWRp 10323 -Ym9ybg== 10324 -aW5hdGlvbnM= 10325 -INGB0LTQtdC7 10326 -0LLQtdGA 10327 -IE90aGVyd2lzZQ== 10328 -aXN0YW50 10329 -0LDQudGC0LU= 10330 -IHRhbnRv 10331 -IHBlcmZvcm1lZA== 10332 -INC30LDQvw== 10333 -YWxv 10334 -IEZvdW5kYXRpb24= 10335 -IHByb3RvY29s 10336 -IFpv 10337 -bWF5 10338 -IGhhY2s= 10339 -IGJ1ZGR5 10340 -bWFkZQ== 10341 -IGFkcw== 10342 -IGZhc2NpbmF0aW5n 10343 -IGVxdWl2YWxlbnQ= 10344 -Z2Vs 10345 -IGFyYw== 10346 -INGH0LXQu9C+0LI= 10347 -IHByb3Bvc2Vk 10348 -IG5vdHJl 10349 -YW5nZXM= 10350 -IGNvdW5zZWw= 10351 -YWxsYQ== 10352 -IDMx 10353 -d2VldA== 10354 -yJk= 10355 -IGVsZWN0cmljaXR5 10356 -IHRveA== 10357 -xYJhZA== 10358 -IOy0 10359 -IGRpZmZpY3VsdHk= 10360 -oNeZ 10361 -bmVzZGF5 10362 -0LjRgdGM 10363 -IGFsbGVn 10364 -IEdP 10365 -IHF1aXQ= 10366 -IEhlcnI= 10367 -IGVzdMOhbg== 10368 -IGdpcmxmcmllbmQ= 10369 -IHRlbmc= 10370 -aWZpY2lhbA== 10371 -IEphbQ== 10372 -IGNhbmNlbA== 10373 -IGZyZXF1ZW50bHk= 10374 -SVY= 10375 -5a+m 10376 -IGNsb3Npbmc= 10377 -IGRlY2FkZQ== 10378 -IHJlcHJlc2VudGVk 10379 -IENhbmFk 10380 -INC60L7RgtC+0YDRi9C1 10381 -IGVzdGFtb3M= 10382 -IFRodXJzZGF5 10383 -IEdh 10384 -IExpdmU= 10385 -bGVt 10386 -YmJsZQ== 10387 -U09O 10388 -IDIwMDg= 10389 -IGRpY2g= 10390 -IEF3ZXNvbWU= 10391 -IGNvbmNlcHRz 10392 -UEVBSw== 10393 -IGxpdGVyYXR1cmU= 10394 -IE9seW1w 10395 -0LvQsNC0 10396 -IG5vc3Q= 10397 -dml0 10398 -IEVudGVy 10399 -b3JkZXJz 10400 -aWNraW5n 10401 -bmllag== 10402 -IGV1Y2g= 10403 -IFRob3VnaA== 10404 -IGJhZ3M= 10405 -IGxpbWl0cw== 10406 -IHN0YWtl 10407 -g6U= 10408 -IG9j 10409 -IFZpcw== 10410 -IDEyMA== 10411 -IG51ZQ== 10412 -IGNvbmNl 10413 -IGRpc2Fn 10414 -56g= 10415 -IGFudGljaXA= 10416 -oIg= 10417 -c2w= 10418 -IHZvdGluZw== 10419 -IGV4cG9zdXJl 10420 -IENvbW11bml0eQ== 10421 -IEp1c3RpY2U= 10422 -b3JuZXk= 10423 -c3p5c3Q= 10424 -IGZyaWVk 10425 -7Iuc6w== 10426 -IFdpbg== 10427 -IEA= 10428 -IEhvcGVmdWxseQ== 10429 -ZXN6 10430 -IG1vbmRl 10431 -IGNvbWJpbmU= 10432 -Z21lbnQ= 10433 -IHJlY29tbWVuZGF0aW9ucw== 10434 -IHByZWduYW50 10435 -7Iud 10436 -cmFm 10437 -IGx1 10438 -6ICB 10439 -5LuA5LmI 10440 -ZG9vcg== 10441 -0LDQt9GL0LI= 10442 -dWVnbw== 10443 -IGltcHJvdmVtZW50 10444 -IHRyaW0= 10445 -IGVpZ2Vu 10446 -IGFwcHJveGltYXRlbHk= 10447 -INCy0LDQvA== 10448 -YXdh 10449 -INGB0L7QsQ== 10450 -IGNvcm9u 10451 -IG9uZ29pbmc= 10452 -IGhlcw== 10453 -IGluanVyeQ== 10454 -IGZyYW5r 10455 -IGthZGFy 10456 -cmVuY3k= 10457 -IENvbG9y 10458 -IEdydQ== 10459 -IGRpcA== 10460 -0YDRiw== 10461 -IHRlYXJz 10462 -Z3Q= 10463 -IFBE 10464 -IHBhdXNl 10465 -b3Nj 10466 -IHVzdGVk 10467 -IFdvbw== 10468 -IHdpxJk= 10469 -6KaL 10470 -IGRlbm4= 10471 -IFBldA== 10472 -IG92ZXJjb21l 10473 -IOuCtOqwgA== 10474 -IE1vdmU= 10475 -IGxpY2Vuc2U= 10476 -IHJlcGVhdGVk 10477 -4K+H 10478 -IGNhdGVnb3JpZXM= 10479 -IG5vb2RsZXM= 10480 -IGZsb29k 10481 -IE1hc3M= 10482 -IG51dHM= 10483 -IEplc3M= 10484 -IElo 10485 -IGNoYW5jZXM= 10486 -kJg= 10487 -IGRvbmRl 10488 -SUc= 10489 -IGFuZGVyZQ== 10490 -IGJvbmVz 10491 -7J6R 10492 -IGVmZmljaWVuY3k= 10493 -IG1vZGVy 10494 -cm9hdA== 10495 -IOydtOqyjA== 10496 -aWxsZXI= 10497 -IG9tZWdh 10498 -INC/0L7Qsg== 10499 -IEdyb3Vw 10500 -IHByb2R1Y2luZw== 10501 -YW1v 10502 -IHBhcnRpY2lwYW50cw== 10503 -dXBw 10504 -aWZpY2U= 10505 -IGZvcnR1bg== 10506 -aWV0bmFt 10507 -YWNhaw== 10508 -IEtv 10509 -bWnFnw== 10510 -IGphaWw= 10511 -IEpvbmVz 10512 -xZtteQ== 10513 -IERldXRz 10514 -IGJyaWVmbHk= 10515 -IFRhbA== 10516 -IFBlcmhhcHM= 10517 -IFJ1Yg== 10518 -IEtu 10519 -64uk64qU 10520 -csOp 10521 -IHZvY8Oqcw== 10522 -IENoYXJsZXM= 10523 -0LXRgtC1 10524 -cmllcnM= 10525 -IGhlYWw= 10526 -YW50ZWU= 10527 -IGRlbW9jcmFjeQ== 10528 -IGxvYW4= 10529 -IGNoZWY= 10530 -0Y/QvA== 10531 -IHVuY29tZm9ydGFibGU= 10532 -IGV0ZXJu 10533 -YXBwaW5n 10534 -IHJlcGFpcg== 10535 -cm90 10536 -IFRhcg== 10537 -IGNvdmVycw== 10538 -b21pbmc= 10539 -IEV0aA== 10540 -IM6t 10541 -0YfQvdC+ 10542 -IGFmdGVyd2FyZHM= 10543 -INCy0LXRgA== 10544 -IGRhaGE= 10545 -IGtuZWVz 10546 -IG9yZGluYXJ5 10547 -w7xs 10548 -Z2Fz 10549 -IHRpY2tldA== 10550 -IOyggOuKlA== 10551 -IOyeiOyKteuLiOuLpA== 10552 -Y2h0ZQ== 10553 -TXI= 10554 -IHNpc3Q= 10555 -aHVp 10556 -6re46w== 10557 -7Jes 10558 -IHZhcnk= 10559 -IG1lbW9y 10560 -IGNvbnRyb2xsZXI= 10561 -IGLEmWR6aWU= 10562 -IG1pbmlzdGVy 10563 -15I= 10564 -Zmxvdw== 10565 -QUg= 10566 -IHRvd2Vy 10567 -55A= 10568 -IHNjYXI= 10569 -5oOF 10570 -IFBlbg== 10571 -IHBhw61z 10572 -15g= 10573 -7J246w== 10574 -IGVuZXJn 10575 -IHN3b3Jk 10576 -IHBhcGVycw== 10577 -0LjQu9Cw 10578 -IFdlZG5lc2RheQ== 10579 -IEZvcmNl 10580 -IGV4dHJhb3JkaW5hcnk= 10581 -IExha2U= 10582 -IOqwgOs= 10583 -IEJlYXV0 10584 -IHJlYXNvbmFibGU= 10585 -IGNvbnRyaWJ1dGU= 10586 -IHBsZWFzZWQ= 10587 -IHVwZGF0ZWQ= 10588 -IHBpw7k= 10589 -ZWxv 10590 -IHNpZ25pZmljYW50bHk= 10591 -IGJvdA== 10592 -IGdlbmVyYXRpb25z 10593 -IHByb3RlY3RlZA== 10594 -5ZOI 10595 -IGhpZGluZw== 10596 -IElsbA== 10597 -IG5ldXRyYWw= 10598 -XSw= 10599 -z4TOvw== 10600 -IHRvbmd1ZQ== 10601 -VGhhbms= 10602 -IOqzhA== 10603 -IHBheXM= 10604 -zq/OvQ== 10605 -IGFwcGxl 10606 -MDE= 10607 -ZXJr 10608 -aWVyYQ== 10609 -IGplZw== 10610 -IFN1YnNjcmliZQ== 10611 -IHRoZWF0ZXI= 10612 -IHN0cm9uZ2x5 10613 -IOyGjA== 10614 -INC/0YDQsNCy 10615 -dWNreQ== 10616 -IEppbg== 10617 -a3dhcmQ= 10618 -6rG0 10619 -IG9wcG9uZW50 10620 -IFNP 10621 -IGhvbHk= 10622 -IGZpbGxpbmc= 10623 -Ol0= 10624 -IGhpag== 10625 -0Jw= 10626 -IGJpc3M= 10627 -IGJsZW5k 10628 -IGltcGxpYw== 10629 -IOy9 10630 -bGxlaWNodA== 10631 -2YrYqQ== 10632 -YXNhbnQ= 10633 -ZXJ0ZQ== 10634 -IFNhbWU= 10635 -IGludGVyaW9y 10636 -U2U= 10637 -IGJlbmNo 10638 -IHBvY28= 10639 -IG1hcmtz 10640 -IHdpbnM= 10641 -5ZaU 10642 -IM6z 10643 -IGRpc3RpbmN0 10644 -IEFzaWFu 10645 -IG1vbGVj 10646 -IEphY2tzb24= 10647 -IGVhc3Q= 10648 -IHBoeXNpY3M= 10649 -aW1hbA== 10650 -IHBlYWs= 10651 -YXJpYW4= 10652 -ZXBz 10653 -IG5lYXQ= 10654 -INCy0LDRgQ== 10655 -dXJuaW5n 10656 -IHN5bnRo 10657 -IHJldmVhbA== 10658 -xbo= 10659 -Z29u 10660 -bmlz 10661 -YXRpdg== 10662 -IExhcw== 10663 -IHB5 10664 -IE1hamVzdHk= 10665 -IFZhbGxleQ== 10666 -IGVuZg== 10667 -IGdlbnM= 10668 -IHJvb3Rz 10669 -ZXpl 10670 -YmV0 10671 -IGFjdHM= 10672 -6Zo= 10673 -6JA= 10674 -IHBoaWxvc29waHk= 10675 -IG1hdGNoZXM= 10676 -nWk= 10677 -IGp1xbw= 10678 -IGRlc3Blcg== 10679 -IEVkdWNhdGlvbg== 10680 -IHNwb3Rz 10681 -IHJlZ2lvbnM= 10682 -QXI= 10683 -IE5hbQ== 10684 -ZWVu 10685 -IGRpYWdyYW0= 10686 -IHJlbHk= 10687 -IHRlbnM= 10688 -IGRhdGluZw== 10689 -IGNvYXQ= 10690 -IEhvcg== 10691 -IGFja25vd2xlZGdl 10692 -IFByZXR0eQ== 10693 -INC/0L7Qvw== 10694 -IHZvaXI= 10695 -IGZhdm91cml0ZQ== 10696 -IG1vxbw= 10697 -IGtt 10698 -IERP 10699 -IGZlcnQ= 10700 -IOuPhA== 10701 -IFBhYw== 10702 -IGZvbnQ= 10703 -IGZpbmRz 10704 -IEl0YWx5 10705 -INC60L7Quw== 10706 -IGNvbXBhc3M= 10707 -67M= 10708 -bGlhbWVudA== 10709 -IG5vdGlvbg== 10710 -IGluamVjdA== 10711 -IHdpc2RvbQ== 10712 -IMOc 10713 -IE1vb24= 10714 -IEJ1c2luZXNz 10715 -cmljcw== 10716 -IFlvdXQ= 10717 -IGZvcmdpdmU= 10718 -IGZpbmFuY2U= 10719 -aWxv 10720 -2KM= 10721 -YWhs 10722 -IGRlbW8= 10723 -IGNsaW1i 10724 -IGV4cG9ydA== 10725 -5aA= 10726 -IHN1Y2Nlc3NmdWxseQ== 10727 -IEZlcg== 10728 -cGVjdGVk 10729 -ZGVt 10730 -IHJldGlyZQ== 10731 -IGxhcHRvcA== 10732 -IHNwaXI= 10733 -IEFzc29jaWF0aW9u 10734 -INCz0Ls= 10735 -IFNlbA== 10736 -IO2VnOs= 10737 -IGVtcGxveWVl 10738 -IG1vbHQ= 10739 -Ukw= 10740 -0K8= 10741 -IGNvbnRyYQ== 10742 -IHVn 10743 -IEJhbGw= 10744 -IEphdmE= 10745 -w6lyaWU= 10746 -IHByb2NlZHVyZQ== 10747 -IGdyaWQ= 10748 -IOuKkOs= 10749 -IGJlbHQ= 10750 -INGN0YLQvtCz0L4= 10751 -dXJk 10752 -IGNvbXByZWg= 10753 -IGRldmVsb3Blcg== 10754 -INGN0YLQvtC8 10755 -5Zg= 10756 -Y3I= 10757 -IOuT 10758 -IHNwb2tlbg== 10759 -cmVuY2U= 10760 -IHRlcm1pbg== 10761 -IGFnZ3Jlc3NpdmU= 10762 -IGJpc3NjaGVu 10763 -IGhhc3Rh 10764 -IEJyaWFu 10765 -IENvbW1pc3Npb24= 10766 -IFl1 10767 -IHByb21pc2Vk 10768 -IGVxdWl0eQ== 10769 -aWtv 10770 -dmVydHk= 10771 -IHJlcGxhY2Vk 10772 -IEhlbHA= 10773 -IHBvc2U= 10774 -IE1pZGRsZQ== 10775 -IGtpbQ== 10776 -IG1laW4= 10777 -IENvdW5jaWxs 10778 -INCS0YE= 10779 -b3Jv 10780 -IEJlcm4= 10781 -IGJleg== 10782 -IGFuYWx5dA== 10783 -YW5nZW4= 10784 -IOyLtg== 10785 -IEdsbw== 10786 -IHF1YWQ= 10787 -0YLQsA== 10788 -IHNwZWFrcw== 10789 -7JiI7JqU 10790 -IOyXrOufrOs= 10791 -ZnJlZQ== 10792 -0L3Rlg== 10793 -cmljaA== 10794 -IOuvuA== 10795 -IERpZXM= 10796 -YWJi 10797 -pbg= 10798 -IGRlcHJlc3Npb24= 10799 -IHJldGFpbA== 10800 -hOuTpA== 10801 -IFZvdXM= 10802 -IExhdGlu 10803 -4bk= 10804 -IOyii+yVhA== 10805 -IHRvcnQ= 10806 -IGNvbXB1dGVycw== 10807 -IHNlYXJjaGluZw== 10808 -IHR1Yg== 10809 -YXRlbGw= 10810 -IG1lcmM= 10811 -IGdsYXNzZXM= 10812 -cGVyc29u 10813 -IGRpc2hlcw== 10814 -IGd1YXJhbnRlZQ== 10815 -IG1lZw== 10816 -c20= 10817 -IFdhbGs= 10818 -7Jy866m0 10819 -IGZvbGRlcg== 10820 -IE1pdA== 10821 -IHRpbWluZw== 10822 -IGFic3Q= 10823 -IExvZw== 10824 -44Kv 10825 -IGFwcHJvdmVk 10826 -IFVTQQ== 10827 -0LLQtdGC 10828 -IHdpc2U= 10829 -ZXNzZWQ= 10830 -IGRvdWI= 10831 -IHJlc2lkZW50 10832 -IGdlbmVyYXRlZA== 10833 -IHN0YXlz 10834 -IGV4cGxhbmF0aW9u 10835 -IHBvaXNvbg== 10836 -YXRyZQ== 10837 -IGluc2FuZQ== 10838 -IHJlZmVycmVk 10839 -YWlyZXM= 10840 -IFRSQQ== 10841 -IHNlaQ== 10842 -IGlubm9j 10843 -QWg= 10844 -IG1hbnQ= 10845 -aHVz 10846 -IG91dGVy 10847 -Z2Vi 10848 -b2ljZQ== 10849 -IGRpc2N1c3Npbmc= 10850 -IGNvbnZlbmllbnQ= 10851 -X18= 10852 -IGF2b2ly 10853 -IHNoYXBlcw== 10854 -IGdyYXk= 10855 -IGRlbnRybw== 10856 -IG1hY2h0 10857 -IDE5NQ== 10858 -2Y8= 10859 -IGFkZHM= 10860 -dXRpbmc= 10861 -IGNhcGFiaWxpdGllcw== 10862 -IHNlY3Rpb25z 10863 -IHR1bmU= 10864 -IENhdXNl 10865 -YXJkZQ== 10866 -INGB0LrQsNC3 10867 -YXZpcnVz 10868 -IFJF 10869 -IHR1bmVk 10870 -IGxlYWY= 10871 -dGVyaW9y 10872 -IENhcHRhaW4= 10873 -INis 10874 -IGNob29zaW5n 10875 -aGlu 10876 -Z2dpbmc= 10877 -dmlldA== 10878 -IHJlZ3JldA== 10879 -MjY= 10880 -b25kZXJu 10881 -IGJvbnVz 10882 -IFJheQ== 10883 -QXM= 10884 -IHRvcm4= 10885 -IEhpZXI= 10886 -IEVV 10887 -IHJpc2tz 10888 -IGFtYQ== 10889 -IFlldA== 10890 -IGNoYXJhY3RlcmlzdGljcw== 10891 -IOqwkA== 10892 -IFNlbmF0b3I= 10893 -IFZhbW9z 10894 -IHJvc2U= 10895 -IGNvcnBvcmF0ZQ== 10896 -Z2hhbg== 10897 -IGNlbnRlcnM= 10898 -c3RhaXJz 10899 -IG5pdA== 10900 -IHVudXN1YWw= 10901 -IFRvbnk= 10902 -IEdS 10903 -IFdpbGQ= 10904 -IFNpbWlsYXI= 10905 -IHRvZGFz 10906 -5YGa 10907 -IGhvcml6b250 10908 -bWVs 10909 -IHN0cmljdA== 10910 -IGN1YWw= 10911 -IHdyaXQ= 10912 -IGV4dGVuZGVk 10913 -IO2VmOuKlA== 10914 -IHJlbGllZg== 10915 -IG9uaW9u 10916 -IGJhYmllcw== 10917 -IGRpZmVy 10918 -IGludGVncmF0ZWQ= 10919 -w7x6aWs= 10920 -ZXBpbmc= 10921 -LS0tLQ== 10922 -IG1lbnM= 10923 -IHN0cmF0ZWdpYw== 10924 -ZmluaXRlbHk= 10925 -IGVpZ2VudGxpY2g= 10926 -V2hv 10927 -5Zyw 10928 -IHs= 10929 -IOS9oA== 10930 -IFRyaQ== 10931 -IHBvaW50ZWQ= 10932 -8J0= 10933 -bmFtZW50 10934 -0LXRhg== 10935 -IHByaWRl 10936 -IFJlcHVibGljYW4= 10937 -IHNhbXBsZXM= 10938 -IGRvbWVzdGlj 10939 -TFk= 10940 -dmV6 10941 -IHdlYmluYXI= 10942 -2KfZhQ== 10943 -IGVuaA== 10944 -IHN1Z2dlc3RlZA== 10945 -IG1laW5l 10946 -IHB1ZWQ= 10947 -b3Jlbg== 10948 -cmly 10949 -IGhlYXZpbHk= 10950 -IGluc3RydWN0aW9u 10951 -IG1pY3JvcGhvbmU= 10952 -IGlndWFs 10953 -IElyYQ== 10954 -IHZ1bG5lcmFibGU= 10955 -IFZpcmdpbmlh 10956 -IGNvbnRpbnVvdXM= 10957 -IHBvdmVydHk= 10958 -IGJsYWRl 10959 -5LiJ 10960 -IHJlbGF0ZQ== 10961 -IGNhcmE= 10962 -IEdvaW5n 10963 -IHJlZ2lvbmFs 10964 -IEZ1Y2s= 10965 -IHRvdw== 10966 -IE11c2V1bQ== 10967 -cmFudHM= 10968 -INCx0LXQtw== 10969 -bGFpbQ== 10970 -IGNoYW1waW9u 10971 -dGxl 10972 -w61u 10973 -ZW5jaWE= 10974 -IGRpZXNlbQ== 10975 -IERpZw== 10976 -bWF0ZXM= 10977 -IGludmVzdGluZw== 10978 -IEpvcmRhbg== 10979 -IGludGVncmF0aW9u 10980 -IO2O 10981 -4Lir 10982 -ZW5zdXM= 10983 -IEFyY2g= 10984 -IHBlbmNpbA== 10985 -0LDQu9GM0L3Qvg== 10986 -aXNzZW4= 10987 -IEth 10988 -IHJvY2tz 10989 -IHJhdGluZw== 10990 -IHJlZnVnZQ== 10991 -IGFwcg== 10992 -ZXRlZA== 10993 -IGFzc2lzdGFudA== 10994 -IG1lYW5pbmdmdWw= 10995 -IHBlcm1hbmVudA== 10996 -IGhpbGw= 10997 -IHdzenlzdA== 10998 -IHdvdW5k 10999 -IEF0bA== 11000 -IGxha2U= 11001 -IEZvcnQ= 11002 -6Kyd6Kyd 11003 -IHJlZHVjdGlvbg== 11004 -IHZpdg== 11005 -IHNvdXI= 11006 -IGVjb3M= 11007 -IGhheg== 11008 -IHN0ZWFs 11009 -IG15c3Rlcg== 11010 -INCa0LDQug== 11011 -INGN0YLQuA== 11012 -IFZpZXRuYW0= 11013 -IGFudGVz 11014 -IGNvbm5lY3Rpbmc= 11015 -6ZaT 11016 -IERhdmU= 11017 -IGLDtnlsZQ== 11018 -IENhc3Q= 11019 -TGU= 11020 -IGN1bA== 11021 -IGdlbnJl 11022 -66eQ 11023 -IGNvbXBsYWlu 11024 -IGh1cnJ5 11025 -YXJ0ZQ== 11026 -Z3JlZw== 11027 -IG1vbml0b3Jpbmc= 11028 -IGRlc2VydA== 11029 -INGB0L7Qsg== 11030 -ZWxpbmc= 11031 -IFN1cHJlbWU= 11032 -IGdpYmk= 11033 -IGxhcmc= 11034 -IG5hdGlvbnM= 11035 -IFRvaw== 11036 -IG5lZWRsZQ== 11037 -5rU= 11038 -IGFzbGVlcA== 11039 -IGNvbXVu 11040 -IEpld3M= 11041 -IGFjaGlldmVk 11042 -IGV4aXQ= 11043 -IGRpc2Vhc2Vz 11044 -bGluZXM= 11045 -44GL44KJ 11046 -cmllbmRz 11047 -IHJlY3Q= 11048 -IHNjYW4= 11049 -44Gv44GE 11050 -IGh1cnRz 11051 -esSZ 11052 -IExvb2tpbmc= 11053 -44K3 11054 -7ZI= 11055 -dWx0dXJhbA== 11056 -4buT 11057 -aW5lbnQ= 11058 -IHB1ZXM= 11059 -IGNoZWVyaW5n 11060 -p4A= 11061 -YWdnZXI= 11062 -IGFkYQ== 11063 -TGF1Z2h0ZXI= 11064 -IFdvbWVu 11065 -6KOh 11066 -6Ks= 11067 -IG9jY3VycmVk 11068 -IHNlYXRz 11069 -6ICM 11070 -IGVtcG93ZXI= 11071 -dW51 11072 -ZWxsaW5n 11073 -QkVS 11074 -ZW5zaW9uYWw= 11075 -IGNvbnNvbGU= 11076 -YXNoaW5n 11077 -IGVpbm1hbA== 11078 -ZmFyZQ== 11079 -IOuPvA== 11080 -IHNlc3Npb25z 11081 -2ZA= 11082 -IHJpZGljdWxvdXM= 11083 -w61hbg== 11084 -IEhlbnJ5 11085 -IEhvbA== 11086 -IGNvbGxlY3RlZA== 11087 -IGRpc2N1c3Npb25z 11088 -RGU= 11089 -IGRpc2FiaWxpdHk= 11090 -IO2b 11091 -IHN1YnNjcmliZXJz 11092 -IGlyZ2VuZA== 11093 -IGZlbA== 11094 -IGRpcmVjdGlvbnM= 11095 -IG1hbnVmYWN0dXJpbmc= 11096 -IFJvZA== 11097 -IOyWmA== 11098 -4LiX 11099 -5piO 11100 -IGNyaXRlcmlh 11101 -IG1vbGQ= 11102 -6Kmx 11103 -IGVudGVyaW5n 11104 -cmlq 11105 -aXNlbg== 11106 -IFBhcmE= 11107 -aWV2ZQ== 11108 -IGNoYXJnZWQ= 11109 -IGpvdQ== 11110 -IGNhdHM= 11111 -0LvQtdC0 11112 -YWRheXM= 11113 -0LDQvdC+0LI= 11114 -asSZ 11115 -dmF0aW9u 11116 -IGFzdHJvbg== 11117 -aXRhbHM= 11118 -IEJyYW5k 11119 -IEthbg== 11120 -IHBsYWlu 11121 -IGFuZGVyZW4= 11122 -YW5kZQ== 11123 -0Y/Qtw== 11124 -IHRvbGVy 11125 -xYJlbQ== 11126 -IHByw6k= 11127 -0LzQvtGC0YA= 11128 -YWdlbWVudA== 11129 -dWN0 11130 -Y2jDqQ== 11131 -IEVuZXI= 11132 -YWrEhQ== 11133 -IO2VtOs= 11134 -IHN0YQ== 11135 -IHJpbmdz 11136 -IHRvaWxldA== 11137 -IENyYQ== 11138 -IGV4cGVyaWVuY2luZw== 11139 -IHNsaXA= 11140 -IHNhbmR3aWNo 11141 -IFVzaW5n 11142 -IHNwZWN0cnVt 11143 -IFJvcw== 11144 -YXBzZQ== 11145 -IEpheQ== 11146 -0LzRgw== 11147 -5rOV 11148 -RXg= 11149 -IHJlY29nbml0aW9u 11150 -IERpZG4= 11151 -dWRh 11152 -YWpl 11153 -ZXN0bHk= 11154 -IGZlbWlu 11155 -aXR1cmU= 11156 -0YDQsNGC 11157 -IGhpcmU= 11158 -IG5vd2hlcmU= 11159 -5L2N 11160 -4bqn 11161 -IHdpbmc= 11162 -IHNhdg== 11163 -IFNlY3VyaXR5 11164 -IHJ1cmFs 11165 -IEZ1bg== 11166 -YXllcg== 11167 -IGFjY3Vz 11168 -IG1t 11169 -IEpvc2VwaA== 11170 -IHNjcmVlbnM= 11171 -IGJvcnJvdw== 11172 -IHN3aW5n 11173 -IDQ4 11174 -IHRvdWNoaW5n 11175 -dGhpcw== 11176 -aW50ZW5kbw== 11177 -6YM= 11178 -0KA= 11179 -IFNjb3RsYW5k 11180 -IEphc29u 11181 -IFZlbg== 11182 -IGV4Y2VwdGlvbg== 11183 -IG5lYXJieQ== 11184 -IGJyb3dzZXI= 11185 -YW5nZXJz 11186 -IFNpbg== 11187 -z4DOvw== 11188 -5L2G5piv 11189 -b3NwZWw= 11190 -IHd1cmRl 11191 -IGRydW5r 11192 -7Zo= 11193 -7IaN 11194 -44OJ 11195 -IOyKpO0= 11196 -IExpZQ== 11197 -b2Nv 11198 -IExlYWd1ZQ== 11199 -IGlnbm9yZQ== 11200 -IDop 11201 -IGxhbmRpbmc= 11202 -INi52YQ= 11203 -IFRhZw== 11204 -Mjg= 11205 -IGRyYWZ0 11206 -IGFlcg== 11207 -IOq3uOuDpQ== 11208 -IHBlbnNl 11209 -INC00LDQttC1 11210 -IGJlZHJvb20= 11211 -IG5hag== 11212 -7KeA6rOg 11213 -aWdlbm91cw== 11214 -IGRlYWxz 11215 -ZWxsbw== 11216 -5LqM 11217 -IHBvc2l0 11218 -6rs= 11219 -IHZpc2l0ZWQ= 11220 -aWZpZXM= 11221 -IHByZW1p 11222 -IGNhbnQ= 11223 -IFJpY2s= 11224 -IHJhaXNpbmc= 11225 -IHBlcm1pc3Npb24= 11226 -IHB1Ymw= 11227 -dW5jaQ== 11228 -IGJlbmQ= 11229 -IGNoYW1waW9ucw== 11230 -ZGll 11231 -IGF3ZnVs 11232 -IGp1bXBpbmc= 11233 -IGxsZWc= 11234 -IHN1c3RhaW5hYmxl 11235 -IFRvdA== 11236 -IGNhbmR5 11237 -5YCZ 11238 -IHNhdGlzZmllZA== 11239 -IHBpcGU= 11240 -IGNvY2s= 11241 -2LY= 11242 -c3RvbmU= 11243 -IG1vbWVudHVt 11244 -INCd0LA= 11245 -IGFsb3Jz 11246 -IHJldHVybnM= 11247 -YW1tZW4= 11248 -564= 11249 -0YvQvA== 11250 -YXdu 11251 -b3R0ZWQ= 11252 -IHdvbGxlbg== 11253 -aWN0ZWQ= 11254 -IGNhbmRpZGF0ZXM= 11255 -IExhZHk= 11256 -IHlpZWxk 11257 -IG1haW50ZW5hbmNl 11258 -ZmZlY3Q= 11259 -IGV4cGFuc2lvbg== 11260 -IExFRA== 11261 -IGRhcmtuZXNz 11262 -IG91dGZpdA== 11263 -7JWI 11264 -INC40YHQvw== 11265 -cnVwdGlvbg== 11266 -44GE44G+44GZ 11267 -IGVuZ2FnaW5n 11268 -IGluc2lnaHQ= 11269 -IEFsd2F5cw== 11270 -IGdlZg== 11271 -cmFr 11272 -IHBpeA== 11273 -6Ka65b6X 11274 -IHF1YW50aXR5 11275 -IGluaw== 11276 -IEtpbmdkb20= 11277 -IGNvcnQ= 11278 -5bi4 11279 -IGdvdmVybm1lbnRz 11280 -IHByb3Rlc3Q= 11281 -cG9vbg== 11282 -INGC0L7Qs9C+ 11283 -5a6D 11284 -dWNoZW4= 11285 -cXVhbGl0eQ== 11286 -IFBvcnF1ZQ== 11287 -IENsdWI= 11288 -IHJpdA== 11289 -IGFydGljbGVz 11290 -Qkk= 11291 -aWdpYmxl 11292 -IGRpc2FzdGVy 11293 -0LjQsw== 11294 -INC90LjQug== 11295 -2YfYpw== 11296 -66W8 11297 -YXJldA== 11298 -IHVuYWJsZQ== 11299 -IMOu 11300 -IGVyc3Q= 11301 -INeg 11302 -dmFyZA== 11303 -IGFubm95aW5n 11304 -IEtpcg== 11305 -0LXRgNC2 11306 -ZW5uaXM= 11307 -IHVuY2VydGFpbg== 11308 -MzY= 11309 -w7Zz 11310 -IGVjb3N5c3RlbQ== 11311 -emVk 11312 -asOg 11313 -c3Vu 11314 -7Ja07ISc 11315 -IMW8ZWJ5 11316 -IG1hcHM= 11317 -64KY 11318 -5YWo 11319 -IEp1c3Rpbg== 11320 -IHRyYXNo 11321 -IGVub3Jtb3Vz 11322 -IHN0YXRlZA== 11323 -IGJyYW5kcw== 11324 -IHlvdXQ= 11325 -INGH0LXQu9C+0LLQtdC6 11326 -IE1hdHRo 11327 -IHRyYW5zcG9ydGF0aW9u 11328 -IGxlZ2lzbGF0aW9u 11329 -IHByb3ZpZGVycw== 11330 -INit 11331 -IG1hZ2F6aW5l 11332 -IHNlaGVu 11333 -IERlc3BpdGU= 11334 -IHBhc3Nlcw== 11335 -5oiQ 11336 -IGFsdGVy 11337 -YWRhbg== 11338 -IGZhcm1lcnM= 11339 -6LCi 11340 -IGNvbmZpcm1lZA== 11341 -IGVzYQ== 11342 -aXRvcw== 11343 -IHJvYWRz 11344 -VklT 11345 -IHdvcmtlcg== 11346 -IGRlc2lnbnM= 11347 -IFNvdmlldA== 11348 -YnJpZA== 11349 -IHByYWN0aWNpbmc= 11350 -IOu2gA== 11351 -IFNlYQ== 11352 -44Op 11353 -INC/0YDQvtC0 11354 -IGNoaWxs 11355 -IGxlbW9u 11356 -7JeQ64qU 11357 -IGZsZXhpYmxl 11358 -IEV4Y3VzZQ== 11359 -IHRlcnJpdG9yeQ== 11360 -5ZWP 11361 -44G/ 11362 -IGx1eA== 11363 -IGxpZmV0aW1l 11364 -IGRpc3Rpbmd1 11365 -IFRpbWVz 11366 -IGdyb3Nz 11367 -ZW56 11368 -IHNjcm9sbA== 11369 -bcSxxZ8= 11370 -Y2lw 11371 -o7w= 11372 -RFA= 11373 -IHB1Ymxpc2g= 11374 -IGViZW4= 11375 -IHJlZ2lzdA== 11376 -IGVkaXRpb24= 11377 -IExF 11378 -IGNoYXJnaW5n 11379 -dXRhdGlvbg== 11380 -eXJpY3M= 11381 -aWRhcw== 11382 -IM6/ 11383 -INC60L7RgA== 11384 -IFRvbg== 11385 -55uu 11386 -IHdob2V2ZXI= 11387 -IEZveA== 11388 -5omL 11389 -6rGw65Og7JqU 11390 -IGZvdWdodA== 11391 -IGRyaWxs 11392 -IEFmZ2hhbg== 11393 -fiE= 11394 -IFRvbw== 11395 -IHNlY29uZGFyeQ== 11396 -csOk 11397 -IEhlYWQ= 11398 -aW5uZW4= 11399 -IHlhcm4= 11400 -INC90LDQvA== 11401 -IHdpZHRo 11402 -IGVuZ2luZWVy 11403 -acSF 11404 -IHdpbmdz 11405 -IOuVjOusuA== 11406 -IHRyYXVtYQ== 11407 -IHJlcHJvZHU= 11408 -IGNoaXA= 11409 -IHBhc3Npb25hdGU= 11410 -IGF3a3dhcmQ= 11411 -IO2K 11412 -0LDQttC0 11413 -IEJpdGNvaW4= 11414 -IGtow7RuZw== 11415 -IHLDsw== 11416 -cmVjdGlvbg== 11417 -INCz0LTQtQ== 11418 -IFVzdWFsbHk= 11419 -IGltcGxlbWVudGF0aW9u 11420 -IGdhbWVwbGF5 11421 -IG15c3Rlcnk= 11422 -INC+0Lo= 11423 -IGHDsW9z 11424 -YW5keQ== 11425 -0LjQvNC4 11426 -IHByaXZhY3k= 11427 -YWNv 11428 -44KB 11429 -IGR1bXA= 11430 -IFBheQ== 11431 -IGRpcGw= 11432 -IGZ1cm4= 11433 -IHNoaXBz 11434 -TEE= 11435 -INGF0L7RgNC+0Yg= 11436 -IGVj 11437 -IGRyb3Bz 11438 -Y2hs 11439 -MzI= 11440 -IG9ic2VydmU= 11441 -IERldmVsb3A= 11442 -TcO8emlr 11443 -YW5uZWw= 11444 -b3dhxIc= 11445 -IGZhY2Vk 11446 -w6Fs 11447 -IHZpY3RpbXM= 11448 -IGdpZnRz 11449 -IGJvb3Q= 11450 -w59l 11451 -cm9k 11452 -IDIwMDk= 11453 -w7ZydA== 11454 -IHVuaXZlcnNhbA== 11455 -IG5vdXZl 11456 -IGJveWZyaWVuZA== 11457 -IGNldGVyYQ== 11458 -0YHRgtCw 11459 -J1M= 11460 -IG5pdmU= 11461 -IGNydWNpYWw= 11462 -IHN1cnZl 11463 -IGNvaW4= 11464 -IHNvbmRlcm4= 11465 -IHNoYWRl 11466 -IGx1Z2Fy 11467 -IHN1cmVseQ== 11468 -IG1heA== 11469 -IGltcHJvdmluZw== 11470 -5Zug54K6 11471 -IHdlbg== 11472 -INeR 11473 -IOyWtOw= 11474 -IGVuZm9yY2VtZW50 11475 -aWJs 11476 -IGxpdg== 11477 -bGVyaQ== 11478 -IG1lam9y 11479 -IENhcm9saW5h 11480 -IHZhcw== 11481 -IGNvbXByb20= 11482 -IGRpcnQ= 11483 -IHVwZ3JhZGU= 11484 -IEJlbGw= 11485 -IHJlc3RhdXJhbnRz 11486 -IHRyYXA= 11487 -IHRlYXM= 11488 -YmxpYw== 11489 -IEdyZWc= 11490 -c2Fu 11491 -IG93 11492 -dWVzdA== 11493 -IHByb3Bvc2Fs 11494 -IFJldA== 11495 -ZnJvbnQ= 11496 -IHBhc3NhZ2U= 11497 -IHN1cnJvdW5kaW5n 11498 -IMO6bHQ= 11499 -IHVwY29taW5n 11500 -IGhvcnJvcg== 11501 -IGNsb3RoaW5n 11502 -IOyVvQ== 11503 -IGRpbA== 11504 -cm9tZQ== 11505 -IElk 11506 -IFJvYWQ= 11507 -INGN0YLQvtGC 11508 -Y2hhaW4= 11509 -INCx0YvRgtGM 11510 -IE9mZmlj 11511 -INCd0LU= 11512 -IGluc2Fu 11513 -IGRlY3JlYXNl 11514 -INGF0L7Rgg== 11515 -YnVpbGQ= 11516 -IERyYWdvbg== 11517 -5YI= 11518 -IGludmVzdG9ycw== 11519 -YW50aQ== 11520 -IHNhY3JpZmljZQ== 11521 -IHRyb29wcw== 11522 -IEJhZA== 11523 -IHBhc3N3b3Jk 11524 -IGNvbnN0cmE= 11525 -4LiV 11526 -IMOHYQ== 11527 -YWRvdw== 11528 -dGhyb3VnaA== 11529 -0YbQsA== 11530 -Q2Fu 11531 -IGNhbmRpZGF0ZQ== 11532 -IGFudGli 11533 -7JeF 11534 -IHRhc3R5 11535 -2YjZhg== 11536 -IEluZg== 11537 -IEJhbmc= 11538 -acOfdA== 11539 -aW5pdHk= 11540 -ZmF0aGVy 11541 -IGNvbnRyb3ZlcnM= 11542 -IFBhaw== 11543 -aWx0eQ== 11544 -6rWs6w== 11545 -IGxpZ2h0ZXI= 11546 -IGZhbGxlbg== 11547 -IHp1cw== 11548 -IEd1YXJk 11549 -IGNvdHQ= 11550 -IEZyZWU= 11551 -IGluaXRpYXRpdmU= 11552 -YWxvdXM= 11553 -IG5vdGlmaWNhdGlvbg== 11554 -IE1lZGlj 11555 -IENvbW1pdHRlZQ== 11556 -7Jew 11557 -IFdvb2Q= 11558 -IG11c2g= 11559 -dWx1bQ== 11560 -6LI= 11561 -YWhhaA== 11562 -IHN1ZmZpY2llbnQ= 11563 -IHNpbmdlcg== 11564 -0LrQvtC5 11565 -QUxJ 11566 -w6R0dA== 11567 -IFBS 11568 -IExhcg== 11569 -Y3VsZXM= 11570 -aWVtcG8= 11571 -IHVuZXg= 11572 -IGludGVncmFs 11573 -IHRyYW5zbWlzc2lvbg== 11574 -IGljaQ== 11575 -0YPRhQ== 11576 -Z2lj 11577 -IE5pbnRlbmRv 11578 -IENvcA== 11579 -IFRydXN0 11580 -ZW5hcw== 11581 -IGFiaWxpdGllcw== 11582 -IGNoaXBz 11583 -cGF0 11584 -IGFuY2hl 11585 -0LvQtdC9 11586 -IGFwcHJvYWNoZXM= 11587 -IHRob3I= 11588 -IHNpc3RlcnM= 11589 -IGRyaXZlcnM= 11590 -IGFsbGE= 11591 -MDM= 11592 -IHJ1YmJlcg== 11593 -IG7DpQ== 11594 -QUNL 11595 -IGRpc2FwcGVhcg== 11596 -6rCc 11597 -IGNvbXBlbnM= 11598 -IHZpYnI= 11599 -56yR 11600 -R08= 11601 -IHNpemVz 11602 -IHRyYWNraW5n 11603 -7ZmU 11604 -IOyEuA== 11605 -IGltcGFjdHM= 11606 -aWJpbA== 11607 -ZmlzaA== 11608 -QlI= 11609 -IGFycm93 11610 -IGxhcmdlbHk= 11611 -YW5ueQ== 11612 -IGxhd3llcg== 11613 -5oCO6bq8 11614 -am91cnM= 11615 -2ro= 11616 -dmlh 11617 -IGRlbGxh 11618 -IG1hdGhlbWF0 11619 -IE1pbmU= 11620 -IEtvbGw= 11621 -2LI= 11622 -IENyb3Nz 11623 -IDY1 11624 -IGdyYWM= 11625 -IGludm9sdmVz 11626 -IGRlbGlnaHQ= 11627 -IEhvbGx5d29vZA== 11628 -IGltbWVkaWF0ZQ== 11629 -b25pYw== 11630 -IGxhZG8= 11631 -IGJ1bGxldA== 11632 -IE5vdGU= 11633 -IHVubG9jaw== 11634 -IGRpc2NvdW50 11635 -IHJpc2luZw== 11636 -cHJlc3M= 11637 -IHBhY2U= 11638 -IHNob3J0ZXI= 11639 -IHRlbmVy 11640 -Z2Vvbg== 11641 -IG1hbmFnaW5n 11642 -IGNlcmU= 11643 -Q2hy 11644 -V2hlbg== 11645 -YWNoZW4= 11646 -IOyT 11647 -IEh1bg== 11648 -IG9mdA== 11649 -IDI1MA== 11650 -aWVydW5n 11651 -IHN0YWJpbA== 11652 -IENvbm5lY3Q= 11653 -IHlhbmk= 11654 -IGRvd250 11655 -zrzOsQ== 11656 -IHZvY2Fs 11657 -zr3OsQ== 11658 -IGxlYW4= 11659 -IHZpZMOpbw== 11660 -IEZhbWlseQ== 11661 -cmVzZW50 11662 -IGFtb3VudHM= 11663 -7KeB 11664 -Y2xhc3M= 11665 -IHZpYg== 11666 -IEF2 11667 -YXJzZQ== 11668 -IGdlbnRsZW1lbg== 11669 -IHNlZWtpbmc= 11670 -IHVuaW9u 11671 -IHJlZ3VsYXJseQ== 11672 -5o8= 11673 -IEphaHI= 11674 -IEZvb2Q= 11675 -IFByb2JsZW0= 11676 -IGFydGlmaWNpYWw= 11677 -IFNpeA== 11678 -IGltcHJlc3NlZA== 11679 -IHRvb3Ro 11680 -IEto 11681 -IHlhcmQ= 11682 -IO2VtA== 11683 -IG93bmVk 11684 -IOuPmQ== 11685 -7LKt 11686 -IHRvZGE= 11687 -IHBvcnRmb2w= 11688 -IOuCqA== 11689 -b3JnZW91cw== 11690 -IGRhdGVz 11691 -0L7Qu9GM0Lc= 11692 -0LXRh9C90L4= 11693 -IGNvbmZpZ3VyYXRpb24= 11694 -IHJlcXVpcmVtZW50 11695 -IGJlbGx5 11696 -IHBhaW5mdWw= 11697 -IGRlbW9uc3RyYXRl 11698 -IGdsZWljaA== 11699 -IHZpc2l0aW5n 11700 -IENvbmY= 11701 -IGRhbA== 11702 -2ZE= 11703 -IGFtZW5k 11704 -IEZ1cg== 11705 -5q+U 11706 -IHZpdGFs 11707 -4buL 11708 -IG1hdGU= 11709 -IE91 11710 -IGxlZ2FjeQ== 11711 -dXN0aW5n 11712 -IGFjY29tbW9k 11713 -IHF1b2k= 11714 -YXVlbg== 11715 -IGxpZmVzdHlsZQ== 11716 -Q0M= 11717 -w6TDpG4= 11718 -YXJ0ZW4= 11719 -IG1pbmhh 11720 -csOz 11721 -IOuqqA== 11722 -IGZvcm1hdGlvbg== 11723 -IHRyYWlsZXI= 11724 -cGVyb3I= 11725 -INCz0YA= 11726 -IHVk 11727 -enU= 11728 -IGtvbW1lbg== 11729 -IGNhdmU= 11730 -IENvdW5jaWxsb3I= 11731 -IHRocm93bg== 11732 -IHRyaWNrcw== 11733 -TEFVR0hURVI= 11734 -IEFjYWRlbXk= 11735 -cm93ZA== 11736 -oZ0= 11737 -7KCA 11738 -IEltYWdpbmU= 11739 -IGluZm9ybWVk 11740 -cm9waA== 11741 -IGxpZw== 11742 -IHNrdWxs 11743 -YWJldGg= 11744 -IGZ1bmN0aW9uYWw= 11745 -ZXJlaw== 11746 -T24= 11747 -6aY= 11748 -IGFuY2VzdA== 11749 -IHNhZmVseQ== 11750 -IEhU 11751 -64u5 11752 -IGRhdg== 11753 -IGRyaXZlcw== 11754 -QW1lcmlj 11755 -IHRpcmU= 11756 -IHNhaXM= 11757 -w6FyaQ== 11758 -YXZvcnM= 11759 -IGNvcnJlc3BvbmRpbmc= 11760 -IHByw6lz 11761 -Y2hlc3Q= 11762 -IGJhY3Rlcmlh 11763 -IGluZmVjdGlvbg== 11764 -dXNhbA== 11765 -IGF2ZXo= 11766 -IGJhc2tldGJhbGw= 11767 -IHN1cHBsaWVz 11768 -IGV4cGVydGlzZQ== 11769 -oKU= 11770 -ZmE= 11771 -IHRpZW1wbw== 11772 -IFdhbnQ= 11773 -IHNpbGx5 11774 -IHVwcA== 11775 -IGVsZWN0ZWQ= 11776 -IGZpcmVk 11777 -INiv 11778 -IHVuaXZlcnNpdGllcw== 11779 -YWxsZQ== 11780 -IGphY2tldA== 11781 -wrA= 11782 -IHRyYXY= 11783 -bHM= 11784 -IGRlZmVhdA== 11785 -IGNvZ24= 11786 -IGVxdWF0aW9ucw== 11787 -dWtp 11788 -IFNoZXI= 11789 -IHRoaXJ0eQ== 11790 -IHN0cmVhbWluZw== 11791 -b3Ryb3M= 11792 -IFByb2R1 11793 -bmVq 11794 -IGRlc2lnbmVy 11795 -IOuKkOuC 11796 -IHBhaW50ZWQ= 11797 -cmFpbmU= 11798 -bWFpbA== 11799 -IHZlc3M= 11800 -IHJoeXRobQ== 11801 -bGVzaA== 11802 -IDk5 11803 -IGFpbmRh 11804 -Y2hpZWQ= 11805 -IMOpdGFpdA== 11806 -IGFmZmVjdHM= 11807 -6aM= 11808 -IEZpbmQ= 11809 -IMOpbA== 11810 -IHBvdGF0b2Vz 11811 -IHBhZw== 11812 -INC/0LDRgA== 11813 -YXJ0cw== 11814 -IE5hY2g= 11815 -IDMz 11816 -IEhhcmQ= 11817 -IElyYXE= 11818 -IG9waW5pb25z 11819 -d2l0aA== 11820 -ZXJtYW4= 11821 -w70= 11822 -6K0= 11823 -IFNQRUFL 11824 -rLw= 11825 -IHN0YWJpbGl0eQ== 11826 -IEhF 11827 -IGNhcHR1cmVk 11828 -IGJ1Y2tz 11829 -IG1hc2tz 11830 -IGNvbXBldGU= 11831 -IGZvcmdvdHRlbg== 11832 -0LvRjtGH 11833 -c2VxdQ== 11834 -IOyEoA== 11835 -aWxsaW9u 11836 -IGdyYXBoaWNz 11837 -IGh1Yg== 11838 -IOyXsA== 11839 -ZW1wb3I= 11840 -IGNyb3du 11841 -IHdpZGVy 11842 -IG9jY3Vycw== 11843 -RFM= 11844 -5oE= 11845 -IEJhdHRsZQ== 11846 -44Gq44KT 11847 -IGR1YWw= 11848 -IDYwMA== 11849 -YXRoZXJz 11850 -4LmB 11851 -IHNldHRsZQ== 11852 -IGF2YWl0 11853 -IGRvaXM= 11854 -0LrQuNGF 11855 -YWRvcmVz 11856 -IMOz 11857 -bmVnbw== 11858 -IEdlb3JnaWE= 11859 -IFJvZw== 11860 -IGRpdm9y 11861 -IFNvbmc= 11862 -IFNwZWNpYWw= 11863 -IG11bg== 11864 -IHByZXRlbmQ= 11865 -TUFO 11866 -IHZpb2xlbnQ= 11867 -IGJlc2lkZXM= 11868 -dnk= 11869 -IE5heg== 11870 -Mjk= 11871 -IHN3ZWF0 11872 -IHp3 11873 -IEh1 11874 -IEJ1aWxk 11875 -IGhvcm0= 11876 -IENhcmQ= 11877 -IOycoA== 11878 -IHJlY29tbWVuZGF0aW9u 11879 -Y2FsbGVk 11880 -c3RpY2s= 11881 -IFBvbGljZQ== 11882 -IGNvbnN1bWVycw== 11883 -IGdyb2Nlcg== 11884 -IHN0dW4= 11885 -INCS0Ys= 11886 -0KM= 11887 -IERhdGE= 11888 -IHN1YnN0YW50 11889 -aXJlY3Q= 11890 -4LI= 11891 -INCy0Lc= 11892 -IEFybQ== 11893 -IHNlbWVzdGVy 11894 -IEJyYWQ= 11895 -IG91cnM= 11896 -INC60L7RgtC+0YDRi9C5 11897 -p2E= 11898 -IGdyYW1z 11899 -IGV4ZXJjaXNlcw== 11900 -NzU= 11901 -IHN3ZWFy 11902 -IGluY2VudA== 11903 -z4HOvw== 11904 -IGlsbGVnYWw= 11905 -5L2V 11906 -IERhbW4= 11907 -IG7Dug== 11908 -IG5lY2Vz 11909 -IGN1eg== 11910 -aWNvbg== 11911 -IGhvcnM= 11912 -IENvbW8= 11913 -5L2c 11914 -IOuRkA== 11915 -IG92ZXJzZQ== 11916 -IGhhcnZlc3Q= 11917 -IHRocmV3 11918 -INC/0L7RgtC+0LzRgw== 11919 -15nXlA== 11920 -IG90cm8= 11921 -INC/0LXRgNCy 11922 -IHNjb3Bl 11923 -IGdsb3J5 11924 -IE1pY2hpZ2Fu 11925 -IGFzc3VtaW5n 11926 -INGD0LQ= 11927 -IGJvbGQ= 11928 -Z3Vl 11929 -bW90aGVy 11930 -IHdhcmVu 11931 -6Kyb 11932 -INil 11933 -IEthbQ== 11934 -aXNwaWVs 11935 -IHRvdWpvdXJz 11936 -IGNvbnN0aXR1dGlvbg== 11937 -IH4= 11938 -IGZyYW5rbHk= 11939 -b2xlbg== 11940 -b25zY2lvdXM= 11941 -IHfDvHJkZQ== 11942 -dGhvbg== 11943 -IE9G 11944 -7J6Q6w== 11945 -dW5kYQ== 11946 -IOaYrw== 11947 -INC/0L7RgA== 11948 -IGVtcGxveW1lbnQ= 11949 -0ZHRgg== 11950 -44GB 11951 -IHN0ZWFt 11952 -IERJ 11953 -IHByb2Zlc3Npb25hbHM= 11954 -IGVuZ2luZWVycw== 11955 -IFhpYQ== 11956 -56s= 11957 -7JiB 11958 -IER1bg== 11959 -IGJpdGNo 11960 -IEZvcmQ= 11961 -5LiN6KaB 11962 -c2VjdGlvbg== 11963 -IHZpY2U= 11964 -IExhdGVy 11965 -b3N0b24= 11966 -0Y3Rgg== 11967 -16Y= 11968 -IEF6dXJl 11969 -cGxpbmc= 11970 -IDE4MA== 11971 -IENyZWF0 11972 -SVNIQQ== 11973 -IGJ1ZW5v 11974 -7Z2s 11975 -cnVw 11976 -bGVycw== 11977 -IFlhbmc= 11978 -IEhB 11979 -YmF0 11980 -IENhdGhvbGlj 11981 -IGFjY2VudA== 11982 -IG1peGluZw== 11983 -Y2tldHM= 11984 -IGVuaGFuY2U= 11985 -w7xocg== 11986 -w6pz 11987 -IO2W 11988 -IHN3aW1taW5n 11989 -IGPhu6dh 11990 -IEVsaXo= 11991 -IGltbXVuZQ== 11992 -INCx0L7Quw== 11993 -IGZhcmU= 11994 -IEdhYg== 11995 -16E= 11996 -IHNhdGVsbA== 11997 -IEFueXRoaW5n 11998 -IGFzc2V0 11999 -IHNjaGVkdWw= 12000 -IHJhZGljYWw= 12001 -IHp3ZWk= 12002 -IE1F 12003 -cmVsYXRlZA== 12004 -IHNlcGFyYXRlZA== 12005 -IExpYnI= 12006 -IGdyaXA= 12007 -IOCuqg== 12008 -6KiA 12009 -IGJlYW5z 12010 -IE9w 12011 -7IaM 12012 -IHBvdW5k 12013 -IGVudHJhbmNl 12014 -z4Y= 12015 -IE5pZQ== 12016 -IFJlcHVibGljYW5z 12017 -IGF0b20= 12018 -IHBlcnNvbmFz 12019 -IEFsaQ== 12020 -w6Rocg== 12021 -5aSW 12022 -IGRyYW1hdGlj 12023 -IEZpbmU= 12024 -IHJlbWluZHM= 12025 -6Jk= 12026 -IGTDqWrDoA== 12027 -IGFmZm9yZGFibGU= 12028 -IGJyYW4= 12029 -aWVybw== 12030 -YWxhcg== 12031 -Y3U= 12032 -IFw= 12033 -IG1vxbxl 12034 -IGJsYXN0 12035 -IHJlY3k= 12036 -ZmlyZQ== 12037 -IGxsZQ== 12038 -INCy0YDQtdC80Y8= 12039 -IFdX 12040 -IHZz 12041 -IER1ZGU= 12042 -IFJvbWU= 12043 -IGdyZWV0 12044 -IEhldA== 12045 -Y2lhcw== 12046 -IOuLuQ== 12047 -bGVzc2x5 12048 -IHByZW1pdW0= 12049 -IGV4cGVyaW1lbnRz 12050 -YXRhcg== 12051 -w6lyaQ== 12052 -IG9mZmljaWFsbHk= 12053 -IGZlZQ== 12054 -4LmH 12055 -INGH0LXQvA== 12056 -cmVh 12057 -IHRveQ== 12058 -T1A= 12059 -IFRheWxvcg== 12060 -IE1jQw== 12061 -aWxleQ== 12062 -IEJhaw== 12063 -IGFsdW0= 12064 -IFVudGVy 12065 -IG1hZ2ljYWw= 12066 -IHRyYWJhbA== 12067 -IHZvdGVz 12068 -aXRhZ2U= 12069 -IG1lY2hhbmljYWw= 12070 -aG4= 12071 -44G+44GX44Gf 12072 -INC40L3RgtC10YA= 12073 -5LuK5aSp 12074 -IGhpbnQ= 12075 -IGF1dGhvcml0aWVz 12076 -IE5BU0E= 12077 -aXZlcnNhcnk= 12078 -INC/0L7Rhw== 12079 -cmFj 12080 -IFNQRUFLRVI= 12081 -w7Z0 12082 -IGZyYW1lcw== 12083 -IGdvb2RieWU= 12084 -IGNoZXI= 12085 -aHU= 12086 -IG5ldXI= 12087 -5a6a 12088 -IE1hY2g= 12089 -IEhlbGw= 12090 -IGZlc3RpdmFs 12091 -64WE 12092 -dXRh 12093 -IG11c2hyb29t 12094 -IHRhbnQ= 12095 -IHRhdHRv 12096 -IGRlbGV0ZQ== 12097 -IGRpeg== 12098 -IHbDpA== 12099 -IHNldmVudA== 12100 -IFF1aWNr 12101 -IGJha2luZw== 12102 -IGFzc2VtYmx5 12103 -R28= 12104 -IERyZWFt 12105 -IExhZA== 12106 -6Z2e 12107 -w6J5 12108 -YWdz 12109 -IGdyYXZpdHk= 12110 -IOynkQ== 12111 -ZW1wbG95 12112 -IGRpZXNlcw== 12113 -IGRpc2NvdmVyeQ== 12114 -0YHRgtCy0LA= 12115 -IGhlYmJlbg== 12116 -IGdlcmFkZQ== 12117 -IERS 12118 -ICcn 12119 -IHRlY2huaWNhbGx5 12120 -INCf0L4= 12121 -IHByaXZpbGVnZQ== 12122 -IEV2ZXI= 12123 -IFNlcnZpY2Vz 12124 -dXJhbg== 12125 -IGNvbnN1bXB0aW9u 12126 -IFJldg== 12127 -IFNoYWxs 12128 -YXNzZXI= 12129 -toDthLA= 12130 -IHJhY2lhbA== 12131 -IFlvdXR1YmU= 12132 -IFByYQ== 12133 -0YHRgtCy0LXQvQ== 12134 -Y2Vr 12135 -5rQ= 12136 -YXNoYQ== 12137 -INuB 12138 -kZw= 12139 -YWhu 12140 -SUNL 12141 -IGRyaW5rcw== 12142 -IGNhcmI= 12143 -44K/ 12144 -IDY0 12145 -IE1tbQ== 12146 -IGVsZWN0cmljYWw= 12147 -IGZydWl0cw== 12148 -IEhE 12149 -w7Fh 12150 -IERlZmluaXRlbHk= 12151 -IOuwmw== 12152 -IGZhaXM= 12153 -cmF0aW9ucw== 12154 -IGNvZQ== 12155 -YWh1 12156 -IEZhaXI= 12157 -IGVhdGVu 12158 -IGZpcg== 12159 -IEF1 12160 -0YPQvQ== 12161 -dWxhdGluZw== 12162 -aW5nbHk= 12163 -IHZhY2NpbmVz 12164 -IGRyYWdvbg== 12165 -IHBvaW50aW5n 12166 -IHBlbG8= 12167 -b3J0ZXJz 12168 -IHdvcmtvdXQ= 12169 -0LjQvNC10YA= 12170 -bW9uZA== 12171 -IE5vcGU= 12172 -INeW15Q= 12173 -INmC 12174 -IGFkb3B0ZWQ= 12175 -YnVs 12176 -IHNhbnM= 12177 -IHBvc3NpYmlsaXRpZXM= 12178 -IHBlbmQ= 12179 -IHphbWFu 12180 -aG91 12181 -IHNoYXJlcw== 12182 -IGNhbGVuZGFy 12183 -IHBlcnNvbmE= 12184 -IHNlYWw= 12185 -IGdlbmU= 12186 -IHN0b3JlZA== 12187 -INC/0L7Qtw== 12188 -IGx5cmljcw== 12189 -IGluc3RydW1lbnRz 12190 -IE1B 12191 -gOydtA== 12192 -IGNsb3Vkcw== 12193 -aG90 12194 -4bqv 12195 -IOqwmeyVhOyalA== 12196 -IEVtcGlyZQ== 12197 -IGJpbw== 12198 -d2luZA== 12199 -aWVnbw== 12200 -IEV1cm9w 12201 -IOWlvQ== 12202 -ZWRnZQ== 12203 -IGJhY2t3YXJkcw== 12204 -IOyngOs= 12205 -IHF1ZWVu 12206 -IHNoaW5l 12207 -IMOnxLFr 12208 -IGNhZA== 12209 -IE9k 12210 -IOyCrOuejA== 12211 -IGJ1YmJsZQ== 12212 -w7Rp 12213 -emVz 12214 -IHJlYWN0aW9ucw== 12215 -IGp1ZGdtZW50 12216 -IERlbW9jcmF0cw== 12217 -IGNvc2Fz 12218 -YXNoZWQ= 12219 -INC00L7Qu9C2 12220 -xZtuaWU= 12221 -6rQ= 12222 -IGV4ZW1wbGU= 12223 -TVA= 12224 -4buv 12225 -IFZlcnM= 12226 -IHJlc2ls 12227 -IG3DoQ== 12228 -xYRzdA== 12229 -YmVsaWV2 12230 -IFZvcg== 12231 -IHNjaGVtZQ== 12232 -b25kYQ== 12233 -IHBvZGVtb3M= 12234 -IGNoYXJnZXM= 12235 -IGRlc3RpbmF0aW9u 12236 -IEt5 12237 -IFNT 12238 -IHNpbGVuY2U= 12239 -IGVtYmVk 12240 -bmF0 12241 -4bubaQ== 12242 -QU5U 12243 -Z2dlZA== 12244 -IHJlZHVjaW5n 12245 -IHVnbHk= 12246 -IG1pbQ== 12247 -0YPQtNCw 12248 -MzQ= 12249 -IGNvcmQ= 12250 -INGC0L7QttC1 12251 -IExpc2E= 12252 -IMO2bg== 12253 -IENocmlzdGlhbnM= 12254 -dW1ibGVz 12255 -b2xvZ2lzdHM= 12256 -YXph 12257 -IHRlbmRz 12258 -IENvb2s= 12259 -IGdlc2FndA== 12260 -IO2VmOuCmA== 12261 -IFRlcw== 12262 -ZXJlbW9ueQ== 12263 -INC90YPQttC90L4= 12264 -IE1BUklTSEE= 12265 -IGVucm9sbA== 12266 -IENyeQ== 12267 -RVNT 12268 -IFNhZA== 12269 -IGltcGxlbWVudGVk 12270 -IGTDrWE= 12271 -w5w= 12272 -IHBpc3Q= 12273 -RHI= 12274 -IHNhYmU= 12275 -IFNvY2k= 12276 -w6RyZQ== 12277 -INC60YLQvg== 12278 -IEZyYW5jaXNjbw== 12279 -IOyepQ== 12280 -IGNyZWF0dXJlcw== 12281 -YXdz 12282 -IGVhcm5lZA== 12283 -IGNoZWFwZXI= 12284 -IGRsYQ== 12285 -IHdhcm4= 12286 -c2NoZQ== 12287 -IGJsYWg= 12288 -IG51dHI= 12289 -6Lw= 12290 -IGdvcmdlb3Vz 12291 -IEFuZ2VsZXM= 12292 -IGdlbWFjaHQ= 12293 -IGhvbWVsZXNz 12294 -b2dyYXBoaWM= 12295 -IFRhaXdhbg== 12296 -IFNvbQ== 12297 -IEhhZA== 12298 -YWN0aW9ucw== 12299 -IHBvc3Rz 12300 -IG91dHJh 12301 -IE1lYW4= 12302 -a2Fy 12303 -IGNvdXM= 12304 -IGJyYWNr 12305 -0LjRgtGM0YHRjw== 12306 -IGJlbGlldmVz 12307 -IHN1aWNpZGU= 12308 -IGVxdWFsbHk= 12309 -IGNhcmVz 12310 -0L7QttC90L4= 12311 -IHN0ZW0= 12312 -IE11Y2g= 12313 -IHByb2R1Y2Vy 12314 -15XXkA== 12315 -IHByb3RlY3Rpbmc= 12316 -IFRSQVZJUw== 12317 -IGludGVydmlld3M= 12318 -IGFsaWVu 12319 -IEFzaw== 12320 -IHNvbGU= 12321 -Q08= 12322 -IFN1ZA== 12323 -IHN1cnZpdg== 12324 -IHNrZXRjaA== 12325 -IHfFgmE= 12326 -IGNvbG9j 12327 -IGFwb2xvZ2l6ZQ== 12328 -d2VpZ2h0 12329 -IDU1 12330 -ID4= 12331 -IGhlcm9lcw== 12332 -IEJvc3Rvbg== 12333 -IGRlcGVuZGVudA== 12334 -IG1vdGl2YXRpb24= 12335 -ZmxpeA== 12336 -IHNlYW0= 12337 -0LrQuNC1 12338 -IGRyYWlu 12339 -b2RlZA== 12340 -IGd1aWx0eQ== 12341 -IEplbm4= 12342 -aW5nZW4= 12343 -IGdyYW50ZWQ= 12344 -IEtlbGx5 12345 -IFNhdg== 12346 -IFVuY2xl 12347 -IEhvbmVzdGx5 12348 -RUxJ 12349 -IG5hdmlnYXRl 12350 -IGJsZXNzZWQ= 12351 -Y29yZQ== 12352 -IGVhcm5pbmc= 12353 -IHNpZ25hbHM= 12354 -IGRpc2s= 12355 -aWFscw== 12356 -IGFnZXM= 12357 -5oU= 12358 -IHBhcnRpY2xl 12359 -INGH0LXRgA== 12360 -IGNhbm4= 12361 -IHRpZXI= 12362 -IHN0YXRlbWVudHM= 12363 -6rOg7JqU 12364 -IOuVjOusuOyXkA== 12365 -IENobw== 12366 -IHBvbGFy 12367 -YW7Dpw== 12368 -IEtlbm4= 12369 -IE5p 12370 -IEZpZ2h0 12371 -b3JnYW4= 12372 -6ZU= 12373 -IENoYQ== 12374 -IFPDrQ== 12375 -44Oq 12376 -IHNsaWM= 12377 -IGNlcnRpZmlj 12378 -IHRlbXBsYXRl 12379 -IEZlZGVyYWw= 12380 -IGNvbnNpZGVyYXRpb24= 12381 -IGV4cGxv 12382 -IE1haW4= 12383 -IE5F 12384 -IGFsb25nc2lkZQ== 12385 -IGRyZXNzZWQ= 12386 -IFBvaW50 12387 -IGVudmlyb25tZW50cw== 12388 -IHByw7N4aW0= 12389 -IGRhYXI= 12390 -IHByb21wdA== 12391 -IHB1cnN1ZQ== 12392 -IGVudGVydGFpbm1lbnQ= 12393 -IHRocm9hdA== 12394 -IHByb2JsZW1h 12395 -IG1hcnQ= 12396 -7Lw= 12397 -IHByb3ZpZGVy 12398 -2Iw= 12399 -INeX 12400 -aW50ZQ== 12401 -bWFraW5n 12402 -IHN0cm9rZQ== 12403 -IHRpc3N1ZQ== 12404 -VW4= 12405 -IHByZWNpb3Vz 12406 -IEFydHM= 12407 -aW5raW5n 12408 -INCe0L0= 12409 -INC40YE= 12410 -bmFo 12411 -INCV0YHQu9C4 12412 -IGNvcm5lcnM= 12413 -IHRyaWNreQ== 12414 -aW5jaA== 12415 -bGlqaw== 12416 -IHByZXNzaW5n 12417 -bGV2ZWw= 12418 -QU5H 12419 -IHJhZGlhdGlvbg== 12420 -7ISg 12421 -IGNvbmZyb250 12422 -IHZldA== 12423 -IHJlcHJlc2VudGF0aXZl 12424 -IHByb3BhZw== 12425 -IGNyYXA= 12426 -IERlYw== 12427 -IHJhbXA= 12428 -0LXQv9C10YDRjA== 12429 -dcOpcw== 12430 -ZXNzZW4= 12431 -Y3JpcHRpb24= 12432 -IGJpbGxz 12433 -IE1hdHRoZXc= 12434 -IGFuaW1l 12435 -4bqldA== 12436 -IGxvd2VzdA== 12437 -aGFz 12438 -c2NyZWVu 12439 -b2dyYXA= 12440 -0LDQu9C+ 12441 -aW50b24= 12442 -IEphaA== 12443 -6ICF 12444 -aXTDoA== 12445 -IGtheQ== 12446 -IHJvdGF0aW9u 12447 -IFdlcmU= 12448 -YWJlaQ== 12449 -IHRyaWFscw== 12450 -IGxldmVy 12451 -aWdodHk= 12452 -IHNwb29u 12453 -IGh1bnQ= 12454 -Y2xpbmc= 12455 -IGRpc20= 12456 -INCx0L7Qu9GM0Yg= 12457 -IGFzc2F1bHQ= 12458 -IO2YlQ== 12459 -IHdlZWtseQ== 12460 -IG1pc21v 12461 -IGdlbmV0aWM= 12462 -dWxwdA== 12463 -IFN0dWRlbnQ= 12464 -IHJlYWxpc3RpYw== 12465 -IGF1dGhlbnRpYw== 12466 -5omT 12467 -YXN0YQ== 12468 -IGFycmVzdGVk 12469 -IGd1aWRlbGluZXM= 12470 -INec15A= 12471 -INC00LDQsg== 12472 -IENvbWluZw== 12473 -ZsO8cg== 12474 -IHJlcXVlc3Rz 12475 -g5A= 12476 -IGFuYWx5emU= 12477 -IGludGVyZXNz 12478 -IGhhbHQ= 12479 -IE9wZXI= 12480 -b25vbQ== 12481 -IGR1Y2s= 12482 -IHdpdGhk 12483 -c2Vy 12484 -IM+M 12485 -IEhpc3Rvcnk= 12486 -IHlvdXR1YmU= 12487 -44KN 12488 -IHNhYmVy 12489 -d2Fsaw== 12490 -Zm9udA== 12491 -IG92ZXJ2aWV3 12492 -Mzk= 12493 -w7x5 12494 -ZXR0aQ== 12495 -IGZyb3plbg== 12496 -IGZsZXNo 12497 -xJ9p 12498 -IFBN 12499 -IOyZgA== 12500 -6aI= 12501 -0YbQuNC4 12502 -IOq4sOs= 12503 -7YGs 12504 -IHByb3Nl 12505 -b29vbw== 12506 -cmF0ZXM= 12507 -V1M= 12508 -IGF1dG9tYXRpYw== 12509 -IGNvbGxlY3Rpbmc= 12510 -xZE= 12511 -IG5laWdoYm9ycw== 12512 -wrsu 12513 -IEV4cGw= 12514 -IGNpcmN1bA== 12515 -Y292ZXI= 12516 -d2Vn 12517 -IHN0aWNrcw== 12518 -IGVsbGVy 12519 -IHd3dw== 12520 -IGRvcm0= 12521 -IEV4cGVy 12522 -IHN0YXRpc3RpY3M= 12523 -IGVtYWlscw== 12524 -IGdyYXZl 12525 -aW1peg== 12526 -SFM= 12527 -IHVpdA== 12528 -LCc= 12529 -IGxhc2Vy 12530 -6Ik= 12531 -INGC0LXQvA== 12532 -0YvRiA== 12533 -0YnRkQ== 12534 -IGdlbmF1 12535 -IHRpZW5lbg== 12536 -IG1lZGl0YXRpb24= 12537 -IE9yZ2Fu 12538 -IGVzdGltYXRl 12539 -IOustOw= 12540 -bGV0cw== 12541 -IG7DoHk= 12542 -IG1pbmRzZXQ= 12543 -IHJlc29u 12544 -IG3DqXM= 12545 -IG51bWVyb3Vz 12546 -IHZpZWxsZWljaHQ= 12547 -IFRoaXJk 12548 -dW91cw== 12549 -IERlYWQ= 12550 -0LDQvdC0 12551 -SE4= 12552 -IHJhY2luZw== 12553 -IGFnZW50cw== 12554 -IFV0 12555 -IHRlYXI= 12556 -IEhQ 12557 -IGNoZW1pc3RyeQ== 12558 -IHN1cnZpdmFs 12559 -5paw 12560 -IGNvbnZpbmNlZA== 12561 -IDs= 12562 -IHJlZ3VsYXRpb25z 12563 -IEVT 12564 -5ZKM 12565 -MzAw 12566 -IGVuc2U= 12567 -IOy1 12568 -IGRpY3Q= 12569 -R0E= 12570 -IGFow60= 12571 -5YuV 12572 -IHRlag== 12573 -INC+0YHRgg== 12574 -IEVsZWN0 12575 -IGludGVsbGVjdHVhbA== 12576 -IGJpYXM= 12577 -IGJ1cmRlbg== 12578 -54K5 12579 -IOyWtOuWuw== 12580 -IGNoZWVy 12581 -IHNvcGg= 12582 -IHBvcnRmb2xpbw== 12583 -dWJh 12584 -IGVzdG9z 12585 -VFY= 12586 -Rm9y 12587 -IGFzaA== 12588 -IGtvbW1lcg== 12589 -IGNvbGxlY3RpdmU= 12590 -IHdyZXN0 12591 -IEpldHp0 12592 -IFdhdA== 12593 -cmVpY2g= 12594 -IHByaW1lcg== 12595 -YWN0aXZl 12596 -IG1pZQ== 12597 -aWNrZWQ= 12598 -IGh1bnRpbmc= 12599 -IHRlc3RpbQ== 12600 -IGNvbXBhc3Npb24= 12601 -INix 12602 -IGJydXQ= 12603 -IHNhbGFk 12604 -0L7QsdGJ0LU= 12605 -IHNvbHZpbmc= 12606 -IGZsb2F0aW5n 12607 -57c= 12608 -IGF0dHJhY3RpdmU= 12609 -2YjZhA== 12610 -IHBlcmQ= 12611 -aWZmZXI= 12612 -IHNjdWxwdA== 12613 -aGho 12614 -IFdlZWs= 12615 -IGVudGh1cw== 12616 -IG5hZA== 12617 -IG1lcmNo 12618 -IO2ZlQ== 12619 -IG1pbGU= 12620 -5aW95LqG 12621 -IM64 12622 -IOuCmOs= 12623 -6YeN 12624 -Mzg= 12625 -IGNoYWlucw== 12626 -IEFsbW9zdA== 12627 -IHRpY2tldHM= 12628 -cmlu 12629 -IEND 12630 -IGRpc3RyaWJ1dGVk 12631 -YWJldGVz 12632 -IHRlbXBlcmF0dXJlcw== 12633 -IGdhaW5lZA== 12634 -IGZsZXhpYmlsaXR5 12635 -IHNjcmVhbWluZw== 12636 -IGFicm9hZA== 12637 -dW5v 12638 -IGVudHJlcHJlbmV1cnM= 12639 -IE5ldHdvcms= 12640 -IENhbmFkaWFu 12641 -IHByZXY= 12642 -IHPDtg== 12643 -INGC0LXQsdGP 12644 -IFBva2U= 12645 -IFBvZA== 12646 -IFR1cmtleQ== 12647 -54++5Zyo 12648 -IGFic3RyYWN0 12649 -IHNuYWtl 12650 -IEFteQ== 12651 -IOuKkOuCjA== 12652 -IGJyYXZl 12653 -IOyeiOyWtOyalA== 12654 -IEthbA== 12655 -IDIwMDc= 12656 -w6FyaW8= 12657 -IG1hcmtlZA== 12658 -Z2luZXM= 12659 -IGFsbG9j 12660 -T05H 12661 -IHNjaWVudGlzdA== 12662 -IGVzY2E= 12663 -IHJhY2lzbQ== 12664 -15HX 12665 -IFNhbXM= 12666 -IFBlbm4= 12667 -IGxvYWRz 12668 -IOCuqA== 12669 -w7xiZXI= 12670 -TWU= 12671 -aXjDsg== 12672 -IHBlcsOy 12673 -YW5uZQ== 12674 -IGV4cHJlc3NlZA== 12675 -0LzQtdGA 12676 -IG1vZXQ= 12677 -IHJldHVybmluZw== 12678 -bmlh 12679 -IGV4cG9u 12680 -UHJv 12681 -IGxveWFs 12682 -TUw= 12683 -IGxhbXA= 12684 -IHNoeQ== 12685 -IGNvbXBvc2l0aW9u 12686 -IEx5 12687 -IG1hZ25ldGlj 12688 -IHByZW1pZXI= 12689 -IG1lYXN1cmVk 12690 -IHN1bW1hcnk= 12691 -IGF0dGFja2Vk 12692 -IGZpbmlzaGluZw== 12693 -0Jc= 12694 -56U= 12695 -IHNpdHM= 12696 -IGh5ZHJvZ2Vu 12697 -IG1haQ== 12698 -IERldXRzY2g= 12699 -YXPEsQ== 12700 -IG9idGFpbg== 12701 -dmll 12702 -IHNvaXQ= 12703 -IOuwlA== 12704 -IGxhbmU= 12705 -IGNvbnNlZ3U= 12706 -0LLQvg== 12707 -IGVhc2U= 12708 -YWtpbg== 12709 -IEZh 12710 -IHVudHVr 12711 -IGJ1cnN0 12712 -IGN1bQ== 12713 -YWzEsW0= 12714 -w7pibGlj 12715 -aWRp 12716 -IFJveWFs 12717 -IEtvbg== 12718 -IGNvbW1vbmx5 12719 -IHJlbW92aW5n 12720 -IGp1cg== 12721 -aWxpYg== 12722 -IGFuY2g= 12723 -7ZaJ 12724 -xrDhu6M= 12725 -INCc0Ys= 12726 -IEFudGg= 12727 -IFPDpQ== 12728 -IGludGVycnVwdA== 12729 -IHN0ZXJl 12730 -IE9T 12731 -b255bQ== 12732 -dGVyeQ== 12733 -IE1hcmlh 12734 -6rKD 12735 -IGV4cGxvcmluZw== 12736 -IHRyYW5zcGFyZW50 12737 -IGZhdGU= 12738 -IEp1bmc= 12739 -IGdydXA= 12740 -IGRhcmtlcg== 12741 -IERvdWc= 12742 -IG1hbmU= 12743 -5pS+ 12744 -4bqhaQ== 12745 -ZHJp 12746 -bG9vaw== 12747 -IERlc2lnbg== 12748 -IHR1dGFq 12749 -IGhvcml6b250YWw= 12750 -cmVvbg== 12751 -b3J0ZQ== 12752 -IENvcnJlY3Q= 12753 -IFN0ZXZlbg== 12754 -IHZpbmU= 12755 -MDI= 12756 -acSH 12757 -IHNpZW1wcmU= 12758 -IEtleQ== 12759 -5YOP 12760 -IEdhbWVz 12761 -IG5hYXI= 12762 -IHNob2NrZWQ= 12763 -ZWx2ZQ== 12764 -IFJvc2U= 12765 -7Ius 12766 -IHN0b3BwaW5n 12767 -b2hs 12768 -IE1peA== 12769 -IHN1ZmZlcmVk 12770 -IHNpZ21h 12771 -IHdlYWtuZXNz 12772 -IE93 12773 -4Li14LmI 12774 -SUY= 12775 -IOCuhQ== 12776 -YWRlZA== 12777 -IE5ldGZsaXg= 12778 -YW5lcw== 12779 -IHJlbWFpbmVk 12780 -aXJ5 12781 -IHJpcA== 12782 -ZWxsdA== 12783 -IHNpbGVudA== 12784 -IHByb3Zlbg== 12785 -IHRveGlj 12786 -IGFsdW1pbg== 12787 -IG11bHRpcGw= 12788 -YWxhbmQ= 12789 -IDM0 12790 -MDY= 12791 -IEJydQ== 12792 -IOygleunkA== 12793 -SnVzdA== 12794 -Ym95 12795 -IHNob2U= 12796 -IGNyZWF0dXJl 12797 -IGhlYWRlZA== 12798 -INC+0YLQug== 12799 -5rE= 12800 -IGVzc2VuY2U= 12801 -IHJlbWFya2FibGU= 12802 -IG7Dum1lcg== 12803 -IGRyZXc= 12804 -IHB1enpsZQ== 12805 -IExpYnJhcnk= 12806 -IEZ1 12807 -YXNoZXM= 12808 -a2s= 12809 -IElzdA== 12810 -prA= 12811 -IEJyeQ== 12812 -IGNlcmVtb255 12813 -IOCujg== 12814 -IGNyaQ== 12815 -ZXF1 12816 -44Ki 12817 -IHByaXpl 12818 -IGRpbWVuc2lvbnM= 12819 -b2dyYW0= 12820 -IGxlYXRoZXI= 12821 -IHBvcHVsYXRpb25z 12822 -dXVt 12823 -IHZlZ2Fu 12824 -0Y/QtA== 12825 -IGPDs21v 12826 -5YQ= 12827 -IHN0cmlw 12828 -5aM= 12829 -IHZhY2F0aW9u 12830 -hZU= 12831 -IG1lYWxz 12832 -aWxpcHA= 12833 -IGVudHM= 12834 -YXJhbQ== 12835 -cmljaHQ= 12836 -IGdyYWlu 12837 -IFNwYWlu 12838 -IGNoZWVr 12839 -IEFmZg== 12840 -SU9O 12841 -IEJyaW5n 12842 -IDM4 12843 -aWVsZW4= 12844 -dWx1 12845 -INCx0L7Qu9GM0YjQtQ== 12846 -IGFubm91bmNlbWVudA== 12847 -INGC0YPRgg== 12848 -IFByb3BoZXQ= 12849 -YXJkbw== 12850 -Mzc= 12851 -IHdva2U= 12852 -IHRyYW5zbGF0aW9u 12853 -IE5PVA== 12854 -IENM 12855 -IGTDvMWf 12856 -0YbRlg== 12857 -YWNlcg== 12858 -IExvYw== 12859 -IHBlcmNlcHRpb24= 12860 -Tk8= 12861 -IGRpZXNlbg== 12862 -TG9vaw== 12863 -aGVhcnQ= 12864 -YXZlZA== 12865 -IGJvdW5kYXJ5 12866 -IGZsb3dz 12867 -0ZHQvA== 12868 -IGFyZ3VtZW50cw== 12869 -IGVsZWN0aW9ucw== 12870 -xLFz 12871 -IGhlY2s= 12872 -IHN1aXRhYmxl 12873 -IGZpYmVy 12874 -IFN0cmE= 12875 -eHk= 12876 -IEh1bQ== 12877 -IG1vbnRobHk= 12878 -dXBlcg== 12879 -IGdvbGY= 12880 -IGxhdGVseQ== 12881 -IEdhcmQ= 12882 -IFJlbg== 12883 -IEFzdA== 12884 -IEZhbnQ= 12885 -0LDRgdGB 12886 -IG9ic2Vy 12887 -66Gc 12888 -IGVhc2llc3Q= 12889 -jZTr 12890 -IHdlYnNpdGVz 12891 -cG9s 12892 -IGNvY29u 12893 -IOCuhw== 12894 -IFZlZw== 12895 -IHdhbGtz 12896 -IGludHJv 12897 -IGRpcmVjdGVk 12898 -IEFubmE= 12899 -IOuTpOyWtA== 12900 -IEVhc3Rlcm4= 12901 -IFNhaW50 12902 -IEJvdw== 12903 -IHJvYXN0 12904 -IFVSTA== 12905 -IGplZGVu 12906 -dXJhcw== 12907 -YWph 12908 -IHNlbWk= 12909 -IHJhcGlkbHk= 12910 -IHRhcmdldHM= 12911 -IENvbnRyb2w= 12912 -IGJhaA== 12913 -IHJlZmxlY3Rpb24= 12914 -IGNyZWF0aXZpdHk= 12915 -aG9sZGVycw== 12916 -IOyYrOs= 12917 -IGFtb25nc3Q= 12918 -IGZlZWRpbmc= 12919 -0Y3RgtC+0LzRgw== 12920 -INCy0LjQtNC1 12921 -IOunjOuTpA== 12922 -IFNtYXJ0 12923 -IHJlbGlhYmxl 12924 -IHZlemVz 12925 -INeo 12926 -Y2h1Y2tsZXM= 12927 -YXppb25l 12928 -IFdpbGxpYW1z 12929 -IGHDpw== 12930 -IHNsZWU= 12931 -0LXRiQ== 12932 -IHRpbWVsaW5l 12933 -IHRob3JvdWdo 12934 -4buN 12935 -IE90 12936 -4bqhbg== 12937 -IGltYWdpbmF0aW9u 12938 -IG1lY2hhbmljcw== 12939 -cmlzdA== 12940 -IGNsYWltZWQ= 12941 -z4TOtw== 12942 -w6p0ZQ== 12943 -IEh1cnJ5 12944 -IGlQYWQ= 12945 -IGNvbnN0cnU= 12946 -IENsYQ== 12947 -IEFscw== 12948 -5Lya 12949 -dXR6 12950 -IGN1bHR1cmVz 12951 -IOyWtOuWu+qyjA== 12952 -IGJlbG9uZ3M= 12953 -IHllcg== 12954 -IERvZXNu 12955 -IGdlb21ldA== 12956 -IGJpZA== 12957 -IGZvYW0= 12958 -IGhvYg== 12959 -IEJyaXRhaW4= 12960 -IHN1YnN0YW5jZQ== 12961 -IGFubml2ZXJzYXJ5 12962 -IOuEiA== 12963 -IG5vdGVk 12964 -IGdvdmVybm9y 12965 -IHN0b2Nrcw== 12966 -MzE= 12967 -IGRpeWU= 12968 -7Iqk6w== 12969 -IHJlYg== 12970 -emVs 12971 -IG11bHRpcGx5 12972 -IG9wZXJhdG9y 12973 -hKTsmpQ= 12974 -IHdhdGVycw== 12975 -IGTDpHI= 12976 -IHVuc2Vy 12977 -IEVsaXphYmV0aA== 12978 -6auY 12979 -IGluY3JlYXNpbmdseQ== 12980 -IEdybw== 12981 -IGVuZ2luZXM= 12982 -aXJz 12983 -2Ks= 12984 -IHRyZWFzdXJl 12985 -UEM= 12986 -aW5jdGlvbg== 12987 -aXJp 12988 -IGFjY3Vt 12989 -IHZhcmlhdGlvbg== 12990 -IHBvbQ== 12991 -IHRpdGxlcw== 12992 -IEZlc3Q= 12993 -w7Nz 12994 -IGVsZGVy 12995 -bnlt 12996 -cnVu 12997 -0Y/Qsg== 12998 -IGlubm92YXRpdmU= 12999 -IG5vbWJyZQ== 13000 -IGNvaW5j 13001 -IGZyYW5jaA== 13002 -IGVudG9uY2Vz 13003 -IG5pY2h0cw== 13004 -IGV4Y2x1c2l2ZQ== 13005 -IENoZWVycw== 13006 -IEJp 13007 -dWpl 13008 -5q2h 13009 -IHBvaw== 13010 -IFByZW0= 13011 -IHJvY2tldA== 13012 -RUxJUEU= 13013 -IGhvc3BpdGFscw== 13014 -cml1bQ== 13015 -IGp1c3Rl 13016 -IGhhbW1lcg== 13017 -IHF1YW50dW0= 13018 -IHJlc3BvbnNlcw== 13019 -bGx5 13020 -ZW5kaQ== 13021 -IGFjdGl2ZWx5 13022 -IGZyaWRnZQ== 13023 -aWF0ZQ== 13024 -bG9uZw== 13025 -IHF1ZW0= 13026 -IGRlYXRocw== 13027 -IHN1cGVyaW9y 13028 -Y2tlbg== 13029 -7J207JeQ 13030 -a3RvcA== 13031 -IGdhdGhlcmVk 13032 -o6g= 13033 -IGRhenU= 13034 -IHJlY2lwZXM= 13035 -IGJ1eno= 13036 -Y2Vu 13037 -IGFueXRpbWU= 13038 -b25zZW5zZQ== 13039 -IGNpcmNsZXM= 13040 -IHNvbHZlZA== 13041 -IOyLoA== 13042 -IGNvcm9uYXZpcnVz 13043 -IEx1a2U= 13044 -IGJ1YmI= 13045 -IGNvbnRlbXBvcg== 13046 -cnp5 13047 -IEphbmU= 13048 -INC00L7QvA== 13049 -IHNjcmV3cw== 13050 -IGh5YnJpZA== 13051 -IGNhc3VhbA== 13052 -IHNlbGJzdA== 13053 -YmVpbmc= 13054 -IMSQ 13055 -IENvbHVtYg== 13056 -INGF0L7Rhw== 13057 -IGJ1Y2tldA== 13058 -IGV2YWx1YXRl 13059 -IGlkb2w= 13060 -IHJlcHV0YXRpb24= 13061 -IOyGjOs= 13062 -2YjYsQ== 13063 -IGhlY2hv 13064 -IHBvZW0= 13065 -IHN1YmplY3Rz 13066 -cGxhbnQ= 13067 -IEJlaA== 13068 -IFNwZWFraW5n 13069 -IGJhdHRlcmllcw== 13070 -IGZvbGxvd2Vycw== 13071 -w7Zs 13072 -IGdlbnRseQ== 13073 -IHNpeHQ= 13074 -IHBhcmFtZXRlcg== 13075 -IGlra2U= 13076 -IFRvdXI= 13077 -IERK 13078 -b3R0ZQ== 13079 -IEphaHJlbg== 13080 -IHByZXBhcmF0aW9u 13081 -INC00YPQvA== 13082 -IDgwMA== 13083 -Y29w 13084 -aWtpbmc= 13085 -IOusuA== 13086 -INC90YM= 13087 -INC70LXRgg== 13088 -5ZCM 13089 -IElkZQ== 13090 -IOyhsOq4iA== 13091 -IGxhdWdodGVy 13092 -IG1vbGVjdWxlcw== 13093 -IFJlc3Q= 13094 -IG9ic2VydmVk 13095 -ZHppZQ== 13096 -IGFkdmVydGlzaW5n 13097 -ZXJ0bw== 13098 -IG1vaW5z 13099 -IE1JVA== 13100 -IGV4Y2l0 13101 -IHR1bQ== 13102 -IHR5bA== 13103 -IGludmVzdGVk 13104 -IHBoYXJt 13105 -IHVuZXhwZWN0ZWQ= 13106 -IHBoaQ== 13107 -b3R5cGU= 13108 -d2Vpc2U= 13109 -IGdlw6c= 13110 -am91cmQ= 13111 -IGhvcnNlcw== 13112 -bsSF 13113 -PSI= 13114 -IFNN 13115 -IGZpYg== 13116 -IGNsaXBz 13117 -55W2 13118 -5aaC5p6c 13119 -IHJlZ2ltZQ== 13120 -IHJvdGF0ZQ== 13121 -cm91 13122 -bmlr 13123 -IGFybW9y 13124 -8J+Y 13125 -0LXRgNCw 13126 -5bqm 13127 -IE9jaA== 13128 -IHJpY2h0aWc= 13129 -w7x6ZWw= 13130 -YW5lb3VzbHk= 13131 -bWVr 13132 -6Yyv 13133 -IFhpYW8= 13134 -IGV4aXN0ZWQ= 13135 -d29ydGg= 13136 -44Gj44Go 13137 -IG5hdWdodA== 13138 -IGhlacOfdA== 13139 -IEJhbA== 13140 -IHJlc2lk 13141 -aXZvdA== 13142 -b21hdGlj 13143 -IGhpcmVk 13144 -IGdyYWR1YWxseQ== 13145 -IG9uaW9ucw== 13146 -IGNvbXBhdA== 13147 -IGludGlt 13148 -IGpldw== 13149 -IGNvbnRyaWJ1dGlvbg== 13150 -IElyZQ== 13151 -YWNqaQ== 13152 -IHNsaWNl 13153 -IGltbXVu 13154 -IFJ1cw== 13155 -IGdyb3dz 13156 -IFNpbWlsYXJseQ== 13157 -IGhhcmRlc3Q= 13158 -IHN0cnVjaw== 13159 -IG1lYXN1cmVtZW50 13160 -Li4uXQ== 13161 -dGhleQ== 13162 -IOyggOs= 13163 -IHNuZWFr 13164 -IGFwcGxpZXM= 13165 -INC90LXQvA== 13166 -5pM= 13167 -15HXqA== 13168 -INCn0YLQvg== 13169 -IG91dHJv 13170 -IGlubm9jZW50 13171 -IG1vZw== 13172 -IFNhbXN1bmc= 13173 -IG1lcmN5 13174 -IGhhbmRsaW5n 13175 -IGludGVydmVudGlvbg== 13176 -aWRheXM= 13177 -Z290 13178 -IGN1cnJpYw== 13179 -IGJvdW5kYXJpZXM= 13180 -IGNvbmZ1c2luZw== 13181 -nbzripQ= 13182 -5oc= 13183 -IHN0aXRjaGVz 13184 -w612ZWw= 13185 -IHR1bm5lbA== 13186 -aXTDpA== 13187 -IGdvc3Q= 13188 -aW15 13189 -IGN6YXM= 13190 -IG3DqQ== 13191 -IGNhdGFs 13192 -IFNpbW9u 13193 -IExJQU0= 13194 -bWlj 13195 -INCk 13196 -IGV5ZWw= 13197 -aXNhcw== 13198 -IENQVQ== 13199 -IERvdQ== 13200 -IG7DpGNo 13201 -IGluZmluaXR5 13202 -IHJpZg== 13203 -IFBlYWNl 13204 -IEN1 13205 -IG1pbmltYWw= 13206 -IGxpc3RlbmVk 13207 -IHBvbGU= 13208 -aGFsYg== 13209 -IGxvYWRlZA== 13210 -IHN0ZWFkeQ== 13211 -IEJlc2lkZXM= 13212 -w6pt 13213 -IGxhcA== 13214 -IGNvb3A= 13215 -IGZyaWVuZHNoaXA= 13216 -d29ybGQ= 13217 -IGdlaA== 13218 -IHR5bGtv 13219 -IExhdXJh 13220 -IHN1cnJvdW5kZWQ= 13221 -IEV2ZW50 13222 -IGNoYXA= 13223 -IFdvbmRlcg== 13224 -YnJlYWs= 13225 -IGRyb3Zl 13226 -IGJyb2FkZXI= 13227 -IGNoaQ== 13228 -Rmk= 13229 -IGdlaGVu 13230 -IHdlc3Rlcm4= 13231 -IGludGVsbGlnZW50 13232 -IHBlcnNpc3Q= 13233 -IGZvdW5kZWQ= 13234 -44GT44Go 13235 -IGhpc3Rvcmlj 13236 -IGZyw6U= 13237 -Y2tzw6U= 13238 -IGhhbmR5 13239 -IHN5bXA= 13240 -IHJvd3M= 13241 -IG51dHJp 13242 -YnVy 13243 -IExlb24= 13244 -IHNpc3RlbWE= 13245 -IGV4dGVuc2l2ZQ== 13246 -INGD0LI= 13247 -7Y8= 13248 -IG5pZ2h0cw== 13249 -IGPDoWM= 13250 -IGNvdW50aW5n 13251 -IE11c3Q= 13252 -YWxsb3c= 13253 -0LXRgdGB 13254 -TW9t 13255 -INC90LDQtNC+ 13256 -IGJhcnJlbA== 13257 -44Oe 13258 -QVJE 13259 -IGluc3RhbGxhdGlvbg== 13260 -IGluc2VjdA== 13261 -IOuFuOs= 13262 -dWrEhQ== 13263 -IMSRaQ== 13264 -IHBhY2tlZA== 13265 -IGZpY3Rpb24= 13266 -Tm93 13267 -IFlheQ== 13268 -IHBlcnQ= 13269 -cm9ucw== 13270 -dW5kZQ== 13271 -YWNoZXM= 13272 -IHN0eWxlcw== 13273 -IGFwcsOocw== 13274 -b2t1 13275 -IFZpY2U= 13276 -xLFuxLF6 13277 -Y29tbQ== 13278 -IGFzc2lnbmVk 13279 -IGludGVyYWN0aW9ucw== 13280 -IGFjYWI= 13281 -RkVMSVBF 13282 -IHJlc2N1ZQ== 13283 -IGluZHVzdHJpZXM= 13284 -IEFuZHk= 13285 -IHByYWlzZQ== 13286 -IGZsYW1l 13287 -IHNuYWNr 13288 -7YI= 13289 -54E= 13290 -IHN3bw== 13291 -cmVuZGVy 13292 -IGJvYXJkcw== 13293 -INGC0L7QvA== 13294 -ZW5uZQ== 13295 -IHBhc3Rh 13296 -IGRldmls 13297 -IEZlbA== 13298 -IGhhdHRl 13299 -IGNvbGxlZw== 13300 -ZWg= 13301 -7Ls= 13302 -44GT44Gu 13303 -IHByb2R1Y3RpdmU= 13304 -Zm9yd2FyZA== 13305 -0LjQvw== 13306 -IHNtYXJ0cGhvbmU= 13307 -IGludmlz 13308 -IGJ1bQ== 13309 -IHdob2E= 13310 -7J6E 13311 -IG9ja3PDpQ== 13312 -IExhbmc= 13313 -IFN5cmlh 13314 -IHNlc2k= 13315 -zq/OsQ== 13316 -IGFwcHJvdmFs 13317 -NDg= 13318 -INC+0LTQuNC9 13319 -IOuW 13320 -IEhhcnI= 13321 -IEFkbWluaXN0 13322 -INek 13323 -IERlYW4= 13324 -Zmk= 13325 -IGNpdGl6ZW4= 13326 -IHNoYXJr 13327 -MDU= 13328 -IGJvaWw= 13329 -IGluZGljYXRl 13330 -5aE= 13331 -QXJl 13332 -IGxheW91dA== 13333 -IHJlZnI= 13334 -IFBhY2lmaWM= 13335 -QUFBQQ== 13336 -IEF1c3RyYWxpYW4= 13337 -Z3Jlc3Npb24= 13338 -Vm9pY2U= 13339 -0LDQu9GB0Y8= 13340 -IHNoZWx0ZXI= 13341 -VG8= 13342 -YXVwdA== 13343 -IGV2YWx1YXRpb24= 13344 -YXBvcg== 13345 -IGN1cnJlbmN5 13346 -INC80L3QvtCz0L4= 13347 -aWdvcw== 13348 -44Gw 13349 -IG9jdA== 13350 -IHJveWFs 13351 -6LM= 13352 -YXNpbA== 13353 -IENoaWxkcmVu 13354 -IHJpZW4= 13355 -IOuTnOs= 13356 -IGJhcnJpZXI= 13357 -IGVqZW1wbG8= 13358 -IGVr 13359 -TkQ= 13360 -ZXNw 13361 -0LXQvdCw 13362 -IHBpYw== 13363 -IGtpbGxlcg== 13364 -IGludGVncmF0ZQ== 13365 -IGZld2Vy 13366 -IGRpc2FiaWxpdGllcw== 13367 -IC4uLi4= 13368 -IHRyaWFuZ2xl 13369 -IGZlZXM= 13370 -IHdpZGVseQ== 13371 -ZW1p 13372 -IG92ZXJ3aGVsbWluZw== 13373 -IHpvbWI= 13374 -IGJlcmU= 13375 -IGhvb2Q= 13376 -IEF5ZQ== 13377 -IEhhcnZhcmQ= 13378 -ZXY= 13379 -IM+Ezr/PhQ== 13380 -IGN1cHM= 13381 -IEF1Y2g= 13382 -em9uYQ== 13383 -IDE5OTA= 13384 -IHdlacOf 13385 -IGNydW5jaA== 13386 -5qU= 13387 -INC30LDQsg== 13388 -IG1lYXN1cmluZw== 13389 -IHN0YXRpb25z 13390 -IFN0ZXBoZW4= 13391 -IHNob3J0bHk= 13392 -IHNpZ25pbmc= 13393 -IGNvbWVkeQ== 13394 -b21v 13395 -IHN1Z2dlc3Rpb25z 13396 -IHNpZ25hdHVyZQ== 13397 -INC/0YDQuNCy 13398 -IGRpc29yZGVy 13399 -YXNrYQ== 13400 -IHdvcmxkcw== 13401 -IHByZWNpc2VseQ== 13402 -bm9ybQ== 13403 -cmF2 13404 -IENpdmls 13405 -SW50ZXI= 13406 -IENlcnRhaW4= 13407 -IGluanVyZWQ= 13408 -IHN1Z2dlc3Rz 13409 -IEdvbGRlbg== 13410 -IGN5YmVy 13411 -INi0 13412 -IHRlbXBvcmFyeQ== 13413 -IGNvb3Blcg== 13414 -IHZvdGVk 13415 -IG91Z2h0 13416 -4bqleQ== 13417 -eHVhbA== 13418 -IHBhbmVscw== 13419 -IDk1 13420 -IGhhbmRzb21l 13421 -INC/0YDQvtCy 13422 -IHBlcm1pdA== 13423 -IGtlaW4= 13424 -IGJhZGx5 13425 -IG5vdGlmaWNhdGlvbnM= 13426 -aXph 13427 -IE5vdGljZQ== 13428 -IGluY2x1c2l2ZQ== 13429 -IGFuc3dlcmluZw== 13430 -IO2X 13431 -dWxk 13432 -7YWM 13433 -IG5vd2FkYXlz 13434 -IDM3 13435 -IGJvbHQ= 13436 -IHN0YXRpYw== 13437 -IEhvcA== 13438 -IGF2YW50 13439 -YWpv 13440 -IOunm+yeiA== 13441 -IGZpZnR5 13442 -IEZpbmFs 13443 -IHNjb3Jlcw== 13444 -IFRhcA== 13445 -IGN5bA== 13446 -IGNvbnZpbmNl 13447 -IGFueXdheXM= 13448 -b2Rh 13449 -IOyVvA== 13450 -IHNlcnZlcw== 13451 -INGC0LDQutC+0Lk= 13452 -IFpvb20= 13453 -IHNhdmluZ3M= 13454 -dWxv 13455 -IHNvdXRoZXJu 13456 -dmlld2Vy 13457 -IGhvamU= 13458 -IHNlamE= 13459 -IHJlcHJlc2VudGluZw== 13460 -iOuNmA== 13461 -bGlr 13462 -IFNvbWVib2R5 13463 -IGJlYXN0 13464 -IHN0aWNraW5n 13465 -IGluc2lzdA== 13466 -IHRhbGVudGVk 13467 -IGV4cGxhaW5pbmc= 13468 -IGF0dG9ybmV5 13469 -6YOo 13470 -IHN0YWlycw== 13471 -IERvZw== 13472 -7Ys= 13473 -IGNpZw== 13474 -IHNoYXBlZA== 13475 -IHNvbnM= 13476 -z4HOuQ== 13477 -dXR0 13478 -IOyU 13479 -IHBhcmFk 13480 -7J24642w 13481 -IGhvcm4= 13482 -IEpvdXI= 13483 -YW5ubw== 13484 -IHdvcmxkd2lkZQ== 13485 -5Yqb 13486 -IHBhcnRpY2lwYXRpb24= 13487 -poQ= 13488 -IG3Ds3c= 13489 -IGJ1cm5lZA== 13490 -IHdyaXRlcnM= 13491 -YWxsYWg= 13492 -IEZ1bmQ= 13493 -IGNsZXZlcg== 13494 -IExldXRl 13495 -Ymlu 13496 -IGJlYXRpbmc= 13497 -Zm9vdA== 13498 -IOybkA== 13499 -IFN0dWRpbw== 13500 -IHZhZw== 13501 -YmV5 13502 -cnpl 13503 -IG9wcG9zaXRpb24= 13504 -INC20LjQtw== 13505 -d2hv 13506 -IOqxtA== 13507 -IHRyYWNl 13508 -INC00LXQvdGM 13509 -IGVwaWQ= 13510 -IGdlc2No 13511 -IE5hcg== 13512 -IEJF 13513 -0YPQuQ== 13514 -IFNpZ24= 13515 -ZWRseQ== 13516 -IGNsYXk= 13517 -IGluc3RhbnRseQ== 13518 -IGdhdGhlcmluZw== 13519 -IEdhbGF4eQ== 13520 -IGJvcmVk 13521 -IEJ1ZGRo 13522 -Y8Op 13523 -IG1hbQ== 13524 -IHNsb3Bl 13525 -IOuLpOydjA== 13526 -IHNjaMO2bg== 13527 -IHBpcg== 13528 -Z2Vm 13529 -YW1lcg== 13530 -IGjDtg== 13531 -IGNvbGxlYWd1ZQ== 13532 -IHByZXNlbnRz 13533 -YWRpdW0= 13534 -IOCutQ== 13535 -IGZhbGFy 13536 -YmVlcA== 13537 -IGRyaWVk 13538 -aXNtcw== 13539 -IHJvcGU= 13540 -IHdvcmtzaG9w 13541 -IGVzdHVk 13542 -IGJhbmRz 13543 -IHRoZW1lcw== 13544 -5YWs 13545 -2YrYsQ== 13546 -5ZCO 13547 -IHJlbWluZGVy 13548 -0YLRgw== 13549 -IEJo 13550 -IGNvY29udXQ= 13551 -INGB0YLQvg== 13552 -IENoYW5uZWw= 13553 -IGltbWlncmF0aW9u 13554 -w6Rz 13555 -Li4uLi4= 13556 -5Li7 13557 -55m9 13558 -c3RvcA== 13559 -INC60LDRgA== 13560 -IGNvaW5z 13561 -INGH0LDRgQ== 13562 -IGRlc3RydWN0aW9u 13563 -bGluZWQ= 13564 -IGJhcnJpZXJz 13565 -YW50aW5l 13566 -IHByaW50ZWQ= 13567 -IGNvbmdyYXR1bGF0aW9ucw== 13568 -IEhlYXJ0 13569 -IGlucXU= 13570 -dGhh 13571 -IGhhcmRseQ== 13572 -IEF2ZW4= 13573 -IHRpbmhh 13574 -IFNvbnk= 13575 -IE5G 13576 -IGdyYWR1YXRlcw== 13577 -IHNxdWVlemU= 13578 -ZXJlbXk= 13579 -z4TOuQ== 13580 -IGVwaWM= 13581 -IEp1 13582 -IG9sbQ== 13583 -IExhdWdodGVy 13584 -IGJlbGllZnM= 13585 -IENydQ== 13586 -IFRydWU= 13587 -IFNvdWw= 13588 -b3dlZW4= 13589 -IHJvbWFudGlj 13590 -INC30LI= 13591 -IGFub3M= 13592 -IFl1cA== 13593 -6Zi/ 13594 -ZGlt 13595 -IGluZmVy 13596 -INC30LDQvA== 13597 -IHNvYw== 13598 -dWth 13599 -IHByZWNpc2U= 13600 -IGRyb3BwaW5n 13601 -IGNsdWU= 13602 -IGVycm9ycw== 13603 -Y2hhcmdl 13604 -IFB1 13605 -b21ldGVy 13606 -IGxhbWJkYQ== 13607 -YWNpb25hbA== 13608 -IERvbmc= 13609 -IGNoYW1iZXI= 13610 -IHRoYW5rZnVs 13611 -IE51 13612 -IEhhd2Fp 13613 -IGluZm8= 13614 -IGFjdGl2YXRl 13615 -IFF1YWw= 13616 -IHF1ZWQ= 13617 -0YPQu9GM 13618 -IGNsb3Ro 13619 -5Zac 13620 -IHdpY2h0aWc= 13621 -NTU= 13622 -IG90cmE= 13623 -b2dyYXBoZXI= 13624 -IGN1cmlvcw== 13625 -IDE5ODA= 13626 -IGVtcHJlcw== 13627 -ZGVzcw== 13628 -ZXVy 13629 -IGNsdXN0ZXI= 13630 -YXJ0ZXI= 13631 -b2JpbGU= 13632 -IFlhbg== 13633 -IEFkdg== 13634 -IGRpc2NpcGxpbmU= 13635 -IOygleuPhA== 13636 -IFBsYWNl 13637 -IFNlbGVjdA== 13638 -VEU= 13639 -INCx0YvQu9Cw 13640 -IHdoaXM= 13641 -IGJheQ== 13642 -IERvcg== 13643 -ZW5jaW5n 13644 -IHJlcGV0 13645 -IGZpY2Fy 13646 -cGFk 13647 -IGZvZw== 13648 -dXlvcg== 13649 -IHNuYXA= 13650 -aWJ0 13651 -IHNvYmll 13652 -IGFwcG9pbnRtZW50 13653 -IFJ5 13654 -IGNlaWxpbmc= 13655 -b3Vyc2U= 13656 -IHdyaXRlcw== 13657 -IEFmZ2hhbmlzdGFu 13658 -IG1vcw== 13659 -YXpl 13660 -IHBlbmFs 13661 -IGNyeXN0YWw= 13662 -SUNF 13663 -6rCQ 13664 -6Z8= 13665 -IFRlc2xh 13666 -IHRoZW9yaWVz 13667 -IGFwcGVhbA== 13668 -IG5ld3NwYXBlcg== 13669 -IGNvb2tpZXM= 13670 -5qk= 13671 -INin2YTZhA== 13672 -IG1hag== 13673 -IEdldHRpbmc= 13674 -a29tbWVu 13675 -IEhlYXZlbg== 13676 -ZWxscw== 13677 -IGRpdmluZQ== 13678 -xKs= 13679 -IGFrdA== 13680 -IGhvcGVz 13681 -IENoZW4= 13682 -d2VnZW4= 13683 -Kioq 13684 -IEZyYWdl 13685 -INC90Lg= 13686 -4Li5 13687 -bWluaXN0ZXI= 13688 -bmVzb3Rh 13689 -d2hpY2g= 13690 -IGV4cGxpY2l0 13691 -IHZlcmRhZA== 13692 -IGdyYWR1YXRlZA== 13693 -IFBoaWxpcHA= 13694 -UUw= 13695 -IE1J 13696 -IGRldm90 13697 -IGN1cmU= 13698 -IGNsb3Nlc3Q= 13699 -IMOE 13700 -IHNleHk= 13701 -44Gb 13702 -IERlYXRo 13703 -b2tv 13704 -dWd1 13705 -IEFubmU= 13706 -aXRhcmlhbg== 13707 -ZXNh 13708 -0LXQs9C+0LQ= 13709 -IER1cg== 13710 -IDAwMA== 13711 -emVpdA== 13712 -IHRvdXJuYW1lbnQ= 13713 -IG1lbGhvcg== 13714 -4Liq 13715 -IGluZHU= 13716 -IGZsYXc= 13717 -IHdhcnM= 13718 -IE1pbmQ= 13719 -IElyb24= 13720 -0YLQsNC6 13721 -IFZS 13722 -IHNpeg== 13723 -IFNvdXRoZXJu 13724 -IOq3uOufrOs= 13725 -IGF3YWs= 13726 -IOyVng== 13727 -IGN1YmU= 13728 -YmVsaWV2YWJsZQ== 13729 -aWZhbGw= 13730 -ZGlz 13731 -IGFiYW5kb25lZA== 13732 -bWluZA== 13733 -IHBhcmw= 13734 -IGNsYXNzaWNhbA== 13735 -6Is= 13736 -4buZdA== 13737 -IEF1dG8= 13738 -IEJvcg== 13739 -56k= 13740 -NDAw 13741 -IFNvY2lldHk= 13742 -IHN1YnRsZQ== 13743 -IG1pc3Npb25z 13744 -IHJlbWVtYmVyZWQ= 13745 -IEVpdGhlcg== 13746 -IGRhZsO8cg== 13747 -T1JE 13748 -IGludGVuc2l0eQ== 13749 -RVNJTg== 13750 -IEN1cA== 13751 -IHJhcmVseQ== 13752 -IHRveXM= 13753 -IENoYXJsaWU= 13754 -4buf 13755 -IGdsYXViZQ== 13756 -IHJvdW5kcw== 13757 -VElO 13758 -IGNhcGFiaWxpdHk= 13759 -IGRlcml2YXRpdmU= 13760 -IHJlZmVycmluZw== 13761 -IGTDpQ== 13762 -IFRBTEk= 13763 -IGNvdHRvbg== 13764 -IGNvbmZlcg== 13765 -IGNvbHVtbnM= 13766 -IGxpYmVyYWw= 13767 -IG51bmNh 13768 -IM68zrU= 13769 -IGluZG8= 13770 -aWJlbg== 13771 -IEJlaXNwaWVs 13772 -IOq3uOughw== 13773 -INGD0Yc= 13774 -IGhveQ== 13775 -IGZyeQ== 13776 -IFNjb3R0aXNo 13777 -6Io= 13778 -IGNpdg== 13779 -IGNvbnNlcnZhdGl2ZQ== 13780 -IGFpcnBs 13781 -IHNhcg== 13782 -cnVz 13783 -IGludmVzdG1lbnRz 13784 -IGluZmluaXRl 13785 -IOCulQ== 13786 -IFRBTElFU0lO 13787 -IEdhcnk= 13788 -dWVsbA== 13789 -INCw0Lo= 13790 -IENpcg== 13791 -IHJpdHVhbA== 13792 -ID4+Pg== 13793 -IHRlbXB0 13794 -IFRlY2g= 13795 -IFBva2Vtb24= 13796 -IGltcHJvdmVtZW50cw== 13797 -IHNwYXJl 13798 -IHRyYW5zbGF0ZQ== 13799 -IHNvbnJh 13800 -IEZpbG0= 13801 -d29ydA== 13802 -INC80Lg= 13803 -IHBlcmlvZHM= 13804 -IGplYWxvdXM= 13805 -44GE44GE 13806 -IHRpcg== 13807 -TUk= 13808 -IGNvbmR1Y3RlZA== 13809 -IOyViOuFlQ== 13810 -MDk= 13811 -IFBvbGl0 13812 -IFdoZXJlYXM= 13813 -IG1vaXN0dXJl 13814 -IHNpbnM= 13815 -IGthcA== 13816 -INGN0Lo= 13817 -IGJlbmlt 13818 -IGVsaW1pbmF0ZQ== 13819 -IGF0aGxldGVz 13820 -IE1hbmFnZXI= 13821 -IGZlYXR1cmVk 13822 -YXBvcmU= 13823 -5Lqb 13824 -IOuwnA== 13825 -IHBlcmY= 13826 -IFRodXM= 13827 -IGRlYnV0 13828 -0L7QsdGA 13829 -IHNlw7E= 13830 -IG15c3RlcmlvdXM= 13831 -d29yZHM= 13832 -lOqwgA== 13833 -IGNoZWNrcw== 13834 -IHZvbHVudGVlcg== 13835 -IHdhc2hpbmc= 13836 -IE1hcnZlbA== 13837 -IEFC 13838 -aXNzb3Jz 13839 -ISc= 13840 -IEZ1bGw= 13841 -eWVvbg== 13842 -IHdlaWdo 13843 -IEpPSE4= 13844 -IHZvcw== 13845 -IHByb2NlZHVyZXM= 13846 -IGFkZHJlc3NlZA== 13847 -IEJlcmxpbg== 13848 -cHV0ZXI= 13849 -IEJhbg== 13850 -IG1lZGljYXRpb24= 13851 -IGRyb25l 13852 -INGD0LE= 13853 -IEplYW4= 13854 -IGNhcHM= 13855 -IGRpc2FwcG9pbnRlZA== 13856 -IHdvcmU= 13857 -IOq1rQ== 13858 -IG9yZ2FuaXpl 13859 -IEhhbGxvd2Vlbg== 13860 -IGZhbnRhc3k= 13861 -eWFyZA== 13862 -IG5vc290cm9z 13863 -IGp1bXBlZA== 13864 -IHBob3RvZ3JhcGh5 13865 -IE5hbWU= 13866 -cmVj 13867 -QUI= 13868 -IGJsZXNzaW5n 13869 -IFNodXQ= 13870 -IGJpdHRlcg== 13871 -cG9w 13872 -44Gd44KM 13873 -IGRlaQ== 13874 -IGZ1bGZpbGw= 13875 -55CG 13876 -IGRlbmdhbg== 13877 -IGJlbG8= 13878 -IE1lYW53aGlsZQ== 13879 -IGRlcG9pcw== 13880 -IGRpYWJldGVz 13881 -IGJ1bmQ= 13882 -IFplYWxhbmQ= 13883 -IGRpZ2VzdA== 13884 -IHRpcmVz 13885 -IGRvZA== 13886 -YWduZQ== 13887 -4bq/dA== 13888 -IHBlZWw= 13889 -INC30LDQsQ== 13890 -IG5vZGVz 13891 -IHRyZW5kcw== 13892 -IFN3aXRjaA== 13893 -IEF3YXJk 13894 -IE9yaWc= 13895 -IEhhbA== 13896 -IGVzdGFz 13897 -IDM2MA== 13898 -IHNpbXVsdA== 13899 -IGNvbWlj 13900 -IG3DoA== 13901 -IGJhbGFuY2Vk 13902 -IFByaW5jZXNz 13903 -IGtpbG9tZXRlcnM= 13904 -4bup 13905 -IHBhcnRpcg== 13906 -7KSR 13907 -c29mdA== 13908 -IFZpZXc= 13909 -IGJpb2xvZ2ljYWw= 13910 -aW5zdA== 13911 -NDQ= 13912 -IG1hbmVyYQ== 13913 -IGNvbXByZWhlbnNpdmU= 13914 -IFNhYg== 13915 -IGNyaW1lcw== 13916 -eWVycw== 13917 -IENvbXBhbnk= 13918 -IFBob3Q= 13919 -IHBvdWNv 13920 -aWFj 13921 -IGJlaW0= 13922 -aW5hdGU= 13923 -IHN1YnNlcXU= 13924 -IE1heW9y 13925 -IGNlbnR1cmllcw== 13926 -w6hyZXM= 13927 -7J6W7JWE7JqU 13928 -IOq3uOufvA== 13929 -IEZyYXU= 13930 -IE9I 13931 -IOuBnQ== 13932 -IE5haA== 13933 -IFNlcmllcw== 13934 -IG92ZXJuaWdodA== 13935 -7ZKI 13936 -IOKAog== 13937 -IHRyYXZl 13938 -YXR0ZXJlZA== 13939 -IHdhcnJp 13940 -IEdydW5k 13941 -IEluZG9uZXM= 13942 -IHNjcmE= 13943 -b2J5 13944 -IEJyb29r 13945 -IGN1cnM= 13946 -IOu4 13947 -IGV4cGxhaW5z 13948 -cmFtYXRpYw== 13949 -IHBhcnRpY2lwYXRpbmc= 13950 -IG1pbnV0 13951 -IGNvbnRyYWN0cw== 13952 -IGdlZ2Vu 13953 -IGRpc2FwcGVhcmVk 13954 -IFNO 13955 -IHJvYnVzdA== 13956 -YXBo 13957 -IHNocmlt 13958 -IGRldmFzdA== 13959 -Y29wZQ== 13960 -IG1lZXRz 13961 -IHBlYWNlZnVs 13962 -bWF0ZQ== 13963 -IHdlbGQ= 13964 -INeq 13965 -ZG9u 13966 -0YPRgtGM 13967 -IHJlZ2lzdGVyZWQ= 13968 -IE5paw== 13969 -amlu 13970 -IGNhdg== 13971 -IGVjaHQ= 13972 -aW94 13973 -IGZsb3dpbmc= 13974 -0L3QvtGB0YLQuA== 13975 -IHRvZQ== 13976 -IGVudGl0eQ== 13977 -0L7QstCw 13978 -Zml0cw== 13979 -IFBhdHJpY2s= 13980 -0YLRgA== 13981 -IGxldmVyYWdl 13982 -IGNvcnJlbA== 13983 -aWFo 13984 -IHN0cmluZ3M= 13985 -aXN0aW5jdA== 13986 -IGd1ZQ== 13987 -YXJjaHk= 13988 -IHRlbmdv 13989 -xLFtxLF6 13990 -IG9yYml0 13991 -5Li6 13992 -INC10YnRkQ== 13993 -Y2FrZQ== 13994 -INec15Q= 13995 -IE1pbm5lc290YQ== 13996 -IGJyYWtl 13997 -b3dpZQ== 13998 -IGNyYXc= 13999 -6riw66W8 14000 -IHByb2dyYW1tZQ== 14001 -INGB0LvRg9GH 14002 -5Y+q 14003 -aWVuY2Vz 14004 -IE91aQ== 14005 -IFBlcnM= 14006 -aW1pZW50bw== 14007 -IEludmVzdA== 14008 -IHNsb3dlcg== 14009 -5pmC5YCZ 14010 -IEJldGg= 14011 -IG51cnNl 14012 -IFNwcmluZw== 14013 -U3A= 14014 -IHVuZW1wbG95 14015 -0LTQuA== 14016 -IGdlbml1cw== 14017 -IEFhcm9u 14018 -IOq3uOufrA== 14019 -IGVp 14020 -44GX44KH 14021 -IHRhbmtz 14022 -IGF1am91cmQ= 14023 -IGNvbXBsZXhpdHk= 14024 -INGA0LXRiA== 14025 -IG9sZGVzdA== 14026 -IGxldHo= 14027 -5YWl 14028 -IHBoZW5vbWVub24= 14029 -cHJpbnQ= 14030 -IEJ1bmRlcw== 14031 -aXRhdA== 14032 -6ruY 14033 -IDQy 14034 -IFdp 14035 -IGluY29t 14036 -IGdlaw== 14037 -IGVtYnJhY2U= 14038 -IHRpZXM= 14039 -b3V0ZQ== 14040 -IGRvc2U= 14041 -IEZyaWVuZHM= 14042 -0YvRgg== 14043 -0LXQs9C+0LTQvdGP 14044 -IG9yZw== 14045 -hOuhnA== 14046 -w7Nn 14047 -IGV4Y2VlZA== 14048 -IGdvZHM= 14049 -IOqxsOyYiOyalA== 14050 -IHNvY2lldA== 14051 -IFVuaXZlcnM= 14052 -aXTDpHQ= 14053 -IHdvcmRlbg== 14054 -IHNtb2tpbmc= 14055 -IGludGVucw== 14056 -YWJ1bA== 14057 -ZW1pYQ== 14058 -6JE= 14059 -NDc= 14060 -Zmx5 14061 -IDIwMDY= 14062 -IFNlcmlvdXNseQ== 14063 -IHByemV6 14064 -5rw= 14065 -Y3Jl 14066 -IG5hbg== 14067 -IG1vZGVz 14068 -0L7QstCw0YLRjA== 14069 -IEhhbmc= 14070 -ZW1lbg== 14071 -IGJlbmVmaWNpYWw= 14072 -IHZvdGVycw== 14073 -IEJyb2Fk 14074 -IGJlbnQ= 14075 -V293 14076 -IG11bA== 14077 -5ZOl 14078 -IFVD 14079 -IGRhbWFnZWQ= 14080 -IFVrcmFpbmU= 14081 -IHdpcGU= 14082 -IHN0b25lcw== 14083 -IG1hbmFnZXJz 14084 -IHJhYg== 14085 -0YHRgtGA0L4= 14086 -bGF0 14087 -IGRlY2U= 14088 -IGdyYXBoaWM= 14089 -IGZvc3M= 14090 -IGRpc2FncmVl 14091 -IEFtZW4= 14092 -IHNlY3JldHM= 14093 -aG9sZQ== 14094 -aW5rbGU= 14095 -IGZvcnR1bmF0ZQ== 14096 -IOyx 14097 -7JyE 14098 -6JCs 14099 -IGhhYml0cw== 14100 -IGJ1cmllZA== 14101 -IGhpbg== 14102 -IHZpcnR1YWxseQ== 14103 -b2xhcw== 14104 -IFJQ 14105 -IFRhYg== 14106 -bG93 14107 -IHNhY3JpZmlj 14108 -IGVzdGltYXRlZA== 14109 -b2xu 14110 -2Ys= 14111 -Y3Vy 14112 -IEZlZWw= 14113 -IGNhc3RsZQ== 14114 -IHVzZWxlc3M= 14115 -IGRpc2c= 14116 -IEphY29i 14117 -IGdhYW4= 14118 -IHVwc2lkZQ== 14119 -IHBhcmVjZQ== 14120 -44Oz44M= 14121 -IHNoaXBwaW5n 14122 -IENS 14123 -IGRpc3J1cHQ= 14124 -YWN0ZXI= 14125 -VU5E 14126 -ZnU= 14127 -5a6M 14128 -IFBpY2s= 14129 -IENoYXJs 14130 -IEJ1bGw= 14131 -IGVudGVycHJpc2U= 14132 -IHB1bmlzaG1lbnQ= 14133 -YWNraW5n 14134 -IGZyYWN0aW9u 14135 -IHRhYmxldA== 14136 -IGNob3Jk 14137 -IHNpbWlsYXJseQ== 14138 -5YW25a+m 14139 -IFRvcm9udG8= 14140 -IGNvdXJ0cw== 14141 -xJ9s 14142 -ZXN6Y3pl 14143 -IHByb25vdW4= 14144 -IFNpc3Rlcg== 14145 -IE1Q 14146 -IGdyZWF0bHk= 14147 -IERhbms= 14148 -aWNvcA== 14149 -IGdhcmJhZ2U= 14150 -IHJlc29sdmU= 14151 -IFNhZg== 14152 -IEd1bg== 14153 -IGNvbXBvdW5k 14154 -IOuwsA== 14155 -IE11c2lr 14156 -4pmr 14157 -IGNoYW9z 14158 -IFdoZW5ldmVy 14159 -IGV1cm9z 14160 -IG9yY2hlc3Q= 14161 -IHJlZnJpZ2Vy 14162 -YWxhbg== 14163 -4Li3 14164 -IEFtYXppbmc= 14165 -IHB1ZA== 14166 -YWdhbg== 14167 -IGplc3pjemU= 14168 -aXN5 14169 -IGFjY3VyYWN5 14170 -IEFtYQ== 14171 -aXNvZGU= 14172 -64yA 14173 -IGludGVycHJldGF0aW9u 14174 -IExpYmVy 14175 -5rc= 14176 -Y2Ft 14177 -IGV2b2x2ZWQ= 14178 -IEtheQ== 14179 -0YbRiw== 14180 -IGNyZWF0b3I= 14181 -aXRhcw== 14182 -IGFsYXJt 14183 -IGNlbGVicmF0aW9u 14184 -emVudA== 14185 -IGZ1bmNpb24= 14186 -IG92 14187 -dW1ibGluZw== 14188 -ICU= 14189 -4LiI 14190 -IHJlc3RyaWN0aW9ucw== 14191 -INC90LDQsg== 14192 -IEtpbmRlcg== 14193 -IGJhbmFuYQ== 14194 -0YzRjw== 14195 -IGRpYW1ldGVy 14196 -IG5vcnRoZXJu 14197 -dXJlcnM= 14198 -IFBhcw== 14199 -5oiR55qE 14200 -IHdvcmtmb3JjZQ== 14201 -IGp1bmc= 14202 -IGd1YXJhbnRl 14203 -IGVxdWlsaWI= 14204 -IHN1aXRl 14205 -IGV1cm8= 14206 -IGRlbGliZXI= 14207 -U3Rl 14208 -IGRvd250b3du 14209 -IGNoaW4= 14210 -IGNvZGVz 14211 -ZWRpYQ== 14212 -IHNoZWVw 14213 -cmVzaG9sZA== 14214 -d25pZQ== 14215 -w7Ni 14216 -IHVuZGVybHlpbmc= 14217 -bGlh 14218 -amVy 14219 -z4DPjA== 14220 -550= 14221 -dGhyb3A= 14222 -IHphcA== 14223 -IHZhY3V1bQ== 14224 -IEhhYg== 14225 -IHdyYXBwZWQ= 14226 -7KI= 14227 -IGludmVudG9yeQ== 14228 -0LzQsA== 14229 -IGNvb3Jk 14230 -IHBsYXRlcw== 14231 -IHN5bW0= 14232 -VGU= 14233 -IHfFgmHFm25pZQ== 14234 -IHJlYWNoZXM= 14235 -IGxvbmVseQ== 14236 -U2NyaXB0 14237 -bGVl 14238 -ZXNzZXI= 14239 -IOqxuA== 14240 -IEdlc2No 14241 -IE1vdmluZw== 14242 -IHLDqXA= 14243 -IFZpbGw= 14244 -5ZCI 14245 -IFJhY2hlbA== 14246 -IHRlbW9z 14247 -T05F 14248 -IHN0cmFpbg== 14249 -IGFuZ2Vs 14250 -IGbDpQ== 14251 -VHI= 14252 -IGFjaG8= 14253 -IGhpZ2hsaWdodHM= 14254 -IFdlcg== 14255 -IENhcmw= 14256 -IGJsdXI= 14257 -IHJlZ2FyZHM= 14258 -wrc= 14259 -0LjQu9GB0Y8= 14260 -IHJlY3Jl 14261 -IFlhbmk= 14262 -VUNL 14263 -oLg= 14264 -IGVsZWN0cm9ucw== 14265 -IFNwaWVs 14266 -IHZlZA== 14267 -2r4= 14268 -IGJlYW0= 14269 -IGlkaW90 14270 -65Ok 14271 -0L3QsNGH 14272 -aWRk 14273 -IHNraQ== 14274 -aXRhdGl2ZQ== 14275 -IGh5cG90aGVz 14276 -44Gn44GZ44Gt 14277 -ZW50ZXI= 14278 -IOyVhOuLiOs= 14279 -IGlocmU= 14280 -IHByZXZpZXc= 14281 -YW5nZWw= 14282 -IGRlbW9u 14283 -IGR1cw== 14284 -IGRpYw== 14285 -IEtvbQ== 14286 -TEVZ 14287 -Li4uIQ== 14288 -IHNpZWh0 14289 -IFNvbmlj 14290 -IHRlbmhv 14291 -YW5hcw== 14292 -IGRpZ2l0 14293 -IE1hYXI= 14294 -IHVuZGVyZ3JhZA== 14295 -b3VuY2Vy 14296 -dWZmeQ== 14297 -IGNvbnZlcnNpb24= 14298 -IGRpc2Nvbm5lY3Q= 14299 -IGVjaG8= 14300 -b21lcg== 14301 -IGN1cnJpY3VsdW0= 14302 -IHBlcmNow6k= 14303 -IHdhbmQ= 14304 -Li4/ 14305 -IHJvbGxlZA== 14306 -IGVudHJlcHJlbmV1cg== 14307 -IHRoZW9yZXQ= 14308 -INGJ0L4= 14309 -IGluc2lnaHRz 14310 -IHp1c2FtbWVu 14311 -b2lu 14312 -cmV0dA== 14313 -cHJvZHU= 14314 -IHZpc2l0b3Jz 14315 -ZW91cw== 14316 -IGdyYW5kbW90aGVy 14317 -IGh1bW9y 14318 -INC90LjRhQ== 14319 -emVuaWE= 14320 -aW5zb24= 14321 -IHJlc2V0 14322 -IGJhc2ViYWxs 14323 -IG1hdGNoaW5n 14324 -64uk6rCA 14325 -IHB1bnRv 14326 -7KE= 14327 -IHJlZGU= 14328 -IGFkZHJlc3Npbmc= 14329 -IGZvcmVjYXN0 14330 -IEJvbA== 14331 -IGNvbG9yZWQ= 14332 -IGRvY3VtZW50YXRpb24= 14333 -IGV4cGVjdGF0aW9u 14334 -IE5vcnRoZXJu 14335 -IGNyZW8= 14336 -IOCumg== 14337 -Zm9u 14338 -IHVuc2VyZQ== 14339 -VU0= 14340 -IGNvcGllcw== 14341 -IGV4cGFuZGVk 14342 -IHZldGVyYW5z 14343 -IEFsbQ== 14344 -INCy0L7QvtCx0YnQtQ== 14345 -IHBzeWNob2xvZ2ljYWw= 14346 -IG5vc3Nv 14347 -IHBheW1lbnRz 14348 -aW1ldGVycw== 14349 -IC0tPg== 14350 -IEplbm5pZmVy 14351 -IHZvbHVudGVlcnM= 14352 -b3NzZQ== 14353 -b3Jpb3Vz 14354 -INCx0YvQu9C4 14355 -6II= 14356 -IEVzcw== 14357 -d3M= 14358 -IEJD 14359 -IElD 14360 -V29tYW4= 14361 -IHZvbnQ= 14362 -IGV0aG5pYw== 14363 -RU5O 14364 -0LjQvNC+ 14365 -IGxvYg== 14366 -IG91aQ== 14367 -Y3M= 14368 -IHJlaGU= 14369 -IOyggQ== 14370 -IGNoaWNr 14371 -w7pzaWNh 14372 -IGtvbnQ= 14373 -IERpc3RyaWN0 14374 -IHBpbGU= 14375 -INCw0LI= 14376 -0LXQudGB0YLQsg== 14377 -IMKj 14378 -IGlzc3VlZA== 14379 -INC60L7QvNC/ 14380 -IHByb3NwZXI= 14381 -IHByb2ZvdW5k 14382 -IERlYXI= 14383 -IOOBkw== 14384 -IGZ1bmRlZA== 14385 -IGJpc2E= 14386 -npjr 14387 -158= 14388 -IOydmA== 14389 -IHR3ZWx2ZQ== 14390 -IENoYW1waW9ucw== 14391 -6Z2e5bi4 14392 -0YHQuw== 14393 -IDIwMDU= 14394 -cG0= 14395 -IG9uZGU= 14396 -IGRpZmbDqQ== 14397 -IENoYWxs 14398 -IGRpZmZpY3VsdGllcw== 14399 -IGdhcmFnZQ== 14400 -IGTDoQ== 14401 -w7xuaw== 14402 -IOusvA== 14403 -IHRyYW4= 14404 -IHN1Ym1pdHRlZA== 14405 -enc= 14406 -2YjYpw== 14407 -IGFyaw== 14408 -IOyEsQ== 14409 -IGdyb2Nlcnk= 14410 -0L7QvdCw 14411 -aWVyZQ== 14412 -IGFlc3Q= 14413 -IGV4aGliaXRpb24= 14414 -IHLDqXM= 14415 -IGNvbnNpc3RlbmN5 14416 -IGNvb2tpZQ== 14417 -0L3QtdC5 14418 -IHJlcGxhY2VtZW50 14419 -5rK5 14420 -IFNlbQ== 14421 -IOyCrOyaqQ== 14422 -ODAw 14423 -IGdlbmVz 14424 -IHRyYW5zYWN0aW9u 14425 -IEVM 14426 -IGR1cmFudGU= 14427 -aWJsZXM= 14428 -IEVhdA== 14429 -dGFpbA== 14430 -aXNzYW5jZQ== 14431 -IHRvc3M= 14432 -IHN1cnZpdmVk 14433 -IG9mZmljZXM= 14434 -IHN1cHBvcnRpdmU= 14435 -V2hlcmU= 14436 -IHRvdXRlcw== 14437 -IOuniQ== 14438 -IGpva2Vz 14439 -aWVyb24= 14440 -YXBlcnM= 14441 -IG1hdHVyZQ== 14442 -IE1hcnNo 14443 -IHNpZG8= 14444 -a2luZA== 14445 -IHJlYWxtZW50ZQ== 14446 -IENoZWY= 14447 -IHF1ZWxxdWU= 14448 -IGp1ZGdlcw== 14449 -ZWZ0 14450 -RVJT 14451 -IGpldA== 14452 -IHBlcnNvbnM= 14453 -6Ls= 14454 -aXphdGlvbnM= 14455 -cmlr 14456 -IHNob3Bz 14457 -IFd5 14458 -IGVsZWc= 14459 -cXXDqA== 14460 -cXVvaQ== 14461 -IGp1Z2E= 14462 -IO2VnOuyiA== 14463 -IFF1ZXN0aW9u 14464 -IEdsb2JhbA== 14465 -IOyVveqwhA== 14466 -IFN0YXRpb24= 14467 -5o6l 14468 -IE9oaW8= 14469 -IHN0aWNreQ== 14470 -IHN0cmVzc2Vk 14471 -IGfDvG4= 14472 -IO2d 14473 -0YHRgtGD0L8= 14474 -6aGM 14475 -IFBoRA== 14476 -aW1tZXI= 14477 -IG1lbnRvcg== 14478 -IGludmVudGVk 14479 -IHJldW4= 14480 -IGluZXZpdA== 14481 -IHBvbMOtdA== 14482 -IGV4ZWN1dGU= 14483 -IFN0b3J5 14484 -IG91dHN0YW5kaW5n 14485 -IGd1ZXI= 14486 -IFJhaW4= 14487 -IGNob3Nlcw== 14488 -IFRpdA== 14489 -INGB0LXRgA== 14490 -IFNpbmdhcG9yZQ== 14491 -IE5vbmU= 14492 -IGNocm9uaWM= 14493 -sOuNsA== 14494 -IGVnbw== 14495 -5qC3 14496 -RVNU 14497 -44GC44KK 14498 -IFdhbmc= 14499 -IE5BVA== 14500 -IGF1Zw== 14501 -IGRlc2t0b3A= 14502 -IGV0ZXJuYWw= 14503 -IOyCrOyLpA== 14504 -IENvbnN0aXR1dGlvbg== 14505 -7IKs6w== 14506 -15nXnA== 14507 -cHJlcw== 14508 -INCi0Ys= 14509 -IGludGVyZg== 14510 -IGxpc3Rz 14511 -IGZpZ2h0cw== 14512 -ZnRlbg== 14513 -IElvd2E= 14514 -IG1vdGl2YXRlZA== 14515 -IEhvc3A= 14516 -IGVsc2V3aGVyZQ== 14517 -IHBhdGhz 14518 -IGluc3RhbmNlcw== 14519 -Qmw= 14520 -cmFuZ2U= 14521 -4bux 14522 -IFNpdA== 14523 -bWFuYQ== 14524 -IOyLnOyekQ== 14525 -IG3DrG5o 14526 -YW5zYXM= 14527 -IHNuYQ== 14528 -IHBoaWxvc29waA== 14529 -IHBhc3Nl 14530 -xrDhu51p 14531 -YWto 14532 -ZW50YWw= 14533 -IGlobg== 14534 -cnVjdG9y 14535 -INCy0LDRiA== 14536 -IGdlbmVyb3Vz 14537 -IHBpdm90 14538 -0L/QvtC7 14539 -IGphbWFpcw== 14540 -IGNvbWVudA== 14541 -IExldw== 14542 -b2R6aQ== 14543 -IFhib3g= 14544 -INCy0L7QtA== 14545 -IGNvbnNlbnQ= 14546 -ieyepQ== 14547 -IGRpc3Bhcg== 14548 -bGFzcw== 14549 -IEdvdmVybm9y 14550 -QmVpZmFsbA== 14551 -IOqwnA== 14552 -IGJlbG92ZWQ= 14553 -16DXlQ== 14554 -c2VsbA== 14555 -IGhvbm9yZWQ= 14556 -bGVo 14557 -IHfDpHJl 14558 -dW50aW5n 14559 -IGZyYXVk 14560 -IFJBTQ== 14561 -6rG4 14562 -IGtpbGxz 14563 -IGVjb25vbWljcw== 14564 -MDQ= 14565 -0L/QtdGA 14566 -IGNvaXNhcw== 14567 -INC40LPRgA== 14568 -w61t 14569 -IG3DtmNodGU= 14570 -IOy1nA== 14571 -IHN0aW11bA== 14572 -IGZhc3Rlc3Q= 14573 -bHY= 14574 -IGfDqW4= 14575 -IFNvdW5kcw== 14576 -IDE5NzA= 14577 -IGhvbWV3b3Jr 14578 -c3BlYWtpbmc= 14579 -IGVuY291cmFnaW5n 14580 -IHF1ZXJ5 14581 -IHJldmVycw== 14582 -cHJvZml0 14583 -IGR5 14584 -IOyekQ== 14585 -64qU642w7JqU 14586 -IHNvYXA= 14587 -IEdhbGw= 14588 -IENO 14589 -IEFucw== 14590 -IGZpYw== 14591 -YW5rcw== 14592 -IGRlc3NlcnQ= 14593 -IOyggO2drA== 14594 -IE1ha2luZw== 14595 -IGNvbWXDpw== 14596 -6rOE 14597 -IGFzc29jaWF0aW9u 14598 -RGFk 14599 -aGVl 14600 -IGhvZ3k= 14601 -IGFwcm8= 14602 -IGludmlzaWJsZQ== 14603 -QW1lcmljYW4= 14604 -7Y4= 14605 -IHZpYmU= 14606 -IGVtaXNzaW9ucw== 14607 -IGFkdm9jYXRl 14608 -IGtpY2tlZA== 14609 -IHZlbA== 14610 -IHN1bW1hcg== 14611 -IGZyZWFraW5n 14612 -Y2hyb24= 14613 -IHBpbmNo 14614 -IHdzenlzdGs= 14615 -aXNjYWw= 14616 -IHByb3ZlZA== 14617 -IG1pbmRmdWw= 14618 -IHTDpA== 14619 -IG5vaXNlcw== 14620 -IGlzb2xhdGVk 14621 -IGNyb3NzZWQ= 14622 -IOqwlQ== 14623 -IHZvaWzDoA== 14624 -IGNob3Jl 14625 -IFJB 14626 -Q29t 14627 -IHJlbGF4ZWQ= 14628 -YXRybw== 14629 -IHByZXZlbnRpb24= 14630 -Vm9pY2VvdmVy 14631 -T0Q= 14632 -IENvdmlk 14633 -IHNlcGFyYXRpb24= 14634 -IC1b 14635 -0LjRh9C10LPQvg== 14636 -55m8 14637 -IFNE 14638 -YmxlZXA= 14639 -IGluZGVwZW5kZW5jZQ== 14640 -IHBhcnRpYWw= 14641 -IGFsZ29yaXRobXM= 14642 -IEFueW9uZQ== 14643 -IGFzc29jaWF0ZQ== 14644 -aHVt 14645 -aWN1bGFy 14646 -IGLhuqFu 14647 -IGJhdHRsZXM= 14648 -R29vZA== 14649 -QXBwbGF1c2U= 14650 -IGJhc3RhbnRl 14651 -IGFkdmFudA== 14652 -IFN3ZWV0 14653 -IHJlZnVzZWQ= 14654 -44K4 14655 -INGC0LXQsdC1 14656 -cGxldA== 14657 -IGVuY291cmFnZWQ= 14658 -5ZOm 14659 -IG1pcmFjbGU= 14660 -IEJ1bg== 14661 -IFZhcg== 14662 -cmltaW5hdGlvbg== 14663 -ZWxlY3Q= 14664 -IE11bHQ= 14665 -IGRlbGl2ZXJpbmc= 14666 -ZWluZw== 14667 -IGNt 14668 -bmVobWVu 14669 -IExpbmU= 14670 -IOunjA== 14671 -ZW5jZWQ= 14672 -IFNvdW5k 14673 -IENvbnRpbg== 14674 -aWpk 14675 -VU5H 14676 -a2xl 14677 -IHRocmVzaG9sZA== 14678 -IGNvbXBhY3Q= 14679 -YWR0 14680 -IHRvZXM= 14681 -IFB1cg== 14682 -b3duZWQ= 14683 -bWVudGVk 14684 -IGRlc2lnbmluZw== 14685 -IHZhY2NpbmF0ZWQ= 14686 -IGV4aGF1c3Q= 14687 -IGJhc2ljcw== 14688 -IGNvbnNpc3Rz 14689 -IEd1eQ== 14690 -YWN6eQ== 14691 -IG3DrQ== 14692 -d29u 14693 -5a6z 14694 -IDg1 14695 -5oI= 14696 -IG11bQ== 14697 -IGlnbm9y 14698 -IHByaW50aW5n 14699 -YWN1bGFy 14700 -cG93 14701 -IGV4cGFuZGluZw== 14702 -IGdpcg== 14703 -IENhYg== 14704 -7Zi4 14705 -0YLRjNGB0Y8= 14706 -IOyXrOufrOu2hA== 14707 -IGFuZ2xlcw== 14708 -IHRlcm1pbmFs 14709 -IFdvbg== 14710 -IEludGVyZXN0aW5n 14711 -IGNyb3NzaW5n 14712 -IGJvbmRz 14713 -IHB1ZWRlbg== 14714 -IG9yYg== 14715 -bGFyxLFu 14716 -IGNyZWVweQ== 14717 -IG51dHJpdGlvbg== 14718 -IGFsbGllcw== 14719 -IHdpcmVsZXNz 14720 -IGRlc2lyZWQ= 14721 -IGNvbXB1dGU= 14722 -IEFyaXpvbmE= 14723 -IEJlYXV0aWZ1bA== 14724 -IHByb2R1Y2Vz 14725 -IG51ZXN0cm8= 14726 -dGVk 14727 -IGVsaWdpYmxl 14728 -INGB0L7Qtw== 14729 -aWNpYWw= 14730 -IEhlcm8= 14731 -IGNvbnN1bWU= 14732 -IHJvYm90cw== 14733 -IHB1cmNoYXNlZA== 14734 -Y2Npw7Nu 14735 -IGl6 14736 -xrDhu6Nj 14737 -zq/Ovc6xzrk= 14738 -INij2YY= 14739 -IHNoYWRvd3M= 14740 -IE1lZGlh 14741 -IHByaW5jZXNz 14742 -IGtsYXI= 14743 -IHdvb2Rlbg== 14744 -IHVzYXI= 14745 -IGfDvHplbA== 14746 -IHNsb3Q= 14747 -cmFkZQ== 14748 -IOuS 14749 -IGhhcm1vbg== 14750 -IGluZ3JlZGllbnQ= 14751 -b3JzaGlw 14752 -ZWtp 14753 -IGdyYW5kZmF0aGVy 14754 -IGV4Y2l0ZW1lbnQ= 14755 -IHBvbGl0aWNpYW5z 14756 -Li4h 14757 -IG91dHM= 14758 -IHNlcGFyYXRlbHk= 14759 -INGP0Lo= 14760 -IFdlbHQ= 14761 -IFBvdw== 14762 -amFu 14763 -IG9yaWVudGF0aW9u 14764 -5Y+L 14765 -TEM= 14766 -YWdlbQ== 14767 -24zaug== 14768 -5ZCX 14769 -IGJyYW5jaGVz 14770 -YWRlbg== 14771 -cmVudGU= 14772 -IElocg== 14773 -YXNt 14774 -IGVzdMOjbw== 14775 -IE5pYw== 14776 -IHNsYXZl 14777 -IGNvbXByZXNz 14778 -Y3Jvd2Q= 14779 -IGNsaW1iaW5n 14780 -IE1hbmFnZW1lbnQ= 14781 -IEJhaA== 14782 -IHBhbmlj 14783 -IGtvcg== 14784 -IGNvb2xpbmc= 14785 -IGJpbmQ= 14786 -INC30LDQtA== 14787 -IHJhY2s= 14788 -IGVudGl0 14789 -IHNlbmRz 14790 -IHlvdXJzZWx2ZXM= 14791 -ZGVz 14792 -IE11c2xpbXM= 14793 -IO2a 14794 -aXNtYQ== 14795 -Y3ljbGU= 14796 -dW5rdA== 14797 -IENvcmU= 14798 -IGluanVyaWVz 14799 -IGlkZW50aWNhbA== 14800 -0LrQsNGP 14801 -IERldXRzY2hsYW5k 14802 -INC10LU= 14803 -aXNhbg== 14804 -IHRydWM= 14805 -bGV0b24= 14806 -IGJhY2t1cA== 14807 -IHVsdHJh 14808 -IGFidW5k 14809 -aWxsZXVycw== 14810 -IGJ5xYJv 14811 -5YWD 14812 -b3J0ZWQ= 14813 -IGVhcnRocXU= 14814 -INC60Ls= 14815 -IG9ic2VydmF0aW9u 14816 -IG1haW50ZW5hbnQ= 14817 -ZWxlbg== 14818 -IHNldHRsZWQ= 14819 -IHBlbGE= 14820 -IEVjb25vbQ== 14821 -INU= 14822 -IHN0ZWVyaW5n 14823 -IEFMTA== 14824 -IENoZXI= 14825 -IHBhdGllbmNl 14826 -IFNub3c= 14827 -IGJvcg== 14828 -IHdvcnRoeQ== 14829 -IGPDoWk= 14830 -INen 14831 -IM66zrE= 14832 -ZG9n 14833 -IEthcmVu 14834 -aWxsZXM= 14835 -zrI= 14836 -IGFncmljdWx0dXJl 14837 -15XXnw== 14838 -IFNlYW4= 14839 -IHNlbnNvcnM= 14840 -7ZW06w== 14841 -YWdo 14842 -IHB1YmxpY2x5 14843 -IHBldXg= 14844 -IEFsZXhhbmRlcg== 14845 -IHByaW9yaXQ= 14846 -IGxhenk= 14847 -YXJkb24= 14848 -YXR0ZXJpbmc= 14849 -IGNvc3R1bWU= 14850 -2LPYqg== 14851 -6L+Y 14852 -IHVudw== 14853 -0Js= 14854 -IHRoaWNrbmVzcw== 14855 -cXVpdG8= 14856 -Z3VudA== 14857 -aXN0YXM= 14858 -bmV5cw== 14859 -IOuQmOqyjA== 14860 -IEJyYXNpbA== 14861 -IHRva2Vu 14862 -IGFmZmlsaQ== 14863 -bG9u 14864 -IGbDpXI= 14865 -IEJlYWNo 14866 -IHdpdGNo 14867 -IFNldmVu 14868 -IHBhbnQ= 14869 -zrvOuw== 14870 -IGNhcHRhaW4= 14871 -5Z0= 14872 -IHZldXQ= 14873 -IHBvdXZvaXI= 14874 -YWN6 14875 -IEJhcmI= 14876 -IHV0aWxpdHk= 14877 -IGNvbnRlbXBvcmFyeQ== 14878 -IG9idGFpbmVk 14879 -IHBhaW50aW5ncw== 14880 -ZWFy 14881 -IHBlYW4= 14882 -IE9n 14883 -IGN1c3Q= 14884 -0LvQtdC8 14885 -gpjr 14886 -IElzc28= 14887 -IGFjb250ZQ== 14888 -IFRlbGU= 14889 -IEFzc2lzdGFudA== 14890 -w4k= 14891 -7ZaI7Iq164uI64uk 14892 -IGNvdW50cw== 14893 -IGJ1Y2s= 14894 -IERlZXA= 14895 -IHRhY2tsZQ== 14896 -IGhhcnNo 14897 -IGRlY2lkZXM= 14898 -6Zec 14899 -LuKAiw== 14900 -6YKK 14901 -IEFuZ2Vs 14902 -IGxheWluZw== 14903 -IGNhbG9yaWVz 14904 -IGNvbnRyb2xsaW5n 14905 -IGFkdmFudGFnZXM= 14906 -INGN0YLQvtC5 14907 -IGFwcHJvYWNoaW5n 14908 -IHRocmVhdHM= 14909 -YWthbg== 14910 -ZW1hdGlj 14911 -bWFubg== 14912 -6rO1 14913 -bXVtYmxlcw== 14914 -YWNpw7M= 14915 -IG1haW50YWluaW5n 14916 -IGZvdW5kZXI= 14917 -bGFo 14918 -ZmlnaHQ= 14919 -IGFkbWl0dGVk 14920 -4oCmLg== 14921 -lYw= 14922 -YWJvbA== 14923 -IHVzYWdl 14924 -IG5vbnNlbnNl 14925 -IFBhbGVzdA== 14926 -IGNvbnRyZQ== 14927 -IERlbW9jcmF0aWM= 14928 -IEVS 14929 -amVrdA== 14930 -IGFyYml0 14931 -INCz0L7Quw== 14932 -IE1pY2hlbGxl 14933 -aWNoZXI= 14934 -ZXNo 14935 -IFBobw== 14936 -0LrQvtC8 14937 -NDk= 14938 -IEVuZXJneQ== 14939 -zr/PjQ== 14940 -IGNlbnRz 14941 -IHJlZmVycw== 14942 -IGdvc3BlbA== 14943 -IFNoYQ== 14944 -IFNoYXJl 14945 -15nXoA== 14946 -IGNsaW5pYw== 14947 -IOuEow== 14948 -IGVxdWFsaXR5 14949 -dWdz 14950 -IHNoZWQ= 14951 -IHBsYW5lcw== 14952 -IHRvdXRl 14953 -cmVjaw== 14954 -IHN0cmFuZA== 14955 -IGJpb2xvZ3k= 14956 -IGxlYWd1ZQ== 14957 -IFBvaw== 14958 -IG7Dum1lcm8= 14959 -IENvYXN0 14960 -IGNvbnNpc3RlbnRseQ== 14961 -IG51Y2xl 14962 -T09PTw== 14963 -IG9iamV0 14964 -IGNob3I= 14965 -IGdpbmdlcg== 14966 -IGRhYmVp 14967 -IGNvb3BlcmF0aW9u 14968 -4K+NLg== 14969 -bnRlbg== 14970 -56Q= 14971 -bMOg 14972 -7JaR 14973 -cmFkbw== 14974 -IHBhc3NpdmU= 14975 -IGdsb3Zlcw== 14976 -IHVuZGVyZ3JvdW5k 14977 -IGxvZ2ljYWw= 14978 -IGtldA== 14979 -IGZ1bmN0aW9uYWxpdHk= 14980 -uOumrA== 14981 -IHBvcnRhbA== 14982 -ZWxsZXI= 14983 -15nXqA== 14984 -IFRlZA== 14985 -IEdyZQ== 14986 -kJw= 14987 -IHBlcnNvbm5lbA== 14988 -IGVtZXJnaW5n 14989 -IEbDvHI= 14990 -IG1lYW50aW1l 14991 -dXNhbGVt 14992 -IENsZWFy 14993 -IHRyYXBwZWQ= 14994 -IOyasA== 14995 -IGRpc3Bs 14996 -IG1ldHRyZQ== 14997 -IG11bmljaXA= 14998 -IHdpdGhkcmF3 14999 -IHNwYXQ= 15000 -dW5lcw== 15001 -IGFjY2Vzc2liaWxpdHk= 15002 -5oiR5Lus 15003 -IGFwYXJl 15004 -IHByb3NwZWN0 15005 -INC90LDQtw== 15006 -IGNvcHBlcg== 15007 -IFBSTw== 15008 -z4XPhA== 15009 -IGF0dGFja2luZw== 15010 -IFZpbg== 15011 -IFN0b25l 15012 -IGludmVzdGlnYXRl 15013 -c3R5bGU= 15014 -IM67 15015 -66Gd 15016 -66eI 15017 -IGluc3BlY3Q= 15018 -IGxpdmVy 15019 -0LDQu9C40YHRjA== 15020 -IHNlcmE= 15021 -aGFsdGVu 15022 -ZW1hbg== 15023 -IG1pbmlzdHJ5 15024 -Jyc= 15025 -IGRvdHM= 15026 -44WL44WL44WL44WL 15027 -0YPRgdGC 15028 -IEphaw== 15029 -QUtF 15030 -IGdhcHM= 15031 -dWNrZXI= 15032 -INC40L3RgtC10YDQtdGB 15033 -IEVtaWx5 15034 -IGludGVydmFs 15035 -IHRlbmRlcg== 15036 -IFRlY2hub2xvZ3k= 15037 -Z2FtZQ== 15038 -IHRyaWI= 15039 -2YTYpw== 15040 -IERldmVsb3BtZW50 15041 -2YXYpw== 15042 -IHdyaXN0 15043 -IGZpcmVz 15044 -IHRhcmdldGVk 15045 -7KCQ 15046 -IHNvZA== 15047 -7ZqM 15048 -IG9sZHXEnw== 15049 -IHNlYXNvbnM= 15050 -dmVudGlvbnM= 15051 -INC90LXQs9C+ 15052 -IHNvbWV0aW1l 15053 -0LvQuNCy 15054 -bsOp 15055 -IHTDug== 15056 -IERldXM= 15057 -IGV4ZWN1dGlvbg== 15058 -w6Fw 15059 -IENoYW5nZQ== 15060 -IEluZGVlZA== 15061 -IHJlZ3VsYXRpb24= 15062 -IEh1bmc= 15063 -w6lpcw== 15064 -IHdpc2hlcw== 15065 -IGpheno= 15066 -IHN0cnVjdHVyYWw= 15067 -IGJsb3dpbmc= 15068 -IGJ5xIc= 15069 -IHRoZXJtYWw= 15070 -cGhhbnQ= 15071 -0YDRg9C3 15072 -0LDQvdGC 15073 -IFB1bGw= 15074 -IGNvbmZ1c2lvbg== 15075 -0L3Ri9C80Lg= 15076 -IHNjZW5hcmlvcw== 15077 -7KCB7Jy866Gc 15078 -INC00LXRgg== 15079 -IHRhdHRvbw== 15080 -IGF1dHJl 15081 -IGhlYXRpbmc= 15082 -IHRyZWF0aW5n 15083 -INC/0L7QvdC40Lw= 15084 -IGV4Y2x1cw== 15085 -IExPTA== 15086 -d2Vhcg== 15087 -YWdsZQ== 15088 -IHp1csO8Y2s= 15089 -IHJhdGlvbmFs 15090 -c3U= 15091 -IGRldGVy 15092 -IE5hdGl2ZQ== 15093 -4K6V4K6z 15094 -YWNoZWQ= 15095 -IOOD 15096 -IEVudG9uY2Vz 15097 -IGhvcmE= 15098 -7J207JeQ7JqU 15099 -IGxpdGU= 15100 -w6s= 15101 -IHNpeHRo 15102 -INCx0L7Qu9C10LU= 15103 -YWN0b3I= 15104 -IHBzeWNob2xvZ3k= 15105 -55u4 15106 -IGRlbWFuZHM= 15107 -IHBlZXI= 15108 -IG5ld2x5 15109 -IFdXRQ== 15110 -RG9uYWxk 15111 -IEJveA== 15112 -IHBpbmU= 15113 -IGxvYWRpbmc= 15114 -IE5pY28= 15115 -IHPFgg== 15116 -b21tZQ== 15117 -QVJU 15118 -IHJlY3J1aXQ= 15119 -IGJ1Z3M= 15120 -YXJlbnRz 15121 -INC/0YDQvtCx 15122 -IEluc2lkZQ== 15123 -aXBwZXI= 15124 -ZHJhbWF0aWM= 15125 -IHBsYW5ldHM= 15126 -b3JkZQ== 15127 -IHlvZ2E= 15128 -Y2hpbGQ= 15129 -IE1hcmll 15130 -IOOBgg== 15131 -IEJM 15132 -IGZpbG1lZA== 15133 -IHJlZnJlc2g= 15134 -IHRvbWF0b2Vz 15135 -IGZldA== 15136 -UXXDqQ== 15137 -ICEh 15138 -IOuCtOs= 15139 -cmluZQ== 15140 -IGludGVyYWN0aXZl 15141 -c2Fs 15142 -YW5uYWg= 15143 -cGV6 15144 -57aT 15145 -IHVuZGVyc3RhbmRz 15146 -IFRva3lv 15147 -IGxpYnJhcmllcw== 15148 -IHJlYWRlcg== 15149 -kZA= 15150 -b3o= 15151 -IEVuZGU= 15152 -IEZsbw== 15153 -IG1pbGQ= 15154 -IHBvZXRyeQ== 15155 -INC20LjQsg== 15156 -5oSb 15157 -IGJlaGF2ZQ== 15158 -IGRvZW4= 15159 -IFN1c2Fu 15160 -cGFnZQ== 15161 -cmFoYW0= 15162 -IGNvbW11bmljYXRpb25z 15163 -IHR1bmluZw== 15164 -IHBhYw== 15165 -IGFueGlvdXM= 15166 -SU8= 15167 -TWFyaw== 15168 -IGhpw6c= 15169 -Ym9va3M= 15170 -IHBpc3M= 15171 -IGVuYWJsZWQ= 15172 -YWNoZWxvcg== 15173 -IEZPUg== 15174 -IMOpYw== 15175 -IFRS 15176 -aWxzdA== 15177 -aGF0 15178 -IOydjA== 15179 -IHR5Y2g= 15180 -IGphcg== 15181 -IGJ1aWxkcw== 15182 -IEFyZ2VudA== 15183 -IGludGVybWVkaQ== 15184 -IGxvdQ== 15185 -IGFyYQ== 15186 -IGFzc2lnbm1lbnQ= 15187 -IGNhYmluZXQ= 15188 -IHJldGlyZW1lbnQ= 15189 -44G7 15190 -IGRpc2FibGVk 15191 -cmljYQ== 15192 -IGF3YXJkcw== 15193 -IGJvb3Rz 15194 -IGFja25vd2xlZA== 15195 -IHRoeQ== 15196 -IOq1rA== 15197 -IHN5bmQ= 15198 -0L3QuNC5 15199 -aWx0b24= 15200 -IHByb2Js 15201 -IEZhbA== 15202 -IHZlcmRhZGU= 15203 -IDcwMA== 15204 -IExlYXJuaW5n 15205 -b2N1cw== 15206 -IHBhbGFjZQ== 15207 -Tm90 15208 -dGFpbg== 15209 -Y20= 15210 -IG1hZ25ldA== 15211 -aW5jb2xu 15212 -IGZpZ3VyaW5n 15213 -IEx5bg== 15214 -IEJvc3M= 15215 -IFZP 15216 -IGRpYWdub3Npcw== 15217 -IGVxdWlwcGVk 15218 -d2F0Y2g= 15219 -aW5vcw== 15220 -YWRlcnM= 15221 -IHNoZWxm 15222 -IG9yZ2FuaXM= 15223 -IG5vZA== 15224 -IGvEsXo= 15225 -cHBlcnM= 15226 -IHJlc3RvcmU= 15227 -IGFydGlj 15228 -IFZvaWNl 15229 -xLF5b3J1bQ== 15230 -6rKp 15231 -IHNwcmVhZGluZw== 15232 -IGhpcHM= 15233 -IHdhcmQ= 15234 -dXJlYXU= 15235 -IGludGVyc2VjdGlvbg== 15236 -NjY= 15237 -IDM5 15238 -57M= 15239 -IHdhaXRlZA== 15240 -7LQ= 15241 -aGhoaA== 15242 -IGR5cw== 15243 -IEVO 15244 -IGJhdGNo 15245 -IGNhZg== 15246 -IG1hcmtlcg== 15247 -5aSn5a625aW9 15248 -b3JhYmxl 15249 -w7NyaWE= 15250 -IHN0ZXBwZWQ= 15251 -IGNlbGVicmF0aW5n 15252 -0LDQvdCw 15253 -IHdvcm4= 15254 -IEZvbA== 15255 -IHBsYQ== 15256 -IGF0dGVtcHRz 15257 -IHR3ZWV0 15258 -IHJ1c3Q= 15259 -Z2VuY2U= 15260 -7Ya1 15261 -IHJldmVs 15262 -IHJlY2VwdA== 15263 -ZW5lc3M= 15264 -ICgo 15265 -44O844M= 15266 -IeKAiw== 15267 -IOyGkA== 15268 -IGluZmx1ZW5jZWQ= 15269 -0LjQtg== 15270 -INC60L7QvdC10YfQvdC+ 15271 -IGNvbGxlZ2Vz 15272 -aW9uaQ== 15273 -IHNhZw== 15274 -QW5u 15275 -b2xhcg== 15276 -IGV4cHJlc3Npb25z 15277 -IHN1aXRz 15278 -IG93bmVyc2hpcA== 15279 -ZWxhbmQ= 15280 -cGllY2U= 15281 -5oCO5LmI 15282 -IGRlc3B1w6lz 15283 -IHRlbA== 15284 -IGluc3VsdA== 15285 -IOq1ieyepQ== 15286 -IFNtYWxs 15287 -IEZS 15288 -b2th 15289 -YmVycmllcw== 15290 -IEFudG9u 15291 -0LXQu9GP 15292 -0Y/RgQ== 15293 -IHZhbHZl 15294 -YWN0cw== 15295 -IHdvb2Rz 15296 -4K6j 15297 -IGN1bHRpdg== 15298 -IGbDoQ== 15299 -44Go44GE44GG 15300 -IGNoZWVycw== 15301 -IGFzc3VtcHRpb24= 15302 -IGZpdG5lc3M= 15303 -w61jdWw= 15304 -IHBvZHI= 15305 -IHdlaXQ= 15306 -IEhpbmQ= 15307 -IGRpZ24= 15308 -INC30L0= 15309 -IHNxdWFk 15310 -IGRlc3Rybw== 15311 -Y2VyZQ== 15312 -c2hpcnQ= 15313 -aW1tdA== 15314 -ZW5nZXJz 15315 -IHPDpA== 15316 -a8WCYWQ= 15317 -IMiZ 15318 -IG9jY2Fz 15319 -IOykhA== 15320 -IHByb2Nlc3Nvcg== 15321 -IERN 15322 -IERhZGR5 15323 -IHNvb25lcg== 15324 -IHN0cmFpZ2h0Zm9yd2FyZA== 15325 -IGRlcGFydG1lbnRz 15326 -IENocm9tZQ== 15327 -IHdvcmtwbGFjZQ== 15328 -IFB5dGhvbg== 15329 -IG1lbmc= 15330 -IERBTg== 15331 -IEljZQ== 15332 -IOuIiA== 15333 -IEdp 15334 -IGhpcmluZw== 15335 -IGxhbmRlZA== 15336 -IGRlbW9jcmF0aWM= 15337 -aWVkeg== 15338 -44GY44KD 15339 -IHNldg== 15340 -aWNpYQ== 15341 -IGVzcGVjaWFs 15342 -IE5vdXM= 15343 -IGjDpHQ= 15344 -IGJvdQ== 15345 -cGVydA== 15346 -aWVzeg== 15347 -5ZGA 15348 -IHZpbA== 15349 -xZtsaQ== 15350 -IMOubg== 15351 -IGxvc3Nlcw== 15352 -6ZW3 15353 -IHRvYXN0 15354 -IHJlYWxt 15355 -IEF1c3Rpbg== 15356 -IEluZm9ybWF0aW9u 15357 -IHJlc3VtZQ== 15358 -IGNoYXNl 15359 -IHNhbGFyeQ== 15360 -IOu2hA== 15361 -0LvQuNGH 15362 -INGB0LvQtdC0 15363 -IEZ1cnRoZXI= 15364 -IGNhcmluZw== 15365 -IHZpZw== 15366 -IHZhbG9y 15367 -6L+Z5Liq 15368 -INGH0LA= 15369 -IGFuYWx5dGljcw== 15370 -IGdsb2Jl 15371 -IE1BTg== 15372 -IG5lbA== 15373 -7J207JW8 15374 -n7w= 15375 -IG95 15376 -7ZWY7IS47JqU 15377 -amVu 15378 -IHRyb3VibGVz 15379 -YWhhaGE= 15380 -IGNodXJjaGVz 15381 -dWV0 15382 -IG1lYXN1cmVtZW50cw== 15383 -Ymls 15384 -7L0= 15385 -aWZ1bGx5 15386 -0LjQvdGD 15387 -IFdpbHNvbg== 15388 -prQ= 15389 -IO2MjA== 15390 -IOywqA== 15391 -IHDDumJsaWM= 15392 -IEplcnVzYWxlbQ== 15393 -IG5haWxz 15394 -IHNwaW5l 15395 -IGhlbW9z 15396 -IHpu 15397 -cXVpcw== 15398 -IExlYmVu 15399 -IHJlZmVyZW5jZXM= 15400 -SVRI 15401 -aXBlcg== 15402 -INGB0LXQsdGP 15403 -7IE= 15404 -IFdh 15405 -c3RhdGU= 15406 -p50= 15407 -5YWx 15408 -IEdlbmVy 15409 -IGFjdHJlc3M= 15410 -IEVuam95 15411 -4LmD 15412 -INeS 15413 -IGluZmVjdGVk 15414 -IHNoYWtpbmc= 15415 -IG5pY2s= 15416 -4Li4 15417 -IGZvdA== 15418 -IGFjY29tcGxpc2hlZA== 15419 -dWtl 15420 -IHNoZWV0cw== 15421 -IGZlbmNl 15422 -IG51cnNpbmc= 15423 -IGludHJvZHVjaW5n 15424 -IGZlYXQ= 15425 -T25l 15426 -VE8= 15427 -IGNsdWJz 15428 -IEJydWNl 15429 -b25nZQ== 15430 -Y2hhbmdl 15431 -IEJhdG1hbg== 15432 -5Y+w 15433 -IE9mZmljZXI= 15434 -IGh5ZHJv 15435 -IHN1cHBsZW1lbnQ= 15436 -IGNlbGE= 15437 -IGxvbmdlc3Q= 15438 -IGNvbXBldGluZw== 15439 -IGNvbmhl 15440 -Z2l2aW5n 15441 -IGJyYWlucw== 15442 -IGxvYW5z 15443 -IHdhZ2U= 15444 -IENsaW50b24= 15445 -IHPEgw== 15446 -YW5lb3Vz 15447 -IGxvcmQ= 15448 -0YDRg9C2 15449 -IHF1aXo= 15450 -IHN0aWZm 15451 -IExHQg== 15452 -c3o= 15453 -TUU= 15454 -bWFyZQ== 15455 -dGhlcmU= 15456 -IG7DpHI= 15457 -IE1hbmQ= 15458 -bGFzdA== 15459 -IGRhZw== 15460 -IGhhbGZ3YXk= 15461 -IEJhbmQ= 15462 -IOuLpOyLnA== 15463 -IEFyZW4= 15464 -IGlsZQ== 15465 -UE4= 15466 -ZW50bw== 15467 -IGFsZ3Vt 15468 -IHNvY2Nlcg== 15469 -IGJsb2NrZWQ= 15470 -IEpvbmF0aGFu 15471 -IHNldw== 15472 -IFRlc3RhbWVudA== 15473 -IHZhbGU= 15474 -IGJlaGF2aQ== 15475 -5aeL 15476 -IGNvbm5h 15477 -SUNI 15478 -IGF1ZGllbmNlcw== 15479 -bWw= 15480 -YW1tYWQ= 15481 -IOyCtOw= 15482 -SUdI 15483 -IHJhY2Vz 15484 -ZW1lZA== 15485 -IG3hu5l0 15486 -w68= 15487 -IG92ZXJz 15488 -IGRlY2xhcmVk 15489 -IHNhbmE= 15490 -IFVuYQ== 15491 -INGA0LU= 15492 -dWNrcw== 15493 -IHBhaXJz 15494 -IGFuZ2U= 15495 -TmU= 15496 -IHVwcw== 15497 -YXZ5 15498 -w7hy 15499 -cmVlaw== 15500 -IGJlaGF2aW9ycw== 15501 -IHJlZmxlY3RlZA== 15502 -IHByaW9yaXRpZXM= 15503 -IGNvbmR1 15504 -IHJldHJlYXQ= 15505 -IGV4cGVuc2Vz 15506 -IOu0kA== 15507 -IHRyaXBsZQ== 15508 -IOq1ieyepe2eiA== 15509 -w6RsdA== 15510 -IGluZGlnZW5vdXM= 15511 -IG1pbmluZw== 15512 -IGFjY2VwdGFibGU= 15513 -IHJ1aW4= 15514 -Q0E= 15515 -dWluZQ== 15516 -IHBpcGVsaW5l 15517 -Y3RpYw== 15518 -w6p0 15519 -INCy0YHQtdCz0L4= 15520 -IGJvdW4= 15521 -IERpZ2l0YWw= 15522 -IEJvb20= 15523 -0YbQtQ== 15524 -INC70YPRhw== 15525 -IGFzYw== 15526 -jIDroZw= 15527 -IEdvb2RieWU= 15528 -IHJlbmRlcg== 15529 -ZW5leg== 15530 -YXJyZQ== 15531 -IFRIQVQ= 15532 -Ym91cg== 15533 -aWNpw7Nu 15534 -44Kt 15535 -RXZlcnk= 15536 -IHdpcmVz 15537 -IFBhcmxpYW1lbnQ= 15538 -bnVuZw== 15539 -YXRldXI= 15540 -IFNhdmU= 15541 -IFBoeXM= 15542 -IGFtb3I= 15543 -IEV2ZQ== 15544 -IGZyaWdodA== 15545 -IGdhbW1h 15546 -IG1pY3Jvcw== 15547 -bWl0dA== 15548 -IENvZGU= 15549 -IEJleQ== 15550 -cGxlZA== 15551 -INC40YHQv9C+0LvRjNC3 15552 -55c= 15553 -7IOJ 15554 -5aW5 15555 -IG1vbmV0 15556 -IEphaHJl 15557 -IGx1eHVyeQ== 15558 -IGRlYWY= 15559 -IGJldHJheQ== 15560 -IOqysA== 15561 -0LjQutC4 15562 -IGRlZmVhdGVk 15563 -IHVuZGVydA== 15564 -IHdlZw== 15565 -IGNvb2xlcg== 15566 -44GV44KT 15567 -aWFtaQ== 15568 -6YKE5pyJ 15569 -IEplc3NpY2E= 15570 -IEpveQ== 15571 -IHNvcGhpc3RpYw== 15572 -0LXQvdC40Lg= 15573 -8J2Y 15574 -IGNoaWxp 15575 -IFR5cGU= 15576 -IHByb3RlaW5z 15577 -IHByZXNlbnRpbmc= 15578 -YWxpYQ== 15579 -7Jq4 15580 -IE1ham9y 15581 -IG1vbGVjdWxl 15582 -dW1lcg== 15583 -IGNvbGxhcHNl 15584 -IEFueXdheXM= 15585 -IE1vdW50YWlu 15586 -YW50ZWQ= 15587 -44CQ 15588 -INCy0LjQtNC10L4= 15589 -5rC0 15590 -QXVk 15591 -IGNvbnF1 15592 -IHZvbGw= 15593 -IGtuaXQ= 15594 -IG1lbWJy 15595 -IE1hcmtldA== 15596 -IGRhcmk= 15597 -IGNhbGN1bGF0ZWQ= 15598 -0LPQuA== 15599 -IHNocmltcA== 15600 -IE11 15601 -INC/0YDQvtGC 15602 -IOyYgeyDgQ== 15603 -IHByb2R1Y3Rpdml0eQ== 15604 -IGNvZ25pdGl2ZQ== 15605 -IEhlYg== 15606 -aWN0aW9ucw== 15607 -6rK9 15608 -IGNyw6k= 15609 -ZsO2cg== 15610 -IHByYXlpbmc= 15611 -YXNoaQ== 15612 -IFRpaw== 15613 -w7Ny 15614 -d2Vu 15615 -0YzRjg== 15616 -aXhv 15617 -ICgi 15618 -INGC0LXQuw== 15619 -IOyWtOuWpA== 15620 -INC/0LXRgNC10LQ= 15621 -IERyaXZl 15622 -44CR 15623 -IEVxdQ== 15624 -IGVxdWlsaWJyaXVt 15625 -IGRlc2NyaWJlcw== 15626 -0L3QtdC1 15627 -NDI= 15628 -IEN1cnJlbnQ= 15629 -eXk= 15630 -IGFic29yYg== 15631 -IHNvbGRpZXI= 15632 -ZGVycw== 15633 -IHRlc3RpbW9ueQ== 15634 -IGRlY2xpbmU= 15635 -nOuhnA== 15636 -Z2FnZQ== 15637 -IGluc3BpcmU= 15638 -bGFwcGluZw== 15639 -IHNwaW5uaW5n 15640 -IHNsYXZlcnk= 15641 -IGZhY2lhbA== 15642 -IHRyYWRpdGlvbnM= 15643 -w6FyaW9z 15644 -IEhvc3BpdGFs 15645 -IG5lc3Q= 15646 -IOuIhA== 15647 -IHRvaQ== 15648 -IGZlYXJz 15649 -7IWo 15650 -IE11aA== 15651 -IGdyYWR1YXRpb24= 15652 -IGltcGFjdGVk 15653 -IGF1bnQ= 15654 -IExldHM= 15655 -IGFsdW1pbnVt 15656 -IGRvbWluYW50 15657 -IERhdmlz 15658 -IE5hdnk= 15659 -IGNvbXB0 15660 -b3BsZXM= 15661 -IGVzdGF2YQ== 15662 -6KU= 15663 -IHNjYWw= 15664 -IHByZXNlcnZl 15665 -IE9wcA== 15666 -IHByYWN0aWNhbGx5 15667 -IG1hZ25pdHVkZQ== 15668 -IGZpdHRpbmc= 15669 -IGNvb3JkaW5hdGU= 15670 -IGZ1cm5pdHVyZQ== 15671 -IEZhbWls 15672 -IGV4cGxvc2lvbg== 15673 -IGRvY3VtZW50YXJ5 15674 -IFNjcmlwdA== 15675 -IHBvcnRyYXk= 15676 -bWF0 15677 -IHNjaGVkdWxlZA== 15678 -IGR5bmFtaWNz 15679 -cGh5 15680 -YWt5 15681 -IFVJ 15682 -Q2hl 15683 -IGNvbnRpbnVvdXNseQ== 15684 -IFByb3Y= 15685 -5bCR 15686 -0YPQtw== 15687 -cmFo 15688 -IGdlcm5l 15689 -cHJvb2Y= 15690 -IHNlY3JldGFyeQ== 15691 -IFBhdHJlb24= 15692 -c2NyZWFt 15693 -IEtpZHM= 15694 -4buTaQ== 15695 -IGtn 15696 -IHVuY2VydGFpbnR5 15697 -INC60LDQttC0 15698 -IG1pdGln 15699 -IHJlYWRz 15700 -5bey 15701 -IFJ1 15702 -IHByaWVzdA== 15703 -INC90LXQtA== 15704 -IGxpbWl0YXRpb25z 15705 -IGZsb2F0 15706 -NjAw 15707 -IFRveQ== 15708 -IEppbW15 15709 -IG9mZmVuc2l2ZQ== 15710 -ZW5p 15711 -IFhp 15712 -IGV5ZWJy 15713 -IFR1cms= 15714 -IGFjY2lkZW50YWxseQ== 15715 -IG9obmU= 15716 -IFNhdWQ= 15717 -OTU= 15718 -IER1dGNo 15719 -0LDQvdGB 15720 -IFNlYXR0bGU= 15721 -IOuTsQ== 15722 -Y2hlY2s= 15723 -a8SZ 15724 -IGNvbnRyaWJ1dGlvbnM= 15725 -IGJlc2lkZQ== 15726 -IHF1aW5kaQ== 15727 -IGZsZXc= 15728 -5pe2 15729 -2LDYpw== 15730 -IExP 15731 -IHdhaXN0 15732 -IEVW 15733 -IGhvbGlkYXlz 15734 -am9u 15735 -IG1pc3VuZGVy 15736 -0Y/QvQ== 15737 -IGJvdXQ= 15738 -IGRpbWlu 15739 -4bq9 15740 -w7Ns 15741 -IEdyYWNl 15742 -IGlucHV0cw== 15743 -IGRlbnk= 15744 -IGZvcm1pbmc= 15745 -IEJpbGQ= 15746 -IGFkZXF1 15747 -IGZvbGs= 15748 -IHJlamVjdGVk 15749 -c2VtYg== 15750 -IGZydXN0cmF0ZWQ= 15751 -b3Blbg== 15752 -IEJldHRlcg== 15753 -aWxvbg== 15754 -IHRvd2Vs 15755 -IGRpZmZlcmVudGlhbA== 15756 -IHNhY3JlZA== 15757 -IHNhaWw= 15758 -6YeM 15759 -ZW50aW1lcw== 15760 -IGdlbnRsZW1hbg== 15761 -IGljb25pYw== 15762 -IGNvbXBhcmluZw== 15763 -IHNhZ3Q= 15764 -IHRleHRz 15765 -IGdyYW5kbWE= 15766 -IHJvbGxz 15767 -IGNvbnRlbnRz 15768 -5LiN5aW9 15769 -0L7RgdGB 15770 -IHN1c3BlbnNpb24= 15771 -cm9pdA== 15772 -prw= 15773 -IGFzc2V6 15774 -IGRvcnQ= 15775 -IE1hdGg= 15776 -IFZpY3Rvcg== 15777 -IEphdmFTY3JpcHQ= 15778 -5LiN5bCN 15779 -IGVuaGFu 15780 -xZk= 15781 -IEJ1c2g= 15782 -IHByb21vdGlvbg== 15783 -IGtpbg== 15784 -IG1vbnN0ZXJz 15785 -IENvbG9yYWRv 15786 -IM6y 15787 -7ZW07JqU 15788 -5q2j 15789 -aWZmZXJlbnQ= 15790 -IG5ha2Vk 15791 -IHByb2Q= 15792 -ZXRpY3M= 15793 -IFdvbWFu 15794 -IHRyZWF0bWVudHM= 15795 -IGVzdG95 15796 -dsOp 15797 -IGxpZnRpbmc= 15798 -IHlhcHQ= 15799 -IFJvYmVy 15800 -IOy5nA== 15801 -IHN1YnN0aXR1dGU= 15802 -YWt1 15803 -cmlkZ2U= 15804 -IOqxsOs= 15805 -IHJlc3BvbmRlZA== 15806 -IGLDqQ== 15807 -IEVuZ2luZWVy 15808 -IHRyYW5zZmVycmVk 15809 -67I= 15810 -IGhhYmVy 15811 -b29w 15812 -IFdF 15813 -IHZlc3Q= 15814 -IGZvcnR5 15815 -IERT 15816 -IDIwMDQ= 15817 -IGNvYWNoaW5n 15818 -bm9t 15819 -IEJhYg== 15820 -IG5vc3Nh 15821 -IEpha2U= 15822 -IGd5 15823 -IGRlbGVn 15824 -IOyeoA== 15825 -INC60YDQsNGB 15826 -IHN0YW5kcG9pbnQ= 15827 -IGRpc2Fk 15828 -IGFydHdvcms= 15829 -QWQ= 15830 -aWxsbw== 15831 -IMSRxrDhu6Nj 15832 -IFByb20= 15833 -IExpYg== 15834 -IGNyaXRpY2lzbQ== 15835 -IGNvbnRhY3Rz 15836 -0YDQsNC8 15837 -IGFjaGlldmVtZW50 15838 -0JTQsA== 15839 -IGRpc3NvbA== 15840 -IFZlZ2Fz 15841 -IHN0cmVhbXM= 15842 -IEtlbnQ= 15843 -INi52YTZiQ== 15844 -IHJhZGl1cw== 15845 -IHN1Y2tz 15846 -IEFjaA== 15847 -IGZp 15848 -b3VzdA== 15849 -INC70Y7QtNC4 15850 -IHBhbGV0dGU= 15851 -IEhheg== 15852 -IEFudGhvbnk= 15853 -IHRlbWE= 15854 -IENvcw== 15855 -IHNhZmVy 15856 -zrHPgg== 15857 -IGNvbnRyYWQ= 15858 -IG1haW9y 15859 -IGluZmxhdGlvbg== 15860 -IFNpbHZlcg== 15861 -IGF0dGVuZGluZw== 15862 -7ZWc7YWM 15863 -YXJ0bw== 15864 -IGFwcGxhdWRpbmc= 15865 -IGNvbXB1dGluZw== 15866 -IEhhdA== 15867 -5rs= 15868 -a25vdw== 15869 -bWFrZXJz 15870 -IGNvbm9j 15871 -IGVkdWNhdGVk 15872 -IG1vZGlmaWVk 15873 -IGluY2x1c2lvbg== 15874 -bWVudGFs 15875 -npA= 15876 -aXNpYQ== 15877 -IM+Azr/PhQ== 15878 -IGF1bg== 15879 -IElyZWxhbmQ= 15880 -IGvDtg== 15881 -IGNvbXBsaWFuY2U= 15882 -IGluc3BpcmluZw== 15883 -0LjRgtC10LvRjNC90L4= 15884 -IGRpc3Bvcw== 15885 -7LCo 15886 -IHdpcA== 15887 -cmljYWw= 15888 -cmF3ZA== 15889 -IHRyZXM= 15890 -IG1vYmls 15891 -b2x1dGlvbnM= 15892 -Qk8= 15893 -IGJvdW5jZQ== 15894 -IGFzc3VtZWQ= 15895 -IE1lZGljYWw= 15896 -IGZpc2NhbA== 15897 -IG5nxrDhu51p 15898 -aXRpb25hbGx5 15899 -IHN0b2xlbg== 15900 -IEJN 15901 -IG1lY2hhbmlzbXM= 15902 -zrXOrw== 15903 -IHF1YWxpZmllZA== 15904 -IOyekOs= 15905 -dWdodGVycw== 15906 -IEhJVg== 15907 -IExvdHM= 15908 -IHNlcnZlcnM= 15909 -IGNhcnI= 15910 -IFRvZ2V0aGVy 15911 -IGF0dHJhY3RlZA== 15912 -IGty 15913 -5oiR5piv 15914 -dGh1cg== 15915 -aW5pbg== 15916 -IEhhbGY= 15917 -yJs= 15918 -IFBhcA== 15919 -IHJlbWluZGVk 15920 -QUxM 15921 -IGhlbG1ldA== 15922 -IGJvdHRsZXM= 15923 -IHByb2Zlc3NvcnM= 15924 -IHNlaW5l 15925 -xYLEhQ== 15926 -44OP 15927 -IOqxsOyVvA== 15928 -INei15w= 15929 -ZnVu 15930 -IEJpcmQ= 15931 -IGZpZ2h0ZXI= 15932 -IOuUsOs= 15933 -IFRvb2w= 15934 -IHRpbg== 15935 -aW5vaXM= 15936 -67aE 15937 -15nXnw== 15938 -IENBUg== 15939 -5ZCN 15940 -aXJzdHk= 15941 -IG91dGRvb3I= 15942 -IE5T 15943 -44WO 15944 -ZmZlbg== 15945 -IGx1ZA== 15946 -SGVsbG8= 15947 -IHJvbGxlcg== 15948 -aWVsZQ== 15949 -IFBvbGFuZA== 15950 -IGFwYQ== 15951 -ZXhw 15952 -IGNlcnRpZmljYXRl 15953 -IFRvd24= 15954 -0LDRjtGC0YHRjw== 15955 -aWxkZQ== 15956 -IGRldGVybWlu 15957 -UFI= 15958 -IGZyZWV6ZQ== 15959 -IG1haW5zdHJlYW0= 15960 -IG9iamVjdGl2ZXM= 15961 -Ymxv 15962 -IHRha2ll 15963 -5ZOI5ZOI 15964 -IOuwlOuhnA== 15965 -ZWxldA== 15966 -IElW 15967 -IEZhc3Q= 15968 -IGRlcmU= 15969 -ZW1w 15970 -IERyYQ== 15971 -IOyeiOyXiA== 15972 -IGRpc2NyaW1pbmF0aW9u 15973 -IM61zq/Ovc6xzrk= 15974 -bmVjZXNz 15975 -5q4= 15976 -xLHEn8Sx 15977 -IHBvc3Rpbmc= 15978 -d2nFm2NpZQ== 15979 -IGx1Yg== 15980 -IG9saXZl 15981 -IHJpbQ== 15982 -IG1vZGVsaW5n 15983 -IGHDsW8= 15984 -IFBha2lzdGFu 15985 -IG92ZXJs 15986 -IGluZmxhbQ== 15987 -TkU= 15988 -7JeQ6rKM 15989 -IGF0dGVuZGVk 15990 -IGRlYWx0 15991 -IEFsdA== 15992 -IExpbmNvbG4= 15993 -IGF3YWtl 15994 -IGZpbHRlcnM= 15995 -IFdpdGhpbg== 15996 -Y3p5d2nFm2NpZQ== 15997 -IHPDuw== 15998 -IEpvaG5ueQ== 15999 -IGludGVncml0eQ== 16000 -IGlzb2xhdGlvbg== 16001 -IEVhc3k= 16002 -INC/0YDQuNC9 16003 -IEFsaWNl 16004 -IHNtaWxpbmc= 16005 -ZW5peA== 16006 -LC4uLg== 16007 -zrY= 16008 -IGJlZ3Vu 16009 -IGpld2Vs 16010 -IGNvbnZlbnRpb25hbA== 16011 -IHN0YXRpc3Q= 16012 -IGhhbmRlZA== 16013 -IGlycmU= 16014 -IHByb2hpYg== 16015 -IHNhdGVsbGl0ZQ== 16016 -6aaZ 16017 -IEluZHVzdA== 16018 -IHRyYWdlZA== 16019 -IHRyYXZh 16020 -IGlobQ== 16021 -IGNydWVs 16022 -IEFnb3Jh 16023 -IERvYw== 16024 -IHpvbmVz 16025 -IG1hbGw= 16026 -IHRyYXk= 16027 -15XXoA== 16028 -IGlycml0 16029 -IGthbnM= 16030 -IEJlYXQ= 16031 -dWRnZQ== 16032 -aWVsbGU= 16033 -IHRydXN0ZWQ= 16034 -IGJpa2Vz 16035 -INGD0L8= 16036 -IE1lbWJlcg== 16037 -d2ljaw== 16038 -IGNyZWF0b3Jz 16039 -IGhlcml0YWdl 16040 -aW5kaXN0aW5jdA== 16041 -IHJlc3Vy 16042 -ZW5uZW4= 16043 -Q29tZQ== 16044 -IGZpcmluZw== 16045 -IEJ1ZW5v 16046 -INCi0L4= 16047 -aWthbg== 16048 -ZXR0ZXM= 16049 -IGtlcw== 16050 -IHRyaXBz 16051 -IGRpdm9yY2U= 16052 -IEts 16053 -IGNvbnNvbA== 16054 -a2VlcA== 16055 -6riw6rCA 16056 -IFJlcG9ydA== 16057 -IGhvc3Rpbmc= 16058 -IGRpYW1vbmQ= 16059 -IGNvbXBsaWM= 16060 -IGhlbGljb3A= 16061 -IGRlcHVpcw== 16062 -ZHM= 16063 -IENoYW4= 16064 -0Y/Quw== 16065 -IHNjaXNzb3Jz 16066 -aWxhdGlvbg== 16067 -IHByb3BvcnRpb24= 16068 -RVJF 16069 -INmI2KfZhA== 16070 -aW50YQ== 16071 -IG11Y2hhcw== 16072 -dWF0aW9u 16073 -aXRpcw== 16074 -5oqK 16075 -0Y/RiQ== 16076 -IG5paW4= 16077 -IGVtcGhhc2l6ZQ== 16078 -dWVsYQ== 16079 -IHByb2R1Y2Vycw== 16080 -IHJ6ZQ== 16081 -w6RuZGVy 16082 -RVRI 16083 -5ro= 16084 -IGNvbnN0aXR1 16085 -5Zu9 16086 -IHBlcmZvcm1hbmNlcw== 16087 -aXN0bGU= 16088 -Z292 16089 -IExpdGVy 16090 -IGluY29ycG9yYXRl 16091 -IGVkdWNhdGU= 16092 -IE5pbg== 16093 -7Kq9 16094 -2YfZhQ== 16095 -ZWxlcmF0aW9u 16096 -15XXkQ== 16097 -IHlhxZ8= 16098 -b3JvdXM= 16099 -IENhcw== 16100 -IGdyYW50cw== 16101 -64ql 16102 -YW1lbA== 16103 -IOq3uOugh+qyjA== 16104 -IEVzdGU= 16105 -0YXQvtC00LjRgg== 16106 -INC/0L7RgdC70LU= 16107 -IGdlbnQ= 16108 -IGZvY3VzZXM= 16109 -YWxpdGllcw== 16110 -IFJo 16111 -67O0 16112 -5rCR 16113 -IERhbmNl 16114 -cnI= 16115 -IGFtZXI= 16116 -IHV0aWxpemU= 16117 -IGzDrQ== 16118 -IEFtb25n 16119 -IHByZWduYW5jeQ== 16120 -IGxvb3Bz 16121 -0LDQu9C+0YHRjA== 16122 -IE1vaA== 16123 -IGNhdGNoaW5n 16124 -IGdsb2I= 16125 -IGFqdWQ= 16126 -IFs/ 16127 -IEFuYWw= 16128 -bG9va2luZw== 16129 -IHN1cmZhY2Vz 16130 -IHByb2dyZXNzaXZl 16131 -IHZpcmFs 16132 -MDg= 16133 -zr4= 16134 -S0E= 16135 -IMW8eQ== 16136 -IHBpY2tz 16137 -YW5ub24= 16138 -IGJ1bGs= 16139 -IFJvc3M= 16140 -IGRlc2NyaWJpbmc= 16141 -IEdlbA== 16142 -IGxvY2FsbHk= 16143 -IGVuZGxlc3M= 16144 -IG1hc3NhZ2U= 16145 -IGNsZWFuZWQ= 16146 -IHRyYXZlbGVk 16147 -0LXQvdGL 16148 -IHNlbnRpbWVudA== 16149 -aWdtYQ== 16150 -IE5hcw== 16151 -IGNoZW1pY2Fscw== 16152 -IHJpZ2h0ZW91cw== 16153 -IE1hZ2lj 16154 -IHJlbGF0ZXM= 16155 -IHRydWNrcw== 16156 -IDE5NjA= 16157 -5Yil 16158 -IGFwcGV0 16159 -IHNuYWNrcw== 16160 -IFN1bW1lcg== 16161 -IHnDvHo= 16162 -IHByaXM= 16163 -IE1leGljYW4= 16164 -IHRyYW5zcGFyZW4= 16165 -IG1pbm9yaXR5 16166 -IHZlcnRl 16167 -IGxhc3Nlbg== 16168 -NDY= 16169 -0LvQtdC6 16170 -w6lw 16171 -INGE0LjQu9GM 16172 -IGl5aQ== 16173 -IHNwYW4= 16174 -7ZWY7KeA 16175 -IGluZGljYXRlZA== 16176 -cXVhcg== 16177 -IHNjaG9sYXJzaGlw 16178 -IExHQlQ= 16179 -IGhpc3RvcmljYWxseQ== 16180 -w7PFgg== 16181 -IG1pbmlzdA== 16182 -IHBlbmV0 16183 -IFJhcA== 16184 -IGNvbnNlcnZhdGlvbg== 16185 -55u0 16186 -IEhvbmV5 16187 -IEJlaQ== 16188 -aWRlbA== 16189 -IHJlc3BvbnNpYmlsaXRpZXM= 16190 -IG1lc3N5 16191 -IEV4Y2VwdA== 16192 -T1JF 16193 -IGluaXRpYXRpdmVz 16194 -IGp1bmlvcg== 16195 -IGRlc2lnbmVycw== 16196 -IGV4cGxvcmF0aW9u 16197 -IHNwb25zb3I= 16198 -IG1vYmlsaXR5 16199 -IGludGVn 16200 -bGFuZG8= 16201 -IGJhcms= 16202 -IGluZGljYXRlcw== 16203 -4LY= 16204 -IGVtcGxveWVy 16205 -5a6J 16206 -IGNvdXNpbg== 16207 -IGJvaWxpbmc= 16208 -IGNocm9t 16209 -IMOnYWw= 16210 -IHBlcnBldA== 16211 -IGNvbnRhaW5lZA== 16212 -IHBhcmtz 16213 -0Ks= 16214 -IEVuZ2luZWVyaW5n 16215 -UGxlYXNl 16216 -IFN0YXJ0aW5n 16217 -aGVybw== 16218 -IGxhd3llcnM= 16219 -6KW/ 16220 -IHpk 16221 -IGZyYW5jaGlzZQ== 16222 -cmFnZQ== 16223 -IGludHVpdA== 16224 -IEdM 16225 -cmVhY2g= 16226 -IEVsbGU= 16227 -IG5oxrA= 16228 -IE5vcmQ= 16229 -IGJlYW4= 16230 -MDc= 16231 -IHBsZWFzYW50 16232 -5b2T 16233 -dmlyb24= 16234 -IGdyYWRpZW50 16235 -enVz 16236 -IEVN 16237 -IGVzc2F5 16238 -7JeQ7JqU 16239 -4bq/bg== 16240 -bnU= 16241 -4bur 16242 -IMOJcw== 16243 -IGRlbm9taW4= 16244 -IEdpcmxz 16245 -IHBlcnNvbm5lcw== 16246 -INin2YTYow== 16247 -YmlsZA== 16248 -IFN0YXQ= 16249 -IGNvbXBsaW1lbnQ= 16250 -IEthdGU= 16251 -IG9wdGltYWw= 16252 -IGhpZA== 16253 -2K/Zig== 16254 -IHF1aWNrZXI= 16255 -d2FsbA== 16256 -RW4= 16257 -SU5F 16258 -Pz8/ 16259 -7LK0 16260 -IEFjdGlvbg== 16261 -5Z8= 16262 -IHBlbmFsdHk= 16263 -IEtheg== 16264 -Jz8= 16265 -IGNyaWVk 16266 -IGNhbnZhcw== 16267 -ZnRl 16268 -IGV4Y2x1ZA== 16269 -uOuhnA== 16270 -IGVtcGhhc2lz 16271 -IGVuenk= 16272 -IEhvdQ== 16273 -IG92ZXJzZWFz 16274 -w61hbW9z 16275 -5bir 16276 -w7ZnbGljaA== 16277 -IGhlYWRwaG9uZXM= 16278 -Y24= 16279 -IEFnZQ== 16280 -IGFrYW4= 16281 -IGNoYXJhY3RlcmlzdGlj 16282 -7ZWY66m0 16283 -Z2V0cw== 16284 -IOu2iA== 16285 -IHJpdmFs 16286 -IGJvcmRlcnM= 16287 -ZW1lbnRl 16288 -ZW3DoXM= 16289 -IHlvbA== 16290 -IGNvbXBl 16291 -ZW5kZXJz 16292 -xLFuZGFu 16293 -IG3DtmdsaWNo 16294 -IGJ1YmJsZXM= 16295 -bmF0dXJhbA== 16296 -IGFybWVk 16297 -IGVsYWJvcg== 16298 -IOydtOuyiA== 16299 -IHdhc2hlZA== 16300 -zr/Phc68zrU= 16301 -6KuL 16302 -IGZsYXZvcnM= 16303 -IGV4aXN0ZQ== 16304 -IHByZXN0 16305 -IFRoZW1h 16306 -0L7Qv9GA0L7RgQ== 16307 -ZXJvbg== 16308 -VUU= 16309 -ZXJp 16310 -IGNvbmNlcg== 16311 -IGFpeMOy 16312 -5YWp 16313 -IHByb3RlY3RpdmU= 16314 -INC30L3QsNGO 16315 -IOuCoA== 16316 -IElJSQ== 16317 -IG1lZXI= 16318 -IFNob3A= 16319 -bGxp 16320 -IE9yZGVy 16321 -IE1Z 16322 -IEdob3N0 16323 -44KC44GG 16324 -YWRlbA== 16325 -IHN0b2xl 16326 -IHJlbGVhc2luZw== 16327 -IENvbW1lbnQ= 16328 -IHRyYWlucw== 16329 -66qF 16330 -IHdpc3Nlbg== 16331 -ZW5zZWQ= 16332 -IGRlc2NlbmQ= 16333 -IGZpZXI= 16334 -IHJhZGk= 16335 -IHBlcnN1 16336 -56I= 16337 -INC80L0= 16338 -IERlc3Q= 16339 -IHdvcnJpZXM= 16340 -aXRldA== 16341 -YmFz 16342 -IHN0YWI= 16343 -bmFtZQ== 16344 -b3JpYw== 16345 -IENsb3Nl 16346 -IGFsdW1uaQ== 16347 -IFNlbGY= 16348 -ZmZl 16349 -aXRhdGluZw== 16350 -YXRoZXJpbmU= 16351 -IFJpZ2h0cw== 16352 -IGVsbG9z 16353 -IHdhcnJhbnQ= 16354 -IG5lcnZl 16355 -IHZlZ2V0YWJsZQ== 16356 -IFRlaWw= 16357 -IOqwmeydtA== 16358 -Ulk= 16359 -IHN1c3RhaW5hYmlsaXR5 16360 -IHN0ZWh0 16361 -IGJyaWQ= 16362 -YWRhxZ8= 16363 -IHR2 16364 -IGR1cmF0aW9u 16365 -IHBlc3NvYQ== 16366 -IG1ldHJpY3M= 16367 -IGFkYW0= 16368 -Y2Fz 16369 -0LDRgNC4 16370 -IGV2aWRlbnQ= 16371 -IGRpc3BsYXllZA== 16372 -2KfYpg== 16373 -IHJlY2s= 16374 -IEJ1ZGRoYQ== 16375 -IGRlbGU= 16376 -IERpZWdv 16377 -b3NwaA== 16378 -IGJsYQ== 16379 -IE1paw== 16380 -dWxhdG9y 16381 -IDIwMDE= 16382 -IHByb21vdGluZw== 16383 -eWNo 16384 -IEVY 16385 -IGxhc3RseQ== 16386 -IG91dGxpbmU= 16387 -IHNwaXJpdHM= 16388 -IHZldXg= 16389 -IHN1YnRyYWN0 16390 -IMWfaW1kaQ== 16391 -IHBpbnM= 16392 -IGJ1cmdlcg== 16393 -IG1vbHRv 16394 -IGhhYsOtYQ== 16395 -IOuwmA== 16396 -aWd1 16397 -ZXJzdA== 16398 -IG5lbg== 16399 -IGJhY29u 16400 -aXRpb3Vz 16401 -IGNhcnJpZXM= 16402 -IHByb21pc2Vz 16403 -bmRl 16404 -IExlZnQ= 16405 -IExpbQ== 16406 -5qM= 16407 -IDQ0 16408 -IGNhcmVlcnM= 16409 -IOyjvOs= 16410 -IHNwZWVkcw== 16411 -cXXDqQ== 16412 -bWFk 16413 -bWFya2V0 16414 -aXNtZQ== 16415 -IDIwMDM= 16416 -IHJlY2Vzcw== 16417 -IEpVRA== 16418 -IHJhY2lzdA== 16419 -IFNjaGw= 16420 -IHBhcmxlcg== 16421 -IG90cm9z 16422 -aXNoZXM= 16423 -IGNvbnZlcnRlZA== 16424 -YWFhYQ== 16425 -0LDQvdC40Lg= 16426 -IEFyaw== 16427 -IENoYW5jZQ== 16428 -IGVsZW1lbnRhcnk= 16429 -zrXOvQ== 16430 -aW5rcw== 16431 -SW50ZXJ2aWV3ZXI= 16432 -IGZyZWVseQ== 16433 -YWxhaA== 16434 -IOuLpOuluA== 16435 -IHJlcXVlc3RlZA== 16436 -IHRvcnF1ZQ== 16437 -bm/Fm2Np 16438 -b3VyZWQ= 16439 -IFN0YWZm 16440 -IHN0YWlu 16441 -IEFsYW4= 16442 -IHZlcmU= 16443 -IFdpbnRlcg== 16444 -IGRlZmVjdA== 16445 -aWVkeQ== 16446 -IGJlYXRz 16447 -IGjDoQ== 16448 -dW1u 16449 -b29ucw== 16450 -aXR1ZGVz 16451 -IHNlaXQ= 16452 -b2x5 16453 -IHJlc2Vydg== 16454 -IGV4dHI= 16455 -IHBoeXNpY2lhbg== 16456 -dmlzb3I= 16457 -IGhhbmRmdWw= 16458 -IE5hdGlvbnM= 16459 -IOyii+ydgA== 16460 -dWNjZXNz 16461 -IHVwc3RhaXJz 16462 -IFNxdWFyZQ== 16463 -IGhlaW4= 16464 -IFNlYXNvbg== 16465 -b2xpcw== 16466 -IHByaW5jZQ== 16467 -IGRlZmVuc2l2ZQ== 16468 -570= 16469 -INC80LXRgdGC 16470 -0ZbQuQ== 16471 -INin2YY= 16472 -dW1ibGU= 16473 -6rmM7JqU 16474 -IGFzc2Fzcw== 16475 -IGNpcmN1bGFy 16476 -IHF1YWxpdGllcw== 16477 -IGhtbQ== 16478 -IGJsb3du 16479 -IExpeg== 16480 -IEt1cg== 16481 -IFNB 16482 -IGZpbmRpbmdz 16483 -IGNvbG91cnM= 16484 -IGRlbGxl 16485 -IElS 16486 -IEF0aA== 16487 -IER1Yg== 16488 -IE94 16489 -INiu 16490 -IHBvY2tldHM= 16491 -IGdyaWxs 16492 -IHN3aXRjaGluZw== 16493 -IHByZWZlcnJlZA== 16494 -IFdhbGVz 16495 -IGV4ZW1wbG8= 16496 -IGNob3BwZWQ= 16497 -IHZhY2NpbmF0aW9u 16498 -IG5ldXJv 16499 -IHNwZWNpZnk= 16500 -aXZvcw== 16501 -IHNlcsOh 16502 -IHppZQ== 16503 -IOCurg== 16504 -IHJlc3VsdGluZw== 16505 -IFVnaA== 16506 -IG1lc3NlZA== 16507 -Q0Q= 16508 -IHBhYXI= 16509 -IGNvbWVy 16510 -IGNvdWNo 16511 -IEZlc3RpdmFs 16512 -IDQ5 16513 -dm91cw== 16514 -emVucw== 16515 -56iu 16516 -IEtlbm5lZHk= 16517 -IFRz 16518 -IOuztOyX 16519 -IGRlbW9uc3RyYXRpb24= 16520 -IHVudG8= 16521 -IGZydXN0cmF0aW5n 16522 -IGxhYm9yYXRvcnk= 16523 -IGVneQ== 16524 -IGJlYXV0aWZ1bGx5 16525 -IOyerOs= 16526 -IGFsZ3U= 16527 -IMO2eWxl 16528 -5L2g55yL 16529 -IFBI 16530 -IGZvcnR1bmU= 16531 -IGNsZWFuZXI= 16532 -IFJvYmlu 16533 -IHNhdXM= 16534 -IEdlbGQ= 16535 -IGthdA== 16536 -b2Jz 16537 -IG9sdXI= 16538 -IG1hdHQ= 16539 -IHF1ZXN0YQ== 16540 -IHN1Z2dlc3Rpb24= 16541 -ZW5jZXI= 16542 -0L7RgdGC 16543 -IHJhZGFy 16544 -IOyeoQ== 16545 -aXNoYQ== 16546 -4K6o 16547 -44KT44Gq 16548 -amVz 16549 -IHZlZWw= 16550 -7IKw 16551 -IGF1dGhvcnM= 16552 -44CO 16553 -cGxhbg== 16554 -IGNvbGxhYm9yYXRpdmU= 16555 -IGluc3RpbmN0 16556 -IGZhcm1pbmc= 16557 -YXVnZQ== 16558 -RWR1 16559 -IG1lbWJlcnNoaXA= 16560 -IHNpbXVsdGFuZW91c2x5 16561 -IGJha2U= 16562 -IGvDpA== 16563 -IGxlY3R1cmVz 16564 -0YfQtdGB 16565 -IHByZW5kcmU= 16566 -IGNvbGxhcHM= 16567 -IFNheWE= 16568 -IEZ1dA== 16569 -IHlvZw== 16570 -IFJhdGhlcg== 16571 -2LHZig== 16572 -IGNhbXBz 16573 -0L7Qu9C+0LQ= 16574 -IHNpbXVsYXRpb24= 16575 -IE1haw== 16576 -TGF1Z2hz 16577 -IGdyZXk= 16578 -IHNlbnRlbmNlcw== 16579 -eWVu 16580 -IFVubGVzcw== 16581 -SmU= 16582 -IFNhdGFu 16583 -INGC0LDQutC20LU= 16584 -IE5B 16585 -IGJyb24= 16586 -ID9d 16587 -IHNvdWxz 16588 -IGxpZ2h0bmluZw== 16589 -IGltYWdpbmVk 16590 -IGN6eWxp 16591 -cHNpbG9u 16592 -ZXR0YQ== 16593 -IGJlbGlldmluZw== 16594 -IHN0cm9uZ2VzdA== 16595 -IENPTg== 16596 -IHF1ZWxxdWVz 16597 -IGltbWlncmFudHM= 16598 -IHdhbGxldA== 16599 -6YCZ5piv 16600 -IEplcnNleQ== 16601 -IGltcGxpY2F0aW9ucw== 16602 -IGZvcmI= 16603 -44CP 16604 -IHVuYmVsaWV2YWJsZQ== 16605 -2KfYoQ== 16606 -IG9wZXJhdGlvbmFs 16607 -w7xz 16608 -IEdN 16609 -IOq3uOufsOuNsA== 16610 -IGdyYWNpYXM= 16611 -IGVudGVuZA== 16612 -IFJlZ2FyZA== 16613 -cm9i 16614 -INGC0LXRhQ== 16615 -6I8= 16616 -IFJldm9sdXRpb24= 16617 -IHdhYXI= 16618 -IEJpeg== 16619 -dGhlbGVzcw== 16620 -IHNwb25zb3JlZA== 16621 -cXVpZXI= 16622 -IOydvOs= 16623 -IHRlaw== 16624 -IOuQoA== 16625 -aWdrZWl0 16626 -IEx1Y2s= 16627 -IENlcnRhaW5seQ== 16628 -IHRvbGw= 16629 -INC90LjRh9C10LPQvg== 16630 -IE1vbmV5 16631 -INGB0YLQvtGA 16632 -IERvdWJsZQ== 16633 -IFdvbGY= 16634 -IGNodW5r 16635 -zqzOvQ== 16636 -aXTDqXM= 16637 -b25pbmc= 16638 -TWFy 16639 -IGdyYW5kZXM= 16640 -IGNvbGxlY3Rpb25z 16641 -IEV1cm9wYQ== 16642 -INCw0YA= 16643 -IOKAi+KAi+KAiw== 16644 -IOq3uOufrOuptA== 16645 -INC+0LHRig== 16646 -IOOBqg== 16647 -IOyLnOqwhA== 16648 -IEN1c3RvbQ== 16649 -IOyymA== 16650 -0ZbQu9GM 16651 -IGluZGl2aWR1YWxseQ== 16652 -7Zc= 16653 -IGRvemVu 16654 -IG93ZQ== 16655 -IFZpY3Rvcmlh 16656 -5Y+v6IO9 16657 -IGJlZXQ= 16658 -dXJi 16659 -IGFuYWxvZw== 16660 -acOnw6Nv 16661 -gpw= 16662 -c29ldmVy 16663 -IG1vZG8= 16664 -IHN1YnNjcmliZWQ= 16665 -7J6s 16666 -IGVudGl0aWVz 16667 -54mH 16668 -IGNsb3NldA== 16669 -IHJlc3BvbmRpbmc= 16670 -IHByaW50ZXI= 16671 -IFN0ZXBoYW4= 16672 -IGJ5xYI= 16673 -IERvbQ== 16674 -IEZlcm4= 16675 -IFBpZXI= 16676 -IHdpxJlj 16677 -IGhlbmNl 16678 -IG1vZHVsZXM= 16679 -44Os 16680 -IOuUsQ== 16681 -IERhbm55 16682 -INGB0LXQsdC1 16683 -IHZhZA== 16684 -IOyXhA== 16685 -IHNvdXM= 16686 -IHNwaGVyZQ== 16687 -Qlk= 16688 -IFBlZA== 16689 -aWduZWQ= 16690 -IHdoZWF0 16691 -IHVuZGVycw== 16692 -IGV2b2x2ZQ== 16693 -IGRlY2xhcg== 16694 -IGxpZ2h0bHk= 16695 -IGlkZW50aWZ5aW5n 16696 -5oSP5oCd 16697 -IGxlZ2VuZGFyeQ== 16698 -IGdlbnVpbmU= 16699 -IGdyaW5k 16700 -IFVuZQ== 16701 -Z2ViZW4= 16702 -IGJpY3k= 16703 -IGp1bXBz 16704 -IHByb3ZpbmNl 16705 -emnEmQ== 16706 -INeQ16DXmQ== 16707 -IGhvYw== 16708 -INCx0Ls= 16709 -IEdyYWQ= 16710 -IHJldmVuZ2U= 16711 -INin2YTYqg== 16712 -b29o 16713 -5ouc 16714 -0LDRhtC40Lg= 16715 -5bmz 16716 -IGVsZWN0cm8= 16717 -IOuQkA== 16718 -44Gn44Gv 16719 -IGZhbHM= 16720 -cmllbA== 16721 -b2tlcg== 16722 -IEV4Y2VsbGVudA== 16723 -IE1vcmdhbg== 16724 -IGJyaWNr 16725 -IHN1YnN0YW50aWFs 16726 -IHBvbGx1dGlvbg== 16727 -IFTDvHI= 16728 -IEV2ZXQ= 16729 -IGx1bmc= 16730 -44GW 16731 -15nXqQ== 16732 -b21tZXM= 16733 -IHJlYWxpemluZw== 16734 -IGh1bWJsZQ== 16735 -IExvY2s= 16736 -IGJvZA== 16737 -IOyWuA== 16738 -IHBlZXJz 16739 -dXp6 16740 -IGVtYmVkZGVk 16741 -IGNsYXJv 16742 -IGFnZ3JlZw== 16743 -IGVtcGxveWVycw== 16744 -IFJhag== 16745 -IOOBqA== 16746 -IFlp 16747 -IGpldQ== 16748 -YXRlcnM= 16749 -IHN0cmlrZXM= 16750 -bm9z 16751 -YXV0cmVz 16752 -ZHI= 16753 -b3BoZXI= 16754 -IEFwcGFyZW50bHk= 16755 -7ZiE 16756 -IGluZmFudA== 16757 -2KfYqA== 16758 -0YLRiw== 16759 -7Zs= 16760 -2q8= 16761 -IHJlZGVz 16762 -YWNhxJ/EsW0= 16763 -IERBVklE 16764 -IENoaWNrZW4= 16765 -IHBlcnNwZWN0aXZlcw== 16766 -IHZpZXdlcg== 16767 -IHNoYXI= 16768 -INC/0YDQvtC40Lc= 16769 -bGlndA== 16770 -ZXJvcw== 16771 -aXRhYmxl 16772 -0LjQu9C+0YHRjA== 16773 -IGRpZsOt 16774 -tOuNsA== 16775 -IHJldGlyZWQ= 16776 -IHRoYXRz 16777 -emVuaWU= 16778 -YmVpdGVu 16779 -IG15Y2tldA== 16780 -IFJhYg== 16781 -IGluZmxhbW0= 16782 -7LCu 16783 -IGR1bQ== 16784 -IGRhZGR5 16785 -5pyf 16786 -IGltbWVycw== 16787 -IHBsYXlsaXN0 16788 -4K+G 16789 -IHRyYXVt 16790 -IHJlZnVzZQ== 16791 -c3RlcA== 16792 -4K6a 16793 -Y3Vw 16794 -IHBvcHM= 16795 -cmltaW4= 16796 -YXnEsW0= 16797 -IGFsZA== 16798 -IHVubmVjZXNz 16799 -IGRhaA== 16800 -IElyaXNo 16801 -IGNvbXBy 16802 -bGHFnw== 16803 -VFA= 16804 -IHRyYW5zbGF0ZWQ= 16805 -U2M= 16806 -Y2XEn2lt 16807 -tJA= 16808 -IGRyZWk= 16809 -INC70Y7QtNC10Lk= 16810 -IHF1aWVybw== 16811 -IGhlbGU= 16812 -emxpY2g= 16813 -IGFwcGxlcw== 16814 -IGRpc3RyaWN0cw== 16815 -IGNyZWRpdHM= 16816 -IGFzcA== 16817 -IOuLqA== 16818 -b3JhbA== 16819 -5b2x 16820 -IHN0ZXBwaW5n 16821 -IFZh 16822 -IGdhaW5z 16823 -NjU= 16824 -IG51ZXN0cmE= 16825 -ZWRheQ== 16826 -YXNzYWRvcg== 16827 -IExpbmQ= 16828 -IGNyb3Bz 16829 -Y2llbmRv 16830 -aWd1ZQ== 16831 -IGJhbmE= 16832 -QW0= 16833 -IHBlbnQ= 16834 -IGFkZGljdGlvbg== 16835 -IHBhY2thZ2luZw== 16836 -w6Rk 16837 -qqg= 16838 -IHBlcnF1w6g= 16839 -IGNhbXBhaWducw== 16840 -IHN0ZWVw 16841 -IG5ldWU= 16842 -IGVtYmFycmFzc2Vk 16843 -IGRpc3RpbmN0aW9u 16844 -aXR6ZXI= 16845 -5ZGK 16846 -IHJlZ2lzdHJhdGlvbg== 16847 -IGxsYW0= 16848 -IEFsbWlnaHR5 16849 -bGllc3Q= 16850 -IHV6 16851 -bmFr 16852 -57o= 16853 -IHRlcmF6 16854 -aWFtZW50ZQ== 16855 -IHRyYW5zYWN0aW9ucw== 16856 -IGPDtHQ= 16857 -IHN3aXRjaGVk 16858 -IGNvbWJv 16859 -IHByYXllcnM= 16860 -IGludGVybnNoaXA= 16861 -IGFkZHJlc3Nlcw== 16862 -IGNoYXJpdHk= 16863 -IFdPTw== 16864 -IGJhaXQ= 16865 -6L+H 16866 -IO+/vQ== 16867 -IGZpY2E= 16868 -IFR5bGVy 16869 -YXJ1 16870 -IGF0b21z 16871 -IExldmVs 16872 -INC/0L7RgtC+0Lw= 16873 -IGZhbWU= 16874 -dWxr 16875 -IHRlYWNoZXM= 16876 -IHJlYnVpbGQ= 16877 -0LXQtNGM 16878 -IEluZG9uZXNpYQ== 16879 -dXNoaQ== 16880 -IFNob3J0 16881 -IGVuc3VyaW5n 16882 -ZnM= 16883 -ZWxl 16884 -IG1hcmdpbmFs 16885 -IGNvbmNsdWRl 16886 -YW10 16887 -IHZlcmlmeQ== 16888 -IE1jRG9uYWxk 16889 -IHNrYWw= 16890 -IHJlY29uc3Q= 16891 -IE1hbm4= 16892 -IGJhc2VtZW50 16893 -IHRyYW5zZm9ybWVk 16894 -IG9jY2FzaW9uYWxseQ== 16895 -em9uZQ== 16896 -IERhbnM= 16897 -INC60LDQutC+0Lk= 16898 -IGRpYWdub3NlZA== 16899 -IM+EzrE= 16900 -IGNvbW1hbmRz 16901 -IHByZXNpZGVudGlhbA== 16902 -IGFiYg== 16903 -IGJyYWNrZXQ= 16904 -IExlbQ== 16905 -w6VuZw== 16906 -IGZhdm9yaXRlcw== 16907 -IHJldm9s 16908 -IO2KuQ== 16909 -IGhhcmFzcw== 16910 -6YU= 16911 -IGNsZWFucw== 16912 -c3TDpG5k 16913 -IGtub2NrZWQ= 16914 -IHBlb3BsZXM= 16915 -IG11c2ljaWFucw== 16916 -IG11dHVhbA== 16917 -IENvbGQ= 16918 -ODg= 16919 -emVq 16920 -YXRpZQ== 16921 -IEhvbm9y 16922 -IG9ic2Vzc2Vk 16923 -IE1VU0lD 16924 -IEJyZWFr 16925 -w7puZw== 16926 -IG1vZGlmeQ== 16927 -IHPDtnlsZQ== 16928 -INee15Q= 16929 -IE9ubGluZQ== 16930 -Zm8= 16931 -IE1pbGxlcg== 16932 -IGxpa2luZw== 16933 -IGluaGFi 16934 -IGdyYXRpdHVkZQ== 16935 -IEpvdXJuYWw= 16936 -YXJuZXNz 16937 -Sm9obg== 16938 -IEdpdA== 16939 -5Ymb 16940 -IHNpbmNlcmU= 16941 -IFNjaQ== 16942 -IEVsaQ== 16943 -IHN5bWJvbHM= 16944 -IG1hbnVhbGx5 16945 -zrXPgg== 16946 -INCy0ZbQtA== 16947 -IEZhdA== 16948 -IGxhYmVscw== 16949 -IHNvcGhpc3RpY2F0ZWQ= 16950 -dW1wcw== 16951 -IHJlbGVhc2Vz 16952 -IDQ3 16953 -IE9N 16954 -6rCA6w== 16955 -IEJpZW4= 16956 -IFJlZg== 16957 -6KiY 16958 -IFN0YQ== 16959 -IEVnZw== 16960 -IGluZGljYXRvcg== 16961 -cHNvbg== 16962 -IG5hc8SxbA== 16963 -UmlnaHQ= 16964 -IGNvbnZleQ== 16965 -IGtub3Q= 16966 -IGNvbm5lY3Rz 16967 -dWxhcw== 16968 -IHByZWNlZA== 16969 -IGluZXF1YWxpdHk= 16970 -YW1pZW50bw== 16971 -IHJlcGx5 16972 -T1k= 16973 -IGRpc21pc3M= 16974 -IOuQnA== 16975 -54Sh 16976 -INGF0L7RgNC+0YjQvg== 16977 -IG3DqWQ= 16978 -IHJhbmRvbWx5 16979 -IE9udA== 16980 -dWFyZA== 16981 -IHB1bGxz 16982 -INGC0LXQv9C10YDRjA== 16983 -IE5lZWQ= 16984 -IFNvZnQ= 16985 -IHN0cmVuZ3Rocw== 16986 -IGdvZWQ= 16987 -dW1lbg== 16988 -5q27 16989 -IO2OuA== 16990 -INC00L7QsQ== 16991 -IGNsYXJpdHk= 16992 -IEFp 16993 -IGJhbGxvb24= 16994 -IFBhbmQ= 16995 -IOyVhOuL 16996 -IHNoaW55 16997 -IHNtYWxsZXN0 16998 -b25pYQ== 16999 -aGlsbA== 17000 -b3Rpbmc= 17001 -IGVpbmc= 17002 -IG1lcmVseQ== 17003 -IHNldXM= 17004 -INC90LXQvw== 17005 -IO2GtQ== 17006 -IGd1aWRlcw== 17007 -IHNwZWNpYWxpc3Q= 17008 -IHN0ZWFr 17009 -44KI44GG 17010 -IG1pZ3JhdGlvbg== 17011 -cXVlbGU= 17012 -IHJ1aW5lZA== 17013 -IHB1cHA= 17014 -5aWz 17015 -IGtlbmQ= 17016 -YW5nYW4= 17017 -IHBhbG0= 17018 -IHVuZmFpcg== 17019 -IHpt 17020 -IERW 17021 -Y2hlc3Rlcg== 17022 -0LjRjg== 17023 -IG9vaA== 17024 -ZXJn 17025 -QVRI 17026 -sKk= 17027 -5ZOq 17028 -cmlzb24= 17029 -IGludm9sdmluZw== 17030 -IHBhcnRseQ== 17031 -YW7Dp2Fpcw== 17032 -IHZvdw== 17033 -IHByb21pbmVudA== 17034 -IGNyeXN0 17035 -aWJh 17036 -IGRlc2VydmVz 17037 -IG92ZXJ0 17038 -IHNlbnNpdA== 17039 -IFdoZQ== 17040 -IHRpZ2h0ZW4= 17041 -IGludGltaWQ= 17042 -IGFsaW1lbnQ= 17043 -d2lsbA== 17044 -IHN0cmVuZ3RoZW4= 17045 -IFRhbg== 17046 -5Y+I 17047 -44GX44G+44GZ 17048 -b25p 17049 -IE11bg== 17050 -IHByb3Bo 17051 -IHJlaGVhcnM= 17052 -IEtsZQ== 17053 -IHZlY2Vz 17054 -IHdvbmRlcmVk 17055 -b2tp 17056 -IHNlbnNlcw== 17057 -tOyL 17058 -xrDhu5s= 17059 -IMiZaQ== 17060 -IG11Y2hvcw== 17061 -IHdhdGNoZXM= 17062 -b3J0dW5hdGU= 17063 -IEp1YW4= 17064 -7J6W7JWE 17065 -0YDQtQ== 17066 -ZWk= 17067 -aW9uZW4= 17068 -IGV4cGVyaW1lbnRhbA== 17069 -IGRhdWdodGVycw== 17070 -4Lib 17071 -IG1lbnRhbGx5 17072 -YmVjY2E= 17073 -YXdhcmU= 17074 -7ISd 17075 -IHdoYXRzb2V2ZXI= 17076 -IGVuYWJsZXM= 17077 -IExvdw== 17078 -b2lk 17079 -4LiK 17080 -w7Nk 17081 -2Lo= 17082 -IGNvbnN0cnVjdGVk 17083 -IExhZGllcw== 17084 -IGFjY3VzZWQ= 17085 -INCw0L0= 17086 -RGFu 17087 -IHNwYXdu 17088 -IGNvbnRhaW5lcnM= 17089 -IGFydGlzdGlj 17090 -xLFw 17091 -IGRpc2Ns 17092 -IGF1dHJlcw== 17093 -aW5hcw== 17094 -IE5hdGlvbg== 17095 -IG5hZw== 17096 -YmVhbg== 17097 -d2hl 17098 -nOuPhA== 17099 -IFNlb3Vs 17100 -IO2PrA== 17101 -IE5pY2g= 17102 -IGNvbXBsZW1lbnQ= 17103 -IGludGVydmVu 17104 -IE1vZGVs 17105 -IE9yYW5nZQ== 17106 -bmFtb24= 17107 -IGNhbGN1bGF0aW9u 17108 -c2Vl 17109 -IHVzdGVkZXM= 17110 -IGxlYg== 17111 -IGRvY3Q= 17112 -0ZbQvQ== 17113 -IGZvc3Rlcg== 17114 -IGVsYXN0aWM= 17115 -IEFoaA== 17116 -IGFjZQ== 17117 -IFBpbms= 17118 -IEplZw== 17119 -IGRlZXI= 17120 -44GX44GE 17121 -c2lz 17122 -IGpha28= 17123 -IEVtbWE= 17124 -0YHRgtCy0LXQvdC90L4= 17125 -IHBvcnRyYWl0 17126 -IG1ha2Vy 17127 -IGF1bWVudA== 17128 -0YDQvtCx 17129 -IGFpcnBsYW5l 17130 -IHRyYW5zcGFyZW5jeQ== 17131 -IGFkanVzdG1lbnQ= 17132 -IENEQw== 17133 -w6dvbg== 17134 -IHVwbG9hZGVk 17135 -INC00LXQudGB0YLQsg== 17136 -INCz0L7RgtC+0LI= 17137 -IGl0ZXI= 17138 -IGN1cnNl 17139 -w7Ru 17140 -bWVyY2U= 17141 -YXJhbg== 17142 -IGxlYWs= 17143 -57WQ 17144 -IGFic2VuY2U= 17145 -0YHQutC40Lk= 17146 -IHJlYWRlcnM= 17147 -YWxlcg== 17148 -IGJlbmVhdGg= 17149 -YW5nbw== 17150 -aGV0aWM= 17151 -IGZpbm5z 17152 -IHBvb3A= 17153 -IGR1cGxpYw== 17154 -SGk= 17155 -aWdz 17156 -b2xvZ2ljYWxseQ== 17157 -b3Bw 17158 -IGRpemVy 17159 -IEFsbGVu 17160 -IGdsaQ== 17161 -IGFjY2VsZXJhdGlvbg== 17162 -IHZpdGFtaW4= 17163 -44Ot 17164 -dsOk 17165 -IEFjY2Vzcw== 17166 -4K6Z 17167 -csOhcw== 17168 -IGFwcHJlY2lhdGVk 17169 -IG5haA== 17170 -IHBvc3Rlcg== 17171 -IHRhbGU= 17172 -IGhpZ2hsaWdodGVk 17173 -5paH 17174 -xbxlbGk= 17175 -IGJsb2NrY2hhaW4= 17176 -IG1pY3Jvdw== 17177 -IGNpbmVtYQ== 17178 -IENoYW5n 17179 -IFNlYXJjaA== 17180 -dXN0ZXJz 17181 -IFplcm8= 17182 -IERpdmlzaW9u 17183 -0YDQsNGB 17184 -IHNjYXJl 17185 -IGplbGx5 17186 -IEFkbWluaXN0cmF0aW9u 17187 -U08= 17188 -IGxpbmVk 17189 -IOqwhA== 17190 -IGdlYmVu 17191 -IHNvZGE= 17192 -IHdpbm5lcnM= 17193 -s7w= 17194 -2ZI= 17195 -IEFtYg== 17196 -5ZWP6aGM 17197 -5ZQ= 17198 -IHBlZw== 17199 -5bex 17200 -NDM= 17201 -IHJhdXM= 17202 -IHJld2FyZHM= 17203 -IGluY2x1cw== 17204 -IGhpZ2h3YXk= 17205 -IGhhaA== 17206 -IG11bHRpcGxpZWQ= 17207 -IHPhur0= 17208 -IGRpc2NpcGxlcw== 17209 -IG5pbmc= 17210 -IGRyZXNzaW5n 17211 -IGF0dHJpYnV0ZXM= 17212 -IE1vc2M= 17213 -IEdyZWVjZQ== 17214 -IHNlaw== 17215 -IExlYXJu 17216 -IGp1cw== 17217 -cmVuZHJl 17218 -IHBlcnNvbm5l 17219 -cGxldGU= 17220 -IHBsYWNpbmc= 17221 -IGx1ZWdv 17222 -aWxsYW5jZQ== 17223 -INC+0LHRiQ== 17224 -IHByb3Zpc2lvbg== 17225 -IGxpb24= 17226 -dHJh 17227 -Ym9hcmRz 17228 -IGJlaGF2aW91cg== 17229 -aGV5 17230 -IHN1YnNjcmlwdGlvbg== 17231 -IHByb3RhZ29u 17232 -44Oj 17233 -IHZhcmE= 17234 -IMWfdQ== 17235 -IGhhaGE= 17236 -IHRlYXNwb29u 17237 -5p8= 17238 -YXZvaXI= 17239 -IGNyeXB0bw== 17240 -INGB0YLQsNGA 17241 -IFN0b3Jl 17242 -YWJz 17243 -IFN0dWRlbnRz 17244 -IGxhdW5k 17245 -aW50bw== 17246 -IGFwcHJvYWNoZWQ= 17247 -sJw= 17248 -0YPRjtGJ 17249 -IExhYm9y 17250 -b3Rlcw== 17251 -aWF0cmlj 17252 -IGdyb8Of 17253 -dXRpdmU= 17254 -INC40LQ= 17255 -IEdpYg== 17256 -IHBsYWNlbWVudA== 17257 -IGRpZsOtY2ls 17258 -IGZyb2c= 17259 -INCy0YHQtdGF 17260 -IEpy 17261 -YXplZA== 17262 -0YPRiQ== 17263 -IOq8 17264 -ZnJhbWU= 17265 -0LDQtdGI0Yw= 17266 -IGxvY2tkb3du 17267 -5ZGz 17268 -IG1lZGk= 17269 -INeU157X 17270 -0LXQvdC40Lk= 17271 -ZW1hbGU= 17272 -7KKF 17273 -YXRlcmFs 17274 -IGRpc3RhbnQ= 17275 -IGJlYXJz 17276 -IGpvdXJuYWxpc3Q= 17277 -6Kej 17278 -IE1hcnNoYWxs 17279 -IElobmVu 17280 -dWV0b290aA== 17281 -YmFn 17282 -IMSRw6M= 17283 -IEhpZ2huZXNz 17284 -IOywjQ== 17285 -0LjQutCw 17286 -IFd1 17287 -IEZyYW4= 17288 -IHBlbmc= 17289 -IGZvbg== 17290 -IGh5cG90aGVzaXM= 17291 -INGA0YM= 17292 -IGx5 17293 -15o= 17294 -7JuU 17295 -IFJhZGlv 17296 -4Lie 17297 -RGF2 17298 -IGVtYmFycmFzc2luZw== 17299 -IOyeiOyWtA== 17300 -IGNhc3Rpbmc= 17301 -IGNhZ2U= 17302 -IFBzeWNo 17303 -IOydvOuLqA== 17304 -IMW+ 17305 -aW1i 17306 -IGRpcmVjdG9ycw== 17307 -U0g= 17308 -IM+EzrfOvQ== 17309 -4buBdQ== 17310 -IGtvbnXFnw== 17311 -IG9wdGlvbmFs 17312 -cXVhcnRlcnM= 17313 -aWtlcg== 17314 -IFNhbnQ= 17315 -IHZlcnNlcw== 17316 -67aA 17317 -IG9sYXI= 17318 -IM+H 17319 -44OV 17320 -IM6zzrnOsQ== 17321 -IEltbQ== 17322 -IGNvbnRyb3ZlcnNpYWw= 17323 -IGVyc3Rlbg== 17324 -IHJlY2lw 17325 -IENocmlzdGlhbml0eQ== 17326 -IOq0nA== 17327 -b3Jkb24= 17328 -15XXqQ== 17329 -IHNsYXNo 17330 -IFBm 17331 -0YPQtNGM 17332 -15XXnQ== 17333 -IFBlcnJ5 17334 -IG1hbXk= 17335 -IGJhY2tncm91bmRz 17336 -IOCujuCuqQ== 17337 -IHBlbmRhbnQ= 17338 -IENvbHVtYmlh 17339 -IGludmVyc2U= 17340 -INGH0LXRgNC10Lc= 17341 -IHN2 17342 -IGRpZ2dpbmc= 17343 -NDE= 17344 -Y2hlbQ== 17345 -IG5hdmlnYXRpb24= 17346 -IFNoaW4= 17347 -IEZyb250 17348 -UEQ= 17349 -IGJlYXJpbmc= 17350 -IFdhc3Nlcg== 17351 -IHdheA== 17352 -IENIUklT 17353 -Y2hpbmc= 17354 -IHByZXNzZWQ= 17355 -RWw= 17356 -IERhbA== 17357 -b25zaW4= 17358 -IGJpbmRpbmc= 17359 -0YHQutC+0Lk= 17360 -cG9vbnM= 17361 -IG1vY2s= 17362 -YXJlc3Q= 17363 -0LrRgNCw 17364 -TU0= 17365 -IGNvcnJ1cHQ= 17366 -c3Rvcm0= 17367 -IHJlZnJlcw== 17368 -IENvYWNo 17369 -bGzDpA== 17370 -IFRISVM= 17371 -IHBhcmFn 17372 -IOyTsA== 17373 -cG9vbA== 17374 -IGJpbGxpb25z 17375 -IOq5gA== 17376 -Z3JvdXA= 17377 -IHdlbGNvbWluZw== 17378 -Y2VsbGVuY2U= 17379 -IER1a2U= 17380 -6ri0 17381 -IHByaW1lcmE= 17382 -7KC4 17383 -IHBvbmQ= 17384 -IHN0YXR1ZQ== 17385 -IOq1rOs= 17386 -IGhhdGNo 17387 -IGluc3RydW1lbnRhbA== 17388 -IHJlc2lkZW50aWFs 17389 -7Luk 17390 -IGFjY2VwdGluZw== 17391 -b3NoaQ== 17392 -ZGF0ZQ== 17393 -IOyUqA== 17394 -IHBsYW50ZWQ= 17395 -IGpva2luZw== 17396 -IOyEnA== 17397 -IGhhdGVk 17398 -INGA0LDRgdGB0Lo= 17399 -IHNsZXB0 17400 -IHBhY2thZ2Vz 17401 -IGlzbGFuZHM= 17402 -ZXNlbg== 17403 -xJ/EsQ== 17404 -IGRpYWdvbg== 17405 -IE9zYw== 17406 -IG1lc2g= 17407 -IHNjYWxlcw== 17408 -YXJpdHk= 17409 -IERlZmVuc2U= 17410 -44Gh44KH 17411 -IExld2lz 17412 -INGB0LXQs9C+0LTQvdGP 17413 -IGZsaWVz 17414 -dWluZWx5 17415 -IENvbnNpZGVy 17416 -IHN0YXJr 17417 -aGV3 17418 -IEFzw60= 17419 -s7Tr 17420 -IHByb3Bvc2U= 17421 -IO2VmOuptA== 17422 -b2Rv 17423 -IE5vcm1hbGx5 17424 -IGhlZWZ0 17425 -IEhhcnJpcw== 17426 -Z3Jv 17427 -IEJsb29k 17428 -YmFzZQ== 17429 -IGlPUw== 17430 -IHRvdWNoZXM= 17431 -IGluc3Bpcg== 17432 -INeT 17433 -IGJpbmFyeQ== 17434 -IOy2lA== 17435 -IHNlcmlhbA== 17436 -IGlvbg== 17437 -IHVuZW1wbG95bWVudA== 17438 -IG9kZHM= 17439 -IEZhYg== 17440 -IEZCSQ== 17441 -QlJVTg== 17442 -IHdlaWdodHM= 17443 -zr3Ovw== 17444 -YXRpbGU= 17445 -IG51cnNlcw== 17446 -IGludm9sdmVtZW50 17447 -IO2UvA== 17448 -IGdvdmVybmFuY2U= 17449 -IOKCrA== 17450 -0YDRg9C/ 17451 -aWVycmE= 17452 -7ZiV 17453 -IEplcnJ5 17454 -IGJlYXJk 17455 -IHNhbHZhdGlvbg== 17456 -IEFsb25n 17457 -Z2VudGxl 17458 -IEtp 17459 -Ym9s 17460 -IFBsYXQ= 17461 -IGhhc2h0 17462 -6L+R 17463 -IHdhcmU= 17464 -IHBhcnRpZQ== 17465 -eWN6 17466 -IGludHI= 17467 -Rmlo 17468 -bmVudA== 17469 -IGNoZWF0 17470 -aWxlbg== 17471 -IOuv 17472 -b3JpZQ== 17473 -IGbDoWNpbA== 17474 -ZXRyaWM= 17475 -IGFmZmVjdGluZw== 17476 -dW5jaWF0aW9u 17477 -IGFmZmFpcnM= 17478 -IGJlZQ== 17479 -IHZpZXdpbmc= 17480 -IG9yYW5n 17481 -IExhbg== 17482 -INCh0YI= 17483 -5LiW 17484 -IE1lcw== 17485 -g4E= 17486 -ZXJpZQ== 17487 -IGVzcGE= 17488 -IGludGVycHJl 17489 -IHBvc3Nlc3M= 17490 -IHB1cmVseQ== 17491 -cml0bw== 17492 -Zm91bmQ= 17493 -YXNtYQ== 17494 -7KCB7J24 17495 -IGV4YW1pbmU= 17496 -INGD0Lw= 17497 -IGJlc2No 17498 -IFRvbW9ycm93 17499 -IEJsb2Nr 17500 -IHZhcmlhbnQ= 17501 -IHByZWZlcmVuY2U= 17502 -IGNvYWNoZXM= 17503 -IG1lZGljYXRpb25z 17504 -IO2YhA== 17505 -IGVtcGlyZQ== 17506 -64Sk 17507 -IElsbGlub2lz 17508 -IGNyaXNweQ== 17509 -IHRow6w= 17510 -IGJlZXM= 17511 -Nzc= 17512 -IGdsb3c= 17513 -6Lo= 17514 -IFN0dWRpZXM= 17515 -5ZCE 17516 -IENoYWxsZW5nZQ== 17517 -IHVubGlrZWx5 17518 -0Kc= 17519 -xLF5b3JzdW4= 17520 -RElF 17521 -IG1pbmltaXpl 17522 -aXphcmQ= 17523 -IMO6bg== 17524 -IGVuY29udHJhcg== 17525 -IEtpbGw= 17526 -5bs= 17527 -IHZhbmlsbGE= 17528 -IEdyYW50 17529 -IEdU 17530 -c2Vh 17531 -IHNvdWdodA== 17532 -0LLQvtC0 17533 -IG7DpG0= 17534 -IEF1bnQ= 17535 -T1dO 17536 -IHB1bXBraW4= 17537 -c3RlbGxlbg== 17538 -IHJhZw== 17539 -0LXQs9C00LA= 17540 -IHN0b3J5dA== 17541 -IGZvcnVt 17542 -5qmf 17543 -IGVzdGFiYQ== 17544 -dWNoZQ== 17545 -IGNvbmdyZXNz 17546 -IFJleQ== 17547 -IGRyYW1hdGljYWxseQ== 17548 -IFNwb3J0 17549 -IFllbGxvdw== 17550 -IOqzhOyGjQ== 17551 -IGRpc2d1c3Rpbmc= 17552 -IFJlY2VudA== 17553 -IGFjcXVpcmVk 17554 -IGNhYmxlcw== 17555 -55Sa 17556 -ZGlu 17557 -IHZpc3Rv 17558 -IGNvbW11bmljYXRpbmc= 17559 -0YHRgtCw0LLQu9GP 17560 -0LXRgdGC0L4= 17561 -44O744O744O7 17562 -IHLDqWc= 17563 -IHNvY2tz 17564 -IHByb2Nlcw== 17565 -YmVjYXVzZQ== 17566 -IHV0dGVy 17567 -IGNvbG9jYXI= 17568 -IG5ld2VzdA== 17569 -IGdyYW1t 17570 -6KGo 17571 -5LiN55+l6YGT 17572 -IHNoaWZ0aW5n 17573 -IGNhcnJpZXI= 17574 -INGB0LrQvtGA 17575 -IFNjaHc= 17576 -IGV4ZWN1dGVk 17577 -IG1haW50YWluZWQ= 17578 -IM+G 17579 -IE1vc2Vz 17580 -IGRpc3Nl 17581 -IGhvcnI= 17582 -44Cc 17583 -IHJhbGx5 17584 -IGFsbGVt 17585 -IEV2ZW50dWFsbHk= 17586 -IGRpeW9y 17587 -bHZhbmlh 17588 -IHNjaG5lbGw= 17589 -IOqzvA== 17590 -IOunpA== 17591 -IHN0cnVnZ2xlcw== 17592 -bGF0ZQ== 17593 -IGNsYXJpZnk= 17594 -w6ltZW50 17595 -IG11bHRpcGxpYw== 17596 -0LjQsdC+ 17597 -IGpvdXJu 17598 -IGZyYWdy 17599 -IHN1cnByaXNpbmdseQ== 17600 -IGRlc3BlcmF0ZQ== 17601 -NTI= 17602 -IHN1bA== 17603 -IFJlYWQ= 17604 -IEZyaWVk 17605 -IG1vbmQ= 17606 -d29v 17607 -IG9yZ2FuaXppbmc= 17608 -44GX44KH44GG 17609 -IFNvb24= 17610 -INCy0L7Qv9GA0L7RgQ== 17611 -IE51cg== 17612 -INCX0LQ= 17613 -IHNwaWRlcg== 17614 -0LXRgdGP 17615 -IHR1dG9yaWFscw== 17616 -IG51dHJpZW50cw== 17617 -b3Jlcg== 17618 -IGNvZWZmaWNpZW50 17619 -IGFycmFuZ2VtZW50 17620 -IHByaWNpbmc= 17621 -bmFu 17622 -eXU= 17623 -Qkw= 17624 -IHRyaWJl 17625 -IEhvd2FyZA== 17626 -dW5rcw== 17627 -IG5ld2Vy 17628 -IHByb3Zpbg== 17629 -IHByZWRpY3Rpb24= 17630 -aG9z 17631 -IG9sc3Vu 17632 -IEFyb3VuZA== 17633 -IHZpZXI= 17634 -INGB0YLQvtGA0L7QvQ== 17635 -IHZhbGxleQ== 17636 -IEVsYQ== 17637 -aWZp 17638 -IGdhbGF4eQ== 17639 -IHRyYW5xdQ== 17640 -IGFkdmVycw== 17641 -IFRlbXBsZQ== 17642 -aWZmcw== 17643 -aWdlbmNl 17644 -6Ieq5bex 17645 -IGvDtm5udGU= 17646 -IMSRw7M= 17647 -RGlk 17648 -IHBob3RvZ3JhcGhz 17649 -IEFXUw== 17650 -0YbQuNGP 17651 -IGd1YXJkcw== 17652 -IGFwcG9pbnRlZA== 17653 -IEdpbA== 17654 -INC80L7QvA== 17655 -IGNvZA== 17656 -IFVubGlrZQ== 17657 -IGV2ZW5seQ== 17658 -aXNjb25zaW4= 17659 -IGVzdG91 17660 -IG1uaWU= 17661 -IEV4ZWM= 17662 -IE1W 17663 -IEVpbmU= 17664 -5L+h 17665 -IFJvZ2Vy 17666 -IEZhYw== 17667 -IExpc3Q= 17668 -IGZ1ZXI= 17669 -0LDQtdGC0LU= 17670 -b21lZA== 17671 -IGF0dHJhY3Rpb24= 17672 -6Imy 17673 -IHRlcnJhaW4= 17674 -IERyb3A= 17675 -IGNvcnBvcmF0aW9ucw== 17676 -IHNjaWVuY2Vz 17677 -IHRocm9uZQ== 17678 -44GE44Gf 17679 -IGFq 17680 -IFJvdA== 17681 -54m5 17682 -IHN1cHBvcnRlcnM= 17683 -IEJlcmU= 17684 -SGVyZQ== 17685 -IGRpZmVyZW50ZXM= 17686 -IHNpZ25pZmljYW5jZQ== 17687 -z4POtw== 17688 -5oiR6Ka65b6X 17689 -IGNsYW1w 17690 -IOuMgOs= 17691 -IGZhYnVsb3Vz 17692 -cmV6 17693 -5oyB 17694 -IGFzc3VtcHRpb25z 17695 -dXRoZXI= 17696 -d2lk 17697 -cG90 17698 -6L+O 17699 -IHlhbg== 17700 -dWxpbg== 17701 -0YDRi9Cy 17702 -IFNsb3c= 17703 -IFBlbm5zeQ== 17704 -IO2VtOyEnA== 17705 -IG1laW8= 17706 -IHdlYWx0aHk= 17707 -IEVpZ2h0 17708 -IHB1bHNl 17709 -IGZyaWN0aW9u 17710 -aWRpdHk= 17711 -IEhvbGw= 17712 -aXlvcnVt 17713 -IHNvdW5kZWQ= 17714 -IENhcnI= 17715 -IGZvcms= 17716 -4pg= 17717 -IFBB 17718 -IGNvbnNwaXI= 17719 -IGNvZGluZw== 17720 -cnQ= 17721 -IFR5cA== 17722 -IOyWkQ== 17723 -INC/0L7Qsw== 17724 -IG1pc2Vy 17725 -INGB0LzQvtGC0YA= 17726 -IFN3ZWRlbg== 17727 -IG9sYXJhaw== 17728 -IFpoYW5n 17729 -IENoaQ== 17730 -IFRpdGFu 17731 -IHNjcmVlbmluZw== 17732 -IFNwaWRlcg== 17733 -IMWeaW1kaQ== 17734 -IG9ic3RhY2xlcw== 17735 -bGFyYQ== 17736 -IGNoYWxsZW5nZWQ= 17737 -cHNl 17738 -VE9O 17739 -4bul 17740 -IFBp 17741 -IGxhZ2k= 17742 -aWV1cnM= 17743 -IGh1cnRpbmc= 17744 -IG5lZ2xlY3Q= 17745 -IGdlbmVyYXRpbmc= 17746 -IHlvdW5nZXN0 17747 -IGF1ZGl0 17748 -INGA0LXQtw== 17749 -z4HOrA== 17750 -IGRvbmF0ZQ== 17751 -IFBERg== 17752 -IHZpc2l0cw== 17753 -IGNydWlzZQ== 17754 -UFA= 17755 -YXNlcg== 17756 -IHdzcA== 17757 -YmFja3M= 17758 -aXZhbHM= 17759 -44GG44KT 17760 -IGRldmU= 17761 -IHByb3BvcnQ= 17762 -IGNhdGg= 17763 -IEVmZmVjdA== 17764 -IHdpbmRz 17765 -IOyZlA== 17766 -IGNoYXJ0cw== 17767 -IHNhbWE= 17768 -IGF1dG9tYXRpb24= 17769 -INC/0L7QutCw 17770 -IG9sYW4= 17771 -IGJvYXRz 17772 -IGNhZmU= 17773 -IGRlbmllZA== 17774 -IE1hbWE= 17775 -IGJsb2NraW5n 17776 -IFRob3I= 17777 -IHBoZW5vbWVuYWw= 17778 -IHN0YWtlaG9sZGVycw== 17779 -IHVub3M= 17780 -0YPQtdGC 17781 -IEFicmFoYW0= 17782 -44Gn44KC 17783 -IGRldGVjdGlvbg== 17784 -IGp1cmlz 17785 -IHBvd2VyZWQ= 17786 -emlhbA== 17787 -IHdlbGZhcmU= 17788 -IHVwZ3JhZA== 17789 -IG1vxbxuYQ== 17790 -IENhc2U= 17791 -Y3VsYXI= 17792 -lOydtA== 17793 -44OB 17794 -IEd1ZXNz 17795 -IGN5Y2xlcw== 17796 -5L6L 17797 -57Wm 17798 -cm9jaw== 17799 -dW1p 17800 -IGVsaXRl 17801 -IHF1w6g= 17802 -5aCx 17803 -0YLQvtC8 17804 -IHNob3Jl 17805 -Z3VudGE= 17806 -IGt1 17807 -IGZhaXRoZnVs 17808 -IEplcmVteQ== 17809 -YWlk 17810 -4Lc= 17811 -dWdhbA== 17812 -5bCN5ZWK 17813 -IFZlbA== 17814 -IHZyYWk= 17815 -c3RlbGw= 17816 -qLg= 17817 -IGtvbA== 17818 -6L0= 17819 -IHF1YW50bw== 17820 -INC30LDRgA== 17821 -IDIwMDI= 17822 -ZXN5 17823 -IHJlc2VydmU= 17824 -INC80L7QvNC10L3Rgg== 17825 -IGRlcGxveWVk 17826 -IGRlZmluaW5n 17827 -IHNhdQ== 17828 -IGdhYXQ= 17829 -Iik= 17830 -IHRyYW5zbWl0 17831 -IHB1Ymxpc2hpbmc= 17832 -IHJhbmtpbmc= 17833 -IG9mZmVuc2U= 17834 -IDQ2 17835 -cGlu 17836 -IFRha2luZw== 17837 -IGVudGl0bGVk 17838 -IGdlbnVpbmVseQ== 17839 -IHZhcmlhdGlvbnM= 17840 -IGZpbmRl 17841 -IHRhdQ== 17842 -IHVuZm9ydHVuYXRl 17843 -IFJhaA== 17844 -cG9ydHM= 17845 -IGPF 17846 -IG1vbmtleQ== 17847 -IGJyYWM= 17848 -d2Vp 17849 -bHVuZw== 17850 -IGFydGlm 17851 -IHN5cnVw 17852 -INCU0LDQsg== 17853 -IGxpZnRlZA== 17854 -IGNoZXo= 17855 -IEFkdmVudA== 17856 -IFN0b2Nr 17857 -IGRvbA== 17858 -0LzQtdC9 17859 -0LjRiNGM 17860 -IHlu 17861 -Z2lv 17862 -ZGV0 17863 -IGRlc3Nl 17864 -IGdyaQ== 17865 -IENoYWlybWFu 17866 -54U= 17867 -IGN1ZW50YQ== 17868 -YW5pbQ== 17869 -IGNyYWI= 17870 -IGVzY2Fs 17871 -IHByZW1pw6hyZQ== 17872 -IEdlZg== 17873 -IGRpbmluZw== 17874 -IHNldmVudGg= 17875 -IGNoYXNpbmc= 17876 -IFRvd2Vy 17877 -IGJydXRhbA== 17878 -IGZ1bmRhbWVudGFsbHk= 17879 -44Go44GG 17880 -0LvQtdC90LjRjw== 17881 -c3RhZ2U= 17882 -IGFjcXVpcw== 17883 -IGN5bGluZGVy 17884 -IGNvbW1hbmRlcg== 17885 -bWVt 17886 -IFVW 17887 -aGFwcHk= 17888 -IGVwc2lsb24= 17889 -IGludml0YXRpb24= 17890 -IGZhcm1lcg== 17891 -Y2hhaXI= 17892 -IGRlc3Rpbnk= 17893 -IHNvdmVyZQ== 17894 -IEhlYnJldw== 17895 -IHNlcnZhbnQ= 17896 -IGJldw== 17897 -IGdhc3Q= 17898 -dXRpZXM= 17899 -IGFkbWluaXN0cmF0aXZl 17900 -IENvbW1hbmQ= 17901 -w6l0YQ== 17902 -IG5pdHJvZ2Vu 17903 -6re8 17904 -IGFiaQ== 17905 -IHZpbGxhaW4= 17906 -IGJsYW5rZXQ= 17907 -IFNlbmQ= 17908 -IGJlYXRlbg== 17909 -soQ= 17910 -IHZvbHVudA== 17911 -IHNjaG9sYXI= 17912 -IEVtcGVyb3I= 17913 -IDQz 17914 -dmFibGU= 17915 -IER1cw== 17916 -IEdV 17917 -IHRhcmdldGluZw== 17918 -d3d3 17919 -IGFtZW5kbWVudA== 17920 -7IaM6w== 17921 -IHRpbmc= 17922 -IG5hc3R5 17923 -IGdhdWdl 17924 -INGA0L7QtA== 17925 -IEhhbnM= 17926 -WW91cg== 17927 -zrHOvQ== 17928 -IHByb2pldA== 17929 -IEhhd2FpaQ== 17930 -IHN1c3BpY2lvdXM= 17931 -IHNjaHc= 17932 -IHJlbW92YWw= 17933 -IGludHJpZw== 17934 -IE1V 17935 -IHBvbnRv 17936 -4KS+ 17937 -INC+0LHRgNCw0Lc= 17938 -IGd1ZXNzaW5n 17939 -cGFjZQ== 17940 -IG1vdGhlcnM= 17941 -IG1pbGxpbWV0ZXI= 17942 -0LvQtdC90LjQtQ== 17943 -5rKh5pyJ 17944 -IGF2YWlsYWJpbGl0eQ== 17945 -aWN6 17946 -5q2k 17947 -IGZyYWN0 17948 -IGJhc2Vz 17949 -a20= 17950 -IEJUUw== 17951 -IEZpZWxk 17952 -IGR6aWU= 17953 -IHNlZ3VuZG8= 17954 -IOuCmOuKlA== 17955 -IGxlZ2l0aW1hdGU= 17956 -aW1hcw== 17957 -INCy0L0= 17958 -IGNvcnJ1cHRpb24= 17959 -IHNtYXNo 17960 -IFZhbGVudA== 17961 -IGFsaWduZWQ= 17962 -IFBlbm5zeWx2YW5pYQ== 17963 -IGdhYg== 17964 -IEV1bg== 17965 -ZW50aA== 17966 -IE1vcm5pbmc= 17967 -IGNhbmRsZQ== 17968 -IGJhY2twYWNr 17969 -IElzbGFtaWM= 17970 -YcOnw7Vlcw== 17971 -IGVuY3J5 17972 -IG11c2hyb29tcw== 17973 -7YyM 17974 -ZGl0 17975 -IHRyYW5zaXQ= 17976 -IFdpc2NvbnNpbg== 17977 -IHBhcnRpY2lwYXRlZA== 17978 -IElscw== 17979 -IHVuZm9sZA== 17980 -toDr 17981 -IHByb2ZpdHM= 17982 -IHdhcm1pbmc= 17983 -IEdhbmc= 17984 -IG5ldHdvcmtpbmc= 17985 -IG1lZ2E= 17986 -IHRob3JvdWdobHk= 17987 -bGVtZW50cw== 17988 -IEht 17989 -IGRlY2lkaW5n 17990 -IGVtb3Rpb25hbGx5 17991 -IGV4aGF1c3RlZA== 17992 -INCf0L7Rgg== 17993 -Y2lkbw== 17994 -IEhUTUw= 17995 -IGNvcHlyaWdodA== 17996 -IG1lbG9keQ== 17997 -eWlt 17998 -IGFuZGVycw== 17999 -b3Nob3A= 18000 -IOuzvA== 18001 -IGF0aGxldGU= 18002 -IEdF 18003 -IGZyZXF1ZW50 18004 -IGRlc2lyZXM= 18005 -IG5lZWRpbmc= 18006 -IFl1bg== 18007 -IHJpZmxl 18008 -IGxvdmVy 18009 -J1Q= 18010 -IGRlbnNl 18011 -IHTDo28= 18012 -IG5vdGlmaWVk 18013 -IGlkaQ== 18014 -7Jet 18015 -7YY= 18016 -IGludGVyYWN0aW5n 18017 -IHJhcHBvcnQ= 18018 -0LXRgNC4 18019 -c2tp 18020 -IGJlc3Nlcg== 18021 -IG1hbnVmYWN0dXJlcg== 18022 -IEt5bGU= 18023 -IGFjY291bnRhYmxl 18024 -IFNhaw== 18025 -IFBpbA== 18026 -IERvbWlu 18027 -IHByZXN1bQ== 18028 -INCS0YHQtQ== 18029 -IHZpbmVnYXI= 18030 -IGd1YXJhbnRlZWQ= 18031 -55yL5Yiw 18032 -IGhhbmRsZWQ= 18033 -6Z+z 18034 -Y2F0 18035 -IGNpdmlsaXphdGlvbg== 18036 -IGFjY29tcA== 18037 -IFZN 18038 -w6ltb24= 18039 -IGRlemU= 18040 -IGdyYWRlcw== 18041 -IHNvbGx0ZQ== 18042 -IHN0YXJpbmc= 18043 -15DXqg== 18044 -YXJudA== 18045 -IGhvcml6b24= 18046 -IHRyYXZhaWw= 18047 -aG91cg== 18048 -56ys5LiA 18049 -IEVE 18050 -IERhaw== 18051 -IG55 18052 -IGNvbnZl 18053 -IENoYW0= 18054 -IGZpcm1z 18055 -IExpdQ== 18056 -INGB0YLRgNCw0L0= 18057 -IGxpYmVydA== 18058 -IGxlbnNlcw== 18059 -IGludGFrZQ== 18060 -INCy0YvQsQ== 18061 -IG1lbnNlbg== 18062 -aGVs 18063 -IHByYWN0aXRpb24= 18064 -IDM1MA== 18065 -44Kz 18066 -Rk8= 18067 -IGJlZHM= 18068 -IGFuY2VzdG9ycw== 18069 -IOyXhOyyrQ== 18070 -IGRpc3R1cmI= 18071 -IExhc3RseQ== 18072 -IFN1cHBvcnQ= 18073 -4Li14LmJ 18074 -IENvcm9uYQ== 18075 -IGVudGh1c2k= 18076 -INCy0L7Qt9C8 18077 -IOyCrOuejOs= 18078 -IDUy 18079 -YmlyZA== 18080 -IHJlZHVjZXM= 18081 -IOyeiOydhA== 18082 -IEdlbmU= 18083 -6rWQ 18084 -xJlw 18085 -IMOcYmVy 18086 -IGNvbmNlcm5pbmc= 18087 -dXNlcg== 18088 -IGNvbmNlbnRyYXRl 18089 -IFdIQVQ= 18090 -aXNob3A= 18091 -b255bW91cw== 18092 -bm9sZA== 18093 -IHN1Z2dlc3Rpbmc= 18094 -qbA= 18095 -IEZpc2g= 18096 -Li4uLi4uLi4= 18097 -IHZlc3NlbA== 18098 -IHRyYWJham8= 18099 -44G1 18100 -IE9jZWFu 18101 -5aeQ 18102 -eWc= 18103 -IHRvd25z 18104 -ZGVs 18105 -IHRlcnJpZnlpbmc= 18106 -IMOnYWzEscWf 18107 -IHNpbm8= 18108 -IGVhdHM= 18109 -IGdleg== 18110 -IGdlbWU= 18111 -IOyZhA== 18112 -IGNvbXBhcnQ= 18113 -IGltcGxlbWVudGluZw== 18114 -IFBvdHRlcg== 18115 -IEdlcm1hbnM= 18116 -IGfFgg== 18117 -IHRlbm5pcw== 18118 -IGNhcnBldA== 18119 -YXVlcg== 18120 -IFNhdWRp 18121 -eWVvbmc= 18122 -IGN1cnJ5 18123 -IEZvcmVzdA== 18124 -0YvQuw== 18125 -IGZpZnRlZW4= 18126 -IGJvbHRz 18127 -IHtc 18128 -rLQ= 18129 -IHNldHRsZW1lbnQ= 18130 -IGxhbmdl 18131 -IGJhbQ== 18132 -R2V0 18133 -7ZWZ 18134 -IHN3YXA= 18135 -IEtoYW4= 18136 -IGNvbW1lbmNl 18137 -IHF1YXJhbnRpbmU= 18138 -IHNjb3JlZA== 18139 -55Y= 18140 -IDE5NTA= 18141 -IHRoaWNrZXI= 18142 -IHPDu3I= 18143 -5Y+j 18144 -IExhcnJ5 18145 -IGFsbGV6 18146 -7Iuc64qU 18147 -IGfDvA== 18148 -IHNwZWN0YWN1bGFy 18149 -Ly8= 18150 -Ym90aA== 18151 -IHN0YXRz 18152 -5aaz 18153 -IE5hbmN5 18154 -IGJ1bnU= 18155 -IGNydXN0 18156 -IGFjdGl2YXRlZA== 18157 -IOq3uOue 18158 -b3V0aGU= 18159 -IHBvcnRz 18160 -IG5ldXJhbA== 18161 -IGphdw== 18162 -IG9ic2VydmF0aW9ucw== 18163 -IHZvaXQ= 18164 -YWJhbg== 18165 -4bqjaQ== 18166 -pqzrpbw= 18167 -b21lcw== 18168 -4K+L 18169 -cXVp 18170 -IGtpbmRuZXNz 18171 -0JE= 18172 -IDQx 18173 -IG1vZGVyYXRl 18174 -IGFuZ2Vscw== 18175 -IFRhbWI= 18176 -w6h0 18177 -IGNobG9y 18178 -IEJpbGx5 18179 -7LKY6w== 18180 -YWNvbg== 18181 -IHNlbGVjdGluZw== 18182 -IERlbHRh 18183 -IG51bGw= 18184 -ZGVubHk= 18185 -IGNpdWQ= 18186 -IHRlbmRlbmN5 18187 -IGJyZWFrZG93bg== 18188 -IG1pbnQ= 18189 -0YTQvtGA0Lw= 18190 -b3JwaA== 18191 -IGRhd24= 18192 -c3By 18193 -IFdJTEw= 18194 -w6RjaGxpY2g= 18195 -IHB1cHB5 18196 -NzAw 18197 -IOCupA== 18198 -IGZhaWxz 18199 -IENvbmM= 18200 -IHJlbGF0aXZlcw== 18201 -IGludml0aW5n 18202 -IGF1dG9ub20= 18203 -IGNvbXBvc2Vk 18204 -IHVuaXR5 18205 -IGRlY2lz 18206 -IGFjY2Vzc29yaWVz 18207 -IENhc3M= 18208 -IGJpc3Q= 18209 -IFRpcA== 18210 -7Ke4 18211 -IHB1bnQ= 18212 -IHLDoXA= 18213 -6YCy 18214 -QU5L 18215 -44Ga 18216 -ZXhpc3Q= 18217 -IGNvbXBhdGlibGU= 18218 -IG5lcg== 18219 -INC10LzRgw== 18220 -IGFwbGlj 18221 -IGJhcHQ= 18222 -IGZhaWxpbmc= 18223 -IFRhbWFt 18224 -IG9zY2lsbA== 18225 -IGxldHp0ZW4= 18226 -IHJlcGVhdGVkbHk= 18227 -IGp1bmdsZQ== 18228 -IFB1c2g= 18229 -aGFp 18230 -IM63 18231 -IGRlYWRseQ== 18232 -0Y/Qtg== 18233 -d2nEhQ== 18234 -IENvbW1vbg== 18235 -IM6V 18236 -IHNrYXRl 18237 -VEM= 18238 -IE1pbmk= 18239 -IGhvYmJ5 18240 -4bqnbg== 18241 -IHJvdXRlcw== 18242 -IGFtaWdvcw== 18243 -IGNvbmp1bg== 18244 -IHBhcnRuZXJzaGlwcw== 18245 -IG5vdm8= 18246 -IGF2ZXI= 18247 -IHBvdXZleg== 18248 -YnJpZGdl 18249 -IHByZW9j 18250 -aGlt 18251 -IHR1cmI= 18252 -IHNvYg== 18253 -IFNuYXA= 18254 -IOywuA== 18255 -bWludXRl 18256 -IHRyYWplY3Q= 18257 -dWrEmQ== 18258 -IGVhZ2Vy 18259 -IHJlZ3VsYXRvcnk= 18260 -IGJhbmtpbmc= 18261 -Ymxpbmc= 18262 -0YjRjA== 18263 -YcW8 18264 -IGJpemFycmU= 18265 -aXRhdGVk 18266 -ZGlyZQ== 18267 -IHRocmVhdGVuZWQ= 18268 -IHNoaW5pbmc= 18269 -IG5lc3Nl 18270 -IGNvcnBz 18271 -INGB0YM= 18272 -IHRlbGVz 18273 -IHRlbXA= 18274 -dGVt 18275 -INC60LDQvQ== 18276 -IGZldmVy 18277 -TmV3 18278 -IGhlYXZpZXI= 18279 -IFNhaA== 18280 -YnVk 18281 -IG91dHJvcw== 18282 -IOywvg== 18283 -IOuqhQ== 18284 -YXJyaW5n 18285 -IOq0nOywrg== 18286 -IE5hcA== 18287 -IHNlbWlu 18288 -IFRoYW4= 18289 -aWZz 18290 -IGRlc2Vu 18291 -INGC0LDQutC+0LU= 18292 -IGxvc2Vz 18293 -IEJhbHQ= 18294 -a29u 18295 -INC90LDQv9GA 18296 -IHZvaXM= 18297 -IE1vc2Nvdw== 18298 -IGNoYWlycw== 18299 -aGlz 18300 -IHJlZnVnZWVz 18301 -a2c= 18302 -IGtvbGU= 18303 -jag= 18304 -0LDRgdC40LHQvg== 18305 -pr0= 18306 -IFVuaXZlcnNl 18307 -IERpcmVjdA== 18308 -IGNoZWF0aW5n 18309 -IENpbg== 18310 -IHBhdHJp 18311 -IGFkdmlzZQ== 18312 -IE5ldGhlcg== 18313 -IHByaW1laXJv 18314 -IG1lbnRpb25pbmc= 18315 -bnV0 18316 -NTY= 18317 -YXLEsQ== 18318 -IHBldGl0ZQ== 18319 -YmxlZA== 18320 -IHBlbnNhcg== 18321 -aWNpbw== 18322 -SU5E 18323 -IHZldGVyYW4= 18324 -IGxhZGRlcg== 18325 -IGNvbnNlcXVlbmNl 18326 -0L7QttCw0Ls= 18327 -IEJ1cm4= 18328 -IHJ1Zw== 18329 -IE1hZGU= 18330 -IGdpdA== 18331 -Ii4uLg== 18332 -IGNvbXBldGl0b3Jz 18333 -IHByemVk 18334 -IGFwcGFyZW50 18335 -IEFyZ2VudGluYQ== 18336 -IFdvcmtpbmc= 18337 -IGNvbGxhYm9yYXRl 18338 -d29tYW4= 18339 -IHJldGFpbg== 18340 -IGxldXJz 18341 -IGRhc2hib2FyZA== 18342 -15nXkw== 18343 -IEVhcmx5 18344 -Qk0= 18345 -INC10ZE= 18346 -0L7Qu9C+0LM= 18347 -IHNhdGlzZnlpbmc= 18348 -IG9mdGVudGltZXM= 18349 -IG1hcHBpbmc= 18350 -w7xua8O8 18351 -YXJ0aA== 18352 -Zm9sZA== 18353 -IGxhdW5jaGluZw== 18354 -IGF1cmE= 18355 -IHByZWNpc2lvbg== 18356 -d29ya3M= 18357 -R29k 18358 -IHN0cmFw 18359 -IEltcGVy 18360 -IHJpdmVycw== 18361 -IHw= 18362 -IGN1ZXI= 18363 -cmVnb24= 18364 -IGFycml2YWw= 18365 -0LrQsNGF 18366 -IE1pYW1p 18367 -0LDQvdGL 18368 -IHN1cnZpdm9ycw== 18369 -IFNlbmlvcg== 18370 -RGF2aWQ= 18371 -IGVzdGFkbw== 18372 -IHNlY3RvcnM= 18373 -IHBvcHBpbmc= 18374 -IGNoaW0= 18375 -YXnEsQ== 18376 -IGt1bm5lbg== 18377 -IGdhbGxlcnk= 18378 -IHN1bmxpZ2h0 18379 -ZXNlaGVu 18380 -IHllbGxpbmc= 18381 -IE1laW4= 18382 -IFBob2VuaXg= 18383 -IG1hbm8= 18384 -IGhpc3Rvcmlh 18385 -IG9jY3VycmluZw== 18386 -5qy4 18387 -7Lg= 18388 -0LDQtNC4 18389 -5b6F 18390 -IGluc3RpdHV0aW9uYWw= 18391 -IFR1dA== 18392 -57I= 18393 -IHNsYXZlcw== 18394 -44Gp44GG 18395 -IGZvcmdpdmVuZXNz 18396 -IHR3aW4= 18397 -IEh5dW4= 18398 -0L3RjA== 18399 -IEtvbW0= 18400 -YW5kcmE= 18401 -c2hvdA== 18402 -c3PDpA== 18403 -INGG0LU= 18404 -YXR0YQ== 18405 -IGV4cGVuc2U= 18406 -IEdQVQ== 18407 -IFBhc3Q= 18408 -cmlibHk= 18409 -IOutkOyVvA== 18410 -INCz0L7QtNCw 18411 -IHJlc3Bpcg== 18412 -5p2x 18413 -IFF1ZWVucw== 18414 -aG9wcw== 18415 -IHPDqXJpZQ== 18416 -IHByZWY= 18417 -IGNvbWVk 18418 -IHBsdXQ= 18419 -IE92ZXJhbGw= 18420 -IOOBnQ== 18421 -IGN1c2g= 18422 -IHJpbmdpbmc= 18423 -IGluY29ycmVjdA== 18424 -INGB0YLRgA== 18425 -IGdlb21ldHJ5 18426 -IGFkdmVydGlz 18427 -INCo 18428 -IHJldmlld2Vk 18429 -44GC44GC 18430 -IGRvemVucw== 18431 -IGRldGVybWluYXRpb24= 18432 -IFBoaWxs 18433 -IGNvbnRyaWJ1dGVk 18434 -IENpdA== 18435 -IHBhc3NlbmdlcnM= 18436 -IGPDtHTDqQ== 18437 -IHJldmVy 18438 -IHRlY2hub2xvZ2ljYWw= 18439 -IGFsbGVu 18440 -IHJhaW5pbmc= 18441 -YXZp 18442 -IHNhbHR5 18443 -IHR5cGluZw== 18444 -INGC0LU= 18445 -IHRpbHQ= 18446 -IOy5mA== 18447 -INC+0YA= 18448 -INC/0YDRj9C8 18449 -IHJvdQ== 18450 -IGFyZW5h 18451 -YXJhdA== 18452 -5Yir 18453 -SEhISA== 18454 -IG1hbnVmYWN0dXJlcnM= 18455 -IEVkd2FyZA== 18456 -IHR1Y2s= 18457 -IGJsb3dz 18458 -aW5nbw== 18459 -IE1hcmM= 18460 -7JWE7ISc 18461 -TWljaA== 18462 -IENsZWFu 18463 -6LQ= 18464 -ZXN0bw== 18465 -IFBhY2s= 18466 -IHNoYWZ0 18467 -QlJVTk8= 18468 -IGF2ZW4= 18469 -dXVy 18470 -0YHQutC+0LvRjNC60L4= 18471 -6rSA 18472 -IGF1dG9tYXRlZA== 18473 -IHZlbnR1cmU= 18474 -IHN1cnZlaWxsYW5jZQ== 18475 -IEdyb3c= 18476 -IEVtZXI= 18477 -INC00L7RgA== 18478 -IGludmVzdG9y 18479 -IFlvaw== 18480 -IGxhdHRlcg== 18481 -IE5J 18482 -IGZ1bmN0aW9uaW5n 18483 -IEhhbWlsdG9u 18484 -IDUx 18485 -IG11cmRlcmVk 18486 -IGFuY2hvcg== 18487 -IGN1Yw== 18488 -IFNDUA== 18489 -IE1hZGFt 18490 -IGNvbnN0cmFpbnRz 18491 -IGJhcm4= 18492 -YW5rZW4= 18493 -IOunjuydgA== 18494 -IE1vdG9y 18495 -IERvaW5n 18496 -IGFtZW4= 18497 -ZXR0cw== 18498 -IGluc3RydWN0b3I= 18499 -ZWd0 18500 -YWtv 18501 -IHBvc3R1cmU= 18502 -aXZpYQ== 18503 -IFBvbGlzaA== 18504 -INC00LLQsA== 18505 -IGNvbG9yZnVs 18506 -IGVsYm93 18507 -IHBhcmxl 18508 -IHBhc3Nlcg== 18509 -IGNvbmRlbQ== 18510 -b3J0YWw= 18511 -IGZlcnRpbA== 18512 -2KfYrw== 18513 -IENvbG9tYg== 18514 -IGFsaWdubWVudA== 18515 -IGFzdHJvbmF1dA== 18516 -IE11dA== 18517 -IHNhbG1vbg== 18518 -IHN0cnVjdHVyZWQ= 18519 -nteo 18520 -IGNsaWNrcw== 18521 -IG1pZWo= 18522 -5pS/ 18523 -44GE44KE 18524 -IFJvdW5k 18525 -IHJhaW5ib3c= 18526 -IFZB 18527 -44GU44GW 18528 -7KeI 18529 -b3R6 18530 -LDwv 18531 -IE5pY29sZQ== 18532 -bGlzaGluZw== 18533 -IHdoaWxzdA== 18534 -IHJlcHVibGlj 18535 -IHRhbWFt 18536 -dmVydGVk 18537 -IHJlY29nbml6aW5n 18538 -INCz0LvQsNCy 18539 -IGR1Yg== 18540 -IEpvcw== 18541 -ZmFsbHM= 18542 -aWNoaQ== 18543 -IGN6xJk= 18544 -INCm 18545 -IE1pdGNo 18546 -Q1I= 18547 -Y2xpY2s= 18548 -44GE44Gm 18549 -IHN0dW5uaW5n 18550 -IEp1bGlh 18551 -bWVycw== 18552 -IFBvbHk= 18553 -IGRlc3Nh 18554 -IGludMOp 18555 -IOqzoOs= 18556 -IGRvxJ8= 18557 -IGRpdmVy 18558 -IHN0cmlraW5n 18559 -YXBob3I= 18560 -IGFwZW5hcw== 18561 -b3VzZXM= 18562 -IHRyYWdlZHk= 18563 -IEZhbg== 18564 -IFR1cmtpc2g= 18565 -IHByb3BoZXQ= 18566 -IGRpc3RhbmNpbmc= 18567 -IEhlbQ== 18568 -IGNhcnRvb24= 18569 -S2U= 18570 -YW50aW5n 18571 -IENsYXJr 18572 -578= 18573 -IGRhdm9u 18574 -IO2F 18575 -IHl1bW15 18576 -IGNvbXByb21pc2U= 18577 -IHN0YXJ0dXA= 18578 -cml0dA== 18579 -IGNlcnRpZmllZA== 18580 -IHBpbGxvdw== 18581 -YmVyZQ== 18582 -7KSA 18583 -IHNlZ3Vpcg== 18584 -IHN0YWRpdW0= 18585 -YXRpdm8= 18586 -IHNpbXBsZXI= 18587 -s7g= 18588 -IHZpc2E= 18589 -IHBhdGh3YXk= 18590 -IG51ZXZv 18591 -IHJheQ== 18592 -44OQ 18593 -6Zw= 18594 -w7bDnw== 18595 -INC30LDQvQ== 18596 -IGNlbGVicml0eQ== 18597 -0LfQsA== 18598 -IGVpbmVz 18599 -IEdpdmVu 18600 -IEFyYQ== 18601 -IEpvYg== 18602 -IHlhaw== 18603 -IEFyYmVpdA== 18604 -cmVzc2luZw== 18605 -w6FuZA== 18606 -IGdyYWJiZWQ= 18607 -cGVuZA== 18608 -IHNpbmU= 18609 -aXJr 18610 -INCe0YI= 18611 -IEZsZQ== 18612 -aWNoZW4= 18613 -56Y= 18614 -IE5laWw= 18615 -6Jmf 18616 -IHJlcGVhdGluZw== 18617 -IGRyYXdpbmdz 18618 -cmlzZQ== 18619 -IGdsaXR0ZXI= 18620 -Zml2ZQ== 18621 -IHN1cnQ= 18622 -IHNpY2hlcg== 18623 -IGFkanVzdG1lbnRz 18624 -IOmCow== 18625 -aXBwaQ== 18626 -Y2tl 18627 -IHJlcHJlc2VudGF0aXZlcw== 18628 -IG1pZHN0 18629 -IHNwb2ls 18630 -bWV5ZQ== 18631 -IHRhZ3M= 18632 -IHllcA== 18633 -IFN0ZXBoYW5pZQ== 18634 -IGdlcmU= 18635 -IFJ1ZA== 18636 -54s= 18637 -IGdyb3M= 18638 -IHF1ZXVl 18639 -IGFjY29yZA== 18640 -IG9yZ2FuaXNhdGlvbg== 18641 -ZW5keQ== 18642 -IFRleHQ= 18643 -w7x5b3I= 18644 -IMOt 18645 -IGNvbmNsdXM= 18646 -IOykgOs= 18647 -IGFtcA== 18648 -IExlc3M= 18649 -IOuQmOuKlA== 18650 -Y2Fubw== 18651 -IFBpeA== 18652 -YXBlZA== 18653 -IGRhcmF1Zg== 18654 -dW8= 18655 -eW50aA== 18656 -YWJlbA== 18657 -IERvbmU= 18658 -IGRpY2s= 18659 -YXRob24= 18660 -IGhpbGFy 18661 -YWNjbw== 18662 -IOyGjQ== 18663 -IE9yZWdvbg== 18664 -IFdlaWw= 18665 -IG1hdGhlbWF0aWNz 18666 -IGFsbQ== 18667 -IHBpeGVscw== 18668 -IGZyw6Vu 18669 -0LHQvg== 18670 -RkM= 18671 -0L3Rjg== 18672 -aGVpbQ== 18673 -Z29z 18674 -IEZvcmdldA== 18675 -ZmVuZA== 18676 -IFZvaWzDoA== 18677 -IEdyZWV0 18678 -IM6xz4XPhA== 18679 -IHJlY3Vy 18680 -5pS2 18681 -NTE= 18682 -IOyeiOqzoA== 18683 -QXQ= 18684 -IHlhcmRz 18685 -0LjRgtC4 18686 -IG9mZnNldA== 18687 -cm9sbGluZw== 18688 -INCf0L7RgQ== 18689 -IGVubGlnaHQ= 18690 -IFBhZA== 18691 -bGltaXRlZA== 18692 -0LjQu9GM0L3Qvg== 18693 -IFNhcmE= 18694 -INGB0LTQtdC70LDRgtGM 18695 -bWFydA== 18696 -IEp1bXA= 18697 -IGFkb3JhYmxl 18698 -b3JzZQ== 18699 -Y2hlZXJpbmc= 18700 -IGVtcGF0aHk= 18701 -IFRvbmlnaHQ= 18702 -b3Jw 18703 -IEh1bnRlcg== 18704 -UG9pbnQ= 18705 -0LPQsA== 18706 -IHBhc3Nlbmdlcg== 18707 -IEtuaWdodA== 18708 -IHNlZW1pbmdseQ== 18709 -aHVo 18710 -IHRoZWF0cmU= 18711 -IHRvbWI= 18712 -IGRlcHJlc3NlZA== 18713 -IHN1bW1vbg== 18714 -IHNhdGlzZmFjdGlvbg== 18715 -ZG9vcnM= 18716 -IEhvdXN0b24= 18717 -0LDRjtGJ 18718 -IFJpbw== 18719 -0LPQu9GP 18720 -IGFycmFuZ2Vk 18721 -IGhhbmRsZXM= 18722 -IHRyaWxsaW9u 18723 -IG5pZ2h0bWFyZQ== 18724 -IFF1YW5kbw== 18725 -IG9sZQ== 18726 -IEd1aWRl 18727 -b29v 18728 -IGJpbGU= 18729 -IGVtcGV6 18730 -IDcy 18731 -Y3JpYmVk 18732 -IHByb2dyZXNzaW9u 18733 -IExpbnV4 18734 -66as 18735 -IOyymOydjA== 18736 -IGZvc3NpbA== 18737 -IHF1ZXJv 18738 -7Iah 18739 -YXRpdmE= 18740 -IHB1eno= 18741 -IFp1cw== 18742 -44Kq 18743 -IHRocmlsbGVk 18744 -IENC 18745 -IG1pbmVy 18746 -0YDQsNGJ 18747 -IFNBUg== 18748 -IE5vcw== 18749 -INCz0L7RgNC+0LQ= 18750 -IGNhbWI= 18751 -INGC0LA= 18752 -IHJlc3VsdGVk 18753 -IERpY2s= 18754 -b3VuZw== 18755 -IGNvbWljcw== 18756 -IGFic29sdXQ= 18757 -c3Rhbg== 18758 -ZGltZW5zaW9uYWw= 18759 -IHRlbnNl 18760 -bXVz 18761 -IEludGVsbA== 18762 -INGN0YLRgw== 18763 -IHBoYXNlcw== 18764 -IHZvbHRh 18765 -IHbDo28= 18766 -Ym91bmQ= 18767 -IEFuZGVyc29u 18768 -IGN1cmlvc2l0eQ== 18769 -IHBvbnQ= 18770 -6YCZ6KOh 18771 -IGRlbW9uc3RyYXRlZA== 18772 -b2xpbmU= 18773 -IFNwZWVk 18774 -IG1hbWE= 18775 -IHNob2NraW5n 18776 -IGtpZWR5 18777 -IGVhcnRocXVha2U= 18778 -IGltcGxpZXM= 18779 -IGVudGVycw== 18780 -noA= 18781 -IGVsZXZhdG9y 18782 -IGRlbGlnaHRlZA== 18783 -IE1pdHQ= 18784 -IEJhc2Vk 18785 -IERvbA== 18786 -IGtlbg== 18787 -IHdvcnJ5aW5n 18788 -IGZpbGVk 18789 -YWlsYW5k 18790 -INC80LXRgg== 18791 -IG1hc2M= 18792 -IM6R 18793 -IEp1bGll 18794 -IGRpbWVuc2lvbmFs 18795 -aHVtYW4= 18796 -VG9r 18797 -w78= 18798 -IHVuc3Q= 18799 -IHNldWxl 18800 -IGVtYmFy 18801 -IO2VqeuLiOuLpA== 18802 -YWNpb24= 18803 -IOyJ 18804 -IOu2gOu2hA== 18805 -IGhlYXRlZA== 18806 -4oCm4oCm 18807 -IiE= 18808 -IHJlYWxpc2U= 18809 -0LXRgtGL 18810 -aWVuaWE= 18811 -aWV6 18812 -IGbDvGg= 18813 -IEVzc2U= 18814 -IHBz 18815 -IGTDsw== 18816 -YXN0ZXJz 18817 -IG9ucw== 18818 -UE0= 18819 -IHJldHJv 18820 -bWFrZXI= 18821 -d2hlbg== 18822 -IGVsbGE= 18823 -IExpdmluZw== 18824 -IExhbQ== 18825 -IHRyb25n 18826 -IGFwcHJvdmU= 18827 -IM64zrE= 18828 -IHN1bmc= 18829 -0LXQvdC40Y4= 18830 -IFJlbW92ZQ== 18831 -w6huZQ== 18832 -aXJlbg== 18833 -IHN0cmFuZ2Vy 18834 -0LjQvdGL 18835 -IHbDpg== 18836 -YWZ0ZXI= 18837 -b3R0bw== 18838 -lOuhnA== 18839 -IEFob3Jh 18840 -bWlsbA== 18841 -SVNI 18842 -IGdyYWR1YXRpbmc= 18843 -a3Rl 18844 -IHJlbm92 18845 -IHByb2Nlc3NlZA== 18846 -a2V5cw== 18847 -0LXQutC+ 18848 -IGVucmljaA== 18849 -IMWfZWs= 18850 -IGluc2Vj 18851 -IE5hbg== 18852 -Y2FrZXM= 18853 -IGlsbHVzaW9u 18854 -mOulvA== 18855 -IGFpcmw= 18856 -aW1z 18857 -IGFudGVu 18858 -4buvbmc= 18859 -c24= 18860 -IHByZWNpc2E= 18861 -6riw7J6Q 18862 -INin2YTYuQ== 18863 -IGZvcmVtb3N0 18864 -IHBhcmFncmFwaA== 18865 -YXZhaXM= 18866 -INCy0L7RgQ== 18867 -IG1hbnM= 18868 -w61maWM= 18869 -Ym90 18870 -INi52YY= 18871 -IGJyb3Ro 18872 -IGFsdGVybmF0ZQ== 18873 -IENoYXB0ZXI= 18874 -IHZlY3RvcnM= 18875 -ZXNhcg== 18876 -IGluZGljYXRpb24= 18877 -IE5laW4= 18878 -toE= 18879 -IGplYW5z 18880 -WUU= 18881 -Y29uZA== 18882 -IHVuaXRlZA== 18883 -YWJp 18884 -IFNlcmdl 18885 -IHBhcnRpYWxseQ== 18886 -IG1hY3Jv 18887 -5omN 18888 -5by1 18889 -IGV0aGljYWw= 18890 -cnVpdA== 18891 -IHNoaWZ0ZWQ= 18892 -IGNhYmU= 18893 -IG1hdGhlbWF0aWNhbA== 18894 -IHJ1ZGU= 18895 -15nXldeq 18896 -IE1lcmM= 18897 -IGdhbnpl 18898 -aWNpb24= 18899 -IHVuY29uc2Npb3Vz 18900 -IGJ1cm50 18901 -INGA0LXQsQ== 18902 -7Yq46w== 18903 -IGNoYXJt 18904 -YW5kYWw= 18905 -7LKc 18906 -b3RoeQ== 18907 -IEhhZGk= 18908 -IGFwcHJlY2lhdGlvbg== 18909 -RU5E 18910 -IHLDqWFs 18911 -toTrk6Q= 18912 -IE5hZw== 18913 -oKTqs6A= 18914 -IExhdXJlbg== 18915 -IHbhu5tp 18916 -IEJyaWRnZQ== 18917 -IFVtbQ== 18918 -IFdlZw== 18919 -IGNoYXF1ZQ== 18920 -IFNvcGg= 18921 -IGdkemll 18922 -7ZGc 18923 -IHN0ZXI= 18924 -IEJsYQ== 18925 -IHJlZmxlY3Rz 18926 -IGJlbmNobWFyaw== 18927 -0LLQsNGC 18928 -YW1pbmU= 18929 -44Gh44KD 18930 -IGFuaA== 18931 -IGNvbnRpbmVudA== 18932 -IEZEQQ== 18933 -7KGw 18934 -IMOqdGVz 18935 -15nXkA== 18936 -5byA 18937 -IGJsb29keQ== 18938 -IE5pbmU= 18939 -aWVsdA== 18940 -ZW1hbmQ= 18941 -IOuztOqzoA== 18942 -IHRpZGFr 18943 -IFNjaWVudA== 18944 -cGxleA== 18945 -b3N0ZW4= 18946 -IGFuaW1hdGVk 18947 -YXNzYQ== 18948 -IGRlcml2ZWQ= 18949 -INC40YHRgtC+0YA= 18950 -IE1pZw== 18951 -7IWY 18952 -IHJvcw== 18953 -cGx1cw== 18954 -b3NhdXI= 18955 -IF4= 18956 -IGludGVuc2l2ZQ== 18957 -IGdsb2JhbGx5 18958 -IGRpZmVyZW4= 18959 -7J206rOg 18960 -5L2g55qE 18961 -xIVk 18962 -IGTDqXM= 18963 -IHByZXNlbnRhdGlvbnM= 18964 -IENybw== 18965 -IGVzc2Vz 18966 -IEJldHdlZW4= 18967 -UGE= 18968 -IG5hdw== 18969 -4Lit4LiH 18970 -IGJyZWVk 18971 -aWNodGU= 18972 -INCe0L3QuA== 18973 -IEJ1aWxkaW5n 18974 -IGNvbmZvcm0= 18975 -TU8= 18976 -INCW 18977 -IEtpZA== 18978 -bmFz 18979 -IER1ZQ== 18980 -csOpcw== 18981 -IGRpb3g= 18982 -IEJpbg== 18983 -IHRheGk= 18984 -IHNhcA== 18985 -IEh1Yg== 18986 -54K65LuA6bq8 18987 -IGNlbnRlcmVk 18988 -IHN1cmdl 18989 -IGF2b25z 18990 -IGxlYXJudA== 18991 -IFlhbQ== 18992 -IERpZXNl 18993 -0L3QuNC60Lg= 18994 -IEJlaWo= 18995 -V2lsbA== 18996 -IGF0dGVtcHRlZA== 18997 -IGdyaWVm 18998 -w7Nq 18999 -IGtpZG5leQ== 19000 -IG9wcG9uZW50cw== 19001 -5pu0 19002 -IG5vbWU= 19003 -NTc= 19004 -0Y/RgtC90L4= 19005 -IG1pZG5pZ2h0 19006 -QW5ub3VuY2Vy 19007 -YWNpdHk= 19008 -b25lZA== 19009 -IHB1ZWRlcw== 19010 -IHByb2JsZW1hdGlj 19011 -IGNvcHM= 19012 -IFBldGU= 19013 -cmludA== 19014 -dW50ZWQ= 19015 -IGJpcA== 19016 -5qI= 19017 -IMOA 19018 -IGNlbnM= 19019 -YXRpdmVseQ== 19020 -IOS4jQ== 19021 -IHVyZ2VudA== 19022 -IHN0cnVnZ2xlZA== 19023 -YWNodXM= 19024 -IG1pY3Jvd2F2ZQ== 19025 -IFNpZGU= 19026 -IERlbm4= 19027 -INGP0LI= 19028 -IHVyZ2U= 19029 -IGZvcmNpbmc= 19030 -d2FuZw== 19031 -INC60L7RgtC+0YDQsNGP 19032 -IG1hbW0= 19033 -IPCfjg== 19034 -IHRyaWJlcw== 19035 -IFNoYWRvdw== 19036 -IFNhbmc= 19037 -IEhpdGxlcg== 19038 -IGx1bg== 19039 -IHNjZW50 19040 -7KeR 19041 -IG92ZXJ3aGVsbWVk 19042 -IGJvbWJz 19043 -IGNyaW1pbg== 19044 -IGNvbnNvbGlk 19045 -IG1vbGVjdWxhcg== 19046 -15XXpw== 19047 -bm9y 19048 -IHBlcmNlaXZlZA== 19049 -IHbDqQ== 19050 -IGFsdG9nZXRoZXI= 19051 -IG9ydGg= 19052 -IHZlbQ== 19053 -IHp3YXI= 19054 -aXpv 19055 -xas= 19056 -IG1lbHRlZA== 19057 -b3JkZW4= 19058 -IENoYXJsb3R0ZQ== 19059 -IEV4Y2Vs 19060 -YXJ0YQ== 19061 -7Jyg 19062 -IEdldw== 19063 -IHJvbWFuY2U= 19064 -ZXJlbW9z 19065 -IGNvbG9uaWFs 19066 -IHRyYWRpdGlvbmFsbHk= 19067 -IHF1YW4= 19068 -aG9v 19069 -IGNoYW1waW9uc2hpcA== 19070 -IGFyYml0cg== 19071 -7IWU 19072 -INC80LjQvQ== 19073 -IHNlbGZpc2g= 19074 -IGJsZXc= 19075 -cnlpbmc= 19076 -IG9wZXJhdG9ycw== 19077 -IGp1cmlzZA== 19078 -j4U= 19079 -dWl0aW9u 19080 -IEVD 19081 -IEFueWJvZHk= 19082 -dmF0ZQ== 19083 -aWV0aWVz 19084 -IGFuYWx5c3Q= 19085 -tOyXkA== 19086 -INCy0YHQtdCz0LTQsA== 19087 -w6dlaw== 19088 -IEt1bg== 19089 -IGFnaW5n 19090 -1aE= 19091 -0YDQsNGE 19092 -IE1vbWVudA== 19093 -IEh1YQ== 19094 -6IM= 19095 -dGhlbg== 19096 -0LXQu9Cw 19097 -ZXN0b25l 19098 -IGVuZGU= 19099 -IGF3YXJkZWQ= 19100 -IG7DpGNoc3Rlbg== 19101 -IFNwb3Q= 19102 -IE5lZw== 19103 -IGZhaXJ5 19104 -5Luj 19105 -IENvdmVy 19106 -IGRlcG9zaXQ= 19107 -IHN0cmVzc2Z1bA== 19108 -IGp1bms= 19109 -IG1ldGFib2w= 19110 -SmE= 19111 -IOq3gA== 19112 -IHVuZGVyZ3JhZHVhdGU= 19113 -IGNhbmNlbGw= 19114 -IGNvbnNlbnN1cw== 19115 -IG9zbw== 19116 -6YeR 19117 -4bq3 19118 -xJ9lcg== 19119 -cmFkYQ== 19120 -IFBhbGFjZQ== 19121 -IHBlZGFs 19122 -IGV4YWdnZXI= 19123 -IGJlaGF2aW9yYWw= 19124 -cGxheWVy 19125 -bGxlcw== 19126 -IGNvbm5lY3Rvcg== 19127 -IHNrZXB0 19128 -jZTrnbzqs6A= 19129 -IG1pdHQ= 19130 -IEhhaGE= 19131 -IHBlcXVl 19132 -IEdvdHQ= 19133 -ZmFuZw== 19134 -4LA= 19135 -am9z 19136 -IGtpY2tpbmc= 19137 -IG1vdW50ZWQ= 19138 -IHJlcGxhY2luZw== 19139 -dm9z 19140 -IHF1aWV0bHk= 19141 -IG1pbGl0 19142 -IG93bnM= 19143 -IG5pdmVhdQ== 19144 -IGF1cg== 19145 -IEJ1eQ== 19146 -IHByZWRpY3RlZA== 19147 -IGNvd3M= 19148 -IHBvbmVy 19149 -IERyaQ== 19150 -IHJlbWFya3M= 19151 -IHJlcG9ydGVy 19152 -IGFya2FkYcWf 19153 -0LXRgdGC0Lg= 19154 -IHNhdmVz 19155 -IMOnb2M= 19156 -IG1ldGFwaG9y 19157 -IEtlbA== 19158 -c3RhdGlvbg== 19159 -c2VtYmx5 19160 -IGFkdmlzb3I= 19161 -IHdvcmtzaG9wcw== 19162 -IGFjY291bnRpbmc= 19163 -IHRvaw== 19164 -bmllcg== 19165 -aW5uZXI= 19166 -IGJ1cmFkYQ== 19167 -IEJC 19168 -IE9seW1waWM= 19169 -IFByYWN0 19170 -Q2hyaXN0 19171 -INGB0Y4= 19172 -IGthcw== 19173 -IHZpZXdlZA== 19174 -IG1hcmtlcnM= 19175 -IGZvdG8= 19176 -Z2V0aWM= 19177 -IEx1Y2Fz 19178 -IHBhZHM= 19179 -IEpvaA== 19180 -IENEVQ== 19181 -YWZmZW4= 19182 -YXJlbQ== 19183 -IEJlY2s= 19184 -IEdvc2g= 19185 -c2hpdA== 19186 -44GM44Go44GG 19187 -IE1hdGVy 19188 -YWJ1bGFyeQ== 19189 -IFJvb20= 19190 -bGxlbg== 19191 -IEZvbGxvd2luZw== 19192 -IGRvaXQ= 19193 -YmFsbHM= 19194 -aXhh 19195 -IGdyb3VuZHM= 19196 -IOyeiOuKlOuNsA== 19197 -TFM= 19198 -IHdpbGRsaWZl 19199 -IFNRTA== 19200 -IHNoaWZ0cw== 19201 -5LiA6bue 19202 -Qm9vaw== 19203 -IGhvc3RlZA== 19204 -bGxvcg== 19205 -IHNuYXBz 19206 -IGJlc29pbg== 19207 -INep15Q= 19208 -IHBlYW51dA== 19209 -w6RmdA== 19210 -uaA= 19211 -xZts 19212 -QXVkaWVuY2U= 19213 -IEJhcmJhcmE= 19214 -IGFkb3B0aW9u 19215 -IHdvbGY= 19216 -INC+0YHQvdC+0LI= 19217 -YXJkYQ== 19218 -IGV4cG9zZQ== 19219 -IOym 19220 -amFz 19221 -xJM= 19222 -IGNvdW50bGVzcw== 19223 -IOyngQ== 19224 -aGVhbHRo 19225 -dWVudA== 19226 -aXNv 19227 -b3Rpb24= 19228 -IGh1bmdlcg== 19229 -IG1vaXM= 19230 -b2Zmcw== 19231 -IGNsYWltaW5n 19232 -IM6a 19233 -IEJlbGc= 19234 -INC90LDQuQ== 19235 -6riw64+E 19236 -IHVucHJl 19237 -IGdlZA== 19238 -IElv 19239 -INC/0L7RgdC80L7RgtGA 19240 -IGNvxZs= 19241 -IE5hcnJhdG9y 19242 -IMOHb2s= 19243 -7Zmp 19244 -4Lit4Lii 19245 -Y2lwbA== 19246 -IHRpbWVy 19247 -IGRlZmlj 19248 -YXZpbg== 19249 -IGNhdGVnb3I= 19250 -IHRocm93cw== 19251 -IOuCnA== 19252 -INC/0L7RgdC70LXQtA== 19253 -IFRoYWk= 19254 -IG1hc2N1bA== 19255 -IGJla29tbWVu 19256 -IGludGVybmF0aW9u 19257 -dWxzZQ== 19258 -IGF5ZQ== 19259 -IHBvaQ== 19260 -IHBpeGVs 19261 -Q2hyaXM= 19262 -IHN0b3Zl 19263 -zr/OuQ== 19264 -IGdlbmVyYXRvcg== 19265 -IOy7rOs= 19266 -IGFjYWRlbQ== 19267 -IHByYWN0aWNlZA== 19268 -IGFxdWVzdA== 19269 -IGNvbnRyaWJ1dGluZw== 19270 -IEln 19271 -IOG7nw== 19272 -IGNvbnRhaW5pbmc= 19273 -IHdyZXN0bGluZw== 19274 -INGH0LXQs9C+ 19275 -aGF1cHQ= 19276 -IGVzc2Fz 19277 -dmVsb3Bl 19278 -IGV4Y2VwdGlvbmFs 19279 -WVU= 19280 -IEFwcGxhdXNl 19281 -cmljYW5l 19282 -IGNvbnZlbmllbmNl 19283 -INC00LXQu9Cw0YLRjA== 19284 -0LjQu9C40YHRjA== 19285 -IEVudmlyb24= 19286 -ODU= 19287 -IGPDog== 19288 -IOyViOuFle2VmOyEuOyalA== 19289 -IE1P 19290 -IFBvcGU= 19291 -IHNhaA== 19292 -b2Jp 19293 -IG1hc3RlcnM= 19294 -YWluZXM= 19295 -IGJsZXNzaW5ncw== 19296 -IG9iZXk= 19297 -IGZsdXg= 19298 -IGJyb3c= 19299 -IOyLpA== 19300 -IHBvcHVsYXJpdHk= 19301 -IExhbWI= 19302 -emV1Zw== 19303 -7JmU 19304 -j4TroZ0= 19305 -aXR1YXRpb24= 19306 -IGFjY29tcGFu 19307 -IGRpYWxvZw== 19308 -IEphbWll 19309 -5Yqg5rK5 19310 -IHNld2luZw== 19311 -IGJsZWVkaW5n 19312 -IGJhaWw= 19313 -IHRocmVhZHM= 19314 -b2RnZQ== 19315 -IFNoYW5n 19316 -IGRlcGxveW1lbnQ= 19317 -Y2hlZA== 19318 -IHNhdGlzZnk= 19319 -IGxheg== 19320 -IG1pc3NpbGU= 19321 -IExpbmtlZA== 19322 -IG1ha2Vycw== 19323 -Y2l1bQ== 19324 -ZnJl 19325 -IOuovA== 19326 -IOustOs= 19327 -IEVkZ2U= 19328 -IHNvY2lldGllcw== 19329 -IGFndWE= 19330 -IHN5bmNocm9u 19331 -oaA= 19332 -dW5mdA== 19333 -IHVubQ== 19334 -IHRyaWFuZw== 19335 -IGluanVzdA== 19336 -dG9w 19337 -IG9yYWw= 19338 -a29y 19339 -IO2VqA== 19340 -bGRpZ3Q= 19341 -Y2XEnw== 19342 -cXVldA== 19343 -IExlbw== 19344 -IHNhdm9pcg== 19345 -IGVhc3Rlcm4= 19346 -aWV1 19347 -IGV4cGVk 19348 -INCh0L8= 19349 -IHVubmVjZXNzYXJ5 19350 -IFBlcmZvcm0= 19351 -IE1pbmc= 19352 -INGA0LDQsg== 19353 -IGludGVudGlvbnM= 19354 -IGNvbXByZXNzaW9u 19355 -IFNhYw== 19356 -zr/Ouw== 19357 -YXJzb24= 19358 -IHRyb3V2ZQ== 19359 -IE11aGFtbWFk 19360 -INCy0YvRgQ== 19361 -IGZpbml0ZQ== 19362 -INC90LDRhdC+0LQ= 19363 -dWdh 19364 -0YDQsNC30YM= 19365 -IGNlbGVicmF0ZWQ= 19366 -IGNvbmZlc3M= 19367 -IHNxdWFyZXM= 19368 -IEdvcmRvbg== 19369 -IOuCmOyY 19370 -IHN5bmRyb21l 19371 -IGNvbXBsZXRpb24= 19372 -IGJhY2tpbmc= 19373 -IGRhcmY= 19374 -IFF1cmFu 19375 -IGludGVybWVkaWF0ZQ== 19376 -IGtlcg== 19377 -IGTDvA== 19378 -aGVzaXZl 19379 -IGFjY291bnRhYmlsaXR5 19380 -IFJlYmVjY2E= 19381 -6JGX 19382 -IFNsZWVw 19383 -IGRpZmbDqXJlbnQ= 19384 -b2xz 19385 -IFJpY2U= 19386 -IOuzuA== 19387 -IGFudGliaW90 19388 -z4TOrA== 19389 -cno= 19390 -YW1ibGluZw== 19391 -IHNlbnNpdGl2aXR5 19392 -IGNocm9u 19393 -YWxsYXM= 19394 -NjQ= 19395 -IGZsZWV0 19396 -IG9wdGltaXN0aWM= 19397 -0YHQutC+0LPQvg== 19398 -IGphZGk= 19399 -YWlsbGV1cnM= 19400 -IEVub3VnaA== 19401 -IHNlbmlu 19402 -IHBhY2tz 19403 -Ym4= 19404 -IEFyZWE= 19405 -IFRybw== 19406 -qOumrA== 19407 -0LDRlA== 19408 -IFRob20= 19409 -IGhhcm1vbnk= 19410 -0L3QuNC60LA= 19411 -IHNvbWVkYXk= 19412 -SVNF 19413 -IEJyb2Fkd2F5 19414 -bGFyZXM= 19415 -ZXJuZXNz 19416 -4LmE4Lih 19417 -IFRlbm4= 19418 -IE5BVE8= 19419 -44KK44G+44GZ 19420 -IG1pbnV0b3M= 19421 -IEthbnNhcw== 19422 -IE1vbmc= 19423 -IGNvbXB0ZQ== 19424 -5Zub 19425 -iqQ= 19426 -IOyXrQ== 19427 -IHN1cGVyaGVybw== 19428 -IEdhcmRlbg== 19429 -IE1vcw== 19430 -IGF0dGFjaG1lbnQ= 19431 -IGJ1c3Q= 19432 -4K+K 19433 -IFRoYWlsYW5k 19434 -c3RhdA== 19435 -IHNwaWNl 19436 -IExlYg== 19437 -IGxlYXA= 19438 -emVjaA== 19439 -R0w= 19440 -IHZlcmw= 19441 -IGZpeGluZw== 19442 -IOuztOuptA== 19443 -IHBvcm4= 19444 -IGLDvHk= 19445 -INmF2Kc= 19446 -IFZpcnQ= 19447 -IFRvbW15 19448 -IGNhcmdv 19449 -IE9saGE= 19450 -IHJva3U= 19451 -2YPZhg== 19452 -IGJha2Vk 19453 -IHRhY3RpY3M= 19454 -IG1hcmtldHBsYWNl 19455 -IGt0w7NyYQ== 19456 -YXJsbw== 19457 -IHN3aXRjaGVz 19458 -IGNhY2hl 19459 -IEhS 19460 -IEdhbg== 19461 -IEdQUw== 19462 -IGR1YXM= 19463 -aGVyZXM= 19464 -0LXRgNGI 19465 -dHJhY2s= 19466 -IGx1bmdz 19467 -U3RhdGlvbg== 19468 -aWdnbGVz 19469 -IGNhbXBpbmc= 19470 -5ZOH 19471 -IGNvbXBsZXRpbmc= 19472 -YW1hcw== 19473 -IGN5Y2w= 19474 -IHByb3RvdHlwZQ== 19475 -IEp1ZGdl 19476 -b3R5cGVz 19477 -IGluZmVjdGlvbnM= 19478 -oKTr 19479 -0LXRgNCz 19480 -b2Jh 19481 -IEJvZA== 19482 -IFNlY29uZGx5 19483 -IGFwb3N0 19484 -IHNvZ2Fy 19485 -IHJlYXNz 19486 -aWVr 19487 -5pa8 19488 -IGFzaGFtZWQ= 19489 -IGN1cnZlcw== 19490 -INCy0LDQtg== 19491 -IGVuc2VtYmxl 19492 -YXR1cg== 19493 -IHBob3RvZ3JhcGhlcg== 19494 -IGVpZ2h0aA== 19495 -IHdhc3RlZA== 19496 -566X 19497 -IGRhbXA= 19498 -INC80LDQuw== 19499 -YXJlbmE= 19500 -IGludGVybmFsbHk= 19501 -IGhlZWxz 19502 -IFNhbHQ= 19503 -IGJsaXI= 19504 -iOuCmA== 19505 -IGNvbnRyYXJ5 19506 -IHByaW1h 19507 -IG9zcw== 19508 -IHJhYmJpdA== 19509 -IGF1dG9y 19510 -IGJyb2FkbHk= 19511 -w61zdA== 19512 -IGJhY2tz 19513 -7ZSE 19514 -ZXRv 19515 -IGp1cnk= 19516 -6LE= 19517 -IHByb3N0dQ== 19518 -IGJhcmE= 19519 -IHBhcmxpYW1lbnQ= 19520 -b3JpZW50 19521 -0LjQu9Cw0YHRjA== 19522 -IGluZGlyZWN0 19523 -w6Ft 19524 -IMOlcg== 19525 -IHRyYWl0cw== 19526 -IGTDrWFz 19527 -2YTZhQ== 19528 -IENU 19529 -YWx5c3Q= 19530 -IGxpdmVzdA== 19531 -IGtvcw== 19532 -TWF5 19533 -IEppbmc= 19534 -IGpvdXJuYWxpc3Rz 19535 -0YfQuNC6 19536 -YXJtcw== 19537 -IOqwkOyCrA== 19538 -INC40LzQtQ== 19539 -IMOpZ2Fs 19540 -IE5ld3Rvbg== 19541 -IHJlY292ZXJlZA== 19542 -IGJyYXVjaGVu 19543 -IEJyb24= 19544 -0LDQvdC+ 19545 -IHBhbGU= 19546 -cHJpc2Vz 19547 -IGhvcmFz 19548 -Y2h0cw== 19549 -6YCa 19550 -w7/Dvw== 19551 -YWtlcnM= 19552 -IEFsYXNrYQ== 19553 -emllag== 19554 -IHNjb29w 19555 -7J206rCA 19556 -44GV44GE 19557 -Y29y 19558 -w6lsw6k= 19559 -IHN1cmc= 19560 -IHZpZW5l 19561 -IEtyaXN0 19562 -NTQ= 19563 -IGJhbm5lZA== 19564 -IHNtb290aGx5 19565 -IHRyZWF0cw== 19566 -IHByb25vdW5jZQ== 19567 -IGZsdXNo 19568 -IGNhbWJp 19569 -IG11c2ljaWFu 19570 -IEFzaGxleQ== 19571 -IFNQRA== 19572 -IEJvYmJ5 19573 -IGdsb3Nz 19574 -cmVzcGVjdA== 19575 -IHJldmlld2luZw== 19576 -IGdlbmVyaWM= 19577 -xrDhu5tj 19578 -YXRzw6RjaGxpY2g= 19579 -IGhlYWx0aGllcg== 19580 -dWJlcnM= 19581 -INC00LDQvQ== 19582 -IE1lZGljYXJl 19583 -NTM= 19584 -IGNvbXBsYWludHM= 19585 -amFj 19586 -IGFncmljdWx0dXJhbA== 19587 -U3Bl 19588 -IEpvbmc= 19589 -IGRpb3hpZGU= 19590 -6rKo 19591 -ZWxpams= 19592 -IFNoaXQ= 19593 -YWludHM= 19594 -IElhbg== 19595 -IFNpbXBseQ== 19596 -IFN0cmU= 19597 -5pyL 19598 -IEdEUA== 19599 -NTk= 19600 -YXN6 19601 -IEthdGll 19602 -INCx0YA= 19603 -IHBlZWs= 19604 -b3d5Y2g= 19605 -IHJlc29ydA== 19606 -IHJlc2lkZW5jZQ== 19607 -IHNwaWNlcw== 19608 -Y2nDsw== 19609 -IGplZGVy 19610 -IGVtbw== 19611 -YXJpdW0= 19612 -IHB1ZmY= 19613 -66eJ 19614 -0YPQu9GM0YI= 19615 -IG1ldGE= 19616 -IOyghOs= 19617 -IG9wdGltaXphdGlvbg== 19618 -Z2FuZw== 19619 -IO2VhA== 19620 -IGVmZmljaWVudGx5 19621 -IHZpc3VhbGx5 19622 -IGZyb3N0 19623 -IEFydGh1cg== 19624 -IMW8 19625 -IGFjaGlldmluZw== 19626 -IHJvdGF0aW5n 19627 -IGxpbmluZw== 19628 -IG9jY3VwaWVk 19629 -5byf 19630 -bWVudGF0aW9u 19631 -IHN0cmV0Y2hpbmc= 19632 -IHN0YWxs 19633 -b3N0aWM= 19634 -IFNldmVy 19635 -IGdsdWM= 19636 -IHLDs8W8 19637 -IG91dHJlYWNo 19638 -c3RyYQ== 19639 -aWtlbg== 19640 -IOyWmOq4sA== 19641 -IEpvaW4= 19642 -IGltcGU= 19643 -IGNvbXBlbnNhdGlvbg== 19644 -IFRhdA== 19645 -IENhcmxvcw== 19646 -w7xocnQ= 19647 -IEZyYW5jaXM= 19648 -Y2pp 19649 -eWVhaA== 19650 -IG1lbWJyYW5l 19651 -IGV4aGFsZQ== 19652 -IHJlbGk= 19653 -IE9S 19654 -IHJlZnJpZ2VyYXRvcg== 19655 -IFZlbmV6 19656 -TGlrZQ== 19657 -IHJhaXNlcw== 19658 -b3R0bGU= 19659 -YXR1cmE= 19660 -IHJ1bGVy 19661 -IHdlZXI= 19662 -IGd1aWRlZA== 19663 -IE1hZ24= 19664 -IENvcnBvcg== 19665 -jZQ= 19666 -IGF0dHJpYnV0ZQ== 19667 -IFdvYWg= 19668 -IGFycm93cw== 19669 -IGF3YWl0 19670 -IFByaW0= 19671 -IGRpZ25pdHk= 19672 -IE9udGFyaW8= 19673 -aXNjaGVy 19674 -IOyLnQ== 19675 -aW1lbg== 19676 -b3V2ZXI= 19677 -QVNT 19678 -4buHbg== 19679 -b3B5 19680 -YWNodXNldHRz 19681 -IGVsZGVybHk= 19682 -5Y6f 19683 -RkE= 19684 -IERhaWx5 19685 -c2hpbmU= 19686 -IDU2 19687 -6KI= 19688 -aWVybm8= 19689 -IHNraWxsZWQ= 19690 -IGdyb8OfZQ== 19691 -IE9haw== 19692 -56ys5LqM 19693 -aWdnbGU= 19694 -0LXQu9C10Lk= 19695 -IGJpcmF6 19696 -IGFyZ3Vpbmc= 19697 -INC/0L7RjdGC0L7QvNGD 19698 -IGRyaWZ0 19699 -IGhhcm5lc3M= 19700 -IGRlaXhhcg== 19701 -YXV0cmU= 19702 -IFNlZWluZw== 19703 -IGNhcGl0YWxpc20= 19704 -IEVsZA== 19705 -emlvbmU= 19706 -IEJleW9uZA== 19707 -IHBlcmZlY3Rpb24= 19708 -IGhvZQ== 19709 -IGRlY2xhcmU= 19710 -0LDQu9Cw0YHRjA== 19711 -IHBva2U= 19712 -INeh 19713 -IGZpZ2h0ZXJz 19714 -6rKg64uk 19715 -0L7RgNC+0LI= 19716 -IGFjY29yZGluZ2x5 19717 -IElzYQ== 19718 -IG9wdGltaXpl 19719 -IE1pbmlzdHJ5 19720 -IHNhZ2U= 19721 -7Iuc66m0 19722 -IGJlbmk= 19723 -IGRvbmF0aW9u 19724 -IGNsZWFyZWQ= 19725 -IEx1Y2tpbHk= 19726 -IGhhcm1mdWw= 19727 -tey7pA== 19728 -IGNlbWVudA== 19729 -0L/QuNGB 19730 -IGRlZGk= 19731 -IENyYWln 19732 -IGRlbW9ucw== 19733 -IGN1c3RvbWl6ZQ== 19734 -IGlnbm9yZWQ= 19735 -IFRpYW4= 19736 -IGhvcGVk 19737 -IEJ1cmVhdQ== 19738 -IHJp 19739 -IFlhaA== 19740 -IHNvY2tldA== 19741 -IGZlYXR1cmluZw== 19742 -IHBhcmY= 19743 -IFRF 19744 -IFRlYWNoZXI= 19745 -IGNhdGFsb2c= 19746 -6rCA7KeA6rOg 19747 -IFNlaXRl 19748 -IGNvbmU= 19749 -IFBhbGVzdGlu 19750 -IGdld29vbg== 19751 -IGdhaW5pbmc= 19752 -INii 19753 -IGNhdGFzdA== 19754 -IG5laWdoYm91cg== 19755 -SVNU 19756 -IHN0ZWFsaW5n 19757 -IHRyb2lz 19758 -IGludGVuZA== 19759 -IFNob290 19760 -IHBpb25l 19761 -IEludGVs 19762 -IExJTg== 19763 -IGJyaWdodGVy 19764 -IFllc3RlcmRheQ== 19765 -IHNvdw== 19766 -c2lu 19767 -b2Rz 19768 -IGV0aGljcw== 19769 -IGludGVydmlld2Vk 19770 -cmVsbA== 19771 -IHJlZnJlc2hpbmc= 19772 -c8Ol 19773 -IGFic3VyZA== 19774 -IHBob3NwaA== 19775 -Zmls 19776 -IHN0ZWhlbg== 19777 -dmFscw== 19778 -IGNhcmVk 19779 -5oiW 19780 -IGRlbGw= 19781 -Ym9uZQ== 19782 -IGhvY2g= 19783 -IHB1cA== 19784 -IGlv 19785 -IGFjb250ZWNl 19786 -ZWxsZXM= 19787 -IFNwbA== 19788 -aWdp 19789 -IHTDpG4= 19790 -IGVsZXBoYW50 19791 -IGdhdGVz 19792 -IHNsaWNlcw== 19793 -IHByYW5r 19794 -b2tyYXQ= 19795 -IGhpbGFyaW91cw== 19796 -IFNpZA== 19797 -IOuSpA== 19798 -IGVzc2VyZQ== 19799 -IHRlbGVwaG9uZQ== 19800 -aW5hbGx5 19801 -cmF0b3I= 19802 -IGhlbGljb3B0ZXI= 19803 -IGnFn3Rl 19804 -IGdpZA== 19805 -IHRvdXJpc3Q= 19806 -IGNvbmZsaWN0cw== 19807 -0LDRgtCw 19808 -IHTDqQ== 19809 -IGFzc2VydA== 19810 -IGxhdW5kcnk= 19811 -IEJvbQ== 19812 -IHNwZWNpYWxpemVk 19813 -IE1vZGVybg== 19814 -b2dyYWY= 19815 -IGFubw== 19816 -IHJldHJpZQ== 19817 -IFB1dGlu 19818 -IEhBUg== 19819 -INC80LDRiA== 19820 -IM6xz4DPjA== 19821 -IHR1dHRp 19822 -INCy0YLQvtGA 19823 -7Ja1 19824 -IEJ1bA== 19825 -64uk66m0 19826 -xYJl 19827 -5pyL5Y+L 19828 -YXJpbg== 19829 -IHRoZXJhcGlzdA== 19830 -IGfDpXI= 19831 -IEN6eQ== 19832 -cHBl 19833 -bWly 19834 -IFRlcm0= 19835 -IEJlYXI= 19836 -bGFjZQ== 19837 -IE1vcmVvdmVy 19838 -IERpc2M= 19839 -IO2DgA== 19840 -IHRpdGxlZA== 19841 -IHN0cmlwcw== 19842 -IEZhaHI= 19843 -IFJpbmc= 19844 -cmFuZG8= 19845 -YWZh 19846 -6Lqr 19847 -IHNob3J0cw== 19848 -IHRydW5r 19849 -IHNlbnRpZG8= 19850 -z4nOvQ== 19851 -IGFjcmVz 19852 -IG92ZXJk 19853 -IE9seW1waWNz 19854 -5Y+r 19855 -IE1lcmNp 19856 -IOuCmOyYpA== 19857 -IGdlcm0= 19858 -YW1tZWQ= 19859 -IHByZWd1bnQ= 19860 -IE51dA== 19861 -IDwv 19862 -IHRyYXZlbHM= 19863 -IHZvY2FidWxhcnk= 19864 -ZXRlbg== 19865 -b2Rlcg== 19866 -IGNvbnN1bWluZw== 19867 -d3JpdGluZw== 19868 -6LaF 19869 -IGFwcGVhcmluZw== 19870 -IGFkanVzdGVk 19871 -c2Vt 19872 -IGZyZW50ZQ== 19873 -IG1heGltaXpl 19874 -IHp3aXNjaGVu 19875 -IHphbQ== 19876 -Y29uc2Npb3Vz 19877 -emVr 19878 -6LCi6LCi 19879 -aGFv 19880 -7LKY65+8 19881 -IEVwaXNvZGU= 19882 -IHZpc2liaWxpdHk= 19883 -IG1pam4= 19884 -IHZpZWxlbg== 19885 -IEJyb3RoZXJz 19886 -15nXkQ== 19887 -IHbDpGxkaWd0 19888 -IGNydXNoZWQ= 19889 -dWZlbg== 19890 -5L2g5YCR 19891 -YWN0aWM= 19892 -IEJlZA== 19893 -IEZB 19894 -aXNzaXBwaQ== 19895 -IHJlbW90 19896 -IHBldHM= 19897 -IHRodW5kZXI= 19898 -IE1hbQ== 19899 -7JW17Luk 19900 -cGFyZW50cw== 19901 -IGLEsQ== 19902 -IHN1cnRvdXQ= 19903 -IHNlZ21lbnRz 19904 -IG5laG1lbg== 19905 -IHV0aWxpeg== 19906 -IFJ1Ynk= 19907 -IHLhu5Np 19908 -IGhhcHBpbHk= 19909 -IGJ1c2g= 19910 -dWx0YW4= 19911 -546p 19912 -2Lg= 19913 -IEhpbA== 19914 -IGxhd24= 19915 -IGV5ZWJyb3dz 19916 -bWV6 19917 -IFN5ZA== 19918 -cmVw 19919 -aW5m 19920 -6aCt 19921 -IG92ZXJoZWFk 19922 -Y3puaWU= 19923 -IG94aWQ= 19924 -IFdvbA== 19925 -IGRlc3Ryb3lpbmc= 19926 -IEFkZGl0aW9uYWxseQ== 19927 -dW1ibGVk 19928 -ZGVw 19929 -IGRlcG9z 19930 -IGNvbW1vZA== 19931 -IGNha2Vz 19932 -IHRhbGVudHM= 19933 -IHBvdXJxdW9p 19934 -IGNvbnRlbXBs 19935 -bmVscw== 19936 -0L7RiQ== 19937 -IEFyYWJpYw== 19938 -IE1hcnlsYW5k 19939 -546L 19940 -b3dv 19941 -IFBsYQ== 19942 -xJ9sdW0= 19943 -IHByb3BoZQ== 19944 -IFJlcHJlc2VudA== 19945 -b3BvbA== 19946 -YWNjb3Jk 19947 -IE1lYW5pbmc= 19948 -IGpvaW50cw== 19949 -IGJyYWtlcw== 19950 -Y2t0 19951 -IDE5OTk= 19952 -IHB1YmxpY2F0aW9u 19953 -IFJldmlldw== 19954 -0L7QudC0 19955 -IG5pY2hl 19956 -IHNpZ25pZmljYQ== 19957 -IGRlYnI= 19958 -IG92ZXJsYXA= 19959 -IGRlbWFuZGluZw== 19960 -IFPDsw== 19961 -IHN1YnNlcXVlbnQ= 19962 -IHF1b3Rlcw== 19963 -IEN1cnJlbnRseQ== 19964 -IHByZXZlbnRpbmc= 19965 -IDEzMA== 19966 -IENlbA== 19967 -b25u 19968 -d25pZcW8 19969 -7JW9 19970 -INC60LDQutC40LU= 19971 -QUNI 19972 -IGd1bQ== 19973 -IElzcmFlbGk= 19974 -7Jy864uI6rmM 19975 -5ag= 19976 -cnVrdA== 19977 -IGNsYXBwaW5n 19978 -IE1hc3NhY2h1c2V0dHM= 19979 -IHJlc2lsaWVuY2U= 19980 -IHN1YnNjcmliaW5n 19981 -IGpld2Vscnk= 19982 -Z2VicmE= 19983 -IGNvcnJlY3Rpb24= 19984 -Ym9v 19985 -2KY= 19986 -bGlv 19987 -c2Ft 19988 -IGVudmVsb3Bl 19989 -a2Fs 19990 -IEZhcm0= 19991 -IGNhdHRsZQ== 19992 -IGJyYXM= 19993 -IHJlcGVudA== 19994 -IHRvbmVz 19995 -b3Npb24= 19996 -cGVjdGlvbg== 19997 -IGRlbmVu 19998 -yJtp 19999 -IE1hcmc= 20000 -IGFjcXVpcmU= 20001 -aWJsaW5ncw== 20002 -IGFzcGly 20003 -IHNpemVk 20004 -IGFsYw== 20005 -IHZpYnJhdGlvbg== 20006 -dGls 20007 -ZW1pbg== 20008 -IGNvcnJlbGF0aW9u 20009 -IHNpbmd1bGFy 20010 -INC/0L7Rj9Cy 20011 -cmVr 20012 -IGNoYXB0ZXJz 20013 -bWJyZQ== 20014 -IGF1ZGl0aW9u 20015 -w6dhcw== 20016 -IHZhbXA= 20017 -IHRlcw== 20018 -INGA0LDQt9Cy 20019 -IHJlc3BlY3RlZA== 20020 -Y2lu 20021 -IGZ1Y2tpbg== 20022 -IMO8YmVyaGF1cHQ= 20023 -INC/0L7QsQ== 20024 -IGFsaWtl 20025 -tog= 20026 -cm9iaQ== 20027 -w650 20028 -IFRvdWNo 20029 -YW56YQ== 20030 -IGZpcm1seQ== 20031 -IEdyZWV0aW5ncw== 20032 -c2NhbGU= 20033 -ZGFk 20034 -0LDQutGC0Lg= 20035 -IGJhY2t5YXJk 20036 -0L7QttC0 20037 -R3I= 20038 -IFNURQ== 20039 -0L7RgNGC 20040 -IGjDpHR0ZQ== 20041 -IEZpcnN0bHk= 20042 -IE9mdGVu 20043 -YXN1cmVz 20044 -IGRyYXdz 20045 -cmVkaXQ= 20046 -QVRF 20047 -UGU= 20048 -Q1A= 20049 -IGNvbXBlbGxpbmc= 20050 -IHN1YnNpZA== 20051 -IG5laWdoYm9yaG9vZHM= 20052 -IGRpcGxvbQ== 20053 -IGVudGVuZGVy 20054 -cGVyaW5n 20055 -YXVn 20056 -Y2hhdA== 20057 -0J3Rgw== 20058 -IERvbGw= 20059 -IOygkA== 20060 -IGhvc2U= 20061 -bmFy 20062 -IHJld2FyZGluZw== 20063 -IFNvbGQ= 20064 -IHRha2k= 20065 -IGJsYWRlcw== 20066 -IEthdGg= 20067 -IGpvZ28= 20068 -IHNlbnNhdGlvbg== 20069 -dWFuYQ== 20070 -cGVs 20071 -IFJlY2VudGx5 20072 -IHBvbHltZXI= 20073 -IFVQ 20074 -LS0t 20075 -IGhvdmVy 20076 -IHJ1bGVk 20077 -5rW3 20078 -INeU15DX 20079 -IGFmZmVjdGlvbg== 20080 -IMSR4buD 20081 -IGJyZWU= 20082 -56eB 20083 -IExheQ== 20084 -IFlvbmc= 20085 -IHJlY2VpdmVy 20086 -nOulvA== 20087 -IGRpc3Nv 20088 -IFFpbmc= 20089 -IMOpdg== 20090 -IG3DunNpY2E= 20091 -IGFlc3RoZXRpYw== 20092 -IEJyZWF0 20093 -IFRB 20094 -IGFjY3VyYXRlbHk= 20095 -P+KAiw== 20096 -IHdhZ2Vz 20097 -cmF3ZMSZ 20098 -IHN3YWxsb3c= 20099 -IGNvbXBsYWludA== 20100 -IGxpZWQ= 20101 -YmVjdWU= 20102 -IHJlbGF4aW5n 20103 -IFBva8OpbW9u 20104 -IHRlY24= 20105 -YmFuZw== 20106 -s7Ts 20107 -IHF1aWVu 20108 -0L3QvtC80YM= 20109 -IGhhYml0YXQ= 20110 -Li4uLi4u 20111 -YWJsaW5n 20112 -INGC0LDQutC40LU= 20113 -IGJlc29uZA== 20114 -IGVtcGxveWVk 20115 -IGFycml2ZXM= 20116 -IHZlc3NlbHM= 20117 -IEF4 20118 -IGRpc3BsYXlz 20119 -MTUw 20120 -b2xvZ2ll 20121 -IOyXkA== 20122 -IGNsbw== 20123 -INC00L7Qsg== 20124 -INCe0LQ= 20125 -IHZ1ZWw= 20126 -6Iqx 20127 -d2VuZA== 20128 -IHNsaXBw 20129 -dXJw 20130 -IExvdA== 20131 -IGJ1bGxldHM= 20132 -IHJhZ2U= 20133 -IHNraXJ0 20134 -aWVudGVz 20135 -IG5o4buvbmc= 20136 -IE5hdHVyYWw= 20137 -IGhpbmQ= 20138 -IHdvcmtsb2Fk 20139 -bXU= 20140 -7YOc 20141 -IHN1bnNldA== 20142 -0LLQvtC7 20143 -cGl0 20144 -5Y2B 20145 -IEFTSA== 20146 -IOu2hOuTpA== 20147 -IGRvd25zdGFpcnM= 20148 -6a0= 20149 -IGNvdW50ZWQ= 20150 -IG5heg== 20151 -15XXpA== 20152 -IFBoaWxpcHBpbmVz 20153 -IDExMA== 20154 -IFBhcmtlcg== 20155 -IGdpdHU= 20156 -IGludGVyZXM= 20157 -IHVtYnJl 20158 -IE5hdHVyZQ== 20159 -IGplcg== 20160 -ZW5vcw== 20161 -IHBhbmVsaXN0cw== 20162 -IGNvYXRpbmc= 20163 -IGNoZXJyeQ== 20164 -IFBlbnQ= 20165 -IE1pc3Q= 20166 -cmVnYXRpb24= 20167 -IHZpbmQ= 20168 -IENvcnBz 20169 -IE1pc3Npb24= 20170 -IG5vYmxl 20171 -IGZvbmN0aW9u 20172 -IHdhcnJpb3I= 20173 -IHByb3Rlc3Rz 20174 -b3VyaQ== 20175 -IGNvbnN0aXR1dGlvbmFs 20176 -xYJhbQ== 20177 -IGVtZXJnZWQ= 20178 -IGR5ZQ== 20179 -IFRyeWluZw== 20180 -aWdt 20181 -5LiA5Liq 20182 -w6lxdQ== 20183 -TE8= 20184 -IFZlcm0= 20185 -ZXJ2aW5n 20186 -IFRJTQ== 20187 -IENp 20188 -IGZyZWV6ZXI= 20189 -IGdydXBv 20190 -IFNwb3J0cw== 20191 -INC/0YDQvtCz 20192 -INmE2Kc= 20193 -b3RoZXJhcA== 20194 -aWZmYW55 20195 -Ymlhbg== 20196 -IHJhbmtlZA== 20197 -IHByb3Bvc2Fscw== 20198 -IMSRw6J5 20199 -IGZyZWV6aW5n 20200 -IGluc2VjdHM= 20201 -dmls 20202 -IGNvbXBvc3Q= 20203 -546w 20204 -IHNlbWFuYQ== 20205 -IGRpc3Rpbmd1aXNo 20206 -IGZhY2lsaXRhdGU= 20207 -IHBsdXNpZXVycw== 20208 -IHZlcmc= 20209 -IGFsZ3Vucw== 20210 -IFRpa1Rvaw== 20211 -IEV4cHJlc3M= 20212 -0LzQtdC90YI= 20213 -U1U= 20214 -IGludGltYXRl 20215 -IEF1dGhvcg== 20216 -IHdpdG5lc3Nlcw== 20217 -IGthbGF1 20218 -IGFyZ3VlZA== 20219 -IGF2b2lkaW5n 20220 -Y3RpdmU= 20221 -IHB1cnN1aW5n 20222 -IHN5bGw= 20223 -w6F2ZWw= 20224 -IEF0bGFudGE= 20225 -IFV0YWg= 20226 -IFRpbGw= 20227 -IGVyZg== 20228 -IDIwMjI= 20229 -w6R0ZXI= 20230 -IGZ1bmVyYWw= 20231 -IEZsYXNo 20232 -IEF0bGFudGlj 20233 -IGdlbGU= 20234 -7KaI 20235 -IG1vcnRnYWdl 20236 -IOuEmA== 20237 -bGljaHQ= 20238 -IGFtYml0aW91cw== 20239 -IEJlaWppbmc= 20240 -IGRpdmluZw== 20241 -IHVuYm94 20242 -aWxsYXM= 20243 -IG90cmFz 20244 -IGV2YWM= 20245 -IG1hcmluZQ== 20246 -INGB0L7Qt9C0 20247 -IENyZWF0ZQ== 20248 -IGdq 20249 -IGZyZXF1ZW5jaWVz 20250 -aW5ndG9u 20251 -IFJvbWFucw== 20252 -IGFpbWluZw== 20253 -IEJ1ZmY= 20254 -IGVtcGVyb3I= 20255 -IE1vaQ== 20256 -IHByb21pc2luZw== 20257 -44Gc 20258 -IGFsZ3VtYQ== 20259 -IHBhc2E= 20260 -IGRpc29yZGVycw== 20261 -U0k= 20262 -IHN1Y2NlZWRlZA== 20263 -IGN1ZXJwbw== 20264 -IHNvZGl1bQ== 20265 -IHN0dWI= 20266 -aGVpcm8= 20267 -IGRlbGF5ZWQ= 20268 -ZXRlcmE= 20269 -dHc= 20270 -IHN5bmM= 20271 -aGQ= 20272 -IHRvdXJpc3Rz 20273 -IHN5c3Q= 20274 -IG3DqXQ= 20275 -IHF1YWxpZnk= 20276 -IE90aGVycw== 20277 -bGxlcnM= 20278 -0LDRgtC10LvRjNC90L4= 20279 -INCe0L3QsA== 20280 -IHBlcmNlaXZl 20281 -IOqygA== 20282 -IOqwgOyepQ== 20283 -INC40YHQug== 20284 -IE1hdHRlcg== 20285 -IEJsdWV0b290aA== 20286 -IHBlYXJs 20287 -IGFyaXNl 20288 -IG1vbnVtZW50 20289 -INC40LzQtdC90L3Qvg== 20290 -YWdp 20291 -2YTZig== 20292 -IHJobw== 20293 -IHNtYXJ0ZXI= 20294 -IGNvbmo= 20295 -0L7QutCw 20296 -IGtlZW4= 20297 -IFRyZWF0 20298 -0LrQu9GO0Yc= 20299 -IHBhY2tldA== 20300 -ZWxzaXVz 20301 -IEFsYWI= 20302 -0LjQvdC4 20303 -IHBzaQ== 20304 -IGVuam95YWJsZQ== 20305 -IEVsbGVu 20306 -INCy0Lw= 20307 -IGVsaW1pbmF0ZWQ= 20308 -IFJvdw== 20309 -IHpvbWJpZQ== 20310 -IEt1 20311 -IHBocmFzZXM= 20312 -IGdyZW4= 20313 -dXRlcg== 20314 -IGRpcmVrdA== 20315 -15Y= 20316 -ZW5lbg== 20317 -dXNh 20318 -INGB0LvQvtCy 20319 -xLA= 20320 -IEdo 20321 -IGNvcnJpZA== 20322 -IHF1ZWVy 20323 -IExpbmRh 20324 -IG9uYQ== 20325 -IG9ibGlnYXRpb24= 20326 -ZGFy 20327 -INi1 20328 -ZW1tZW50 20329 -YWNpZXM= 20330 -IHNjcmV3ZWQ= 20331 -IG5haw== 20332 -IGF5dWQ= 20333 -5LiU 20334 -w6Fy 20335 -bGV6 20336 -IGRyb3du 20337 -IE1lZGljaW5l 20338 -IGxhYnM= 20339 -IGp1c3F1 20340 -IEdvbm5h 20341 -IHRlcnJvcmlzdA== 20342 -cXVlc3Q= 20343 -IGZhcnRoZXI= 20344 -IHJlcGxpZWQ= 20345 -IFNX 20346 -IE1pc3Npc3NpcHBp 20347 -aXNobmE= 20348 -IGhvbGRlcg== 20349 -IHJlaWdu 20350 -IGFjY2VwdGFuY2U= 20351 -IHVs 20352 -tow= 20353 -IEhvdGVs 20354 -IENvb3Blcg== 20355 -dGFu 20356 -IEdyYWI= 20357 -IHZhcG9y 20358 -IGFjdGVk 20359 -IEthbmc= 20360 -ZmFu 20361 -IOydtOyDgQ== 20362 -55Sa6bq8 20363 -dXRldA== 20364 -IHdvcmR0 20365 -IGZhcm1z 20366 -ZGF0 20367 -IGNvdXBsZXM= 20368 -IGJlYWRz 20369 -aWVudG9z 20370 -VGhlbg== 20371 -5L+C 20372 -b3NpdHk= 20373 -IFN0YW5mb3Jk 20374 -Li0= 20375 -V2FpdA== 20376 -IGRhdGFz 20377 -b2lyZQ== 20378 -IGhhc2h0YWc= 20379 -aW1tZQ== 20380 -IGVuY291bnRlcmVk 20381 -IHNob3V0aW5n 20382 -IHJlc2lzdGFudA== 20383 -IFNldW5n 20384 -IHRyYWdpYw== 20385 -IERyYXc= 20386 -LCw= 20387 -IHNob3djYXNl 20388 -IEFG 20389 -IFN0cmk= 20390 -IGJhY2tlZA== 20391 -INGD0LM= 20392 -INCx0YPQtNGD0YI= 20393 -IENvbGU= 20394 -ZXVycw== 20395 -KD8p 20396 -IGVzY2FwZWQ= 20397 -QVNU 20398 -IEFzc2VtYmx5 20399 -IHN0aWNrZXI= 20400 -IG1pZXV4 20401 -IGVudGVydGFpbmluZw== 20402 -IERPTg== 20403 -IEFtZW5k 20404 -IEthcmw= 20405 -IGluaGli 20406 -c3N0 20407 -aWVn 20408 -fn5+ 20409 -IGhvb2tlZA== 20410 -IGxpdGVyYWw= 20411 -IHN1bm55 20412 -c3RlcHM= 20413 -IOuwnOs= 20414 -IE1hcmluZQ== 20415 -IHN1ZQ== 20416 -IHByaXNvbmVycw== 20417 -IEVi 20418 -NTg= 20419 -IGRydW1z 20420 -IGd1aWx0 20421 -YWxn 20422 -IGhhcHBpZXI= 20423 -IENN 20424 -IOyVhOuLiOyVvA== 20425 -INCf0LXRgA== 20426 -0YPQu9GP 20427 -IGtleXdvcmQ= 20428 -IFBhcmNl 20429 -IEZvcmVpZ24= 20430 -IEFtYW5kYQ== 20431 -56We 20432 -IOuqqQ== 20433 -cGxlc3M= 20434 -iKw= 20435 -w7Ntbw== 20436 -IHF1YWxxdWVy 20437 -7J2065286rOg 20438 -IGNvbnNwaXJhY3k= 20439 -IHN0cmF3YmVycnk= 20440 -IGhhdHRlbg== 20441 -RXM= 20442 -IHNwb3M= 20443 -IHZpbGxhZ2Vz 20444 -IGxldg== 20445 -INGB0YDQtdC0 20446 -IHdha2luZw== 20447 -IGNhbGN1bGF0aW9ucw== 20448 -INmF2Lk= 20449 -IHBvdXJpbmc= 20450 -IGxlYmlo 20451 -IHBvbGlzaA== 20452 -IFRvdXQ= 20453 -IGZ1bmt0aW9u 20454 -0LzQvg== 20455 -IFRp 20456 -IHdhc3Rpbmc= 20457 -aXN0aWNhbGx5 20458 -IG1hbmlwdWxhdGU= 20459 -IHNpbXBsaWZ5 20460 -IHRlYW1tYXRlcw== 20461 -INCx0L4= 20462 -IGNvbnRhbQ== 20463 -IFF1aXRl 20464 -IGt1cno= 20465 -IENhbmQ= 20466 -dHlwZQ== 20467 -b3V0aGVhc3Q= 20468 -IGZpbmFuY2lhbGx5 20469 -0L7Qu9C9 20470 -ZWxzb24= 20471 -IGZvcmVoZWFk 20472 -dWFnZQ== 20473 -bmF1ZGlibGU= 20474 -IEJlaGluZA== 20475 -IG5lZ290aWF0aW9ucw== 20476 -IOuniOydjA== 20477 -IGFsdGVybmF0aXZlcw== 20478 -cmFuaw== 20479 -aG9sZGVy 20480 -5oeJ 20481 -IGhlYWxlZA== 20482 -0YLQvtGH 20483 -IFNwZWM= 20484 -5Lu2 20485 -5LuW5YCR 20486 -IGV4aGliaXQ= 20487 -IHNoYWxsb3c= 20488 -IGdvYg== 20489 -IOuc 20490 -IGZydXN0cmF0aW9u 20491 -w61v 20492 -IG1lbHRpbmc= 20493 -IFN0b3Jt 20494 -IHBhdGVudA== 20495 -IEJhcmNlbA== 20496 -IHBlZGVzdA== 20497 -2YjZhQ== 20498 -IHRhaQ== 20499 -IE1vZGU= 20500 -IHdpbA== 20501 -IOuqqOultA== 20502 -IMOpZ2FsZW1lbnQ= 20503 -6YKj6bq8 20504 -INeQ15c= 20505 -YXlhbg== 20506 -IGFtYXplZA== 20507 -7KeA64qU 20508 -IGhhY2llbmRv 20509 -IOydtOyVvA== 20510 -zrvOsQ== 20511 -4LiC 20512 -0LXRgtCw 20513 -IGV4YW1z 20514 -IHRyYXZlbGxpbmc= 20515 -UHJlc3M= 20516 -0LjRgNGD 20517 -IGJhc2VsaW5l 20518 -IGJ1c2Vz 20519 -IHJlaW5mb3I= 20520 -dmVuYW50 20521 -IFRydXRo 20522 -nb0= 20523 -b2Jl 20524 -IHllbGw= 20525 -IHNhdXNhZ2U= 20526 -VEY= 20527 -IEV2aWw= 20528 -IG1laW5lcg== 20529 -15nXpw== 20530 -IGhvcGVmdWw= 20531 -IHLDs3duaWXFvA== 20532 -IFBlcsOy 20533 -dHdv 20534 -bmRlcg== 20535 -INC80LjRgA== 20536 -IGNvbnNjaWVuY2U= 20537 -IFdhcnJlbg== 20538 -aWNreQ== 20539 -IGFpbWVk 20540 -IGfDtnJh 20541 -WFQ= 20542 -IHB5cmFt 20543 -UmVk 20544 -6Zu7 20545 -YXR1 20546 -IEVzdGE= 20547 -IGVhcm5pbmdz 20548 -IGhhdHM= 20549 -IFN0YWR0 20550 -aWNrZXQ= 20551 -cG9pbnRz 20552 -aW5hbmRlcg== 20553 -IG1vdG9yY3ljbGU= 20554 -IOuPjA== 20555 -IO2VtOyVvA== 20556 -a29t 20557 -IERpbmc= 20558 -5pI= 20559 -IHJlY3Vycw== 20560 -IGVzdGltYXRlcw== 20561 -IGRlcm5p 20562 -IHZlcnNjaA== 20563 -44Gd44Gu 20564 -IE1JQw== 20565 -0LjQstCw0YLRjA== 20566 -INC/0YDQvtGI 20567 -IGRvc3Q= 20568 -INCy0YHRgtGA 20569 -IHdpZWw= 20570 -IHNpYmxpbmdz 20571 -INC00LXQsg== 20572 -IGVhcmxpZXN0 20573 -IGZhdGlndWU= 20574 -IG5oaQ== 20575 -IGd1c3Rh 20576 -IGJvbm5l 20577 -5pyA5b6M 20578 -ZnJvbQ== 20579 -IEplbm55 20580 -IHN1cHBvc2VkbHk= 20581 -aW50YWdl 20582 -IGNvdW50aWVz 20583 -IHVucmU= 20584 -IHBsYW50aW5n 20585 -IEdyYWM= 20586 -IEdlbmVzaXM= 20587 -IEFscGhh 20588 -eXN6 20589 -IHRpbGU= 20590 -IOqyveyasA== 20591 -INeZ16k= 20592 -cXVlbA== 20593 -IGRpc3RyaWJ1dGU= 20594 -ZGVm 20595 -w6lyYWw= 20596 -IGNsdXRjaA== 20597 -YWRlbHBo 20598 -IFBsYXlTdGF0aW9u 20599 -hLg= 20600 -IHNq 20601 -YnJlYWtpbmc= 20602 -IOuQmOs= 20603 -IEN1YmE= 20604 -IFJ1c3NpYW5z 20605 -IE1BUks= 20606 -IHBlcnNl 20607 -IHJlc3RyaWN0ZWQ= 20608 -aWdlcw== 20609 -IFRyYXZlbA== 20610 -IGVsZWN0cm9uaWNz 20611 -IHF1YXJ0ZXJz 20612 -IEtlaXRo 20613 -c2l6ZWQ= 20614 -IGRlYWRsaW5l 20615 -YXJlbnRo 20616 -IHbDrWRlb3M= 20617 -IHByb3RvY29scw== 20618 -YW1tZW50 20619 -IFRyYWluaW5n 20620 -IMOi 20621 -IHNlcXVlbA== 20622 -0L3QsNC6 20623 -IGtlaW5lbg== 20624 -IG1hdHRyZXNz 20625 -bHVkaW5n 20626 -IGNsYXNzaWZpZWQ= 20627 -IHJlYWN0b3I= 20628 -IEtvbnQ= 20629 -IHBhc3Nhcg== 20630 -IGhvbm91cg== 20631 -b3JpZw== 20632 -SU5B 20633 -IE5hdGhhbg== 20634 -0LLQsA== 20635 -INGB0LrQsNC30LDRgtGM 20636 -dMSxcg== 20637 -IGV4Y2x1c2l2ZWx5 20638 -IHNoYWRlcw== 20639 -INC/0YDQvtGG 20640 -IG9jY2FzaW9ucw== 20641 -aWph 20642 -55qE5pmC5YCZ 20643 -5Y6y 20644 -5oWi 20645 -Zmln 20646 -IHR1cw== 20647 -IHJlbWVt 20648 -IENocmlzdG9waGVy 20649 -IHNsaW1l 20650 -IGFsZ3VuYQ== 20651 -IEZvcnR1bmF0ZWx5 20652 -IGxvcnM= 20653 -dm9sbA== 20654 -YXZlcg== 20655 -IG91dGxldA== 20656 -IExpbmtlZElu 20657 -IEV4ZWN1dGl2ZQ== 20658 -IG9yZ2Fucw== 20659 -IEJlZ2lu 20660 -IO2ZlA== 20661 -IHRyYW5zcGxhbnQ= 20662 -cmFnZW4= 20663 -Vk8= 20664 -IEbDtnI= 20665 -INio2KfZhA== 20666 -IEFuZHJl 20667 -aXNpbmU= 20668 -IGxhc3Rz 20669 -IGhpc3TDs3JpYQ== 20670 -IGx1eg== 20671 -IGNvbGxhcg== 20672 -IGtpZG5h 20673 -IG9wdGljYWw= 20674 -aW92 20675 -IHRvYg== 20676 -IGV4dGVyaW9y 20677 -IG1ldHJpYw== 20678 -aWV1cg== 20679 -IHRyb2xs 20680 -INGA0L7Qtw== 20681 -5pif 20682 -IHTDtA== 20683 -IOyYiOyB 20684 -IEdlc2V0eg== 20685 -INC10LQ= 20686 -IGRlbm9taW5hdG9y 20687 -7LM= 20688 -IGxldHQ= 20689 -5YWJ 20690 -IGdyw7bDnw== 20691 -6aGY 20692 -IEx1dGhlcg== 20693 -IHJlc3Rl 20694 -IHJlc2VtYg== 20695 -IHBlcm1ldA== 20696 -a3Np 20697 -IGZpc2hlcg== 20698 -44Gf44GE 20699 -IFZvbg== 20700 -7ZS8 20701 -IM+Dz4TOvw== 20702 -IGxvY2tz 20703 -IHNob290cw== 20704 -IGthbXU= 20705 -IEtlcg== 20706 -IE9icw== 20707 -552A 20708 -IGJpbGk= 20709 -IOuwsQ== 20710 -IHRvcnR1cmU= 20711 -YXNzeQ== 20712 -INC40LM= 20713 -IGxhc3Rpbmc= 20714 -5aW955qE 20715 -IHRpZW5lcw== 20716 -IHJlY2VpdmVz 20717 -IE9zY2Fy 20718 -IHJlbWVtYmVyaW5n 20719 -IHByb2JsZW1hcw== 20720 -IGlh 20721 -5Zib 20722 -IG1lbW9yYWJsZQ== 20723 -IGpvdXJz 20724 -IGZhw6dvbg== 20725 -YW1pYw== 20726 -IOu0pA== 20727 -YXRpcXVl 20728 -IOutlOqwgA== 20729 -IHppcA== 20730 -aGFsdA== 20731 -IPCfmA== 20732 -IGZyaWVz 20733 -IGZpbmRlbg== 20734 -Z3Jh 20735 -0YDRg9C0 20736 -aW1wb3J0 20737 -IOuLrOs= 20738 -IGlraQ== 20739 -IGNvbXBsYWluaW5n 20740 -IGZhemVuZG8= 20741 -IGdvb2dsZQ== 20742 -IHRhYnM= 20743 -IOuTpOyWtOw= 20744 -44Km 20745 -dWdv 20746 -aWVydG8= 20747 -YXVmZW4= 20748 -IOuovOyggA== 20749 -IHNrdWxsZQ== 20750 -IHN1aXY= 20751 -IHNweQ== 20752 -IEthaQ== 20753 -6YKj5YCL 20754 -IG1hcnRpYWw= 20755 -IG9uZGVy 20756 -6Kqw 20757 -YXRpbGl0eQ== 20758 -IGlyZ2VuZHdpZQ== 20759 -IGNsYXA= 20760 -aW50ZWxs 20761 -IGluc3RhbGxpbmc= 20762 -IHVuaXF1 20763 -IENlbnRyZQ== 20764 -YXN0cw== 20765 -dWFy 20766 -IHJldmlz 20767 -IHRocmVhdGVuaW5n 20768 -cmFpcw== 20769 -IGN1aWQ= 20770 -c2th 20771 -IHJlc29sdmVk 20772 -IHJpZGVz 20773 -IGZhaWx1cmVz 20774 -IHNlbWI= 20775 -IG1hbGVz 20776 -VUZG 20777 -5b6I5aSa 20778 -IHRyw6pz 20779 -YXBwZWQ= 20780 -IG5ld3NwYXBlcnM= 20781 -cmlldA== 20782 -IGFwcGxhdWRz 20783 -0JM= 20784 -IOOBrw== 20785 -IE5D 20786 -5Y2D 20787 -5pmC6ZaT 20788 -IGhldGVy 20789 -IGhhemFyZA== 20790 -IHJ5 20791 -IHN0cmljdGx5 20792 -IDU0 20793 -IOuTpOyWtOqwgA== 20794 -IHNwb250 20795 -IHRhdHPDpGNobGljaA== 20796 -IOunkOyU 20797 -bGF1Yg== 20798 -IGFic29yYmVk 20799 -YWNhxJ/EsXo= 20800 -IG9udQ== 20801 -INCQ0L0= 20802 -IGV4cGxpY2l0bHk= 20803 -IOyerA== 20804 -IEZ1dHVyZQ== 20805 -YWNodGVu 20806 -w6Bv 20807 -eW9u 20808 -IHNlcmlh 20809 -IEhlcnJlbg== 20810 -Y2Vq 20811 -IEFsYmVydA== 20812 -7J2064qU 20813 -ZWN0b3I= 20814 -IHBhY2tpbmc= 20815 -IHZpcnR1ZQ== 20816 -IHZlbmly 20817 -REQ= 20818 -IHlheg== 20819 -IGxvZ3M= 20820 -IFBob3Rvc2hvcA== 20821 -IHNpZA== 20822 -bGluZ3M= 20823 -IHJlbW90ZWx5 20824 -IERpZmZlcmVudA== 20825 -IG9wZXJhdGVk 20826 -bGlnaHRz 20827 -IGRpc2NyaW1pbg== 20828 -aXN0YW5jZQ== 20829 -IEdSRQ== 20830 -IHBsYWM= 20831 -IHNoaXJ0cw== 20832 -IGp1c3RpZnk= 20833 -IHRyYWJhbGhv 20834 -dXRpbA== 20835 -dm9j 20836 -IHF1YXJ0 20837 -IM6k 20838 -U0M= 20839 -IFNS 20840 -IC0i 20841 -IGhlc2l0YXRl 20842 -IHBhaw== 20843 -6Iez 20844 -Z3Vh 20845 -Sm8= 20846 -IHNvdXZlbnQ= 20847 -IEFuZ2VsYQ== 20848 -ZXNzZWU= 20849 -YWRlbHBoaWE= 20850 -YXJrcw== 20851 -IHdlZWQ= 20852 -IGthbm5zdA== 20853 -5YKZ 20854 -IOq3uOufrOuLiOq5jA== 20855 -IHBsdXTDtHQ= 20856 -IENvbW1hbmRlcg== 20857 -IHN1bW1hcml6ZQ== 20858 -4K+A 20859 -IDk4 20860 -44GH 20861 -IGRldmVsb3BtZW50cw== 20862 -IENvc3Q= 20863 -IHRoZW9yZXRpY2Fs 20864 -IG9yZQ== 20865 -IG1ldGFsbA== 20866 -zr/Phc69 20867 -ZmFocg== 20868 -0JrQkA== 20869 -IGNodWNr 20870 -IGFkYXB0ZWQ= 20871 -IE9rbGFo 20872 -IE5ldGhlcmxhbmRz 20873 -IHBvZXQ= 20874 -c3Rv 20875 -a2F0 20876 -IHdlYXJz 20877 -568= 20878 -IOyWtOuUlA== 20879 -IEVzdG8= 20880 -IGxhdWdoZWQ= 20881 -IGRvbm5lcg== 20882 -IOuNsA== 20883 -IOybkOs= 20884 -b2N1cg== 20885 -IEtpY2s= 20886 -IERldHJvaXQ= 20887 -IGJpY3ljbGU= 20888 -IGxhY2tpbmc= 20889 -cGhhYmV0 20890 -IEtlbmQ= 20891 -QXNz 20892 -IHJldmVhbHM= 20893 -IM6g 20894 -IE5vYWg= 20895 -pqzripQ= 20896 -IHNlbGxz 20897 -IEFsYWJhbWE= 20898 -IHRlcnJpZmlj 20899 -IEVsZW1lbnQ= 20900 -IO2G 20901 -IHR1cmJv 20902 -IEhvbQ== 20903 -IHRoZW9yZW0= 20904 -IGFkdmVudHVyZXM= 20905 -IHB1cmNoYXNpbmc= 20906 -IFTDoQ== 20907 -INC80LDRgg== 20908 -IHZlbW9z 20909 -IGR1dGllcw== 20910 -IHdlbmln 20911 -IGJvb3Ro 20912 -IGVudHJhcg== 20913 -VkE= 20914 -IGdlYXJz 20915 -IEphZQ== 20916 -w6hu 20917 -IGNhbGNpdW0= 20918 -IFJvYmVydHM= 20919 -INC/0YDQvtCx0LvQtdC8 20920 -IHJpYmJvbg== 20921 -INC90LDQt9GL0LI= 20922 -IGxhdg== 20923 -IGludGVydmVudGlvbnM= 20924 -IFVsdHJh 20925 -IG5hbWVseQ== 20926 -IGFkZXF1YXRl 20927 -IHJlY2Fw 20928 -IGRvY2s= 20929 -ZnRpbmc= 20930 -IHZvaQ== 20931 -IGNvbnN1bHRhdGlvbg== 20932 -INGB0LXQvA== 20933 -IHBvZGVt 20934 -IHBvc3Nlc3Npb24= 20935 -IGNsdWVz 20936 -IFJ1c3NlbGw= 20937 -IHJlbmV3YWJsZQ== 20938 -5Y6y5a6z 20939 -INGD0Lc= 20940 -aW5mb3JtYXRpb24= 20941 -aWdnZXJz 20942 -V2l0aA== 20943 -d25v 20944 -IGVsYWJvcmF0ZQ== 20945 -Y3RvcmFs 20946 -IERvdw== 20947 -IHJhbWVu 20948 -5o+Q 20949 -4buV 20950 -IGVyc3Rl 20951 -IFplbA== 20952 -44OX 20953 -IHF1YXNp 20954 -INC90LDQug== 20955 -56eS 20956 -IFN0YXJz 20957 -IHRyaWJhbA== 20958 -IHNlYXRlZA== 20959 -IHdvbA== 20960 -IGNob2w= 20961 -w6Rtw6Q= 20962 -IG91dGJyZWFr 20963 -IGNyZXM= 20964 -IHVuc2VyZXI= 20965 -IO2RnA== 20966 -IHVuZGVyd2F0ZXI= 20967 -IGFzc3VyZQ== 20968 -T09E 20969 -IG5hcHJhd2TEmQ== 20970 -IGVzdGFibGlzaG1lbnQ= 20971 -IGluY29u 20972 -IGRpZmVyZW50ZQ== 20973 -IGV4Y3Vz 20974 -IERpbQ== 20975 -0L7RhQ== 20976 -IExpbmc= 20977 -cm9sb2c= 20978 -IOOBvg== 20979 -IG91dGRvb3Jz 20980 -bmFq 20981 -IGVwaWRlbWlj 20982 -IHVudGVycw== 20983 -IDMwMDA= 20984 -IEdhYnJpZWw= 20985 -IOyXhuuKlA== 20986 -IGVuY2w= 20987 -IE9kZXI= 20988 -IEZvb3Q= 20989 -cGFz 20990 -IFp1aw== 20991 -5ZOh 20992 -IHdvcmtmbG93 20993 -IHVucA== 20994 -IGFsbGlhbmNl 20995 -ZW5zY2hhZnQ= 20996 -IHlvZ3VydA== 20997 -0LjQvdC1 20998 -IGVydQ== 20999 -IGZpeg== 21000 -5LqU 21001 -IGHFnw== 21002 -IGFwcmVuZA== 21003 -IGN1YWxxdWllcg== 21004 -IGNhcnJvdHM= 21005 -xLFuxLFu 21006 -YWZvb2Q= 21007 -IGZsb29ycw== 21008 -IGtleXdvcmRz 21009 -IHNwb3R0ZWQ= 21010 -IGRyYW5r 21011 -IHBhcmFz 21012 -IMO6bHRpbW8= 21013 -IGhhYmxhcg== 21014 -IHByb3NlY3V0 21015 -7JeQ64+E 21016 -6ZaL5aeL 21017 -IMOpcA== 21018 -IHN0aWNrZXJz 21019 -IHB1c2hlcw== 21020 -a2g= 21021 -IHJlc3RhcnQ= 21022 -IFRodW5kZXI= 21023 -4budaQ== 21024 -IG11aXRh 21025 -IGZveA== 21026 -YXJkZcWf 21027 -IFphY2g= 21028 -IE1pbmVjcmFmdA== 21029 -57g= 21030 -ID09PT0= 21031 -IGfDtnJl 21032 -IHN0YW5jZQ== 21033 -aWd1bmc= 21034 -2Y7ZkQ== 21035 -a8Ok 21036 -IHRlYWNoaW5ncw== 21037 -6YY= 21038 -IGRlY2F5 21039 -IHJpYw== 21040 -b21lbmE= 21041 -INCy0YHQtdC8 21042 -Y2h0ZW4= 21043 -IFZlcnQ= 21044 -IO2VnOq1rQ== 21045 -rLTr 21046 -IGNvYw== 21047 -Oik= 21048 -a2VpdGVu 21049 -IEJB 21050 -ZXRoZWxlc3M= 21051 -IGhlYWRxdWFydGVycw== 21052 -IHNwaWtl 21053 -IEJhc2U= 21054 -IDEwMQ== 21055 -IGNvb3JkaW5hdGVz 21056 -IHRhcmQ= 21057 -IGJvaWxlZA== 21058 -IE1vbnN0ZXI= 21059 -IG5vdGVib29r 21060 -IOq0gA== 21061 -IFdha2U= 21062 -IFNldHRpbmc= 21063 -7J207Jc= 21064 -IFN5ZG5leQ== 21065 -IEZpbm4= 21066 -IGxvYmJ5 21067 -5b6e 21068 -IHNlbmlvcnM= 21069 -0L3QuNGF 21070 -YXZhbg== 21071 -IEpF 21072 -IHRyYWZm 21073 -dGhpbms= 21074 -IHNsYXA= 21075 -IENhc3RsZQ== 21076 -qW5n 21077 -IGFsZ3Vub3M= 21078 -IFBlcnNvbmFsbHk= 21079 -IE1hbGU= 21080 -7Yuw 21081 -IEdlbmVyYWxseQ== 21082 -IFBlbA== 21083 -IGRpYXM= 21084 -IGV2b2x2aW5n 21085 -aXRvbA== 21086 -0LLQvtGA 21087 -IHBsZWlu 21088 -IGZsaWdodHM= 21089 -IGVsZXZlbg== 21090 -b3dlag== 21091 -4buRbmc= 21092 -IGFrdQ== 21093 -IGdsYW5jZQ== 21094 -IGNvbm5lY3Rpdml0eQ== 21095 -IGJhbGQ= 21096 -0YvRhw== 21097 -IGludGVzdA== 21098 -w6Fn 21099 -IEdSw5w= 21100 -aWJsaWNhbA== 21101 -IFBhcGE= 21102 -IHBpdHk= 21103 -IGZhaW50 21104 -IHd1cmRlbg== 21105 -IGxlZ2FsbHk= 21106 -IHByZXk= 21107 -IFNjaWVuY2Vz 21108 -INC/0YDQvtGB 21109 -IHRyYWluZXI= 21110 -IHByb2Jsw6htZQ== 21111 -IGtpbG8= 21112 -0LrQvtCz0L4= 21113 -IGJyaWRnZXM= 21114 -ODk= 21115 -IGxhc3RlZA== 21116 -IGVsZWdhbnQ= 21117 -Ym93cw== 21118 -IHBhbGFi 21119 -IGRpcmVjdG9yeQ== 21120 -5LiN5pyD 21121 -IGJ1bGI= 21122 -cGVvcGxl 21123 -SVg= 21124 -IGdlYg== 21125 -IDY2 21126 -IFRlbm5lc3NlZQ== 21127 -YWhsZW4= 21128 -aWV2YWw= 21129 -IGNhdXQ= 21130 -IERhbWVu 21131 -cGxv 21132 -aWFuZQ== 21133 -0LDQu9C1 21134 -YXR0YW4= 21135 -INin2YTYsw== 21136 -IHJpc2t5 21137 -IHNsZWV2ZQ== 21138 -IGluY2lkZW50cw== 21139 -IOuwlQ== 21140 -Q28= 21141 -IGFwcGxpY2FibGU= 21142 -IGltcGVyaWFs 21143 -IFBoaWxpcA== 21144 -IFllYQ== 21145 -0LXRgNC+ 21146 -INC/0L7QutCw0Lc= 21147 -w7xuZQ== 21148 -7JiA 21149 -SHVi 21150 -dG9y 21151 -IHNpZ3U= 21152 -Y2VuZA== 21153 -IHBvbGl0aWNhbGx5 21154 -IOyCtA== 21155 -IHBhcnM= 21156 -IG91dg== 21157 -IHByaW1laXJh 21158 -IFNoYWg= 21159 -IHNhdHVy 21160 -IGNvbWJ1c3Q= 21161 -IHByb21vdGVk 21162 -7KO86w== 21163 -5oCV 21164 -IHRlbXBsYXRlcw== 21165 -IOuLrA== 21166 -IGhhdWw= 21167 -INGC0LXRgA== 21168 -IHNsaWRpbmc= 21169 -Y2VkZW50ZWQ= 21170 -IOOBrg== 21171 -Y2hpbGRyZW4= 21172 -TVI= 21173 -IFdlaQ== 21174 -IGLDtnI= 21175 -5pep 21176 -IHByw7N4aW1v 21177 -YXLDrWE= 21178 -IHNhbXBsaW5n 21179 -0LXQu9C10L0= 21180 -ZXNp 21181 -IERhbmllbGxl 21182 -IE9rbGFob21h 21183 -6IU= 21184 -55WM 21185 -0LXRgdC/ 21186 -IERWRA== 21187 -INCy0YvQvw== 21188 -cm91cw== 21189 -Y29ucw== 21190 -IGVuaGFuY2Vk 21191 -6Zuj 21192 -IHBhc3Rvcg== 21193 -IFN1ZGRlbmx5 21194 -6K6T 21195 -ZmFy 21196 -UEVS 21197 -IE5n 21198 -MTAwMA== 21199 -IGNoZXc= 21200 -IHJ1bW9ycw== 21201 -IEFuYQ== 21202 -IGFubsOpZXM= 21203 -INGD0YHRgg== 21204 -IFBoaWxhZGVscGhpYQ== 21205 -5Zev 21206 -0LXQttC00YM= 21207 -IGVmZmVjdGl2ZW5lc3M= 21208 -6L+Z5qC3 21209 -w6l0w6k= 21210 -IGRpbmc= 21211 -IHJlbGlnaW9ucw== 21212 -IGFnZWQ= 21213 -emllxIc= 21214 -IFJpYw== 21215 -IEthcA== 21216 -IFBhZ2U= 21217 -IHPDvA== 21218 -IG7DpG1saWNo 21219 -IG1hbmtpbmQ= 21220 -IHJlc3Rpbmc= 21221 -IGluZmx1ZW5jZXM= 21222 -IFNjaHVs 21223 -INC90LXQsg== 21224 -IG1hbmE= 21225 -IGNvbnN1bWVk 21226 -IFBvbQ== 21227 -576O5ZyL 21228 -IGNvbnNlZ3Vpcg== 21229 -IFRoYW5rc2dpdmluZw== 21230 -IEhpbmR1 21231 -bGFpcw== 21232 -IHRocml2ZQ== 21233 -IGNvbnRvdXI= 21234 -0LDRhtC40Y8= 21235 -IGZhbGFuZG8= 21236 -IErDoQ== 21237 -emFu 21238 -0LjRgtGD 21239 -aXBoZXI= 21240 -amFtaW4= 21241 -IEhhbGxv 21242 -IDE2MA== 21243 -INC+0YHQvtCx 21244 -IG1ldGU= 21245 -IOyVjOs= 21246 -IEJhcmNlbG9uYQ== 21247 -bGV0dGVy 21248 -INCd0LXRgg== 21249 -5Zk= 21250 -IGFkZW3DoXM= 21251 -IGNvb3JkaW5hdGlvbg== 21252 -dW50cw== 21253 -IHNsb3A= 21254 -INC/0YDQuNC0 21255 -7KeA66eJ 21256 -IHF1ZXN0aW9uaW5n 21257 -IGRpZXNlbA== 21258 -IGRlag== 21259 -IGFmZmlybQ== 21260 -jZTrnbzqs6DsmpQ= 21261 -aWVubmU= 21262 -IGNyYW5r 21263 -IHByZWRpY3Rpb25z 21264 -IHBoeXNp 21265 -Y2hzZWw= 21266 -IGNvbWJpbmF0aW9ucw== 21267 -IGV4Y2VsbGVuY2U= 21268 -6YCZ6bq8 21269 -4bud 21270 -d2lkdGg= 21271 -d2VlZA== 21272 -hOulvA== 21273 -hOuniA== 21274 -IGFsdG8= 21275 -IGRhaXJ5 21276 -IE5vcm1hbA== 21277 -cHBlbg== 21278 -IG9iZW4= 21279 -IGRldmFzdGF0aW5n 21280 -IHBveg== 21281 -IEh1cw== 21282 -bWF6 21283 -IHdhcm5lZA== 21284 -IGRlbms= 21285 -IEF1c3M= 21286 -IHRyYWRlcw== 21287 -aGVsbA== 21288 -IHByaW1lcm8= 21289 -IG1pYQ== 21290 -0LLQsNGA 21291 -2KjZig== 21292 -IGtpY2tz 21293 -IGHEnw== 21294 -IE3DvA== 21295 -IGx1Yw== 21296 -0LXQvdC40LXQvA== 21297 -IFN0YW5kYXJk 21298 -cmljZQ== 21299 -IEN1Yg== 21300 -IGdvdQ== 21301 -IEpvw6Nv 21302 -0YPRgdC6 21303 -IGVucXU= 21304 -o4w= 21305 -Z2V3 21306 -IO2BsA== 21307 -b3dhbmlh 21308 -aWFuaQ== 21309 -IGZha3Q= 21310 -0Y/QvdC4 21311 -IGJlZg== 21312 -IHRodW1ibmE= 21313 -IGNldXg= 21314 -5q2h6L+O 21315 -YXBwbGU= 21316 -TkVO 21317 -IGdhZA== 21318 -YXBvbg== 21319 -IEZhbnRhc3RpYw== 21320 -IGNvbmNlbnRyYXRlZA== 21321 -Z2lybA== 21322 -bGVuZQ== 21323 -INCU0LvRjw== 21324 -IMOpdGE= 21325 -YWFu 21326 -IG91dHRh 21327 -IG5hcmM= 21328 -IEJvZHk= 21329 -YnJ1c2g= 21330 -IGxlZ2lzbGF0aXZl 21331 -IE1lZ2Fu 21332 -IG1pc3Rha2Vu 21333 -IE1pc3NvdXJp 21334 -IGxhYmVsZWQ= 21335 -0LvRj9C10YLRgdGP 21336 -IHJlYWxpc2Vk 21337 -eW9yc3Vu 21338 -44GC44KK44GM44Go44GG 21339 -IFNhZmV0eQ== 21340 -IGFjY2VsZXJhdGU= 21341 -IHNhbmN0aW9ucw== 21342 -IHBlZQ== 21343 -IGp1ZWdv 21344 -IHBlcHBlcnM= 21345 -IHdhbA== 21346 -6riJ 21347 -ZWxsb3c= 21348 -INC20LXQvQ== 21349 -IGNpbmNv 21350 -INGB0LjRgdGC 21351 -Y292ZXJ5 21352 -IGdyYW0= 21353 -IMOpcG8= 21354 -IEJNVw== 21355 -aXZvbA== 21356 -IENoZW0= 21357 -55qE6Kmx 21358 -dXNlbWVudA== 21359 -IFN1cHBvc2U= 21360 -IOqwgOyngOqzoA== 21361 -IG1pbGxlbm4= 21362 -IFR1bg== 21363 -IG1lZGFs 21364 -IGhhY2lh 21365 -IHN0aW11bHVz 21366 -IGJyaWdodG5lc3M= 21367 -YWllbnQ= 21368 -IEhhbmRz 21369 -aW5ldA== 21370 -IGNvYWxpdGlvbg== 21371 -5a24 21372 -IHJpc2Vz 21373 -cmluYQ== 21374 -IHNjb290 21375 -IOOBpw== 21376 -IGRlZmVuZGluZw== 21377 -IGludmVycw== 21378 -IGhpbGxz 21379 -IGZ1bGZpbGxlZA== 21380 -5Yiw5LqG 21381 -bGxpZQ== 21382 -IGFkb2xlcw== 21383 -IENoYXNl 21384 -5Zac5q2h 21385 -IEpK 21386 -IG5ldWVu 21387 -IFRydQ== 21388 -IGluaGVyaXQ= 21389 -IHNpeHR5 21390 -IEV4cA== 21391 -IENsYXk= 21392 -0L7RgdC+0LE= 21393 -YXJuYQ== 21394 -IEltcGVyaWFs 21395 -INGN0YLQsA== 21396 -IHNvY2lhbGx5 21397 -YXR5 21398 -b2R5bmFt 21399 -IHJpYnM= 21400 -b21pYw== 21401 -IFRvbA== 21402 -0L7Qu9C2 21403 -IDE5OTg= 21404 -IGZyYW0= 21405 -IHJhbmtz 21406 -INCx0YPQtNGD 21407 -IENvbG9u 21408 -SHo= 21409 -IGFjY29tbW9kYXRl 21410 -IGV4cGxvZGU= 21411 -7YSw6w== 21412 -SEFFTA== 21413 -IEhhcnQ= 21414 -INC20LjQt9C90Lg= 21415 -5qE= 21416 -IGRlbGljYXRl 21417 -oNeX 21418 -IHRvZnU= 21419 -IGFjaGlldmVtZW50cw== 21420 -IFNvcg== 21421 -IGFncmVlbWVudHM= 21422 -IDU3 21423 -IHRhbXA= 21424 -IGZyYW7Dp2Fpcw== 21425 -IGhlcmJz 21426 -Y29ybg== 21427 -IGtvbms= 21428 -QU5B 21429 -IFFp 21430 -IHByw7Nw 21431 -IHRpZ2Vy 21432 -IOuRmA== 21433 -xINt 21434 -IGFwcHJlbnQ= 21435 -YWhhbg== 21436 -IHJ1bGluZw== 21437 -IHRzcA== 21438 -IHR3aXR0ZXI= 21439 -IHRlZW5hZ2Vy 21440 -YnVz 21441 -IO2S 21442 -IEFtZW5kbWVudA== 21443 -IHRhcHBpbmc= 21444 -IEFQSXM= 21445 -5aC0 21446 -IG1hdGNoZWQ= 21447 -66m0 21448 -V0E= 21449 -IEJlYXV0eQ== 21450 -IGluZXZpdGFibGU= 21451 -IGdhc2Vz 21452 -INm+ 21453 -aGlnaA== 21454 -IE9wdA== 21455 -IHByZWRvbWlu 21456 -z4HPjA== 21457 -IHR1YmVz 21458 -IOyVoA== 21459 -IEFh 21460 -IOaciQ== 21461 -b21ldG93bg== 21462 -IElN 21463 -IGRlc2Fy 21464 -w6RyZW4= 21465 -INC80LDRgQ== 21466 -IE3DtmdsaWNo 21467 -IHJlbnRhbA== 21468 -IO2VqOq7mA== 21469 -IERpYW5h 21470 -IGF1dGlzbQ== 21471 -IFB1ZXJ0bw== 21472 -xLFsZA== 21473 -IGZhbGFu 21474 -IGRyZWFtaW5n 21475 -IGd1dGU= 21476 -INC60LDQvA== 21477 -IHdyZWNr 21478 -IHN0b3J5dGVsbGluZw== 21479 -IExlZ2VuZA== 21480 -IFVrcmFpbg== 21481 -INC/0YDQvtC40YE= 21482 -IFNL 21483 -IO2WiQ== 21484 -IMWbd2k= 21485 -IEJlbGlldmU= 21486 -IG1vc3RyYXI= 21487 -IFRvZGQ= 21488 -IE5pZ2Vy 21489 -aWN0aW5n 21490 -aGFyZA== 21491 -Oi8v 21492 -aXJhYmxl 21493 -aWdhdGlvbg== 21494 -IE1lbWJlcnM= 21495 -IOygnO2SiA== 21496 -IGRpc2NvdXI= 21497 -n70= 21498 -cmlrYQ== 21499 -IERO 21500 -IEZpZg== 21501 -IENhcGl0YWw= 21502 -0YDQvtC8 21503 -IFNhbnM= 21504 -eXVu 21505 -IHBpbG90cw== 21506 -IHRyYXQ= 21507 -IG55dA== 21508 -IOuvvA== 21509 -IGV4cG9uZW50aWFs 21510 -IGVtZXJnZQ== 21511 -IHRyYWplY3Rvcnk= 21512 -INC/0L7Rh9C10LzRgw== 21513 -IHNlYWxlZA== 21514 -YXR0aQ== 21515 -IHdpZGVz 21516 -INC+0LPRgA== 21517 -aWFuY2Vz 21518 -IHdpdG5lc3NlZA== 21519 -T3I= 21520 -b3Np 21521 -IEpvZWw= 21522 -b25hbA== 21523 -6IG9 21524 -IEludGU= 21525 -Y2VkZXM= 21526 -IEdvdHRh 21527 -YW5pdW0= 21528 -IGZlbWFsZXM= 21529 -IExlYmVucw== 21530 -IG1vaXN0dXI= 21531 -IFNpbXBsZQ== 21532 -IERvY2g= 21533 -YXLDoQ== 21534 -IGdlc2VoZW4= 21535 -VVNU 21536 -xqFp 21537 -IGNsYXNzaWZpY2F0aW9u 21538 -IGRpYWdvbmFs 21539 -IHBlcm1ldHQ= 21540 -Y29tcA== 21541 -INin2YTYrQ== 21542 -IE1hbGF5cw== 21543 -IGdlaMO2cnQ= 21544 -IHBvcHBlZA== 21545 -IGNvbnRhY3RlZA== 21546 -INeb15w= 21547 -IDE0MA== 21548 -IGFkYXB0YXRpb24= 21549 -IG1hbnVz 21550 -IHR1cmtleQ== 21551 -IHByZWFjaA== 21552 -YnJpZ2h0 21553 -IGRvd25z 21554 -IHVucHJlY2VkZW50ZWQ= 21555 -IG1pZ2h0eQ== 21556 -IGNhdGVy 21557 -aXR0aQ== 21558 -Z3M= 21559 -IERlcHV0eQ== 21560 -d3JpdGU= 21561 -IEJsZXNz 21562 -w6Fj 21563 -IHN1bW1pdA== 21564 -IOuPvOyalA== 21565 -IHRob3VnaHRmdWw= 21566 -IHNocmVk 21567 -c2luZ2luZw== 21568 -INC70YPRh9GI0LU= 21569 -IHllbg== 21570 -IHZpYnJhbnQ= 21571 -IFdhbHRlcg== 21572 -IGhvc3Rz 21573 -IGFtYnVs 21574 -IGludmFzaW9u 21575 -b2dhbg== 21576 -IHJlYXNvbmluZw== 21577 -IHN1Y2M= 21578 -0LvQtdC60YI= 21579 -IGZhbGE= 21580 -IGtpbmdz 21581 -IGdvaW4= 21582 -IGNhbGli 21583 -IEdSw5xORU4= 21584 -b3Rlcg== 21585 -IGVpbno= 21586 -IGluc3VsaW4= 21587 -iqg= 21588 -IHNjYWxpbmc= 21589 -IENvcm4= 21590 -aHlk 21591 -IG1hdHRl 21592 -UEw= 21593 -IGFsaWVucw== 21594 -IFNlZw== 21595 -6K+d 21596 -ZXN0aQ== 21597 -YXN0aWNz 21598 -IHdhcm1lcg== 21599 -IGluZ2Vu 21600 -IE1M 21601 -IHJvZGU= 21602 -IEV5ZQ== 21603 -YmVpdHM= 21604 -IEJhcm4= 21605 -wrss 21606 -IENodWNr 21607 -IHByb2ZpdGFibGU= 21608 -dWd1ZXNl 21609 -IEFyYWJpYQ== 21610 -IGNvY28= 21611 -IHB1ZWRv 21612 -IGluZmxhbW1hdGlvbg== 21613 -Y2xpcA== 21614 -IHRhYmxlc3Bvb25z 21615 -IOygkQ== 21616 -IFN3ZWQ= 21617 -IGFuYXQ= 21618 -7Iig 21619 -IGFycmli 21620 -IGRhbmNlcg== 21621 -IENhcnRlcg== 21622 -IG1hZ25pZmlj 21623 -c3RvcmU= 21624 -6YG4 21625 -IGZhZGU= 21626 -IGFjY29tcGFueQ== 21627 -IHdhaHI= 21628 -IHllYXN0 21629 -IG1pbmVyYWw= 21630 -IGxlZ2lzbGF0dXJl 21631 -5L2P 21632 -aXJvcw== 21633 -IGNyb3dkZWQ= 21634 -0YDQsNGI 21635 -b2NhZG8= 21636 -7Ja07JW8 21637 -IO2bhA== 21638 -IEJhcnJ5 21639 -bWFzdGVy 21640 -IG5pY2tuYW1l 21641 -ICIuLi4= 21642 -IFJz 21643 -IE1vb3Jl 21644 -IHZlbnVl 21645 -INCx0YM= 21646 -44Oh 21647 -bGlob29k 21648 -IEFnZW5jeQ== 21649 -0LvQvtCy 21650 -IGthaA== 21651 -IOyGjOumrA== 21652 -IG1hcnNo 21653 -IGluY29ycG9yYXRlZA== 21654 -YW50d29ydA== 21655 -IGtpbWNoaQ== 21656 -IHdvbw== 21657 -IGRpc3RyYWN0ZWQ= 21658 -ZXJpZXM= 21659 -IGluZm9ybWFjacOzbg== 21660 -IENob29zZQ== 21661 -IEphZGk= 21662 -IGFuYWxvZ3k= 21663 -c2F5 21664 -dWZmbGU= 21665 -Ym9r 21666 -IGFjaWRz 21667 -IGFjcXVpc2l0aW9u 21668 -IHZhcmlhbnRz 21669 -6LW35L6G 21670 -IHBhc3NpZXJ0 21671 -7J2064KY 21672 -cnVjdGl2ZQ== 21673 -YnJpZw== 21674 -IOOAjA== 21675 -ZXBoZXI= 21676 -IHBI 21677 -dXRsaWNo 21678 -5beu 21679 -IHJlbGll 21680 -dWl0ZQ== 21681 -IHJlY2VwdGlvbg== 21682 -IGNvaA== 21683 -IFByZXA= 21684 -IGFudGljaXBhdGU= 21685 -5oCn 21686 -a2Vl 21687 -IGRlc2lnbmF0ZWQ= 21688 -0Y/RgtC4 21689 -IEtvcg== 21690 -IEFuaW0= 21691 -w7xobA== 21692 -IFdoaXQ= 21693 -IHVuY292ZXI= 21694 -IE1heWE= 21695 -INGC0L7Qs9C00LA= 21696 -sJU= 21697 -dXRlbmFudA== 21698 -IOyWvOs= 21699 -IGZvcmVzdHM= 21700 -IG1lbWU= 21701 -IGRpc3Rpbmd1aXNoZWQ= 21702 -IE1hcng= 21703 -IExpb24= 21704 -IHNlcnZhbnRz 21705 -IERpYW0= 21706 -55W254S2 21707 -IFBvbGljeQ== 21708 -jbw= 21709 -IHRyaWdnZXJlZA== 21710 -YWJpbGly 21711 -IOydkQ== 21712 -IG5lZ290aWF0ZQ== 21713 -IGZleg== 21714 -IGVydw== 21715 -IHZhcmllcw== 21716 -IGplbWFuZA== 21717 -IGRpc2NoYXJnZQ== 21718 -0YHRj9GH 21719 -IFBBUg== 21720 -IEFmZmFpcnM= 21721 -IHZvdGVy 21722 -IGF0ZW4= 21723 -IGNyb2lz 21724 -b2JpbA== 21725 -IE9vcHM= 21726 -IEFyYw== 21727 -IEhlYXRoZXI= 21728 -YW5rYQ== 21729 -IHNpbXBsZXM= 21730 -zr/OvQ== 21731 -Ij4= 21732 -IGNob3Jkcw== 21733 -IFNhbmRlcnM= 21734 -IOu2hOs= 21735 -QmVu 21736 -IGRhcsO8YmVy 21737 -aWxpYW5z 21738 -IG9yZGVyaW5n 21739 -IE1hbmg= 21740 -IGtpbG9ncmFt 21741 -IGthcsWf 21742 -IGdyYXNw 21743 -IGdob3N0cw== 21744 -YWxlbg== 21745 -IEplZGk= 21746 -INCx0LvQuA== 21747 -IGRvd25sb2FkZWQ= 21748 -IGNvbmR1Y3Rpbmc= 21749 -IEhhaw== 21750 -IHJlc2VhcmNoZXI= 21751 -aWxhbg== 21752 -Z29vZA== 21753 -IEhhbm5haA== 21754 -IGTDvMWfw7xu 21755 -IE1lc3NpYWg= 21756 -dWl0eQ== 21757 -aW9uYQ== 21758 -IHByb2JhYmxl 21759 -IFlF 21760 -IGluZGVwZW5kZW50bHk= 21761 -IGJ1ZmZlcg== 21762 -YnVybg== 21763 -b3VyZA== 21764 -IE1jSw== 21765 -IGxpbmd1 21766 -dWplbXk= 21767 -0LXRgNGC 21768 -IGludHVpdGl2ZQ== 21769 -IGNyYWNrcw== 21770 -YXBwcm9wcmk= 21771 -bnR5 21772 -IGdlZW4= 21773 -IGxlbmQ= 21774 -IGNlcnRpZmljYXRpb24= 21775 -SURT 21776 -dW50ZXI= 21777 -cGVlcw== 21778 -IHRydW1w 21779 -IGJhbmtydXB0 21780 -IGZlYXM= 21781 -6Jc= 21782 -IGR1xbw= 21783 -5riF 21784 -IHZpcnVzZXM= 21785 -IDU4 21786 -Z29k 21787 -INC20LXQuw== 21788 -IHN0YWxr 21789 -SW5k 21790 -YWNoaQ== 21791 -IENG 21792 -IENvbmQ= 21793 -IHNhbmN0 21794 -IGNvbnRlbg== 21795 -IGZyZWVk 21796 -IFJU 21797 -IG1lbnRvcnM= 21798 -7KGx 21799 -IHBvcnRhYmxl 21800 -IFBhdWxv 21801 -cmFuZQ== 21802 -SEFIQQ== 21803 -IFNlY3Rpb24= 21804 -54Y= 21805 -aHl1bg== 21806 -IM6tz4c= 21807 -IFB1Yg== 21808 -IEluZGVwZW5k 21809 -IGNvbXBvdW5kcw== 21810 -INGB0Ys= 21811 -IG1lc3NhZ2luZw== 21812 -IGRlZGljYXRpb24= 21813 -IG5vdGljaW5n 21814 -IGRldm90ZWQ= 21815 -0Y7RgtGB0Y8= 21816 -IHNuYWtlcw== 21817 -IGJhdHRsZWZpZWxk 21818 -cGVycw== 21819 -IGRlbGE= 21820 -OTI= 21821 -IGhhaQ== 21822 -aWxsw6Q= 21823 -w6lyZXI= 21824 -ZXZlcnk= 21825 -IHJlc3BvbnNpdmU= 21826 -15nXlQ== 21827 -b3Bm 21828 -6Yk= 21829 -irg= 21830 -QmVjYXVzZQ== 21831 -IHRvdXJpc20= 21832 -IOq3uOqyjA== 21833 -15XXpg== 21834 -IGNhbnM= 21835 -c3TDvHQ= 21836 -IGRvbm5l 21837 -IERpb3M= 21838 -IFViZXI= 21839 -YWN0b3J5 21840 -IG9yaWVudGVk 21841 -IEhlcm0= 21842 -IHBhdHJvbg== 21843 -dXJm 21844 -YmVp 21845 -IHByb2dyYW1h 21846 -IE9oaA== 21847 -Z2VuZXI= 21848 -IGZpc3Q= 21849 -IFdlbmR5 21850 -IGFuZGE= 21851 -IGd1ZXNzZWQ= 21852 -IGZyZWFr 21853 -5Lit5ZyL 21854 -IEtpbmdz 21855 -Y2hvb2w= 21856 -IG9mZmxpbmU= 21857 -IEluZGlhbmE= 21858 -IEFsbGlhbmNl 21859 -IDUz 21860 -IHBhcnRpY3Vs 21861 -IEZvY3Vz 21862 -IGluaGFiaXQ= 21863 -IOqwmeydgOuNsA== 21864 -IE1jRw== 21865 -b3dza2k= 21866 -IOydtOqxtA== 21867 -IHBhxYRzdA== 21868 -0L7QvdC4 21869 -aXR0YQ== 21870 -IGNvbmZpcm1hdGlvbg== 21871 -IEJyb29rbHlu 21872 -IG5vb2RsZQ== 21873 -ZnVuZA== 21874 -aXR1ZA== 21875 -IGdyYW5kcGFyZW50cw== 21876 -IGJhcmJlY3Vl 21877 -zrXOuc+C 21878 -IOE= 21879 -IGJhbGxvdA== 21880 -IFZldGVy 21881 -IHBpcGVz 21882 -aWdpb3Vz 21883 -IEdyYXBo 21884 -ZXN0ZWQ= 21885 -IOu4jOs= 21886 -IEtF 21887 -44Gh44KH44Gj44Go 21888 -IGVpbnM= 21889 -IGhhdHJlZA== 21890 -44GR44Gp 21891 -IGRhbmc= 21892 -ZWVlZQ== 21893 -IGFyY2hhZQ== 21894 -IEplc3Nl 21895 -IGRldGVjdGVk 21896 -IHNlbmk= 21897 -YnVyZ2g= 21898 -IGRpc3BsYWNlbWVudA== 21899 -IGRvcA== 21900 -IGNvbmRpdGlvbmluZw== 21901 -INC90LXRgdC60L7Qu9GM0LrQvg== 21902 -IGRpc3R1cmJpbmc= 21903 -UEg= 21904 -IHRoaW5uZXI= 21905 -IHdvdW5kZWQ= 21906 -IEN1YW5kbw== 21907 -IGN1c2hpb24= 21908 -IHdoaXRlcw== 21909 -IHByZWZlcmVuY2Vz 21910 -IOykgOu5hA== 21911 -IGthxbw= 21912 -IEdhdGU= 21913 -IFBhdGg= 21914 -ZGxlcw== 21915 -4LiE4Lij 21916 -aW1vcmU= 21917 -IOuztOyXrA== 21918 -IGRpc2NpcGxpbmVz 21919 -4buP 21920 -IG1lc21h 21921 -IOyDiOs= 21922 -IOyLrA== 21923 -IGdpbmc= 21924 -IHVtYnJlbGxh 21925 -SUdIVA== 21926 -IHBlbnNpb24= 21927 -IGNvbWJpbmluZw== 21928 -U1M= 21929 -IHJlY3RhbmdsZQ== 21930 -4buHdA== 21931 -IHByb3hpbQ== 21932 -IENvdw== 21933 -uIw= 21934 -IGludGVudGlvbmFs 21935 -5pWZ 21936 -IGRlY2lk 21937 -INGB0LrQsNC2 21938 -IFVtYQ== 21939 -aWFzbQ== 21940 -YnV6 21941 -IGRlYnJpcw== 21942 -IGNhc3M= 21943 -IFByb3A= 21944 -aXNrYQ== 21945 -66Cl 21946 -ZXN0ZXJvbA== 21947 -dXNzaWFu 21948 -7J20656R 21949 -IHVubGltaXRlZA== 21950 -IGFkbWlyZQ== 21951 -IHRpZ2h0bHk= 21952 -IGdlbm9tZQ== 21953 -IEp1bmlvcg== 21954 -dmVuaXI= 21955 -Z3Vz 21956 -IGPEgw== 21957 -IFZsYWQ= 21958 -IO2C 21959 -IHJlbGF0aXY= 21960 -aW5jaQ== 21961 -IGF1bnF1ZQ== 21962 -IEJveXM= 21963 -0YbQuNC+0L0= 21964 -IFN3aXNz 21965 -IHBoeXNpY2lhbnM= 21966 -IO2PiQ== 21967 -IFBFVA== 21968 -IHdvdW5kcw== 21969 -YWJvdXQ= 21970 -w6Bp 21971 -b256 21972 -dXJpdGllcw== 21973 -INGD0LLQuNC0 21974 -5bem 21975 -IG1lbnRhbGl0eQ== 21976 -IHZhcmlhbmNl 21977 -IHNlZ3VuZGE= 21978 -IHZvbGNhbm8= 21979 -YWxpZQ== 21980 -4KWH 21981 -IHRpbGVz 21982 -IFRlcnJ5 21983 -INin2YTZhNmH 21984 -IGNhbm9u 21985 -IHNjYXR0ZXJlZA== 21986 -cHRvbg== 21987 -IGRlZmluaXRpb25z 21988 -IGFsZ2VicmE= 21989 -b3Rlbg== 21990 -YWJsbw== 21991 -aWp1YW5h 21992 -IHdyYXBwaW5n 21993 -IHNlc2FtZQ== 21994 -INC90LDRh9C40L3QsA== 21995 -IEFsZg== 21996 -INCg0L7RgdGB 21997 -b3Jubw== 21998 -IGFua2xl 21999 -IHNwZWNpYWx0eQ== 22000 -IGF0dGVtcHRpbmc= 22001 -aWxpYXRpb24= 22002 -IDE5MjA= 22003 -IHBoZW5vbWVuYQ== 22004 -IFByb2R1Y3Q= 22005 -IEJ1Y2s= 22006 -IEF3dw== 22007 -c2Vlbg== 22008 -IHZvaWQ= 22009 -IEZyYW5rbGlu 22010 -IGFkdm9jYWN5 22011 -IFNlcA== 22012 -IGNvb2xlc3Q= 22013 -INGB0YDQsNC30YM= 22014 -IFF1YW5k 22015 -IDkwMA== 22016 -IFRyYWQ= 22017 -ZGllcw== 22018 -IGhhc2g= 22019 -5oiR5bCx 22020 -5Lmf5piv 22021 -IHBvdHM= 22022 -IHNhZGx5 22023 -IHZpYWJsZQ== 22024 -IFRpZ2Vy 22025 -IE9ORQ== 22026 -IG5ldXJvbnM= 22027 -b3dhbmll 22028 -xJc= 22029 -IFNoYXI= 22030 -IExhbmRlcw== 22031 -IGNvbmZlcmVuY2Vz 22032 -6Kmy 22033 -IGNyZWRlbnRpYWw= 22034 -IGxpbWU= 22035 -aW5lZQ== 22036 -eGl0 22037 -cGF5 22038 -IGluY29ucw== 22039 -ID4+Og== 22040 -6KqN 22041 -IO2emOs= 22042 -IGxlc3Nlcg== 22043 -IHNwaWxs 22044 -IHByZW1pc2U= 22045 -IDM2NQ== 22046 -IEhvc3Q= 22047 -IHRvbWFy 22048 -15DXnA== 22049 -67KI 22050 -IFdoYXRz 22051 -IGxpZ2h0d2VpZ2h0 22052 -IE1hcA== 22053 -Zmlh 22054 -ZWxsc2NoYWZ0 22055 -IHZlbmRvcnM= 22056 -dWVzdG8= 22057 -IE1pc3Rlcg== 22058 -INCf0YDQuA== 22059 -5Y+z 22060 -aG1h 22061 -IGludGVudGlvbmFsbHk= 22062 -IFRhbmc= 22063 -6Zeu 22064 -IGlkZW50aWZpY2F0aW9u 22065 -IGV0Y2V0ZXJh 22066 -IE5lZQ== 22067 -INGC0YDQuA== 22068 -6re4 22069 -IGNyeXB0b2N1cg== 22070 -IGluaGFsZQ== 22071 -IGFkZGljdA== 22072 -5ZCE5L2N 22073 -IG1hdQ== 22074 -INGC0LDQutCw0Y8= 22075 -IOuyhA== 22076 -IGNvbXByYXI= 22077 -aWVkemllxIc= 22078 -INC+0YLQvdC+ 22079 -IGJlZ2lubmVy 22080 -INC80YPQtg== 22081 -IG9ic2M= 22082 -IGxpbWl0aW5n 22083 -YXNjdWxhcg== 22084 -IGluc3BlY3Rpb24= 22085 -YWNp 22086 -IHJlam8= 22087 -TXVz 22088 -IHphdGVu 22089 -IHN6Y3o= 22090 -IE1hZHJpZA== 22091 -IHZhcmlldGllcw== 22092 -IGVzdMOg 22093 -IFNoYWtlcw== 22094 -IGtpdHM= 22095 -IGFkbWluaXN0ZXI= 22096 -IGxhdmE= 22097 -IGfDpQ== 22098 -6Kmm 22099 -16rXmQ== 22100 -IFdheW5l 22101 -IGluc3RhZ3JhbQ== 22102 -IHJhdGVk 22103 -cGFwZXI= 22104 -IGJpbGQ= 22105 -IHByZXRlbmRpbmc= 22106 -IG9ic2VydmluZw== 22107 -INGB0LDQvNC+0Lw= 22108 -IHRyb3I= 22109 -IG9yZ2FuaXNtcw== 22110 -IGZhbHRh 22111 -IGhvbWV0b3du 22112 -57E= 22113 -IO2L 22114 -IGNoZWc= 22115 -IOyh 22116 -IGNvbW1h 22117 -aXPDqQ== 22118 -IGxpa2VsaWhvb2Q= 22119 -YXZvcmVk 22120 -IGdlbGRp 22121 -0L3QuNC60L7Qsg== 22122 -IG1lZGlv 22123 -IGpha2ll 22124 -IEp1cA== 22125 -IGdyZWVuaG91c2U= 22126 -IHNwaXQ= 22127 -0LrQvtC1 22128 -INC60LDQtg== 22129 -IEdyYW0= 22130 -IENvbmZlcmVuY2U= 22131 -IGRlZmljaXQ= 22132 -c8Sxbg== 22133 -aW5zZQ== 22134 -dcSf 22135 -IHJpY2h0 22136 -IGNvaW5jaWRlbmNl 22137 -5Y+N 22138 -IGV1cm9w 22139 -IGJ1dHRlcmZseQ== 22140 -cHJlYWQ= 22141 -IOyWvA== 22142 -6IC2 22143 -IHdhdmVs 22144 -IEluZmlu 22145 -IFBsYW5ldA== 22146 -IHNlbGZpZQ== 22147 -aWVudHJhcw== 22148 -IGFycm9n 22149 -b3Nlcg== 22150 -aWRhbA== 22151 -oNeX16DXlQ== 22152 -w7x0w7xu 22153 -IGZyZXNobWFu 22154 -IE1hY2hpbmU= 22155 -z4PPhA== 22156 -IERpYQ== 22157 -7J2064uk 22158 -44GT44GG 22159 -bmVh 22160 -IGxpc3Rpbmc= 22161 -IGNvbmZpZ3VyZQ== 22162 -dXRvcg== 22163 -VXA= 22164 -dHNjaGFmdA== 22165 -cmnDqHJl 22166 -IHVwd2FyZHM= 22167 -INGF0L7Rh9GD 22168 -IHN3ZWVw 22169 -QnI= 22170 -IGV4cHJlc3Npbmc= 22171 -IHVuaGFwcHk= 22172 -IG1hbmRhdG9yeQ== 22173 -Z2VuZGVy 22174 -IEHDrQ== 22175 -IGluZGljYXRvcnM= 22176 -IG9pbHM= 22177 -bm90ZQ== 22178 -IHNlZ3Vy 22179 -0L7QttC10YI= 22180 -eW5hc3R5 22181 -IGRpc3RhbmNlcw== 22182 -IG1lcmdl 22183 -QkVSVA== 22184 -IHN1cnJlbmRlcg== 22185 -IGJ1YXQ= 22186 -IEF3YXJkcw== 22187 -IHNlw7Fvcg== 22188 -b2RveA== 22189 -IGZsYXZvdXI= 22190 -IGFiZG9t 22191 -IGNvbmZpZ3Vy 22192 -ODY= 22193 -IERJWQ== 22194 -IHJpZ2lk 22195 -sJg= 22196 -IGNvcnBvcmF0aW9u 22197 -IGdyb29t 22198 -amF3 22199 -IE5lYXI= 22200 -0LjQu9C+ 22201 -IG9wZXJh 22202 -IElubm92 22203 -0LjRgNCw 22204 -k7E= 22205 -IHNwZWNpZmllZA== 22206 -IGNvc20= 22207 -IEZyZWVkb20= 22208 -IGNsb3du 22209 -IE5lbQ== 22210 -INCy0L7Quw== 22211 -0ZHQvQ== 22212 -IGNoYXJnZXI= 22213 -4LmB4Lil 22214 -IGluZmx1ZW50aWFs 22215 -w6RzaWRlbnQ= 22216 -6aQ= 22217 -IOyEoOs= 22218 -IHZvbHVtZXM= 22219 -5pA= 22220 -IG91dHJhcw== 22221 -IFR3aXRjaA== 22222 -IGZvdW5kaW5n 22223 -IGF3aGlsZQ== 22224 -IGNvaWw= 22225 -6rCZ 22226 -IGPhuqM= 22227 -IFRocm93 22228 -IEhlbmNl 22229 -b21tdA== 22230 -IEJlbmphbWlu 22231 -0LPQu9GP0LQ= 22232 -VGltZQ== 22233 -b2JpYw== 22234 -IG1vdXI= 22235 -IGRyZWFk 22236 -IEzDoA== 22237 -IENoaWxl 22238 -IHByZXZhbA== 22239 -IHZhaW4= 22240 -IGFydMSxaw== 22241 -IHByZXNlcnZlZA== 22242 -INC+0YLQtA== 22243 -IHdhcmVob3VzZQ== 22244 -IGJlc3Rl 22245 -IFNldmVyYWw= 22246 -IFNpdHVhdGlvbg== 22247 -IGNhcmRib2FyZA== 22248 -VG9k 22249 -ZXJuYQ== 22250 -IGdhcmFudA== 22251 -IGdlc3R1cmU= 22252 -IGhlbg== 22253 -IHNwZWxsaW5n 22254 -b3NleHVhbA== 22255 -IGFubmU= 22256 -IG1pY2U= 22257 -IE1laW5l 22258 -Y2FyZA== 22259 -IHJlYmVsbA== 22260 -IGNlcnRv 22261 -IOycoOs= 22262 -IHZlcnNjaGllZA== 22263 -IEJvcw== 22264 -IGludmVudGlvbg== 22265 -IHRyemU= 22266 -IG1hbmnDqHJl 22267 -IENoYWQ= 22268 -IHNwcmU= 22269 -IG9yZ2FuaXNhdGlvbnM= 22270 -IHBvb3JseQ== 22271 -IGFudGVyaW9y 22272 -IHN0YWly 22273 -0LrRgA== 22274 -IGF0b21pYw== 22275 -IHN5bXBhdGg= 22276 -IGNvbnRpbnVhbGx5 22277 -IGtsZWluZQ== 22278 -w6h0ZQ== 22279 -0LjRiQ== 22280 -zr/Pgg== 22281 -cGV1dA== 22282 -IHJlcG9zaXQ= 22283 -IGVudHJh 22284 -RW0= 22285 -IGZpbmFuY2luZw== 22286 -INC80L3QvtCz 22287 -IHRoZXNpcw== 22288 -IENvbXB1dGVy 22289 -ZWF1 22290 -IFRyZWU= 22291 -IGJyaWRl 22292 -b25zaWV1cg== 22293 -c2hpcmU= 22294 -d2lj 22295 -REU= 22296 -IOyImOs= 22297 -IGFjb20= 22298 -IFBP 22299 -ZXJzY2g= 22300 -INC/0L7QvNC+0Yk= 22301 -IEFybWVu 22302 -IOyjvQ== 22303 -IHpvcg== 22304 -IHByaW50cw== 22305 -IERhc3M= 22306 -5riv 22307 -IGR1cmFibGU= 22308 -IFRyYW5zcG9ydA== 22309 -7J6Q6rCA 22310 -INC70LXQsw== 22311 -IGTDqXQ= 22312 -w7RsZQ== 22313 -YW1vdXM= 22314 -WU4= 22315 -IGNsaWZm 22316 -IGdyYW1tYXI= 22317 -INCf0L7RjdGC0L7QvNGD 22318 -IGzDoG0= 22319 -ZXNjaA== 22320 -IG1pc2VyYWJsZQ== 22321 -IHZvbHRz 22322 -IENhZA== 22323 -dWthbg== 22324 -0YLQuNCy 22325 -cnVzdA== 22326 -IOyYrOudvA== 22327 -IHZlcms= 22328 -IGNoaWNrZW5z 22329 -IFlvbw== 22330 -IG91dGZpdHM= 22331 -Y29kZQ== 22332 -IGhpZXJhcmNoeQ== 22333 -bmV0ZXM= 22334 -IGNvdW50ZXJwYXJ0 22335 -IHTDtGk= 22336 -IHRlZA== 22337 -IEJhcnQ= 22338 -IOudvA== 22339 -IEdlbmF1 22340 -IGluY29taW5n 22341 -IEFCQw== 22342 -cmlxdWU= 22343 -INC+0YLQvw== 22344 -cXVhbA== 22345 -IGluY2VudGl2ZQ== 22346 -IGlocmVu 22347 -16DXmQ== 22348 -bG9l 22349 -IDE5MzA= 22350 -IGJhcmc= 22351 -IGRpY3Rpb24= 22352 -IMO2bmNl 22353 -SU5T 22354 -IHJlaA== 22355 -aXNpYWo= 22356 -bW91dGg= 22357 -IHNjb3Jpbmc= 22358 -bMSxaw== 22359 -IOyVhOyjvA== 22360 -T1JJQQ== 22361 -IEVzdGFkb3M= 22362 -IGNvbXBhbmlvbg== 22363 -IGFzc2VtYmxl 22364 -IHB1bmlzaGVk 22365 -IGl0YWw= 22366 -IHByZXZlbnRz 22367 -aXN0ZXM= 22368 -IEtlbnR1Y2t5 22369 -IGxvY2F0ZQ== 22370 -IGZhc3Rpbmc= 22371 -44Go5oCd 22372 -g4A= 22373 -IFNlYg== 22374 -IENyb3du 22375 -b3BpYQ== 22376 -IHdoaXA= 22377 -dXN6 22378 -0LrQsNC80Lg= 22379 -IGRhdGFiYXNlcw== 22380 -5a2X 22381 -IHByb3NlYw== 22382 -IDE5OTc= 22383 -IOyCtOynnQ== 22384 -IFNvbGFy 22385 -IFB1ZXM= 22386 -IFplbg== 22387 -b2xsbw== 22388 -IEd1cnU= 22389 -IHNxdWVleg== 22390 -INCX0LA= 22391 -IMSN 22392 -Y2VwdGlvbnM= 22393 -Y2Nh 22394 -aXphYmxl 22395 -bWFuZA== 22396 -IGJyZWFrdGhyb3VnaA== 22397 -IHRhYmxlc3Bvb24= 22398 -IFNFQw== 22399 -aWto 22400 -IFPDo28= 22401 -INC/0LvQvg== 22402 -YW1lbg== 22403 -IHByYWM= 22404 -IGRhcmxpbmc= 22405 -IHRhbGxlcg== 22406 -IHJlbmRlcmluZw== 22407 -IOyasOumrOqwgA== 22408 -IM+EzrfPgg== 22409 -IG3Dow== 22410 -IGVzb3M= 22411 -dWVyZG8= 22412 -INGB0YfQuNGC 22413 -YWxsZXI= 22414 -7JeI7Ja07JqU 22415 -IG1pbGxvbmVz 22416 -bGVyaW4= 22417 -IHBlZ2Fy 22418 -b25uZQ== 22419 -IGVucm9sbG1lbnQ= 22420 -IGxpZWd0 22421 -IGJvYQ== 22422 -d2nEmQ== 22423 -YnNw 22424 -IGN5Y2xpbmc= 22425 -IEJlcm5pZQ== 22426 -IDE5ODk= 22427 -INC00LDQu9GM 22428 -IERha290YQ== 22429 -INGB0LLRj9C3 22430 -IENQ 22431 -IHN0YXJl 22432 -7YKk 22433 -IHByb3NwZXJpdHk= 22434 -IGFycmFuZ2VtZW50cw== 22435 -IGFycml2aW5n 22436 -bcOk 22437 -IGtheWFr 22438 -aXB0 22439 -IHBhcmRvbg== 22440 -IHJlbGF0 22441 -IHZlcnN0ZQ== 22442 -IEZpZw== 22443 -IGZvaWw= 22444 -IFRhbGtpbmc= 22445 -cGVhcmU= 22446 -IG5vaQ== 22447 -INC/0YDQuNGI 22448 -IGhvY2tleQ== 22449 -IGFkbw== 22450 -IE9VVA== 22451 -Njc= 22452 -IGhvcm1vbmVz 22453 -IEF2ZW51ZQ== 22454 -IFN1cGVybWFu 22455 -IHByZXNjcmlwdGlvbg== 22456 -dWJlcm5ldGVz 22457 -Q0w= 22458 -b3RpdmU= 22459 -TklT 22460 -aWVuZW4= 22461 -IHNhZG5lc3M= 22462 -IFZpdA== 22463 -VHk= 22464 -IHN0YXJ0ZXI= 22465 -IGJlZGU= 22466 -IGZvdW5kYXRpb25z 22467 -IHNvcmU= 22468 -5bqX 22469 -0YnQtdGB0YLQsg== 22470 -7Jqw6w== 22471 -INGH0YPQsg== 22472 -bGluaw== 22473 -IG1hbmV1 22474 -d29ya2luZw== 22475 -w6Bu 22476 -IEF0dGFjaw== 22477 -IENhcnQ= 22478 -dmVpcw== 22479 -IFJlc3A= 22480 -ZW5zaW5n 22481 -IOyii+yVhOyalA== 22482 -IGVzY3VjaA== 22483 -IFJOQQ== 22484 -grQ= 22485 -IGFkb3A= 22486 -IGJlbmRpbmc= 22487 -2LnYrw== 22488 -IG1hbmFnZXM= 22489 -dXNw 22490 -IHRhcnQ= 22491 -IHJvdXRlcg== 22492 -Qm8= 22493 -IGVzdGFibGlzaGluZw== 22494 -IGJhbGFuY2luZw== 22495 -IGF0aGxldGlj 22496 -IFNsbw== 22497 -IGZpbGxz 22498 -INC90LDQsQ== 22499 -INC00LDQuw== 22500 -IHBvc3Nv 22501 -IFZpZWxlbg== 22502 -IGNyaXRpY3M= 22503 -IGxhd3N1aXQ= 22504 -IElzYWFj 22505 -INGE0LjQu9GM0Lw= 22506 -IHRyYXM= 22507 -IHByYXc= 22508 -IENyYXp5 22509 -IG5ldQ== 22510 -IGt1bGw= 22511 -IHR1bW9y 22512 -IEFQUA== 22513 -Z2F0ZQ== 22514 -IEFSRQ== 22515 -OTg= 22516 -IFN0ZWFt 22517 -IGZ1Y2tlZA== 22518 -bGFnZQ== 22519 -IOKZrA== 22520 -IE1E 22521 -Znk= 22522 -IHNoZWxscw== 22523 -IFNlZW1z 22524 -aXplcnM= 22525 -IHJhbmdlcw== 22526 -IEFudG9uaW8= 22527 -QVRJT04= 22528 -IEJhYmE= 22529 -IOyDiQ== 22530 -a3Vu 22531 -IHByYXllZA== 22532 -0YDRjw== 22533 -INC/0YDQvtGC0LjQsg== 22534 -IHNlYXM= 22535 -YnVyeQ== 22536 -INeU16k= 22537 -IHRyYWl0 22538 -IERlcGVuZGluZw== 22539 -IGRyZQ== 22540 -IGvDtm5udA== 22541 -0YbRgw== 22542 -IGxpcHN0aWNr 22543 -ZWV6 22544 -INC/0YDQuNC80LXRgA== 22545 -IGFzc2lnbm1lbnRz 22546 -Qm9i 22547 -IG1ldGFscw== 22548 -IHNwZWNpYWxseQ== 22549 -5bCN5LiN5bCN 22550 -IOyYiOs= 22551 -IMWh 22552 -IHZpc3Rh 22553 -IM6s 22554 -IHR3aW5z 22555 -IG5vdGFibGU= 22556 -IFNhdQ== 22557 -IGTDqXZlbG9w 22558 -IMOnZWs= 22559 -IHBvbHlub20= 22560 -YXZhbQ== 22561 -IHRhbWLDqQ== 22562 -0L7QvdC+0Lw= 22563 -IHBsYXNtYQ== 22564 -IGVmZWN0 22565 -IGzDpG5n 22566 -IGNhc2k= 22567 -0YHQsA== 22568 -xLFtxLE= 22569 -44GZ44KL 22570 -k6TsnYA= 22571 -IGxhYm91cg== 22572 -b3NzZW4= 22573 -IFB1bg== 22574 -cmlm 22575 -IGRvc2Vz 22576 -IG9wZXJhdGVz 22577 -0LjQu9C70Lg= 22578 -IGphYXI= 22579 -c3Rhdw== 22580 -IOyCrOuekQ== 22581 -IGF0bQ== 22582 -IHByb3RlY3Rz 22583 -IGltcGVk 22584 -SE8= 22585 -IGNpbWE= 22586 -IHRvY2g= 22587 -YWJpcw== 22588 -IHNlbmRv 22589 -bGF1cw== 22590 -IGN1cmw= 22591 -IE51bQ== 22592 -IHNwb25zb3Jz 22593 -IGTDqWJ1dA== 22594 -IEFsZXhh 22595 -IELDvHI= 22596 -IEFtZXI= 22597 -IGNvcGU= 22598 -INC40LfQsg== 22599 -amFs 22600 -IDE5OTU= 22601 -YXBhdA== 22602 -cmVzc2U= 22603 -IFByaXpl 22604 -IENsYWlyZQ== 22605 -IEJyYW5kb24= 22606 -IHdzenlzdGtv 22607 -IHZhbHVlZA== 22608 -4LiZ4Liw 22609 -IHNlY3Q= 22610 -IHNlY3JldGx5 22611 -IGRpYW1vbmRz 22612 -IEV2YW4= 22613 -IFJQRw== 22614 -44Gr44Gq 22615 -iOuPhA== 22616 -IFVuaXZlcnNhbA== 22617 -IGRvdWJ0cw== 22618 -IFBpbg== 22619 -d2nEhXo= 22620 -mqk= 22621 -IGFsYm8= 22622 -IGJyYXVjaHQ= 22623 -QVVM 22624 -IE1vYmlsZQ== 22625 -Z3JhZGVz 22626 -IHNjaGVt 22627 -d2h5 22628 -IE5pY2h0 22629 -cGk= 22630 -Z2xl 22631 -IGNob3J1cw== 22632 -IGdseQ== 22633 -IHJlaW5mb3JjZQ== 22634 -IG11ZmY= 22635 -IFNoZW4= 22636 -IEhvbGE= 22637 -0YPQsw== 22638 -dmlkZW1tZW50 22639 -dmlhbA== 22640 -YWNpb3Vz 22641 -bGFpbWVk 22642 -IFJpY28= 22643 -IHZlZ2c= 22644 -IGlsbHVzdHJhdGlvbg== 22645 -IEJ1dHRlcg== 22646 -b3dhZA== 22647 -IGV1eA== 22648 -IGVuZmFudHM= 22649 -IExlYWRlcg== 22650 -IFZpbGxhZ2U= 22651 -ZXRpY2FsbHk= 22652 -2YbZig== 22653 -IHN0ZXc= 22654 -IHN1cnByaXNlcw== 22655 -IGN1ZQ== 22656 -IEdyYW5kbWE= 22657 -IENlbHNpdXM= 22658 -IFJpY2h0 22659 -ZW5j 22660 -IHBldGl0aW9u 22661 -IGhlcmI= 22662 -IHdpY2tlZA== 22663 -IHNjaGxl 22664 -b2NhbHk= 22665 -IHRyYW5zZg== 22666 -IHRva2Vucw== 22667 -IEdyYXk= 22668 -IEJCQw== 22669 -SUs= 22670 -IDE1MDA= 22671 -em4= 22672 -IE5ldg== 22673 -IGtveQ== 22674 -IHphcg== 22675 -IGJ1bGxzaGl0 22676 -IENvbG9tYmlh 22677 -dWxhdGl2ZQ== 22678 -IHdpZGVzcHJlYWQ= 22679 -eWVjdA== 22680 -a2l0 22681 -IGVtcHJlc2E= 22682 -IG5vdXI= 22683 -IGJ1cm5z 22684 -YXRpbg== 22685 -YWlyZWQ= 22686 -IHJldm9sdXRpb25hcnk= 22687 -INCz0L7QtNGD 22688 -IExvZ2Fu 22689 -IDE5OTY= 22690 -IEdyYWhhbQ== 22691 -cmVi 22692 -IE5IUw== 22693 -5pyb 22694 -IGNvc3R1bWVz 22695 -IG5hd2V0 22696 -IGxvdmVycw== 22697 -IEx1Y3k= 22698 -IEluZGlnZW5vdXM= 22699 -7ZWY6riw 22700 -IGltbXVuaXR5 22701 -pbTr 22702 -dWl0bw== 22703 -IGV4Y2Vzc2l2ZQ== 22704 -IGRvbmF0aW9ucw== 22705 -INeU16g= 22706 -IOyyqw== 22707 -6YmE 22708 -IGRyeWluZw== 22709 -bWVsb24= 22710 -IHN1cnZleXM= 22711 -IOustOyKqA== 22712 -6aKo 22713 -YWFh 22714 -IHByb2Jl 22715 -YW5jaWFs 22716 -IGxvdWRlcg== 22717 -IGhvdGVscw== 22718 -w7zEnw== 22719 -YWduZXI= 22720 -IG9yaWdpbnM= 22721 -IOuniOyngOuniQ== 22722 -ICoq 22723 -IHN0cmFuZ2Vycw== 22724 -IEhhdXM= 22725 -Y29tZWQ= 22726 -IGFudGhyb3A= 22727 -IHVzbw== 22728 -IOyVhOyngQ== 22729 -IFl1YW4= 22730 -IO2VhOyalA== 22731 -cGxlcg== 22732 -cmVzc2l2ZQ== 22733 -IHNwcmF3 22734 -IFN0ZXc= 22735 -IDE5OTQ= 22736 -IGVsZGVycw== 22737 -IG1laW5lbg== 22738 -IGp1bnQ= 22739 -IGFjb3VzdA== 22740 -IFdvaG4= 22741 -IGJhbmFuYXM= 22742 -IHByb2plY3Rpb24= 22743 -IFN0aWNr 22744 -bGVndA== 22745 -c3BlZWQ= 22746 -IGPFqW5n 22747 -IFdvcnQ= 22748 -IEJhbHRpbW9yZQ== 22749 -INGG0LXQuw== 22750 -IGR1bm5v 22751 -5by3 22752 -Pyw= 22753 -44OJ44Oz 22754 -IExvY2Fs 22755 -b3N0bw== 22756 -0K0= 22757 -0L7QtNCw 22758 -IFBvcnR1Z3Vlc2U= 22759 -IHRoZWlycw== 22760 -IGTDqW0= 22761 -5Y+m 22762 -IGRyYXVm 22763 -IEJ1ZGRoaXN0 22764 -ZXJ0YQ== 22765 -R2U= 22766 -IGNhcnJvdA== 22767 -IFdvbmRlcmZ1bA== 22768 -IHNvYWs= 22769 -IGNoYWlybWFu 22770 -Z2dp 22771 -SUNB 22772 -ZnJpZWQ= 22773 -IGZsaWNr 22774 -IFRocm91Z2hvdXQ= 22775 -IOyasOs= 22776 -IGNvdWdo 22777 -IGZsdWZmeQ== 22778 -c2Nob29s 22779 -IHJpcHBlZA== 22780 -LS0tLS0tLS0= 22781 -IFp1a3VuZnQ= 22782 -INC90LXQsQ== 22783 -IHN0bw== 22784 -IEJP 22785 -cGVudA== 22786 -IExhd3JlbmNl 22787 -z4nPgg== 22788 -c3RpY2tz 22789 -IEVpbnM= 22790 -INGA0Ys= 22791 -IFN0cm9uZw== 22792 -IGNhcmFtZWw= 22793 -IHNwaXRl 22794 -YXphcg== 22795 -6YO95piv 22796 -IGNyaXRpY2FsbHk= 22797 -IG9icmE= 22798 -b3dpdHo= 22799 -IFpvbmU= 22800 -INGA0LXQug== 22801 -IHN1Zw== 22802 -YXJkZWQ= 22803 -IGfDrA== 22804 -ZmZlbnRsaWNo 22805 -YW5jaGU= 22806 -2J8= 22807 -YXN0aWNhbGx5 22808 -7J286w== 22809 -0LvQsNCy 22810 -IHNpbXBsZXN0 22811 -IEZyaWVuZA== 22812 -IHF1ZWxsbw== 22813 -IGFtYml0aW9u 22814 -IGFiYmlhbW8= 22815 -5bqV 22816 -INGE0L7RgNC8 22817 -IEVzc2E= 22818 -IGVkdWNhdG9ycw== 22819 -IHN0YXRpc3RpY2Fs 22820 -6YCZ6YKK 22821 -IGNoYW5nZXI= 22822 -IGF0YXU= 22823 -w6l0YWlz 22824 -IFNoYWtlc3BlYXJl 22825 -65CY 22826 -IHRyaWdnZXJz 22827 -IHJlYWxpeg== 22828 -IGNlbHVp 22829 -d2hlZWw= 22830 -IGxveWFsdHk= 22831 -IHNjcmVhbXM= 22832 -a2Vocg== 22833 -IE1lZ2E= 22834 -ZWFzdA== 22835 -IHRvcHM= 22836 -IFRvdGFsbHk= 22837 -b3VudGFpbg== 22838 -bG9yZA== 22839 -IHZpb2xhdGlvbg== 22840 -IEdB 22841 -IG5pY2Vy 22842 -IEZyZXNo 22843 -IE1lbGlzc2E= 22844 -ZnVuY3Rpb24= 22845 -IHJhcGU= 22846 -IGV4Y2VwdGlvbnM= 22847 -IHNpbGljb24= 22848 -IGxpYmVydHk= 22849 -IGhvdXNlaG9sZHM= 22850 -44GN44G+44GZ 22851 -IENB 22852 -INCe0LE= 22853 -IGxpYg== 22854 -now= 22855 -Y2lmaWM= 22856 -IHRyb3BpY2Fs 22857 -IGludmVzdGlnYXRpbmc= 22858 -SEQ= 22859 -IGFkYXB0ZXI= 22860 -IFBpdHQ= 22861 -YW5jaWE= 22862 -IFNoZWxs 22863 -ZnJpZW5kbHk= 22864 -IGNvbmNsdXNpb25z 22865 -IHR1cnRsZQ== 22866 -IGRlY29tcA== 22867 -IGFuaW1hdGlvbnM= 22868 -INGB0LXQug== 22869 -aW5zaQ== 22870 -IHJldGVudGlvbg== 22871 -a2ll 22872 -IGluamVjdGlvbg== 22873 -IE1hZGlzb24= 22874 -7LCw 22875 -IHZpZW50 22876 -IHZhcmllZA== 22877 -IHZpb2xpbg== 22878 -IEJpbA== 22879 -IGx1Y2tpbHk= 22880 -IGh0dA== 22881 -bMOk 22882 -IHJhbmNo 22883 -55yL55yL 22884 -IHPDs2xv 22885 -7JWF 22886 -IERlcmVr 22887 -IFNjcmlwdHVyZQ== 22888 -0L7RgNCw 22889 -IGNsYXNzcm9vbXM= 22890 -YXZpbA== 22891 -Zm9ybWVk 22892 -IGJlZm9yZWhhbmQ= 22893 -IEdlbQ== 22894 -cHJlY2g= 22895 -IGxpbg== 22896 -IGdyZWVucw== 22897 -0YbQtdCy 22898 -IE1lcmNlZGVz 22899 -IGRyb3VnaHQ= 22900 -Z2FzcHM= 22901 -IGFib3J0aW9u 22902 -IHRlcnJpYmx5 22903 -IHNwb3PDs2I= 22904 -IHNlY3VyZWQ= 22905 -IGF0csOhcw== 22906 -IHdhdmVsZW5ndGg= 22907 -IGdyYWlucw== 22908 -ZWN0aXZl 22909 -IHNwYWNlY3JhZnQ= 22910 -IHRvdXJz 22911 -IHByb2Zlcw== 22912 -IHN1cmdlb24= 22913 -IFBpZQ== 22914 -IGlkZWFsbHk= 22915 -YXJuZXI= 22916 -VVA= 22917 -b3BhcmQ= 22918 -c2Nl 22919 -IGltbWVuc2U= 22920 -IE9ydA== 22921 -cm9sbGVy 22922 -IERhbGxhcw== 22923 -IE5pY2hvbGFz 22924 -IHN1bGY= 22925 -IFRveW90YQ== 22926 -IHF1YW50aXRpZXM= 22927 -Y2VhbnM= 22928 -IGN1aQ== 22929 -YW7Dp2E= 22930 -IENBTg== 22931 -aXR6ZXJsYW5k 22932 -5YS/ 22933 -IHpvdQ== 22934 -IEN5YmVy 22935 -bGVnZW4= 22936 -IEluaXQ= 22937 -ZWR1 22938 -IGFwZXJ0 22939 -IGFkamFj 22940 -b3V2 22941 -6ICM5LiU 22942 -cnM= 22943 -IGNhYmJhZ2U= 22944 -IHdoZWVsY2hhaXI= 22945 -aW55bA== 22946 -IER5bmFt 22947 -IOyVhOuLiOudvA== 22948 -IGxpbmc= 22949 -aGw= 22950 -INC80L7Qs9GD 22951 -IGNyaXNw 22952 -IG1pag== 22953 -IGR1Zw== 22954 -bmlu 22955 -IGJsb3Nz 22956 -IGJlbG9uZ2luZw== 22957 -IGxvdWRseQ== 22958 -IG1pbmVyYWxz 22959 -IGNvbmNsdWRlZA== 22960 -IHNlYXJjaGVk 22961 -OTY= 22962 -IE1lZXQ= 22963 -IFNFTw== 22964 -INCh0Lo= 22965 -IEhvYg== 22966 -b3R0YQ== 22967 -IHByb3BhZ2FuZGE= 22968 -IGNpbm5hbW9u 22969 -IGh1bnRlcg== 22970 -IGdlbWVpbnM= 22971 -IHNjdWxwdHVyZQ== 22972 -dWxzaW9u 22973 -IHbDpGw= 22974 -IG1hZ2F6aW5lcw== 22975 -IGNvbnRyb3ZlcnN5 22976 -5LiA5qij 22977 -IHNlcXVlbmNlcw== 22978 -44GE44KL 22979 -IO2ajA== 22980 -IGRlbGV0ZWQ= 22981 -5L2/ 22982 -kOuPhA== 22983 -IHZhcnlpbmc= 22984 -44OG 22985 -IG1vdW50aW5n 22986 -IGFmZmFpcg== 22987 -IHBhdGh3YXlz 22988 -5qY= 22989 -IGRpZ28= 22990 -5Lqu 22991 -INC00L7Qug== 22992 -QWxleA== 22993 -IHRvYmFjY28= 22994 -IENW 22995 -IGJvdGhlcmVk 22996 -IGFtYmllbnQ= 22997 -aW5reQ== 22998 -IFNM 22999 -IGhhdGVz 23000 -IGplxbxlbGk= 23001 -IGNvbmdyZWc= 23002 -IGVsYXM= 23003 -IGRldXRz 23004 -IFN0dWRpb3M= 23005 -Y2jEmQ== 23006 -IGRvY3VtZW50ZWQ= 23007 -IENydXo= 23008 -IExlbg== 23009 -IERvdWdsYXM= 23010 -IFBvcnR1Z2Fs 23011 -ZW50aQ== 23012 -IHNwb3VzZQ== 23013 -IGFuYWx5cw== 23014 -YXZpYQ== 23015 -IGVkaXRlZA== 23016 -IGzhuqFp 23017 -YnVpbHQ= 23018 -IHZpbGxl 23019 -YWRvcmE= 23020 -IGJyYWNlbGV0 23021 -IHN1c2hp 23022 -IHBt 23023 -IHRyYWlscw== 23024 -IGx1Zw== 23025 -IMO2dmVy 23026 -IHNvcnJvdw== 23027 -IGNvbG9ueQ== 23028 -YWRveA== 23029 -IHNlcmll 23030 -YW55YWs= 23031 -INi3 23032 -IEd1bGY= 23033 -5piv5LiN5piv 23034 -IFBW 23035 -IFNhbXVlbA== 23036 -IEtpdA== 23037 -IFJhbA== 23038 -b250aW4= 23039 -ZXhwbA== 23040 -IGVudHJpZXM= 23041 -IGFjdGl2aXN0cw== 23042 -UHM= 23043 -IHNhbnQ= 23044 -INGC0L7Rhw== 23045 -IEJydW5v 23046 -a2VsZXk= 23047 -IHR1dHRv 23048 -6ZQ= 23049 -IHZpbnRhZ2U= 23050 -IHRlcnJpZmllZA== 23051 -INC/0L7RhQ== 23052 -dXNpdmU= 23053 -b3dlcnM= 23054 -0LDQudGC 23055 -64+Z 23056 -IHR3aXN0ZWQ= 23057 -IFRob3VnaHQ= 23058 -IHRhaA== 23059 -IHNocmluaw== 23060 -IHNoZWVy 23061 -bGl0 23062 -IGRhbGFt 23063 -IGRpYg== 23064 -IHZhcmQ= 23065 -b3dhbmU= 23066 -IGRvYnI= 23067 -IFJlbmE= 23068 -INGB0LLQvtGO 23069 -IHBhw61zZXM= 23070 -IEVyYQ== 23071 -44Gu44Gn 23072 -IEJVVA== 23073 -c2lnaHM= 23074 -IOq3uOqxsA== 23075 -IGdyb8OfZW4= 23076 -IOu5qOumrA== 23077 -IG5lcnZlcw== 23078 -IGNvbnN0aXQ= 23079 -IHByZW9jdXA= 23080 -IEdheQ== 23081 -IFh1 23082 -a2VlcGVy 23083 -aGV1cmU= 23084 -Li4p 23085 -IENhbG0= 23086 -IFVuaWRvcw== 23087 -IOydtOqygw== 23088 -IEFxdWk= 23089 -IOygnOydvA== 23090 -ZMSxcg== 23091 -7KaY 23092 -eW91cg== 23093 -INGN0YLQuNC8 23094 -MjAyMA== 23095 -IHJ1bmQ= 23096 -IEhP 23097 -IENhdGhlcmluZQ== 23098 -aWVsaQ== 23099 -IGZ1c2lvbg== 23100 -IGlkZW9sb2d5 23101 -IGZvcmFt 23102 -c2hhcGVk 23103 -IO2bhOs= 23104 -IHd0 23105 -IHJldHI= 23106 -IHByw6lj 23107 -IOqwkQ== 23108 -IG9wZW5seQ== 23109 -dml0eQ== 23110 -6rWs7JqU 23111 -IG9ic3RhY2xl 23112 -IGJvbw== 23113 -IHNlaW5lcg== 23114 -aWNvcm4= 23115 -IGVpZ2VubGlqaw== 23116 -IGhlYWRlcg== 23117 -YXJlbW9z 23118 -IHNvZnRlcg== 23119 -INCf0L7QtA== 23120 -IHByZWp1ZA== 23121 -IGRlZmluZXM= 23122 -aWVydGU= 23123 -IGJsZW5kaW5n 23124 -IGJlbGlldmVycw== 23125 -IFdvY2hlbg== 23126 -INC90LjQutCw0Lo= 23127 -INCa0L7Qs9C00LA= 23128 -IFR5cGljYWxseQ== 23129 -IO2BrA== 23130 -566h 23131 -Y2lvcw== 23132 -IG1pc3NpbGVz 23133 -IHNwb25nZQ== 23134 -IEtpdGNoZW4= 23135 -IHRyZW4= 23136 -bmluZ2Vu 23137 -IHNjcmFw 23138 -IHNlcmFpdA== 23139 -tOyg 23140 -57k= 23141 -IOuwmOs= 23142 -IHJlc3RvcmVk 23143 -IHByenlrxYJhZA== 23144 -IEt1YmVybmV0ZXM= 23145 -IHNhaXQ= 23146 -IHV3 23147 -IGVuYWJsaW5n 23148 -IHRyYXZlcnM= 23149 -YW1wcw== 23150 -5Y+X 23151 -IE9NRw== 23152 -ZW5zb3I= 23153 -IHpvc3Rh 23154 -IHByb25vdW5jZWQ= 23155 -QW5n 23156 -bm9ybWFs 23157 -IGVjb25vbWllcw== 23158 -dGlu 23159 -IENoYW1waW9u 23160 -aXplbg== 23161 -IGFyYmVpdGVu 23162 -IEdvc3BlbA== 23163 -IFp1 23164 -bmdh 23165 -IGxpdGVyYWN5 23166 -IE1hbnM= 23167 -IGNpcmN1bGF0aW9u 23168 -IGFkYXA= 23169 -IFRvdGFs 23170 -IG1lcmVrYQ== 23171 -IG9sYWNhaw== 23172 -0YHRgtCw0YLQuA== 23173 -SmFjaw== 23174 -IG11bmQ= 23175 -IHRoaWVm 23176 -Ymllcw== 23177 -IOqygQ== 23178 -YXF1ZQ== 23179 -INqp24w= 23180 -IFNjYXI= 23181 -5bI= 23182 -IGFib2w= 23183 -IGRldm90ZQ== 23184 -IDAx 23185 -IHNpdHRlbg== 23186 -IFZpc3VhbA== 23187 -d2Vlaw== 23188 -c29tZQ== 23189 -aW5ndA== 23190 -IGpvdXJuYWxpc20= 23191 -IEhpcg== 23192 -IEJhY2hlbG9y 23193 -aW5lcnk= 23194 -w5xORA== 23195 -44Of 23196 -57uZ 23197 -IGNvbG9yaW5n 23198 -IENyaXN0 23199 -IGNlbGVicml0aWVz 23200 -INGH0LjRgQ== 23201 -IENyaXQ= 23202 -IGRpZmZlcmVudGlhdGU= 23203 -INCc0L3QtQ== 23204 -ZWxpbQ== 23205 -IHNlYWZvb2Q= 23206 -IGFsZ3VtYXM= 23207 -b3RoZXJhcHk= 23208 -5oiw 23209 -IGdsYXVi 23210 -IGFyYml0cmFyeQ== 23211 -Z2Vucw== 23212 -INCx0YPQtNC10Lw= 23213 -IHRhdg== 23214 -IGNyZWFteQ== 23215 -IENvdW50cnk= 23216 -YcOx 23217 -0LzQtdGC 23218 -IGhpbnRlcg== 23219 -IG1pc20= 23220 -IGlsbHVzdHJhdGU= 23221 -w5xORE5JUw== 23222 -IGRlY3JlYXNpbmc= 23223 -IHdlbmlnZXI= 23224 -QUtJ 23225 -aXhvbg== 23226 -INC90LXQuQ== 23227 -IGZhdHRv 23228 -IG5lcmQ= 23229 -56A= 23230 -IGJpdHRl 23231 -UGVy 23232 -IHRhbmU= 23233 -IGfDtno= 23234 -IGZvcnRl 23235 -IEV5 23236 -INC90LDQstC10YA= 23237 -6KKr 23238 -IFdvcmRQcmVzcw== 23239 -IE1pcw== 23240 -xa8= 23241 -esOkaA== 23242 -IGludMOpcmVzcw== 23243 -b3NhdXJz 23244 -IEZhbGxz 23245 -IG5lc3Nh 23246 -OTc= 23247 -IG11c2V1bXM= 23248 -IGNvcnJlc3BvbmRz 23249 -IHNpbmdz 23250 -Zm91cg== 23251 -IGVkZXI= 23252 -IENvbW11bmlzdA== 23253 -b2E= 23254 -bmVr 23255 -IFdITw== 23256 -IGNvcnBv 23257 -IG1lc3Npbmc= 23258 -z4TOsc65 23259 -IGJydXNoZXM= 23260 -IGJpc2M= 23261 -IEFyYmVpdHM= 23262 -IFRheA== 23263 -IHNlbGU= 23264 -IGZsYWdz 23265 -b3VwZQ== 23266 -IGFudGljaXBhdGVk 23267 -44OR 23268 -IE5hZA== 23269 -IHBvdXJlZA== 23270 -IG1s 23271 -IGxsYW1h 23272 -IHZpc3VhbGl6ZQ== 23273 -IGxpc3RlbmVycw== 23274 -2YTZgw== 23275 -YWx0ZW4= 23276 -TWljaGFlbA== 23277 -IGNvc8Os 23278 -1aHV 23279 -b3B1cw== 23280 -IO2VtOyjvA== 23281 -IGhpa2U= 23282 -IEF0dG9ybmV5 23283 -IEhpbGxhcnk= 23284 -dWRlZA== 23285 -IO2VmOyngOunjA== 23286 -IGRvdmU= 23287 -IHN0b3Jtcw== 23288 -0LDQutGB 23289 -IGRvY3RyaW5l 23290 -IGhleA== 23291 -aWtz 23292 -bm/Fm8SH 23293 -IHNjcmlwdHM= 23294 -IM60zrXOvQ== 23295 -INGN0YLQuNGF 23296 -INCG 23297 -YWJlcg== 23298 -IFZhcw== 23299 -IGNlbnRpbWV0ZXJz 23300 -157XlA== 23301 -0L3QuNCx 23302 -IHJpZGVycw== 23303 -IFRyaWI= 23304 -5YyF 23305 -IHRha8W8ZQ== 23306 -IG5vdW4= 23307 -IGljb25z 23308 -IHNvbGVseQ== 23309 -bWluZGVk 23310 -IGRpc3Bvbg== 23311 -IFN3aXR6ZXJsYW5k 23312 -IGNsdXN0ZXJz 23313 -IHF1ZWRh 23314 -YWlsaW5n 23315 -IG1hbmdh 23316 -IDY4 23317 -hIg= 23318 -IHRldA== 23319 -Z2lucw== 23320 -aGF1cw== 23321 -56m6 23322 -5bel 23323 -IE9Q 23324 -b3RlZA== 23325 -IG5vdXZlYXU= 23326 -QUxMWQ== 23327 -2YjYrw== 23328 -w7Ju 23329 -IG1vcnRhbGl0eQ== 23330 -IEdpdEh1Yg== 23331 -ZHJvcA== 23332 -IGRpc2d1 23333 -IHJlY29t 23334 -IGxvY2Fscw== 23335 -IGhvbWVtYWRl 23336 -YW1iYQ== 23337 -IHByb251bmNpYXRpb24= 23338 -IGFscGhhYmV0 23339 -0LDQvdGM 23340 -b3dhbnk= 23341 -aXJhcw== 23342 -aWRlbmN5 23343 -T01F 23344 -INGA0LDRgdGB 23345 -YXJhaw== 23346 -dmlhbWVudGU= 23347 -IG5vbnByb2ZpdA== 23348 -IFlvdVR1YmVy 23349 -IHBhcmVudGg= 23350 -IEJvbw== 23351 -dmF0 23352 -IFN0aXI= 23353 -IHByZWNpcA== 23354 -IGFudHM= 23355 -IGFsbHk= 23356 -IE1hb3Jp 23357 -IOuMgO2VnA== 23358 -5Y+v5piv 23359 -b2dlbmU= 23360 -IExhYm91cg== 23361 -YXJldHRl 23362 -IHJlY3ljbGluZw== 23363 -ZW5zYQ== 23364 -IHB1cnN1aXQ= 23365 -IHNhaw== 23366 -INCX0LTQtdGB0Yw= 23367 -IHRvbGVyYW5jZQ== 23368 -IHNhYXQ= 23369 -IGNsaWNrZWQ= 23370 -4pml 23371 -IGZhY2Vib29r 23372 -IEludG8= 23373 -IGluY2VudGl2ZXM= 23374 -6riw64qU 23375 -IERlbm5pcw== 23376 -IFdpaw== 23377 -Z2VzY2g= 23378 -4LmA4Lib 23379 -IM+AzrE= 23380 -IFdob28= 23381 -IHJvdW5kZWQ= 23382 -IGRvcGU= 23383 -IGNhcHR1cmluZw== 23384 -IFdhcnJp 23385 -IGNpdmlsaWFu 23386 -IGNoYXJtaW5n 23387 -IGVzYXM= 23388 -IHN1c3RhaW5lZA== 23389 -IGxlYW5pbmc= 23390 -IGFidW5kYW5jZQ== 23391 -w61saWE= 23392 -0LDQu9GM0L3Ri9C5 23393 -IHBo4bqjaQ== 23394 -YWNqYQ== 23395 -IOqwmeyVhA== 23396 -YWN0aXY= 23397 -4Liy4Lii 23398 -IDk3 23399 -INC80L7QuQ== 23400 -Y3Jv 23401 -IEphY2tpZQ== 23402 -aXR0ZWVz 23403 -YnJhY2h0 23404 -dWxlbnQ= 23405 -IOygnOs= 23406 -IHBsdWdpbg== 23407 -dmFudGFnZQ== 23408 -cGFydHk= 23409 -IHN1YXM= 23410 -IGFudGU= 23411 -0YPQuw== 23412 -0J3QkA== 23413 -5oKo 23414 -IM+Dz4U= 23415 -IG1ldGg= 23416 -IGVudGh1c2lhc20= 23417 -0Y/RgtGB0Y8= 23418 -7ZmU6w== 23419 -IHN5bnRoZXRpYw== 23420 -IHNlYXNvbmluZw== 23421 -IExvc3Q= 23422 -b25vbXk= 23423 -IFNwYXJr 23424 -IGJ1cmU= 23425 -IGFzc3VyZWQ= 23426 -IGltYWdpbg== 23427 -IGNhcnJv 23428 -U2hh 23429 -xIV0 23430 -0L3Rg9GC0Yw= 23431 -w6F0aWNh 23432 -VFk= 23433 -IGtlcm4= 23434 -IEJyYXppbGlhbg== 23435 -w7A= 23436 -IHN1c3BlbmRlZA== 23437 -IENhcmli 23438 -IGJpemlt 23439 -IE9saXZlcg== 23440 -44G2 23441 -VG9t 23442 -INC/0LvQsNC9 23443 -IG5vcGU= 23444 -b21ldGhpbmc= 23445 -IGJlaWRlbg== 23446 -0YbQtdC9 23447 -IGZsdWN0 23448 -IM68zr/PhQ== 23449 -IGZhdGhlcnM= 23450 -IEJsYWtl 23451 -IHVwd2FyZA== 23452 -IERhc2g= 23453 -IExpbA== 23454 -IOyImOuPhA== 23455 -IHJldmVsYXRpb24= 23456 -IGVsZXZhdGVk 23457 -IEppYW5n 23458 -TEVE 23459 -IFRob21wc29u 23460 -INC80L7Qs9GD0YI= 23461 -0YHRgtGA0YM= 23462 -aWZpZXJz 23463 -IGNvbWViYWNr 23464 -IGJ1eWVycw== 23465 -6rKw 23466 -IFNhbGVz 23467 -0LjRh9C1 23468 -Y2lvbmVz 23469 -IHdoaXN0bGU= 23470 -IGR1bGw= 23471 -TEVY 23472 -IO2VmOqyoOyKteuLiOuLpA== 23473 -IGNyaW1pbmFscw== 23474 -IGRlc2NlbnQ= 23475 -aXBwbGU= 23476 -bWFzxLE= 23477 -IGZvb2xpc2g= 23478 -INC00YPQvNCw0Y4= 23479 -dGFy 23480 -IG1hbmdv 23481 -IGNob3Jlb2dyYXBoeQ== 23482 -TWF0dA== 23483 -IHRlcnJpdG9y 23484 -IGFjYWJh 23485 -IEVpbnN0ZWlu 23486 -IElCTQ== 23487 -IE1ldGFs 23488 -IENyeXN0YWw= 23489 -IHJhaA== 23490 -IGZvdWw= 23491 -IElzbGFuZHM= 23492 -IGludGFjdA== 23493 -IFJhaWw= 23494 -Ljo= 23495 -IGFjw6E= 23496 -INC/0YDQvtC/ 23497 -0LXRgNC1 23498 -IFdyaXRl 23499 -aGVoZQ== 23500 -IEZP 23501 -IM+Dz4TOtw== 23502 -IGRvaW4= 23503 -aGVsZA== 23504 -IGFwcHJvcHJpYXRlbHk= 23505 -IGRlbGliZXJhdGVseQ== 23506 -IGFyY2hpdmU= 23507 -IGdpdmVhd2F5 23508 -44GT44GT 23509 -IGZpbmFsZQ== 23510 -0LvQsNGB 23511 -0LXQvdC+ 23512 -xqFu 23513 -5qOS 23514 -b2dv 23515 -54mp 23516 -IEF1ZGllbmNl 23517 -44Wg 23518 -IHN1YnVy 23519 -IGhlYWRhY2hl 23520 -0LDQvdC90Y8= 23521 -IFdpdGNo 23522 -IFN3ZWRpc2g= 23523 -IEJJ 23524 -IGVyYXNl 23525 -IGtoaQ== 23526 -IGNvbW1lbnRhcnk= 23527 -IFN1bHRhbg== 23528 -7YOd 23529 -IExlYmFu 23530 -IOuztOyL 23531 -IFBhbQ== 23532 -cGVrdA== 23533 -bW9udGg= 23534 -IGdyb3VuZGVk 23535 -6r4= 23536 -IMWfZWtpbGRl 23537 -MjUw 23538 -IFNDSA== 23539 -aW9zbw== 23540 -IGluYXVn 23541 -aGVpbWVy 23542 -IHJlZmxlY3Rpbmc= 23543 -IFJ1dGg= 23544 -IE9pbA== 23545 -IHRyb3V2ZXI= 23546 -dWVw 23547 -Li5d 23548 -IOyeiOs= 23549 -IG9saGE= 23550 -IHJlYXNvbmFibHk= 23551 -IGdsaXRjaA== 23552 -VUI= 23553 -IEdyYW4= 23554 -IGFkYWxhaA== 23555 -IGxlbnQ= 23556 -2LHYpw== 23557 -IHRyYWN0aW9u 23558 -IGFkanVzdGluZw== 23559 -tKQ= 23560 -0L3QuNCx0YPQtNGM 23561 -INC00L7Qvw== 23562 -IHN0cmV0Y2hlZA== 23563 -IG9ydA== 23564 -IGNvc2luZQ== 23565 -dmlvbA== 23566 -IOyF 23567 -Y2ly 23568 -IGJhc3RhcmQ= 23569 -5LiH 23570 -INGF0L7QtA== 23571 -IHF1aWVy 23572 -IHByZXNzdXJlcw== 23573 -IEFuaA== 23574 -5bm+ 23575 -IGVsbGVz 23576 -INC00YDRg9C3 23577 -INC80L7QttC10YLQtQ== 23578 -IGNo4bs= 23579 -IE3DqQ== 23580 -w7Zr 23581 -4bqndQ== 23582 -7KCI 23583 -emlu 23584 -IGNhdXRpb24= 23585 -aWJhbg== 23586 -IGp1ZGdpbmc= 23587 -0YPRjtGC 23588 -IGJhag== 23589 -INCh0LXQudGH0LDRgQ== 23590 -IFBvb3I= 23591 -IE5hemk= 23592 -IHVwYmVhdA== 23593 -eWFuZw== 23594 -IHdlZWtlbmRz 23595 -IEVzc2VudGlhbGx5 23596 -IG9sdXlvcg== 23597 -IHNwYXRpYWw= 23598 -YWNrZXI= 23599 -IHNlbGxlcg== 23600 -INeQ15XXqg== 23601 -kdec 23602 -IHZpdmlk 23603 -IEJvbmQ= 23604 -6raM 23605 -aXNrdA== 23606 -44K1 23607 -IGdvYXQ= 23608 -ZHJpdmVy 23609 -IG11Zw== 23610 -aWN0aW9uYWw= 23611 -IGFsbHQ= 23612 -IEluaXRp 23613 -IFJhbmQ= 23614 -IGZpbmlzaGVz 23615 -IOqwiA== 23616 -IHZpdGFt 23617 -IHRlZW5hZ2Vycw== 23618 -IE1vcnJpcw== 23619 -7KSE 23620 -IE9yaQ== 23621 -aXlh 23622 -IG15w7Zz 23623 -U3RlcA== 23624 -IEtyZQ== 23625 -6L6m 23626 -IGRpbm9zYXVy 23627 -IOuqhw== 23628 -YWZmZQ== 23629 -IOuQqeuLiOuLpA== 23630 -IHplZw== 23631 -5YiH 23632 -IE1hbmhhdHRhbg== 23633 -IHN1amV0 23634 -dWVsbGU= 23635 -c3RvZmY= 23636 -IGTDvHI= 23637 -IHN1Ym1hcg== 23638 -ZXNlcw== 23639 -IGFxdWVsZQ== 23640 -IG5vdQ== 23641 -IEZhaXRo 23642 -dHo= 23643 -INGC0L7QvNGD 23644 -YWNldXQ= 23645 -bGllcnM= 23646 -IGJhbmR3aWR0aA== 23647 -xrDhu50= 23648 -IHJlc3BlY3RpdmU= 23649 -IEF2ZQ== 23650 -IHNwcmVhZHNoZQ== 23651 -IFNlbnQ= 23652 -aWNhbWVudGU= 23653 -IGluZnJh 23654 -IGxlYXJuZXJz 23655 -IOCuiQ== 23656 -YWlhaA== 23657 -cmVuYWw= 23658 -IG11c3RhcmQ= 23659 -IGhhYnQ= 23660 -54M= 23661 -IFF1w6k= 23662 -IGFuYWx5emluZw== 23663 -5q+P 23664 -IHNvbGlj 23665 -INeU15XXkA== 23666 -IGNhdXNh 23667 -IHdlbGNvbWVk 23668 -IFN1Y2Nlc3M= 23669 -IGZhY2lsZQ== 23670 -INCf0L7RgtC+0LzRgw== 23671 -c2NoZWlu 23672 -IGZldGNo 23673 -IHN0cmF0 23674 -INGB0YLQvtC40YI= 23675 -7JeQ7ISc64qU 23676 -INGB0L/QvtGB0L7QsQ== 23677 -bWFt 23678 -IHNlcsOtYQ== 23679 -bmFtZW50cw== 23680 -d3JpdGVy 23681 -IGNvbnN1bHRpbmc= 23682 -7ZiA 23683 -IEJlcmtlbGV5 23684 -ZXU= 23685 -YXNpdmU= 23686 -VVU= 23687 -IEFuYWx5dA== 23688 -IHN1Ym1pc3Npb24= 23689 -IG1hZ25pZmljZW50 23690 -ZW56YQ== 23691 -IGVjb24= 23692 -IHByb2ZpbGVz 23693 -IGluY2Fy 23694 -QWI= 23695 -IE51bg== 23696 -IGhpYw== 23697 -c2NyZWFtaW5n 23698 -IHJlc2lsaWVudA== 23699 -5Yip 23700 -Z3J1bmQ= 23701 -IGNvbmN1cg== 23702 -IGJlcmVpdHM= 23703 -TEQ= 23704 -IG51cnQ= 23705 -7Ik= 23706 -IGZlYXN0 23707 -IGVuY3VlbnQ= 23708 -IE1pY2hlbA== 23709 -IHN1cHJlbQ== 23710 -Il0= 23711 -IGZlZWRz 23712 -IEtvbGxlZ2Vu 23713 -aXNzZXI= 23714 -IEZlbmc= 23715 -IFdlbg== 23716 -bXVu 23717 -IHRlbsOtYQ== 23718 -IFdyZXN0 23719 -IOyYpOuKmOydgA== 23720 -IHN0ZWFk 23721 -IHJlc3RvcmF0aW9u 23722 -IGRvbmF0ZWQ= 23723 -IGRlbHM= 23724 -IGNlbnN1cw== 23725 -IGRlc3BlcmF0ZWx5 23726 -d29ydGh5 23727 -SEU= 23728 -IFNwYQ== 23729 -IEJyeWFu 23730 -IGhq 23731 -IFJhdw== 23732 -7JWE6w== 23733 -IENhbWVyYQ== 23734 -IHppZW4= 23735 -IHN0eWw= 23736 -IFRX 23737 -IENoZWVzZQ== 23738 -Ym9ybmU= 23739 -IG9ibA== 23740 -IEFscmVhZHk= 23741 -IHVuc3RhYmxl 23742 -IGZsYW1lcw== 23743 -cG9zdA== 23744 -SGE= 23745 -cm9tYWdu 23746 -IOyXhOuniA== 23747 -ZGVzdA== 23748 -IGtvbGVq 23749 -IHRlbXBvcmFyaWx5 23750 -IGRldGVybWluaW5n 23751 -IEdsYXNz 23752 -0YDQvtC9 23753 -b2xhbg== 23754 -IGRvbWluYXRlZA== 23755 -5YyW 23756 -X19fXw== 23757 -INmH2LDYpw== 23758 -IERhbmE= 23759 -IGRpbmhlaXJv 23760 -YXF1 23761 -66+8 23762 -IMOgcw== 23763 -IEpvZXk= 23764 -IEdyaWZm 23765 -IGF0dGFpbg== 23766 -IHRyYW5zaXRpb25z 23767 -IExpdGVyYWxseQ== 23768 -0LXQvdC0 23769 -IEhhdmVu 23770 -IGdyYWJiaW5n 23771 -IGNyeXN0YWxz 23772 -IEZvdXJ0aA== 23773 -IGNhbmRsZXM= 23774 -INGB0LvRg9GH0LA= 23775 -cmljbw== 23776 -IDUwMDA= 23777 -ZXR0bw== 23778 -IHVuZG8= 23779 -IGt0bw== 23780 -IGRpdmVydA== 23781 -IGNoaXI= 23782 -IHBlcnNlYw== 23783 -IGhpa2luZw== 23784 -IGFubm91bmNlbWVudHM= 23785 -55Sx 23786 -0LfRiw== 23787 -IGF1Yw== 23788 -IHN5c3RlbWlj 23789 -IFJN 23790 -z4POsQ== 23791 -INCU0LY= 23792 -IHlhcg== 23793 -IFdhcmQ= 23794 -IHBpc3NlZA== 23795 -IGNhcm4= 23796 -IGF1dG9ub21vdXM= 23797 -44WO44WO 23798 -c292ZXI= 23799 -5rKS6Yyv 23800 -5b6I5aW9 23801 -IHJlZmxleA== 23802 -IGdhcmRlbnM= 23803 -IGRhdGVk 23804 -7LE= 23805 -YW1pxJk= 23806 -IGNvbnRpbnVpdHk= 23807 -IGNpdGl6ZW5zaGlw 23808 -IHNjaHdlcg== 23809 -IHphaw== 23810 -dGFibGU= 23811 -INGB0Yc= 23812 -6KeB 23813 -IM+DzrU= 23814 -IGdlbmVyYXRlcw== 23815 -6rWs64KY 23816 -w7Zo 23817 -w7Nt 23818 -YWxhbQ== 23819 -IEpVRFk= 23820 -IEJ1Zw== 23821 -IOOBpg== 23822 -IGRyb25lcw== 23823 -IMOhZ3Vh 23824 -YWNha3M= 23825 -5po= 23826 -INCa0L7QvQ== 23827 -15bXlA== 23828 -IHN0cml2ZQ== 23829 -IEFsdGVybg== 23830 -IG5lYXJlc3Q= 23831 -IHByb3llY3Q= 23832 -dGVyYQ== 23833 -IEFTSExFWQ== 23834 -IHdvcm0= 23835 -IHJlcGxheQ== 23836 -IHRhcmE= 23837 -IEluZGlhbnM= 23838 -44Kw 23839 -aWNhaWQ= 23840 -IOyInA== 23841 -IGFwcGVhbGluZw== 23842 -IFdlcw== 23843 -IG1lbnRpb25z 23844 -INC00LXQu9C1 23845 -IGt3 23846 -IGZyYWdpbGU= 23847 -aXN6 23848 -a8Ozdw== 23849 -aGFuZw== 23850 -Y29sb3I= 23851 -IHByZXNpZGVudGU= 23852 -ODc= 23853 -0LXRhA== 23854 -54i4 23855 -INC00L7QsdCw0LI= 23856 -IE5lbHNvbg== 23857 -w6FmaWM= 23858 -IE1JQ0hBRUw= 23859 -IG1lY2hhbmlj 23860 -IG1ldHJlcw== 23861 -IG9jenl3acWbY2ll 23862 -IENpbmQ= 23863 -IG9nc8Ol 23864 -IGxhbmRzY2E= 23865 -QUNF 23866 -IGhlYWRsaW5lcw== 23867 -IGNhdGFseXN0 23868 -IENhdGNo 23869 -aW5rbGVz 23870 -IHBpbGxz 23871 -b3Jkbw== 23872 -IGltbWlncmFudA== 23873 -IGV4YW1pbmF0aW9u 23874 -IGFjY2lkZW50cw== 23875 -esSFZA== 23876 -IHF1aWVyZQ== 23877 -IG5lbGxh 23878 -IDY3 23879 -IHBhc3Nh 23880 -IHN1cGVyZmlj 23881 -aXN0b3I= 23882 -IG5vdg== 23883 -64u1 23884 -IG1hbmRhdGU= 23885 -aXNvbnM= 23886 -IFZpcnR1YWw= 23887 -IHNlbGJlcg== 23888 -IGNvdW5zZWxpbmc= 23889 -IE5CQQ== 23890 -IHNlcHQ= 23891 -IGJlbGlldmVy 23892 -IG1hcnZlbA== 23893 -IEludGVncg== 23894 -INC80ZY= 23895 -IG9ycGg= 23896 -IGJhY2t3YXJk 23897 -IEdlbmVyYXRpb24= 23898 -IFBpY3Q= 23899 -INGC0L7Rgg== 23900 -IHRhcGk= 23901 -cHJvY2hlbg== 23902 -IGhhbGx3YXk= 23903 -aHRl 23904 -INuB25I= 23905 -IFp1bQ== 23906 -6ICB5bir 23907 -YWNobWVudA== 23908 -aXF1ZXI= 23909 -Zm9sZw== 23910 -IEVkZGll 23911 -IEtpbA== 23912 -IHdlbGxuZXNz 23913 -c3RvY2s= 23914 -6LyD 23915 -IGthw6c= 23916 -IHRlcnJvcmlzbQ== 23917 -IHBvaW50ZXI= 23918 -T2Y= 23919 -aGVyaWM= 23920 -IFVsdGltYXRlbHk= 23921 -IG1lc2Vz 23922 -IFRyYWRl 23923 -IHBpbnQ= 23924 -IHR1aXRpb24= 23925 -IGRpc2FncmU= 23926 -IOqyjOyehA== 23927 -IG1hbnVzY3JpcHQ= 23928 -IHJvb21t 23929 -IG91dHB1dHM= 23930 -0LXRhtC4 23931 -IHJpZXM= 23932 -IHNhbHVk 23933 -b3R6ZGVt 23934 -IG1hc3Nlcw== 23935 -IGJ5xYJh 23936 -IGNsZWFyaW5n 23937 -IGRpc2NvdXJzZQ== 23938 -YXRzb24= 23939 -IGZvbGRlZA== 23940 -IEphcg== 23941 -2YTZiQ== 23942 -OTAw 23943 -INGD0YHQvw== 23944 -IHByb3BoZWN5 23945 -IGludGVyZmVyZQ== 23946 -0LjRhdC+0LQ= 23947 -4LmM 23948 -IHRocmk= 23949 -INee16k= 23950 -IGxhesSxbQ== 23951 -IDE5OTI= 23952 -IGZ1dHVybw== 23953 -IGxvY2tpbmc= 23954 -IGVtYmFyZ28= 23955 -IE5laXRoZXI= 23956 -aXZhbWVudGU= 23957 -IG3DpXN0ZQ== 23958 -IG1paw== 23959 -IGNvbGxlY3Rvcg== 23960 -0LXQutC+0YLQvtGA 23961 -IEdhbmQ= 23962 -IHNlbnRpcg== 23963 -IE1pZ2h0 23964 -5aGU 23965 -IGdhbnplbg== 23966 -VUM= 23967 -IHJlbGF0aW5n 23968 -U0Q= 23969 -IG1vc3F1aXRv 23970 -R1I= 23971 -IGhvbGxvdw== 23972 -4piF 23973 -IFdhbGtlcg== 23974 -IGFmZmlsaWF0ZQ== 23975 -IGR1cGxpY2F0ZQ== 23976 -0L3QtdC8 23977 -IGdyYXBl 23978 -IE9yZ2FuaXphdGlvbg== 23979 -IHN5bnQ= 23980 -Sm9l 23981 -IGdlZw== 23982 -IHJldmVhbGluZw== 23983 -IEV0aGFu 23984 -b3V0ZXI= 23985 -IHlheQ== 23986 -6auU 23987 -0LvQsNGA 23988 -IHJlcG9ydGVkbHk= 23989 -IGlocmVy 23990 -IHJlY29nbmlzZQ== 23991 -IGJ1bXBlcg== 23992 -IFJhbmR5 23993 -IFZlbnVz 23994 -dGxlcw== 23995 -IGFwcGV0aXRl 23996 -IGdsdWNvc2U= 23997 -IGNob2R6aQ== 23998 -IEZ1cnRoZXJtb3Jl 23999 -dGly 24000 -IGNvbnRh 24001 -IGludHVpdGlvbg== 24002 -IGFsdGl0dWRl 24003 -IGNodW5rcw== 24004 -IEpvc2h1YQ== 24005 -xLHEn8SxbQ== 24006 -cnlsaWM= 24007 -bGVhbnM= 24008 -IO2UvOs= 24009 -TEw= 24010 -UXVl 24011 -IGdvcg== 24012 -INC30L3QsNGH0LjRgg== 24013 -IHBvZW1z 24014 -IGV4Y2Vs 24015 -IGV4cGxvcmVk 24016 -IHBvcHVs 24017 -IGluY2x1c28= 24018 -c3TDpA== 24019 -IEdhdmlu 24020 -YWxsaW5n 24021 -IM+Ezr/OvQ== 24022 -6ak= 24023 -YXJiZWl0 24024 -IEdhcw== 24025 -IGdsb3Jpb3Vz 24026 -cmllYmVu 24027 -IHNwYW0= 24028 -IGluZG9vcg== 24029 -IHRocnVzdA== 24030 -IEFsZA== 24031 -IFByaW9y 24032 -IG9uYm9hcmQ= 24033 -44Gg44GV44GE 24034 -b2Nh 24035 -QVNI 24036 -o6A= 24037 -IENocmlzdGluZQ== 24038 -IGRyYXdlcg== 24039 -IG5vb24= 24040 -IOyemOs= 24041 -IHBlcm1hbmVudGx5 24042 -5rex 24043 -INC90LDQv9GA0LjQvNC10YA= 24044 -IHBvZGNhc3Rz 24045 -ZXJhcGV1dA== 24046 -cHJpdA== 24047 -IHN0YWlubGVzcw== 24048 -INqp25I= 24049 -IGZhbWlsaWE= 24050 -INGA0LDQt9GA 24051 -dW50bw== 24052 -INGB0YLQvtC7 24053 -IGjDpA== 24054 -IEhhaQ== 24055 -IFBC 24056 -aXpvbg== 24057 -IGtvbm50ZQ== 24058 -IGLDvHnDvGs= 24059 -IHV0aWxpemFy 24060 -2oY= 24061 -IGFxdWVzdGE= 24062 -IG1peGVy 24063 -dWRlbnQ= 24064 -0LvQtdC60YE= 24065 -xYJ1 24066 -INGB0LjRgdGC0LXQvA== 24067 -INC90L7RgNC8 24068 -IGZhdGFs 24069 -IGNvbnNpZGVyYXRpb25z 24070 -IHZhbGlkYXRpb24= 24071 -IG9saQ== 24072 -IGthcmRlxZ8= 24073 -IEdMT1JJQQ== 24074 -IHBhbGw= 24075 -0LXRgdGC0LU= 24076 -IHJlY3Rhbmc= 24077 -IG1lZGlldmFs 24078 -YWxsYWhp 24079 -YXN0aQ== 24080 -IFN5cmlhbg== 24081 -IHNoZWFy 24082 -IGRlYnVn 24083 -IE1haQ== 24084 -IGtub2NraW5n 24085 -IExleA== 24086 -YXJkYW4= 24087 -cm92 24088 -IG1lbW9yaWFs 24089 -5rCj 24090 -b29reQ== 24091 -IHN0dWZmZWQ= 24092 -IHBhc3PDqQ== 24093 -IHdpZw== 24094 -gqA= 24095 -IHByw7N4aW1h 24096 -IDE5OTE= 24097 -INC80LXQttC00YM= 24098 -IG51ZXN0cm9z 24099 -IEJlYXN0 24100 -IHNtbw== 24101 -YXRjaGVk 24102 -b2xvZ2lh 24103 -INC80L7QtA== 24104 -IGdlZQ== 24105 -IGNvbmNlcHR1YWw= 24106 -IMO0 24107 -IGRlY3JlYXNlcw== 24108 -IHF1ZXJpZXM= 24109 -0L7Qu9GM0Yg= 24110 -IEFwYXJ0 24111 -IGV4ZW1wbA== 24112 -5bGx 24113 -IGZsZWQ= 24114 -IE9GRg== 24115 -Z2dhaw== 24116 -IGJlYWQ= 24117 -aGly 24118 -bGllcw== 24119 -IENsZWFybHk= 24120 -xLFsYXI= 24121 -IGNoZXNz 24122 -IHdoaWNoZXZlcg== 24123 -IDk2 24124 -4bqx 24125 -IHJlc3BlY3Rz 24126 -INC80L7RgA== 24127 -IG9yZ2FuaXNt 24128 -IGdyYW5kcGE= 24129 -IFZpZQ== 24130 -6Lef5L2g 24131 -IGZsb29kaW5n 24132 -IHVwZ3JhZGVk 24133 -0ZHRgA== 24134 -IGNoZWVrcw== 24135 -IGNvbnF1ZXI= 24136 -IHN0dWJib3Ju 24137 -IHB1enpsZXM= 24138 -IGF1Y3Rpb24= 24139 -IHJlbHlpbmc= 24140 -IFBST0Y= 24141 -IEVzcGVy 24142 -INCc0KM= 24143 -IGh5cGU= 24144 -IHBvc3NpYmls 24145 -IGltcHJpc29u 24146 -IEVybg== 24147 -7JeI7Iq164uI64uk 24148 -IGVudmll 24149 -IHJlc3VycmVjdGlvbg== 24150 -5LiN6KGM 24151 -IHNwZXI= 24152 -IFZlbmV6dWVsYQ== 24153 -c29t 24154 -IOyeoOq5 24155 -IG5vdXZlbGxl 24156 -IGNsb3Nlcw== 24157 -IDE5NDA= 24158 -IHF1YQ== 24159 -IEphcmVk 24160 -IFBpcg== 24161 -IGluZGU= 24162 -IHNjcnVi 24163 -dWt1 24164 -IHJlcXVpcmluZw== 24165 -INCy0LDQvNC4 24166 -IGNvbnNpZGVyYWJsZQ== 24167 -5ZCb 24168 -aWxpYQ== 24169 -IGlubmU= 24170 -IG1laW5lbQ== 24171 -IGhhcmRzaGlw 24172 -IHRyYXBz 24173 -cm9j 24174 -IOyEpOs= 24175 -IHJlc2VhcmNoaW5n 24176 -IE1hcmdhcmV0 24177 -IHBlbm55 24178 -IGLEsXJhaw== 24179 -0ZHQuw== 24180 -IHdvb2w= 24181 -IHJoZXQ= 24182 -IGZsYXR0ZW4= 24183 -54c= 24184 -4LmA4Lij 24185 -IHBpZWQ= 24186 -IENoYXA= 24187 -IHVuZGVybQ== 24188 -IGZyZXQ= 24189 -IGNyYXNoZWQ= 24190 -IEZyYXVlbg== 24191 -2LDZhw== 24192 -aXZhbg== 24193 -IGxpdGVyYXJ5 24194 -bGF0ZWdv 24195 -IHNww6R0ZXI= 24196 -IHNpbWlsYXJpdGllcw== 24197 -4oY= 24198 -IENvcm9u 24199 -IENyZWVr 24200 -IGJvc3Nlcw== 24201 -IGFjY29tcGFuaWVk 24202 -IGRlYmF0ZXM= 24203 -IGFzc2VtYmxlZA== 24204 -IMOB 24205 -IFZhaQ== 24206 -IHRyYWN0 24207 -IHNpbXBsZW1lbnQ= 24208 -IEFyaW4= 24209 -IHZ1bG5lcmFiaWxpdHk= 24210 -IGhvcm1vbmU= 24211 -SUVM 24212 -T09L 24213 -IHJlbGF5 24214 -IEFuZHJlYQ== 24215 -cmls 24216 -IG5lY2Vzc2l0eQ== 24217 -YWNldXRpY2Fs 24218 -0Y7RiQ== 24219 -b3VzaW5n 24220 -bmFobWVu 24221 -IGZvb3RwcmludA== 24222 -bWFw 24223 -IFRpZXI= 24224 -YW5ueWE= 24225 -aW50ZW5k 24226 -5Zau 24227 -5aI= 24228 -IGRlY29yYXRl 24229 -IHpvbWJpZXM= 24230 -IEh5ZA== 24231 -IFN1eg== 24232 -IGNhbXB1c2Vz 24233 -IEVtYg== 24234 -IHRocm90dGxl 24235 -IGFkbWlu 24236 -IG9wb3J0dW4= 24237 -IG1pcnJvcnM= 24238 -IGlkZW50aXRpZXM= 24239 -IENsaW4= 24240 -IOu5hOs= 24241 -4bmj 24242 -IE90dA== 24243 -IGJsdWVz 24244 -IGltcHJlc3Npb25z 24245 -LSw= 24246 -IHZhZ3Vl 24247 -YWZl 24248 -IGluZmVyaW9y 24249 -ZXJhbGQ= 24250 -IG1lZGljaW5lcw== 24251 -IHByZWd1bnRh 24252 -b3NlbHk= 24253 -IHTDqWzDqQ== 24254 -IE1vbnRo 24255 -IExlYWRlcnM= 24256 -IEVneXB0aWFu 24257 -IHJhdGlvbg== 24258 -a2Vycw== 24259 -aGVpdHM= 24260 -IHJlY2h0 24261 -UGxheQ== 24262 -IGVn 24263 -IHBvbGxz 24264 -IFdPT0RS 24265 -IHNsb3Rz 24266 -amFt 24267 -Qm90aA== 24268 -IFJhdA== 24269 -0YDQsNC2 24270 -IEJyaWdodA== 24271 -5LiA5a6a 24272 -4buRaQ== 24273 -dXJpb3Vz 24274 -IHNpbmdlcnM= 24275 -IGxvZ2lu 24276 -IHTDqm0= 24277 -bGF0aW9u 24278 -IE11bQ== 24279 -xrDhu51uZw== 24280 -IEVkaXRvcg== 24281 -5ZCR 24282 -IGlubm92YXRpb25z 24283 -aGF2ZQ== 24284 -IFNlaw== 24285 -IHdlYWtlcg== 24286 -IEdvYg== 24287 -QWZ0ZXI= 24288 -tOyngA== 24289 -IOusuOygnA== 24290 -44O844O8 24291 -IGRpc2FkdmFudGFnZQ== 24292 -56K6 24293 -IGdhemU= 24294 -IE1hY2s= 24295 -z4HOrw== 24296 -IEtpc3M= 24297 -IEhvbG8= 24298 -IEJpcnRo 24299 -aXpp 24300 -YmFi 24301 -5L+d 24302 -7Iuc6rOg 24303 -0LTQtdGA0LY= 24304 -IHNxdWF0 24305 -0LrRg9GB 24306 -dW5p 24307 -IENvbW1l 24308 -IFdPT0RSVUZG 24309 -IENoYW1waW9uc2hpcA== 24310 -IHdlbGNoZQ== 24311 -IFlvdXRo 24312 -emVt 24313 -IG9kcG93 24314 -IHBlcnNpc3RlbnQ= 24315 -cnV0 24316 -7JSp 24317 -7Zal 24318 -bGFpcg== 24319 -aWt1 24320 -IHZlbmRvcg== 24321 -IGNow7puZw== 24322 -IGZpbmFuY2k= 24323 -IG92ZXJseQ== 24324 -w6J1 24325 -IGdsdXRlbg== 24326 -IDE4MDA= 24327 -IGRpdmlzaW9ucw== 24328 -IGNpdWRhZA== 24329 -IG9iZWQ= 24330 -IHdhcnVt 24331 -IGVoZXI= 24332 -IGVsaW0= 24333 -INCS0L4= 24334 -IHBldXZlbnQ= 24335 -IFdhbm5h 24336 -IGF0dGVuZGFuY2U= 24337 -IGFzc2Vzc21lbnRz 24338 -IEJvZw== 24339 -IGltYWdlcnk= 24340 -IGNvbGxlY3RpdmVseQ== 24341 -IGluZm9ybWFs 24342 -IFNjaHdl 24343 -IGRldXRsaWNo 24344 -IENoZWw= 24345 -IFBF 24346 -b3dlZA== 24347 -IGJhbm5lcg== 24348 -IHNoZWx2ZXM= 24349 -IFJldHVybg== 24350 -5ou/ 24351 -TEFVR0hT 24352 -IGNvbmdyYXR1bGF0ZQ== 24353 -IE5vcndheQ== 24354 -IGR3ZWxs 24355 -IENhcmliYmVhbg== 24356 -IG5vcm1z 24357 -IEFuaW1hbA== 24358 -IFZhbGVudGluZQ== 24359 -IGV4dGVuZGluZw== 24360 -IFZvdQ== 24361 -b3Jy 24362 -IENoZW5n 24363 -wqE= 24364 -INC00L7RgNC+0LM= 24365 -IHZlZw== 24366 -IGjDpQ== 24367 -IFhpbg== 24368 -IOy5tOs= 24369 -ZW1ldA== 24370 -IGh5cG90aA== 24371 -IGludGVyZXNzYW50ZQ== 24372 -cmljZXM= 24373 -SVo= 24374 -IFVTRA== 24375 -IHJ1bm5lcg== 24376 -IEJhZw== 24377 -IOq9 24378 -IGNvbWXDp2Fy 24379 -IHBpZ3M= 24380 -IHdlYWtuZXNzZXM= 24381 -UGg= 24382 -IFZpb2w= 24383 -5LiN55So 24384 -IGRyYWdnaW5n 24385 -IEFxdcOt 24386 -IENTUw== 24387 -IG1pbGxpbWV0ZXJz 24388 -IGVzdMOhcw== 24389 -IGFjdXRl 24390 -IGRlamFy 24391 -acSf 24392 -b2JyYQ== 24393 -TG92ZQ== 24394 -IHNpbGs= 24395 -KioqKg== 24396 -IGpvaW5z 24397 -IHByb2w= 24398 -IOqwkOyCrO2VqeuLiOuLpA== 24399 -5pSv 24400 -2K3Yrw== 24401 -YWdoZXR0aQ== 24402 -w6RubmVy 24403 -IHN0cmFuZw== 24404 -IGRvdWJsZWQ= 24405 -IGRlc2NyaXB0aW9ucw== 24406 -IHN0ZWxsZW4= 24407 -IHBhcnRp 24408 -56uL 24409 -soTr 24410 -IMO2xJ8= 24411 -aWdoaW5n 24412 -IGFuZ3VsYXI= 24413 -IG5hdHV1cg== 24414 -IFNoZWw= 24415 -xrDGoQ== 24416 -IHJheXM= 24417 -IHNlcGVy 24418 -c3RhcnQ= 24419 -dmlzZWQ= 24420 -IHJ1c2hlZA== 24421 -IGludGVybmF0aW9uYWxseQ== 24422 -IG5pdmVs 24423 -IGJveGluZw== 24424 -ZmFsbGVu 24425 -4buRYw== 24426 -IHNlaW5lbg== 24427 -cGxpY2l0eQ== 24428 -IGNhcmJvaA== 24429 -IFRyYXZpcw== 24430 -dXNv 24431 -IFBoYXNl 24432 -IGFjdGl2YXRpb24= 24433 -IG9waW8= 24434 -t6g= 24435 -IGRlY3JlYXNlZA== 24436 -Q2Fy 24437 -IGJ1bmRsZQ== 24438 -IGV4cGVuZA== 24439 -b3JtYWw= 24440 -IGFkamFjZW50 24441 -IG1lZQ== 24442 -INC+0YDQsw== 24443 -IHRyYW5zY3JpcHQ= 24444 -IExhbmd1YWdl 24445 -R1M= 24446 -6KeJ 24447 -IHNldWw= 24448 -w6BuaA== 24449 -IG55YQ== 24450 -bmluZ3M= 24451 -IOyLnOs= 24452 -IOuUsOudvA== 24453 -IEFncg== 24454 -w61k 24455 -55WZ 24456 -IGFieQ== 24457 -IE5lbw== 24458 -xLF5b3J1eg== 24459 -IFRoaW5raW5n 24460 -YWltZQ== 24461 -IHZpdGU= 24462 -IHRyYXbDqXM= 24463 -INeR16I= 24464 -INC80LXQtA== 24465 -T3Vy 24466 -aG9vdA== 24467 -IGxpbmVy 24468 -IFBpenph 24469 -IGh5Zw== 24470 -ZmxpZXM= 24471 -IENvbnRpbnVl 24472 -IGRlbnRhbA== 24473 -IFRpYg== 24474 -IHJlZ3VsYXRl 24475 -bGllw58= 24476 -QUxL 24477 -IFRhZQ== 24478 -6ri4 24479 -IEJyZXhpdA== 24480 -IEd1dA== 24481 -IG9jY3VwYXRpb24= 24482 -IHpyb2Jp 24483 -w6Jt 24484 -IHdoaXNr 24485 -5LiW55WM 24486 -IGthbnNrZQ== 24487 -b21vbg== 24488 -cm9iZQ== 24489 -IHdhcmZhcmU= 24490 -IHRo4buD 24491 -IGpha2k= 24492 -IHN0cm9rZXM= 24493 -IHBlYXM= 24494 -IERhbWl0 24495 -SEFO 24496 -IGludGVyZmVyZW5jZQ== 24497 -INC80LjQvdGD0YI= 24498 -TkVS 24499 -b3V0aW5n 24500 -IHRleHR1cmVz 24501 -n4k= 24502 -b3dp 24503 -IO2VmQ== 24504 -IGRlbnM= 24505 -IHByb3RhZ29uaXN0 24506 -w6Rubg== 24507 -IGdvZGRlc3M= 24508 -IHdvbGx0ZQ== 24509 -aWpv 24510 -IFdvY2hl 24511 -IFZQTg== 24512 -c3Rvcnk= 24513 -IGtpbmRlcmc= 24514 -IGZ1bm5lbA== 24515 -IGRpc3RyZXNz 24516 -0L3QvtGB0YLRjNGO 24517 -IG5vaXN5 24518 -INC/0YDQvtC00L7Qu9C2 24519 -IGRhcmFu 24520 -IGVuenltZQ== 24521 -0LvQvtC2 24522 -IG11dGU= 24523 -IGR3YXI= 24524 -INin2LM= 24525 -IGtvbXBs 24526 -IG1lcml0 24527 -IGZvc3Nl 24528 -IERyaW5r 24529 -IGZvcmE= 24530 -IHdvaGw= 24531 -IGJyZWV6ZQ== 24532 -IHNhbml0 24533 -IGRyaW4= 24534 -IOydtOqxsOuKlA== 24535 -IDYy 24536 -IOywqOs= 24537 -YWJ5dGVz 24538 -IGRlZWRz 24539 -INC5 24540 -acOobWU= 24541 -aWdnbGluZw== 24542 -ICIn 24543 -INGH0LDRgdGC0Yw= 24544 -IEFuc3dlcg== 24545 -IGV2YW5nZWw= 24546 -IDEwODA= 24547 -IFZpc2l0 24548 -aWNpZW50 24549 -IHJlbGlhYmlsaXR5 24550 -0Y7RgdGM 24551 -IEVhcmxpZXI= 24552 -IGZpZA== 24553 -562J5LiA5LiL 24554 -IHNsZWV2ZXM= 24555 -aXlvcnN1bg== 24556 -IGJpYg== 24557 -IEFjY291bnQ= 24558 -0Y/Qu9C4 24559 -Y2lwbGluYXJ5 24560 -emFz 24561 -INCx0LXRgA== 24562 -IG5lY2tsYWNl 24563 -IGJsZW5kZXI= 24564 -IFBoaWxsaXBz 24565 -ZXRp 24566 -IEp1cGl0ZXI= 24567 -IHByb3ZvYw== 24568 -IFllYXJz 24569 -ZW50cmU= 24570 -YWNpbw== 24571 -IGvDvA== 24572 -IGFudGVubmE= 24573 -IG5vdmVscw== 24574 -IGZhcnQ= 24575 -IFN1Z2Fy 24576 -IEp1ZHk= 24577 -IGNvbGxhcHNlZA== 24578 -57A= 24579 -cml0aXM= 24580 -IOyDge2ZqQ== 24581 -0JfQqw== 24582 -IFZlcmY= 24583 -cmFuZWFu 24584 -ZXJldW0= 24585 -IFRhcmdldA== 24586 -IDg4 24587 -INCY0Lc= 24588 -aWRlbw== 24589 -IHJlZ3Jlc3Npb24= 24590 -7Lac 24591 -IG3Ds3dp 24592 -IHN0dWRpb3M= 24593 -aWVucw== 24594 -aXBo 24595 -IGZyeWluZw== 24596 -IGZhc2NpbmF0ZWQ= 24597 -IFdhaA== 24598 -YnVja3M= 24599 -bWF5YQ== 24600 -IFNhdHVybg== 24601 -IE1vbW15 24602 -IHJhdGluZ3M= 24603 -IGF1dHVtbg== 24604 -xrDGoW5n 24605 -IGxvc2Vy 24606 -IGNlbnRybw== 24607 -w6lyaWV1cg== 24608 -IEZvbGQ= 24609 -IHN1cGVydmlzb3I= 24610 -IE5vYmVs 24611 -IHVuZGVyZXN0 24612 -b2JpYQ== 24613 -INCy0YHRjw== 24614 -IHZlcnc= 24615 -IGZ1ZWxz 24616 -IGFydGlmYWN0cw== 24617 -IOu2mQ== 24618 -IEF1dG9t 24619 -55qE5piv 24620 -25Q= 24621 -15XXoQ== 24622 -IGlobmVu 24623 -IDU5 24624 -b3VuZGluZw== 24625 -0LXRgNGL 24626 -aW5hcnM= 24627 -Y2hhbnQ= 24628 -IGFkZGljdGVk 24629 -IGV4cGxvc2l2ZQ== 24630 -IGRpc3BlcnM= 24631 -4paI 24632 -YXhpcw== 24633 -QVJZ 24634 -IGx1bQ== 24635 -INGD0YHQuw== 24636 -INiM 24637 -IHJ1cGVlcw== 24638 -IFBlYXJs 24639 -Y2FtcA== 24640 -dHY= 24641 -b3lh 24642 -IGNvbmNsdWRlcw== 24643 -IGNvbGxpc2lvbg== 24644 -IGJ1eWVy 24645 -IHBsYXlncm91bmQ= 24646 -IHNwcmluZ3M= 24647 -IGZlbWluaW5l 24648 -IFJhcw== 24649 -IGluY2FyY2Vy 24650 -7ZeY 24651 -IGRpYWxlY3Q= 24652 -IGNsb3N1cmU= 24653 -IGNoYXR0aW5n 24654 -IGJhYmU= 24655 -IHNwb3RsaWdodA== 24656 -IG5vdGF0aW9u 24657 -6Lev 24658 -U3Rhcg== 24659 -acOjbw== 24660 -IHTDqnRl 24661 -IHRpZGU= 24662 -IGp1bnRv 24663 -IHNlbmF0b3I= 24664 -0KU= 24665 -IGV4Y3VzZXM= 24666 -IGJsaW5r 24667 -IGFkbWlzc2lvbg== 24668 -IExpbHk= 24669 -0YvQvNC4 24670 -IGFtaWdv 24671 -IGx1c3Q= 24672 -64us 24673 -IGFtaW5v 24674 -5LqL5oOF 24675 -IGNvbnN1bHRhbnQ= 24676 -IEVsZWN0cmlj 24677 -IOuFuOuemA== 24678 -dWphaA== 24679 -IHNob290ZXI= 24680 -aWNodGVu 24681 -IFVrcmFpbmlhbg== 24682 -IGFpbXM= 24683 -IEVudGVydGFpbg== 24684 -IG1pcmFjbGVz 24685 -6K2w 24686 -IHplaWdlbg== 24687 -IGxhbQ== 24688 -IHJlc3M= 24689 -IEppbGw= 24690 -eWxhbg== 24691 -IHJvb2s= 24692 -IGhheWE= 24693 -IHBhc3Nwb3J0 24694 -YWRhdGE= 24695 -IGp1aWN5 24696 -Y29uZg== 24697 -0LvQtdC5 24698 -IFN6 24699 -IGludGVyY2VwdA== 24700 -44GC44KK44GM44Go44GG44GU44GW 24701 -IFRlYW1z 24702 -IG1ha2Vu 24703 -aXJyZWw= 24704 -IExJS0U= 24705 -4bqteQ== 24706 -6rWw 24707 -IHNob3J0YWdl 24708 -IHBhcmFkaWdt 24709 -IHBhcGVs 24710 -IGFzdGVybw== 24711 -44G+44Gf 24712 -IHNvbGxlbg== 24713 -IE1pY2tleQ== 24714 -IE9ybGVhbnM= 24715 -IGNob2xlc3Rlcm9s 24716 -IGdvb3Nl 24717 -0YbQuNGO 24718 -44GC44KL 24719 -IEZM 24720 -INCz0L7Qu9C+0LI= 24721 -IHRyaWJ1dGU= 24722 -IEdhbQ== 24723 -IMOpdmlkZW1tZW50 24724 -0Y/RhQ== 24725 -5a6e 24726 -55Sw 24727 -IGluYXBwcm9wcmk= 24728 -dWhhbg== 24729 -IG9yZ2FuaXphdGlvbmFs 24730 -YWlsZWQ= 24731 -IGVuZHVyZQ== 24732 -IDc2 24733 -IHNob3RndW4= 24734 -IGxpdnJl 24735 -IHN1aXRlZA== 24736 -IHdhcm10aA== 24737 -IFNJTQ== 24738 -IGVudmlzaW9u 24739 -IGRlZ3JhZA== 24740 -w65uZQ== 24741 -TGF1Z2hpbmc= 24742 -IFdob2V2ZXI= 24743 -IEJ1ZGRoaXNt 24744 -IHNwcmlua2xl 24745 -Y2XEn2l6 24746 -IHJ1aW5z 24747 -IHN0YXJjaA== 24748 -IEhlcno= 24749 -IGluanVzdGljZQ== 24750 -IGh1bWlkaXR5 24751 -0L7QttCw0LvRg9C5 24752 -IE9iamVjdA== 24753 -IElnbg== 24754 -IEV4YW0= 24755 -aWdlcnM= 24756 -IHRob3U= 24757 -IFNveQ== 24758 -aXZhcw== 24759 -IHBvbGVz 24760 -bWF0aA== 24761 -INCy0L3QuNC8 24762 -SU5HSU5H 24763 -ZWRyYWw= 24764 -IGV4cGxvcg== 24765 -IHJvYXN0ZWQ= 24766 -IGNyYXds 24767 -IGNvZmY= 24768 -IGFub20= 24769 -IHdpag== 24770 -IGltcHJvdmVz 24771 -IHRyZWF0eQ== 24772 -IGRpc2NvdmVyaW5n 24773 -IHN0YXR1dGU= 24774 -IG1lcmNhZG8= 24775 -INGB0LjQuw== 24776 -IGludGVs 24777 -IENoYW5jZWxsb3I= 24778 -IE1lZGljYWlk 24779 -dWdp 24780 -IHZlcmJhbA== 24781 -IGTDtm4= 24782 -IHNjcmlwdHVyZQ== 24783 -IGl0ZXJhdGlvbg== 24784 -ZWtz 24785 -IE94Zm9yZA== 24786 -IHfDpGg= 24787 -IFZhZA== 24788 -IEFL 24789 -IOyVhOydtOs= 24790 -IGlldHM= 24791 -IG5lZWRsZXM= 24792 -2YPZhQ== 24793 -IHBhc2Fkbw== 24794 -IGFsYnVtcw== 24795 -IHllYQ== 24796 -ZXR6ZW4= 24797 -hOuPhA== 24798 -IGRldGVybWluZXM= 24799 -IHRoZWU= 24800 -IFBsYXlpbmc= 24801 -w6RydA== 24802 -INem 24803 -Y2xlZA== 24804 -IGRvd253YXJk 24805 -YWxvbmU= 24806 -IHNvbHU= 24807 -IHBhcnRpdGlvbg== 24808 -IHd6 24809 -ZGQ= 24810 -IHBlc3NvYWw= 24811 -5aq9 24812 -IGZhY3Rvcmllcw== 24813 -IGJsZWlidA== 24814 -4Lih4Liy 24815 -YWxzYQ== 24816 -IE5GTA== 24817 -IGZ1ZXJh 24818 -IHJlc2VydmVk 24819 -IEVhcm4= 24820 -IGhlbHQ= 24821 -IHNob3J0Y3V0 24822 -IGNvbnZpbmNpbmc= 24823 -c3BhY2U= 24824 -IGVuZm9yY2U= 24825 -IGNvcmVz 24826 -IGVmdGVy 24827 -IHJlY2Vzc2lvbg== 24828 -eGljbw== 24829 -IHByb3Bvc2l0aW9u 24830 -YXJpYW5z 24831 -cm9wb2w= 24832 -IOuqsOs= 24833 -IM6c 24834 -IOyalOymmA== 24835 -IGFjdGl2aXN0 24836 -IGNvbnZpY3Rpb24= 24837 -IHphYg== 24838 -IGNhbmNlbGVk 24839 -0YLQvtGH0L3Qvg== 24840 -IM6u 24841 -6YCZ5qij5a2Q 24842 -bml0ZQ== 24843 -IGZ1bmRyYQ== 24844 -YnV6emVy 24845 -0LXQu9C+ 24846 -aWNhdGlvbnM= 24847 -IHpvbmE= 24848 -IHRlZW5z 24849 -IG1ldGhvZG9sb2d5 24850 -IOykkeyalA== 24851 -dGhhbg== 24852 -IFVs 24853 -IEdyZXk= 24854 -IGhvZw== 24855 -SU5L 24856 -IFN1bmc= 24857 -IENsYXVk 24858 -IENOTg== 24859 -IGRlbGl2ZXJz 24860 -YWxpbg== 24861 -IEFkb2Jl 24862 -b3RoZQ== 24863 -IERlc3dlZ2Vu 24864 -4Liz 24865 -IHdlcmRl 24866 -IGdyZWFzZQ== 24867 -IHVwZ3JhZGVz 24868 -IEZpbmxhbmQ= 24869 -YWNjZXB0 24870 -IGludGVycm9n 24871 -YmVl 24872 -IOOBqw== 24873 -IHByZWRl 24874 -IE5lcA== 24875 -IENhbWJyaWRnZQ== 24876 -IGdyYXBocw== 24877 -IGhhdW50ZWQ= 24878 -0YHQtdC8 24879 -5qc= 24880 -5YWL 24881 -U29tZQ== 24882 -IE1hbGw= 24883 -IHJlaGVhcnNhbA== 24884 -IFVyYmFu 24885 -IExhZw== 24886 -IG5pbQ== 24887 -6rCV 24888 -IHBvc2l0aW9uZWQ= 24889 -IGF2b2lkZWQ= 24890 -RU1B 24891 -IGxsZWdhcg== 24892 -IHLDoXBpZG8= 24893 -IGdvdXZlcm4= 24894 -IGhpbmc= 24895 -IGRlYWxlcg== 24896 -IHJlZm9ybXM= 24897 -IGZhdHR5 24898 -0LrQvtC7 24899 -IEFjZQ== 24900 -IG5lcA== 24901 -IOyyrQ== 24902 -IGNvbXB1dGF0aW9u 24903 -IFN0cmVhbQ== 24904 -Ym91cm5l 24905 -dHVy 24906 -UG9y 24907 -IHNsZWVweQ== 24908 -IGJhbmdldA== 24909 -44GC44Gu 24910 -IHdlaWdocw== 24911 -IGJsZWliZW4= 24912 -IEdyZW4= 24913 -IHVuaW9ucw== 24914 -IOq1kA== 24915 -IGFwcmVuZGVy 24916 -dWl0YXI= 24917 -IEplc3Q= 24918 -dW1pbmc= 24919 -IFBsYXllcg== 24920 -IEV4dHJlbQ== 24921 -IGludGVnZXI= 24922 -0LDRh9C1 24923 -IGNvbmNlcnRz 24924 -15XXmw== 24925 -IHRyb2NoxJk= 24926 -IFJlcGU= 24927 -6YeN6KaB 24928 -4LmC 24929 -xbxlbg== 24930 -IHNvdW5kaW5n 24931 -IGFub255bW91cw== 24932 -IGV4Y2E= 24933 -IElyYW5pYW4= 24934 -IGVuZXJnZXRpYw== 24935 -IHdpdmVz 24936 -INGG0LLQtdGC 24937 -IGFpcw== 24938 -44GL44Gq 24939 -IHN1ZGFo 24940 -IHVuZGVyd2Vhcg== 24941 -IGNydW5jaHk= 24942 -IFBhaW4= 24943 -IGdlcsOnZWs= 24944 -cmVkaWN0 24945 -IG1pc21h 24946 -0ZbRgg== 24947 -IHN1cnZpdmluZw== 24948 -zq3Pgg== 24949 -IHBhcnRpY2lwYW50 24950 -IEhlc3Nlbg== 24951 -w6FyaWFz 24952 -IHN1YndheQ== 24953 -aXN0w6Q= 24954 -IGNvcmFs 24955 -IG1hcmlqdWFuYQ== 24956 -IE1lbW9yaWFs 24957 -0YjQuNC5 24958 -cml6 24959 -IHNhdGVsbGl0ZXM= 24960 -IGxlYXNl 24961 -IENhbWVyb24= 24962 -dW1waA== 24963 -IGNsYXNzbWF0ZXM= 24964 -w6Row6Ru 24965 -0YHRgtCy0LU= 24966 -IGh1ZQ== 24967 -k6TsnYQ= 24968 -IHByb3BvcnRpb25hbA== 24969 -IG5vc3M= 24970 -IGxhcHM= 24971 -csOl 24972 -IGJpdGNvaW4= 24973 -0JfQq9Ca0JA= 24974 -IOy2qQ== 24975 -INmE2YQ= 24976 -IE1vcnQ= 24977 -IEVzcA== 24978 -YXJub3M= 24979 -INGB0LrQsNC30LDQuw== 24980 -IMOkbmQ= 24981 -5YWE 24982 -15nXmded 24983 -IEdlYg== 24984 -Z2VoZW4= 24985 -SW5hdWRpYmxl 24986 -Ym9yb3VnaA== 24987 -0YTRhA== 24988 -IGZlbGxvd3NoaXA= 24989 -IFBhcGVy 24990 -IGN1cnZlZA== 24991 -IEdFT1I= 24992 -IGNhbGN1bGF0b3I= 24993 -IENhdGFs 24994 -IHbDoG8= 24995 -IGJ5cGFzcw== 24996 -0LvQtdGC 24997 -4LM= 24998 -dHJhbnM= 24999 -cmVuY2llcw== 25000 -7KGM 25001 -aWdlbnQ= 25002 -IHRhc3RlZA== 25003 -IG9jZWFucw== 25004 -dWZ0 25005 -ZXJ2aWNl 25006 -INCc0KPQl9Cr0JrQkA== 25007 -IENsYXNzaWM= 25008 -IHJlc3BlY3RpdmVseQ== 25009 -fik= 25010 -w650cmU= 25011 -IE5hc2g= 25012 -IHppdA== 25013 -IOybgw== 25014 -IOuGkg== 25015 -cXVvdGU= 25016 -IFVucw== 25017 -IHRhYw== 25018 -IHByb3Zlcw== 25019 -IFBvcnRsYW5k 25020 -Ymx5 25021 -IGVyZQ== 25022 -7LaU 25023 -IMOpcG9jYQ== 25024 -INGC0YvRgdGP0Yc= 25025 -NzY= 25026 -IGhhZGU= 25027 -IEZybw== 25028 -IHBvbMOtdGljYQ== 25029 -dGFn 25030 -IO2VrQ== 25031 -IHNjaMO2 25032 -YXJldHQ= 25033 -IHByb3Zpc2lvbnM= 25034 -IG1vdG9ycw== 25035 -IGltYWdpbmc= 25036 -IGRvaw== 25037 -dWxvdXNseQ== 25038 -IG1laWxsZQ== 25039 -546w5Zyo 25040 -65A= 25041 -IElTTw== 25042 -IFNURU0= 25043 -IEJvd2w= 25044 -IHRvd2Vycw== 25045 -IEVl 25046 -IFBlcmZvcm1hbmNl 25047 -IGxvaW4= 25048 -Y3Vzc2lvbg== 25049 -IGNvYXN0YWw= 25050 -aWFsZQ== 25051 -Y29tcGFzcw== 25052 -IHNwZWxscw== 25053 -IGRpc2FwcG9pbnRpbmc= 25054 -IOuyiOynuA== 25055 -RUVS 25056 -IHZlcnNhdGlsZQ== 25057 -YXN1cnk= 25058 -IGVuZmlu 25059 -IGRvd25zaWRl 25060 -IGd1aWRpbmc= 25061 -INin2YTZgg== 25062 -IG5pbmV0eQ== 25063 -Y2hhcmdlZA== 25064 -IEZhbnM= 25065 -IHBoaWxvc29waGljYWw= 25066 -IGdhcm4= 25067 -IG3DpW5nYQ== 25068 -IHdpbGxpbmduZXNz 25069 -IHBvcnRpb25z 25070 -YWJlbg== 25071 -IO8= 25072 -wr8= 25073 -cmF1bA== 25074 -IHNwcmludA== 25075 -aWZlbg== 25076 -xLF5bGE= 25077 -INC60YPQvw== 25078 -44GP44Gg44GV44GE 25079 -IGVuc3VpdGU= 25080 -IENhcGl0b2w= 25081 -IDYz 25082 -INCz0L7QstC+0YDQuNGC 25083 -IGFwcG9pbnRtZW50cw== 25084 -5om+ 25085 -b21pYXN0 25086 -IGNhcmVn 25087 -IHB1Ymxpc2hlcg== 25088 -IGhlcmF1cw== 25089 -IM61zq8= 25090 -IFZT 25091 -44Gd44GX44Gm 25092 -5Lit5YWx 25093 -IHNhY3JpZmljZXM= 25094 -dGhpcmQ= 25095 -IGh1bWFuaXRhcmlhbg== 25096 -IOuCtOw= 25097 -aW1vbg== 25098 -IGluZXF1 25099 -IHpvYg== 25100 -IGNvbWZvcnRhYmx5 25101 -IERpbmdl 25102 -IGNhbmNlbGxlZA== 25103 -IFBTQUtJ 25104 -IFJvYmluc29u 25105 -IGZpbnM= 25106 -KT8= 25107 -IEhpc3Rvcg== 25108 -INGH0LXQu9C+0LLQtdC60LA= 25109 -IHRic3A= 25110 -dGV4dA== 25111 -a2lt 25112 -IHVwZGF0aW5n 25113 -IGdlbGQ= 25114 -ZmVsZA== 25115 -j7w= 25116 -IG3DpA== 25117 -IGNhZsOp 25118 -1oA= 25119 -IFNyaQ== 25120 -IFJlZ2lvbg== 25121 -IEhhaGFoYQ== 25122 -IGZpbmFuY2Vz 25123 -INin2YTYtA== 25124 -IGJ1bms= 25125 -cnVr 25126 -aGFmdA== 25127 -IGxhdGVyYWw= 25128 -IGV4dGVuc2lvbnM= 25129 -IOyVhOydtA== 25130 -IGRlZmluaXRl 25131 -IFpoYW8= 25132 -IEx1aXM= 25133 -c3R5 25134 -IGNhc29z 25135 -IEtsaW0= 25136 -IDE5OTM= 25137 -IHJlYWxpemF0aW9u 25138 -IGhpc3Rvcmlhbg== 25139 -IGNyYWNrZWQ= 25140 -64K0 25141 -IHN5c3TDqG1l 25142 -IENJQQ== 25143 -INGC0LLQvg== 25144 -b3NwaGVyaWM= 25145 -IGZsZWU= 25146 -IHLhuqV0 25147 -IFJlZ2FyZGxlc3M= 25148 -IHJlbHVjdA== 25149 -IHRpbWVseQ== 25150 -IEp1bGlhbg== 25151 -R00= 25152 -6ZI= 25153 -YWR1cmE= 25154 -6aOf 25155 -IGRyZXNzZXM= 25156 -54Gj 25157 -IOuUlA== 25158 -IG5vbWluYXRlZA== 25159 -IGFkdm9jYXRlcw== 25160 -eW1waA== 25161 -IHJlY29yZGluZ3M= 25162 -IGRldmlhdGlvbg== 25163 -IHByaW9yaXRpemU= 25164 -IHNwaXJhbA== 25165 -IFlPVVI= 25166 -IHRyYW5zcG9zZQ== 25167 -YW1wb28= 25168 -IOybkOuemA== 25169 -IFZpc2lvbg== 25170 -IHBvbGl0ZQ== 25171 -IGhhbWI= 25172 -IFBhdGllbnQ= 25173 -5q+U6LyD 25174 -7YGs6w== 25175 -IHNpYQ== 25176 -IOqzsw== 25177 -IMW+ZQ== 25178 -6KeA 25179 -IHN1cGVybWFya2V0 25180 -67k= 25181 -IFNpZXJyYQ== 25182 -IGdyaWxsZWQ= 25183 -IFVwb24= 25184 -IGFic2VudA== 25185 -IG1lYw== 25186 -IEFwb2xsbw== 25187 -IHB1bms= 25188 -IFBhxYRzdA== 25189 -INGB0LLQvtC5 25190 -IOqxsOq4sA== 25191 -R2lybA== 25192 -IHNraW5ueQ== 25193 -IFByZW1pZXI= 25194 -IHRlcnJpdG9yaWVz 25195 -IGxpYWJpbGl0eQ== 25196 -IGplcms= 25197 -cmF0aWM= 25198 -IGRhbmNlcnM= 25199 -INGD0YDQvtCy 25200 -IOq0gOs= 25201 -b25seQ== 25202 -IFN0dQ== 25203 -IHNrZWxldG9u 25204 -IOutkOs= 25205 -INC30LDQutC+0L0= 25206 -xLFrdA== 25207 -IE1JS0U= 25208 -IGzDtg== 25209 -bWll 25210 -IHJlaXRlcg== 25211 -44GT44KM44Gv 25212 -IEtvbGxlZw== 25213 -IEFkYW1z 25214 -bGljaGVy 25215 -IMOnb2N1aw== 25216 -0Y/Qsw== 25217 -IGJsdXNo 25218 -IHN1bnNoaW5l 25219 -IGV6 25220 -IERldmls 25221 -IOq4uA== 25222 -IOOBig== 25223 -YWRk 25224 -IGxpY2Vuc2Vk 25225 -IHZpbnls 25226 -IEN6ZWNo 25227 -aW1hZw== 25228 -IGNyYWNraW5n 25229 -IOy6 25230 -IHVkYWg= 25231 -IHNvbW1lcw== 25232 -IOyWvOq1 25233 -d2HEhw== 25234 -IGZyZXM= 25235 -5ZG9 25236 -IFdhbG1hcnQ= 25237 -INCi0LXQv9C10YDRjA== 25238 -YXRpc2Y= 25239 -Q0k= 25240 -bGFuZw== 25241 -IGRpZmZ1c2lvbg== 25242 -55S3 25243 -IHNvbW9z 25244 -IE1ha2Vz 25245 -5oiR5oOz 25246 -IFJpY2t5 25247 -IG11Y2hh 25248 -7ZWo 25249 -IGhvcnNlcG93ZXI= 25250 -YXNpYQ== 25251 -IGZpYmVycw== 25252 -IGVybQ== 25253 -0YHQutC40LU= 25254 -IGplc3Rl 25255 -IGZpcmVmaWdodA== 25256 -IGN1aXNpbmU= 25257 -IGJlc29uZGVycw== 25258 -ZGln 25259 -IOyihQ== 25260 -INGD0LY= 25261 -IHRyYWNpbmc= 25262 -IGNlcnRhaW5z 25263 -IEFwcGx5 25264 -0YvQstCw0YLRjA== 25265 -54w= 25266 -IGJydQ== 25267 -IFlFUw== 25268 -IEJhaQ== 25269 -IERpdA== 25270 -IEJpcw== 25271 -IHVubGU= 25272 -0YHRgtCw0YLQvtGH0L3Qvg== 25273 -IEF3YWs= 25274 -Li4i 25275 -IDEyNQ== 25276 -IHJvb3RlZA== 25277 -IGNhdXRpb3Vz 25278 -Y29uc3Q= 25279 -IG9yY2hlc3RyYQ== 25280 -55y8 25281 -INCy0L3Rg9GC 25282 -IHF1ZWxxdQ== 25283 -INC+0YLQstC10YI= 25284 -IE1ldGhvZA== 25285 -7Lmc 25286 -IM68zrHPgg== 25287 -bMO8 25288 -IOyVhOq5jA== 25289 -IG5hbWluZw== 25290 -Q2hhcg== 25291 -IFNpY2hlcg== 25292 -IHByaXZpbGVnZWQ= 25293 -IEZseQ== 25294 -IOOBiw== 25295 -4bqtdA== 25296 -IGFkdmFuY2Vz 25297 -IFplbGRh 25298 -IGFuZHJh 25299 -IGdyaW5kaW5n 25300 -IEVkaXRpb24= 25301 -cGY= 25302 -IHdhcnJpb3Jz 25303 -IGhlZGdl 25304 -IHVuc2VyZW4= 25305 -INGB0Y7QtNCw 25306 -ZWxpbmVzcw== 25307 -IHBlcnNvbmFsaXRpZXM= 25308 -IGbDtg== 25309 -J00= 25310 -INGC0L7Rh9C90L4= 25311 -IHNoaXBwZWQ= 25312 -IG1ldGVvcg== 25313 -IHN1cnJvdW5kaW5ncw== 25314 -IEZpbGw= 25315 -dWVzdGE= 25316 -IFBlcnNvbmFs 25317 -IEFsbGU= 25318 -T1JU 25319 -5LmF 25320 -IFNjaGU= 25321 -Vkk= 25322 -IGNvbXBhcmFibGU= 25323 -ZGFtbg== 25324 -IGRpdGNo 25325 -WUFO 25326 -aXNtdXM= 25327 -IHBpY2t1cA== 25328 -IGRhaw== 25329 -IEVQ 25330 -YmVzdA== 25331 -IFN1ZQ== 25332 -w6RsbHQ= 25333 -IHBvcGNvcm4= 25334 -IGZvbGRpbmc= 25335 -aG9tZQ== 25336 -0LjQstCw0LXRgg== 25337 -5bey57aT 25338 -IGFubm90 25339 -Y2h1Y2s= 25340 -IGZpZXJjZQ== 25341 -IGRhbWFnaW5n 25342 -IGZsb3A= 25343 -IHBhc2Fy 25344 -IHJlZWY= 25345 -INGB0LLQvtC10Lk= 25346 -IHpvbw== 25347 -b3ZlcnM= 25348 -amV0cw== 25349 -IHByw6hz 25350 -IFNpbGljb24= 25351 -dGVvaw== 25352 -IFNldGg= 25353 -YXRhbWVudGU= 25354 -IHRyYW5zbWl0dGVk 25355 -IHJlcGxpY2F0ZQ== 25356 -IHNsaW0= 25357 -IENyZWFt 25358 -5oSf44GY 25359 -IHNpZGV3YWxr 25360 -7IiY6w== 25361 -INC20LjQt9C90Yw= 25362 -IE1vbmljYQ== 25363 -5L6G5LqG 25364 -IGNvcGllZA== 25365 -IFRlcnJh 25366 -aXN0ZW50 25367 -57O7 25368 -INC+0L3Qvg== 25369 -IHdoYWxl 25370 -IFdJVEg= 25371 -0LvRg9GI 25372 -5b2x54mH 25373 -IEVlbg== 25374 -INGB0LLQvtC4 25375 -IG9yZGlu 25376 -IHBsdXJhbA== 25377 -IHNwb2tlcw== 25378 -IGRpc3B1dGU= 25379 -IHNlbnNpYmxl 25380 -IHByZWFjaGluZw== 25381 -IGt0w7Nyenk= 25382 -cHRlZA== 25383 -YXZpZXI= 25384 -IHBpc3RvbA== 25385 -IFRhcGk= 25386 -IMWC 25387 -ZmZmZg== 25388 -IGFjcnlsaWM= 25389 -IGlnbm9yYW5jZQ== 25390 -IFppZWw= 25391 -cmFucw== 25392 -IHdlbGRpbmc= 25393 -bWlk 25394 -5oiR5LiN 25395 -INC30LDQvdC40Lw= 25396 -IGxhbmVz 25397 -IG1pbmVz 25398 -IG1vbXM= 25399 -15XXlw== 25400 -IENoYW1iZXI= 25401 -dGllcg== 25402 -IG1vZGVzdA== 25403 -IOyXrOq4sOyEnA== 25404 -IHVuYXM= 25405 -IHdyZW5jaA== 25406 -aGFuZGVk 25407 -IHNhdHVyYXRlZA== 25408 -IEZhbmc= 25409 -IENvbW1pc3Npb25lcg== 25410 -4KSw 25411 -INeW 25412 -IExvdWlzaWFuYQ== 25413 -IE1hc2s= 25414 -IGN1YmVz 25415 -7JSo 25416 -IHZpZMOpb3M= 25417 -IG7DpWdvbg== 25418 -IHJpZGVy 25419 -IOy2nA== 25420 -IHPDs24= 25421 -IExhdGlubw== 25422 -YmFuaw== 25423 -7ZW07KO8 25424 -IEJyZW5k 25425 -IHNleHVhbGl0eQ== 25426 -Li4uLA== 25427 -IGZvcmdldHRpbmc= 25428 -INuM 25429 -IEF2ZW5nZXJz 25430 -IEJvbmpvdXI= 25431 -Y2Vzc29y 25432 -0LrRgNCw0Zc= 25433 -Y2VuY2U= 25434 -IGdlb2dyYXBo 25435 -Y3Vsbw== 25436 -0L7RgdGC0Yw= 25437 -IHN3ZWF0aW5n 25438 -7YOA 25439 -IHN5bW1ldHJ5 25440 -dHPDpQ== 25441 -IGphbg== 25442 -IEZlcnI= 25443 -6aaW 25444 -IGFtYmFzc2Fkb3I= 25445 -emnEmWs= 25446 -IG11c3Vu 25447 -INGD0YI= 25448 -IExH 25449 -aXNzZW50 25450 -Y29tbXVu 25451 -IGNvdXJz 25452 -IGRldmVsb3Bz 25453 -IGJyb256ZQ== 25454 -IHN1YnN0YW5jZXM= 25455 -ZHJpdmVu 25456 -7KO87IS47JqU 25457 -IGFvcw== 25458 -5YSE 25459 -IFBST0ZFU1M= 25460 -aGFsZg== 25461 -IHNvcnRlZA== 25462 -IEJvbWI= 25463 -0LvQsNCz 25464 -IE1hbGF5c2lh 25465 -IENocmlzdGluYQ== 25466 -IHRlYW1tYXRl 25467 -6IGe 25468 -RlQ= 25469 -IGvEsQ== 25470 -aGVhcnRlZA== 25471 -Kys= 25472 -b2dlbmlj 25473 -IGJlbGxz 25474 -IE91YWlz 25475 -IHNwZWNpYWxpc3Rz 25476 -0LHRiw== 25477 -ZGVwdGg= 25478 -bGFzc2Vz 25479 -Z2llcw== 25480 -IENvZmZlZQ== 25481 -IG1hcmtpbmc= 25482 -IGZvbGw= 25483 -dWxp 25484 -IGFkaGVzaXZl 25485 -IEJvdA== 25486 -IFB1bmt0 25487 -ZXll 25488 -IEJ1Yg== 25489 -ZWxvbmc= 25490 -5Yi2 25491 -INC/0YDQuNC6 25492 -IGRvbm9y 25493 -ODQ= 25494 -IGVuZm9y 25495 -IGNhdGNoZXM= 25496 -IGJyaWNrcw== 25497 -IGtuaXR0aW5n 25498 -IEtub3dpbmc= 25499 -b2tz 25500 -SFk= 25501 -cmlkZQ== 25502 -IEZhbnRhc3k= 25503 -aW1hbg== 25504 -IHBzZQ== 25505 -IOyYqA== 25506 -INCy0LQ= 25507 -IHJlc3RyYQ== 25508 -IGV2YWx1YXRlZA== 25509 -0YDQtdCy 25510 -IGZvcnR1bmF0ZWx5 25511 -IGNoZWdhcg== 25512 -2LHYqA== 25513 -IGRvbWFpbnM= 25514 -aWJp 25515 -YXJyeQ== 25516 -IHNodXR0ZXI= 25517 -IGZpY291 25518 -TWlrZQ== 25519 -IGluY2x1 25520 -IGRvbm9ycw== 25521 -IGFwbA== 25522 -IExvd2Vy 25523 -IGltcG9ydGVk 25524 -IGFjYWRlbXk= 25525 -IGZpbmFscw== 25526 -IGRpc2FwcGVhcnM= 25527 -2YrYpw== 25528 -IGFkbWluaXN0cmF0b3I= 25529 -anM= 25530 -IGN1dHRlcg== 25531 -IHJhbmdpbmc= 25532 -w7ZycGVy 25533 -IGNvbnN0cmFpbnQ= 25534 -IFRhYmxl 25535 -IFNoYW4= 25536 -dmlj 25537 -IEZpeA== 25538 -IFN3aWZ0 25539 -b3VuY2Vz 25540 -IFdhcnVt 25541 -IGxldHR1Y2U= 25542 -YXBwZWxsZQ== 25543 -IHNoYXZl 25544 -IGLDoXM= 25545 -IDc3 25546 -IE9vbw== 25547 -YW8= 25548 -IE1jTQ== 25549 -IERyZXc= 25550 -IGx1bXA= 25551 -IGxhc2hlcw== 25552 -c2NoZWlubGljaA== 25553 -UmVw 25554 -aW5pcw== 25555 -IENldHRl 25556 -IGNvbXBvc2l0ZQ== 25557 -ZW1ldGVyeQ== 25558 -IHNvcnRl 25559 -IEZpbmFuY2lhbA== 25560 -0L7QvdC1 25561 -cm9uZXM= 25562 -IFZveQ== 25563 -IHTDqWM= 25564 -oLk= 25565 -IE5pbmph 25566 -IENvcmlu 25567 -0LXQvdC90Y8= 25568 -7J207JeI 25569 -IG5pY2g= 25570 -IGRldGVjdGl2ZQ== 25571 -4oCmIg== 25572 -z4POtQ== 25573 -nbzrj4Q= 25574 -IOuzgA== 25575 -IOu4lOs= 25576 -IHByb3Bl 25577 -IFdyaWdodA== 25578 -INeU16o= 25579 -IFNoaQ== 25580 -IOOBnw== 25581 -IGludmVzdGlnYXRpb25z 25582 -6YKE5piv 25583 -IFBvd2VyUG9pbnQ= 25584 -IENodQ== 25585 -IOyYpO0= 25586 -IOyZhOyghA== 25587 -IEZyYWdlbg== 25588 -dW5uaW5n 25589 -IHBvdXJyYWl0 25590 -IHRleHRib29r 25591 -0LzRiw== 25592 -IGZhaHJlbg== 25593 -INGC0L7RgA== 25594 -IGxha2Vz 25595 -w7xuZGU= 25596 -SW50 25597 -IE1ldHJv 25598 -IG1hbnNpb24= 25599 -INCw0LE= 25600 -IFpob3U= 25601 -IGNvcnJpZG9y 25602 -IGVzY29s 25603 -IGluZGljYXRpbmc= 25604 -aWHFgmE= 25605 -IG1vbW15 25606 -IGFyY2hpdmVz 25607 -IGZvdW5kZXJz 25608 -ZW5naW5l 25609 -IERpZXU= 25610 -IHNpY2tuZXNz 25611 -IOuztOuLiOq5jA== 25612 -IGFyYg== 25613 -IG5lZA== 25614 -IENob3A= 25615 -IGNvdmlk 25616 -IHNsYW0= 25617 -IHB1YmxpY2F0aW9ucw== 25618 -REM= 25619 -IHNwZW5kcw== 25620 -5r4= 25621 -IHJlZnVnZWU= 25622 -IGRpbGU= 25623 -INeQ15Y= 25624 -aWZpY2Fy 25625 -IFNhY2g= 25626 -R3U= 25627 -IHJlbG9hZA== 25628 -Pz8/Pw== 25629 -IGplxZtsaQ== 25630 -INGB0L7RgdGC0L4= 25631 -IHNpbXBsaWNpdHk= 25632 -IGJ1bGx5aW5n 25633 -INC80L7Quw== 25634 -IHJlYWxpZGFk 25635 -IHVuY2xlYXI= 25636 -YXBwYQ== 25637 -bGV2YW50 25638 -IElTSVM= 25639 -IFdhdHNvbg== 25640 -IGRlaW4= 25641 -IE1pY3Jv 25642 -7ZWc6w== 25643 -w7xn 25644 -IGRldmFt 25645 -IHR3ZWV0ZWQ= 25646 -5bCO 25647 -IHVuZGVyc3RhbmRhYmxl 25648 -YXRhbg== 25649 -IHZlcnNh 25650 -IHByZWNh 25651 -IHbhu4E= 25652 -IENvcHk= 25653 -IE9yYWNsZQ== 25654 -IG1pbmRmdWxuZXNz 25655 -IGRpc2NyZXQ= 25656 -ZXJuZW4= 25657 -IFBsZQ== 25658 -SGF2ZQ== 25659 -IGlzb2xhdGU= 25660 -IGRldQ== 25661 -IHNldmVudHk= 25662 -IEhpbGxz 25663 -IGFyY2FkZQ== 25664 -INGB0L/QtdGG0Lg= 25665 -IHNpZ3VpZW50ZQ== 25666 -IELDnE5ETklT 25667 -bGlnYQ== 25668 -INCy0YHRgtGA0LXRhw== 25669 -w7Rt 25670 -IHR3ZWV0cw== 25671 -IHNjaGF1ZW4= 25672 -IGNyaXRpcXVl 25673 -IPCfjrU= 25674 -IHN0YXR0 25675 -INGB0LDQvNC+0LU= 25676 -w6JuY2lh 25677 -IHN1cGVybmF0dXJhbA== 25678 -IHBsdWdnZWQ= 25679 -Rmw= 25680 -eW7EsQ== 25681 -IFRhbWJpw6lu 25682 -IGVuY291cmFnZW1lbnQ= 25683 -IFNlcnZlcg== 25684 -64Kc 25685 -dXBh 25686 -IGFzdG9u 25687 -IGhlYXJz 25688 -0YDQsNGF 25689 -IHNjaGU= 25690 -IHJhdHM= 25691 -IHJlY3VwZXI= 25692 -IHVudGVu 25693 -IEZpZ2h0aW5n 25694 -IGFjYWRlbWljcw== 25695 -56S6 25696 -IFPDvA== 25697 -0YHQutC40YU= 25698 -IHBhaXJlZA== 25699 -gOydhA== 25700 -IMOhcmVh 25701 -IHN3ZWV0bmVzcw== 25702 -5Y+K 25703 -IGRlZmVy 25704 -IG11aXRhcw== 25705 -IEF1ZGlv 25706 -IGxvY2tlcg== 25707 -2YrYrw== 25708 -INGB0YLQsNCy 25709 -IGJ1ZW5h 25710 -QU5T 25711 -IGRldGVjdG9y 25712 -YXZv 25713 -YmVr 25714 -IM6xzr0= 25715 -7Y64 25716 -IGRyYWdnZWQ= 25717 -INC00L7Qu9C20LXQvQ== 25718 -w5Y= 25719 -2LHYqQ== 25720 -7J207KeA 25721 -IGNlbGxl 25722 -Y2tpbmc= 25723 -INin2YTYrA== 25724 -IENhbnZhcw== 25725 -IGVzcGHDsQ== 25726 -IGdsaW1w 25727 -IHNwcmVhZHM= 25728 -b25nbw== 25729 -IE1hc29u 25730 -IEluZw== 25731 -IOqwgOuKpQ== 25732 -z4TOuc66 25733 -IHNlY3VsYXI= 25734 -IGJhdGVy 25735 -IGlucXVpcnk= 25736 -IGVuZXJnaWVz 25737 -IG1hbnVmYWN0dXJlZA== 25738 -IHZlZ2V0YXJpYW4= 25739 -IHBpbmVhcHBsZQ== 25740 -0Y/RgtCw 25741 -IHByYWN0aXRpb25lcnM= 25742 -MjAwMA== 25743 -IO2VtOyalA== 25744 -IOyXrOufrOu2hOuTpA== 25745 -IOu2iOs= 25746 -IEplZmZlcnNvbg== 25747 -IEpvYW4= 25748 -IHRyYW0= 25749 -5a65 25750 -Y2htYWw= 25751 -IEhhaXQ= 25752 -4bmH 25753 -IHVucmVhbA== 25754 -IHN5bWJvbGlj 25755 -IHN0ZWFsdGg= 25756 -IHNwbGFzaA== 25757 -IEVudGVydGFpbm1lbnQ= 25758 -IG1ldGFsbGlj 25759 -PyIu 25760 -6LaK 25761 -YXJvdW5k 25762 -IGRlc3BhaXI= 25763 -IE5ldmFkYQ== 25764 -IEZpbmFuY2U= 25765 -IGtyaWU= 25766 -IEx1eA== 25767 -IFNtYXNo 25768 -a2VlcGluZw== 25769 -INC30LDQsw== 25770 -IG5hcmNpc3M= 25771 -IGR6aXNpYWo= 25772 -IHRvbGVyYXRl 25773 -b2FyZA== 25774 -IGxpbmtpbmc= 25775 -IEVjb25vbWlj 25776 -IOy8 25777 -IG1vcnBo 25778 -IE5haw== 25779 -IEJha2Vy 25780 -YXRvbg== 25781 -cmluZ3M= 25782 -IFBlbmc= 25783 -IEFpcnBvcnQ= 25784 -44GL44Gj44Gf 25785 -7ZWY64uk 25786 -p4E= 25787 -cHJpbnRz 25788 -IGhhZGk= 25789 -IGVtcGly 25790 -IExpdmVz 25791 -YW5uZXJz 25792 -INC90LjQvA== 25793 -IFBST0ZFU1NPUg== 25794 -IHBvc2l0aXZlbHk= 25795 -YW50b20= 25796 -IGJhZGdl 25797 -a2VsdA== 25798 -IGludGVyZmVy 25799 -IGZ1bGZpbGxpbmc= 25800 -IHZpc3VhbGl6YXRpb24= 25801 -6Zec5L+C 25802 -IFByaWNl 25803 -77+977+9 25804 -IHNjZW5lcnk= 25805 -IHByb25l 25806 -IHdpemFyZA== 25807 -IGJhbnlhaw== 25808 -dmVyYg== 25809 -c2t5 25810 -IHdpc2hlZA== 25811 -IHJhaWx3YXk= 25812 -IMO8emVy 25813 -IGFsZ3VpZW4= 25814 -IEFX 25815 -INC60L7Qu9C40YfQtQ== 25816 -IHJlYWN0aW5n 25817 -IEJ1Y2g= 25818 -4Li2 25819 -IGFudGg= 25820 -IHNpaA== 25821 -IGh1c3Q= 25822 -IFNjcmVlbg== 25823 -aWxhbnQ= 25824 -YWhv 25825 -IGZyYWdyYW5jZQ== 25826 -IGVsZXZhdGlvbg== 25827 -IE1lZGl0ZXI= 25828 -IOu/ 25829 -IMOpcXU= 25830 -IHdyYXBz 25831 -IGluZXJ0 25832 -IHJlY3JlYXRl 25833 -0LvQsNGC 25834 -IGJvbGVo 25835 -IGhhcmFzc21lbnQ= 25836 -dW5reQ== 25837 -IGdsaW1wc2U= 25838 -cmVnaWVydW5n 25839 -IGZ1dHVy 25840 -IHJlcG9zaXRvcnk= 25841 -IGVuZ3Jh 25842 -IHRyYWZmaWNraW5n 25843 -YXNzaXM= 25844 -IFRyZWs= 25845 -IOuyjA== 25846 -IOuniOs= 25847 -IEthYg== 25848 -YW5pdQ== 25849 -Z2l2ZQ== 25850 -IGRpbm9zYXVycw== 25851 -IGZlYXRoZXI= 25852 -IGF0dGl0dWRlcw== 25853 -IHBsdW0= 25854 -IFJT 25855 -IEFuZmFuZw== 25856 -aWxsZXJ5 25857 -IOyKpA== 25858 -TVk= 25859 -IHRyemViYQ== 25860 -IHNraWVz 25861 -IEFq 25862 -dXJhYmxl 25863 -Q1U= 25864 -IFNoYW5l 25865 -IGRlcGFydHVyZQ== 25866 -IFRPTg== 25867 -aWV0ZW4= 25868 -cmF0cw== 25869 -5rCX 25870 -aXN1 25871 -IGJvcmQ= 25872 -IGludGVyZXN0aW5nbHk= 25873 -55m7 25874 -b3VnaGluZw== 25875 -IHJ1c2hpbmc= 25876 -IHZvbGF0aWxpdHk= 25877 -IHB5dA== 25878 -IGZvcm1hdHM= 25879 -INC30LDRgg== 25880 -IOq8rQ== 25881 -IHdoYXRub3Q= 25882 -IGNvbXBvcnQ= 25883 -c3c= 25884 -b3JlYW4= 25885 -IFJlbGF4 25886 -IGNsYW4= 25887 -IEFI 25888 -IHBldw== 25889 -IGRpY3Rpb25hcnk= 25890 -VGFrZQ== 25891 -c2hpcnRz 25892 -IEh1Z2g= 25893 -INi52YTZig== 25894 -IFBpYw== 25895 -IGVucm9sbGVk 25896 -IGplZG5haw== 25897 -IG9mZmVyaW5ncw== 25898 -IGNvcmF6 25899 -TGlmZQ== 25900 -ICEhIQ== 25901 -IGNsZXI= 25902 -IFZpZGVvcw== 25903 -IFJvZHJpZw== 25904 -IElkZW50 25905 -IFBvcw== 25906 -IFN0YWdl 25907 -IFJhY2U= 25908 -IGVuYWN0 25909 -44GE44G+44GX44Gf 25910 -IEd5 25911 -IEhpc3Bhbg== 25912 -IGRlZmVuY2U= 25913 -IENhbXBiZWxs 25914 -bWF0aWM= 25915 -IHJlbGV2 25916 -IHBlYWNo 25917 -hLjsmpQ= 25918 -IHBhcmFkaXNl 25919 -IGNlcmVtb24= 25920 -IGFubm95ZWQ= 25921 -5oyH 25922 -bGF4 25923 -IGV4cGxvaXQ= 25924 -IGNsYXVzZQ== 25925 -ZWtlcg== 25926 -IEJsb29t 25927 -bmFudA== 25928 -YXRldXJz 25929 -IGhlaWdodHM= 25930 -RXZlbg== 25931 -0YHQvtC9 25932 -IG91dHJhZ2U= 25933 -IFZpZXRuYW1lc2U= 25934 -44Gv44Gv 25935 -VFI= 25936 -IGVlcg== 25937 -IGNhbm5vbg== 25938 -IENvbWI= 25939 -kOunjA== 25940 -6LuK 25941 -IOqyg+uPhA== 25942 -IGFjY29tcGxpc2htZW50cw== 25943 -IEFuYWx5dGljcw== 25944 -IHNoYXBpbmc= 25945 -cmVpYmVu 25946 -IGJhY2hlbG9y 25947 -IGZpbmdlcnQ= 25948 -YWNrZWQ= 25949 -IHB5cmFtaWQ= 25950 -IFN0ZXdhcnQ= 25951 -w6FzdA== 25952 -IHN1cnZpdm9y 25953 -IGR1Y3Q= 25954 -IGRlYWxlcnM= 25955 -5rS7 25956 -2LnZhQ== 25957 -0LvQuNC9 25958 -IGVkZQ== 25959 -15XXog== 25960 -INmD2KfZhg== 25961 -IM+Ezrk= 25962 -IGNob29zZXM= 25963 -IE93bg== 25964 -0LPQvtGC0L7Qsg== 25965 -aGlyZQ== 25966 -0LDQu9GM0L3Ri9C1 25967 -INCb0Y4= 25968 -INC+0YHRgtCw0LI= 25969 -dGVjaA== 25970 -IGRyb2l0 25971 -IHN1YmplY3RpdmU= 25972 -ZW5lcw== 25973 -IGRpdmlz 25974 -YXZleg== 25975 -IG1hbmV1dmVy 25976 -4LmE4LiU 25977 -YWRlY2U= 25978 -IEVucw== 25979 -YWNpYWw= 25980 -IFByb3RlY3Rpb24= 25981 -lrQ= 25982 -IGZvcm1hbGx5 25983 -IHd5ZA== 25984 -aW5ndcOpbQ== 25985 -IHppZW0= 25986 -IHJlY3J1aXRpbmc= 25987 -15nXmg== 25988 -bmVt 25989 -IGZvcmJpZGRlbg== 25990 -IEJhcHQ= 25991 -15DXoNeZ 25992 -IHN1YnNldA== 25993 -IE1hZ2F6 25994 -bmVtZW50 25995 -IGFxdWVsYQ== 25996 -cmFnb24= 25997 -IGNvbW1pdHRlZXM= 25998 -IMOpdGFpZW50 25999 -dWRp 26000 -IERhd24= 26001 -IGJvcmU= 26002 -IGNvbXBvc2Vy 26003 -IHdpxJljZWo= 26004 -YW5nYQ== 26005 -IGRpc2xpa2U= 26006 -IERheXM= 26007 -5Z+6 26008 -IHBhcmFs 26009 -IG1pZW50cmFz 26010 -IGhlYXZlbnM= 26011 -44GS 26012 -aGVpZA== 26013 -IHRyYWRlcnM= 26014 -b25jZQ== 26015 -IG1hc2NhcmE= 26016 -IM+Az4HOvw== 26017 -IHdoaXNwZXI= 26018 -IE11c2s= 26019 -6ZuG 26020 -IEZhbWlsaWU= 26021 -QWxsYWg= 26022 -IE9saXZpYQ== 26023 -IFByb3M= 26024 -IG9saWth 26025 -aWxpbQ== 26026 -IHLDqXBvbmQ= 26027 -IFBldGVycw== 26028 -IOW+iA== 26029 -IGJpdGVz 26030 -IHZpYw== 26031 -IE5Z 26032 -ZW1wdGlvbg== 26033 -IDQ1MA== 26034 -IHZpc3VhbHM= 26035 -IGxpZXU= 26036 -w7xja2Vu 26037 -IFN0ZWVs 26038 -IEdQ 26039 -d2FpdA== 26040 -IG5vdGljZWFibGU= 26041 -dWNoYQ== 26042 -IHJlaGFiaWw= 26043 -IHJlamVjdGlvbg== 26044 -INGB0LvQtdC00YPRjtGJ 26045 -IHNsaWRlcg== 26046 -IHJlZ2FyZGVk 26047 -IGdyYXZpdA== 26048 -IFJlc2VydmU= 26049 -Y291bnQ= 26050 -IGJyZWVkaW5n 26051 -IGxvbmdl 26052 -YWxlYg== 26053 -IGtuaWdodA== 26054 -INCy0L7QuQ== 26055 -IHByw6lzZW50 26056 -gpjsmpQ= 26057 -IFNwZWNpZmljYWxseQ== 26058 -IHBvc2Vz 26059 -IHZldXJl 26060 -b2theQ== 26061 -ZW1hcw== 26062 -IOOBp+OBmQ== 26063 -IG1hasSF 26064 -IHdlYmluYXJz 26065 -IGNhbm5hYmlz 26066 -IGRhbWFscw== 26067 -IE5vcnRod2VzdA== 26068 -IHBhZGE= 26069 -IGNyb3dkcw== 26070 -IGZ1dHVyZXM= 26071 -IMOkbg== 26072 -IGNpdmlsaWFucw== 26073 -IFNhY2hlbg== 26074 -5o0= 26075 -IHRyYWNlcw== 26076 -IOuoueqzoA== 26077 -UVU= 26078 -6aGY44GE 26079 -IElG 26080 -YW7EsW4= 26081 -7IK0 26082 -IGJpYmxpY2Fs 26083 -IFZlZA== 26084 -IHN0b3Jpbmc= 26085 -0YDQsNCy0LvRjw== 26086 -5oeJ6Kmy 26087 -IG5hc3Q= 26088 -IGTDtg== 26089 -0YDQvtC/ 26090 -ZWxpYQ== 26091 -IHNpZGV3YXlz 26092 -IFVuZGVyc3RhbmQ= 26093 -IFF1cg== 26094 -IHBlcnBlbmQ= 26095 -IE1pbGxpb25lbg== 26096 -IHdhdGVybWVsb24= 26097 -IERpdmluZQ== 26098 -dWx0dXI= 26099 -YWJvcmQ= 26100 -IHN1Y2Nlc3Nlcw== 26101 -IGhvbWJyZQ== 26102 -IGNhcnA= 26103 -IHN1c2NlcHQ= 26104 -dW5na2lu 26105 -IGtpag== 26106 -dWx1cw== 26107 -2KfYrA== 26108 -IG5vdGNo 26109 -IHBvbHlub21pYWw= 26110 -5bmy 26111 -5ak= 26112 -IMO6bmljbw== 26113 -IHRlbGVzY29wZQ== 26114 -IHBvbGl0aXF1ZQ== 26115 -a2llbQ== 26116 -IM6tzr3OsQ== 26117 -IGFnZ3JlZ2F0ZQ== 26118 -IEdlb2Zm 26119 -IHRyaWw= 26120 -IEdSQQ== 26121 -IHN1YnNjcmliZXI= 26122 -aW1ldA== 26123 -INC00L7Qu9C70LDRgA== 26124 -b3Bpbmc= 26125 -IHRoZXJhcGV1dA== 26126 -IENhbmNlcg== 26127 -IHBhcmFkZQ== 26128 -IGlycmln 26129 -4pmq4pmq 26130 -IGNsZWFyZXI= 26131 -IGJvZw== 26132 -IE1hdXI= 26133 -4Liy4LiH 26134 -IFNoYW5naGFp 26135 -YWNodGU= 26136 -IEtvbA== 26137 -ZWx1amFo 26138 -IGhhdg== 26139 -IENyaW1l 26140 -c2Vr 26141 -IOuhnA== 26142 -aWVubmE= 26143 -IEdvcg== 26144 -6Js= 26145 -INC/0L7RgtGA 26146 -INC60LDQttC10YLRgdGP 26147 -IExpZnQ= 26148 -IFNvcnQ= 26149 -IFBzYWw= 26150 -IHBpbmc= 26151 -k50= 26152 -cGhpcw== 26153 -IEZVQ0s= 26154 -IFN5bg== 26155 -IGJhbWJvbw== 26156 -rOyYgQ== 26157 -Y3V0cw== 26158 -IG1tbQ== 26159 -IGZ1bmt0aW9uaWVydA== 26160 -IF8= 26161 -w61jaW8= 26162 -U3RvcA== 26163 -IGltYWdpbmFyeQ== 26164 -IG5vdGFtbWVudA== 26165 -IEluaXRpYXRpdmU= 26166 -44Ol 26167 -IEt1cnQ= 26168 -IGxvb3Nlbg== 26169 -IGJ1c2Nhcg== 26170 -54Gr 26171 -IHplbGY= 26172 -IHByb3Bz 26173 -5ZuJ 26174 -IG1vZXRlbg== 26175 -IG1pbGxp 26176 -IGhhbGxz 26177 -IE1hdGNo 26178 -IGJyYWNrZXRz 26179 -IENvdQ== 26180 -5qaC 26181 -INCc0LDRgA== 26182 -SVNB 26183 -IGNpZ2FyZXR0ZQ== 26184 -IGNvbXBldGl0aW9ucw== 26185 -IE1JTg== 26186 -IGJlaMO2 26187 -dm9vcg== 26188 -IHVzdA== 26189 -IFpp 26190 -IE9jYw== 26191 -dWxhdGVz 26192 -IGJhbGxvb25z 26193 -IHByb250bw== 26194 -IE1peQ== 26195 -IEZpbGU= 26196 -INC60LvQsNGB0YE= 26197 -0L3Rg9C7 26198 -IGNlcmVhbA== 26199 -IGluY3JlbWVudA== 26200 -IHJlZmluZWQ= 26201 -5Y+m5aSW 26202 -cHJpc2luZw== 26203 -IFJG 26204 -IHJlc3BlY3RmdWw= 26205 -IGxvb3Q= 26206 -YXNrZXQ= 26207 -IGRlaXhh 26208 -aW5nbGU= 26209 -IGZ1bmNpb25h 26210 -IFJldmVs 26211 -IHNvYmVy 26212 -IHBlcmZvcm1z 26213 -IEdlbnRsZQ== 26214 -44Ko 26215 -IHJlY2lwaWVudA== 26216 -IEhhdXNl 26217 -IOuD 26218 -RnJvbQ== 26219 -IG1pbmlzdGVycw== 26220 -IHBhcmFkb3g= 26221 -5bCx5piv6Kqq 26222 -IHRhc3Rpbmc= 26223 -INeU15c= 26224 -IHJldXNl 26225 -IExhbmU= 26226 -INGB0L7QstC10YDRiA== 26227 -IHJlbWVtYmVycw== 26228 -IGZlbWluaXN0 26229 -IGNvbW1pdG1lbnRz 26230 -IHByb2plY3RlZA== 26231 -IGdheg== 26232 -aXlvcnV6 26233 -IG9ibGlnYXRpb25z 26234 -Um8= 26235 -emFy 26236 -IGNodw== 26237 -IEpBTQ== 26238 -IGLEmWTEhQ== 26239 -YXNwYmVycnk= 26240 -INC80LXRgdGC0L4= 26241 -67KV 26242 -IHJlZ3VsYXRlZA== 26243 -IHdpY2h0 26244 -IFRyZXZvcg== 26245 -IHNlY29uZGx5 26246 -IElocmU= 26247 -ZWxzaA== 26248 -IHJlcG9ydGVycw== 26249 -0YLQvtGA0LA= 26250 -b3lv 26251 -R0k= 26252 -IGludGVyY29ubmVjdA== 26253 -6ZCY 26254 -T1NI 26255 -5q2y 26256 -IGJyYXNz 26257 -IGlnbm9yaW5n 26258 -5LuK5pel 26259 -aW5mZWN0 26260 -IHByb2pla3Q= 26261 -b3JldA== 26262 -z4TOsc69 26263 -INGC0LjQvw== 26264 -IG11dHRh 26265 -IHVuYm94aW5n 26266 -hLA= 26267 -5aGK 26268 -IGFkdmlzZWQ= 26269 -IERlbnZlcg== 26270 -IHNldmVyZWx5 26271 -IE1obQ== 26272 -IGZsaXBwZWQ= 26273 -IHBpZW4= 26274 -IGtvbW11bg== 26275 -IEZSRQ== 26276 -IOCuh+CusA== 26277 -YWludGVk 26278 -IGtuaXZlcw== 26279 -IGhhYmw= 26280 -IGdld29yZGVu 26281 -YXJldHRlcw== 26282 -Q1M= 26283 -INC80LDQu9C10L3RjA== 26284 -IGdhbGF4 26285 -IG5pbmV0ZQ== 26286 -6rGw64KY 26287 -IHNpcw== 26288 -IGFkdmlzb3J5 26289 -IGRyaWxsaW5n 26290 -IFdvdWxkbg== 26291 -w7xuZg== 26292 -Z2VzdGVsbHQ= 26293 -IEhlbGVu 26294 -INee15A= 26295 -YXBvbGlz 26296 -IHJ6ZWN6eQ== 26297 -IHRlcnJh 26298 -IGhlcA== 26299 -IGFsZ8O6bg== 26300 -aWtr 26301 -IGFzdHJvbm9t 26302 -IFN0YXJidWNrcw== 26303 -a8SF 26304 -IHBhdHJvbA== 26305 -IOy9lA== 26306 -IGdvbg== 26307 -IOOAkA== 26308 -IHNvbnN0 26309 -IGVuY291bnRlcnM= 26310 -IHJldHJvdQ== 26311 -IHNoYXJrcw== 26312 -IGRvcg== 26313 -IFJldmVy 26314 -IGV2YXBvcg== 26315 -IHJlc2Vydm9pcg== 26316 -IGFsbGVnZWQ= 26317 -dWxlcg== 26318 -IHZlcm0= 26319 -IGNvbW1lcmNl 26320 -IGZpdHRlZA== 26321 -Z2Vt 26322 -IHRhY3RpY2Fs 26323 -IGxpdGg= 26324 -6YmE5aGU 26325 -aGFk 26326 -6K6K 26327 -IGNhcmJvaHlk 26328 -IGxlbmd0aHM= 26329 -zrnOvw== 26330 -IGRlbW9ncmFwaGlj 26331 -Um9i 26332 -IFNraW4= 26333 -Y2NvbGk= 26334 -IHNpbXBsaWZpZWQ= 26335 -IHJlYWRpbHk= 26336 -IEN1bQ== 26337 -YWRlc2g= 26338 -IETDpQ== 26339 -dXNzdA== 26340 -aWduZQ== 26341 -ZXRvbg== 26342 -IG1lbm9y 26343 -cWk= 26344 -T09N 26345 -4Lit4LiZ 26346 -IHBzeWNoaWF0 26347 -IGVpZ2h0eQ== 26348 -INC80LjQu9C70Lg= 26349 -IFRvYg== 26350 -ZWRv 26351 -57ay 26352 -IMSR4bq/bg== 26353 -IGNpcmN1aXRz 26354 -IExBVUdI 26355 -aWNpc20= 26356 -ZW1vcg== 26357 -IHJlZ2VuZXI= 26358 -ZWdyZWU= 26359 -IGJ1cmVhdWM= 26360 -IEFsYmVy 26361 -5LmL5b6M 26362 -IFdvcg== 26363 -5aSr 26364 -IHJlc2lu 26365 -IGJ5xYJ5 26366 -IElH 26367 -4K+NLA== 26368 -IDc4 26369 -IHdlZWRz 26370 -IE15dGg= 26371 -OTM= 26372 -5r8= 26373 -IOuCmOyZlA== 26374 -w6l2 26375 -4b0= 26376 -w7ZyZW4= 26377 -w6dhcg== 26378 -IFBBVUw= 26379 -IGRpc2FkdmFudA== 26380 -IHBvc2l0aW9uaW5n 26381 -IGNvY2t0YWls 26382 -IGFncmVlcw== 26383 -bm4= 26384 -IFNhbGx5 26385 -TXM= 26386 -IGluaGVyZW50 26387 -IG1vbmV0YXJ5 26388 -IG5hdHVy 26389 -IE5o 26390 -IEltcG9ydA== 26391 -IGxlYmVu 26392 -IHdp 26393 -dXNzeQ== 26394 -IG9iZXM= 26395 -IHdhbmRlcmluZw== 26396 -IOyLoOs= 26397 -xIVkYQ== 26398 -ZXRjaHVw 26399 -IGRpc3Bvc2Fs 26400 -IEpB 26401 -IENlcg== 26402 -emlsbGE= 26403 -IHZpcmdpbg== 26404 -IFNsaWRl 26405 -YW5kZWw= 26406 -IHJpZ2h0ZW91c25lc3M= 26407 -IM6j 26408 -IGlkZWlh 26409 -5L2g5aW9 26410 -0LjRgNC+0LLQsNGC0Yw= 26411 -16jXkA== 26412 -Q29tbWVudA== 26413 -IHByZWxpbQ== 26414 -IFZhbGU= 26415 -IOyngOuCnA== 26416 -IFZhbmM= 26417 -T01BTg== 26418 -INC/0ZbQtA== 26419 -IHl1bQ== 26420 -c3RyZQ== 26421 -Y2Vt 26422 -IHBvY3o= 26423 -IGZyYWdtZW50 26424 -INGB0LvRg9GH0LDQtQ== 26425 -IHVuZGVyZ28= 26426 -IEhhbms= 26427 -Y2Vrcw== 26428 -IEZQUw== 26429 -IG9jdXI= 26430 -IGRldGVyaW9y 26431 -5rOo 26432 -IGVtcHJlc2Fz 26433 -UGF1bA== 26434 -ICkpKQ== 26435 -INCy0YDQtdC80LXQvdC4 26436 -IHNjb2xk 26437 -15nXog== 26438 -IHN1c3BlY3RlZA== 26439 -IGFjY2Vzc2luZw== 26440 -IHN1YnN0aXQ= 26441 -IGhpc3RvcmlhbnM= 26442 -5Lu7 26443 -INC00LXQu9C+ 26444 -IHNvY2llZA== 26445 -cm9uZQ== 26446 -IHJlZGVu 26447 -IGV4dGVuZHM= 26448 -ZXBoZXJk 26449 -IGJhbGNvbg== 26450 -5LiN6LW3 26451 -IFNvbG8= 26452 -IHBvbGl0aWNpYW4= 26453 -0L7Qu9GM0L3Qvg== 26454 -IGlyZ2VuZHc= 26455 -IHRyYXVtYXRpYw== 26456 -IHJhcHBlcg== 26457 -IFJPQkVSVA== 26458 -UmVhbGx5 26459 -5oGv 26460 -IGxpbmV1cA== 26461 -QVNF 26462 -IGNvbnRyYWN0b3I= 26463 -IENvcnBvcmF0aW9u 26464 -Z29y 26465 -IFRvZG8= 26466 -0YHRgtGA0L7QuQ== 26467 -RkJF 26468 -IG5ld3NsZXR0ZXI= 26469 -IGtvxYQ= 26470 -YWx0aWVz 26471 -INC/0YDQuNGH 26472 -IEhlYXZ5 26473 -IHN3b3Jkcw== 26474 -IG1hbmlwdWxhdGlvbg== 26475 -IGZ1bms= 26476 -IHbDpXI= 26477 -IFRhbGliYW4= 26478 -IOuwpQ== 26479 -IGFjbmU= 26480 -w7xyw7w= 26481 -IGRlc3dlZ2Vu 26482 -IER1c3Q= 26483 -IHNpbGlj 26484 -IGhvb2tz 26485 -IGJsaWo= 26486 -IHBldGl0cw== 26487 -IGZpbG1l 26488 -IEJlcmVpY2g= 26489 -IFNhaWQ= 26490 -IGltcG9zZWQ= 26491 -IGRpYXJ5 26492 -INCz0L7RgA== 26493 -IEdhdGVz 26494 -IGFsdGE= 26495 -5biM 26496 -IGNoY2lh 26497 -cGxlYXNhbnQ= 26498 -IOuwnQ== 26499 -IG1vxbxlbXk= 26500 -IEF1c3RyaWE= 26501 -IGJyb2tlcg== 26502 -IHN1Y2tlZA== 26503 -6ICD 26504 -IGNvbXBhcnRtZW50 26505 -IGNsb25l 26506 -INeU16I= 26507 -IERhbmtl 26508 -IG5vY2htYWw= 26509 -0LXQt9C0 26510 -IGFkcmVuYWw= 26511 -IGtsZWluZW4= 26512 -44G+44GX44KH44GG 26513 -IHN1YnNlcXVlbnRseQ== 26514 -IGRlY2VudHJhbA== 26515 -IGdlbmV0aWNz 26516 -IOq0kQ== 26517 -IG1vbml0b3Jz 26518 -IEFwcGxpYw== 26519 -IFJlcG9ydGVy 26520 -d2VydA== 26521 -IHdpZW0= 26522 -IE1vdmVtZW50 26523 -IGludGVydmlld2luZw== 26524 -IGhhaXJz 26525 -IHB1w7I= 26526 -IENoZWxzZWE= 26527 -IGNvaGVy 26528 -IGNvdA== 26529 -IHphcw== 26530 -IHBhdGNoZXM= 26531 -IGxhaA== 26532 -0YPQvdC6 26533 -IFJlYWdhbg== 26534 -IE1hcmNv 26535 -Y2l0eQ== 26536 -IGRlZmVuZGVy 26537 -IGRlY29yYXRpb24= 26538 -aWpp 26539 -IGxpdHRlcg== 26540 -0Kg= 26541 -IGplZ28= 26542 -UkVX 26543 -IFBpaw== 26544 -IEhlZQ== 26545 -IEl2 26546 -INC40LTQtQ== 26547 -IFRoZWF0ZXI= 26548 -INGH0LDRgdGC0L4= 26549 -IHN3ZWF0ZXI= 26550 -IGhpZ2hsaWdodGluZw== 26551 -IGFpbnNp 26552 -IGRpcGxvbWF0aWM= 26553 -IE5ldmVydGhlbGVzcw== 26554 -5bM= 26555 -QVNPTg== 26556 -IHDDumJsaWNv 26557 -IGZlcm0= 26558 -cmVhdGVk 26559 -Y29k 26560 -IOusvOs= 26561 -IG1pc3Rlcg== 26562 -IFZhbmNvdXZlcg== 26563 -IHJlY29nbml6ZXM= 26564 -ZWNk 26565 -IGNvbXBsaWNhdGlvbnM= 26566 -ZW5jaWFs 26567 -44GX44GP 26568 -IOqwgOyngA== 26569 -IFVsdGltYXRl 26570 -IHZhaWc= 26571 -IE1lcnJ5 26572 -15XXkg== 26573 -IE1hcmN1cw== 26574 -57i9 26575 -b3dlZ28= 26576 -IG1lbnRl 26577 -U20= 26578 -IGFqYQ== 26579 -IFRhbw== 26580 -IGp1ZGljaWFs 26581 -IGVudHJlcHJlbmV1cnNoaXA= 26582 -INC90LXQvNC90L7Qs9C+ 26583 -IHBpcw== 26584 -IGVyZw== 26585 -IGNocmlzdA== 26586 -IEN1cnQ= 26587 -INGA0LDRgdC/ 26588 -zrvOtQ== 26589 -ZW5zY2g= 26590 -w61yZQ== 26591 -IGZvY2Fs 26592 -IERpYW1vbmQ= 26593 -YXbDrWE= 26594 -IGhhbm5v 26595 -IFNxdWFk 26596 -IGFzc29jaWF0aW9ucw== 26597 -IENyZWF0aXZl 26598 -IG1lc3Nlbmdlcg== 26599 -IGJlZ2dpbmc= 26600 -IGRlY2ltYWw= 26601 -IGTEscWf 26602 -IG1ldGFkYXRh 26603 -c2Vscw== 26604 -IMSwxZ8= 26605 -4buvYQ== 26606 -IGRpZmZpY2lsZQ== 26607 -ZMSx 26608 -IHNsYXVnaHRlcg== 26609 -IFZlcmc= 26610 -INeS150= 26611 -57Ch 26612 -5oyJ 26613 -IFRlYQ== 26614 -YXNzZXM= 26615 -T2s= 26616 -IHN5bnRoZXM= 26617 -b3RpYXRpb24= 26618 -IHBhaW50ZXI= 26619 -IGVsYm93cw== 26620 -IGFyY2hpdGVjdHVyYWw= 26621 -INGA0LDQtA== 26622 -IGdsb3I= 26623 -aW1hZ2U= 26624 -YW1wYQ== 26625 -Y3VsaWFy 26626 -oKg= 26627 -IHRldmU= 26628 -IFN0ZWxsZQ== 26629 -IEJhbQ== 26630 -IOy0iA== 26631 -YXNpcw== 26632 -aXBlZGlh 26633 -IEdJ 26634 -IEFjdGl2ZQ== 26635 -54S25ZCO 26636 -YXpp 26637 -44KM44Gm 26638 -IEx1Y2t5 26639 -7ZWp 26640 -INC/0YDQuNGF0L7QtA== 26641 -IHJ1bndheQ== 26642 -IGF1dGhlbnRpY2F0aW9u 26643 -IHBvc2libGU= 26644 -IHN1cHBsZW1lbnRz 26645 -IHN1cmdpY2Fs 26646 -R2Vu 26647 -IGZlYXNpYmxl 26648 -RE8= 26649 -IG91dGxvb2s= 26650 -IGludGVydmFscw== 26651 -IGFuZWNk 26652 -w6BuZw== 26653 -IHN0cmFwcw== 26654 -IFNodQ== 26655 -dWRk 26656 -aXNzZW5zY2hhZnQ= 26657 -IHBvcnRl 26658 -IGNvbW1pdHRpbmc= 26659 -IGFsbGV5 26660 -IGNvdmVuYW50 26661 -IFBlZHJv 26662 -bGVzc25lc3M= 26663 -IFNvbGlk 26664 -IE1vbGx5 26665 -INC90LXQutC+0YLQvtGA 26666 -IGNvb3BlcmF0ZQ== 26667 -5YyX 26668 -b2xsZW4= 26669 -IHR1bmE= 26670 -IGtpbmRlcmdhcnRlbg== 26671 -IFNpeg== 26672 -IGR1xbxv 26673 -IE1CQQ== 26674 -IEdFT1JHRQ== 26675 -IEZpc2hlcg== 26676 -5b+Y 26677 -IENhZXNhcg== 26678 -INC60YDQsNGB0LjQsg== 26679 -IERlbGhp 26680 -enlt 26681 -IGV4cGxpY2Fy 26682 -6rCA7KeA 26683 -dW5z 26684 -Z3Jvdw== 26685 -INC/0YDQuNGB 26686 -IDg2 26687 -IHN0YXRpbmc= 26688 -IG1hc3Nh 26689 -Y2h0ZXI= 26690 -IOy7rOufrA== 26691 -IGRlcHV0eQ== 26692 -U00= 26693 -bm9j 26694 -IGdlb2dyYXBoeQ== 26695 -IEVudGVycHJpc2U= 26696 -IENhbnQ= 26697 -w7Z6 26698 -IHVucGFjaw== 26699 -IO2ZlOs= 26700 -IHNlYXJjaGVz 26701 -IHByZXNpZGVuY3k= 26702 -IHRyaXZpYWw= 26703 -IHBpZ2U= 26704 -b3VidA== 26705 -44Ka 26706 -7LyA7J20 26707 -IGJ1ZGdldHM= 26708 -IHVi 26709 -IHBuZQ== 26710 -IFlhbGU= 26711 -IMWfw7Z5bGU= 26712 -cmVndWxhcg== 26713 -IGltcGVyZmVjdA== 26714 -QVJB 26715 -IGZhbcOtbGlh 26716 -dXJt 26717 -IEFkdmVudHVyZQ== 26718 -44OK 26719 -Y2lz 26720 -ZW1hcms= 26721 -IG5lZ28= 26722 -IGluYXBwcm9wcmlhdGU= 26723 -INC/0YDQuNC3 26724 -INGA0L7Quw== 26725 -IGRyZWFtZWQ= 26726 -QnJ5 26727 -IHNodXR0bGU= 26728 -IHBpbGxhcnM= 26729 -IGJpaw== 26730 -aW51bQ== 26731 -INGD0YE= 26732 -IE5lYnI= 26733 -IHBlcnBlbmRpY3VsYXI= 26734 -IGJvb2tlZA== 26735 -YmVyeQ== 26736 -IHZpa3Q= 26737 -YmVhcg== 26738 -ZXN1cw== 26739 -INCy0L7Qt9C80L7QttC90L4= 26740 -qLk= 26741 -IHByZXN1bWFibHk= 26742 -IE1lbXBoaXM= 26743 -IGFtYnVsYW5jZQ== 26744 -15XXnteo 26745 -IHRodW1ibmFpbA== 26746 -IG1vZGlmaWNhdGlvbg== 26747 -6YeP 26748 -IGludGVycHJldGVk 26749 -IHByb21v 26750 -IM66zqw= 26751 -IM61z4A= 26752 -IGFjb3VzdGlj 26753 -IERC 26754 -5ZOO 26755 -IG5vbmV0aGVsZXNz 26756 -b3VsZQ== 26757 -IHBlcXU= 26758 -IGtub2I= 26759 -44Kj 26760 -IOuPjOyVhA== 26761 -IHB1cmNoYXNlcw== 26762 -IMOHw7xua8O8 26763 -IGRpdmlkaW5n 26764 -cGVyZm9ybQ== 26765 -cmFjdGlvbg== 26766 -aGVhbHRoeQ== 26767 -IFRpdGxl 26768 -IHVr 26769 -IGNlcmNh 26770 -IGFyZ3VhYmx5 26771 -IGZhbGU= 26772 -67O1 26773 -IGdhbWVycw== 26774 -IHV0aWxpemluZw== 26775 -IG9mZmVuZGVk 26776 -IHRhdmE= 26777 -YWzEsQ== 26778 -IG1lZGlhbg== 26779 -IGluZmVjdGlvdXM= 26780 -IEFubmll 26781 -IHNtYXJ0cGhvbmVz 26782 -IHBhcm9sZQ== 26783 -5Zad 26784 -IEVwaWM= 26785 -enph 26786 -IHVuaWZpZWQ= 26787 -IOq3uOuVjA== 26788 -IGN1cnRhaW4= 26789 -IMSD 26790 -IHNleHVhbGx5 26791 -IHVuc2VyZW0= 26792 -IENvbnZlbnRpb24= 26793 -IGFsbGVnZWRseQ== 26794 -WWE= 26795 -IEhvbw== 26796 -ZW5tZW50 26797 -5oCq 26798 -7ZuE 26799 -IGdpZ2FudGlj 26800 -IG5vdGluZw== 26801 -IHJlYm8= 26802 -IEphbWE= 26803 -IEFseg== 26804 -IGJvcnJvd2Vk 26805 -7Lmo 26806 -IHBlcmlwaGVy 26807 -0L7RgtCw 26808 -IEdC 26809 -IEdlYXI= 26810 -IGVjb25vbWljYWxseQ== 26811 -IHRlbGVmb24= 26812 -IHF1ZXJlbW9z 26813 -INC00LDQu9GM0YjQtQ== 26814 -IHJhcw== 26815 -IFRlYWNo 26816 -aWNpb3M= 26817 -YXRvcw== 26818 -IHBsZWRnZQ== 26819 -YmF1 26820 -IEhpbXNlbGY= 26821 -TGluaw== 26822 -IGVzcGVybw== 26823 -IGNocm9tb3M= 26824 -IFBFUg== 26825 -IGVybGU= 26826 -IHBvZGl1bQ== 26827 -w6dvcw== 26828 -IG5pZXU= 26829 -IGZlbg== 26830 -IEdPRA== 26831 -IENob2NvbGF0ZQ== 26832 -d2Vyaw== 26833 -IHThu6s= 26834 -IHN1cHByZXNz 26835 -zrvOtw== 26836 -IDI0MA== 26837 -IHNpdMOk 26838 -IGhvbmVzdHk= 26839 -IEJpbw== 26840 -IEJhcmQ= 26841 -INC+0LHRidC10Lw= 26842 -INC80YPQtw== 26843 -IG1hcmJsZQ== 26844 -INGG0LXQvdGC 26845 -IHByb2N1cmU= 26846 -IHJvdG9y 26847 -YmVybg== 26848 -IHR1aA== 26849 -IGhlYWRzZXQ= 26850 -YXRlbQ== 26851 -IHdhcnJhbnR5 26852 -4K60 26853 -IGZpbGluZw== 26854 -zrnOrA== 26855 -IGNvbXByZW5kcmU= 26856 -IGltcHVsc2U= 26857 -IHNhbHY= 26858 -d3JpdHRlbg== 26859 -IGluc3RpdHV0ZQ== 26860 -S2lt 26861 -IExHQlRR 26862 -ZmljaWVudGU= 26863 -SGlz 26864 -IM6xz4XPhM+M 26865 -IHRlZW5hZ2U= 26866 -b3J1cw== 26867 -INGA0LDQt9Cx 26868 -U2Vl 26869 -IENvbnNlcnY= 26870 -4buBbg== 26871 -ZnVsbmVzcw== 26872 -IHN0cmF3YmVycmllcw== 26873 -IEFidQ== 26874 -0LjQvtC9 26875 -IG9sbGE= 26876 -Tk9JU0U= 26877 -IEVtcGxveQ== 26878 -IHdpcGVk 26879 -dXJnZXI= 26880 -IG1vZGlmaWNhdGlvbnM= 26881 -IO2VmOyngA== 26882 -IGZvb3RzdGVwcw== 26883 -IGhvbm9ycw== 26884 -IGFkdWw= 26885 -IGZsaXBwaW5n 26886 -IEhV 26887 -Wlk= 26888 -IGludGVncmF0aW5n 26889 -2KjYsQ== 26890 -dWxsYQ== 26891 -IG5hdHV1cmxpams= 26892 -IO2XiA== 26893 -IEV0aGVyZXVt 26894 -2YrZhA== 26895 -d2Vk 26896 -IHBlYWtz 26897 -IEtlcw== 26898 -IGJsb29t 26899 -IGNyYXNoaW5n 26900 -IDkxMQ== 26901 -INC+0YLQu9C40Yc= 26902 -IGNvbnRyb2xsZXJz 26903 -IERvZA== 26904 -INCy0LzQtdGB0YLQtQ== 26905 -IHNvcnRpcg== 26906 -5aWH 26907 -IFN0cmFpZ2h0 26908 -IEdyYWNpYXM= 26909 -IGdyb292ZQ== 26910 -IHRvZ2c= 26911 -IOyLtuydgA== 26912 -w6lybw== 26913 -IG91dHdhcmQ= 26914 -IFdB 26915 -IFJvY2t5 26916 -IHNjYW0= 26917 -IGhheWF0 26918 -aWdudHk= 26919 -4oQ= 26920 -cGxpbmdz 26921 -IGFudGliaW90aWNz 26922 -IOS4gA== 26923 -IG5ldmVydGhlbGVzcw== 26924 -amFuZw== 26925 -Y29tbWVyY2U= 26926 -IHNwb2lsZXI= 26927 -IGdsb3Zl 26928 -IGNoYXR0ZXI= 26929 -IEJZ 26930 -fj8= 26931 -IO2YuA== 26932 -IGRlbW9s 26933 -d2VjaHNlbA== 26934 -aW1pcg== 26935 -IHJhaWQ= 26936 -0LXRgNGF 26937 -7J6Q6riw 26938 -ZW5m 26939 -IGNvbW1lbnRlZA== 26940 -IG9wdGltaXplZA== 26941 -IGNvbnZpY3RlZA== 26942 -IGJhdHM= 26943 -IFNC 26944 -IEF1cg== 26945 -IFRvbmc= 26946 -IGltcGxpY2l0 26947 -IEphbmV0 26948 -IHJlYWc= 26949 -44Gy 26950 -IEFkdmFuY2Vk 26951 -IGltcG9zZQ== 26952 -16nXlA== 26953 -IHNjaGVtZXM= 26954 -b3VnaGVy 26955 -YWJvbGlj 26956 -IOqxsOyjoA== 26957 -IHNsb3dpbmc= 26958 -IHd0ZWR5 26959 -IGRlc3RydWN0aXZl 26960 -INC+0L/RgNC10LQ= 26961 -IGxhbmRtYXJr 26962 -IOuPiA== 26963 -IFdhbGtpbmc= 26964 -4bq5 26965 -IHRpamQ= 26966 -IEtO 26967 -IFF1YW50 26968 -7Jik6w== 26969 -INC60YDRgw== 26970 -IHBlcmRlcg== 26971 -IG5vdmU= 26972 -w6RuZGU= 26973 -IOOBlw== 26974 -Ymlh 26975 -IGN1c3RvZHk= 26976 -IGJpb2Q= 26977 -5p2x6KW/ 26978 -IGRpcmVjdGluZw== 26979 -Li4u4oCL 26980 -IHJlbG9j 26981 -IGRlbWFuZGU= 26982 -44KT44Gg 26983 -IG/En2x1bQ== 26984 -INC+0LTQvdCw 26985 -IE1pbGs= 26986 -5Y+3 26987 -IEtyYQ== 26988 -IEhvbmRh 26989 -IHB1ZQ== 26990 -IGVsZWt0 26991 -IGJlZ2lubmVycw== 26992 -IHNwZWFy 26993 -w61uaA== 26994 -IEx1ZnQ= 26995 -IG5pZw== 26996 -IFNjaG9vbHM= 26997 -IGZvcnVtcw== 26998 -IFFpbg== 26999 -cHBv 27000 -IHphZw== 27001 -INCu 27002 -IHRvb3RocA== 27003 -IFN0eWxl 27004 -7LSI 27005 -IHB1bmN0 27006 -IHJlcHM= 27007 -IEFseQ== 27008 -IGFtZW5kbWVudHM= 27009 -IMO2eg== 27010 -IGRpZ2l0cw== 27011 -dXJhaQ== 27012 -IGNoYW90aWM= 27013 -IE1hc3RlcnM= 27014 -ZW9u 27015 -IENhc2g= 27016 -IEN1eg== 27017 -IGJlZGV1dGV0 27018 -IHNjYW5uaW5n 27019 -INC20LQ= 27020 -0L3QtdGC 27021 -IGNlcnRhaW50eQ== 27022 -amVr 27023 -IGRpam8= 27024 -IENsaW1hdGU= 27025 -IHJpbnNl 27026 -IGtyaWo= 27027 -dmVsYW5k 27028 -IHNvdW5kdHJhY2s= 27029 -IFNhZmU= 27030 -IE5vdmE= 27031 -OTQ= 27032 -IGF0aGU= 27033 -IFZlcmI= 27034 -b2xlcg== 27035 -7J207KOg 27036 -IHZpbg== 27037 -IHJlc3BpcmF0b3J5 27038 -IFN0dWR5 27039 -IENBTQ== 27040 -IGF2b2NhZG8= 27041 -IFpoZW4= 27042 -IGxhdGVuY3k= 27043 -IGZlYXRoZXJz 27044 -IGNvbnRhcg== 27045 -INCy0LXRiQ== 27046 -IGZhcms= 27047 -IGJsZW5kZWQ= 27048 -IGV4cGxvZGVk 27049 -IFhY 27050 -IEJlbmlt 27051 -IGFsZ3XDqW0= 27052 -aXN0b2lyZQ== 27053 -IGNvbmZpZGVudGlhbA== 27054 -IG1hc3Q= 27055 -IOy/ 27056 -Z2Vo 27057 -IGRpc3Jlc3BlY3Q= 27058 -IFN5c3RlbXM= 27059 -xrBh 27060 -RWQ= 27061 -IHd5cw== 27062 -IGV4b3RpYw== 27063 -IGdsb3dpbmc= 27064 -w7luZw== 27065 -b3VuZ2U= 27066 -6IQ= 27067 -0LDQvdC40Lc= 27068 -IHBhbGF2 27069 -IFN3b3Jk 27070 -IGdpbQ== 27071 -IENyb3c= 27072 -IHBvdGVudA== 27073 -YmlzaA== 27074 -IGFidXNlZA== 27075 -IEplZA== 27076 -IGdhbWJsaW5n 27077 -IFNwZWN0 27078 -IGludmVzdGlnYXRvcnM= 27079 -5pma 27080 -IHJhdHQ= 27081 -IGRvYg== 27082 -IERFUw== 27083 -aG9n 27084 -INC+0YLQutGA0Ys= 27085 -7YyF 27086 -INC00LXQvdGM0LPQuA== 27087 -IO2YuQ== 27088 -IOuouOumrA== 27089 -IHNhdHVyYXRpb24= 27090 -IGluaGVyaXRlZA== 27091 -IElubm92YXRpb24= 27092 -7JeI642Y 27093 -IHRhbmdpYmxl 27094 -IGRlcHJp 27095 -aGVk 27096 -INC/0L7QvNC+0LM= 27097 -IHNsaWNlZA== 27098 -4KWN 27099 -IHRo4bq/ 27100 -xaU= 27101 -Njg= 27102 -IGNvcm9uYQ== 27103 -IGdpZnRlZA== 27104 -IHNvaXI= 27105 -IGh1bWlsaXR5 27106 -IOydtOqxuA== 27107 -IGZsYXdz 27108 -INC/0YDQsNC60YLQuA== 27109 -IGthbGQ= 27110 -d2HFvA== 27111 -eXc= 27112 -44KT44Gn44GZ 27113 -aXJ0ZWVu 27114 -IGNyb2NoZXRz 27115 -pqzqsIA= 27116 -IOyghOyXkA== 27117 -IGRlc2U= 27118 -5qWt 27119 -INC80LDQsw== 27120 -IGR6aWHFgg== 27121 -IGzDqWc= 27122 -Y2hhbmdpbmc= 27123 -IGxsZXY= 27124 -xYRzaw== 27125 -55S7 27126 -IDE5ODQ= 27127 -b3Jucw== 27128 -IFdlbHNo 27129 -IHBoYXJtYWNldXRpY2Fs 27130 -IHB1bXBpbmc= 27131 -IFNoYXc= 27132 -cHVuaw== 27133 -IHZhdWx0 27134 -IGtpbmV0aWM= 27135 -IGh1cnJpY2FuZQ== 27136 -IEluY2x1ZGluZw== 27137 -4bupYw== 27138 -IEdyYW5kcGE= 27139 -YW5zaGlw 27140 -6aaZ5riv 27141 -INCy0YvRhdC+0LQ= 27142 -0L3QvtC2 27143 -nKA= 27144 -dXR0YQ== 27145 -IOqygeuLiOuLpA== 27146 -IGJheg== 27147 -INC/0L7RiA== 27148 -IHBlY3VsaWFy 27149 -ennEhw== 27150 -IEVsbGll 27151 -IGxlYXJucw== 27152 -IEtyaXNobmE= 27153 -IGNvbnNlY3V0 27154 -IGVtcGF0aA== 27155 -IERpbg== 27156 -IHRyYWRlZA== 27157 -IEJvcmlz 27158 -dWdnYWdl 27159 -b2xsYQ== 27160 -INC90LDQt9Cy 27161 -IGV0ZXJuaXR5 27162 -INCy0L8= 27163 -w6htZXM= 27164 -IGdyYXBw 27165 -YsOp 27166 -INC/0YDQtdC00YHRgtCw0LI= 27167 -IEZD 27168 -jeuLiOuLpA== 27169 -ZXZlbg== 27170 -IE5lYnJhc2th 27171 -b3J0dW5l 27172 -IGthcmVuYQ== 27173 -IEFnZW50 27174 -IHN0aW5n 27175 -IFBJ 27176 -IG11bmljaXBhbA== 27177 -cG93ZXJlZA== 27178 -IGNvbnNlZ3Vl 27179 -IE1hbmNoZXN0ZXI= 27180 -IHJhaW55 27181 -IGJsaQ== 27182 -IGtvc3Q= 27183 -IGhhbHRlbg== 27184 -IEFoaGg= 27185 -aW5zdWxh 27186 -ZXJ0aW5n 27187 -INin2YTZgQ== 27188 -IHJlbGFjaW9u 27189 -IGtvbWVu 27190 -IGRvbWU= 27191 -IHByaWVzdHM= 27192 -IEludHJvZHU= 27193 -cm9waGU= 27194 -c2hvcmU= 27195 -dmVsdA== 27196 -Y2xpcHNl 27197 -INGA0YPRgQ== 27198 -15nXoQ== 27199 -IHNhYmVtb3M= 27200 -IEhvbGxhbmQ= 27201 -b2dp 27202 -YW5raQ== 27203 -IE1hdHM= 27204 -IHNtb2tlZA== 27205 -dWxsaWU= 27206 -IGV1cm9wZQ== 27207 -INC00LXQudGB0YLQstC40YLQtdC70YzQvdC+ 27208 -IGJhcmR6aWVq 27209 -IHRyYW5zZm9ybWluZw== 27210 -IEV6 27211 -b3BhdGg= 27212 -IOyWuOuLiA== 27213 -INGB0YLQsNC9 27214 -4bqxbmc= 27215 -4Lix4LmJ 27216 -IE91Y2g= 27217 -IGNsZWFyYW5jZQ== 27218 -dXN0YWlu 27219 -IHNvbGlkYXJpdHk= 27220 -IHByb3Zpbmc= 27221 -INCY0L0= 27222 -INGB0Yo= 27223 -IHByb2xvbmc= 27224 -0LDQtNC90L4= 27225 -IHNvcw== 27226 -IERlYWw= 27227 -IDE3MA== 27228 -bW9ucw== 27229 -INC30LXQvA== 27230 -IGxvZ2dlZA== 27231 -IGxpZmVsb25n 27232 -IHNlbnNvcnk= 27233 -IGJlaG9sZA== 27234 -IEZBUg== 27235 -w6h0ZW1lbnQ= 27236 -IEZlZGVyYXRpb24= 27237 -IGRvZGdl 27238 -IFNoaXI= 27239 -IGRyYWdvbnM= 27240 -IEFyY3RpYw== 27241 -xIXFvA== 27242 -xY0= 27243 -wro= 27244 -IGRlbmtl 27245 -IHBvZHLDrWE= 27246 -Y29sZQ== 27247 -0YPQu9GM0YLQsNGC 27248 -IHN5c3RlbWF0aWM= 27249 -0LDQvNCw 27250 -Y2hvcw== 27251 -IGNsaW5pY3M= 27252 -IEJT 27253 -IHRhbGVz 27254 -dXNpb25z 27255 -IO2IrA== 27256 -IHByZXNlcnZhdGlvbg== 27257 -IGxvcmU= 27258 -IFByb3Rlc3Q= 27259 -4bub 27260 -5biC 27261 -IGFja25vd2xlZGdlZA== 27262 -IElzYWlhaA== 27263 -IOuVjOuKlA== 27264 -INeY 27265 -IGNvbXBldGl0b3I= 27266 -IGFkdmFuY2luZw== 27267 -emlw 27268 -IHRlbnRo 27269 -IExhdXJl 27270 -IGhpbnRz 27271 -IGV4ZXJjaXNpbmc= 27272 -npzr 27273 -IEludGVsbGlnZW5jZQ== 27274 -dWF0ZWQ= 27275 -T1VU 27276 -b3BlZA== 27277 -IGF1dG9ub215 27278 -IGJyYW5kaW5n 27279 -IE1lZGl0ZXJyYW5lYW4= 27280 -0ZbQug== 27281 -IHNjcmV3ZHJpdmVy 27282 -IHN1cHJl 27283 -IHN0YXA= 27284 -IGp1cmlzZGljdGlvbg== 27285 -IFNldHRpbmdz 27286 -IGZvcmVmcm9udA== 27287 -IEZlbWFsZQ== 27288 -Y29tZm9ydA== 27289 -IG11bHRpcGxpY2F0aW9u 27290 -IE11cnJheQ== 27291 -IGJvYg== 27292 -IFRhcw== 27293 -IHRhaHU= 27294 -IG9udW4= 27295 -ZXR0ZXI= 27296 -IHByb3BoZXRz 27297 -bGFn 27298 -IHJldmVudWVz 27299 -IHByw6E= 27300 -IHVwbG9hZGluZw== 27301 -IG1hY2hpbmVyeQ== 27302 -YXNjYWw= 27303 -IEVzdMOh 27304 -IEdvdGg= 27305 -IEJhbGQ= 27306 -IFNhdw== 27307 -IHN0cmlwZXM= 27308 -7KCR 27309 -IHBvd2lu 27310 -5pel5pys 27311 -IGhvc3RpbGU= 27312 -IGRhcnVt 27313 -IHByZXZlbnRlZA== 27314 -0L7QttCw0LvRg9C50YHRgtCw 27315 -IGFsZ3VuYXM= 27316 -IGhvcGVsZXNz 27317 -IHpuYWo= 27318 -IHJlYWRpbmdz 27319 -IGNyYXZpbmc= 27320 -dGF0 27321 -IFBpZw== 27322 -IGxpYXI= 27323 -54ix 27324 -IG11bHRpcGxheWVy 27325 -IGRhbGU= 27326 -IENvdXJzZQ== 27327 -7YG8 27328 -IEtpdGE= 27329 -IGN1c3RvbXM= 27330 -IHJlc3BvbmRz 27331 -ZW5kcmE= 27332 -6KaW 27333 -IG1ldHJv 27334 -0YHQvtC7 27335 -IG1pdGlnYXRl 27336 -IG9wcHJlc3Npb24= 27337 -IOaIkeWAkQ== 27338 -cXVpbmhv 27339 -IGFtbW8= 27340 -IGVuZmVy 27341 -IHBvbnk= 27342 -IG91bmNlcw== 27343 -sJQ= 27344 -IOyImOqwgA== 27345 -IGRpY2hv 27346 -IERlYg== 27347 -IHdvbmRlcnM= 27348 -IFJvb3Nl 27349 -IHByaXplcw== 27350 -IEFMRVg= 27351 -IHRoYW5rZnVsbHk= 27352 -IHRpc3N1ZXM= 27353 -INGA0LDQstC90L4= 27354 -IEx1bmE= 27355 -aW50ZWxsaWdpYmxl 27356 -IOyZuA== 27357 -6rCR 27358 -IEhlYXQ= 27359 -INGB0LjQtA== 27360 -IFF1aQ== 27361 -IGlvbnM= 27362 -IGFjY29tbW9kYXRpb24= 27363 -5L6/ 27364 -IEthcnQ= 27365 -aWVuc3Q= 27366 -IHRhcmRl 27367 -IHNvYWtlZA== 27368 -IENhc2V5 27369 -IOy0nQ== 27370 -INGA0YPQsQ== 27371 -IGRpZmZlcmVudGk= 27372 -IGxlZnRvdmVy 27373 -IGV4Y2hhbmdlcw== 27374 -c2Vjb25k 27375 -IGZpcnN0bHk= 27376 -IGJ1aWxkZXI= 27377 -cmllbg== 27378 -IGR3 27379 -IGJvdW5jaW5n 27380 -Pzwv 27381 -IOuMgO2VtOyEnA== 27382 -INGB0LU= 27383 -IE1pbGVz 27384 -aWVuaWU= 27385 -INC/0L7QtNC/0LjRgQ== 27386 -IOustA== 27387 -IGFyaXNlcw== 27388 -IHN1YmNvbnNjaW91cw== 27389 -IFNhbmR5 27390 -IGxvdHRlcnk= 27391 -4oCR 27392 -YW1pbGlhcg== 27393 -IGNvb3JkaW5hdG9y 27394 -6Iw= 27395 -IGV4dHJhb3JkaW4= 27396 -IFJvbmFsZA== 27397 -IE1PTg== 27398 -Z3JlZW4= 27399 -IG1hbnVmYWN0dXJl 27400 -IFJlY29yZA== 27401 -IE1hcmtldGluZw== 27402 -0LjRhg== 27403 -IGNyZWRlbnRpYWxz 27404 -IHVwcmlnaHQ= 27405 -IEhlcml0YWdl 27406 -IGfDtnJk 27407 -5pyN 27408 -ZXhwZW5zaXZl 27409 -4bqtbg== 27410 -IOyxhA== 27411 -IG91dGxpbmVk 27412 -IE9vb2g= 27413 -b3JpZW50ZWQ= 27414 -IHdpcmVk 27415 -IG91dGxldHM= 27416 -IGh1Z2VseQ== 27417 -IO2WiOuKlOuNsA== 27418 -0LDRgNGC 27419 -IGxvZ2lzdGljcw== 27420 -IHNlYXNvbmFs 27421 -IGRlYmU= 27422 -IHRoZW9y 27423 -IHBpcmF0ZQ== 27424 -YXBweQ== 27425 -IGtub3Rz 27426 -IGZlbW1l 27427 -IFNvZnR3YXJl 27428 -Z2VuZGU= 27429 -0YLQsNC60Lg= 27430 -IHRlbXBsZXM= 27431 -IGxpbWl0YXRpb24= 27432 -IGFtcGxpdHVkZQ== 27433 -IGhhY2Vu 27434 -IGF1ZGk= 27435 -IOuWqA== 27436 -IFdhaGw= 27437 -IG5paA== 27438 -IGFtcGxpZmllcg== 27439 -YXJpdXM= 27440 -aXphZG8= 27441 -YWNoYQ== 27442 -IGt1bGxhbg== 27443 -IFR3aW4= 27444 -IEZvcmNlcw== 27445 -IGFicmly 27446 -IEVQQQ== 27447 -IEFoYQ== 27448 -IOq3uOuemOuPhA== 27449 -IGJpb20= 27450 -INCi0LDQvA== 27451 -IHNhaWxpbmc= 27452 -IEpva2Vy 27453 -Rmlyc3Q= 27454 -6L+Z5piv 27455 -fl0= 27456 -b3JzY2g= 27457 -IHbDpnJl 27458 -IGJlZXRqZQ== 27459 -IFNwYcOf 27460 -cG9saXQ= 27461 -IHR1cmJ1bA== 27462 -IOyggO2drOqwgA== 27463 -IGNpYw== 27464 -IERyYWtl 27465 -IEJSSQ== 27466 -aXphw6fDo28= 27467 -IOyeiOuLpA== 27468 -IEx5bm4= 27469 -IHRyYW5zZ2VuZGVy 27470 -IHJlc2lnbg== 27471 -IGNoYXJ0ZXI= 27472 -IEpI 27473 -IEhvbG1lcw== 27474 -IExpcA== 27475 -ZGFz 27476 -IHBlZGlhdHJpYw== 27477 -IG1lbW9yaXpl 27478 -IGV2YWx1YXRpbmc= 27479 -IPCfkA== 27480 -Y2Fr 27481 -IGNvbmp1bmN0aW9u 27482 -IHJlc2VydmVz 27483 -IHNoYW1wb28= 27484 -IGp1ZGdlZA== 27485 -IHdpZHo= 27486 -VklO 27487 -IGFib2FyZA== 27488 -YXJpcw== 27489 -IFJvaA== 27490 -IGNvb2xlZA== 27491 -0YHRgtC1 27492 -Y2Vw 27493 -cm9zdA== 27494 -aG90cw== 27495 -IE1lbGJvdXJuZQ== 27496 -0L7Rh9GM 27497 -IHZlbnRpbA== 27498 -0LjQvdC+0LI= 27499 -IG1vdGlvbnM= 27500 -7JeI64qU642w 27501 -0LzQtdGA0LjQug== 27502 -IENoYXQ= 27503 -IGdvdXZlcm5lbWVudA== 27504 -5LiA5qyh 27505 -IEtpdm9s 27506 -IEtpdm9sb3dpdHo= 27507 -IG7Ds2k= 27508 -INC60YPQtNCw 27509 -IGh5ZHJhdWw= 27510 -IEJlcmc= 27511 -eWx1bQ== 27512 -IFByw6RzaWRlbnQ= 27513 -cm9weQ== 27514 -IHNlbWlj 27515 -0Y/QtdGC 27516 -IENhcGU= 27517 -IGNhbmU= 27518 -IGJyaW5nZW4= 27519 -IHdpcmluZw== 27520 -dW55YQ== 27521 -IHJlcGF5 27522 -qqk= 27523 -IHdvbnQ= 27524 -w6FudA== 27525 -IGdvdmVy 27526 -IExpYmVydHk= 27527 -IGVsZWN0cm9tYWdu 27528 -IFNpbmdo 27529 -INCz0YDRg9C/ 27530 -0LPQvtCy 27531 -iOustOs= 27532 -IFJ1bGU= 27533 -IHVuZGVyd2F5 27534 -IEZyZWRlcg== 27535 -IHR1cmJpbmU= 27536 -aXNoaQ== 27537 -IGbDrXM= 27538 -IEN1bHR1cmU= 27539 -YWNyZQ== 27540 -IHdhbmRlcg== 27541 -IGd1ZXJyYQ== 27542 -IHPDtnk= 27543 -IEp1cg== 27544 -YXdheXM= 27545 -IHNjaHdpZXI= 27546 -Z3VhcmQ= 27547 -IEFiZA== 27548 -dWN0aW9u 27549 -IGFya2FkYcWfbGFy 27550 -IEhhbWI= 27551 -Py4= 27552 -c2l6ZQ== 27553 -IE9ydGg= 27554 -IHN3YXk= 27555 -IM6U 27556 -IGFic29ycHRpb24= 27557 -aW5lZXM= 27558 -IHBhdHJvbnM= 27559 -IGJlYWNoZXM= 27560 -R0c= 27561 -IGNvbnRhbWlu 27562 -aW50ZW5kZW50 27563 -INC90YDQsNCy 27564 -INC00LXRgNC2 27565 -IHF1aWx0 27566 -IGV2b2x1dGlvbmFyeQ== 27567 -7J206528 27568 -YXppb25p 27569 -IGVya2w= 27570 -IEJ1dGxlcg== 27571 -IGRvbw== 27572 -IG5lZ290aWF0aW9u 27573 -ZW5kdW0= 27574 -IHRlcm1pbm9sb2d5 27575 -IGt1bA== 27576 -IFVudGVybmVobWVu 27577 -w6lyaWM= 27578 -eGk= 27579 -YmFk 27580 -INC00L7Qu9C20L3Riw== 27581 -IE1pdGNoZWxs 27582 -dGhyZWU= 27583 -5byP 27584 -IHN1YnN0cmF0ZQ== 27585 -IEluaGFsZQ== 27586 -IEFncmlj 27587 -dW5nZQ== 27588 -INC30YA= 27589 -IGFkdmVyc2U= 27590 -IOyggOuPhA== 27591 -IHBpbGxhcg== 27592 -IE1pbnV0ZW4= 27593 -IE1hdGU= 27594 -IFBsYXR6 27595 -IGhlbHBsZXNz 27596 -IGFsYXI= 27597 -IGZyZW5jaA== 27598 -IGFsbG9jYXRpb24= 27599 -IHN0ZW1z 27600 -IG1hcmF0aG9u 27601 -IEhBUkY= 27602 -aXphY2nDs24= 27603 -SmVzcw== 27604 -INC30L3QsNGH 27605 -IGRlY2xhcmF0aW9u 27606 -RUVSSU5H 27607 -c3RlcmRhbQ== 27608 -YXNzaXVt 27609 -IHNlaXo= 27610 -IHByZXNpZGVudHM= 27611 -dGFrZQ== 27612 -IHdpbGRlcm5lc3M= 27613 -IGNvc21pYw== 27614 -IOuqqOuRkA== 27615 -c3Rybw== 27616 -IHBvd2llZHo= 27617 -IE1hZ2F6aW5l 27618 -IFZJ 27619 -INC00LXRgA== 27620 -IHfDvHJkZW4= 27621 -IHRhYmxldHM= 27622 -IHBpZXJ3cw== 27623 -IG1vcnRhbA== 27624 -IHN1cHBsaWVk 27625 -IE7Ds3M= 27626 -IFByb3Blcg== 27627 -INC60LDQttC00YvQuQ== 27628 -b2zDs2c= 27629 -67Cp 27630 -IG1pc2Nvbg== 27631 -IHByb3hpbWl0eQ== 27632 -IEFsbGVz 27633 -INCz0LvQsNC3 27634 -IGxhbWU= 27635 -IHZpYmVz 27636 -IGRlZW1lZA== 27637 -IHVyaW5l 27638 -IHJlbWluZGluZw== 27639 -IGNpcmN1bXN0YW5jZQ== 27640 -65Ok7J20 27641 -IGxhcHRvcHM= 27642 -wrI= 27643 -7ZW07JW8 27644 -IE9tZWdh 27645 -44Gq44KT44GL 27646 -Tlk= 27647 -IHB1bXBz 27648 -IHJhaWxz 27649 -IHN1cnBhc3M= 27650 -IEJyb3M= 27651 -IG5hdGlvbmFsbHk= 27652 -IGdld2VzZW4= 27653 -5Lqr 27654 -s7Tri6Q= 27655 -b3NoaW5n 27656 -6rCI 27657 -56S+ 27658 -IGNyaWFu 27659 -IOyCrOuejOydtA== 27660 -Y2F1c3Q= 27661 -5pW0 27662 -0YbQuNC/ 27663 -IE9iZXI= 27664 -IERBWQ== 27665 -IENhbm9u 27666 -enVuZw== 27667 -IOqwlg== 27668 -INCw0LLRgtC+0Lw= 27669 -IGRpdm9yY2Vk 27670 -15nXpA== 27671 -z4HOtQ== 27672 -Y2VsYW5k 27673 -Y2llcg== 27674 -0YDQtdC3 27675 -VG9kYXk= 27676 -IG9yYml0YWw= 27677 -IHN0cmV0 27678 -IHNhdHU= 27679 -IO2BrOs= 27680 -em9z 27681 -IFNjbw== 27682 -zrzOrQ== 27683 -IEd1YXJkaWFu 27684 -aW50ZXJlc3Q= 27685 -IFZFUg== 27686 -w7xuZGVu 27687 -INGF0L7RgtC10Ls= 27688 -dGl0 27689 -Qnk= 27690 -IGFubGF0 27691 -U2hvdw== 27692 -IG9pbHk= 27693 -56+A 27694 -IGxlZ2VuZHM= 27695 -IHNwZWN1bGF0aW9u 27696 -IFdpc2g= 27697 -IG1vbms= 27698 -R0FO 27699 -IGjhu40= 27700 -IGRhbmdlcnM= 27701 -IEJlbmU= 27702 -aXF1ZW1lbnQ= 27703 -IOuCmOyZgA== 27704 -INCw0LQ= 27705 -IGRpc2NyZXRl 27706 -w4c= 27707 -IGNvbmRpdGlvbmFs 27708 -IEdpbGw= 27709 -dWF0ZXM= 27710 -INGB0L7QstGB0LXQvA== 27711 -IHNjcmVlbnNob3Q= 27712 -Y2Fkbw== 27713 -IOuqqOuToA== 27714 -IGZpbmdlcnRpcHM= 27715 -IE1BQw== 27716 -IGR1ZGVz 27717 -Y29zdA== 27718 -IGJ1bXBz 27719 -b25kbw== 27720 -IGRhdG9z 27721 -IGJlZXBz 27722 -IFByb24= 27723 -IEtoYWw= 27724 -emVnbw== 27725 -IEFiYnk= 27726 -VWg= 27727 -WW8= 27728 -IFRlbA== 27729 -IM68zq0= 27730 -S0k= 27731 -IHN0cmVzc2Vz 27732 -IHNwcmVhZHNoZWV0 27733 -IE5PVw== 27734 -REI= 27735 -IGxpYmVyYXRpb24= 27736 -IHByZWRpY3RhYmxl 27737 -IFF1ZXN0aW9ucw== 27738 -IHNwYWNpbmc= 27739 -IGluaGFiaXRhbnRz 27740 -IHp3acSFeg== 27741 -57Gz 27742 -IFNBUA== 27743 -IGx1Z2dhZ2U= 27744 -IGhpcHA= 27745 -6JY= 27746 -IHRhbmdlbnQ= 27747 -IHbDpQ== 27748 -0LDQu9GM0L3QvtC5 27749 -c2VoZW4= 27750 -IHByb2Nlc3NvcnM= 27751 -IGZpbmRldA== 27752 -IGNhcnRyaWRnZQ== 27753 -IGFkbWluaXN0cmF0b3Jz 27754 -IOyWtOya 27755 -IHN1cHJlbWU= 27756 -IEFudGk= 27757 -IO2UhOuhnA== 27758 -IGluZm9ybWF0aXZl 27759 -IGtvbXQ= 27760 -5oiR5Lmf 27761 -15nXmA== 27762 -QXNzaXN0YW50 27763 -IGxpc3Rh 27764 -w7ZsbA== 27765 -IGRpc3RpbmN0aXZl 27766 -IEh1ZA== 27767 -IHNhbG9u 27768 -5LiL5L6G 27769 -bcOqbWU= 27770 -IE1vdGlvbg== 27771 -IHNldWxlbWVudA== 27772 -IE1lbnNjaA== 27773 -IHB1bXBlZA== 27774 -w7xoZXI= 27775 -aWJv 27776 -IHdhxbw= 27777 -IHF1YW50aXRhdGl2ZQ== 27778 -2b4= 27779 -IOuqqOyKtQ== 27780 -IHBvdWNo 27781 -IFRoZWF0cmU= 27782 -YWhp 27783 -IHNwaW5hY2g= 27784 -IHJlYWxpdGllcw== 27785 -IGxleQ== 27786 -IE1hcnRoYQ== 27787 -IHJlY2hlcg== 27788 -ZWNoZXM= 27789 -IHBlcmlvZGlj 27790 -b2NpZGU= 27791 -IEluY3JlZA== 27792 -IHRo4bqleQ== 27793 -b3Rvbg== 27794 -IEVzbw== 27795 -IGfDqW7DqXJhbA== 27796 -aWxpZ2h0 27797 -IGltYWdpbmluZw== 27798 -aGVh 27799 -ZXRpY2Fs 27800 -4but 27801 -IERlbW9rcmF0 27802 -IGVuam8= 27803 -IGFkanVzdGFibGU= 27804 -IHJhaW5z 27805 -aWV3YcW8 27806 -IGp1c3RlbWVudA== 27807 -IGp1c3RpZmllZA== 27808 -IFNoYWtl 27809 -dml2 27810 -7IKs66W8 27811 -IG1ldHQ= 27812 -IEVudmlyb25tZW50YWw= 27813 -IHNvbGFtZW50ZQ== 27814 -IGludGVyc2VjdA== 27815 -IDE5ODg= 27816 -IHNpbXVsYXRl 27817 -SkE= 27818 -INC30LDRgQ== 27819 -IGNvbnRpbmc= 27820 -IFRlaw== 27821 -IHRvcmNo 27822 -INC00YDRg9Cz0L7QuQ== 27823 -IGluc2NyZQ== 27824 -IG1vZGVsbw== 27825 -IEdlZw== 27826 -IERlbW9jcmF0 27827 -0LrQsg== 27828 -IEJ1ZGR5 27829 -IHJlZHVuZA== 27830 -IGNyYWZ0cw== 27831 -IEhpag== 27832 -IGp1ZQ== 27833 -IEtpcms= 27834 -IGthYg== 27835 -4buj 27836 -IGFlc3RoZXQ= 27837 -IEpPTg== 27838 -IHN1cGVyY29t 27839 -INGB0LjRgtGD 27840 -IM+Mz4TOuQ== 27841 -2YXZhg== 27842 -IEVWRVI= 27843 -7JWY7Ja0 27844 -b2l0 27845 -IENsZXZlbGFuZA== 27846 -IHNpeHRlZW4= 27847 -IHdhdGVyZmFsbA== 27848 -77g= 27849 -aW5mbA== 27850 -IGNvdW5zZWxvcg== 27851 -IFB1bms= 27852 -IHNwcmVjaGVu 27853 -5rWB 27854 -ZXhj 27855 -IFNraWxscw== 27856 -cm96 27857 -YWRhbWVudGU= 27858 -IHBhbmNha2Vz 27859 -6riw66Gc 27860 -IHBsYW5r 27861 -IHNvdmVyZWlnbnR5 27862 -IGZ1aQ== 27863 -INC90LXQvtCx 27864 -IFdpaQ== 27865 -IFNjaG9s 27866 -4oCO 27867 -IFNwZWFr 27868 -6Iux 27869 -Y2lsaWF0aW9u 27870 -IHRoaWdo 27871 -IOqxsOydmA== 27872 -IGpvdA== 27873 -IOy0rOyYgQ== 27874 -INmF24zaug== 27875 -IENDUA== 27876 -INC/0L7RgdGC 27877 -IG9ic2VydmVy 27878 -w6Fi 27879 -IHN0aWdtYQ== 27880 -IHByb3ByaWV0 27881 -IGNpZGFkZQ== 27882 -IGJhxZ9rYQ== 27883 -2LnYqQ== 27884 -a3Jl 27885 -IHBvd2llZHppZcSH 27886 -IGNlYXNl 27887 -IHNraW5z 27888 -IHZlZ2dpZXM= 27889 -IG9wcG9zaW5n 27890 -b3BvbHk= 27891 -IEp1Zw== 27892 -IFlvb24= 27893 -IFVuaXQ= 27894 -IDE5ODY= 27895 -IGtvbnM= 27896 -IGRpYWdub3N0aWM= 27897 -IGVtcG93ZXJlZA== 27898 -IHRobw== 27899 -IGNlbg== 27900 -w6lyYXRpb24= 27901 -INGX 27902 -IHBoeXNpYw== 27903 -IFByYWN0aWNl 27904 -5bed 27905 -IFNvdXRoZWFzdA== 27906 -IEVzcGE= 27907 -6K+3 27908 -IEdlb3I= 27909 -cm9wb3J0aW9u 27910 -IHNwZWNz 27911 -IGFkYXB0aXZl 27912 -IFVuaXR5 27913 -IFdvcmtz 27914 -dWdlbg== 27915 -IE1vbnRhbmE= 27916 -VGhhbmtz 27917 -IHdoaXBwZWQ= 27918 -IGR1bmdlb24= 27919 -IHZpdGFtaW5z 27920 -U1A= 27921 -IHNjYW5kYWw= 27922 -IGRpbmVybw== 27923 -b3Zh 27924 -IGVtYnJv 27925 -IEVhZ2xl 27926 -IHRoZW9sb2d5 27927 -IFZhbmVzc2E= 27928 -IEFJRFM= 27929 -65Cc 27930 -IGZyZWVs 27931 -IEFsemhlaW1lcg== 27932 -IMWa 27933 -SGVy 27934 -IHRvcm5hZG8= 27935 -YWdlbnM= 27936 -IOyeiOyWtOyEnA== 27937 -IFRyYW5zZm9ybQ== 27938 -IHByb2Nlc3Nv 27939 -IG1pbGxpc2U= 27940 -IHByb2Zlc3Npb25hbGx5 27941 -IG1lbWI= 27942 -b2NhdGlvbg== 27943 -IHN0eWxpbmc= 27944 -INC+0LHRj9C3 27945 -IE9wZXJhdGlvbg== 27946 -IHd5Z2w= 27947 -IFJhbg== 27948 -IOeahA== 27949 -IEtpbg== 27950 -4buxYw== 27951 -IEJBUg== 27952 -IHBhcGVyd29yaw== 27953 -IHR1bGU= 27954 -IHF1ZXJpYQ== 27955 -IGNvbXBseQ== 27956 -IEhhaXI= 27957 -15nXmw== 27958 -INC/0YDQvtGB0YI= 27959 -IG11dGF0aW9u 27960 -IHJlcHLDqXM= 27961 -IG9jdG9wdXM= 27962 -IGltcG9ydGFudGVz 27963 -IGRlc2VydmVk 27964 -ZXRy 27965 -IGRpc2FzdGVycw== 27966 -bMSxbmRh 27967 -aXF1w6k= 27968 -IERlc2hhbGI= 27969 -c29v 27970 -b3NzaXA= 27971 -IHJlbGlldmVk 27972 -IENvbGxpbnM= 27973 -IHdhdGVycHJvb2Y= 27974 -IFl1aw== 27975 -IGNvcHlpbmc= 27976 -IGLDvHTDvG4= 27977 -IEhldXRl 27978 -IEVudHJl 27979 -IHJlc2lkdWFs 27980 -IGNvbG9uaWVz 27981 -IMOpbm9ybQ== 27982 -IEVyaW4= 27983 -IHN0YW4= 27984 -IHRyZW1lbmRvdXNseQ== 27985 -IGNhcHR1cmVz 27986 -IFNhaQ== 27987 -w6JjZQ== 27988 -IG1pYcWC 27989 -IDg3 27990 -IGxvZ2dpbmc= 27991 -IGluc2VydGVk 27992 -IGluaGVyZW50bHk= 27993 -7J2R 27994 -bGF2ZQ== 27995 -0L3QuNGH 27996 -IGZlbW1lcw== 27997 -IGTDqXA= 27998 -dWtz 27999 -YWNpYQ== 28000 -IFdhZGU= 28001 -IGppag== 28002 -IFZpbmNlbnQ= 28003 -IEljZWxhbmQ= 28004 -aGVt 28005 -IGFwb2xvZ3k= 28006 -IFBlZw== 28007 -IGdsdWVk 28008 -IGNvbXBhbmlvbnM= 28009 -IExpdmVy 28010 -IGNyaXRpY2l6ZWQ= 28011 -bGVhZGluZw== 28012 -IHPDpGdh 28013 -5ryC 28014 -IHNxdWlk 28015 -IG5hcnJhdGl2ZXM= 28016 -IHRha2E= 28017 -bmV6 28018 -d2VpdA== 28019 -IHRyaXBvZA== 28020 -IGV4cGxpYw== 28021 -IHNwaW5hbA== 28022 -IGFwcHJveGltYXRpb24= 28023 -IHBhZ2Fy 28024 -IENhbHZpbg== 28025 -INCy0LXQtNGM 28026 -IGxhYw== 28027 -IHByb2FjdGl2ZQ== 28028 -IFRyYWlu 28029 -b3Jm 28030 -IHN0ZW4= 28031 -IGdyYXBlcw== 28032 -IG1ldXM= 28033 -IGF1dG9tYXQ= 28034 -IGJpYXNlZA== 28035 -IGNoYcOubmU= 28036 -Y29hbA== 28037 -IHJlbmNvbnQ= 28038 -IEt1bQ== 28039 -IGZlc3RpdmFscw== 28040 -IHN0YXJ0dXBz 28041 -IGFrYQ== 28042 -44G5 28043 -IGN5bGluZA== 28044 -c25h 28045 -Q1JJ 28046 -IHJlc3VsdGFkbw== 28047 -IG1pbGVzdG9uZQ== 28048 -IM+F 28049 -IHRlbGVwb3J0 28050 -enljaA== 28051 -NjI= 28052 -5YWz 28053 -IEZlYXI= 28054 -IG51Y2xldXM= 28055 -IHNoaW5lcw== 28056 -aG92 28057 -IFBhcnRuZXJz 28058 -IEthcw== 28059 -IG5hZGll 28060 -IGFsZXJ0cw== 28061 -IEJJTEw= 28062 -c3Ryb25n 28063 -IE5hdGU= 28064 -IERlbm1hcms= 28065 -IENhdg== 28066 -T1NU 28067 -aMOkbHQ= 28068 -IOyVhOuLjA== 28069 -YW55b24= 28070 -IGVuY291cmFnZXM= 28071 -INC/0L7RgdGC0LDQsg== 28072 -IEh1YW5n 28073 -44GK6aGY44GE 28074 -U1RB 28075 -IHBhaW50cw== 28076 -44GZ44GU 28077 -IHNjaGVkdWxlcw== 28078 -IGNoZWF0ZWQ= 28079 -IGFwcHJveA== 28080 -IO+3 28081 -IMK7Lg== 28082 -IHNtaWxlcw== 28083 -aXN1cmU= 28084 -IG5lcmVk 28085 -YXJkZW4= 28086 -IGN1cnQ= 28087 -IOuM 28088 -IFJvdGg= 28089 -IHB1aXNxdWU= 28090 -IEdFVA== 28091 -IFZlZ2V0 28092 -IHByb2R1eg== 28093 -IEJlbGdpdW0= 28094 -IENhbXB1cw== 28095 -16jXmded 28096 -aWN1dA== 28097 -INGB0L3QuNC8 28098 -IHLDqXVzcw== 28099 -IHNsaXBwZXJ5 28100 -IEV3 28101 -xbM= 28102 -IExlZ2VuZHM= 28103 -IFRpZmZhbnk= 28104 -0LDQu9C40Lc= 28105 -INC/0LXRgNC10LI= 28106 -INC+0LPRgNC+0Lw= 28107 -IGNyb3M= 28108 -IENF 28109 -QnU= 28110 -IGVuc3VyZXM= 28111 -IGdyYW5kY2hpbGRyZW4= 28112 -IGFjdWVyZG8= 28113 -IHByaXNvbmVy 28114 -IHRoaXJzdHk= 28115 -YmFuZQ== 28116 -IOu5oA== 28117 -IMO6bHRpbWE= 28118 -IExhdW5jaA== 28119 -bml0eQ== 28120 -IGNvbWJ1c3Rpb24= 28121 -IHVuaWNvcm4= 28122 -IGZhbWlsbGU= 28123 -IGxvd2VyaW5n 28124 -IFlpbmc= 28125 -YnVpbGRpbmc= 28126 -IGR1bw== 28127 -IE3DqXhpY28= 28128 -YXN0aWFu 28129 -IOuoueydhA== 28130 -IFJhbHBo 28131 -IHJld3JpdGU= 28132 -IGdsYW0= 28133 -aWZpcXVl 28134 -RXI= 28135 -IFJ1bm5pbmc= 28136 -0L7QvdC+0LI= 28137 -IG1lYW5pbmdz 28138 -IGNoZXd5 28139 -IExlc2xpZQ== 28140 -IGZpbmVzdA== 28141 -IGhhaGFoYQ== 28142 -IFNURVA= 28143 -IGxvbmVsaW5lc3M= 28144 -cmlhbnM= 28145 -IHF1ZXN0aW9uZWQ= 28146 -IGVzcXVl 28147 -IHNpbmtpbmc= 28148 -IHBlc28= 28149 -IFdyb25n 28150 -YXNtaW5l 28151 -IGRlZmluaXRpdmU= 28152 -IGJ1eXM= 28153 -IGNydWM= 28154 -Y29vbA== 28155 -IOugiA== 28156 -IHDDsw== 28157 -IHV0aWxpemVk 28158 -IHdvcnRod2hpbGU= 28159 -IER5bGFu 28160 -RVNF 28161 -IHZlcnRleA== 28162 -dMSx 28163 -IEZpcg== 28164 -IHphdw== 28165 -IEdlZA== 28166 -INCd0LDQvw== 28167 -ZHo= 28168 -IGN1cnNvcg== 28169 -IHN3aXBl 28170 -IGluZXZpdGFibHk= 28171 -IHBvc3RlcnM= 28172 -IGluY2xpbmVk 28173 -IGdyZWV0aW5n 28174 -IGRpc2FwcG9pbnRtZW50 28175 -44G+44Gn 28176 -IHJlbGHDp8Ojbw== 28177 -VFQ= 28178 -IHJhYmI= 28179 -IE1haW5l 28180 -IGFuYWx5emVk 28181 -RkU= 28182 -INCf0L7Quw== 28183 -IFNhbmRyYQ== 28184 -IHBsYWd1ZQ== 28185 -QVJF 28186 -IHbDpHI= 28187 -IFZpdg== 28188 -dW1lZA== 28189 -aGFuZG8= 28190 -aG91ZXR0ZQ== 28191 -IEJhaWxleQ== 28192 -5LiN6YGO 28193 -eXNvbg== 28194 -IHNlbXVh 28195 -IGhhcmRjb3Jl 28196 -4oKs 28197 -0ZbQvA== 28198 -w6lyYQ== 28199 -T1RI 28200 -IGZvcmVpZ25lcnM= 28201 -IFBhbGVzdGluaWFu 28202 -IHByb3ByaW8= 28203 -0LDQvdC40Lk= 28204 -IG15dGhz 28205 -V0g= 28206 -IG5pbnRo 28207 -IENyZWF0b3I= 28208 -0LvQvtC8 28209 -IEZsaXA= 28210 -IGVtYW4= 28211 -IGtpxZ8= 28212 -emllaA== 28213 -IEVhcm5lc3Q= 28214 -c3lzdGVt 28215 -luyXkA== 28216 -IGFybWllcw== 28217 -IE91dHNpZGU= 28218 -IGhhcnVz 28219 -5rqW 28220 -0L7QtNCw0YA= 28221 -IHZpc2l0b3I= 28222 -562U 28223 -IHN0cmVuZ3RoZW5pbmc= 28224 -IDky 28225 -dmlv 28226 -IOumrA== 28227 -IGdyZWVkeQ== 28228 -IHBvcXVpdG8= 28229 -dWRlcg== 28230 -IEtvcGY= 28231 -IOuLpOydjOyXkA== 28232 -IHNlaXM= 28233 -w6F0aWNv 28234 -IHRydXN0aW5n 28235 -w61w 28236 -IEVtbQ== 28237 -bGVlbg== 28238 -INin2YTZhg== 28239 -IHJlY3J1aXRtZW50 28240 -IEZpbGlw 28241 -INmD2YQ= 28242 -Q2xpbnQ= 28243 -INCy0LXRgQ== 28244 -YXVmdA== 28245 -IGRvbWluYXRl 28246 -IHJlc3Rv 28247 -IGtyYQ== 28248 -w6Fp 28249 -IENhaXQ= 28250 -cm93cw== 28251 -IGNvdW50cnlzaWRl 28252 -IDE5NDU= 28253 -0LDRhtC40Y4= 28254 -INC00Lg= 28255 -IGtlcm5lbA== 28256 -bG92 28257 -IGNhbGN1bGF0aW5n 28258 -2K/Ypw== 28259 -IFdhbHQ= 28260 -IGVtcG93ZXJpbmc= 28261 -IGNoYXNzaXM= 28262 -bGluZWFy 28263 -0LPRgw== 28264 -IG5vdmE= 28265 -IHV5 28266 -IDY5 28267 -IGVuY29tcGFzcw== 28268 -dHJs 28269 -IGNvbXB1dGF0aW9uYWw= 28270 -IHdvcm1z 28271 -IG5oaeG7gXU= 28272 -IGFzdHJvbmF1dHM= 28273 -IHZlcw== 28274 -IHN5dHU= 28275 -IGRlbWFuZGVk 28276 -IGNz 28277 -IE1vbA== 28278 -IGA= 28279 -IGNoYW50 28280 -IHRoZXJlYnk= 28281 -IHBlbmlz 28282 -IGVtb2M= 28283 -d3lu 28284 -0YPQttC1 28285 -IHRyZWFk 28286 -w7NsZQ== 28287 -IGRlZXBlc3Q= 28288 -IG1hY2hl 28289 -IFZlbnQ= 28290 -IEFtc3RlcmRhbQ== 28291 -44Ob 28292 -IHJlYmVs 28293 -IDYx 28294 -INCy0LrRg9GB 28295 -dWZmcw== 28296 -IGRvxJ9ydQ== 28297 -IE5hcG9sZQ== 28298 -zq7Pgw== 28299 -IHdvcmtvdXRz 28300 -IEdsYWQ= 28301 -0L3QtdGB 28302 -IHRlbnNpb25z 28303 -IFNoaWZ0 28304 -IEd1ZXI= 28305 -7YyQ 28306 -IOy5nOq1rA== 28307 -0JY= 28308 -IGltcGxhbnQ= 28309 -w6p1 28310 -6riA 28311 -IGF1dGhvcml6ZWQ= 28312 -Q0VS 28313 -IFJW 28314 -IGhpbA== 28315 -bGV2 28316 -Y2ltZW50bw== 28317 -IFVGTw== 28318 -7IOI 28319 -6KiC 28320 -d29y 28321 -IGRhbmNlcw== 28322 -IFBpeGVs 28323 -55yL5LiA5LiL 28324 -IHRyb3R6ZGVt 28325 -IG9idGVu 28326 -IEFsZnJlZA== 28327 -IGNvc3RseQ== 28328 -IFN0YW5sZXk= 28329 -IHRlcnJvcmlzdHM= 28330 -IFdpZA== 28331 -heuLiOuLpA== 28332 -IGxlaWNodA== 28333 -7J207Iqk 28334 -IGRvYnJ6ZQ== 28335 -IGhlc2l0 28336 -IGVyesOkaA== 28337 -IGVpbmlnZQ== 28338 -IGhlYnQ= 28339 -0YHQtQ== 28340 -IHVucHJlZGljdA== 28341 -Q8OzbW8= 28342 -cmVtb3M= 28343 -IFRoYW5rZnVsbHk= 28344 -IHB1cnNl 28345 -Y2hz 28346 -YW5jZXI= 28347 -dWxvcw== 28348 -c3R1ZA== 28349 -5pyJ5rKS5pyJ 28350 -IG5ldXJvbG9n 28351 -IEFuY2llbnQ= 28352 -T3V0 28353 -YXdzemU= 28354 -IG9wcG9zZQ== 28355 -IGFudGlib2RpZXM= 28356 -IFNvbWVob3c= 28357 -cm9wb2xpdGFu 28358 -a3Rvcg== 28359 -INGB0YLQvtGA0L7QvdGL 28360 -IHJvY2tldHM= 28361 -IGRpc2FibGU= 28362 -IGNhdGFzdHJvcGg= 28363 -tOye 28364 -IGN5bg== 28365 -INC00YDRg9C30YzRjw== 28366 -IGluc3RydWN0b3Jz 28367 -ZW1hYWw= 28368 -IGV0d2E= 28369 -IHl1YW4= 28370 -IEdyb3VuZA== 28371 -IHByZW1pZXJl 28372 -0YfQuNCy 28373 -IHNhaW50 28374 -eWJh 28375 -IGtvaw== 28376 -IGNvbnRyYWN0b3Jz 28377 -IOqwgQ== 28378 -INeQ15w= 28379 -IGhlYWRsaW5l 28380 -IGNvbXBsZXRhbWVudGU= 28381 -IGluZXhwZW5zaXZl 28382 -IHZpdQ== 28383 -IEdyYW5kZQ== 28384 -IGJsZWVk 28385 -66y8 28386 -IDcz 28387 -IHRvZGF2w61h 28388 -IFJ1c2g= 28389 -IEVsZGVy 28390 -6rCA64qU 28391 -IFJvdQ== 28392 -INC20LXQvdGJ 28393 -IE1pcmE= 28394 -IGRlaW5l 28395 -IGthcm1h 28396 -IHVtbQ== 28397 -IGVudHNjaGU= 28398 -IEhvbG9jYXVzdA== 28399 -IGRpc2NvdmVyaWVz 28400 -YW1lbnRz 28401 -IHJhaXNvbg== 28402 -IGJ1cmdlcnM= 28403 -QmFjaw== 28404 -IGdkeQ== 28405 -IEFH 28406 -IERhdw== 28407 -7JWg 28408 -aGVhZGVk 28409 -IENsYXI= 28410 -SW5zdA== 28411 -IExpZXV0ZW5hbnQ= 28412 -IEFmRA== 28413 -IENlcw== 28414 -IHBlcnNvbmFsaXplZA== 28415 -IGludGVyZmFjZXM= 28416 -4LiI4Liw 28417 -INGA0LXQtg== 28418 -IHN1aWM= 28419 -IHN0YXJ2aW5n 28420 -IG94aWRl 28421 -IGRlY29yYXRlZA== 28422 -IERV 28423 -IOyYiOyBmA== 28424 -IHF1bw== 28425 -IGRpc3RvcnRpb24= 28426 -5q61 28427 -IOuoueyWtOs= 28428 -IHN0YWtlcw== 28429 -5piO55m9 28430 -IHN5bnRheA== 28431 -IGJp4bq/dA== 28432 -dGh5 28433 -aWNpZQ== 28434 -IGJyYXNpbGU= 28435 -aXNpcw== 28436 -UkM= 28437 -IHNob29r 28438 -IGRlcHRocw== 28439 -IENvc3Rh 28440 -IHZvY2Fscw== 28441 -IGNvYXN0ZXI= 28442 -IGZhbG91 28443 -ZXR0bGU= 28444 -IGtlbm5lbg== 28445 -IGRlcml2ZQ== 28446 -IGFpZHM= 28447 -INCd0LjQug== 28448 -IGVudHdpYw== 28449 -IHZlcnRpY2FsbHk= 28450 -IM0= 28451 -IFNVVg== 28452 -IGZpcmV3b3Jrcw== 28453 -IHNwZWNpZmljcw== 28454 -5Lqk 28455 -IGluc2lzdGVk 28456 -IGRlc2hhbGI= 28457 -IEdvbno= 28458 -bG92ZQ== 28459 -IE1pbGl0YXJ5 28460 -IFBpZXJyZQ== 28461 -IOKI 28462 -IFdob3Nl 28463 -IHBlcmZ1bWU= 28464 -IM+AzrU= 28465 -IGxvd2VyZWQ= 28466 -IGNyb3NzZXM= 28467 -IHRyYW5zbGF0ZXM= 28468 -IGFycmliYQ== 28469 -w61kbw== 28470 -IExldg== 28471 -5YWn 28472 -IENpYW8= 28473 -IHNjaG9sYXJzaGlwcw== 28474 -IGdlc3R1cmVz 28475 -INGA0LXQt9GD0LvRjNGC0LDRgg== 28476 -IHF1ZXN0w6Nv 28477 -IENvbG9uZWw= 28478 -IEJvdHQ= 28479 -2LHZgQ== 28480 -TklORw== 28481 -IFdhdGNoaW5n 28482 -IFB1cnBsZQ== 28483 -0YHRgtGA0LDQvQ== 28484 -IGV4ZWN1dGl2ZXM= 28485 -IEtyaXM= 28486 -b3JuZXlz 28487 -0LXQvdC90YvQuQ== 28488 -IGNvYXRlZA== 28489 -xKk= 28490 -IHBhcmtlZA== 28491 -INGB0LLQtdGC 28492 -ISEhISE= 28493 -IEZsb3lk 28494 -xLFzxLE= 28495 -emnEhw== 28496 -IG1vdGl2YXRl 28497 -IEVsb24= 28498 -bGVhbg== 28499 -hpM= 28500 -IGlw 28501 -IG5pxbw= 28502 -IEV4cGVyaWVuY2U= 28503 -IFRpbmE= 28504 -IEtvbGxlZ2U= 28505 -IEFtYmFzc2Fkb3I= 28506 -aW55YQ== 28507 -IHRoZWZ0 28508 -IGhldXJlcw== 28509 -IE15c3Q= 28510 -IG1haXNvbg== 28511 -bGVi 28512 -IGJvd2xz 28513 -IELDvHJnZXI= 28514 -IFJvb3NldmVsdA== 28515 -UlA= 28516 -6rCA7JqU 28517 -IERlbGljaW91cw== 28518 -ZXJkaW5ncw== 28519 -IEFzc29jaWF0ZQ== 28520 -b3Vzc2U= 28521 -IENvcnQ= 28522 -IFJlcGVhdA== 28523 -IEdsb3J5 28524 -IGNvbnRhZw== 28525 -4LmA4Lil 28526 -IFBhcmFk 28527 -IEtlcnJ5 28528 -IOq/ 28529 -IFdhdmU= 28530 -5b+F 28531 -IGdhdGV3YXk= 28532 -55CD 28533 -IeOAjQ== 28534 -IHRyYW5zY2VuZA== 28535 -IGRhbWFnZXM= 28536 -IHRhaWxz 28537 -IGdyYXZpdGF0aW9uYWw= 28538 -IFNoaWVsZA== 28539 -IHByaW1pdGl2ZQ== 28540 -IGNhcnJpZXJz 28541 -IEh1YXdlaQ== 28542 -2YLYrw== 28543 -IGZlbGl6 28544 -IE1pYQ== 28545 -5YOV 28546 -INC/0YDRj9C80L4= 28547 -INC/0YDQvtC40YHRhdC+0LTQuNGC 28548 -IE11cnBoeQ== 28549 -IEFjdGl2 28550 -44OD44Kv 28551 -IGRpc2NvbWZvcnQ= 28552 -15HXlA== 28553 -IEtlbGw= 28554 -IENlbnR1cnk= 28555 -IHNwYWdoZXR0aQ== 28556 -IER1cmNo 28557 -IGNpZXJ0bw== 28558 -IEVtcHJlc3M= 28559 -IGd1dHM= 28560 -bmVn 28561 -INC00L7RgdGC0LDRgtC+0YfQvdC+ 28562 -IHZvbHVudGFyeQ== 28563 -5aSx 28564 -IHNxdWlycmVs 28565 -5qyi 28566 -44Gh44KJ 28567 -IE1heg== 28568 -tOyLrA== 28569 -INCy0Lg= 28570 -44Kn 28571 -INGC0LDQutC40YU= 28572 -IFNoYXJvbg== 28573 -IGVudGh1c2lhc3RpYw== 28574 -aXJlbWVudA== 28575 -IO2emOuTpA== 28576 -IHBvdHJ6ZQ== 28577 -IGluaXRpYXRlZA== 28578 -44On 28579 -IMWbcm9k 28580 -IOydtOumhA== 28581 -IHJlbWFrZQ== 28582 -IGN1bG1pbg== 28583 -IGNvbmZ1c2U= 28584 -bWl5b3I= 28585 -dXJhcg== 28586 -Q1RPUg== 28587 -IGJ1bm55 28588 -IOWkpw== 28589 -5LiN6IO9 28590 -ZWxw 28591 -IHZhbXBpcmU= 28592 -IGlsbHVtaW4= 28593 -IEhlbmQ= 28594 -INC60LDRh9C1 28595 -IFNhbHY= 28596 -INC60LDQvdCw0Ls= 28597 -IHBvcnRh 28598 -IGFzc2hvbGU= 28599 -IHN1cHBvcnRlcg== 28600 -IHNrZXB0aWNhbA== 28601 -IGtuZWFk 28602 -IOyYrA== 28603 -ZXph 28604 -IHF1w6o= 28605 -IERI 28606 -IHJvZHo= 28607 -b3duZXJz 28608 -IHBsb3Rz 28609 -IGRlbGF5cw== 28610 -IGJlbG9uZ2Vk 28611 -IGFoaA== 28612 -IGNhcnZlZA== 28613 -IHJpc2Vu 28614 -IG9yZGVu 28615 -cGhvbnk= 28616 -aXNzeQ== 28617 -ISEhISEhISE= 28618 -IG9sZHXEn3VudQ== 28619 -IHJvc2Vz 28620 -IGludHJpbnM= 28621 -IEFuZ3N0 28622 -IGZpbmFsZW1lbnQ= 28623 -7Ked 28624 -U09VTkQ= 28625 -IGluZHVs 28626 -sIw= 28627 -INeV15Q= 28628 -Y2h5 28629 -0LDQutGB0LjQvA== 28630 -IG5nZ2Fr 28631 -IGxpeg== 28632 -IGVsZWN0b3JhbA== 28633 -IFNoYXdu 28634 -cmljaWE= 28635 -IGFyc2Vu 28636 -IFBlcA== 28637 -IDIwMzA= 28638 -IHRyb3BoeQ== 28639 -IHNtb290aGVy 28640 -IGVycmU= 28641 -IGNyYXNoZXM= 28642 -IHNjaG5l 28643 -IGFzaQ== 28644 -IE1hw58= 28645 -0YPQu9C4 28646 -0YfQtdGB0LrQuA== 28647 -aWV2ZXM= 28648 -UkVBTQ== 28649 -IHN0aXJyaW5n 28650 -44OA 28651 -dXN0YQ== 28652 -IGludmVy 28653 -c2lnaHQ= 28654 -b3JkdQ== 28655 -b29y 28656 -IMSDbg== 28657 -IHBlcm1pdHRlZA== 28658 -0YDRjA== 28659 -IGNoYWxr 28660 -44KI44GX 28661 -IHRhdHRvb3M= 28662 -IFJlbGF0aW9ucw== 28663 -IEhveQ== 28664 -a3NhbQ== 28665 -IGRlbnRpc3Q= 28666 -IOuvuOq1rQ== 28667 -IHNvZmE= 28668 -INGU 28669 -IGZvcm1l 28670 -2YLYqQ== 28671 -IOuyoA== 28672 -IGVtYnJhY2Vk 28673 -bWls 28674 -IHN1bmdsYXNzZXM= 28675 -IOqwlA== 28676 -IHNlYW1sZXNz 28677 -IGJlZXA= 28678 -w6RjaHN0 28679 -IHN3ZWV0cw== 28680 -IHNlbWFpbmU= 28681 -IGlycmVsZXZhbnQ= 28682 -IGRlc2Vudm9s 28683 -z4HPiQ== 28684 -INC/0YDQvtC40LfQstC+0LQ= 28685 -YW5ncw== 28686 -IGFyb21h 28687 -IHBvb2xz 28688 -IGdp4bud 28689 -IFVn 28690 -IGNsaW1iZWQ= 28691 -IHRyZW5kaW5n 28692 -IHNlcGVydGk= 28693 -IEJhcnI= 28694 -IHDFgg== 28695 -IE9yaWdpbmFsbHk= 28696 -INqv 28697 -dXR0bw== 28698 -irjr 28699 -INC60L7RgtC+0YDRi9GF 28700 -INC30LDRhQ== 28701 -IGVpZ2VuZW4= 28702 -IG11cmRlcmVy 28703 -ZXJuYW1l 28704 -xZ4= 28705 -IGFubm91bmNpbmc= 28706 -IFBsYXRmb3Jt 28707 -IGV4cGxhbmF0aW9ucw== 28708 -IHByZXNlbnRl 28709 -IE5hc8SxbA== 28710 -IG9ycGhhbg== 28711 -IEZvcnRuaXRl 28712 -cm9zcGVjdA== 28713 -ZXJlZGl0aA== 28714 -IOyXhuyWtA== 28715 -IE5JSA== 28716 -d2FnZW4= 28717 -IHJlbWVk 28718 -p4Dr 28719 -bW9udA== 28720 -IEplZmZyZXk= 28721 -cHJvbQ== 28722 -IGbDvG5m 28723 -INC90LDQt9Cw0LQ= 28724 -IGN1Y3VtYmVy 28725 -IFN1bW1pdA== 28726 -5Yid 28727 -p6Q= 28728 -0J3QkNCv 28729 -IEpldA== 28730 -IGNhbWJpbw== 28731 -0YPQudGC0LU= 28732 -IGN1Ymlj 28733 -IGRpc3Byb3BvcnRpb24= 28734 -ZXJleg== 28735 -IG1hZG5lc3M= 28736 -55eb 28737 -IHRpbnQ= 28738 -IGZ1ZXJvbg== 28739 -IGt5 28740 -IGJpcGFydA== 28741 -44G+44Gb 28742 -U2Ft 28743 -IOu9 28744 -IHJpdg== 28745 -IFRhbms= 28746 -IOuGkw== 28747 -IHJlbmRlcmVk 28748 -xZtsxJk= 28749 -Y29uZHM= 28750 -IGRpc3J1cHRpb24= 28751 -IGluY29udmVu 28752 -IHF1aXNlcg== 28753 -IGRlbmlhbA== 28754 -IGdhbGF4aWVz 28755 -IHNvdmVyZWlnbg== 28756 -IHBvbHNr 28757 -z4HPjg== 28758 -IG1leA== 28759 -IGNhcmFjdGVy 28760 -IExlZ28= 28761 -YW5kZW4= 28762 -Lici 28763 -IO2UjOs= 28764 -IGNvbXByZXNzb3I= 28765 -IE1vdmll 28766 -IGFwcGxpY2FudHM= 28767 -emllaGVu 28768 -IHZlZ2V0YXRpb24= 28769 -IGJlbGxl 28770 -IEdPT0Q= 28771 -IEJhdQ== 28772 -IHJlc2VudA== 28773 -c2V4 28774 -YW1lbnRvcw== 28775 -INeU15bXlA== 28776 -IG92ZXJsb2Fk 28777 -IHNpbGljb25l 28778 -0LXRgdGC0L3Qvg== 28779 -IGRlbmtlbg== 28780 -IGRlZmluaXQ= 28781 -IFdhc24= 28782 -IGFsdGVyZWQ= 28783 -IFNvbw== 28784 -IFdpbmc= 28785 -aW5kcmU= 28786 -IE5QQw== 28787 -z4HOrQ== 28788 -IFR3ZW50eQ== 28789 -IExpZWJl 28790 -IGhvbWVsZXNzbmVzcw== 28791 -b3VsZGVy 28792 -INCY0YLQsNC6 28793 -0YHQutCw0Y8= 28794 -IGN1YXRybw== 28795 -IEhhcnZleQ== 28796 -IHBoaWxhbg== 28797 -IEJlZXQ= 28798 -IHBvbGljaW5n 28799 -IEFsZXhhbmQ= 28800 -INC80L7Qu9C+0LQ= 28801 -IG3DvHM= 28802 -IGhpem8= 28803 -67O064uk 28804 -INC/0L7Qt9Cy0L7Quw== 28805 -INC/0YvRgg== 28806 -0L7Rh9C10LzRgw== 28807 -IO2DnA== 28808 -IGNyeXB0b2N1cnJlbmN5 28809 -IGxvcm8= 28810 -IHN1bW1hdGlvbg== 28811 -IGJha2FsxLFt 28812 -IG5ldXJvcw== 28813 -2KU= 28814 -INC80L7QttC10Lw= 28815 -IMO8c3Q= 28816 -IHByZWxpbWluYXJ5 28817 -IGhvcm5z 28818 -IFRJ 28819 -2YPZhA== 28820 -WU8= 28821 -IGhpbmdl 28822 -IHJlcGFpcnM= 28823 -IGJvbmRpbmc= 28824 -IGJpemU= 28825 -INGI0YI= 28826 -IG1vdGl2ZQ== 28827 -IE5pZ2VyaWE= 28828 -MTIw 28829 -YmxvY2s= 28830 -IGF2aWF0aW9u 28831 -IEtvbW11bg== 28832 -INC+0LrQsNC3 28833 -IHRlbmhh 28834 -IGVkdWNhdGluZw== 28835 -IHN0YWF0 28836 -5raI 28837 -INGB0LrQvtC70YzQutC+ 28838 -IGZyaWdodGVuZWQ= 28839 -IHNlZWtz 28840 -0YDRg9GI 28841 -cXVlbnQ= 28842 -IE5vdQ== 28843 -IHByYXQ= 28844 -IFNob3Q= 28845 -V29yaw== 28846 -a2FyYW5n 28847 -IExpZ2h0bmluZw== 28848 -bm9sZHM= 28849 -cm9sbGVk 28850 -Z2xhc3M= 28851 -IGNyZWRpYmlsaXR5 28852 -SVRZ 28853 -IGF0bW9zcGhlcmlj 28854 -IGhhdmlh 28855 -w6RuZGVybg== 28856 -Y2hlZXJz 28857 -VGhlc2U= 28858 -IENlbGw= 28859 -IG1hZ25lcw== 28860 -IEJyYXZv 28861 -c2Vhc29u 28862 -IMWfZXlsZXI= 28863 -8J+O 28864 -d2hpdGU= 28865 -IE1C 28866 -IHN0YWNrZWQ= 28867 -IDc0 28868 -INC00LDQstCw0Lk= 28869 -IHBhdmU= 28870 -INC+0YU= 28871 -IGRhdGFzZXQ= 28872 -IHJldG91cg== 28873 -IG1hdHVyaXR5 28874 -IHF1YXNl 28875 -IDkz 28876 -IFN5bQ== 28877 -IGJyaWVmaW5n 28878 -IGN1bHR1cmFsbHk= 28879 -IOy3qA== 28880 -aW5oYXM= 28881 -IG1hZGFt 28882 -IGFqdWRhcg== 28883 -IFRpYmV0 28884 -IGxlYWtz 28885 -Y2lsZQ== 28886 -IHRoZWF0ZXJz 28887 -7Jio 28888 -44OW 28889 -NzI= 28890 -IFdhc2g= 28891 -IFF1YWxpdHk= 28892 -IEl2YW4= 28893 -IEJlbnQ= 28894 -aWdhdG9y 28895 -IEdlc2NoaWNodGU= 28896 -IHJlYWN0aXZl 28897 -IDE5MDA= 28898 -5qGI 28899 -IGNvbnRyYWRpY3Q= 28900 -IHppZW1saWNo 28901 -IGNvaG9ydA== 28902 -4bun 28903 -IHBlc3RpYw== 28904 -IG9yYXo= 28905 -IHRlbGxlbWVudA== 28906 -6b4= 28907 -IE5vd2FkYXlz 28908 -Y3Jldw== 28909 -U3RldmU= 28910 -IGZpY3Rpb25hbA== 28911 -IGlsaw== 28912 -44GC44Gj 28913 -IGdhc29saW5l 28914 -emFt 28915 -IHBhbmNha2U= 28916 -w6huY2lh 28917 -IG11aXRvcw== 28918 -IGJ1cnk= 28919 -IGtvcA== 28920 -IElR 28921 -IHJlc2VydmF0aW9u 28922 -IFVwZGF0ZQ== 28923 -IGplag== 28924 -IEV5ZXM= 28925 -5Y+R 28926 -IHZpdmU= 28927 -IGNoY2U= 28928 -IEluaQ== 28929 -cmVzcG9ucw== 28930 -IHJlZmxlY3RpdmU= 28931 -IFdhbg== 28932 -0ZbQtw== 28933 -IGVuY2E= 28934 -IGVtYm9k 28935 -IEJ1cmdlcg== 28936 -IGFjYWRlbWlh 28937 -IENpcmM= 28938 -INC/0YDQtdC6 28939 -IGFubGFt 28940 -IHBoaWxhbnRocm9w 28941 -IEJhxZ8= 28942 -IEF1ZGk= 28943 -IHZvc3Q= 28944 -5L2g55+l6YGT 28945 -IHJlcGVy 28946 -UGV0ZXI= 28947 -IGNvbnNvbGVz 28948 -IHNjcnV0 28949 -IFR1cm5lcg== 28950 -INCx0YvQsg== 28951 -SUlJ 28952 -6Ki0 28953 -IEZsaWdodA== 28954 -4LiW 28955 -IFJhdmVu 28956 -IGNvcnJvcw== 28957 -ZmVybg== 28958 -IHByb3Zh 28959 -IFNldg== 28960 -IHJlY2lwcm8= 28961 -IDE5ODU= 28962 -IG51ZXZh 28963 -IGRhYg== 28964 -44CB44CM 28965 -IG1leg== 28966 -IFN0YXJr 28967 -cHBpbmdz 28968 -0L7RgdGC0Lg= 28969 -7Kad 28970 -IGZyYW1pbmc= 28971 -INCg0LDQtw== 28972 -IHBvc3Rw 28973 -IFNoYW5ub24= 28974 -INC60YPRgA== 28975 -IGpha2J5 28976 -aWVubmVudA== 28977 -IE1hcHM= 28978 -IFJldmVsYXRpb24= 28979 -INGB0YLQsNC7 28980 -7Jq0642w 28981 -IGRldmFudA== 28982 -IEdpdmluZw== 28983 -IFdBUw== 28984 -INC60L7Qs9C+ 28985 -IHJlbWE= 28986 -IFJD 28987 -bsOt 28988 -IHNsaXBwZWQ= 28989 -IFJhbXM= 28990 -IHdlZXQ= 28991 -IG1hc2N1bGluZQ== 28992 -IEVj 28993 -IHJlb3A= 28994 -IFBsYW50 28995 -IE1BWQ== 28996 -IHNwaWtlcw== 28997 -IG5venpsZQ== 28998 -IFdpa2lwZWRpYQ== 28999 -IENvaA== 29000 -SVNTQQ== 29001 -Y2hsb3NzZW4= 29002 -7KeA66W8 29003 -IOuvuOs= 29004 -IE5lZGVy 29005 -Sm9zaA== 29006 -INCg0L7RgdGB0LjQuA== 29007 -IDE5ODc= 29008 -IFRoZW9yeQ== 29009 -ZWtr 29010 -IHV0YW4= 29011 -INC00L7QvNCw 29012 -Y2h1 29013 -INGB0LE= 29014 -IGFwcm92ZQ== 29015 -VkVO 29016 -dWVwcmludA== 29017 -IDg0 29018 -5ryC5Lqu 29019 -Q29y 29020 -IHJpY2hlcg== 29021 -IHNhbmR3aWNoZXM= 29022 -YXRzdQ== 29023 -0YjQuNGF 29024 -IGxhdHQ= 29025 -fn5+fg== 29026 -ZnJpZW5kcw== 29027 -IGRlcm5pw6hyZQ== 29028 -IHN0ZXJlbw== 29029 -INGN0LrRgdC/ 29030 -IHByb3RlY3Rpb25z 29031 -IGhhdXQ= 29032 -RXZlcnlvbmU= 29033 -IGVudGVycHJpc2Vz 29034 -IE1vc3RseQ== 29035 -IFNwb3RpZnk= 29036 -IFNleA== 29037 -IHVuZw== 29038 -jOulvA== 29039 -IGFjdGl2aXNt 29040 -Y3RpY2E= 29041 -b3JpZ2luYWw= 29042 -INC/0YDQvtCz0YDQsNC8 29043 -IGJyb2Njb2xp 29044 -4KY= 29045 -0L7Qs9GA0LDRhA== 29046 -IHNla2FyYW5n 29047 -IGNyYWZ0aW5n 29048 -INCx0LDQvQ== 29049 -44G744Gp 29050 -IFJheg== 29051 -IG5haXZl 29052 -IHNjcm9sbGluZw== 29053 -IG51bWVyaWNhbA== 29054 -IHNjaGVkdWxpbmc= 29055 -IGFwYXJ0bWVudHM= 29056 -540= 29057 -IHN0cmV0Y2hlcw== 29058 -YWNleQ== 29059 -IEhFUg== 29060 -44K6 29061 -IHppbmM= 29062 -IGRhcm4= 29063 -IGPDqWw= 29064 -IHdhcmRyb2Jl 29065 -IHJlZGlyZWN0 29066 -IGp1bQ== 29067 -IFN0cmFuZ2U= 29068 -IG7DoG8= 29069 -IGV4cGVyaW1lbnRpbmc= 29070 -w6lyw6k= 29071 -IHZvdWxleg== 29072 -IGdlYmU= 29073 -IEthbm4= 29074 -IMSR4buZ 29075 -IE1heGlt 29076 -IEvDtm4= 29077 -IEdsYXM= 29078 -IHBvbGlzaGVk 29079 -IG51bWE= 29080 -SWNo 29081 -IHJpdHVhbHM= 29082 -IFNJ 29083 -0LjRgtC10LvQuA== 29084 -IGluZmlsdA== 29085 -IHNjYXJm 29086 -b3BoeQ== 29087 -IHlpbmU= 29088 -IGNpdmlj 29089 -IE1lbmc= 29090 -w6RuZ2U= 29091 -1aU= 29092 -aGlzdG9pcmU= 29093 -IE9rZQ== 29094 -IOyYhg== 29095 -IHNvbGx0ZW4= 29096 -IDgy 29097 -6aas 29098 -IHByZXNjcmliZWQ= 29099 -IER1YmFp 29100 -IEVsdGVybg== 29101 -IG5hdGlvbndpZGU= 29102 -IHNrYXRpbmc= 29103 -aWFyeQ== 29104 -IHJld2FyZGVk 29105 -IG1vcmFsaXR5 29106 -IE1hZ2dpZQ== 29107 -IE9oaGg= 29108 -IEZhaHJlbg== 29109 -b2x2ZWQ= 29110 -5pe25YCZ 29111 -IGRldXhpw6htZQ== 29112 -dGVjaG4= 29113 -cm9sZQ== 29114 -IGxlaWRlcg== 29115 -IEpBWQ== 29116 -INC40L3RhNC+0YDQvA== 29117 -IGNhZmZl 29118 -cmVpY2hlbg== 29119 -IGthcnQ= 29120 -IEN1dGU= 29121 -ZmZlY3RpdmU= 29122 -IGJ1bGx5 29123 -YWdhcg== 29124 -IGNvbW1vZGl0eQ== 29125 -IG9icmln 29126 -T1VS 29127 -IHVucGxlYXNhbnQ= 29128 -bm94 29129 -SnVs 29130 -b2xpdGg= 29131 -0YLQvtGP0Yk= 29132 -IEJlbGxh 29133 -IGRvbGxz 29134 -IEhvZmY= 29135 -IGFkdmlzb3Jz 29136 -IHRyYW5zZmVycw== 29137 -IEdva3U= 29138 -IDEyMDA= 29139 -aW5ob3M= 29140 -UGFs 29141 -IOuYkQ== 29142 -IHJlcHQ= 29143 -IGFjY29tcGxpc2htZW50 29144 -IHdlYXZl 29145 -IG92ZXJzaWdodA== 29146 -IHVuaGVhbHRoeQ== 29147 -IGZpbHQ= 29148 -IHB1ZGRpbmc= 29149 -IE1pZ3VlbA== 29150 -IGNodWNrbGVz 29151 -5Y+w54Gj 29152 -dmVyc2lvbg== 29153 -IGNvbmZlc3Npb24= 29154 -dmFsdWU= 29155 -IHRyaXVtcGg= 29156 -IHNhaXI= 29157 -IOuFuA== 29158 -IGFydGU= 29159 -IE1hdGVyaWFs 29160 -dXRp 29161 -IGxpcXVvcg== 29162 -IEJheWVybg== 29163 -IE1haWw= 29164 -IO2WpQ== 29165 -0YHQutC+0Lw= 29166 -IGNoZWFwZXN0 29167 -INGH0LDRgdGC0Lg= 29168 -IEpvYnM= 29169 -IENhbnlvbg== 29170 -aGFybWE= 29171 -YWxleQ== 29172 -YW5kcm8= 29173 -IGFwcGVhcmFuY2Vz 29174 -cHJvZg== 29175 -INC+0Lc= 29176 -bGFnZW4= 29177 -IC8v 29178 -INC70LjRiNGM 29179 -IHJlY292ZXJpbmc= 29180 -0LTQtg== 29181 -cHN5 29182 -44Oi 29183 -IHN3aWZ0 29184 -IFNwaW4= 29185 -5biI 29186 -IHNlaW5lbQ== 29187 -IGRvbHBo 29188 -ZsO8aHI= 29189 -w6J0 29190 -IGFsdGlqZA== 29191 -IE1hcnR5 29192 -IEhvY2g= 29193 -IHByZWRhdG9ycw== 29194 -IHZvcmhlcg== 29195 -INCU0LDQstCw0Lk= 29196 -IGZyYWdtZW50cw== 29197 -IHBhc3RyeQ== 29198 -IGNvbW1lbg== 29199 -IFNhbmE= 29200 -IOqxtOuNsA== 29201 -dXNzZW4= 29202 -IHRlbGE= 29203 -IE5pbmE= 29204 -bGVr 29205 -IGNyaWVz 29206 -IHRoaWdocw== 29207 -IEZsZXg= 29208 -IEJ1eno= 29209 -44Q= 29210 -VXM= 29211 -IHBhc28= 29212 -IGRlY2xpbmVk 29213 -IE55 29214 -YmFsYW5jZQ== 29215 -IG1hc2E= 29216 -IGpvcw== 29217 -44Gq44KL 29218 -INCh0L/QsNGB0LjQsdC+ 29219 -YWNodQ== 29220 -bG91ZA== 29221 -IHBlbmE= 29222 -IFdhbGQ= 29223 -IGVsaW1pbmF0aW9u 29224 -INCy0LXRgdGM 29225 -b3JhZ2U= 29226 -IG1pc3VuZGVyc3RhbmRpbmc= 29227 -IGVuZG9yc2U= 29228 -IG9nw7NsZQ== 29229 -IGdyZWVk 29230 -IGtsZWlu 29231 -15zXlA== 29232 -UkVZ 29233 -IEVhdGluZw== 29234 -IHNlbWluYXI= 29235 -IEJpcnRoZGF5 29236 -IHF1ZWxsZQ== 29237 -IE11bHRp 29238 -IHRpcmFy 29239 -IHBlcmNo 29240 -IGxhdm9y 29241 -IEppYQ== 29242 -IG11dGF0aW9ucw== 29243 -IGNpZ2FyZXR0ZXM= 29244 -2YjYrA== 29245 -IGNvdXNpbnM= 29246 -IGNhcHN1bGU= 29247 -IGhvcnJpZmlj 29248 -IHN0dXI= 29249 -IHplaWd0 29250 -bnV0cw== 29251 -IG1lYW53aGlsZQ== 29252 -IENvbGlu 29253 -IGdvYmllcm5v 29254 -IGd3 29255 -IHVoaA== 29256 -IEpFUg== 29257 -c3BlY2lmaWM= 29258 -IGFsbGVnYXRpb25z 29259 -IOupiw== 29260 -IEVsbGE= 29261 -b29rZWQ= 29262 -IEZpdA== 29263 -YWZmbGU= 29264 -IEFwcsOocw== 29265 -IER1Y2s= 29266 -IGNlbGx1bGFy 29267 -Y8Ozdw== 29268 -INGH0YPQstGB0YLQsg== 29269 -Z2Vub21tZW4= 29270 -7Iqk7Yq4 29271 -IGxhaW4= 29272 -aXNvbA== 29273 -IGhvbGRlcnM= 29274 -IGJvb3N0ZXI= 29275 -IFNhc2hh 29276 -0YvQstCw0LXRgg== 29277 -gbw= 29278 -IHNlcGFyYXRpbmc= 29279 -IHJlaW5mb3JjZW1lbnQ= 29280 -INC+0LTQvdC+0Lk= 29281 -7JeG 29282 -SURF 29283 -IE9wdGlvbg== 29284 -cGhvbg== 29285 -IHBsYWlz 29286 -IENhbWI= 29287 -IO2ZmA== 29288 -IHVuY29tbW9u 29289 -Ijo= 29290 -bWl5b3J1bQ== 29291 -bW9p 29292 -YWNqZQ== 29293 -0LDQttGD 29294 -1bY= 29295 -IGdlbXM= 29296 -w7xsZXI= 29297 -b29scw== 29298 -IGVuenltZXM= 29299 -IGtpZG5hcHBlZA== 29300 -IGtldGNodXA= 29301 -dGFsaw== 29302 -IHphY2g= 29303 -IHdhc2hlcg== 29304 -44CC44CC 29305 -IEFyY2hpdGVjdA== 29306 -dmVudWU= 29307 -IFBsYW5uaW5n 29308 -6YCB 29309 -IFNhdmlvcg== 29310 -INCz0YDRg9C/0L8= 29311 -7Yq8 29312 -YXJ5YQ== 29313 -IHByb2Nlc28= 29314 -IGxpbWJz 29315 -IHJlYWxpemVz 29316 -aWFuZGVy 29317 -RlM= 29318 -YWpp 29319 -IHVuaXRl 29320 -IOydmOs= 29321 -IHBvc3PDrXZlbA== 29322 -cmFpdHM= 29323 -IEFncmU= 29324 -24zaqQ== 29325 -7ISc64+E 29326 -5o6J 29327 -INCy0LXQuw== 29328 -INC80LXRgdGP 29329 -YW5vcg== 29330 -UGF0 29331 -IGRlcm5pZXI= 29332 -z4PPhM61 29333 -INC60LDQutCw0Y8= 29334 -IGzDpHNzdA== 29335 -5o6w 29336 -IE1laA== 29337 -IG5naA== 29338 -IGFtYXRldXI= 29339 -6KuW 29340 -RmU= 29341 -IOq2gQ== 29342 -IHNpdHVhY2nDs24= 29343 -IHNlZGFu 29344 -IGNsZWFuc2luZw== 29345 -bGFzdGluZw== 29346 -IGNvbW11bmlzdA== 29347 -QU5F 29348 -IGlycmVndWxhcg== 29349 -IHNvdXQ= 29350 -IENhcm5leQ== 29351 -IGFsbGVtYWFs 29352 -IG11Y2jDrXM= 29353 -IGxpYnJv 29354 -0K3RgtC+ 29355 -INCw0L8= 29356 -IGNvbnRpbnVhdGlvbg== 29357 -IExvcg== 29358 -PyIs 29359 -cXVpbg== 29360 -IGNoYXJhY3Rlcml6ZWQ= 29361 -YWplcw== 29362 -IHNpZ2h0cw== 29363 -INGP0LfRiw== 29364 -IFVoaA== 29365 -6Lez 29366 -YmlydGg= 29367 -ZG9uZw== 29368 -IGhhYmxhbmRv 29369 -IHN5bXB0b20= 29370 -57WC 29371 -IGNhcGFjaXRvcg== 29372 -IHRyYW5zcG9ydGVk 29373 -IGlnbm9yYW50 29374 -INC90LjQutC+0LPQtNCw 29375 -IGRyaXA= 29376 -IEV2YQ== 29377 -IGFkamVjdA== 29378 -IG1hc3NpdmVseQ== 29379 -IEV0aGk= 29380 -IENpcmNsZQ== 29381 -IHJhaW5mYWxs 29382 -IE1vdXNl 29383 -IHJlZnVuZA== 29384 -IFp3 29385 -YXNzZW1i 29386 -IDIyMA== 29387 -IE9yZA== 29388 -6KeS 29389 -IHZlaW5z 29390 -IEdpYW50 29391 -IG3Do2U= 29392 -IHZhcA== 29393 -IG1pc3Nlcw== 29394 -zr/Phc+C 29395 -TW8= 29396 -IEVudHdpY2s= 29397 -SU5U 29398 -2YbYqg== 29399 -IHRoZW9yZXRpY2FsbHk= 29400 -IHRlYXJpbmc= 29401 -IHRyb3VibGVk 29402 -cHJlbQ== 29403 -IHJlcGV0aXRpdmU= 29404 -IOKW 29405 -IGhlYXZlbmx5 29406 -IEFtYmVy 29407 -INC/0L7Qu9C+0LY= 29408 -IO2VtOyk 29409 -IHZvd2Vs 29410 -YW5raW5n 29411 -IFdpcnRzY2hhZnQ= 29412 -IGlycg== 29413 -IGNvenk= 29414 -IHVuZmFtaWxpYXI= 29415 -IFBvcnM= 29416 -IOunnuyVhA== 29417 -IFRpbW90aHk= 29418 -0YHQvtC70Y7Rgg== 29419 -cGV4 29420 -IFZJUw== 29421 -KSg= 29422 -IHN1cGVyc3Q= 29423 -IGltcHJvdg== 29424 -IEJlbmc= 29425 -IGRpc2Nvbm5lY3RlZA== 29426 -IGFwdA== 29427 -0YDQtdC9 29428 -IEV4dHJh 29429 -INCx0LXQuw== 29430 -c2hvcA== 29431 -ZGluZ3M= 29432 -IENvbm5lY3RpY3V0 29433 -7LCs 29434 -IEdD 29435 -5Y+W 29436 -YmVo 29437 -SmVyZW15 29438 -IEJhdHQ= 29439 -44G4 29440 -YXRoYQ== 29441 -IFp1c2FtbWVu 29442 -c2NyZWFtcw== 29443 -IGdyYXM= 29444 -YWZmdA== 29445 -IEluaXRpYWxseQ== 29446 -IEJyZXR0 29447 -IHNwZWNpZmljYXRpb25z 29448 -IHNlYXdlZWQ= 29449 -IG9hdGg= 29450 -IGZvdW50YWlu 29451 -INC60L7RgtC+0YDQvtC5 29452 -IFN0ZWlu 29453 -6IGy 29454 -IENvcmludGg= 29455 -IGNvbmp1Zw== 29456 -5bem5Y+z 29457 -IGNvbXBlbnNhdGU= 29458 -IOuKkOuCjOydtA== 29459 -IG9uemU= 29460 -IHNraW5jYXJl 29461 -QnJpYW4= 29462 -IHNlcnZpcg== 29463 -fX0= 29464 -IFZpaw== 29465 -IHVuaW50 29466 -IHN1cHBsaWVycw== 29467 -IGJhbGNvbnk= 29468 -IGVuZXJnaWE= 29469 -b21ldHJpYw== 29470 -0LfRjw== 29471 -IHNpZ2g= 29472 -IFRPTQ== 29473 -IFB1cmU= 29474 -eXR0 29475 -0YvRgQ== 29476 -IFJhaW5ib3c= 29477 -IFBpdHRz 29478 -15nXng== 29479 -IHN0YXR1ZXM= 29480 -aGVhZHM= 29481 -IGNvdXBsZWQ= 29482 -6Yyi 29483 -IGhlcmQ= 29484 -5L2T 29485 -IGV4Y2x1ZGVk 29486 -IGdpbHQ= 29487 -INGO 29488 -IHN3b2pl 29489 -IFN2ZXI= 29490 -NjM= 29491 -aXNzYW50 29492 -IGTDvHJmZW4= 29493 -oIjr 29494 -IGtpc3Npbmc= 29495 -b29m 29496 -5Lul5LiK 29497 -IGN1cnNlZA== 29498 -IHNob3dlcnM= 29499 -IHN3aW5naW5n 29500 -IHJlcHJvZHVjZQ== 29501 -44Go44GE44GG44GT44Go 29502 -IHPDpHR0 29503 -ZWxjb21l 29504 -IGZ1bmRhbWVudGFscw== 29505 -IGFsbW9uZA== 29506 -IHDDqQ== 29507 -IHdlbGxiZWluZw== 29508 -IGh1bnRlcnM= 29509 -5b6A 29510 -U2Vj 29511 -k5zrprQ= 29512 -IGVtaXNzaW9u 29513 -IHBzeWNob2xvZ2lzdA== 29514 -IGJldHJheWVk 29515 -IFJleW5vbGRz 29516 -TEVT 29517 -IHBvbGxpbmc= 29518 -IG5lZ2F0aXZlbHk= 29519 -IGNvbWJpbmVz 29520 -15zXkA== 29521 -0LDRgNCw 29522 -zrvOu86s 29523 -IFR1cm5z 29524 -T1RU 29525 -INeU15k= 29526 -YWlzb24= 29527 -IGFpcmxpbmU= 29528 -IHJlc3RyaWN0aW9u 29529 -d2Fs 29530 -IGF1cmFpdA== 29531 -IExlYmFub24= 29532 -IE1PUg== 29533 -IG1vbmtleXM= 29534 -w6luZXI= 29535 -0ZbRlw== 29536 -IG1vdGhlcmY= 29537 -INmH2LDZhw== 29538 -IGZldQ== 29539 -w7xocmVu 29540 -IGh5Z2llbmU= 29541 -ZW50ZWVu 29542 -RGVz 29543 -IGRpc3NpcA== 29544 -RXN0 29545 -IHNhaW50cw== 29546 -IHBvdGFzc2l1bQ== 29547 -IHJlY2tvbg== 29548 -Q2xpbnR1cw== 29549 -IG1hbmlmZXN0YXRpb24= 29550 -IEFwcHJv 29551 -IEluc3BlY3Q= 29552 -IHZlbnRpbGF0aW9u 29553 -IGhlbG0= 29554 -IGthcmE= 29555 -4Liy4LiZ 29556 -IGZhdm9yYWJsZQ== 29557 -IOyViuyVmA== 29558 -IEhpc3Bhbmlj 29559 -4Lic 29560 -INeU15s= 29561 -IHZhbGlkYXRl 29562 -IFJlc2lkZW50 29563 -IGNvbWVueg== 29564 -YmVpdGVy 29565 -ZXJlcg== 29566 -5LiA6LW3 29567 -IGRhZG8= 29568 -YXRjaGluZw== 29569 -bWV0cm9z 29570 -IEhpbg== 29571 -IER1bQ== 29572 -IGhhesSxcg== 29573 -IE5hdGFsaWU= 29574 -IGVuY3J5cHRpb24= 29575 -0L7Rh9C60LA= 29576 -bW1h 29577 -aG91c2Vz 29578 -IGFuYWx5dGljYWw= 29579 -IERhbmc= 29580 -Zmlyc3Q= 29581 -5q2M 29582 -57qM 29583 -IEVuYw== 29584 -Y2FuZG8= 29585 -IGx1ZHpp 29586 -d2FydA== 29587 -IHN0YXRpc3RpYw== 29588 -IOyCsA== 29589 -IGNvbW1lbnRpbmc= 29590 -IGNvb3JkaW5hdGVk 29591 -IEh5cGVy 29592 -5Zo= 29593 -IEJlcnQ= 29594 -55y+ 29595 -IEhpcA== 29596 -a2Vt 29597 -w7xuw7w= 29598 -IHphbA== 29599 -IO2VmOuKlOuNsA== 29600 -IFJvYm90 29601 -6Zax 29602 -cmF3bg== 29603 -IHJoZXRvcmlj 29604 -dWxsYWg= 29605 -IERpZXQ= 29606 -IHRha2ljaA== 29607 -IHBvc3Nlc3NlZA== 29608 -k5zripQ= 29609 -IHdha2Vz 29610 -IFJhZg== 29611 -TWFydA== 29612 -IGVjYw== 29613 -IEZN 29614 -IGRpZmlj 29615 -IEFsbGV6 29616 -IGN1cmVk 29617 -5a2m 29618 -IFF1YWQ= 29619 -IGJlbGU= 29620 -IGpvdXJuYWxz 29621 -IHRhZA== 29622 -IHNvY2lhbGVz 29623 -5oeC 29624 -IHdoYXRz 29625 -IEJhc3M= 29626 -IGplc3RlbQ== 29627 -IFNhZGx5 29628 -IFNvdXJjZQ== 29629 -IMO8w6c= 29630 -YWx0dW5n 29631 -aWVydGVu 29632 -IGp1bGxpZQ== 29633 -aWZh 29634 -INCa0L7RgA== 29635 -IERvb3I= 29636 -INCd0LDQtA== 29637 -INC30LTQvtGA0L7Qsg== 29638 -IHJ1bW9y 29639 -IHBpZXM= 29640 -INC/0LXRgNC1 29641 -INC+0YLQsg== 29642 -0LXQvdC90YvQtQ== 29643 -SG9zdA== 29644 -IFNvcGhpZQ== 29645 -YW50ZW4= 29646 -QW55 29647 -IEF1Zmc= 29648 -56iL 29649 -IEhEUg== 29650 -IFJvY2tldA== 29651 -cmVzc28= 29652 -IHZlcmRl 29653 -IHByw6lzaWRlbnQ= 29654 -IGluZG9vcnM= 29655 -IHN0YWdnZXI= 29656 -IHN0YXRv 29657 -IERpYWw= 29658 -IGJ1enppbmc= 29659 -ZW1lcg== 29660 -INCS0YHRkQ== 29661 -INC00LXRgNC10LI= 29662 -IHBvdXY= 29663 -IHN0cmFuZHM= 29664 -IOqyg+ydtA== 29665 -IFBhcmw= 29666 -0L7QutC+0Lk= 29667 -IHNpcA== 29668 -ICgq 29669 -w6RuZ3Q= 29670 -IGRlYmVy 29671 -IEFpbg== 29672 -IGRyYXN0aWNhbGx5 29673 -IFNsb3dseQ== 29674 -IEJyaWc= 29675 -IFRvcmFo 29676 -IGFjaGU= 29677 -ID8/Pw== 29678 -IERvYg== 29679 -a2FubnQ= 29680 -TWFyeQ== 29681 -IHN0YW0= 29682 -IERlbW9u 29683 -cGxh 29684 -IEZyZXVuZA== 29685 -IEJlbm4= 29686 -IGhpZ2hz 29687 -INqp2LE= 29688 -IFByZXBhcmU= 29689 -IHByb3h5 29690 -IGNhbXBv 29691 -IEF1Z2Vu 29692 -o6jr 29693 -IENobG9l 29694 -aWN1bGFybHk= 29695 -eW91bmc= 29696 -IOOBjA== 29697 -qZTr 29698 -IHNjcmF0Y2hpbmc= 29699 -IGdsYWM= 29700 -IGdlbWVpbnNhbQ== 29701 -YW5hbA== 29702 -YWNha3PEsW4= 29703 -IEZvcnVt 29704 -ZW5uaWFs 29705 -IFJlc291cmNlcw== 29706 -44Go5oCd44GE44G+44GZ 29707 -IG1laXN0ZW4= 29708 -IEZlbGw= 29709 -IHVuYW5pbQ== 29710 -IFRC 29711 -IFNlbGJzdA== 29712 -5oY= 29713 -IGludGltaWRhdGluZw== 29714 -IEdlZsO8aGw= 29715 -IOy9lOuhnA== 29716 -5ouJ 29717 -aWRvcg== 29718 -aWNpb25lcw== 29719 -YXJzYQ== 29720 -XS4u 29721 -YXpv 29722 -IGtlbmRp 29723 -IFRhZ2U= 29724 -dGVybWlu 29725 -IFByb3plbnQ= 29726 -TWF5YmU= 29727 -bMOp 29728 -IHF1ZXN0aQ== 29729 -IG1lbWVz 29730 -IGNvcnJl 29731 -IFZJUA== 29732 -IEdhbGxlcnk= 29733 -IHVyZ2VuY3k= 29734 -IG5vY2hl 29735 -IGtpbmRseQ== 29736 -IE1lcmVkaXRo 29737 -IHbhuq15 29738 -INin2YTYqA== 29739 -IEVzdGFkbw== 29740 -5Ye65L6G 29741 -enVn 29742 -b3F1ZQ== 29743 -IG9iZXNpdHk= 29744 -T2Zm 29745 -IEV1cm9wZWFucw== 29746 -w7Zk 29747 -7Lm06w== 29748 -IGhvb3A= 29749 -IGVuam95cw== 29750 -IENoaXA= 29751 -cGF0aWVudA== 29752 -IG1pY3Jvc2NvcGU= 29753 -IGxlZ2l0aW0= 29754 -INGP0LLQu9GP0LXRgtGB0Y8= 29755 -z4POuQ== 29756 -YXJnZW50 29757 -IHNoYW0= 29758 -IGxpY2Vuc2luZw== 29759 -b2xpYQ== 29760 -U29ycnk= 29761 -cmFtYQ== 29762 -IGFjY2VsZXJhdGVk 29763 -IHd5bQ== 29764 -IGZhaXJuZXNz 29765 -IFJlYWRpbmc= 29766 -IHNsYWNr 29767 -IERvaw== 29768 -emnEmWt1asSZ 29769 -IHJ1YmJpbmc= 29770 -0LDRgtGD 29771 -IGFsbG9jYXRlZA== 29772 -anVuZw== 29773 -IHBhaW5z 29774 -IHdpbmRpbmc= 29775 -IGdlbGl5b3I= 29776 -IENV 29777 -bW90 29778 -Y29jaw== 29779 -IFBvc2l0aW9u 29780 -YnJvcw== 29781 -IGxpdmVzdHJlYW0= 29782 -IEJyYWlu 29783 -7LCp 29784 -IHByemVr 29785 -IEVp 29786 -IENvY28= 29787 -0LHQsA== 29788 -IHNob3ZlbA== 29789 -44OP44OP 29790 -ZWE= 29791 -IGNob2NvbA== 29792 -IHJlYmVsbGlvbg== 29793 -IHNob3dj 29794 -IEhhbG8= 29795 -IGRpdmlkZW5k 29796 -bWlzc2lvbg== 29797 -IHVzYW5kbw== 29798 -IFsi 29799 -IGZhbGVp 29800 -5pu4 29801 -QmxhY2s= 29802 -IFN1cmVseQ== 29803 -IMW7 29804 -IHBoaWxvc29waGVy 29805 -5L2g5Lus 29806 -IG92ZXJoZQ== 29807 -IEJvcm4= 29808 -IG9iamV0aXZv 29809 -IDEyOA== 29810 -c2NoZWlk 29811 -IE5hemlz 29812 -IHNvbGNoZQ== 29813 -bGlmdA== 29814 -Y2VkZQ== 29815 -YWRvcnM= 29816 -IG1hcnNobQ== 29817 -IExPUkQ= 29818 -lOydtO2BrA== 29819 -IG93bmluZw== 29820 -Q29udA== 29821 -IGxhbmRzY2FwZXM= 29822 -IGxlbmRpbmc= 29823 -IEF1dGhvcml0eQ== 29824 -0L7QstC+0Lk= 29825 -b3F1 29826 -IFNlcw== 29827 -IEZlcnJhcmk= 29828 -IHJlc3BvbnNhYmls 29829 -IHbDoXJpb3M= 29830 -IGRlbGlj 29831 -IGVtYmFyaw== 29832 -IGVtYnJvaWRlcg== 29833 -IGZyYW1ld29ya3M= 29834 -IHNpbW1lcg== 29835 -IG5hY2lvbmFs 29836 -IHJlbWFpbmRlcg== 29837 -IFZpZWxsZWljaHQ= 29838 -IHF1aWVyZXM= 29839 -7JeU 29840 -IHRlc3Rvc3Rlcg== 29841 -aWhlbg== 29842 -IE96 29843 -w6hsZQ== 29844 -IHBvcnRyYXllZA== 29845 -zrrOtQ== 29846 -IFBvbGl0aWs= 29847 -IGFwZXJ0dXJl 29848 -IGJsYW5k 29849 -aW5kdXN0 29850 -INC+0LHRgNCw0YI= 29851 -IFRob3Vz 29852 -QmF5 29853 -IGRhbmRv 29854 -IHNoZXI= 29855 -IGFkbWlzc2lvbnM= 29856 -IENyZXc= 29857 -INGW0L0= 29858 -U0lOR0lORw== 29859 -IG91bmNl 29860 -IGl5 29861 -IGJhc2ls 29862 -IG92ZXJ0aW1l 29863 -IHRocmVhdGVu 29864 -IHBhcnRuZXJlZA== 29865 -IENhbm4= 29866 -YXZhbmE= 29867 -INC30L3QsNC10YLQtQ== 29868 -6YCZ5Lqb 29869 -INC+0YLRgQ== 29870 -IFR1ZG8= 29871 -7L2U 29872 -IOuGgOs= 29873 -ZmVs 29874 -IHJlYXJy 29875 -IGlud2FyZA== 29876 -IFJvZ2Vycw== 29877 -4LmD4Lir 29878 -IHR3ZWFr 29879 -IGRyeWVy 29880 -Y2Vzc2lvbg== 29881 -IHJpZ29yb3Vz 29882 -IERhYXI= 29883 -b21pY3M= 29884 -IGZhdHM= 29885 -dmFk 29886 -IHppcHBlcg== 29887 -YWNjZXB0YWJsZQ== 29888 -IGRlbW9uc3RyYXRpbmc= 29889 -IFl1bQ== 29890 -IGJlYXU= 29891 -IHJvc3Rlcg== 29892 -IHByZWRvbWluYW50bHk= 29893 -0LXRgNGD 29894 -bmluZ2Fy 29895 -IHRyaWFuZ2xlcw== 29896 -IHRleHRpbmc= 29897 -IGJlcnJpZXM= 29898 -IOyCrOynhA== 29899 -6ZSZ 29900 -YWRkZXI= 29901 -IGZhaXRlcw== 29902 -IEltYWdl 29903 -bGVyZQ== 29904 -IGJvdW5kcw== 29905 -IExhdXI= 29906 -IOyVhOustOs= 29907 -IG1pbw== 29908 -IHVzYQ== 29909 -INiw 29910 -IHRvZW4= 29911 -IEphbmc= 29912 -xb5l 29913 -Y2hvZA== 29914 -YW5hbg== 29915 -INC+0LHRgNCw0LfQvtC8 29916 -IHBlcnNldmVy 29917 -IFN3ZQ== 29918 -IGF1Z21lbnQ= 29919 -5LiD 29920 -dWdnbGluZw== 29921 -acOocmVtZW50 29922 -aXN0bGVz 29923 -YWNqxJk= 29924 -OTE= 29925 -IG1haA== 29926 -IEtJUg== 29927 -RGll 29928 -IGRvd25oaWxs 29929 -IDE5Njg= 29930 -0L7RgNC+0YjQvg== 29931 -5bm5 29932 -b2dyYXBoaWNz 29933 -IHTDpHNzw6Q= 29934 -6rKg7KOg 29935 -INC70LjRhw== 29936 -QVVESU8= 29937 -INC/0LvQvtGF 29938 -IHByb3Bvc2luZw== 29939 -6aC7 29940 -IHRlbXB0ZWQ= 29941 -IGNvbnZlcnRpbmc= 29942 -IExlaHI= 29943 -IHBlcnNvbmU= 29944 -IEZlZWxpbmc= 29945 -7Ja07KO8 29946 -b21icmVz 29947 -INec15k= 29948 -IGd1cnU= 29949 -IGRlbWVudA== 29950 -0L3QuNC3 29951 -0LjRgtC10LvQtdC5 29952 -IGNvbXBhw7E= 29953 -5pyq 29954 -5biM5pyb 29955 -IHJlZG8= 29956 -IGNvbmR1Y3Rvcg== 29957 -bWlh 29958 -IGlkb2xz 29959 -IE11bA== 29960 -IGluZXg= 29961 -IHTDpG3DpA== 29962 -IGltcGFjdGluZw== 29963 -IGRheWxpZ2h0 29964 -Z2ls 29965 -IGhlbGZlbg== 29966 -IGVudHNwcmVjaA== 29967 -IHdpxJlrcw== 29968 -IHNjcmlwdHVyZXM= 29969 -IGRpc21pc3NlZA== 29970 -44Oz44OI 29971 -IFBvZGNhc3Q= 29972 -2YXYsQ== 29973 -IGFubnVhbGx5 29974 -IHVzYWJsZQ== 29975 -IGxpYnJl 29976 -0L7Qt9C8 29977 -IHJ1YmJpc2g= 29978 -55qE5Lq6 29979 -IGNvbnRpbnVhcg== 29980 -IGh1bWlsaQ== 29981 -IHNwZWVjaGVz 29982 -0YDQsNGH 29983 -YmFyZA== 29984 -NzE= 29985 -Pjw= 29986 -b2xvZ8OtYQ== 29987 -d2VhbHRo 29988 -IG1lZGl0YXRl 29989 -k6TsnZg= 29990 -IENyYWZ0 29991 -6KeJ5b6X 29992 -5pmu 29993 -cml2 29994 -IEFnYWluc3Q= 29995 -IGNlcmFtaWM= 29996 -ZXNww6hyZQ== 29997 -IGNvbXBldGVudA== 29998 -IEhvcGtpbnM= 29999 -IGtpbG9z 30000 -IGdyYXZlbA== 30001 -IHBpc3Rvbg== 30002 -IGZyaWVuZHNoaXBz 30003 -IGVzY3Jl 30004 -IHZveg== 30005 -IEdlc2VsbHNjaGFmdA== 30006 -IHVudGVyc3TDvHQ= 30007 -IG11ag== 30008 -IHdhcm5pbmdz 30009 -cG9z 30010 -IFByb2Zlc3Npb25hbA== 30011 -d3N6eQ== 30012 -b2RsZQ== 30013 -YmFuZHM= 30014 -IHRlYW13b3Jr 30015 -c3RlbGx1bmc= 30016 -IGR4 30017 -5Y2K 30018 -IGF0dG9ybmV5cw== 30019 -IHdlaXRlcmU= 30020 -44WL44WL44WL 30021 -IE9yaWdpbmFs 30022 -15nXlw== 30023 -IGJyb2FkY2FzdGluZw== 30024 -INC/0LXRgNCy0YvQuQ== 30025 -dWNoaQ== 30026 -IGhldXJl 30027 -IGdyYWJz 30028 -IFdPUg== 30029 -IFBsYWlk 30030 -TWlu 30031 -IHBheg== 30032 -IFB1aXM= 30033 -dW11 30034 -aXRhdGVz 30035 -IGNvYXRz 30036 -IGJ1ZW4= 30037 -IGhlaXI= 30038 -IHBuZXVt 30039 -16nXqA== 30040 -ZW5zZXI= 30041 -IEpVREdF 30042 -IGJsb25kZQ== 30043 -4bmb 30044 -IGdhaw== 30045 -IHPEsWs= 30046 -IHF1b3RlZA== 30047 -IGVxdWlwbw== 30048 -IHdpc2hpbmc= 30049 -w61jaWE= 30050 -IHZlcmJz 30051 -57WE 30052 -IENhbmFkaWFucw== 30053 -IGdvdmVybmluZw== 30054 -IEV2YW5z 30055 -RXVybw== 30056 -IGdlbnJlcw== 30057 -IHVudGVyc2NoaWVk 30058 -IEJlY2t5 30059 -s7zqsozsmpQ= 30060 -IGVpbmdl 30061 -IFJhaXNl 30062 -b2xhbmQ= 30063 -IFN0cmF0ZWc= 30064 -IGVyZXM= 30065 -IFZldGVyYW5z 30066 -IGJyZWFrb3V0 30067 -IHNhbnTDqQ== 30068 -IGFkZWw= 30069 -IGludmVzdGlnYXRlZA== 30070 -IHBldXI= 30071 -IGFnaWxl 30072 -IHJhaWxyb2Fk 30073 -YW5za2E= 30074 -INC10Lk= 30075 -IGV4cG9z 30076 -YXRvcmllcw== 30077 -IENvbnRlbnQ= 30078 -IHRydXRocw== 30079 -IFRyYWls 30080 -IGd1YQ== 30081 -IHBvcmVz 30082 -IHdyaXRpbmdz 30083 -IFVocg== 30084 -IFRoYXRz 30085 -IGljaW5n 30086 -T0M= 30087 -IFByb2R1Y3Rpb24= 30088 -IGNhcm5l 30089 -SVNT 30090 -IG5pbmd1w6lt 30091 -bm9u 30092 -IHZpY2lvdXM= 30093 -15XXlA== 30094 -IHJlY29ubmVjdA== 30095 -IGNlbnRyZXM= 30096 -IEtlbQ== 30097 -IGNyZWFzZQ== 30098 -IOydtOuvuA== 30099 -0LDQudGC0LXRgdGM 30100 -INCx0L7RgA== 30101 -IEhhecSxcg== 30102 -INGB0YPQtA== 30103 -IMO6bmljYQ== 30104 -b3dhxYI= 30105 -IGFkaGVy 30106 -aHVh 30107 -Wlo= 30108 -IHByZWNpc28= 30109 -IGN1cnJlbnRz 30110 -IHNlYXNvbmVk 30111 -IElvVA== 30112 -IEJpc2hvcA== 30113 -6KiI 30114 -c3RlZA== 30115 -IEJlcm5hcmQ= 30116 -7KSY 30117 -5rK7 30118 -IEdsZW5u 30119 -IGt0w7NyeW0= 30120 -4Li34LmI 30121 -IGFzdHJvbG9n 30122 -IEtvdA== 30123 -5aSc 30124 -IHBhcmZvaXM= 30125 -IGZvcndhcmRz 30126 -IFdpxJk= 30127 -IM6Y 30128 -IG5hbm8= 30129 -6LuN 30130 -c3Vi 30131 -IEJyaWxs 30132 -IGdyaXQ= 30133 -IGNpdGVk 30134 -Z2Fkbw== 30135 -IG1lbHRz 30136 -IGZvcmPDqQ== 30137 -4paI4paI 30138 -IGJham8= 30139 -IGRpc2NyZXRpb24= 30140 -sLA= 30141 -YXRpdml0eQ== 30142 -IHNpdHVhdGVk 30143 -44Or44Kv 30144 -0YnQtdC1 30145 -5Zyw5pa5 30146 -INC/0YDQuNC90YbQuNC/ 30147 -YW1heg== 30148 -IGFxdWFyaXVt 30149 -IGRpc3NvbHZl 30150 -IEdvZHM= 30151 -U3VwZXI= 30152 -IGFtaWQ= 30153 -ems= 30154 -IOOBhA== 30155 -6aCQ 30156 -YW1wZg== 30157 -IGhlbGE= 30158 -JyE= 30159 -IGRldmVsb3BtZW50YWw= 30160 -IERpc2U= 30161 -INGA0LDQsdC+0YLQsNC10YI= 30162 -IHNuYXBzaG90 30163 -5aW95aW9 30164 -1bg= 30165 -IFl1ZQ== 30166 -IEh1bGs= 30167 -IERvb20= 30168 -IEZlbGl4 30169 -IHLDqWY= 30170 -TWFsZQ== 30171 -57eK 30172 -cGhhbnRz 30173 -RU5T 30174 -IE1lY2hhbg== 30175 -IEdvbGY= 30176 -5YaN6KaL 30177 -IGdlbmVyb3NpdHk= 30178 -w6R0emU= 30179 -IHVubG9ja2Vk 30180 -IOOCkg== 30181 -7YOB 30182 -b2NhbHlwc2U= 30183 -QWxyaWdodA== 30184 -IOqwnOs= 30185 -INeQ15HXnA== 30186 -IEtlZXBpbmc= 30187 -IGNvbGxhYm9yYXRpbmc= 30188 -Y2hpZWY= 30189 -IEZlcm5hbmRv 30190 -IGNoZWZz 30191 -IO2UvOu2gA== 30192 -IHNraXBwZWQ= 30193 -IHBlcnNvbm4= 30194 -IGF4ZQ== 30195 -Y2hleg== 30196 -IGV4dHJhY3Rpb24= 30197 -IEFW 30198 -IEdpYmJz 30199 -IO2c 30200 -IHPEsQ== 30201 -SUFN 30202 -Vmlldw== 30203 -IEdSQU5U 30204 -IOuquA== 30205 -IHZlcmlmaWNhdGlvbg== 30206 -IGRlcGljdGVk 30207 -IE1veg== 30208 -b3V4 30209 -IHR1bA== 30210 -IHNjYW5uZXI= 30211 -IGNvbWVkaWFu 30212 -IFZvbGtz 30213 -IEpFRkY= 30214 -6KiC6Zax 30215 -p4Q= 30216 -IGRpc3RyYWN0aW9u 30217 -csOh 30218 -IElOVEVS 30219 -IHNpbmNlcg== 30220 -INee16o= 30221 -INep16A= 30222 -IGNvbnN0cnVjdGl2ZQ== 30223 -YXJm 30224 -IOuIhOs= 30225 -IGVjbw== 30226 -cmFtb3M= 30227 -IHJlbmV3ZWQ= 30228 -aW5lbWVudA== 30229 -IFVi 30230 -IFBlcHBlcg== 30231 -7KeA6rCA 30232 -IERhcndpbg== 30233 -IG1lcmNoYW5k 30234 -IHbDoXJpYXM= 30235 -w6hjZQ== 30236 -Tkc= 30237 -IOychO2VtOyEnA== 30238 -INCw0LrRgtC40LI= 30239 -IFVudGVycw== 30240 -2LnZhA== 30241 -IGludHJpYw== 30242 -b21tYQ== 30243 -aWV2aW5n 30244 -IENhcm9saW5l 30245 -5ZOB 30246 -IFBSRVM= 30247 -IHBlcmZvcm1lcg== 30248 -IGF1dG91cg== 30249 -44G+44Gb44KT 30250 -IHV0dGVybHk= 30251 -IHN5bnRoZXNpcw== 30252 -IGxlc2JpYW4= 30253 -IHJldHJpZXZl 30254 -IG1hbmVpcmE= 30255 -IGltcGFpcg== 30256 -IG1lbnRvcmluZw== 30257 -IFNvdWxz 30258 -IEdvUHJv 30259 -0YDQsNGC0Yw= 30260 -IGNvc2U= 30261 -IFNTRA== 30262 -SVJF 30263 -IHVwZnJvbnQ= 30264 -IEF1bg== 30265 -IGdhbWVy 30266 -IGxpdHQ= 30267 -IGFnZ3Jlc3Npb24= 30268 -IExpa2V3aXNl 30269 -IEJldHR5 30270 -IERhcnQ= 30271 -IERMQw== 30272 -aXNobWVudA== 30273 -7J6l7J2E 30274 -IOWvuQ== 30275 -57uP 30276 -Y3JlYW0= 30277 -IEJhYnlsb24= 30278 -IG51Zw== 30279 -YnJhcg== 30280 -IGF5bsSx 30281 -YW1pbHk= 30282 -YmlrZQ== 30283 -YWhhaGFoYQ== 30284 -bG95ZA== 30285 -IG1pcmE= 30286 -IHBlcm1l 30287 -IEdhbWluZw== 30288 -IGZpcm13YXJl 30289 -TWE= 30290 -IGFzc2lzdGVk 30291 -YXRpY3M= 30292 -IOyVnuycvOuhnA== 30293 -IE1lbnRhbA== 30294 -bmllanM= 30295 -IEl6 30296 -b3fEhQ== 30297 -IHRvdWdoZXI= 30298 -IGRlZWQ= 30299 -6Ium 30300 -IHN0eWxpc2g= 30301 -IFRvb2xz 30302 -IEhhbXA= 30303 -IHN1bnNjcmVlbg== 30304 -IGFydGljdWxhdGU= 30305 -aXll 30306 -0LjRhA== 30307 -IFNwcmVhZA== 30308 -IEhBVkU= 30309 -IHN3aXJs 30310 -IHNwb25zb3Jpbmc= 30311 -5LuL 30312 -aW92YXNjdWxhcg== 30313 -bWVzaQ== 30314 -IHJlbGF4YXRpb24= 30315 -INGB0LLQvtC40YU= 30316 -IG1hcmdpbnM= 30317 -IHNhxJ8= 30318 -IFByaWRl 30319 -IM+Ezr/Phc+C 30320 -0LjRhtC4 30321 -ZW5jaQ== 30322 -RG9lcw== 30323 -IGNvcnBzZQ== 30324 -IGVuZHVyYW5jZQ== 30325 -IO2emA== 30326 -7Lm0 30327 -IGhhaXJjdXQ= 30328 -IGludGVycnVwdGVk 30329 -IHdpbmR5 30330 -IENhbGVi 30331 -z4HPhw== 30332 -IFBvdXJxdW9p 30333 -IGhvbGlzdGlj 30334 -dWNsZWFy 30335 -IFdob2xl 30336 -5aOr 30337 -QWN0 30338 -IGdhbGxvbg== 30339 -Y2FkZQ== 30340 -IFJlZ2lvbmFs 30341 -cm9hZHM= 30342 -IFNjaG5l 30343 -w6FuZw== 30344 -INC40LfQvNC10L0= 30345 -44KI44Gt 30346 -IG1lbnVz 30347 -IHNwbGl0dGluZw== 30348 -IHByaWNlZA== 30349 -IM6T 30350 -IHVzZXJuYW1l 30351 -INCe0Yc= 30352 -IGNvbXByZXNzZWQ= 30353 -eWlu 30354 -IGd1YXJkaWFu 30355 -IGdvb2Y= 30356 -IGNoZWNrbGlzdA== 30357 -IGludGVyY2hhbmdl 30358 -IGV4cGVkaXRpb24= 30359 -IGV4dGVybg== 30360 -IGluZnJhcmVk 30361 -ZW5nbw== 30362 -IGRlbnlpbmc= 30363 -IHBhY2tldHM= 30364 -b25lbnQ= 30365 -QkI= 30366 -IEluY3Jl 30367 -IHNpbmk= 30368 -w59lcg== 30369 -w6hn 30370 -bWFhbA== 30371 -Z2VuZXJhdGlvbg== 30372 -IG1pbm9yaXRpZXM= 30373 -IGxsZXZhcg== 30374 -IG5vbWluYXRpb24= 30375 -IGNvbnNpZA== 30376 -INec16I= 30377 -bXXFnw== 30378 -IEVzYw== 30379 -IG51bWVyYXRvcg== 30380 -IGthaWs= 30381 -IGt0w7NyeWNo 30382 -aWVzZW4= 30383 -IHbDqg== 30384 -IFVTUw== 30385 -IFByaXZhdGU= 30386 -INC+0LTQvdC+ 30387 -IGFsw6lt 30388 -w610dWxv 30389 -IGxpbWI= 30390 -IGZvcmdpdmVu 30391 -IGRpc2Nsb3N1cmU= 30392 -z4TOrw== 30393 -IG5pbmfDum4= 30394 -IHRoZXJhcGV1dGlj 30395 -IG5lZ290aWF0aW5n 30396 -IE5pa2U= 30397 -ZW5zZWZ1bA== 30398 -IGluY2Fw 30399 -IGZsYWdzaGlw 30400 -dG93bg== 30401 -4og= 30402 -IM+Azr/Ouw== 30403 -IHdvbHZlcw== 30404 -IHZpb2xhdGlvbnM= 30405 -IEFybm9sZA== 30406 -IGludGVydmVuZQ== 30407 -IGhlYXRlcg== 30408 -IHJlY3Vyc29z 30409 -IG1haWQ= 30410 -6rK8 30411 -INC00LDQstCw0LnRgtC1 30412 -IENlbGVicg== 30413 -IGNhcGU= 30414 -IFN0eQ== 30415 -YWluZW4= 30416 -c2l0ZQ== 30417 -Ymlq 30418 -INC/0L7Qu9GM0Lc= 30419 -IGZyYW1lZA== 30420 -IHB1Ymxpc2hlcnM= 30421 -INGH0YPRgtGM 30422 -IHRlbXB0YXRpb24= 30423 -IGNlcnRlemE= 30424 -IGV4ZW1wdA== 30425 -7Iq5 30426 -c2VsbGluZw== 30427 -IFRhc2s= 30428 -aG9vbg== 30429 -IENvYw== 30430 -IFBhcmtz 30431 -IHJlcGV0aXRpb24= 30432 -INGC0YPQtNCw 30433 -IGVuc2w= 30434 -IGRlxJ9pxZ8= 30435 -IE9ybGFuZG8= 30436 -IE1haW50ZW4= 30437 -5q2i 30438 -b2N1bWVudA== 30439 -IEhD 30440 -IHNjb290ZXI= 30441 -INC90LDQv9C40YE= 30442 -IHRpZ2h0ZXI= 30443 -IHRlYXNl 30444 -IHJlbW92ZXM= 30445 -IGtpamtlbg== 30446 -INGB0YPRidC10YHRgtCy 30447 -IHRow6k= 30448 -INCy0YvQs9C70Y/QtA== 30449 -IHJlbGlldmU= 30450 -IG1pdMOk 30451 -IHN0YXRpb25hcnk= 30452 -w7ZmZg== 30453 -cGFibGU= 30454 -IGFydGVy 30455 -IGTDqWY= 30456 -cmF0aXZl 30457 -IGNvbmVjdA== 30458 -IHNhZGRsZQ== 30459 -IERpYW5l 30460 -IGNvbW1lbW9y 30461 -ZmVuZGlt 30462 -U8Ot 30463 -IO2BtOs= 30464 -IG1hbmdl 30465 -YXR0ZQ== 30466 -IGFycm9nYW50 30467 -IHJvYm90aWM= 30468 -IGdpw6A= 30469 -5piv55qE 30470 -IG5laWdoYm91cmhvb2Q= 30471 -aXNzb24= 30472 -INC00LLQuNC2 30473 -IFJJ 30474 -IE5vcm1hbg== 30475 -YnJhbmQ= 30476 -YW1hdGlvbg== 30477 -IHJhem9y 30478 -IG11cmRlcnM= 30479 -INGC0YM= 30480 -IHdzenlzdGtpbQ== 30481 -IHV0aWxpdGllcw== 30482 -IG1pY3Jvc2NvcA== 30483 -6r8= 30484 -IGRhcXVp 30485 -b2xsYXI= 30486 -INCU0LDQstCw0LnRgtC1 30487 -IGFubsOpZQ== 30488 -IGtpbG9tZXRyZXM= 30489 -IGhvbW9zZXh1YWw= 30490 -IGFyY2hpdGVjdHM= 30491 -44Gh44Gv 30492 -IG5peWU= 30493 -TEVS 30494 -IG1pY3JvcGhvbmVz 30495 -IFN0dW5kZW4= 30496 -IGNvbnNlY3V0aXZl 30497 -aWVuZGE= 30498 -dsOkbmQ= 30499 -REVS 30500 -IGxpZnRz 30501 -IE1lYXQ= 30502 -IHNhdmV6 30503 -7ZaI642Y 30504 -TWVu 30505 -IGRpc21hbnQ= 30506 -6rGw66W8 30507 -IGluc3VsYXRpb24= 30508 -IHNjYWxs 30509 -IHNwb29reQ== 30510 -IHBhcmM= 30511 -IGJhbGxldA== 30512 -IFdoYXRzQXBw 30513 -IGZyYW5j 30514 -IGRlbGliZXJhdGU= 30515 -IO2FjA== 30516 -IG1hcnM= 30517 -IFp1cg== 30518 -UHI= 30519 -ZGlzY2lwbGluYXJ5 30520 -IG9ic2Vzc2lvbg== 30521 -0LzQtQ== 30522 -IG1hcmNoaW5n 30523 -IEVtZXJnZW5jeQ== 30524 -aWd1b3Vz 30525 -IHN6eQ== 30526 -IExhbmRz 30527 -IGJvYXJkaW5n 30528 -INC/0L7Rh9GC0Lg= 30529 -IGVudnk= 30530 -IGNvbXBhc3Npb25hdGU= 30531 -IG1lcmNp 30532 -IGRlc2lyYWJsZQ== 30533 -ZGFsZQ== 30534 -IGNhbsSxbQ== 30535 -IEFudGFy 30536 -dGVtcHM= 30537 -IGNvbmZpZ3VyZWQ= 30538 -IENvbXBhcmVk 30539 -bmVo 30540 -aWNhdGluZw== 30541 -IG5pY2tlbA== 30542 -2YjZgg== 30543 -2YPZiNmG 30544 -b3Blcw== 30545 -IGZvcm11bGFz 30546 -INCV0YHRgtGM 30547 -IHBvYmw= 30548 -IFBK 30549 -IEx1ZA== 30550 -5LuK5Zue 30551 -IEJyaWQ= 30552 -IEhvZw== 30553 -IEJyaXM= 30554 -SmVu 30555 -IHNoYWRpbmc= 30556 -IFlhcw== 30557 -IGRpc3R1cmJlZA== 30558 -IHJlY29tbWVuZGluZw== 30559 -IGPDqQ== 30560 -IEhPVw== 30561 -7JeI7Ja0 30562 -IHJldmVyc2Vk 30563 -IEludGVyZXN0aW5nbHk= 30564 -aW94aWQ= 30565 -5YWt 30566 -IOyYpOy8gOydtA== 30567 -4bq/dQ== 30568 -eHg= 30569 -IG91YWlz 30570 -IFlvdVR1YmVycw== 30571 -IFJvc2E= 30572 -IEhhdXB0 30573 -amFkaQ== 30574 -IHZsb2dz 30575 -IGN1bHR1cmE= 30576 -IExlYWRlcnNoaXA= 30577 -IEhlcA== 30578 -IGlsbHVt 30579 -tOuPmQ== 30580 -IGN1c3RvbWl6ZWQ= 30581 -IG1hcmNh 30582 -IHF1YXRybw== 30583 -INC90LDQsw== 30584 -IFNwYWNlWA== 30585 -IEVpZ2Vu 30586 -YXN0aW5n 30587 -IG9sZHXEn3U= 30588 -IGZvcnRz 30589 -44GJ 30590 -cmltZW50 30591 -aWVuY2lh 30592 -IHRlbmly 30593 -cm9mZmVu 30594 -IDE5Nzk= 30595 -IGNpZQ== 30596 -IOuQmOqzoA== 30597 -IGVzY3Jp 30598 -z4zPgg== 30599 -7Y+s 30600 -dXp6eQ== 30601 -Q29uZw== 30602 -7J247J20 30603 -R3JlYXQ= 30604 -c2ls 30605 -w6ljaA== 30606 -44Go44GL 30607 -IG11bHRpYw== 30608 -IERpc2s= 30609 -spU= 30610 -IGZhemxh 30611 -IGxldmFudA== 30612 -IGFiYWpv 30613 -dXJyeQ== 30614 -c3RydQ== 30615 -IOuoueuKlA== 30616 -IGFjY2Vzc29yeQ== 30617 -INC00LLQuNCz 30618 -IFJpZA== 30619 -MjAxOQ== 30620 -IGRvd25zdHJlYW0= 30621 -5pW4 30622 -IGtheg== 30623 -dXRhbg== 30624 -IGNoYXJjb2Fs 30625 -IGFmZWN0 30626 -d3U= 30627 -IGNvbnRleHRz 30628 -IGZlYXJlZA== 30629 -IOyEpA== 30630 -IGhpc3Rvcmllcw== 30631 -IGZhcw== 30632 -ZW5zaWJsZQ== 30633 -IGNvY29h 30634 -aWxsYXI= 30635 -Z2VvbnM= 30636 -IHNwaXJpdHVhbGl0eQ== 30637 -IFBldw== 30638 -IHBoYXJtYWN5 30639 -IHBhc3Npb25z 30640 -IGJvcw== 30641 -IGFsbMOh 30642 -IHRocml2aW5n 30643 -IFJlYWN0 30644 -IG9jY3VweQ== 30645 -IHdpdGhkcmF3YWw= 30646 -IGFsbG93YW5jZQ== 30647 -IEZyYWt0aW9u 30648 -IGJ1ZGRpZXM= 30649 -IGlkbGU= 30650 -IGRpc3NvbHZlZA== 30651 -IHByZXZhbGVudA== 30652 -IG1pbGl0YXI= 30653 -IHNlbnNpbmc= 30654 -IHBvamF3 30655 -IGFuY29yYQ== 30656 -IGFidW5kYW50 30657 -IGhhaXJzdA== 30658 -44GC44KM 30659 -IHR3ZWU= 30660 -IG7DpGNoc3Rl 30661 -IE3DtmdsaWNoa2VpdA== 30662 -IGhvbw== 30663 -dWZmaWNpZW50 30664 -IGZhbnRhc3Q= 30665 -IGVkaWJsZQ== 30666 -IOuWqOyWtOw= 30667 -7JuD 30668 -IHZlaW4= 30669 -dWNjaQ== 30670 -IGRldm90aW9u 30671 -IGNvbmNlYWxlcg== 30672 -aW5jb21l 30673 -IHJlY3ljbGVk 30674 -IOyKpO2DgA== 30675 -IHBvbnRvcw== 30676 -IGRlc3N1cw== 30677 -IHbDqXJpdA== 30678 -IHJlZmxlY3Rpb25z 30679 -IEFB 30680 -IHRha2Vhd2F5 30681 -YmFyZQ== 30682 -IENvbnRhY3Q= 30683 -ZWls 30684 -IEhlYXI= 30685 -IG1pcmFj 30686 -IEdlcmlsaW0= 30687 -INGB0LDQvNGL0Lk= 30688 -IHZpdm8= 30689 -IGtpbG9ncmFtcw== 30690 -IENyaW0= 30691 -w7t0 30692 -Nzg= 30693 -IHNpbmNlcmVseQ== 30694 -cmF6 30695 -IOuztQ== 30696 -IGFycml2 30697 -IGNvbmNlcHRpb24= 30698 -IFBlcnNpYW4= 30699 -IHNqw6Rs 30700 -IHN0YXJyaW5n 30701 -IOyVhOustA== 30702 -IEZvcmV2ZXI= 30703 -0LXRgdGC0Yw= 30704 -IHZlaWw= 30705 -IHN1YnRpdA== 30706 -b2RrYQ== 30707 -INC+0YLQvdC+0Yg= 30708 -IGNvb2tz 30709 -0LXQvdGP 30710 -S2F5 30711 -IG5pw7Fvcw== 30712 -IFBob25l 30713 -IHN0aXRjaGluZw== 30714 -IGZpbmdlcnByaW50 30715 -6aKY 30716 -zrvOrA== 30717 -IGRlZGljYXRl 30718 -IExvYg== 30719 -IGJsYWNrcw== 30720 -IEJsZQ== 30721 -Ym91dA== 30722 -IMSRYW5n 30723 -IGVrcw== 30724 -IHNxdWFzaA== 30725 -IEvDvA== 30726 -b2Rp 30727 -IG7GsOG7m2M= 30728 -IHZveWFnZQ== 30729 -IHBsYXlmdWw= 30730 -INil2YTZiQ== 30731 -YW5pYw== 30732 -IGNvbmRlbW4= 30733 -IELDtnlsZQ== 30734 -IFBvbGl6ZQ== 30735 -44K/44O8 30736 -IGF5dWRh 30737 -IHBhbQ== 30738 -4LmE4Lib 30739 -IEthdGh5 30740 -0LXQtNC40L0= 30741 -0L3QvtCy0LA= 30742 -IGJyaWc= 30743 -ZWdlcg== 30744 -IGVhZ2xl 30745 -IHZpc2lvbnM= 30746 -IO2VreyDgQ== 30747 -IHNoaXR0eQ== 30748 -IGhvdHQ= 30749 -IEJyaXR0 30750 -dXRvcnM= 30751 -RU5URQ== 30752 -5puy 30753 -IHBob24= 30754 -IEJpbmc= 30755 -INC/0L7QtNC00LXRgNC2 30756 -c3ByaW5n 30757 -5pav 30758 -ZXR0ZW4= 30759 -IHBpbGdy 30760 -IGVkaXlvcg== 30761 -0LXQvdGC0Ys= 30762 -YWdnaW8= 30763 -IGp1bA== 30764 -IGNvbXByZW5k 30765 -dGVpbA== 30766 -INiy 30767 -IHBlcmZvcm1lcnM= 30768 -IGluZmFtb3Vz 30769 -IE1L 30770 -56o= 30771 -5rOB 30772 -b3RsZQ== 30773 -ZWZm 30774 -IEhhc2g= 30775 -IGNvd2FyZA== 30776 -IEJSQQ== 30777 -IERE 30778 -IGNvbWlkYQ== 30779 -IHBsYXRh 30780 -IGZsYXA= 30781 -IE1laHI= 30782 -cmlidXRpb24= 30783 -IFllbWVu 30784 -IG15c3Rlcmllcw== 30785 -IMSweWk= 30786 -IHN0ZWxs 30787 -IGV5ZWxpbmVy 30788 -IGRlbGVz 30789 -IG5haWxlZA== 30790 -IGlsbG5lc3Nlcw== 30791 -IHN0YWNrcw== 30792 -IHRyYWJhamFy 30793 -Zmxvd2Vy 30794 -Y2l1 30795 -IGNydWRl 30796 -IHN1YnN0YW50aWFsbHk= 30797 -IGhvbWVt 30798 -IG5lcGhldw== 30799 -IHN0YW1wcw== 30800 -IGNhcmJz 30801 -0YzRgtC1 30802 -bW9vdGg= 30803 -IHR1bm5lbHM= 30804 -YWNpZQ== 30805 -5rOi 30806 -IFNlw7E= 30807 -IEhlcmE= 30808 -IOyVhOuLiOyXkOyalA== 30809 -IFd5b21pbmc= 30810 -IEhETUk= 30811 -IExpcw== 30812 -dWNpw7Nu 30813 -IHN0ZWVy 30814 -0L7Rjg== 30815 -0LjRgtCw 30816 -TlQ= 30817 -IOyWvOq1tA== 30818 -IHBhbG1z 30819 -IG5lb24= 30820 -0L7QstCw0L3QuNGP 30821 -IGZpbHRlcmluZw== 30822 -IGpvdWVy 30823 -IEjDtg== 30824 -INC90LXRgQ== 30825 -6rKg7Ja07JqU 30826 -IDgx 30827 -IHN0b3J5bGluZQ== 30828 -IHByemVw 30829 -IHRoYW5raW5n 30830 -IEJvZWluZw== 30831 -IHNvZnRseQ== 30832 -amVt 30833 -0LDQu9GM0L3Ri9GF 30834 -IGZsYXNobGlnaHQ= 30835 -INC/0YM= 30836 -IFdPTUFO 30837 -4bqvYw== 30838 -w61jaA== 30839 -IGx1eHVyaW91cw== 30840 -IHfDvG4= 30841 -IGltcGFjdGZ1bA== 30842 -IGNvbnNvbg== 30843 -cmV1 30844 -aXJyaW5n 30845 -aWZ0ZXI= 30846 -IGNvbnN0aXR1ZW50cw== 30847 -6JC9 30848 -IDk0 30849 -IFRvdQ== 30850 -Z29t 30851 -IOyDneqwgeydhA== 30852 -IHN0ZXJlb3R5cGVz 30853 -IG1vxbxsaQ== 30854 -5YiG5Lqr 30855 -gqg= 30856 -IHBlbmNpbHM= 30857 -INGB0LvQvtC2 30858 -IGlocmVt 30859 -IEJlc2No 30860 -IEtvaA== 30861 -IEVudHNjaGVpZA== 30862 -IGxlaw== 30863 -IGbDtnJz 30864 -IHRvdGFsbWVudGU= 30865 -IGxpdmVseQ== 30866 -IGVudHJvcHk= 30867 -IGRpc2Nlcm4= 30868 -INCX0L3QsA== 30869 -IGRvdg== 30870 -IG15dGhvbG9neQ== 30871 -6KiY5b6X 30872 -YXBhbmVzZQ== 30873 -IGFwcHJveGltYXRl 30874 -0LDRgtC40LI= 30875 -aWZpYWJsZQ== 30876 -IFNlbw== 30877 -5YCS 30878 -tOyLrO2eiA== 30879 -IOyYtw== 30880 -IHRlbXBvcmFs 30881 -IGlU 30882 -IGVzdGF0 30883 -0LrQuNC8 30884 -IHNwcmluaw== 30885 -IGdydW5k 30886 -IGluZmFudHJ5 30887 -IHNjaGFmZmVu 30888 -57SE 30889 -IGFuaw== 30890 -cmlhZ2Vz 30891 -IFllb24= 30892 -IE1vcm9j 30893 -IGludmFzaXZl 30894 -gZQ= 30895 -IHBhcmVudGluZw== 30896 -IFJpcw== 30897 -aWJpbGU= 30898 -IG1vZHM= 30899 -5b2i 30900 -INC/0YDQvtCy0LXRgA== 30901 -IFRoaW5n 30902 -IFdoZXJldmVy 30903 -IGFja25vd2xlZGdpbmc= 30904 -IHBhd24= 30905 -dW1tZXI= 30906 -b3Ji 30907 -Njk= 30908 -IHJldHJvdXZl 30909 -IHJlbGllcw== 30910 -IEhpZ2h3YXk= 30911 -IGF3ZQ== 30912 -44Gn44GZ44GL 30913 -aXRhaXJl 30914 -IGFwcGxpY2FudA== 30915 -IGFpc2xl 30916 -d29ybQ== 30917 -IHBheWxvYWQ= 30918 -IGNhcnJl 30919 -IEJhY2g= 30920 -5qC8 30921 -IOy5nOq1rOs= 30922 -0L3QuNC1 30923 -IGl0w61z 30924 -b25uYWlzZQ== 30925 -c29s 30926 -6I+v 30927 -YWxnaWE= 30928 -IHJvY2tpbmc= 30929 -IGJlc3Rlbg== 30930 -cml0ZXM= 30931 -Xl4= 30932 -0LjQvdC+0Lk= 30933 -IGJhaXhv 30934 -IOq4sOyWtQ== 30935 -0L7RgtGA0Lg= 30936 -c2lt 30937 -IGluY2Fybg== 30938 -64uk7J2M 30939 -IGxpY2s= 30940 -c2lkZWQ= 30941 -IDcx 30942 -Zm9yZGVy 30943 -IHJlc29uYW5jZQ== 30944 -IHRlZ2Vu 30945 -IG1ldGFwaA== 30946 -b3dzZXI= 30947 -INeQ16DXl9eg15U= 30948 -P+OAjQ== 30949 -IHNwaWVsZW4= 30950 -IHZvbGxleQ== 30951 -lOydtO2BrOyXhQ== 30952 -bG9va2Vk 30953 -IHNlbnRlbmNlZA== 30954 -IG11bHRpcGx5aW5n 30955 -IGlkZWFscw== 30956 -IHdhaHJzY2hlaW5saWNo 30957 -IGRlcG9zaXRz 30958 -YmlsaXI= 30959 -IGVmZmV0 30960 -aWxsb24= 30961 -iOunjA== 30962 -IHRlc3RpbW9u 30963 -IHphd3N6ZQ== 30964 -INC/0YDQvtGG0LXRgdGB 30965 -IExhdg== 30966 -5LiN6Yyv 30967 -IHRyYXZhaWxsZXI= 30968 -IGxhaXNzZQ== 30969 -IE1vdW50YWlucw== 30970 -INGA0L7QsQ== 30971 -IGV4YW1pbmVk 30972 -aXR1cw== 30973 -V2Fz 30974 -0LvRiw== 30975 -IGF0dHJpYnV0ZWQ= 30976 -IOyKuQ== 30977 -IEJhcm9u 30978 -IGdlcA== 30979 -IGF0dGVudA== 30980 -IENvbGxlY3Rpb24= 30981 -IHRoZWF0 30982 -IENhaQ== 30983 -IHdlbGxz 30984 -IGh1bWFubw== 30985 -55eF 30986 -IEhhc3Q= 30987 -INGF0L7RgtGP 30988 -Y3phcw== 30989 -IHBlcm1pdHM= 30990 -IGxlZ2c= 30991 -IGVwbw== 30992 -IEZlbg== 30993 -IHRoaQ== 30994 -IEZvaQ== 30995 -IMOpbGVjdA== 30996 -IDgz 30997 -IG92ZXJ0aA== 30998 -IOisneisnQ== 30999 -IHRlbmFudA== 31000 -6LK3 31001 -TmV4dA== 31002 -IHByYWlzZWQ= 31003 -c2VjdXJpdHk= 31004 -IEltcGFjdA== 31005 -5Li65LuA5LmI 31006 -IHZvdWNo 31007 -IG5lZ8Oz 31008 -IHVudmU= 31009 -IGNyaXRpY2l6ZQ== 31010 -IEtlbnlh 31011 -IHRhY3RpYw== 31012 -IGxvZ3I= 31013 -IHBvaXM= 31014 -IHBhcGE= 31015 -c3BlYWtz 31016 -8J+R 31017 -aXNwZXJz 31018 -IHN1cnBsdXM= 31019 -IGNvbGRlcg== 31020 -5Y2X 31021 -5ZCs 31022 -cGxldHM= 31023 -IFZpZW5uYQ== 31024 -IExlYWQ= 31025 -IGFlcmlhbA== 31026 -IFRhaA== 31027 -0LXQvdGC0L7Qsg== 31028 -IEdyZWVrcw== 31029 -Q2Ft 31030 -IG3DoXhpbQ== 31031 -IGt1aW4= 31032 -Y2hpbw== 31033 -IGRlbW9uc3RyYXRlcw== 31034 -YW5vcw== 31035 -IENlcnQ= 31036 -INGN0L0= 31037 -IGJsb2dz 31038 -IOyEnOyauA== 31039 -IGJlYW1z 31040 -0LjQutC+0LI= 31041 -IHByb21wdGVk 31042 -IGZyaWdodGVuaW5n 31043 -IFBvcnNjaGU= 31044 -44GI44Gm 31045 -bGFyxLFuxLE= 31046 -IGNoaWxsaW5n 31047 -aXNwaGVyZQ== 31048 -IGZsYXNoaW5n 31049 -IEthcmQ= 31050 -YnJlYWQ= 31051 -IGV4aA== 31052 -IHR5Y2tlcg== 31053 -IGVjb2xvZ2ljYWw= 31054 -IE1hZQ== 31055 -INee15DXldeT 31056 -IOuCmOuPhA== 31057 -0LvQvtC9 31058 -eXNz 31059 -IHBlcmd1bnQ= 31060 -IHByaXg= 31061 -aXp6YXJk 31062 -IGNhbmNlcnM= 31063 -IDkx 31064 -c3VzcA== 31065 -IEl0ZW0= 31066 -xZ9h 31067 -IHBlc3Q= 31068 -IHRha8SF 31069 -IGx5bXBo 31070 -IFBhdHJp 31071 -ZmlsbA== 31072 -IHJlY29ubmE= 31073 -IG9wdGltaXNt 31074 -IG1pbWlj 31075 -IOyynA== 31076 -IE1hZGFtZQ== 31077 -b2N5 31078 -bGluaW5n 31079 -5ZGK6Ki0 31080 -ZXJtZQ== 31081 -IGZvbGRlcnM= 31082 -IGN6xYI= 31083 -dWNoYXI= 31084 -IGN1cnNv 31085 -IGJyZWFjaA== 31086 -0L3QuNGC0Yw= 31087 -IHBhbWnEmQ== 31088 -IGVsaWc= 31089 -IGF1dG9w 31090 -Rmxvdw== 31091 -IHByb2dyYW1tZWQ= 31092 -IFByb2Nlc3M= 31093 -IGZpZ3Vy 31094 -IFNG 31095 -IEVsZXM= 31096 -IHByb2dyYW1tZXM= 31097 -IGRpenp5 31098 -7Iuc6rCE 31099 -INC70LjQsdC+ 31100 -IHNuaWZm 31101 -IFNlYmFzdGlhbg== 31102 -IEh5ZQ== 31103 -IDQwMDA= 31104 -IHBlcm1pdGU= 31105 -5qKd 31106 -INC30LDRiQ== 31107 -IGd1aXQ= 31108 -IERhaXM= 31109 -IGFjY29yZGFuY2U= 31110 -IG1vZHVsYXI= 31111 -b2dlbmVvdXM= 31112 -5ouN 31113 -IHBvdXF1aW5obw== 31114 -IGFydGlsbGVyeQ== 31115 -IGx1YnJpYw== 31116 -IHZvbGNhbg== 31117 -IE5I 31118 -8J+k 31119 -IGRlYW4= 31120 -Umg= 31121 -IG1pbmlzdHJl 31122 -5Z2Q 31123 -IEludg== 31124 -IEJ1bGdhcg== 31125 -IERhdGVu 31126 -6I4= 31127 -SW0= 31128 -IG9yaWdpbmF0ZWQ= 31129 -IE5peG9u 31130 -aW50ZWdy 31131 -IGxhY2tz 31132 -IE5hY2h0 31133 -7Ja064KY 31134 -Y2FtZXJh 31135 -IHJhZGlzaA== 31136 -a2l5ZQ== 31137 -IGFuZ2Vz 31138 -IHByw6lm 31139 -anVr 31140 -IEJlZQ== 31141 -IEJV 31142 -INCy0L7RgdC/ 31143 -IEJU 31144 -w6ptZXM= 31145 -IFN0w7xjaw== 31146 -IEluaw== 31147 -5oiW6ICF 31148 -IFNlcmdlYW50 31149 -IE11bHRpcA== 31150 -IGhpw6diaXI= 31151 -INCh0LDQvA== 31152 -IETDqQ== 31153 -b2xwaA== 31154 -7Ja4 31155 -IGltcGF0 31156 -IOyViuqzoA== 31157 -INGC0LDQutC+0LPQvg== 31158 -INC90LDQstC10YDQvdC+0LU= 31159 -IHVucHJlZGljdGFibGU= 31160 -IG1lbmQ= 31161 -IOyXhuyWtOyalA== 31162 -IGpha2llxZs= 31163 -IGFubmk= 31164 -IGRvbm7DqQ== 31165 -IEtpcnN0eQ== 31166 -IHJlY3Rhbmd1bGFy 31167 -IGVtcGV6YXI= 31168 -IEV4Y2hhbmdl 31169 -6rCU 31170 -IMOpY29ub20= 31171 -44GT44KT 31172 -ZWxpbg== 31173 -cmVpYnQ= 31174 -INeU16Q= 31175 -IGNlbWV0ZXJ5 31176 -IGVzcGHDsW9s 31177 -b2xpbg== 31178 -0LvRjtC0 31179 -IGdyw6JjZQ== 31180 -YWxsZW4= 31181 -IFBoaWxvcw== 31182 -IEVyc3Q= 31183 -IOyDiA== 31184 -IFZpZA== 31185 -R2l2ZQ== 31186 -T0g= 31187 -zrzOvw== 31188 -IFBhcmU= 31189 -IG1ldGFib2xpc20= 31190 -IG1hcGxl 31191 -IGF4bGU= 31192 -IER5 31193 -IGtvbW1l 31194 -z47OvQ== 31195 -IGdyZWF0bmVzcw== 31196 -IHZlcmlmaWVk 31197 -IHNww6k= 31198 -IEZhaHJlbmhlaXQ= 31199 -IEJyZW4= 31200 -IENvbmZlZGVy 31201 -IGhpc3RvaXJl 31202 -IGVsaW1pbmF0aW5n 31203 -IEFkZGluZw== 31204 -IEFiaQ== 31205 -5p2O 31206 -IGhvc3BpdGFsaXR5 31207 -dGlt 31208 -IGJvbml0bw== 31209 -IHBhcnRlcw== 31210 -INC00YDRg9Cz0LjRhQ== 31211 -IFNoYXk= 31212 -IFNlZA== 31213 -IHJlZ3JldHM= 31214 -0Y/QvNC4 31215 -IHRlbmFudHM= 31216 -6YCf 31217 -IFBUUw== 31218 -IGRldmk= 31219 -IExhdGU= 31220 -dWV6 31221 -IHPDtnls 31222 -44K7 31223 -IOyerOuwjA== 31224 -IHRvZ2dsZQ== 31225 -IG1hc2tpbmc= 31226 -0LDQu9GM0L3QvtCz0L4= 31227 -IHBlcnPDtm4= 31228 -IGFtZXJpY2Fu 31229 -Zmlr 31230 -IFJHQg== 31231 -ZW5zb24= 31232 -IEtB 31233 -d3d3dw== 31234 -INGA0LXQsw== 31235 -bWV0aWNz 31236 -IGVkdWNhdG9y 31237 -44K344Or44Kv 31238 -cGFyaw== 31239 -0LXQu9GM0LfRjw== 31240 -YXJ1cw== 31241 -0YDQtdGC 31242 -IGZlaXRv 31243 -IGNob2ly 31244 -IGxhcmdv 31245 -IGVlbnM= 31246 -IHdhdHRz 31247 -IFNpbmdsZQ== 31248 -IHN1c2NlcHRpYmxl 31249 -aWNlcg== 31250 -INCy0LrQu9GO0Yc= 31251 -IHB1cw== 31252 -7ZmY 31253 -RW5n 31254 -IGZhbnRhcw== 31255 -IHNwZWNpZmljYXRpb24= 31256 -IGNvbmZyb250ZWQ= 31257 -IENvbHVtYnVz 31258 -0LjQstC10YI= 31259 -YXLEsW0= 31260 -IGNhZmZlaW5l 31261 -bXVuaXRpb24= 31262 -IG1pZ3JhbnRz 31263 -bGlkZQ== 31264 -aXRhdGlvbnM= 31265 -IEdlbWU= 31266 -4bqr 31267 -IHBsYW5uZXI= 31268 -IHN0aW11bGF0ZQ== 31269 -IGFwcm94aW0= 31270 -Y2V1 31271 -IE5vbQ== 31272 -IHZvZw== 31273 -INGA0LDRgdGC 31274 -IGVuc2XDsQ== 31275 -IHNlbGxlcnM= 31276 -IGd1dGVu 31277 -emQ= 31278 -Q2Fs 31279 -IGRlc2NyaXB0 31280 -IHJlY29uY2lsaWF0aW9u 31281 -emluaG8= 31282 -4bmHYQ== 31283 -44GY44KD44GC 31284 -YWN5ag== 31285 -IENPTA== 31286 -c2F3 31287 -IO2ZleyduA== 31288 -IHZhcml0 31289 -IHBhcnRuZXJpbmc= 31290 -IGRldGVudGlvbg== 31291 -IGJvbWJpbmc= 31292 -Y2xhcHBpbmc= 31293 -aWVuY2llcw== 31294 -b25kdQ== 31295 -QU1F 31296 -IOqwmeyKteuLiOuLpA== 31297 -Y8OtYQ== 31298 -INC/0L7RgdGC0L4= 31299 -IEFTTVI= 31300 -IGhvbWVwYWdl 31301 -IHNpw6g= 31302 -YW50aGE= 31303 -IFBvbGw= 31304 -IGlnZW4= 31305 -Y3ljaA== 31306 -IOqwkeyekOq4sA== 31307 -IGNvbnNpZGVyYWJseQ== 31308 -5LuW55qE 31309 -IEFyaXN0 31310 -IHdpdGhzdGFuZA== 31311 -IHF1YWxpdGF0aXZl 31312 -IEtyYWZ0 31313 -INGN0LvQtdC60YI= 31314 -IEJlYWQ= 31315 -0LXQutGC0LjQsg== 31316 -IGNydXNoaW5n 31317 -7LOQ 31318 -IG5hdnk= 31319 -2Yjaug== 31320 -c2hv 31321 -IG9haw== 31322 -aXBwZXJz 31323 -IHNvaWxz 31324 -IHBpZ21lbnQ= 31325 -IGV2aXRhcg== 31326 -44OH 31327 -IGZ1c2U= 31328 -IERhbGU= 31329 -OiI= 31330 -IGNvbXBsw6h0ZW1lbnQ= 31331 -IGtlbA== 31332 -4LmG 31333 -IHF1YXRyZQ== 31334 -IFVN 31335 -IOunkOs= 31336 -5qC5 31337 -w61y 31338 -IGxlaXN1cmU= 31339 -IEhvdXNpbmc= 31340 -IGZvbGRz 31341 -ZXN0aW9u 31342 -QVJT 31343 -IG1hc2g= 31344 -dXJwb3Nl 31345 -IGFjY3VtdWxhdGVk 31346 -IFN0dWZm 31347 -6Kqe 31348 -IHRhcGVz 31349 -INGB0LjQu9GM0L3Qvg== 31350 -IExPVkU= 31351 -IDE5ODI= 31352 -IHNjYXJz 31353 -IGNhcGl0YWxpc3Q= 31354 -IE5lZA== 31355 -IHNvZnRlbg== 31356 -IG5vdGFibHk= 31357 -IGZvcmPDqW1lbnQ= 31358 -IFJhdW0= 31359 -INC90LXQvtCx0YXQvtC0 31360 -IHRyYWRlbWFyaw== 31361 -IGZlcnRpZw== 31362 -ID8h 31363 -5peg 31364 -IHJlaW5mb3JjZWQ= 31365 -IHJlY2hhcmdl 31366 -IFB1dHRpbmc= 31367 -IHZpbGxhaW5z 31368 -IGhhbmRpYw== 31369 -IGFkdmVydGlzZW1lbnQ= 31370 -2KrZig== 31371 -INGB0YPQvA== 31372 -IFJpbGV5 31373 -15XXkdc= 31374 -5Lqs 31375 -T3M= 31376 -2KfYsg== 31377 -Qm95 31378 -IHNxdWlzaA== 31379 -b2NrZXQ= 31380 -IHRlc3RpZnk= 31381 -5ryU 31382 -INec157X 31383 -INC80LDRgdGB 31384 -bWFudWVs 31385 -IEFya2Fuc2Fz 31386 -aWZmZQ== 31387 -IGFuYWx5c3Rz 31388 -IERlYWY= 31389 -IGrDsw== 31390 -IGdyb2Nlcmllcw== 31391 -IFdoZWVs 31392 -INGA0LjRgQ== 31393 -IGPDsm4= 31394 -IENvYg== 31395 -IHByaXNvbnM= 31396 -w6h2ZQ== 31397 -IENhYmluZXQ= 31398 -IHBvc2Vk 31399 -IGd1ZXJyZQ== 31400 -IExsb3lk 31401 -IGNsZXJr 31402 -IGNyaXNlcw== 31403 -IFNobw== 31404 -IE9yZQ== 31405 -IEZvb3RiYWxs 31406 -IEFkdmlz 31407 -IFpoZW5n 31408 -6I0= 31409 -IEFNWQ== 31410 -IHVuZm9y 31411 -IG1vbmFzdGVy 31412 -IGNvbXBpbGU= 31413 -IGltbW9ydGFs 31414 -YXRhYmxl 31415 -IHBhcmFubw== 31416 -IHRpdmVy 31417 -IFN0ZXBo 31418 -IEZ1w58= 31419 -IGRpc2NvbnRpbg== 31420 -IHJpcGU= 31421 -IGhhY2tpbmc= 31422 -IHNpZW5kbw== 31423 -IHNlZ3Vybw== 31424 -YWx0cmVz 31425 -IGFuZGVyZXM= 31426 -IOumrOs= 31427 -IGV4cG9ydHM= 31428 -5q2l 31429 -IHRhYmlp 31430 -IOq4sOuLpOs= 31431 -IGJvdGhlcmluZw== 31432 -IHBpY2tsZQ== 31433 -IEJSSUFO 31434 -IGFsdGFy 31435 -INC/0YDQuNCx 31436 -IHRyYW5zZmVycmluZw== 31437 -IFZvcnM= 31438 -INmH2Yg= 31439 -IFph 31440 -IEZyYW5jZXM= 31441 -IGJyb3dzZQ== 31442 -ZW1pdA== 31443 -IGNoZXdpbmc= 31444 -IEZyZWRkeQ== 31445 -IGVkaXRvcnM= 31446 -w6RsbGU= 31447 -IO2MgA== 31448 -IFNxdWU= 31449 -IEN1bHR1cmFs 31450 -YXdr 31451 -IFNhY2hl 31452 -IENhcmJvbg== 31453 -4bqvdA== 31454 -Rkw= 31455 -IE5HTw== 31456 -cGXFgg== 31457 -IFNvdQ== 31458 -IGh2b3I= 31459 -dW5pbnRlbGxpZ2libGU= 31460 -IOuylQ== 31461 -IMKw 31462 -aWlu 31463 -INei150= 31464 -IGRlcnJpw6hyZQ== 31465 -IGN6eW0= 31466 -IEFwb3N0 31467 -IHJlZ2FyZGVy 31468 -IGFncmFkZQ== 31469 -IENhbmR5 31470 -IG1hcmU= 31471 -IGludHJvZHVjZXM= 31472 -YmlyZHM= 31473 -IHVuaXF1ZWx5 31474 -IG11aw== 31475 -IGNvb2tlcg== 31476 -IGNyZXdz 31477 -IGplaXRv 31478 -RVJU 31479 -toTr 31480 -bmlzc2U= 31481 -IGVm 31482 -IGNhcnRl 31483 -IFlhaw== 31484 -IFBBVA== 31485 -0LjQvdC+ 31486 -Ym9ra2k= 31487 -IG1hdGVz 31488 -IGRpc3RpbnQ= 31489 -IOy9lOuhnOuCmA== 31490 -IHnEsWw= 31491 -IM66zqzOvQ== 31492 -IGNvbmZpZ3VyYXRpb25z 31493 -ZW5nYQ== 31494 -cmVjaHQ= 31495 -SGFwcHk= 31496 -44KE44Gj44Gm 31497 -aW52ZXN0 31498 -IHJlY29uc3RydWN0 31499 -INGN0YLQvtC80YM= 31500 -IG1vc3F1ZQ== 31501 -cmF1bQ== 31502 -IHZveWV6 31503 -IE5CQw== 31504 -IOyekOyLoA== 31505 -IHN0dXJkeQ== 31506 -INC60LDQvw== 31507 -IGFuc2No 31508 -YWxpZA== 31509 -IG1hc2lo 31510 -IFJFUA== 31511 -IOy9lOs= 31512 -IGRlZHVjdA== 31513 -IHNhbGly 31514 -d3VyZg== 31515 -aWxvdA== 31516 -IE11dHRlcg== 31517 -b2xkcw== 31518 -IEZFTUE= 31519 -IEJpYg== 31520 -IG5laWdoYm9yaW5n 31521 -IGJsaXNz 31522 -IO2YvA== 31523 -0LvQuNGB0Yw= 31524 -INGC0YDQtdCx 31525 -IOWwseaYrw== 31526 -IGdyZW5hZGU= 31527 -IGVnYWw= 31528 -IGZpbmVseQ== 31529 -IHBldGFscw== 31530 -IGtlZXI= 31531 -IGNoeWJh 31532 -IHNraXBwaW5n 31533 -IHRoaXJ0ZWVu 31534 -IGdyYXZ5 31535 -IFNBVA== 31536 -NjE= 31537 -INC90L7Qsw== 31538 -IG1pbnM= 31539 -SVRF 31540 -IHNvemlhbA== 31541 -7ZWY66m07ISc 31542 -cnVrdHVy 31543 -INCy0L7Qt9C80L7Qtg== 31544 -INC+0L/Rj9GC0Yw= 31545 -IGFydGg= 31546 -IEN1YmFu 31547 -IHRyZWFzdXJlcw== 31548 -IGZlcnRpbGl6ZXI= 31549 -IGF3YWtlbmluZw== 31550 -IOuwseyLoA== 31551 -IHJhbGw= 31552 -IGRlcGljdA== 31553 -IFBhYmxv 31554 -IG5pbmV0ZWVu 31555 -IHdhdHQ= 31556 -IGVudGlyZXR5 31557 -S1M= 31558 -IFdvb2Rz 31559 -U2No 31560 -INqp2Yg= 31561 -IERyeQ== 31562 -44Ge 31563 -dXZl 31564 -IHJlY29uc3RydWN0aW9u 31565 -IGFuYXRvbXk= 31566 -iOulvA== 31567 -IGJhYmE= 31568 -IGxpc3RlbmVy 31569 -IHNoYXJwZW4= 31570 -IFBlcnU= 31571 -INCy0YvQtw== 31572 -IHJlY3JlYXRpb24= 31573 -IGluaXRpYXRl 31574 -IGNhbG9y 31575 -IE5hag== 31576 -Z2Vl 31577 -IEZlZWxz 31578 -IFNuYXBjaGF0 31579 -IFRldA== 31580 -IE5lc3Q= 31581 -IERhZg== 31582 -IEZpbmlzaA== 31583 -INGC0LDQutC40Lw= 31584 -w7pj 31585 -aXplbnM= 31586 -IHNwaW5z 31587 -IGVtYnJ5 31588 -IHBhc3NhZ2Vz 31589 -IGNpZW50 31590 -IGp1c3RpZmljYXRpb24= 31591 -5LuW6Kqq 31592 -IG9sbWF6 31593 -IGZsb29kZWQ= 31594 -IGVtb2pp 31595 -IGVtYnJhY2luZw== 31596 -IGRpc2NhcmQ= 31597 -IEJhc2lj 31598 -YWdvZw== 31599 -IOychO2VtA== 31600 -IGFzeWx1bQ== 31601 -ZXJpbg== 31602 -IGZpbQ== 31603 -IG5pbmph 31604 -IGF1dG9tYXRl 31605 -IGFsbGVyZ2lj 31606 -w7/Dv8O/w78= 31607 -YW1hbQ== 31608 -INC80LDRgA== 31609 -IE9p 31610 -w6R1cw== 31611 -IGluZHVjdA== 31612 -IEJFTg== 31613 -IHrFgg== 31614 -IGthxbxkeQ== 31615 -IEFNUA== 31616 -bsSb 31617 -U3VyZQ== 31618 -IHF1aWw= 31619 -IGVzcGVj 31620 -cm9r 31621 -QlNDUkk= 31622 -IGxpZWJl 31623 -cHVz 31624 -YWNoc2Vu 31625 -IGNyaWNrZXQ= 31626 -64qQ 31627 -IEZyYW1l 31628 -ZWtrw7xy 31629 -YXJi 31630 -IHDFmQ== 31631 -0LjRgdGB 31632 -IHplZ2dlbg== 31633 -IGRvdWJsZXM= 31634 -IERyZQ== 31635 -dGVzdA== 31636 -aW5zcA== 31637 -Ym95cw== 31638 -IG3Do28= 31639 -IFZlcnNl 31640 -IG11c2N1bGFy 31641 -IE1BTEU= 31642 -IGR1bHU= 31643 -IG9jY2FzaW9uYWw= 31644 -TG8= 31645 -Y29ub21pYw== 31646 -IHZhaw== 31647 -IHJlbWVkeQ== 31648 -5aSg 31649 -IOKZquKZquKZqg== 31650 -dmVt 31651 -IMO2bmVt 31652 -IGthcsWfxLE= 31653 -IFNoYXJw 31654 -aHVy 31655 -IOuwqeuylQ== 31656 -IGdyYW5kc29u 31657 -IGFrdGl2 31658 -IFRocm9uZXM= 31659 -IOyViOyXkA== 31660 -IHRvdHM= 31661 -IHN1YmQ= 31662 -IFBhdWxh 31663 -IGdyYXZlcw== 31664 -IEJyZW50 31665 -INC90LjQutGC0L4= 31666 -IHPDtno= 31667 -IGNyZWM= 31668 -IFZsYWRpbWly 31669 -55ar 31670 -INC/0L7QuQ== 31671 -ICIt 31672 -IHBzeQ== 31673 -YXRyaQ== 31674 -aWRhbg== 31675 -IGHDum4= 31676 -IHN0YW5kYXJkaXplZA== 31677 -7LmY6w== 31678 -INC60YDQvtCy 31679 -IFpodQ== 31680 -c29tZXRoaW5n 31681 -IDc1MA== 31682 -IG11amVyZXM= 31683 -IGFpdA== 31684 -6Ze0 31685 -YWd1 31686 -IGNvcnJlY3RlZA== 31687 -aWtrYQ== 31688 -ZWxlZA== 31689 -IENhcmVlcg== 31690 -b3d5bQ== 31691 -IHJvb21tYXRl 31692 -IGRlc2NlbmRhbnRz 31693 -IE5hcG9sZW9u 31694 -INCU0L4= 31695 -7ZaI7Ja07JqU 31696 -IGJ1bnVu 31697 -IE1pY2hh 31698 -57ea 31699 -IGRlc2NvYg== 31700 -UEk= 31701 -IHBhbGFicmE= 31702 -IHRyYWNrZWQ= 31703 -IGRlcGVuZGVuY2U= 31704 -IEJhcmFjaw== 31705 -5YGH 31706 -IGZlcnRpbGl0eQ== 31707 -IFNvdXRod2VzdA== 31708 -IGluY29tcGxldGU= 31709 -IGNvbXVuaWM= 31710 -IGNvbXByaXM= 31711 -IFJlc3RhdXI= 31712 -IGFjcm9u 31713 -zrrOsQ== 31714 -IGFwcHJlbnRpY2Vz 31715 -IG11c3N0 31716 -IEFicg== 31717 -IHBlbnRydQ== 31718 -IENvbnNvcnQ= 31719 -IEF2ZWM= 31720 -IGR1bXBsaW5ncw== 31721 -TFI= 31722 -IHdzenlzdGtpZQ== 31723 -IHN3YW1w 31724 -0L3QtdCy 31725 -dWdnbGU= 31726 -IHdhdGVyY29sb3I= 31727 -IHByb3Rvbg== 31728 -IEVzcGHDsWE= 31729 -b2NraW5n 31730 -0L7QstCw0Ls= 31731 -IHRha2lt 31732 -VmVyeQ== 31733 -IGRlbWVudGlh 31734 -IMWfZXlp 31735 -SmFj 31736 -IE1hY0Jvb2s= 31737 -IExpdg== 31738 -ZmZpY2llbnRz 31739 -IEh1bnQ= 31740 -IG92ZXJsYXk= 31741 -5oSf6Ka6 31742 -IFNreXBl 31743 -cHVua3Q= 31744 -IGNvbmZpbmVk 31745 -IEFkcmlhbg== 31746 -2LHZgw== 31747 -IEplZXA= 31748 -IGVucXVhbnRv 31749 -IGFuZXN0 31750 -0L7RgtCy0LXRgg== 31751 -INC80LXQvdGM 31752 -IGlycmlnYXRpb24= 31753 -4buRbg== 31754 -IGVpZ2h0ZWVu 31755 -IFBvbg== 31756 -IHJlc2N1ZWQ= 31757 -IDE5ODM= 31758 -csO8 31759 -amFl 31760 -IEplb25n 31761 -IGFtYXppbmdseQ== 31762 -IEZEUA== 31763 -IGJhY2tzdGFnZQ== 31764 -Y3Vl 31765 -IM+Dz4TOt869 31766 -INin2YTYtQ== 31767 -IGxpdmVzdG9jaw== 31768 -IFdhcm5lcg== 31769 -IG1ham9ycw== 31770 -44OB44Oj 31771 -IGNvb3BlcmF0aXZl 31772 -IEJyYWR5 31773 -cmFpbmVk 31774 -cmllYg== 31775 -INeR157X 31776 -INC00L7QstC+0LvRjNC90L4= 31777 -IEZF 31778 -IGxlYWtlZA== 31779 -IE1lcmN1cnk= 31780 -IHBlcnN1YWRl 31781 -IHRyYW5zZm9ybWVy 31782 -IE5vcndlZw== 31783 -IOyXrOufrA== 31784 -IHpyb2JpxIc= 31785 -IGNhcmRpb3Zhc2N1bGFy 31786 -IENyYXNo 31787 -IGdvc3NpcA== 31788 -0LDRgdGC0Yw= 31789 -IOyqvQ== 31790 -IHN3ZXB0 31791 -IEhvcm4= 31792 -IEF0w6k= 31793 -IGJ1a2Fu 31794 -IEthdw== 31795 -S1k= 31796 -IFN0b3JpZXM= 31797 -R2FyeQ== 31798 -IGdhcmRlbmluZw== 31799 -IFF1aWNrbHk= 31800 -IEZhbGNvbg== 31801 -IG92YXQ= 31802 -Y8Sx 31803 -IENvbXBsZXQ= 31804 -IERhdGU= 31805 -INC/0YDQuNC8 31806 -IGzDpHVmdA== 31807 -IEF1ZHJleQ== 31808 -IFdlbnQ= 31809 -IHBlbMOtY3Vs 31810 -IGNhcnJpYWdl 31811 -IHVuYWNjZXB0YWJsZQ== 31812 -bnltaQ== 31813 -INGB0LvRi9GI 31814 -IHRlcnJl 31815 -dWVsbGVtZW50 31816 -RUVFRQ== 31817 -IHBoYXJtYWM= 31818 -aMO1ZXM= 31819 -IHppY2g= 31820 -IG1pZ3JhdGU= 31821 -IEZyeQ== 31822 -w7FhbmE= 31823 -IE11aXRv 31824 -RU9WRVI= 31825 -IGZvcnRyZXNz 31826 -IENvbXBhbg== 31827 -IEpTT04= 31828 -b3JkbnVuZw== 31829 -IHdhcnRv 31830 -IHVuZ2Vm 31831 -7IWU7ISc 31832 -INGA0L7Qug== 31833 -IHBhZGRsZQ== 31834 -SmFyZWQ= 31835 -IHN1Ym1pdHRpbmc= 31836 -IGxhdGNo 31837 -IGZ1Zw== 31838 -INC60L7RgQ== 31839 -IEVm 31840 -IGxhdW5jaGVz 31841 -IGZ0 31842 -b3RlY2hu 31843 -IHRyYXZlbGxlZA== 31844 -2KfZgQ== 31845 -6YGV 31846 -IHByb2No 31847 -IGRlZGlt 31848 -ODM= 31849 -IHJlYm91bmQ= 31850 -IExV 31851 -cGF0aA== 31852 -INGB0L/RgNCw0LI= 31853 -IMO2bA== 31854 -IO2CpA== 31855 -IHByaXZhdA== 31856 -IHRyYWN0b3I= 31857 -IEF0dGVudGlvbg== 31858 -U2Vy 31859 -IGNvc2Vz 31860 -w6FyaWE= 31861 -cGFs 31862 -IOydgA== 31863 -IHN1Y2Nlc3Nvcg== 31864 -IGNvbm5lY3RvcnM= 31865 -INGD0YHRgtCw0L3QvtCy 31866 -IGdlbm9jaWRl 31867 -IHN1ZmZpY2llbnRseQ== 31868 -IEFpeMOy 31869 -IHN0YWJpbGl6ZQ== 31870 -IGNvbmdlc3Q= 31871 -IGNhcnZpbmc= 31872 -IHpvc3Q= 31873 -INCx0YvRgdGC0YDQvg== 31874 -IHNob3J0ZXN0 31875 -IGxpdmVs 31876 -IDg5 31877 -6YGK 31878 -IGVyaw== 31879 -IHBvcnRyYWl0cw== 31880 -4KWA 31881 -6Jg= 31882 -Ym9hdA== 31883 -bGxhaA== 31884 -QU5D 31885 -IGVtcGlyaWNhbA== 31886 -IEVjaG8= 31887 -IE5lZGVybGFuZA== 31888 -6L+Z5LmI 31889 -TmV0 31890 -IGN1aWRhZG8= 31891 -IFJvbWE= 31892 -IGNhbGY= 31893 -IGdpYW50cw== 31894 -IEV4cGxvcmVy 31895 -IENvbGxlY3Q= 31896 -YWxpdGlvbg== 31897 -IERlc3Rpbnk= 31898 -IGF1c2dl 31899 -IEVkdQ== 31900 -IENsbw== 31901 -IGVhcnJpbmdz 31902 -IFRyYWNr 31903 -IFJPUw== 31904 -IEJlbGxl 31905 -55m+ 31906 -IHB1ZWRh 31907 -IGRheXRpbWU= 31908 -IHN1cHBsaWVy 31909 -IFNW 31910 -IEV4aGFsZQ== 31911 -IGdhbGVyYQ== 31912 -Y291cnNl 31913 -IGNlbnRpbWV0ZXI= 31914 -IEJhc3Q= 31915 -bXVk 31916 -IHNhbmdhdA== 31917 -IFBoeXNpY2Fs 31918 -IHByaXZhdGVseQ== 31919 -IHRyYXRh 31920 -bHlubg== 31921 -aWxsaQ== 31922 -IOuplOydtO2BrOyXhQ== 31923 -IGNyeXN0YWxs 31924 -IHBvZHM= 31925 -4bqjbg== 31926 -aW5hdG9y 31927 -IFJlY29yZHM= 31928 -5a6Y 31929 -xJ9pbWl6 31930 -aXNzZW1lbnQ= 31931 -aGFyZQ== 31932 -aGFkb3c= 31933 -IERL 31934 -IOyVjOqzoA== 31935 -IHd5bg== 31936 -IHJlcXVlc3Rpbmc= 31937 -IERvbm5h 31938 -IOyXtOyLrO2eiA== 31939 -aW5lYQ== 31940 -IGV4ZXJ0 31941 -IER1bmNhbg== 31942 -INCy0LXRhw== 31943 -IEhhaA== 31944 -4KSC 31945 -IExpZg== 31946 -IEZpbmRpbmc= 31947 -IE5vdg== 31948 -INC30L3QsNC6 31949 -INC+0YQ= 31950 -IFF1w6g= 31951 -IHF1YXJ0ZXJiYWNr 31952 -INGE0LDQug== 31953 -IGJpcGFydGlzYW4= 31954 -xJ9pbg== 31955 -IG7DqWNlc3M= 31956 -IHJlZmVyZW5kdW0= 31957 -IGNvbXBpbGVy 31958 -IHByb2JhYmls 31959 -0LXQtNC4 31960 -IHRyYWRlcg== 31961 -5piT 31962 -IFJ1bQ== 31963 -Z2VtZQ== 31964 -IGRpbw== 31965 -IGLEmWR6aWVteQ== 31966 -IM+Azqw= 31967 -6r64 31968 -15XXmA== 31969 -IOCklQ== 31970 -INCx0LvQsNCz 31971 -IHNjYWxw 31972 -IFBhdXNl 31973 -IGNhcHRpb24= 31974 -IGVuZGFuZ2Vy 31975 -IGVubGFy 31976 -IHJvdHRlbg== 31977 -44OD44OI 31978 -IHdhaA== 31979 -6IKJ 31980 -IGR6aQ== 31981 -IEluc3RhbGw= 31982 -QXk= 31983 -IGNyZWFy 31984 -0LXQvdGC0LA= 31985 -IHdlaWdoaW5n 31986 -IGJ1dHRlcmZsaWVz 31987 -IEdhc3Q= 31988 -5LqV 31989 -aG9ybg== 31990 -d2Fyeg== 31991 -SUNFT1ZFUg== 31992 -INC90LDQudGC0Lg= 31993 -IGNvZWZmaWNpZW50cw== 31994 -57Ch5Zau 31995 -IFNwZW5jZXI= 31996 -IEhpZ2hlcg== 31997 -IGNvd29yaw== 31998 -5aiY 31999 -INC60L7RgtC+0YDQvtC1 32000 -IG1vbml0 32001 -IGR5c2Z1bmN0aW9u 32002 -INGB0YLQsNC90L7Qsg== 32003 -IHRvdXJuYW1lbnRz 32004 -IG95c3Rlcg== 32005 -Qk4= 32006 -IHRydWQ= 32007 -c2xvdw== 32008 -IFBlbm55 32009 -IE9keXM= 32010 -w6Zy 32011 -IGZvdQ== 32012 -IGVuam95bWVudA== 32013 -0LDRgtGL 32014 -IHd5Z2zEhWRh 32015 -0LDQu9GM0L3QsNGP 32016 -IFByb3RlY3Q= 32017 -IG1veQ== 32018 -IGNsYXc= 32019 -IHN1c3BpY2lvbg== 32020 -IHNhY3JpZmljZWQ= 32021 -IGdvc3Rv 32022 -Qmln 32023 -IGFnZ3Jlc3NpdmVseQ== 32024 -IHZvcm5l 32025 -44Og 32026 -IGJsYW1lZA== 32027 -IFNlaHI= 32028 -16TXqA== 32029 -Y2l0bw== 32030 -IHNlYWxz 32031 -IG11amVy 32032 -IFdlaXJk 32033 -IGZvcmVucw== 32034 -IGNvbnRyaWJ1dGVz 32035 -ZXN0cmE= 32036 -IHBvZw== 32037 -TE9M 32038 -IGhhY2VybG8= 32039 -0L7RgtGM 32040 -ZmljdGlvbg== 32041 -Nzk= 32042 -zrvOvw== 32043 -5aSn5qaC 32044 -5aOw 32045 -INGC0L7QsQ== 32046 -IEdT 32047 -IENsYXJh 32048 -aXRleg== 32049 -IGFkdm9jYXRpbmc= 32050 -IO2UhOs= 32051 -c3VuZw== 32052 -IHZlcnRpY2Vz 32053 -IG5hdmlnYXRpbmc= 32054 -IGV1cm9ww6k= 32055 -55qG 32056 -IHNsb3dlZA== 32057 -IGZvcmVncm91bmQ= 32058 -IEluZHVzdHJpYWw= 32059 -IGFkb3Jl 32060 -7Iut 32061 -IGNyw6llcg== 32062 -5p6X 32063 -Y2huaXR0 32064 -IHVuYXdhcmU= 32065 -IGN1cmx5 32066 -ZW50YXI= 32067 -IGxlcg== 32068 -IHByb2hpYml0ZWQ= 32069 -IEhlcm9lcw== 32070 -IFJlZWQ= 32071 -dWNh 32072 -IHNtb2s= 32073 -IGt1bm5h 32074 -emVpdGln 32075 -aW1tZW4= 32076 -IEx1bg== 32077 -INCw0LHRgdC+0LvRjtGC 32078 -IGRlZ2xp 32079 -IHZpbGxhZ2Vycw== 32080 -IHByZXNldA== 32081 -emVwdA== 32082 -dWRz 32083 -IGVtaXQ= 32084 -5L2g6KaB 32085 -IOuJ 32086 -64qU7KeA 32087 -0L3QsNC60L4= 32088 -IG9zw7Ni 32089 -IDE5Njk= 32090 -INCQ0YA= 32091 -IG1hbmNobWFs 32092 -IEJyb2Nr 32093 -IG1hbnRyYQ== 32094 -IFdJTA== 32095 -YmFjaA== 32096 -aW7DpA== 32097 -ZWxhcw== 32098 -a2Vsbg== 32099 -IGRpc2NpcGxl 32100 -IHF1YWxj 32101 -IGRlaHlk 32102 -7J20652864qU 32103 -QWY= 32104 -7ISx7J20 32105 -Unlhbg== 32106 -IHB1cHBldA== 32107 -INC00YDRg9Cz0LjQtQ== 32108 -IHJ1ZA== 32109 -IHBlbmRpbmc= 32110 -UGx1cw== 32111 -IOyViuydhA== 32112 -IGLhu4s= 32113 -IFNlZ2E= 32114 -w6dl 32115 -IHByb2dyYW1tZXI= 32116 -Ymxp 32117 -IHVubA== 32118 -IGVuc2xhdmVk 32119 -IHNvY2nDqXTDqQ== 32120 -xIFo 32121 -IGluaGVyaXRhbmNl 32122 -IEJhbmds 32123 -ZXJtYWlk 32124 -IHByYWN0aXRpb25lcg== 32125 -IFN0YWxpbg== 32126 -IFVzZXI= 32127 -Y2libGU= 32128 -IGNhcmRpYWM= 32129 -IEtvcmVhbnM= 32130 -IGR1bXBlZA== 32131 -INeU15nXlA== 32132 -w6Fpcw== 32133 -IGh5ZHJhdWxpYw== 32134 -b3VidGVkbHk= 32135 -IFBpdA== 32136 -IHBpY25pYw== 32137 -IGJlaMO2dmVy 32138 -INGB0LzQvtCz 32139 -IGJyYWtpbmc= 32140 -6buR 32141 -dXRhcg== 32142 -IOyEuOs= 32143 -dWJs 32144 -IMO8eg== 32145 -IG1hamVzdHk= 32146 -IGJlcnM= 32147 -dXRhYmxl 32148 -IGhvdHRlcg== 32149 -54Wn 32150 -24zZhg== 32151 -IGJpYXNlcw== 32152 -IHN1YmplY3RlZA== 32153 -IG5hdWdodHk= 32154 -IGNpcmN1cw== 32155 -44GX44GL 32156 -IEltbWVkaQ== 32157 -IFN0ZWZhbg== 32158 -IFRyaXBsZQ== 32159 -ZW5r 32160 -IHdpdA== 32161 -IHJlY3ljbGU= 32162 -ZW1pZQ== 32163 -ZGF0ZWQ= 32164 -IHVubG9hZA== 32165 -IHBvcHVsYQ== 32166 -Y2hpbg== 32167 -IHlpZWxkcw== 32168 -IGVuZ2xpc2g= 32169 -IEJvbm5pZQ== 32170 -IHNwaWRlcnM= 32171 -w4E= 32172 -IGVyb3Npb24= 32173 -6YOo5YiG 32174 -IE5JQ0s= 32175 -0LjRj9GF 32176 -IGltcGFydA== 32177 -INC60L3QuA== 32178 -IHJlc29sdXRpb25z 32179 -IGxpdGhpdW0= 32180 -IGNvbnZlcmdlbmNl 32181 -IFRhcmE= 32182 -INC00LLQtQ== 32183 -dGhz 32184 -IENpbmR5 32185 -5oiR6KaB 32186 -5bmr 32187 -IERJRQ== 32188 -IGFzc3VyYW5jZQ== 32189 -INC+0L/QuNGB 32190 -IGJ1Y2tldHM= 32191 -IGN1ZXM= 32192 -IFF1aWV0 32193 -IHNpbWlsYXJpdHk= 32194 -IGZvdW5kYXRpb25hbA== 32195 -IE1pbmlzdA== 32196 -5ru/ 32197 -IHBpYW4= 32198 -IGNlbnRy 32199 -IG51bWI= 32200 -IG1vbmtz 32201 -dWpvdXJk 32202 -ZW56aWU= 32203 -IHNrYXRlYm9hcmQ= 32204 -IGRsYXRlZ28= 32205 -INGB0L7Rgg== 32206 -IEFF 32207 -IG1hc3RlcnBpZWNl 32208 -IFNvbG9tb24= 32209 -IFJlZGRpdA== 32210 -IHJpb3Q= 32211 -YWJs 32212 -IEpheno= 32213 -IGVsZWN0cm9tYWduZXRpYw== 32214 -IGluc2VjdXJl 32215 -IENvbXBldA== 32216 -Z2VyaWVz 32217 -0L7QsdC+0LQ= 32218 -oNeV 32219 -8J+S 32220 -IHNlbmF0b3Jz 32221 -IEJyaXNiYW5l 32222 -IEFsYg== 32223 -dXR0ZXJpbmc= 32224 -IEFsbG93 32225 -emVybw== 32226 -IHBhaQ== 32227 -INCQ0LvQtdC60YE= 32228 -IERpc3BsYXk= 32229 -IEJsYWRl 32230 -IEFwcHM= 32231 -IHDDpA== 32232 -INC00LXRgdGP 32233 -IHF1ZWxsYQ== 32234 -IEdhbw== 32235 -0LXQvdC90YvRhQ== 32236 -IHNwb2lsZXJz 32237 -IGdhbGxvbnM= 32238 -INmE2Yo= 32239 -IFppb24= 32240 -5pyJ5LiA 32241 -b25pZQ== 32242 -cmFndA== 32243 -IENoYW5k 32244 -IOuzkQ== 32245 -IGJsdW50 32246 -IHVzdQ== 32247 -IEthZA== 32248 -cmFrdA== 32249 -IGNpbmVtYXRpYw== 32250 -IGFtbXVuaXRpb24= 32251 -cmVuZQ== 32252 -IGZvdXJ0ZWVu 32253 -IENhcm4= 32254 -Y3JpdA== 32255 -IHRlbnVyZQ== 32256 -dnU= 32257 -IHByaW5jaXBhbG1lbnRl 32258 -IGFsbGVlbg== 32259 -6YCZ5LiA 32260 -IGtvbXBsZXR0 32261 -IGTDvG55 32262 -SmFtZXM= 32263 -IHJlY2VwdG9y 32264 -IG9uZXNlbGY= 32265 -Z3VydQ== 32266 -IG1lcmNoYW50 32267 -bGluZXNz 32268 -IG92ZXJsb29rZWQ= 32269 -IGhhcm1vbmlj 32270 -6ZW/ 32271 -aWVzbw== 32272 -15XXng== 32273 -Y29sbQ== 32274 -INC/0YDQvtC10LrRgg== 32275 -IEFkYQ== 32276 -2KfYsw== 32277 -VGlt 32278 -IHJlY3VycmluZw== 32279 -IHByb2NlZWRz 32280 -IFBhcnRpY3VsYXJseQ== 32281 -IERvd25sb2Fk 32282 -ZXRyaWNhbA== 32283 -IG1hdHJpY2Vz 32284 -IHByb3llY3Rv 32285 -YW5jaWVz 32286 -IFVobQ== 32287 -IGNhdmVz 32288 -IOyWtOugpA== 32289 -IExlYWY= 32290 -INC+0LHRi9GH 32291 -IOydtOycoA== 32292 -RXVyb3Bl 32293 -IHTEhQ== 32294 -IHB1bHM= 32295 -IHRha2llZ28= 32296 -0J3QtQ== 32297 -R1U= 32298 -IGZvcnM= 32299 -z4HOsw== 32300 -IGZvdG9z 32301 -ICkp 32302 -IOuppOs= 32303 -IGFxdWlsbw== 32304 -IEt1cmQ= 32305 -77iP 32306 -cHRpYw== 32307 -IERvcnQ= 32308 -IG1pc2VyeQ== 32309 -YXVzbw== 32310 -5Yqf 32311 -Y2h1Y2tsaW5n 32312 -IFJpZGdl 32313 -IO2WiOyKteuLiOuLpA== 32314 -ICoqKg== 32315 -5a6i 32316 -IEhtbW0= 32317 -IGdlb2dyYXBoaWM= 32318 -IGFueXM= 32319 -IHRhbHZleg== 32320 -IHNrZWxldA== 32321 -IHNpZ25hdHVyZXM= 32322 -IGxpdGVycw== 32323 -kOuptA== 32324 -INGB0LLQvtC10LPQvg== 32325 -IHNraWluZw== 32326 -INCc0L7RgQ== 32327 -IGFkb3B0aW5n 32328 -IGhhZnQ= 32329 -IHN5bW1ldHJpYw== 32330 -IExpcXU= 32331 -IHRoeXJvaWQ= 32332 -IG1pc2lu 32333 -bHVkZQ== 32334 -IGh1bGw= 32335 -IFhE 32336 -IEd1c3Q= 32337 -emVpY2g= 32338 -IHZpYnJhdGlvbnM= 32339 -IGVzZW1w 32340 -INCy0YHRjg== 32341 -IFF1ZW0= 32342 -IMO8YnJpZw== 32343 -IFNrZQ== 32344 -IEx5bmNo 32345 -cm9vbXM= 32346 -YXJ0ZXQ= 32347 -ZmVzdA== 32348 -IGZyw7xoZXI= 32349 -IGx1cmU= 32350 -5LiN5aW95oSP5oCd 32351 -IOyVjOyVhA== 32352 -IFdJTg== 32353 -IFJZQU4= 32354 -INC60L7RgtC+0YDRg9GO 32355 -IEthc2g= 32356 -INeU154= 32357 -IHNhZmVn 32358 -IEhhbGxlbHVqYWg= 32359 -INC00LLRg9GF 32360 -IHN0YXBsZQ== 32361 -IHNlZGltZW50 32362 -IEFjdHM= 32363 -IGJsYW1pbmc= 32364 -IG1haW5sYW5k 32365 -IHNwb3J0aW5n 32366 -IGRlY29yYXRpb25z 32367 -IGV4ZWN1dGluZw== 32368 -IHBhcmFu 32369 -IERvbGxhcg== 32370 -IHByb2plY3Rpb25z 32371 -IGNvbW1pc3Npb25lZA== 32372 -IGJvdXI= 32373 -w7Zt 32374 -IHN0ZWFtZWQ= 32375 -IOutmA== 32376 -IHBldHJvbA== 32377 -IGNlbHVsYXI= 32378 -5bi2 32379 -IEh1bmdhcnk= 32380 -IHJlbnRlZA== 32381 -INCy0LDRgNC4 32382 -YmJpZQ== 32383 -IHPDqWN1cg== 32384 -w7xsbA== 32385 -IHN3aW5ncw== 32386 -YmV0d2Vlbg== 32387 -INC40YI= 32388 -ZXN0cm8= 32389 -IG5pZW1hbmQ= 32390 -IOyCvA== 32391 -IFBhcmRvbg== 32392 -ZXNzZXM= 32393 -IE1JRA== 32394 -IGNlbnRyYWxpemVk 32395 -IEFsaWVu 32396 -Y3Vsb3M= 32397 -IGNyaXNl 32398 -6KOh6Z2i 32399 -IGNsYXNzZQ== 32400 -YmVpdGV0 32401 -acSfaQ== 32402 -IHdoYWxlcw== 32403 -IHBlcmltZXRlcg== 32404 -IHR5aW5n 32405 -IHN0cm9ueQ== 32406 -IGxpa2V3aXNl 32407 -IFB1bmNo 32408 -RGE= 32409 -IEJhcHRpc3Q= 32410 -IHNvcnRpbmc= 32411 -IGl2 32412 -IO2VqQ== 32413 -IHJlaGFi 32414 -IGV0YQ== 32415 -cml2ZXI= 32416 -IHNhaQ== 32417 -44GE44Gf44Gg 32418 -b2R1cw== 32419 -44GK6aGY44GE44GX44G+44GZ 32420 -IGVzc2F5ZXI= 32421 -IHR1cnRsZXM= 32422 -IEhhenJhdA== 32423 -IGZhYnJpY3M= 32424 -IGNhdml0eQ== 32425 -IHBvbmlld2HFvA== 32426 -IHNjaGxlY2h0 32427 -IHNhbHNh 32428 -xZ9la2vDvHI= 32429 -IHNlYXRpbmc= 32430 -IGVjb25vbWlzdHM= 32431 -IG1hbmc= 32432 -IHNlZ3VpbnRl 32433 -IHJhbmc= 32434 -IHJhdGlvcw== 32435 -IGNvbnN0ZWxs 32436 -IGxvbmd0ZW1wcw== 32437 -dWF0aW5n 32438 -IHNwb2lsZWQ= 32439 -IHJlY2lwaWVudHM= 32440 -IHNuaXBlcg== 32441 -5LmL5YmN 32442 -7Iq164uI6rmM 32443 -IHdw 32444 -IExJTktF 32445 -IGZsYXJl 32446 -IEFkcmk= 32447 -w7Fhcw== 32448 -IGJhY2ts 32449 -bcOkw58= 32450 -IEJlbmQ= 32451 -IHdvcmtsb2Fkcw== 32452 -INGB0YPQvw== 32453 -IDE5NzU= 32454 -0LjQvNGB0Y8= 32455 -0LDQvdC1 32456 -INC80L7QvQ== 32457 -IGFzcGlyYXRpb25z 32458 -IEFlcg== 32459 -INCz0L7QstC+0YDQuNGC0Yw= 32460 -IFFpYW4= 32461 -5aaI 32462 -IGNvbXByb21pc2Vk 32463 -IHlvbGs= 32464 -0LvQsNGB0YI= 32465 -IGhlbWVu 32466 -cm92ZQ== 32467 -ZGVucw== 32468 -INC60L7QvNC80LXQvdGC 32469 -IC0tLQ== 32470 -IGZsdW9yZXM= 32471 -0L3QvtGB 32472 -IExpdmVycG9vbA== 32473 -INGB0L7QsdC+0Lk= 32474 -IFp3ZQ== 32475 -IGx1bWlu 32476 -IE9H 32477 -4bg= 32478 -aG9sbQ== 32479 -cHJvZml0cw== 32480 -U04= 32481 -IHByb3BvcnRpb25z 32482 -IG1pY2E= 32483 -IEJvaA== 32484 -IEF0bGFz 32485 -IHVuc3VyZQ== 32486 -IHRvdXJpbmc= 32487 -IG5pZWQ= 32488 -IHTEmQ== 32489 -IGltcGVyYXRpdmU= 32490 -IGRlbWVr 32491 -IFNoZXJpZmY= 32492 -cmFuY2U= 32493 -IGhvbWVsYW5k 32494 -IEhhaWw= 32495 -IEdhbno= 32496 -eW1t 32497 -TW9u 32498 -5Ya3 32499 -dmlkYQ== 32500 -IGRlc2Fycm9sbA== 32501 -5oqA 32502 -IGludHJpZ3Vpbmc= 32503 -IEh1Z28= 32504 -IOOCgg== 32505 -6aw= 32506 -0LDRhg== 32507 -IFdpxJlj 32508 -YXR0ZWQ= 32509 -IOyVhOuLiOqzoA== 32510 -IFZhcmk= 32511 -w6Fk 32512 -IHN1cnJlYWw= 32513 -IGRpc3Bhcml0aWVz 32514 -IG3Dsw== 32515 -dWxsZW4= 32516 -IOyeiOuLpOqzoA== 32517 -INC/0L7QttCw0LvRg9C50YHRgtCw 32518 -IG1haW5z 32519 -IGVqZWN0 32520 -IG1ldGhhbmU= 32521 -IG1hcmdpbmFsaXplZA== 32522 -IGNoaWxsaQ== 32523 -csOocw== 32524 -IHllbQ== 32525 -5L2g5piv 32526 -IENodW4= 32527 -IGRlYnRz 32528 -IGRvd25sb2FkaW5n 32529 -IEF0aGVucw== 32530 -aXNpZXJ1bmc= 32531 -cnlu 32532 -IHRla24= 32533 -IFF1aW5kaQ== 32534 -6ZyA 32535 -IHRhcmFm 32536 -IGjDqQ== 32537 -IGNvbnNjaW91c2x5 32538 -IGZpeGVz 32539 -dWNrbGU= 32540 -bWF5xLFu 32541 -IGZyZWk= 32542 -IHNwYQ== 32543 -IOynhO2WiQ== 32544 -INin2YTYsA== 32545 -INGD0Lo= 32546 -bGV0dA== 32547 -IG9sbXXFnw== 32548 -IGNoZWVzeQ== 32549 -4Liy4LiB 32550 -bmFpcmU= 32551 -IHdpZGVu 32552 -IGxpZW4= 32553 -IGVzY2FwaW5n 32554 -aWdncw== 32555 -IEJsaWNr 32556 -Y8SF 32557 -IOyEnOs= 32558 -INeU16E= 32559 -INCy0L/QtdGA 32560 -b3Bob25l 32561 -aWVsbA== 32562 -IFNVQlNDUkk= 32563 -IGxpb25z 32564 -IOq3uOqygw== 32565 -IGluc3BpcmVz 32566 -IGd1YXJhbnRlZXM= 32567 -IGNvbWXDp2E= 32568 -IEdyb3dpbmc= 32569 -IG5lZ2xpZw== 32570 -IEZyYW5rZg== 32571 -IGdlZ2ViZW4= 32572 -IMSR4bqndQ== 32573 -IGVuZGxpY2g= 32574 -IOyNqA== 32575 -IFRU 32576 -IExpdGg= 32577 -z4DOsQ== 32578 -YXN0ZXJu 32579 -IEF6ZXI= 32580 -IGx1bmFy 32581 -aGlj 32582 -INC90LDRgNC+0LQ= 32583 -IG5lbmh1bQ== 32584 -6LeR 32585 -IFNhbHZhZG9y 32586 -IFByb2dyZXNz 32587 -IHByaXZpbGVnZXM= 32588 -IOuPmeyViA== 32589 -IGFudGFnb24= 32590 -IEltcGY= 32591 -IGRlc2N1Yg== 32592 -IExlaQ== 32593 -IOyDiOuhnA== 32594 -0YfQtQ== 32595 -IGTDs2xhcmVz 32596 -IE1lZ2hhbg== 32597 -IFdpcmU= 32598 -dG9v 32599 -YXlpbmc= 32600 -dXNj 32601 -IHR1ZA== 32602 -IGFwcGVhbHM= 32603 -ZWR1Yw== 32604 -IHBhbmU= 32605 -IGpp 32606 -IGRlY2tz 32607 -IEFsdGVy 32608 -IOWwsQ== 32609 -7ISk 32610 -5YiG6ZCY 32611 -IHByb2R1Y3Rpb25z 32612 -IFdJTExJQU0= 32613 -IGltcGxpZWQ= 32614 -IGZ1bGZpbGxtZW50 32615 -IEFhaA== 32616 -IHNhamE= 32617 -eHVz 32618 -IM6azrHOuQ== 32619 -w6Bz 32620 -dWNjaA== 32621 -0L7QutC+ 32622 -IERpc2NvcmQ= 32623 -IFNZ 32624 -anNr 32625 -IFdhbGxhY2U= 32626 -dW5jdGlvbg== 32627 -RGFuaWVs 32628 -IGvDtnQ= 32629 -aWphaA== 32630 -IG1hcmNoZQ== 32631 -IGRpc2dy 32632 -IG11bmdraW4= 32633 -IGFsbWE= 32634 -s7U= 32635 -IGV4dGVuc2l2ZWx5 32636 -IEZsb3Jlbg== 32637 -IEFsbGlzb24= 32638 -44Kx 32639 -2YrZhQ== 32640 -IGp1dmVu 32641 -IFJlbmFpc3NhbmNl 32642 -IGZ1bmRyYWlzaW5n 32643 -IENoYW9z 32644 -IHBhcmFseQ== 32645 -IG5hcnJhdG9y 32646 -IGVjb3N5c3RlbXM= 32647 -QXNo 32648 -IG1pdGlnYXRpb24= 32649 -IEF1am91cmQ= 32650 -IElkZWU= 32651 -ISw= 32652 -IMK9 32653 -IGxhbmRsb3Jk 32654 -IGRlZmVjdHM= 32655 -IGFjcmU= 32656 -dWxzaXZl 32657 -IGFsZ2Fl 32658 -cGVr 32659 -IGVtYmE= 32660 -IFJvYw== 32661 -6Zui 32662 -a3NvbQ== 32663 -w6RjaGU= 32664 -IGxldWs= 32665 -IGxldmVyYWdpbmc= 32666 -IOq3uOugh+yngA== 32667 -IFBhbG0= 32668 -IMOkdmVu 32669 -IGxpcw== 32670 -IEluc3A= 32671 -IFJpdGE= 32672 -IEFiYg== 32673 -aXRobQ== 32674 -IHN1cGVydmlzaW9u 32675 -IHJldmlzaXQ= 32676 -IHBpxJk= 32677 -IGV1aA== 32678 -IGZhZGVz 32679 -IG1vdHRv 32680 -5Y2h 32681 -0LXQt9C2 32682 -IFNoaW0= 32683 -IHJlbGV2YW5jZQ== 32684 -IG9v 32685 -IG9zdGF0 32686 -bmljYQ== 32687 -IGNob2l4 32688 -IEZhY3VsdHk= 32689 -IOykkeyXkA== 32690 -IEFib3Zl 32691 -INC90LXQsdC+0LvRjNGI 32692 -IHNlcXVlbmNpbmc= 32693 -IG51dHJpZW50 32694 -IGNvbnF1ZXJlZA== 32695 -IGRpZ2VzdGl2ZQ== 32696 -IGJhY2tkcm9w 32697 -IExvcmk= 32698 -YWlsYWJsZQ== 32699 -R2FtZQ== 32700 -IG5lZ2xlY3RlZA== 32701 -b21vcnBo 32702 -aWxsYWg= 32703 -IGtuZQ== 32704 -IHNpaXTDpA== 32705 -IHdvcmtzcGFjZQ== 32706 -IFZlbmljZQ== 32707 -IEtuZQ== 32708 -0YnQvg== 32709 -hYA= 32710 -IEhhc3M= 32711 -IHZpdGE= 32712 -nbzrqbQ= 32713 -IGxheXM= 32714 -w6puY2lhcw== 32715 -w6lyaWNh 32716 -IExs 32717 -5rGC 32718 -IENvY2E= 32719 -IFdIWQ== 32720 -6Iie 32721 -IHJvdXRpbmc= 32722 -IHBlcm1pc3Npb25z 32723 -IGRpbmdz 32724 -cHJlbmQ= 32725 -cHJvZ3JhbQ== 32726 -IGNyb2NvZA== 32727 -YnJhbA== 32728 -QUFBQUFBQUE= 32729 -YWdpdA== 32730 -IE7DpA== 32731 -IGdla29tbWVu 32732 -YXR0ZW4= 32733 -IHJlZmVyZW5jZWQ= 32734 -IHBhaXJpbmc= 32735 -IFBhcnRuZXI= 32736 -IENvcm9uYXZpcnVz 32737 -0ZbRgQ== 32738 -6L2J 32739 -INeU15M= 32740 -IGVzcGVjw61maWM= 32741 -YXJzaQ== 32742 -cXVlbGxl 32743 -IHNwb250YW5lb3Vz 32744 -54ax 32745 -IOqyg+ydhA== 32746 -INCf0L7RgdC70LU= 32747 -INin2YTYrw== 32748 -IFNob3V0 32749 -INC90LDQuw== 32750 -IGRpc2d1aXNl 32751 -IEpvcmQ= 32752 -IHdlZQ== 32753 -IG1pZWpzYw== 32754 -IHNlcnVt 32755 -IHBsYWlzaXI= 32756 -IGNyZWRpYmxl 32757 -IGLDpQ== 32758 -IEFK 32759 -bWFyZXM= 32760 -IHJvZHM= 32761 -IGVyYW4= 32762 -44G+44GC 32763 -IHDDpMOk 32764 -IFVB 32765 -IFVua25vd24= 32766 -INmE2YU= 32767 -IFJhYmJp 32768 -IGxhYXQ= 32769 -IGhhaXJzdHlsZQ== 32770 -INi6 32771 -6YGL 32772 -IGNhY2g= 32773 -IFdyaXRpbmc= 32774 -0L7Rh9C60Lg= 32775 -YWJhZA== 32776 -IHN0cmFpZ2h0ZW4= 32777 -LS0i 32778 -d2lmZQ== 32779 -IGhvdHRlc3Q= 32780 -IHB1bnlh 32781 -IEZhc2hpb24= 32782 -Z3JpZmY= 32783 -IFFS 32784 -b3RjaA== 32785 -INCc0L7QttC10YI= 32786 -Q2xvdWQ= 32787 -IFN0cmlrZQ== 32788 -IEhlaW4= 32789 -IOecn+eahA== 32790 -IGxlaQ== 32791 -IEZsb3c= 32792 -d2Vncw== 32793 -IGhhYnI= 32794 -5Ymb5Ymb 32795 -bmFobWU= 32796 -zIE= 32797 -IHBsZWFzaW5n 32798 -b3BwaW5n 32799 -IOq1rOuPhQ== 32800 -IGRyYW4= 32801 -IGJhbmdz 32802 -IDc5 32803 -IHNrZXQ= 32804 -IGNhdmFs 32805 -IE1hY3Jvbg== 32806 -IHdlaWdodGVk 32807 -IG11dGVk 32808 -IG51ZXN0cmFz 32809 -RUVQ 32810 -IG1hdGhlbWF0aWM= 32811 -IE1SSQ== 32812 -YWd1cw== 32813 -IHRoZXJhcGllcw== 32814 -zrjOtQ== 32815 -IHVucGw= 32816 -IGNvbW1lbmNlcg== 32817 -ZnVsbA== 32818 -IHRvd2Vscw== 32819 -IHBydWU= 32820 -IGxpY2Vuc2Vz 32821 -15vXldec 32822 -INCf0L7Rh9C10LzRgw== 32823 -IHBvaW50bGVzcw== 32824 -Qnll 32825 -IGVsaWdpYmlsaXR5 32826 -IHNjcmFwZQ== 32827 -IGFidXNpdmU= 32828 -IE1hbnQ= 32829 -IGpldW5lcw== 32830 -dGFs 32831 -IFByaW5jaXA= 32832 -IE9ydGhvZG94 32833 -IG1lbG9k 32834 -INC80LDRgtC10YDQuA== 32835 -IHByb3NlY3V0b3I= 32836 -IG9waW9pZA== 32837 -INGD0LLQtdGA 32838 -IEJlZW4= 32839 -IOygkeyihQ== 32840 -IGR5bmFzdHk= 32841 -IGFqdWRh 32842 -IGVudHJlZw== 32843 -IHdlaWdoZWQ= 32844 -IGV1cmU= 32845 -IEJlbQ== 32846 -IGFibm9ybWFs 32847 -ODI= 32848 -IEpS 32849 -IEFrdA== 32850 -IEJyaQ== 32851 -w7p0 32852 -IHN0YWdu 32853 -ISo= 32854 -IHdlZ2Vu 32855 -IGxlYWtpbmc= 32856 -IFdvcmRz 32857 -IE1hdQ== 32858 -IHZ1ZQ== 32859 -IExpYW0= 32860 -0LDQvdC40LXQvA== 32861 -IGNsaW5pY2lhbnM= 32862 -IFB1bXA= 32863 -IGbDtnJzdA== 32864 -Py4uLg== 32865 -IGF1dG9tb3RpdmU= 32866 -IE93ZW4= 32867 -enVzYWdlbg== 32868 -IEh1bmRyZWQ= 32869 -IGRlY2VudHJhbGl6ZWQ= 32870 -IGJ1bGJz 32871 -INec15s= 32872 -IHByb3ZpbmNlcw== 32873 -IE1pbGFu 32874 -ODE= 32875 -a2Fz 32876 -IOuTow== 32877 -IGZvcsOnYQ== 32878 -IHJpZ2h0bHk= 32879 -5bO2 32880 -csSF 32881 -IHZlbnVlcw== 32882 -IHdhaQ== 32883 -IHByZWRpY3Rpbmc= 32884 -IFdpRmk= 32885 -IOq2geq4iA== 32886 -2LHZiA== 32887 -INeU15Y= 32888 -Y2VudHVyeQ== 32889 -IGdyYWR1YWw= 32890 -IFByb2JsZW1l 32891 -IOyXhQ== 32892 -IGNvcGluZw== 32893 -IEJydXM= 32894 -IHBlYW51dHM= 32895 -aXJ0c2NoYWZ0 32896 -INC30LDQuw== 32897 -IFRyb3k= 32898 -IHNwZXJt 32899 -IE1pdGFy 32900 -IFTDvHJraXll 32901 -Z3JhbmQ= 32902 -pq0= 32903 -INee16E= 32904 -IHBhbnM= 32905 -IEtub3dsZWRnZQ== 32906 -YmVybHk= 32907 -INCV0LPQvg== 32908 -IGRhbmNlZA== 32909 -IEZyb3N0 32910 -IEJ1cmc= 32911 -IGJpdGluZw== 32912 -7KCV7J2E 32913 -bWVhbA== 32914 -IGhlcm9pYw== 32915 -IG1vdGhlcmJvYXJk 32916 -IExpY2h0 32917 -44Gj44E= 32918 -bGxhbg== 32919 -0LDQudC9 32920 -INGA0Y/QtA== 32921 -IOC5gOC4 32922 -b25lbg== 32923 -aXJpZQ== 32924 -QXJ0 32925 -cmFuZw== 32926 -zr3Otw== 32927 -IG5ld2Jvcm4= 32928 -IGFtaXM= 32929 -INin2YjYsQ== 32930 -IHNvcGhvbQ== 32931 -IENhcmVmdWw= 32932 -IHByb3NwZWN0cw== 32933 -ZW5zZW4= 32934 -IHRocmlsbA== 32935 -IFZp4buHdA== 32936 -QWRhbQ== 32937 -cml0aW9u 32938 -ZW50cmlj 32939 -dWRlbg== 32940 -IGNlcnRpZmljYXRlcw== 32941 -IGFzaGVz 32942 -6Kq/ 32943 -cGxheWluZw== 32944 -IHNhZGVjZQ== 32945 -IG9zdA== 32946 -IGFpcnBsYW5lcw== 32947 -0YDQvtC6 32948 -b25lcg== 32949 -IG1hZ25lc2l1bQ== 32950 -IGdvZGRhbW4= 32951 -IDE5NzI= 32952 -IFNjaHVsZQ== 32953 -IHRlbWF0 32954 -IHBhcnRvdXQ= 32955 -4K+C 32956 -IGludmU= 32957 -IFNjaWVudGlzdHM= 32958 -IEh1ZHNvbg== 32959 -d2lubmluZw== 32960 -Y2Vrc2lu 32961 -IGNvbmdyZXNzaW9uYWw= 32962 -b3J1 32963 -IHJvcGVz 32964 -0LLQtdC0 32965 -IG1hZHJl 32966 -IGZlcnJ5 32967 -IENvaGVu 32968 -IFByZWQ= 32969 -IHZhZ3k= 32970 -INCx0LXRgdC/ 32971 -IG11bHRpbQ== 32972 -IGRyYWluYWdl 32973 -IHNpbXVsYXRvcg== 32974 -Z2lnZ2xlcw== 32975 -IFN0YWRpdW0= 32976 -0L7QsdGJ 32977 -IG5vdGljZXM= 32978 -IGNyYXdsaW5n 32979 -IGdyb3VwZQ== 32980 -5Y+4 32981 -IGt0b8Wb 32982 -IFlvZ2E= 32983 -IG1lZGlkYQ== 32984 -INGF0LLQsNGC 32985 -IExpdGU= 32986 -IHJhdg== 32987 -b3JhbWE= 32988 -IGRpc2NvcmQ= 32989 -IERJUkU= 32990 -IHRlaA== 32991 -IE51cnM= 32992 -57KJ 32993 -IHBpdGNoZWQ= 32994 -IGJhcmtpbmc= 32995 -IENva2U= 32996 -d2lhZA== 32997 -IHBvcHVsYXRlZA== 32998 -6Zmk 32999 -cGVsbGVk 33000 -INCx0L7Qsw== 33001 -IHBld25v 33002 -IEN1YmU= 33003 -IHJlY3J1aXRlZA== 33004 -6YCZ56iu 33005 -IENhcmE= 33006 -xLHEn8SxbsSx 33007 -aW1hdGVk 33008 -INGI0LrQvtC7 33009 -aWNpb25hbA== 33010 -INC/0YDQvtGE 33011 -IGNvbnRhbWluYXRpb24= 33012 -IMO6bHRpbW9z 33013 -IGZlYXJmdWw= 33014 -IGVsZXBoYW50cw== 33015 -dXNp 33016 -IGlUdW5lcw== 33017 -IFN3YW1p 33018 -6rw= 33019 -IOyEpOuqhQ== 33020 -IFJpY2hhcmRz 33021 -IG1hZ25ldHM= 33022 -IFJpY2h0dW5n 33023 -IExlZ2lvbg== 33024 -6I+c 33025 -IGtpdHR5 33026 -IGtpc3NlZA== 33027 -IHdhdGVyaW5n 33028 -IGNvbm8= 33029 -IFBhbGVzdGluZQ== 33030 -aWRpcg== 33031 -IG1hemU= 33032 -IGZsdWlkcw== 33033 -IFByb2R1Y2Vy 33034 -IEtyc25h 33035 -5aW95ZWm 33036 -bGFm 33037 -INeQ15U= 33038 -IG1pZXN6 33039 -IFhpbmc= 33040 -b2ludGVk 33041 -c2Vpbg== 33042 -IEZ1aw== 33043 -IERlcHJlc3Npb24= 33044 -IER1dHk= 33045 -IFBhbnRoZXI= 33046 -IHN1bmQ= 33047 -IHJlZmVyZQ== 33048 -IGV4Y2x1c2lvbg== 33049 -IG5hdmFs 33050 -IFdpbnN0b24= 33051 -IHNsb2dhbg== 33052 -IGh5cG90aGV0aWNhbA== 33053 -IGVsZXZhdGU= 33054 -66C5 33055 -IGNhYmXDp2E= 33056 -IEdlc3VuZA== 33057 -bWV0ZXI= 33058 -IOyVhOuLiOuptA== 33059 -IGNsb3VkeQ== 33060 -4oCmPw== 33061 -IFNjaHJpdHQ= 33062 -IEpT 33063 -7I0= 33064 -IFNwcmluZ3M= 33065 -IEJhdHRlcg== 33066 -t7A= 33067 -IHRhaWxvcg== 33068 -IFBUU0Q= 33069 -IEdlbnQ= 33070 -IGJhxJ8= 33071 -IHNwYXR1bGE= 33072 -IGNyYXk= 33073 -IExlZ2lzbA== 33074 -IHPDug== 33075 -IGxldmU= 33076 -4Liy4Lih 33077 -IGVyYWQ= 33078 -IGRvbmc= 33079 -IGRlcm0= 33080 -IEJhbmtz 33081 -aWNobw== 33082 -5YWI55Sf 33083 -IEZyYW56 33084 -cmF2ZWw= 33085 -6YGU 33086 -0L7Qu9C+ 33087 -IGZsdXRl 33088 -IEVr 33089 -IGpveWZ1bA== 33090 -IGNoYXNlZA== 33091 -IExhcmdl 33092 -T3Zlcg== 33093 -IGVudHJlcHJlbmV1cmlhbA== 33094 -IGNvbnNpZGVycw== 33095 -0YPQtdC8 33096 -b3Bh 33097 -IGRvcm1pcg== 33098 -IEVsZW1lbnRhcnk= 33099 -IHByenlwYWQ= 33100 -0YPRgdC60LA= 33101 -INC+0YfQtdGA 33102 -dWdlbmU= 33103 -IHRlbmlkbw== 33104 -IGx1Z2FyZXM= 33105 -66U= 33106 -INGH0LDRgdGC 33107 -IHNhbw== 33108 -IGJyYWlk 33109 -IFZlcmU= 33110 -IFJlaWNo 33111 -IFBvc3M= 33112 -IGluYW4= 33113 -d2FuZA== 33114 -cmVm 33115 -IG1vbnRyZXI= 33116 -IDE5ODE= 33117 -55Wq 33118 -YXPEsW5kYQ== 33119 -IGNocm9tZQ== 33120 -IFRyaW5pdHk= 33121 -IGV4cGxvaXRhdGlvbg== 33122 -IFNlbnNl 33123 -IENNUw== 33124 -IE5vYmxl 33125 -IOyEoO2DnQ== 33126 -IHN3ZWxsaW5n 33127 -ZWxlY3Ryb25pYw== 33128 -XT8= 33129 -IGJydXNoaW5n 33130 -IGxpcXVpZGl0eQ== 33131 -IEhvb2s= 33132 -IENvbm5vcg== 33133 -IEFsdW0= 33134 -IGd1Y2tlbg== 33135 -c3VpdGU= 33136 -IHdpZWxl 33137 -IGJhcnJlbHM= 33138 -IFJlZ2Vs 33139 -IE1lbnQ= 33140 -IFRyaXA= 33141 -IEJydXNo 33142 -IEVyaWs= 33143 -dXJhdGU= 33144 -yZly 33145 -IEN5cg== 33146 -b3VibGU= 33147 -IEJlY2Nh 33148 -IHBhc3N3b3Jkcw== 33149 -xbE= 33150 -Ym9yZw== 33151 -IHZlbmRv 33152 -IENsYXVz 33153 -IEZheg== 33154 -aW5kZXN0 33155 -IGRlY2Vhc2Vk 33156 -IGNvbXBhcmlzb25z 33157 -IExDRA== 33158 -IFBvcms= 33159 -IGV2ZW50dWFs 33160 -IHBhdHJlb24= 33161 -IGluYWJpbGl0eQ== 33162 -IGV4dGluY3Rpb24= 33163 -IOyii+yVhO2VmOuKlA== 33164 -INGB0L7RgQ== 33165 -YWp1 33166 -INeR15DX 33167 -IHNvZm9ydA== 33168 -IGRlc3RpbmVk 33169 -IFJpbg== 33170 -IG1vdXRocw== 33171 -IE5hdMO8cmxpY2g= 33172 -IHByZXNlcnZpbmc= 33173 -IGxpbXA= 33174 -6buo 33175 -b2N1c2Vk 33176 -0LjQvdCz 33177 -IGV4cG9zaW5n 33178 -IM6+ 33179 -640= 33180 -bGF1Z2g= 33181 -IGhpc3M= 33182 -44Gg44GL44KJ 33183 -IGluZGll 33184 -IGRldGFs 33185 -0YDQsNCy0YHRgtCy 33186 -IHRyw6pu 33187 -5pWw 33188 -IG9nbmk= 33189 -IHNpbXBsZW1lbnRl 33190 -IDE5Nzg= 33191 -IGdvbw== 33192 -IDE5Njc= 33193 -IGdlbnVn 33194 -aMO2 33195 -IGhpc3TDsw== 33196 -5a6f 33197 -IGxvYnN0ZXI= 33198 -Y2VuZG8= 33199 -IHRlaWw= 33200 -IGFsbGV2aQ== 33201 -MDAwMA== 33202 -T0xE 33203 -IHBlc29z 33204 -IGJvbnVzZXM= 33205 -IGFtaQ== 33206 -IHJldml2YWw= 33207 -IEhvcnNl 33208 -IHNhY2s= 33209 -VGFsaw== 33210 -IG11bGhlcg== 33211 -INC/0L7RgdGC0L7Rj9C9 33212 -IEhvb2Q= 33213 -SHVo 33214 -IOu2gQ== 33215 -IGh5dW5n 33216 -IE1lZXRpbmc= 33217 -IGltcG9ydGE= 33218 -IOywvuyVhA== 33219 -IFZlcm4= 33220 -IHN0cmlwcGVk 33221 -IHJlZnVzZXM= 33222 -IHF1YWxpZmljYXRpb25z 33223 -b3Bs 33224 -gOuPhA== 33225 -aXjDrQ== 33226 -IGRpYWI= 33227 -aXRpbWU= 33228 -Zmxvd3M= 33229 -IGluYWM= 33230 -IEdvbmc= 33231 -IG1lYW5pbmdsZXNz 33232 -IGNvdXJhZ2VvdXM= 33233 -IG1pY3JvYmk= 33234 -YXp5 33235 -aGlzdA== 33236 -IHZvbHVudGVlcmluZw== 33237 -VklF 33238 -IHZpb2xhdGVk 33239 -IHN5bXBhdGh5 33240 -IEVkaXQ= 33241 -5aW95YOP 33242 -ZWxlY3RyaWM= 33243 -cHJvZHVjdA== 33244 -IHBhbmRlbWlh 33245 -IGdlb21ldHJpYw== 33246 -IENvbnZlcnM= 33247 -Z3Jl 33248 -IGdsdXQ= 33249 -aXN0ZWQ= 33250 -INin2YTZgw== 33251 -IENoYWlu 33252 -IFByZXNlbnQ= 33253 -IFlpbg== 33254 -INGB0L7Qsw== 33255 -IFZsb2c= 33256 -IOyWtOuouA== 33257 -IGRvbm4= 33258 -IGhpdGNo 33259 -dWNraW5n 33260 -44GK44GE 33261 -d2FsZA== 33262 -cmlzaw== 33263 -IGhhcmk= 33264 -IEtlbnM= 33265 -IElkb2w= 33266 -INCy0L3QuNC80LDQvdC40LU= 33267 -IHRvZGQ= 33268 -IHNtYXNoZWQ= 33269 -IGludmFyaQ== 33270 -INC60L7QvdGC0YA= 33271 -IGF1dGlzdGlj 33272 -7J6l64uY 33273 -UmVz 33274 -0LTRiw== 33275 -Y2hhdQ== 33276 -IHNlbHY= 33277 -IGjDpHR0ZW4= 33278 -4KS/ 33279 -IGV4cGVjdHM= 33280 -z4HOtw== 33281 -IGHDp8Sxaw== 33282 -IEhUVFA= 33283 -bGXFnw== 33284 -IHN3ZWVwaW5n 33285 -IEJldGE= 33286 -IGNvdW50ZXJwYXJ0cw== 33287 -YWJpbGU= 33288 -IFNpbXM= 33289 -Q3M= 33290 -IHJlcGFy 33291 -c3F1 33292 -IHByb3ZpbmNpYWw= 33293 -IHNoYXJlaG9sZGVycw== 33294 -IHJ1bnRlcg== 33295 -IGdlZGFjaHQ= 33296 -IFRlZW4= 33297 -IGdyYW5kcw== 33298 -55Si 33299 -YWdsZXM= 33300 -IHJvY2t5 33301 -dmVucw== 33302 -IHJpdmFscw== 33303 -dW5hbA== 33304 -IHJlYWN0cw== 33305 -66k= 33306 -IG1lcmN1cnk= 33307 -IEx1aWdp 33308 -INC+0LM= 33309 -IEpVU1Q= 33310 -IGxvZA== 33311 -IGNvcnRleA== 33312 -d2ln 33313 -IGxha2g= 33314 -7KSR7JeQ 33315 -IFZpYw== 33316 -IE11bmQ= 33317 -IG1hcHBlZA== 33318 -IERlbGw= 33319 -IERydWNr 33320 -IGxpZmVz 33321 -0LDQu9GM0L3QvtC1 33322 -aXZpZHVhbA== 33323 -YWTEsW0= 33324 -IGF0cmF2 33325 -IEZsdWc= 33326 -IEtsZWlu 33327 -6rGw7JW8 33328 -4Lir4LiZ 33329 -IGFwcGxp 33330 -4K6+Pw== 33331 -w7x5b3J1bQ== 33332 -INC40L3RgtC10YDQtdGB0L3Qvg== 33333 -IGRpc2luZmVjdA== 33334 -Pi0= 33335 -IGNoYW1wYWduZQ== 33336 -IGtsYQ== 33337 -b3BlcnM= 33338 -VHJhbnM= 33339 -IERlc2VydA== 33340 -IGN1bHRpdmF0ZQ== 33341 -IEZ1Y2tpbmc= 33342 -aWRlbGl0eQ== 33343 -INGC0LDQvQ== 33344 -IGluY3Vi 33345 -IHRlbXU= 33346 -IGxlYXJuZXI= 33347 -Zm91bmRlcg== 33348 -IFN5bA== 33349 -44KA 33350 -IGZhdG8= 33351 -emllcg== 33352 -IOyXhuydtA== 33353 -IOyIqA== 33354 -IHBzeWNobw== 33355 -INGC0LXQu9C10YQ= 33356 -IHJlZ2FyZGU= 33357 -IHJlcHJlc2VudGF0aW9ucw== 33358 -IGxpdGlnYXRpb24= 33359 -IHNwYW5u 33360 -dWx0cw== 33361 -Ymlvcg== 33362 -6KaL44Gm 33363 -5LiN5aSa 33364 -IFN1cnZleQ== 33365 -IExFRHM= 33366 -IHRyw6Q= 33367 -IGzDqm4= 33368 -IGFudGlveGlk 33369 -0LXRgNC+0Lw= 33370 -IGluZHVjdGlvbg== 33371 -IGZvb2xlZA== 33372 -w6R0emxpY2g= 33373 -INCz0L7QstC+0YDRj9GC 33374 -IEZhY3Q= 33375 -dW1iYWk= 33376 -IHdpZ2dsZQ== 33377 -Tk9VTg== 33378 -IGTDqXZlbG9wcA== 33379 -IENsYXJv 33380 -IOy4 33381 -66w= 33382 -44Gq44KT44Gg 33383 -IGFjY3VtdWxhdGU= 33384 -IG1haW50YWlucw== 33385 -64Q= 33386 -IEZpZ2h0ZXI= 33387 -7Yag 33388 -IG1hdGlu 33389 -IGNvdXBvbg== 33390 -IHN0dW50 33391 -IGRlYnV0ZWQ= 33392 -5b6F44Gj44Gm 33393 -IHByYWc= 33394 -0LjQstCw0LXQvA== 33395 -NzM= 33396 -IGV4cHJlcw== 33397 -IOyYpOu5oA== 33398 -INC/0LXRgNGB0L7QvQ== 33399 -IGNhbGN1bHVz 33400 -IGFicnVwdA== 33401 -IEluc3BlY3Rvcg== 33402 -b3VydA== 33403 -5paZ 33404 -xbpuaWVq 33405 -aW50ZW5zZQ== 33406 -QmE= 33407 -IGxvdW5nZQ== 33408 -IGFzdGhtYQ== 33409 -IEhpw6c= 33410 -qrs= 33411 -IGVkaXRvcmlhbA== 33412 -IHNlaXpl 33413 -IGvEsXI= 33414 -IG1vdXZl 33415 -IHRpZXJyYQ== 33416 -IHRlc3Rvc3Rlcm9uZQ== 33417 -IHJo 33418 -IEtpbmdzdG9u 33419 -RUxMRQ== 33420 -IFJlcHJlc2VudGF0aXZl 33421 -IDE5NzQ= 33422 -IGliYQ== 33423 -VHM= 33424 -IHNvcnRh 33425 -ICg/KQ== 33426 -INiq2Yg= 33427 -IOuCtOugpA== 33428 -IGJla29tbXQ= 33429 -IHNwaXJpdHVhbGx5 33430 -IGRpc3RvcnRlZA== 33431 -TWFk 33432 -IHJlaW0= 33433 -w6FuaA== 33434 -IE90dG9tYW4= 33435 -IFJlbGln 33436 -IEVscw== 33437 -IHJldGFpbmVk 33438 -IExhdWdocw== 33439 -5oC7 33440 -IFNBUw== 33441 -INC60L7Qu9C40YfQtdGB0YLQstC+ 33442 -15XXqteo 33443 -IGlubm92YXRl 33444 -IGtvcms= 33445 -INGA0LDRgdGB0LrQsNC30YvQsg== 33446 -b25kZXJl 33447 -aXZp 33448 -YXll 33449 -b3VudHk= 33450 -INC/0L7Qu9GD0YfQsNC10YLRgdGP 33451 -IGJ1bnM= 33452 -5YWr 33453 -IHnDvHpkZW4= 33454 -IHN1cmdlcmllcw== 33455 -2KPZhg== 33456 -IGJhbmtydXB0Y3k= 33457 -d2VsdA== 33458 -IHNpYW1v 33459 -IGRhcmtlc3Q= 33460 -IEhhbm4= 33461 -Z2dh 33462 -IGZvcm1hcw== 33463 -IERq 33464 -bmFtZWQ= 33465 -IHNoaWVsZHM= 33466 -dWVsbGVy 33467 -IEZldw== 33468 -IGxhY2U= 33469 -IGZ1cmlvdXM= 33470 -IFlV 33471 -IHNvY2lldGFs 33472 -IGp1ZGdlbWVudA== 33473 -IERvcw== 33474 -IGphYg== 33475 -bGF3cw== 33476 -IHJlaW52ZW50 33477 -IEthdGhlcmluZQ== 33478 -IENob2k= 33479 -YWRvd3M= 33480 -IHJhbnM= 33481 -b2Rlbg== 33482 -IE1pZHdlc3Q= 33483 -bsSxbg== 33484 -IGRlcG9ydA== 33485 -IERpcA== 33486 -57SF 33487 -IGF0ZW5jacOzbg== 33488 -IENvdXJ0bmV5 33489 -aXZpZGFk 33490 -INqp24E= 33491 -IGVmZmljYWN5 33492 -IEJyb29rcw== 33493 -IHJlZmVycmFs 33494 -INC60L7QvdGG 33495 -IG1hbGljaW91cw== 33496 -IGtpcg== 33497 -IEdvZGRlc3M= 33498 -IGZ1bmt5 33499 -IGludGVyaW0= 33500 -IEvDtnJwZXI= 33501 -IOyWvOun 33502 -a3Vy 33503 -INC60LvQuA== 33504 -IHRydWNz 33505 -Z2VzZXR6 33506 -IHp1Zw== 33507 -IEdsw7xjaw== 33508 -IE1pbnV0ZQ== 33509 -IHByZXN0aWdpb3Vz 33510 -IG5pZXo= 33511 -IGNvbmNlbnRyYXRpb25z 33512 -0LvQsNGB0YLQuA== 33513 -IFNpcw== 33514 -IFZpdGFtaW4= 33515 -a292 33516 -IFBCUw== 33517 -INC90LXQtQ== 33518 -IHJldGFpbGVycw== 33519 -IGNvbnZlbnRpb25z 33520 -IFNhbWFudGhh 33521 -IHByb3VkbHk= 33522 -Sm9yZGFu 33523 -IEpBU09O 33524 -YXRr 33525 -IHRyaXN0ZQ== 33526 -IHN0w6Ry 33527 -IHJlaXRlcmF0ZQ== 33528 -IHBvc3Rlcmlvcg== 33529 -IDE5NzM= 33530 -IFBpbmU= 33531 -IEp1bGlldA== 33532 -IHBlZGly 33533 -a2ls 33534 -IG92ZXJsYXBwaW5n 33535 -IGV4Y2x1ZGU= 33536 -IGVjb27Ds20= 33537 -IGFjY2VwdHM= 33538 -IFN0ZXI= 33539 -5rG6 33540 -IOyatOuPmQ== 33541 -ZXN0YWI= 33542 -IHR1Zw== 33543 -YXJn 33544 -IGxpdnJv 33545 -2KfYtQ== 33546 -IHNlYW1z 33547 -IGJ1cmF5YQ== 33548 -IGVsbG8= 33549 -IFRN 33550 -IFBhdw== 33551 -IEluZGV4 33552 -RXhj 33553 -IGluc3BpcmF0aW9uYWw= 33554 -IGR1bms= 33555 -6LCB 33556 -YWt0ZXI= 33557 -IGNvbmRpdGlvbmVy 33558 -IFNhbHV0 33559 -xYJlYw== 33560 -IOyJvQ== 33561 -INGD0LfQvdCw 33562 -IFJvbWVv 33563 -ZnJ1aXQ= 33564 -IFlP 33565 -IGNo4buJ 33566 -0LHRgw== 33567 -Ym9ucw== 33568 -IHJlcHJvZHVjdGl2ZQ== 33569 -IG9yYWRh 33570 -IO2aqA== 33571 -IHRlbnRhcg== 33572 -IG1hw7FhbmE= 33573 -44Ks 33574 -IHNvbHZlbnQ= 33575 -SmVzc2ljYQ== 33576 -IExlZ2Fs 33577 -IHR1YQ== 33578 -IHNpYw== 33579 -IEVR 33580 -YXVrZWU= 33581 -7Iuc64uk 33582 -IMWedQ== 33583 -IGFkaGVyZQ== 33584 -IFR1bA== 33585 -IOCuhg== 33586 -IHRleHRib29rcw== 33587 -IEZpZnRo 33588 -IGV4cGVyaQ== 33589 -IGNoaWM= 33590 -IGhlYXA= 33591 -aW5lbHk= 33592 -YXRyYQ== 33593 -VHdv 33594 -IGhlbGVtYWFs 33595 -IGZyZW4= 33596 -5o6o 33597 -IGJpc2hlcg== 33598 -2KfYtA== 33599 -IOyEoOyDnQ== 33600 -IFRhZ2Vz 33601 -IHPhu7E= 33602 -IGJ1bGxpZWQ= 33603 -2KQ= 33604 -IGJlbmVmaXRlZA== 33605 -IFByZXZpb3VzbHk= 33606 -INGN0YTRhA== 33607 -2Y0= 33608 -IHNlbmF0ZQ== 33609 -IE1vcm0= 33610 -aWprZQ== 33611 -IEZsdQ== 33612 -IGluY29ycG9yYXRpbmc= 33613 -amFjaw== 33614 -INC/0LjRgg== 33615 -IGltcGx5 33616 -IGhhY2tz 33617 -IFJJQ0g= 33618 -INC60LLQsNGA 33619 -INC/0YDQtdC60YDQsNGB 33620 -IGRlcGVuZGVuY3k= 33621 -IOyaqQ== 33622 -IOyxhQ== 33623 -IHfDpGhyZW5k 33624 -IHN1bGxh 33625 -IFBpdHRzYnVyZ2g= 33626 -IGVzZW1waW8= 33627 -vOuhnA== 33628 -cHJvdA== 33629 -IFJvc2Vu 33630 -IEluZGVwZW5kZW5jZQ== 33631 -IHBhcnNsZXk= 33632 -aWVnZW4= 33633 -IGhhdw== 33634 -IGFxdWVsbA== 33635 -IENBUA== 33636 -INGA0LDQsdC+0YLQsNGC0Yw= 33637 -IENsaWZm 33638 -aW9uYXI= 33639 -IHNlY3VyaW5n 33640 -5oiR5YCR55qE 33641 -zr3OtQ== 33642 -IHV0aWxpcw== 33643 -IGNvdWxl 33644 -IFBpbmc= 33645 -IHRyZWs= 33646 -IGZhaw== 33647 -IGVub3JtZQ== 33648 -IOyLqw== 33649 -6K6p 33650 -IGRvdWJsaW5n 33651 -INC90YDQsNCy0LjRgtGB0Y8= 33652 -IGhlZA== 33653 -aG92ZW4= 33654 -IFN0YW5kaW5n 33655 -IG3DrW4= 33656 -IEppbWlu 33657 -IG1vbmFyY2g= 33658 -IGNva2U= 33659 -IG1y 33660 -IGNsaWM= 33661 -w40= 33662 -IGltcGVhY2htZW50 33663 -IGR1cmFiaWxpdHk= 33664 -IHZhcmlvcw== 33665 -IGNvbW1lcmNpYWxz 33666 -IGdyZWV0aW5ncw== 33667 -IFJp 33668 -IEFwcHJlY2k= 33669 -7J6I64qU 33670 -IHLDqXN1bHQ= 33671 -w6lydA== 33672 -IHNhbHV0ZQ== 33673 -IHBvZGVyaWE= 33674 -IHN1bnJpc2U= 33675 -dmVjaw== 33676 -IHJlbHVjdGFudA== 33677 -IGNvbW1pc3Npb25lcg== 33678 -5b+1 33679 -w6J0ZQ== 33680 -IEtlbm55 33681 -IFNpcmk= 33682 -44OD44OX 33683 -IOuKmA== 33684 -IEVF 33685 -IHVuY2g= 33686 -0LrQvtC9 33687 -INin2YTYpQ== 33688 -IGJlbHRz 33689 -IGhhc3M= 33690 -INC80L7Rjw== 33691 -IGRpc3BsYWNlZA== 33692 -IGFicmE= 33693 -zq3Ouw== 33694 -IHNjcmF0Y2hlcw== 33695 -IGNvbWV0 33696 -IGF1dGhvcml6YXRpb24= 33697 -IExMQw== 33698 -IHByb2R1aw== 33699 -IHJlaGFiaWxpdGF0aW9u 33700 -5Z4= 33701 -0ZbRhw== 33702 -dWRpbmc= 33703 -b2xpdA== 33704 -IDEwNQ== 33705 -IGV4cGFuZHM= 33706 -IGFsdHJp 33707 -IEtvbW1lbnQ= 33708 -IGFuZg== 33709 -UGw= 33710 -IE1hbmE= 33711 -ZmVk 33712 -IGJyaQ== 33713 -IG9yYQ== 33714 -R3M= 33715 -IEd1cg== 33716 -dWNrbGFuZA== 33717 -IGp1bmN0aW9u 33718 -IGlyb25pYw== 33719 -IEZlZWQ= 33720 -IHByYWt0 33721 -IEhhbW1lcg== 33722 -jOuPhA== 33723 -IFRyYWN5 33724 -57Wx 33725 -IEFzaWRl 33726 -0L3QtdCz0L4= 33727 -INC40YHQv9C+0LvRjNC30L7QstCw0YLRjA== 33728 -IHphag== 33729 -IGVxdWl0YWJsZQ== 33730 -IGN1cmI= 33731 -IOOBk+OCjA== 33732 -IGRlcml2YXRpdmVz 33733 -IHB1cHBpZXM= 33734 -IEtlbm5ldGg= 33735 -IENvbXBs 33736 -aWdyYW0= 33737 -IEdhcmNpYQ== 33738 -KSI= 33739 -IEhhcmJvcg== 33740 -ZXN0aWFs 33741 -IOS+hg== 33742 -IGVycw== 33743 -5rk= 33744 -IHVud2FudGVk 33745 -IGJlbGFuZw== 33746 -0LDQs9C+ 33747 -ZW1i 33748 -ZG9z 33749 -IOyZnOs= 33750 -IEJ1ZGdldA== 33751 -IGJhdHRsaW5n 33752 -2K3Yqg== 33753 -a29r 33754 -0L3QsNGH0LDQu9Cw 33755 -IHBsYWc= 33756 -IGNhbnRpZGFk 33757 -IGdydXBvcw== 33758 -IHBsdWdpbnM= 33759 -bGVyaW5p 33760 -INC40LzQtdC10YI= 33761 -IHNvenVzYWdlbg== 33762 -b2xpY3M= 33763 -IHB1ZWJsbw== 33764 -IHJlbWluaXM= 33765 -csOkbg== 33766 -IE1vcnJpc29u 33767 -IGxpbmhh 33768 -IGJyZWF0aHM= 33769 -IFRhc3Rl 33770 -IGVuZnJlbnQ= 33771 -IERvY2tlcg== 33772 -INC00LXQvQ== 33773 -IGV0aG5pY2l0eQ== 33774 -IHdvYg== 33775 -IHN1ZmZlcnM= 33776 -IHRyYW5zaXRpb25pbmc= 33777 -IFJhbmdl 33778 -xJlkenk= 33779 -INC60LDRgg== 33780 -IHN5bmVy 33781 -IGRvbnV0 33782 -IHByb2JhYmlsaXRpZXM= 33783 -IE9tYXI= 33784 -V2hpY2g= 33785 -dWlzaA== 33786 -aXNpbg== 33787 -IGRlbW9z 33788 -IOyggOq4sA== 33789 -IOuYkeqwmQ== 33790 -INC10LTQuNC9 33791 -IGNlcnZl 33792 -IGpva2E= 33793 -SUFO 33794 -IGtpbG9tZXRlcg== 33795 -IGhvcml6b250YWxseQ== 33796 -IEJoYWc= 33797 -IC0+ 33798 -IE1vbml0b3I= 33799 -IGtub3dsZWRnZWFibGU= 33800 -IGZhdg== 33801 -IHBpbm5lZA== 33802 -IGVCYXk= 33803 -aWNrZXI= 33804 -IOyeoOq5kOunjA== 33805 -IFhpYW9taQ== 33806 -IGNhcGl0 33807 -IG5w 33808 -IDE5NjU= 33809 -aG9l 33810 -IG5vaw== 33811 -IFNhZ2U= 33812 -INC90LXQu9GM0LfRjw== 33813 -IFRvdw== 33814 -Z2Ft 33815 -IGRpY2Vu 33816 -IFNVQlNDUklCRQ== 33817 -IHJlYm9vdA== 33818 -IHBhag== 33819 -IOuztOyXrOs= 33820 -IHRoaWNrZW4= 33821 -IFJlYWxpdHk= 33822 -aWTDpG4= 33823 -TmE= 33824 -IOqyg+ydgA== 33825 -ISEp 33826 -IHJvdXRpbmVz 33827 -INC+0LTQvdC+0LPQvg== 33828 -IGV4dGluZw== 33829 -IOymnQ== 33830 -IHN1bGZ1cg== 33831 -IGNhcnZl 33832 -IGFzdGVyb2lk 33833 -IFdhcnJpb3I= 33834 -IHBob3RvZ3JhcGhlcnM= 33835 -IHBlbGw= 33836 -IGNyb3Nzb3Zlcg== 33837 -5oiR55+l6YGT 33838 -IGhhY2Vtb3M= 33839 -IE5lag== 33840 -IHNldHRsaW5n 33841 -IGlybQ== 33842 -IEJvb2tz 33843 -aWVudMO0dA== 33844 -IGVzcGFjaW8= 33845 -IFNjaG9sYXJz 33846 -IGRvb21lZA== 33847 -IElSUw== 33848 -d29obA== 33849 -IHNlZ3Vl 33850 -IOuIhOqwgA== 33851 -IHByYXRpYw== 33852 -QlQ= 33853 -IENvbnNpZGVyaW5n 33854 -IEJ1ZmZhbG8= 33855 -IHRyYWluaW5ncw== 33856 -IGdlYnJ1 33857 -IEdsZWljaA== 33858 -IHBpcmF0ZXM= 33859 -IGVudmVsb3A= 33860 -IHJlb3Blbg== 33861 -aW1hdA== 33862 -IHRlZQ== 33863 -IHN1ZWQ= 33864 -ZmVo 33865 -INeU16c= 33866 -IGRpZXRz 33867 -IGp1bnRvcw== 33868 -YXN0bw== 33869 -IG1pc3VuZGVyc3Rvb2Q= 33870 -IHJ1aW0= 33871 -IGNsYXNzaWZ5 33872 -INC/0YDQvtC00YPQug== 33873 -IGluc2U= 33874 -IGlsbHVzdHJhdGVk 33875 -IGNvcnJvc2lvbg== 33876 -IGFjY3JlZA== 33877 -IEF1bnRpZQ== 33878 -INC/0YDQuNCy0LXRgg== 33879 -IExJVkU= 33880 -IHJlaw== 33881 -IHJlY2VpcHQ= 33882 -5Yiw5bqV 33883 -IEJhcmJpZQ== 33884 -IFNuYWtl 33885 -dHVybg== 33886 -SmVmZg== 33887 -44GK44GK 33888 -lYQ= 33889 -Vk9JQ0VPVkVS 33890 -Y29sbA== 33891 -IHJ1bm5lcnM= 33892 -7KCc6w== 33893 -b3Nvcw== 33894 -bW9vbg== 33895 -IGtleW5vdGU= 33896 -IEluc3RpdA== 33897 -U1BFQUs= 33898 -IHBsdWdz 33899 -IGN1cnY= 33900 -IFl1cmk= 33901 -IFRoZXJlcw== 33902 -IFBz 33903 -IM68z4DOvw== 33904 -IGNvbnZlcnRlcg== 33905 -IHJlZmluZQ== 33906 -IGJhZGFzcw== 33907 -IM6/zrk= 33908 -IHJlZ2Vu 33909 -YXp6aQ== 33910 -2YrZgQ== 33911 -IHNlaXplZA== 33912 -IGnDp2Vy 33913 -aWxlZQ== 33914 -IHVwc3RyZWFt 33915 -IGJ1ZHM= 33916 -IHBpbQ== 33917 -IO2VmOujqA== 33918 -IGFsbHVkZWQ= 33919 -IHRoZW1lZA== 33920 -IGNvbnNpc3Rpbmc= 33921 -IGJvbnM= 33922 -dW51eg== 33923 -INC/0YDQvtCy0L7QtA== 33924 -IExvdmVseQ== 33925 -4KWL 33926 -IHBhcmFjaA== 33927 -IFN0YWF0cw== 33928 -6ZqK 33929 -IHNlbGVjdGl2ZQ== 33930 -IGZhc2U= 33931 -IEdlb3JnZXQ= 33932 -IGNvY2FpbmU= 33933 -IHJlcHJvZHVjdGlvbg== 33934 -IExhcmE= 33935 -IExE 33936 -IGdo 33937 -Sm9u 33938 -IGzDpQ== 33939 -IOuRkOs= 33940 -IHR5cGVk 33941 -IEJhbmE= 33942 -65Oc6w== 33943 -IHNhdm9yeQ== 33944 -IFpvbWI= 33945 -c3RhbmRlbg== 33946 -IHBlZGVzdHJpYW4= 33947 -IGRpZmbDqXJlbnRz 33948 -IOyLuA== 33949 -6Imv 33950 -IGNvbXBsYWluZWQ= 33951 -56aP 33952 -INCa0YLQvg== 33953 -INec16Q= 33954 -YWxpxZtteQ== 33955 -IG1vcnRhcg== 33956 -IHZlcmRpY3Q= 33957 -IHN1ZmljaWVudGU= 33958 -IE1pbGxpb24= 33959 -bWl0dGVs 33960 -aW5hbHM= 33961 -INin2YTYrg== 33962 -0LDRjtGB0Yw= 33963 -IG1pxJlkenk= 33964 -IE9sZQ== 33965 -IGludmVydA== 33966 -Y3p5xIc= 33967 -0L7Qt9C80L7QttC90L4= 33968 -c3RhcnRlcg== 33969 -IGF1ZGl0b3I= 33970 -IFNjb3V0 33971 -Y2hpZW4= 33972 -IFN2ZXJpZ2U= 33973 -dWZmbGVk 33974 -IHplaG4= 33975 -IEF1Y2tsYW5k 33976 -IGFyZ2VudA== 33977 -IDE5NzY= 33978 -IEhvZQ== 33979 -IGJvdGhlcnM= 33980 -IHNvY2lhbGlzdA== 33981 -IHBsaWVycw== 33982 -IGVtZXJnZW4= 33983 -IFhQ 33984 -0LXRgNC+0LI= 33985 -TW9yZQ== 33986 -IExldmk= 33987 -IEFuZGVycw== 33988 -aWJpbGlkYWQ= 33989 -IFBhcmVudHM= 33990 -IGluZHVjZWQ= 33991 -7Ja07KQ= 33992 -IGJhbGFuY2Vz 33993 -INCy0YvRiA== 33994 -IHN1Ym1hcmluZQ== 33995 -U3RhcnQ= 33996 -IGRyaWVz 33997 -IHZvbHZlcg== 33998 -IHRpY2tpbmc= 33999 -Y290dA== 34000 -IGZhag== 34001 -cHLDqXM= 34002 -IFNhYmI= 34003 -INC30LDRhw== 34004 -INC/0L7QutGD0L8= 34005 -IGJhcHRpemVk 34006 -IEJyaWxsaWFudA== 34007 -INCR0L7Qsw== 34008 -IG1vdHM= 34009 -Yml0cw== 34010 -IGxhdHRpY2U= 34011 -5oiR6Lef5L2g 34012 -IGNvcmlhbmRlcg== 34013 -IHJlc2lkZW5jeQ== 34014 -eW5j 34015 -IHBpZXJ3c3p5 34016 -IEtub2Nr 34017 -IFphcA== 34018 -INCV0LI= 34019 -6rKs 34020 -5bCP5b+D 34021 -IHVuZXZlbg== 34022 -IEphcw== 34023 -b2Rvcg== 34024 -57+S 34025 -NzQ= 34026 -IFNpdGU= 34027 -IGFjb250ZWNldQ== 34028 -eW1wdA== 34029 -IHRyaWxvZ3k= 34030 -IGxhbnRlcm4= 34031 -IFp1Y2tlcg== 34032 -dmFyaQ== 34033 -d2VsbGluZw== 34034 -IFBvdGF0bw== 34035 -Z29tZXJ5 34036 -IHJlYWN0ZWQ= 34037 -IENocm9u 34038 -IGplZGU= 34039 -YmVlbGQ= 34040 -IHR3ZW50 34041 -IGxhY3Q= 34042 -5qiC 34043 -IHLDqXNl 34044 -IHJlbGVudA== 34045 -IGZ1cm5hY2U= 34046 -IHdpZGdldA== 34047 -IGVhcnRocXVha2Vz 34048 -IEFkanVzdA== 34049 -aWxpdA== 34050 -INij2Yg= 34051 -IGhlYXJpbmdz 34052 -IGRlZmVuZGFudA== 34053 -aXJzaW5peg== 34054 -IGJhc2s= 34055 -Y2ph 34056 -nKg= 34057 -IHJpZmxlcw== 34058 -IGluc3RhbA== 34059 -IEZvcmdpdmU= 34060 -cGljYWw= 34061 -INCe0YfQtdC90Yw= 34062 -IHBldGl0ZXM= 34063 -IGhw 34064 -IHJlbm93bmVk 34065 -IElubg== 34066 -IOyjvOyEuOyalA== 34067 -IGVtcGhhc2l6ZWQ= 34068 -6Zeu6aKY 34069 -IOyeiOyjoA== 34070 -IOqyg+ycvOuhnA== 34071 -44KG 34072 -xZM= 34073 -Z2lsaQ== 34074 -RGF2ZQ== 34075 -IGV4aGF1c3Rpbmc= 34076 -xYJ1Zw== 34077 -IHNjaGVtYQ== 34078 -zrzOrA== 34079 -Y3ljbA== 34080 -IGF1dGFudA== 34081 -IHBhcmNlbA== 34082 -IG1hdGVyaWE= 34083 -IEJlcnJ5 34084 -INGB0LDQvNC4 34085 -IGV4dHJhY3RlZA== 34086 -IFNheWluZw== 34087 -aXNtYXRpYw== 34088 -INC/0L7Qv9GA0L7QsQ== 34089 -IG5ldXJvbg== 34090 -Z3JhcGg= 34091 -nOuptA== 34092 -IGVuY2xvc3VyZQ== 34093 -IEpvaGFubg== 34094 -IGFmdGVybWF0aA== 34095 -0YLQvtCx 34096 -IHXFvHk= 34097 -IHNhbXA= 34098 -MzYw 34099 -IE1laQ== 34100 -IHRhY28= 34101 -IHJlY2VwdG9ycw== 34102 -IHB1bmNoZXM= 34103 -IEhvamU= 34104 -INmH2YbYpw== 34105 -PSIj 34106 -IEFuZ3VsYXI= 34107 -IG11c2lxdWU= 34108 -IHJvbA== 34109 -IMOx 34110 -c3RlcnJlaWNo 34111 -IGNsYW0= 34112 -IFRyZWFzdXJ5 34113 -Y2hlbWljYWw= 34114 -IGFwYXI= 34115 -IGFwcGVuZA== 34116 -IGZvcmJpZA== 34117 -IEhhbWJ1cmc= 34118 -0LDQutC+0LI= 34119 -IOq4iA== 34120 -aWxkYQ== 34121 -IHByZXBhcmF0aW9ucw== 34122 -IG1vZ8SF 34123 -IGNhbWlubw== 34124 -RXJpYw== 34125 -IEJsaW5k 34126 -6IiH 34127 -5bm055qE 34128 -IERpc2NvdmVyeQ== 34129 -7Lig 34130 -54i2 34131 -IGludGVycHJldGVy 34132 -IGJyZWQ= 34133 -IFBzYWxt 34134 -IGRlZmVuZGVk 34135 -7Ims 34136 -IEVyZmFocg== 34137 -IFBlYWNo 34138 -IG1vb25z 34139 -IE9zdA== 34140 -IHNww6ljaWFs 34141 -IGFycml2ZXI= 34142 -IFdpcw== 34143 -dWNp 34144 -IHJvYm90aWNz 34145 -SVZF 34146 -IHNpZWdl 34147 -YXJsYQ== 34148 -IHNlcGFyYXRlcw== 34149 -IFRD 34150 -7Y+w 34151 -cXVpc2l0ZQ== 34152 -IHBhcmVudGhlc2Vz 34153 -0LjQutC1 34154 -56uZ 34155 -IHRyb3Vz 34156 -5bu6 34157 -INGB0LjQu9GM 34158 -IGJlZXJz 34159 -INC/0LvQsNGC 34160 -44GZ44GU44GE 34161 -IHNvbGE= 34162 -IGTDqHM= 34163 -bWluZ2hhbQ== 34164 -aWt0ZQ== 34165 -IG9vcHM= 34166 -IHR3aXRjaA== 34167 -5bCH 34168 -z4g= 34169 -IFNob3VsZG4= 34170 -dXZyZQ== 34171 -IGxlZXI= 34172 -Y3JpcHRpb25z 34173 -IGV5ZXNoYWRvdw== 34174 -IEd1bw== 34175 -IFBvd2VsbA== 34176 -IHN1cHVlc3Rv 34177 -IGFuYQ== 34178 -cmFscw== 34179 -IE1vbnRyZWFs 34180 -IHN1cmZpbmc= 34181 -INCf0LXRgNCy 34182 -157XlQ== 34183 -IG1pbGxpc2Vjb25kcw== 34184 -IHN1YnVyYnM= 34185 -IHBsYW5ldGE= 34186 -0YPRiNC60LA= 34187 -aHJsaWNo 34188 -IEhZ 34189 -INiz25I= 34190 -IE1N 34191 -IEVmZg== 34192 -5Y+v5oSb 34193 -IEhT 34194 -YW5zb24= 34195 -IOyngeygkQ== 34196 -IHN1bw== 34197 -IGRlcGxveWluZw== 34198 -IGt1bnQ= 34199 -dGVyaW5n 34200 -IGVyZWN0 34201 -7J6l7J20 34202 -IOydjOyLnQ== 34203 -IHNwZWNpbWVu 34204 -IS4uLg== 34205 -5oiR6Kqq 34206 -IGxpZ25l 34207 -IGtvbnN0 34208 -YWRlcXU= 34209 -IOyDge2DnA== 34210 -IGFjY2Vzc2Vk 34211 -IFBvbGU= 34212 -a2lsbA== 34213 -IOuyhOs= 34214 -IGF1dGhlbnRpY2l0eQ== 34215 -IGFwcGVsbGU= 34216 -dWxsZQ== 34217 -IHJldmlzaW9u 34218 -IGdvYXRz 34219 -0LPQu9C4 34220 -IHBhdQ== 34221 -IFJhbmdlcg== 34222 -IEltYWc= 34223 -YXV0aG9y 34224 -IGV2ZQ== 34225 -IE1lc3Nlbmdlcg== 34226 -IG5heQ== 34227 -IHdob2xlcw== 34228 -w6R0dGU= 34229 -IG9ud2FyZHM= 34230 -IERlcG9pcw== 34231 -IO2RnO2YhA== 34232 -IFNBUlM= 34233 -IHdzenlzdGtpY2g= 34234 -IGRlc3RydQ== 34235 -dW1iaW5n 34236 -IGNvbXBhdGliaWxpdHk= 34237 -IG1pc2luZm9ybWF0aW9u 34238 -b2RvcmU= 34239 -IEZhdm9y 34240 -ZWtv 34241 -j4w= 34242 -d2F1a2Vl 34243 -IFRlYWNoaW5n 34244 -IEtP 34245 -IGJldHRpbmc= 34246 -IHF1ZXN0cw== 34247 -IHZpdnJl 34248 -INC80YPQt9GL 34249 -IHNhZ2E= 34250 -IHN3ZWxs 34251 -IGdlaGU= 34252 -5oCO6bq85qij 34253 -INC+0YDQs9Cw0L3QuNC3 34254 -IGdpZGU= 34255 -IEdyb3Nz 34256 -IGRhbGVq 34257 -IGNsYXdz 34258 -4buZYw== 34259 -IHByZWp1ZGljZQ== 34260 -IGluc2lnbg== 34261 -aWhvb2Q= 34262 -IHBsZWQ= 34263 -IGTDs25kZQ== 34264 -IFBvbGl0aWNhbA== 34265 -IHByZW1pc2Vz 34266 -dW5kZXJ0 34267 -2LnYqg== 34268 -b25uZW4= 34269 -IGVzcGHDp28= 34270 -IGbDqQ== 34271 -IEhhcnJpc29u 34272 -IENlbnN1cw== 34273 -IGNhcmRpbw== 34274 -IGRpeQ== 34275 -IG1pbGlldQ== 34276 -IGpvdXJuw6ll 34277 -IFJlbGVhc2U= 34278 -TklF 34279 -IE11aw== 34280 -aWTDqWU= 34281 -4buNaQ== 34282 -IGnDp2luZGU= 34283 -npk= 34284 -IHJlc29uYXRl 34285 -IG1vbGVz 34286 -IEZseWluZw== 34287 -IEdsb3JpYQ== 34288 -IFBhc3Rvcg== 34289 -IEFyZW5h 34290 -5aW95LiN5aW9 34291 -Tk9O 34292 -0L7Qu9C+0LI= 34293 -IGFsbMOt 34294 -b21hdA== 34295 -7Ja064+E 34296 -IGNhcmFjdGVyw61zdA== 34297 -IGRlY2xpbmluZw== 34298 -0ZbRjw== 34299 -YW5jbw== 34300 -IEluZm9ybQ== 34301 -IGJhcmdhaW4= 34302 -IGJ1c2hlcw== 34303 -IE5hdHVyYWxseQ== 34304 -IHJlY2h0cw== 34305 -IFRlbnNvcg== 34306 -IFBhdHJpY2lh 34307 -IHByaW5jaXBpbw== 34308 -IE11bWJhaQ== 34309 -IHdvbWI= 34310 -IG5vc3RyYQ== 34311 -IGRpbGVtbWE= 34312 -IGlyZ2VuZHdhbm4= 34313 -IDE5NjQ= 34314 -IGVuZXJnw61h 34315 -INC90LDRgA== 34316 -IHNlZ3JlZ2F0aW9u 34317 -IEF0aGxldA== 34318 -IMK7LA== 34319 -IHllbmk= 34320 -IFNlaXQ= 34321 -IHZlbm9t 34322 -IGRha2lrYQ== 34323 -IOuPjOs= 34324 -IMOJbA== 34325 -IGZ1cw== 34326 -IE1vZw== 34327 -pr3ri4jri6Q= 34328 -IHJlbWFy 34329 -IFRlZGR5 34330 -IGJyZWFzdHM= 34331 -aWNhbnM= 34332 -5pS255yL 34333 -a2Fw 34334 -IGjGoW4= 34335 -IEpQ 34336 -44Oz44K/ 34337 -IHJlc3VycmVjdA== 34338 -IOyduOs= 34339 -aGVyaWNhbA== 34340 -IGZvdG9ncmFm 34341 -IEpvc8Op 34342 -IGxpdmVsaWhvb2Q= 34343 -IGJpYmxp 34344 -dGVyaQ== 34345 -IHZvcnN0ZWxsZW4= 34346 -IEFBQQ== 34347 -IGFzc2Vzc2luZw== 34348 -WUE= 34349 -IHNwbGVuZA== 34350 -IGV4Y2F2 34351 -IGJhcHRpc20= 34352 -eWxs 34353 -d293 34354 -TWFj 34355 -IHBsYXN0aWNz 34356 -dGVva2Jva2tp 34357 -IGludMOpcmVzc2FudA== 34358 -IGNvbW1hbmRlZA== 34359 -IGZhbW91c2x5 34360 -INCY0LvQuA== 34361 -IE1hbnVlbA== 34362 -IHNvdXRod2VzdA== 34363 -IGRlZm9ybWF0aW9u 34364 -w61jdWxv 34365 -INC90LDRhdC+0LTQuNGC0YHRjw== 34366 -IFBhdHRlcg== 34367 -ZGVncmVl 34368 -IGN6xJlzdG8= 34369 -Ii0= 34370 -IOyFiw== 34371 -IG1hbmdlcg== 34372 -IFRydXN0ZWU= 34373 -gOumrA== 34374 -IHB1bnRvcw== 34375 -aXZhYmxl 34376 -IHZvbGF0aWxl 34377 -IOuKkA== 34378 -IGluc3RhYmlsaXR5 34379 -IGNpZWw= 34380 -Y2nEhQ== 34381 -IHB1cml0eQ== 34382 -0L3QvtGB0YI= 34383 -U2ls 34384 -ZWRhcg== 34385 -5Zmo 34386 -Tk9VTkNFUg== 34387 -IHNwZWxsZWQ= 34388 -R0VS 34389 -IHNhbmN0dWFyeQ== 34390 -IGFjY2VsZXJhdGluZw== 34391 -IHNjb3V0 34392 -INC/0YDQtdCy 34393 -ZmFocmVu 34394 -44GT44Gh44KJ 34395 -IOuCmOyYqA== 34396 -IHBvY3rEhXQ= 34397 -IE1ldQ== 34398 -a2Fhcg== 34399 -s7Tqs6A= 34400 -YWtyYQ== 34401 -RG93bg== 34402 -IMOEcg== 34403 -IEVsaXRl 34404 -IGFsbG9ucw== 34405 -IG1heW9ubmFpc2U= 34406 -IFN1c3RhaW4= 34407 -cHJpc2luZ2x5 34408 -IHN1cGVydmlz 34409 -IOq3uOugh+yjoA== 34410 -IHVuZW1wbG95ZWQ= 34411 -IGZyZXNobHk= 34412 -INee16I= 34413 -IERo 34414 -IHRhY2tsaW5n 34415 -IG9ncg== 34416 -IOy0iOs= 34417 -44KI44KN 34418 -IGxvZnQ= 34419 -YXJhaA== 34420 -IEFpcmw= 34421 -IERpcg== 34422 -INCc0L7QttC90L4= 34423 -IGJvb2tpbmc= 34424 -IENSQQ== 34425 -IGh0dHBz 34426 -IGNob2tl 34427 -IGdvd24= 34428 -IG5vaXRl 34429 -IHphYw== 34430 -aXN0b2w= 34431 -IHNlY3Jl 34432 -IHJlc2VtYmxlcw== 34433 -IGN1YWQ= 34434 -7IKs6rCA 34435 -c2hvdw== 34436 -IGJsYW5j 34437 -IGFndQ== 34438 -IFByaW50 34439 -YXN0ZWQ= 34440 -IFdlYXRoZXI= 34441 -aXBs 34442 -IG9ic2N1cmU= 34443 -IGNvbnRl 34444 -b3VnaHM= 34445 -KTs= 34446 -IERhbWU= 34447 -5LiA55u0 34448 -IGNsYXJpZmljYXRpb24= 34449 -IGludGltYWN5 34450 -IHVwaG9sZA== 34451 -IE1pcnJvcg== 34452 -IHdhZ29u 34453 -eGlkZQ== 34454 -IGNsb2c= 34455 -YXBwZXI= 34456 -IEltbWVkaWF0ZWx5 34457 -w7pkZQ== 34458 -IHRvdWNoZG93bg== 34459 -IHJvb2Z0 34460 -0LDRiNCw 34461 -IMOnxLFrdA== 34462 -IGxhaXNzZXI= 34463 -IFVucmVhbA== 34464 -ZW5zaXRpdmU= 34465 -IDEyMw== 34466 -IHBsYXN0ZXI= 34467 -IGR1Y2tz 34468 -IGV0bWU= 34469 -IGJpc2hvcA== 34470 -YnJldmk= 34471 -IGJpYw== 34472 -5LiL5Y67 34473 -IHJ1bnRpbWU= 34474 -IGFtYml0aW9ucw== 34475 -0LzQsNGC 34476 -IFdlaW4= 34477 -IE1hcmk= 34478 -IO2KuOs= 34479 -IHJlc29sdmVy 34480 -IG5nw6B5 34481 -IFJpc2U= 34482 -44KI44GG44Gr 34483 -IENydXM= 34484 -IG1lcmNoYW5kaXNl 34485 -IGVsaQ== 34486 -IHN0YXRld2lkZQ== 34487 -IG93bA== 34488 -6YGg 34489 -5pS5 34490 -IHR3aXN0aW5n 34491 -IGNvbnRhbWluYXRlZA== 34492 -IENvbW1lcmNl 34493 -aHl0aG0= 34494 -IMOI 34495 -IOyLpOs= 34496 -IG11c3N0ZQ== 34497 -dWly 34498 -IHN1bXM= 34499 -IFNvbWV3aGVyZQ== 34500 -44OO 34501 -IGthbWk= 34502 -IGFpcmVk 34503 -IEFORFJFVw== 34504 -IOq6 34505 -IHZpZW5kbw== 34506 -IGFudGlib2R5 34507 -IGFic29sdW1lbnQ= 34508 -IHByb3Rlc3RlcnM= 34509 -IFF1w6liZWM= 34510 -c3RhZHQ= 34511 -U2hhdW4= 34512 -IGNoYW1iZXJz 34513 -IFdlYXI= 34514 -IEVmZmVjdHM= 34515 -IGhhemFyZHM= 34516 -IG5laQ== 34517 -IGNvcmF6w7Nu 34518 -IOG8 34519 -IFNH 34520 -lKk= 34521 -IOyXreyLnA== 34522 -IGNvbWZ5 34523 -IENvZHk= 34524 -IHBlbnNhbmRv 34525 -IGdhbnNrYQ== 34526 -IEFjcm9zcw== 34527 -w7ZsbGln 34528 -YWJ5dGU= 34529 -IHdlZGdl 34530 -IGthbGlhbg== 34531 -IHNpZ3Vl 34532 -ZW5kZXM= 34533 -IEdyb8Of 34534 -IHV0aWxpc2Vy 34535 -IGZsb3du 34536 -0LDQvdC40Y4= 34537 -IGxldmFy 34538 -cmVzdHJpYWw= 34539 -IGlsbHVzdHJhdGlvbnM= 34540 -IGFzbMSxbmRh 34541 -QkxFRVA= 34542 -INC00L7RgdGC 34543 -IHR1cnJldA== 34544 -IHN1aXRjYXNl 34545 -emnEmWtp 34546 -IHNrZXRjaGVz 34547 -IGFjcmVk 34548 -IFJlaQ== 34549 -IHRzdW4= 34550 -IFNhZw== 34551 -IHRoaXJkcw== 34552 -IEtJUkJZ 34553 -cmFp 34554 -IGh1bWFub3M= 34555 -IHJlY29tbWVuZHM= 34556 -IGV4dHJhb3JkaW5hcmlseQ== 34557 -IGNvbW1lbmNlbWVudA== 34558 -S04= 34559 -b3Bleg== 34560 -INeR16k= 34561 -IGxldGhhbA== 34562 -IEVzdGFtb3M= 34563 -IGluc3BlY3Rvcg== 34564 -IFNlb2s= 34565 -ZXVu 34566 -IG9mZnNob3Jl 34567 -IGdldHRpbg== 34568 -eWVhcnM= 34569 -IFNpbGVuY2U= 34570 -IE5hdHVy 34571 -dXB1bg== 34572 -IHRyenk= 34573 -IG5vZ2V0 34574 -IGhhbWJ1cmdlcg== 34575 -IFByYWlzZQ== 34576 -w6luZA== 34577 -IDE5NzE= 34578 -eWxpZQ== 34579 -a3JpdA== 34580 -IOyDneqwgeydtA== 34581 -55qu 34582 -IG1vbWVudG9z 34583 -IGVzdMOp 34584 -IGRpc3NlbWlu 34585 -IGdpZ3M= 34586 -IGRlc2Fm 34587 -IGF2aXM= 34588 -IFpvbw== 34589 -IOyViuydgA== 34590 -aMOkbmc= 34591 -5Y+l 34592 -aGFrZQ== 34593 -IEJpc20= 34594 -IHJldGhpbms= 34595 -IE1hbGNvbG0= 34596 -IGlkZW50aWZpZXM= 34597 -bG93ZXI= 34598 -aXhlbA== 34599 -IHR2w6U= 34600 -a2Vk 34601 -aWVyeg== 34602 -IMO2ZmZlbnRsaWNo 34603 -IHByb2NsYWlt 34604 -c29vbg== 34605 -bG9s 34606 -IGxvaQ== 34607 -IGJpdHRlbg== 34608 -cm9sbG8= 34609 -IHNlcm1vbg== 34610 -IGVzcXU= 34611 -IGphY2tldHM= 34612 -IGdyw6FmaWM= 34613 -INC/0L7QutCw0LfRi9Cy 34614 -IGNhYmV6YQ== 34615 -Y2hvZHpp 34616 -IHBlbHZpcw== 34617 -IG5vc3RhbGdpYQ== 34618 -IGJyZXc= 34619 -IHNob3J0Y3V0cw== 34620 -IEFkZW3DoXM= 34621 -IHN1cGVyZmljaWFs 34622 -5YWp5YCL 34623 -IGJvY2E= 34624 -IOaIkeaYrw== 34625 -aW1lbnRvcw== 34626 -5Zug5Li6 34627 -IHNwcm91dHM= 34628 -6aOb 34629 -IEpvbmFz 34630 -IEZsb3JlbmNl 34631 -c3RhdGlj 34632 -ZGF1Z2h0ZXI= 34633 -Kik= 34634 -xYJieQ== 34635 -ZmFzaGlvbg== 34636 -IEdpbmdlcg== 34637 -IOunpOs= 34638 -IGh1c3RsZQ== 34639 -dXRvcw== 34640 -INGC0Y/Qtg== 34641 -IEzDtnM= 34642 -16nXmded 34643 -YW55Y2g= 34644 -dHViZXI= 34645 -IHRpZHk= 34646 -IGZyb250YWw= 34647 -IHdoaXNrZXk= 34648 -IGh1bWlk 34649 -IM6f 34650 -IHJpZGdl 34651 -IG1hcmlu 34652 -IGJpZW50w7R0 34653 -IENhcnJpZQ== 34654 -Y2h3 34655 -IHRhaHVu 34656 -IEVyZ2Vi 34657 -RlI= 34658 -IOygleu2gA== 34659 -IFNvbGRpZXI= 34660 -IGVubGlnaHRlbm1lbnQ= 34661 -IGV4YW1pbmluZw== 34662 -IE5vdHJl 34663 -IGVyYW0= 34664 -IFN1bm55 34665 -IGxheWVyZWQ= 34666 -IERhenU= 34667 -cmFkZXM= 34668 -5aW95ZCD 34669 -INC90LDRiNC10Lk= 34670 -IHRpbWJlcg== 34671 -IG1hbm5lcnM= 34672 -IEJpcm1pbmdoYW0= 34673 -IG1pbmlhdHVyZQ== 34674 -b21ldGVycw== 34675 -IGZpbGxlcg== 34676 -IFJpcA== 34677 -IEtvbWI= 34678 -b3duZXI= 34679 -7L8= 34680 -aWRpYW4= 34681 -IGRlbcOhcw== 34682 -INmI2Ko= 34683 -IHByZWNhdXRpb25z 34684 -IGdvdmVybm8= 34685 -emVsZg== 34686 -IENvbXBsZXRl 34687 -5biD 34688 -IFBoYW50b20= 34689 -44G+44Ga 34690 -INC90LXQtw== 34691 -INC60LDRgNGC 34692 -IEFudHdvcnQ= 34693 -IFBmaXplcg== 34694 -IEZyYW5jbw== 34695 -IHfFgg== 34696 -IGZyaWc= 34697 -ZXNwZXI= 34698 -IGthbGU= 34699 -IGZpbG1tYWtlcg== 34700 -IGt1cnQ= 34701 -IGludmFsaWQ= 34702 -5bGA 34703 -YXJlbGxh 34704 -xINuZw== 34705 -cmFtZW50bw== 34706 -IG51dHJpdGlvbmFs 34707 -IGRpY3RhdG9ycw== 34708 -IGFmaW4= 34709 -IGZ1enp5 34710 -IEdpbmE= 34711 -w7N0 34712 -IEV4dHJlbWFkdXJh 34713 -IGRlbW9uc3RyYXRpb25z 34714 -IE1vbnRnb21lcnk= 34715 -7ZW07ISk 34716 -IEdhbmRoaQ== 34717 -44Od 34718 -572u 34719 -IHJldW5pb24= 34720 -IGpha2nFmw== 34721 -IFp1Zw== 34722 -T1VHSA== 34723 -bGlmdGluZw== 34724 -IOCy 34725 -4bmb4bmj 34726 -ZWI= 34727 -IFdPVw== 34728 -IFNoaXZh 34729 -b21ldHJ5 34730 -IHdpbGRseQ== 34731 -IHRlbmRlZA== 34732 -IG1lZ2Fw 34733 -7LKY 34734 -IG5hdXNl 34735 -IGdlcmVr 34736 -44OL 34737 -IE1hcmNlbA== 34738 -IG5lc3Rl 34739 -2K7YsQ== 34740 -IGZlaA== 34741 -5YaF 34742 -c3VzcGVuc2VmdWw= 34743 -IFdyZXN0bGU= 34744 -IFBhbGVzdGluaWFucw== 34745 -IEdPUkQ= 34746 -aXlldA== 34747 -INGA0LDQtNC4 34748 -IHZlcnN1Y2hlbg== 34749 -IHRyYW5zaXN0b3I= 34750 -INCf0YDQvtGB0YLQvg== 34751 -INC/0L7QvdGA0LDQsg== 34752 -IHJoeW1l 34753 -IFZlcm1vbnQ= 34754 -cGxhdHo= 34755 -6K6w 34756 -IMSwxZ90ZQ== 34757 -IEhhZw== 34758 -INCY0Lw= 34759 -INGA0LDRgdGB0LrQsNC3 34760 -IG1ldHJvcw== 34761 -IEluZmluaXR5 34762 -d29sZg== 34763 -aWJhbA== 34764 -ZnRpZw== 34765 -INqG 34766 -IO2YueyLnA== 34767 -IG9nZ2k= 34768 -IGRpc3Bvc2l0 34769 -INC/0YDQuNC7 34770 -INCy0YvQv9C+0Ls= 34771 -IHRow7Rp 34772 -IEtFTk4= 34773 -IGhhbmRpbmc= 34774 -YWN0dXM= 34775 -IHRhY29z 34776 -IGZvcm1lcmx5 34777 -IENvcmludGhpYW5z 34778 -44Gr44Gv 34779 -0YbRltGX 34780 -IHBhZHJl 34781 -IGNvbmdyZWdhdGlvbg== 34782 -5pE= 34783 -ZmVydA== 34784 -IHN1Ymly 34785 -YWlzZXI= 34786 -cXVh 34787 -YXJhb2g= 34788 -IEN1cnJ5 34789 -IOyViuuKlA== 34790 -0LXQu9GO 34791 -IGZ1c3M= 34792 -IGJvb3R5 34793 -IGxvd3M= 34794 -IGhvbW1lcw== 34795 -IE1I 34796 -IERpc25leWxhbmQ= 34797 -d2VudA== 34798 -IHJlc2lkdWU= 34799 -IGJlZXBpbmc= 34800 -6LyV 34801 -w6R0dGE= 34802 -IG1vdWxk 34803 -IFByb2pla3Q= 34804 -c3RhbGs= 34805 -IGFydGlmYWN0 34806 -IEFudHJhZw== 34807 -IEFNRA== 34808 -IENyeXB0 34809 -IOuplA== 34810 -IEZlbGlwZQ== 34811 -IENPQg== 34812 -ZWx1 34813 -IHNlbGZpZXM= 34814 -IFNhbnRp 34815 -Y2h1dHo= 34816 -INCj0LrRgNCw0Zc= 34817 -Z2VzYW10 34818 -IGZsb2Nr 34819 -amF6 34820 -cGxhaW4= 34821 -IHdyaW5rbGVz 34822 -IHJlYWlz 34823 -IHBhbGpvbg== 34824 -IGVtcG93ZXJtZW50 34825 -IGF0dGVuZGVlcw== 34826 -cHBh 34827 -IG5lZGVu 34828 -0L7QvdGL 34829 -IHRpbWVmcmFtZQ== 34830 -IENoZXJyeQ== 34831 -IGlkw6ll 34832 -IGdhZw== 34833 -IGRvbmtleQ== 34834 -IMO0bmc= 34835 -IEhhcmU= 34836 -6Zqb 34837 -IEthcmE= 34838 -IGFjb21wYW4= 34839 -cGxhY2Vz 34840 -aW1pZW50b3M= 34841 -IEhhbW0= 34842 -0LHQuA== 34843 -dWJlbg== 34844 -aWxpeW9y 34845 -IHRoaXJzdA== 34846 -IGtyeQ== 34847 -IEdlb3JnZXRvd24= 34848 -16DXlA== 34849 -IG9yY2g= 34850 -IGhlYXJ0YmVhdA== 34851 -IHRyYW5zZm9ybWF0aW9ucw== 34852 -ZXN0b25lcw== 34853 -IEtI 34854 -IGNhcnRvb25z 34855 -IGFuY2k= 34856 -IHdvcnRobGVzcw== 34857 -IHRhaWxvcmVk 34858 -cHU= 34859 -QW1lcmljYW5z 34860 -IHBpbGVz 34861 -IE1vbmtleQ== 34862 -IGJhc2lu 34863 -IFRlbXBlcg== 34864 -IFBhaW50 34865 -IHB1bmNoaW5n 34866 -IGJhaWs= 34867 -IE9ha2xhbmQ= 34868 -dnJl 34869 -xZ9hbGxhaA== 34870 -eWRk 34871 -IGNhc3VhbGx5 34872 -b2R1 34873 -IGNvZGVk 34874 -IE5vcndlZ2lhbg== 34875 -IFZpbmNl 34876 -IHByZW1hdHVyZQ== 34877 -IFByb21pc2U= 34878 -0LXQutGB0YI= 34879 -IGRldmFzdGF0ZWQ= 34880 -IFByZW1pdW0= 34881 -IFBhcmFt 34882 -IMOWeWxl 34883 -dW11eg== 34884 -UE8= 34885 -cmF0b3Jz 34886 -IGxhbXBz 34887 -IHRlcnJpdG9yaWFs 34888 -IGJhY2tib25l 34889 -bGlzdGVk 34890 -RFk= 34891 -INin2YTYsQ== 34892 -IHB1cnN1ZWQ= 34893 -IENvbW1vbnM= 34894 -IOqzoQ== 34895 -bG9ja3M= 34896 -ZWRvcg== 34897 -IGNvbmNlaXZlZA== 34898 -Z2VyZQ== 34899 -IGRpc2FwcGVhcmluZw== 34900 -IFN1bGw= 34901 -IOyXsOs= 34902 -IGhvZmZl 34903 -IGRldG94 34904 -7ZSM 34905 -IHJldGly 34906 -IOuBneuC 34907 -IHBlcmd1bnRh 34908 -IEJPWQ== 34909 -57K+ 34910 -IHBlbm4= 34911 -5p2l5LqG 34912 -aMOpcw== 34913 -aG9u 34914 -IGNhdGFzdHJvcGhpYw== 34915 -IGF1c3Q= 34916 -IHRvcnNv 34917 -IOyWtOuKkA== 34918 -IOyCrOuejOuTpOydtA== 34919 -IG1hcnZlbG91cw== 34920 -IEhhcmxleQ== 34921 -YWNoaW5l 34922 -IHRp4bq/ 34923 -aXR0bw== 34924 -IEnDrW0= 34925 -eWxvbg== 34926 -IHNodXRkb3du 34927 -Licn 34928 -IGFwb2xvZ2llcw== 34929 -IENvbW11bmljYXRpb24= 34930 -INCz0L7QstC+0YDRjg== 34931 -44GC44O8 34932 -4oSi 34933 -w612ZWlz 34934 -YWN1bg== 34935 -IHJldGFpbmluZw== 34936 -IGNvbnRyYWRpY3Rpb24= 34937 -IEFEQU0= 34938 -Q09N 34939 -QnJ5YW4= 34940 -IE1vbnNpZXVy 34941 -IGFkYXB0aW5n 34942 -0KjQkA== 34943 -IFNjcg== 34944 -w6RuZGVydA== 34945 -IHBsYXVz 34946 -5LuK5aSp55qE 34947 -IG9uc2V0 34948 -IGFzc2lzdGFudHM= 34949 -IHZhbHZlcw== 34950 -IHNjYXR0ZXI= 34951 -IFJ1c3Q= 34952 -YXdpYQ== 34953 -IHJlYWRpbmVzcw== 34954 -IHBhaXM= 34955 -IGJpYmxl 34956 -IGFtYmllbnRl 34957 -INCw0LzQtdGA0LjQug== 34958 -IHVuY29uZA== 34959 -IGthbGs= 34960 -5Yqo 34961 -IG1vYw== 34962 -dW5u 34963 -IGFjdHU= 34964 -IGh1bW1pbmc= 34965 -aXNzaW1v 34966 -IFBhdHJvbA== 34967 -Z293 34968 -44Ok 34969 -IFRIRVk= 34970 -IEJvZGVu 34971 -IEJpZQ== 34972 -IHJlZWw= 34973 -INGD0YHQu9C+0LI= 34974 -IGVuZGVhdm9y 34975 -IFBlcmlvZA== 34976 -dXN0b21lZA== 34977 -bWFscw== 34978 -YWxvbg== 34979 -Qm94 34980 -IM+DzrHPgg== 34981 -IG9tZGF0 34982 -IGFsdHJl 34983 -IEhlaA== 34984 -a2Fk 34985 -IHByb3RlY3Rvcg== 34986 -IGRvbWluYW5jZQ== 34987 -b2R5bmFtaWM= 34988 -IGNvbW11bmljYXRlZA== 34989 -a8O2 34990 -IHByZWRlY2Vzc29y 34991 -IEx1aw== 34992 -IEZsb3dlcg== 34993 -IOOBqQ== 34994 -cG9xdWU= 34995 -0YLQuNGA0L7Qsg== 34996 -IHJldHJvc3BlY3Q= 34997 -IGRlY2lzaXZl 34998 -IGV4ZW1wZWw= 34999 -e1w= 35000 -IFLDvGNr 35001 -cml0ZQ== 35002 -IFpldXM= 35003 -IGNhbG9yaWU= 35004 -IGF0dHJhY3Rpb25z 35005 -IEhpbnRlcg== 35006 -IHVobQ== 35007 -IO2MkA== 35008 -IHJ1bGVycw== 35009 -IGRpc2NvdXJhZ2Vk 35010 -IGFjb250ZWNlcg== 35011 -IGFjY2VudHM= 35012 -IE9wdGlt 35013 -IEFsZw== 35014 -a2lkcw== 35015 -MjAyMQ== 35016 -IExpbmRzYXk= 35017 -IGZpbG1tYWtlcnM= 35018 -cHJvd2Fk 35019 -IHRlcnVn 35020 -64u0 35021 -IFNvbW1lcg== 35022 -MjAxOA== 35023 -IGJvcnJvd2luZw== 35024 -IFRyYW5zZmVy 35025 -0L3QvtC/ 35026 -YXJpYXM= 35027 -IGhlYWRwaG9uZQ== 35028 -7Lyc 35029 -IHRyYW5zbGF0aW5n 35030 -IGF1Zmdl 35031 -4K6q4K6f 35032 -d2Vpcw== 35033 -YXZhbnQ= 35034 -cGFpZA== 35035 -YmFieQ== 35036 -IHRvdWdoZXN0 35037 -IHJlcGVhdHM= 35038 -IFRlcmVzYQ== 35039 -TG9yZA== 35040 -IGFjYWJhcg== 35041 -IFJpZGU= 35042 -ZGly 35043 -IGxlbmc= 35044 -IGR3YQ== 35045 -IGhlYWRhY2hlcw== 35046 -IG7hu69h 35047 -INC90LDRgdGC0L7Rj9GJ 35048 -IGJvaWxz 35049 -IGxvbmdpbmc= 35050 -cmlhcw== 35051 -w7NyaW8= 35052 -IFBhcmFkaXNl 35053 -IFNlw7Fvcg== 35054 -ZXJkZW0= 35055 -IHJlaW5zdA== 35056 -IHNhbGFyaWVz 35057 -IGluc2VjdXJpdHk= 35058 -xYJvxZtjaQ== 35059 -INCw0LHRgdC+0LvRjtGC0L3Qvg== 35060 -aW5rZW4= 35061 -IEVkZHk= 35062 -dWRvcw== 35063 -IGR1bW15 35064 -0JrQsNC6 35065 -c2l4 35066 -IGluYm94 35067 -4bqp 35068 -UGVvcGxl 35069 -4buTbmc= 35070 -IG9yZ2FuaXplcnM= 35071 -ZmluZA== 35072 -IMO8bA== 35073 -IENPTQ== 35074 -xbxh 35075 -d2VpbGU= 35076 -Q29tbWVudGFyeQ== 35077 -7Yq466W8 35078 -IE1pdHRlbA== 35079 -a3Vz 35080 -6JuL 35081 -4KSo 35082 -aXJhbA== 35083 -IGdhcm1lbnQ= 35084 -zrnOus6s 35085 -IHN0b29s 35086 -cGF5ZXJz 35087 -IHNoaW1tZXI= 35088 -IE9sbGll 35089 -IEplxbxlbGk= 35090 -6L+Y5pyJ 35091 -IDE5Nzc= 35092 -IGpldXg= 35093 -IGV4dGluY3Q= 35094 -IFRyYW5zcG9ydGF0aW9u 35095 -IE1ha2Vy 35096 -IGpvaG4= 35097 -IHJpY2hlc3Q= 35098 -IHRyYXVtYXQ= 35099 -IGxpZWdlbg== 35100 -tOulvA== 35101 -6L+Z6YeM 35102 -IHVucmVzdA== 35103 -IFN0cmF3 35104 -5ouc5ouc 35105 -IGNvbWE= 35106 -IEtyaXN0ZW4= 35107 -INCa0L7QvdC10YfQvdC+ 35108 -IEJyeWNl 35109 -INGP0LrRlg== 35110 -IHBlYXJscw== 35111 -INC/0L7QvdC40LzQsNGO 35112 -IGFkZGl0aW9ucw== 35113 -IGFzeW1wdA== 35114 -INC80LXQvdGM0YjQtQ== 35115 -IHNjYW5z 35116 -Q2hpbGQ= 35117 -IEhpZGU= 35118 -0LrRg9GO 35119 -ZXRhcw== 35120 -IGRhbms= 35121 -IHBsZWFz 35122 -IGVzc2F5cw== 35123 -IGpldHM= 35124 -5YWS 35125 -INCy0LXQtA== 35126 -IHBvc2l0aXZlcw== 35127 -aG9m 35128 -LSk= 35129 -enpv 35130 -IHN0YXJ0ZXJz 35131 -IHNtaWxlZA== 35132 -IDE5NDQ= 35133 -cXVpZXJh 35134 -IHJvaw== 35135 -IHB1ZXN0bw== 35136 -Tmljbw== 35137 -IHNpbXVsYXRpb25z 35138 -IOC2 35139 -IGludHJpZ3VlZA== 35140 -IE92ZXJ3YXRjaA== 35141 -5ZaC 35142 -c2lnaA== 35143 -YmFp 35144 -IOunkOqzoA== 35145 -aWTDqQ== 35146 -IGNyYWJz 35147 -4bqtcA== 35148 -IElyYXFp 35149 -7J2066W8 35150 -0YLRjw== 35151 -IFNvcGhpYQ== 35152 -IEROUw== 35153 -IMO2bmVtbGk= 35154 -IEx1bw== 35155 -naQ= 35156 -IENvdW5zZWw= 35157 -bGlnZW4= 35158 -0LDQvdGM0YjQtQ== 35159 -IHRydW1wZXQ= 35160 -IGRhcGF0 35161 -IEpN 35162 -IEVWRVJZ 35163 -IOWwjeS4jeWwjQ== 35164 -5aSi 35165 -IExheWVy 35166 -IGPDtA== 35167 -0L3QsNC7 35168 -IEpvbw== 35169 -IEhhY2s= 35170 -IHN1bnQ= 35171 -IExlb25hcmQ= 35172 -IEZpcmViYXNl 35173 -w6RuZ2Vy 35174 -IGV4cGxvZGluZw== 35175 -dm95 35176 -IOymkA== 35177 -INGB0LXRgNGM 35178 -IHNldmVyaXR5 35179 -IGJlc3RpbW0= 35180 -57WQ5p6c 35181 -IHRpcmluZw== 35182 -IHByb2N1cmVtZW50 35183 -IGRpcGxvbWFjeQ== 35184 -IGRlY29yYXRpdmU= 35185 -INmK2Kc= 35186 -IHBlbmV0cmF0aW9u 35187 -1as= 35188 -IG91dHJpZ2h0 35189 -RU5F 35190 -IFVuaQ== 35191 -b2RsZXM= 35192 -IHplcm9z 35193 -IGRlbGlnaHRmdWw= 35194 -am0= 35195 -IGRvcG8= 35196 -5rKh5LqL 35197 -IHBvc2l0aXZpdHk= 35198 -IFZJU1RB 35199 -IFJlc291cmNl 35200 -7YOA6w== 35201 -0YjQuNC1 35202 -Q2FybA== 35203 -IHBpcGluZw== 35204 -IGNob3BwaW5n 35205 -IEdhbnpl 35206 -w7xzcw== 35207 -IEFv 35208 -IHNoYXR0ZXJlZA== 35209 -IERldGVjdGl2ZQ== 35210 -IHVuZG91YnRlZGx5 35211 -IGhhbGx1Yw== 35212 -IGVuY2g= 35213 -0YvRh9C90L4= 35214 -0YPQu9GP0YA= 35215 -aXNlc3Rp 35216 -IHBlZGFscw== 35217 -IGR1cnVt 35218 -pO2U 35219 -bGFpbWVy 35220 -IHByb3ByZQ== 35221 -Q3U= 35222 -IHRyYW5zbGF0b3I= 35223 -IGNhxYI= 35224 -IOq3uOqxuA== 35225 -IGNhxYJ5 35226 -VUE= 35227 -IHJldmlzZWQ= 35228 -INC/0L7QtNC+0LE= 35229 -IEFydGljbGU= 35230 -IEhhaXRp 35231 -IMOT 35232 -IEN0cmw= 35233 -IHJvem0= 35234 -bGFpdA== 35235 -IGxldHp0ZQ== 35236 -aXNwZXJpbmc= 35237 -ZGlzcGxheQ== 35238 -IGFsdW1pbml1bQ== 35239 -IHBhbGFicmFz 35240 -IGNvbm9jZXI= 35241 -IHppdHRlbg== 35242 -IGRpcmln 35243 -5Y+q5pyJ 35244 -IGJyYWluc3Rvcm0= 35245 -IHdpZmk= 35246 -IFBhcnRpY2lw 35247 -IHZpZXdwb2ludA== 35248 -IFF1YW4= 35249 -IGhpZXJhcmNo 35250 -V2VsY29tZQ== 35251 -5a++ 35252 -IG9mZmVu 35253 -IFJlY292ZXJ5 35254 -Z2Fubw== 35255 -V291bGQ= 35256 -IHJlcHJv 35257 -IHBlcmNlcHRpb25z 35258 -IGRlbWFzaQ== 35259 -IEJhbmdsYWRlc2g= 35260 -IEluY3JlZGlibGU= 35261 -IGxldHp0 35262 -IGJlaGF2aW5n 35263 -IGFzdG9uaXNoaW5n 35264 -IOKG 35265 -IOuCqOyekA== 35266 -6LWw5LqG 35267 -44OU 35268 -IEdPUkRPTg== 35269 -Q0FS 35270 -PyEi 35271 -IFByZXN0 35272 -IOunnuyVhOyalA== 35273 -IHRhbmQ= 35274 -IGxhc2g= 35275 -54o= 35276 -aWZpY2FudA== 35277 -IGludG9sZXI= 35278 -INCz0LXRgNC+ 35279 -IHRldQ== 35280 -YXNv 35281 -INGB0L7QstC10YI= 35282 -IHRyYXZlbGVycw== 35283 -IFN5bmQ= 35284 -INCy0LXRgNGB 35285 -Rm9uZGE= 35286 -YWTEsQ== 35287 -IHRyYW5zY3JpcHRpb24= 35288 -IHRpdGFuaXVt 35289 -IHR3aXN0cw== 35290 -IGdlYXJib3g= 35291 -ZW5zYXRpb24= 35292 -ZmF0 35293 -Q29sbA== 35294 -IENvbW1vbndlYWx0aA== 35295 -em9u 35296 -IFBvbGl6ZWk= 35297 -IEFQUExBVVNF 35298 -ZnJ5 35299 -IEp1ZGE= 35300 -ZXN0ZWVt 35301 -IHNvY2s= 35302 -IEp1Z2VuZA== 35303 -INC60YHRgtCw0YLQuA== 35304 -IERybw== 35305 -IHByb2NoYWluZQ== 35306 -44O844Or 35307 -IGxpa3NvbQ== 35308 -IEVuZXJnaWU= 35309 -IE1hcmluYQ== 35310 -IDIzMA== 35311 -IOqwgOyEnA== 35312 -dW1waW5n 35313 -IGxvbmU= 35314 -57Sa 35315 -IGZvbnRz 35316 -IGJ1c2luZXNzbWFu 35317 -IHBseQ== 35318 -IGRvZQ== 35319 -Z3JpZA== 35320 -IE1pbHdhdWtlZQ== 35321 -IEVkZW4= 35322 -ISIu 35323 -INuM24E= 35324 -b2dlbnM= 35325 -IHRlYXNlcg== 35326 -IHF1acOpbg== 35327 -IGluY2VudGl2 35328 -Z292ZXJu 35329 -IGNoaWxkY2FyZQ== 35330 -IHNuZWFrZXJz 35331 -IGltcHJpc29uZWQ= 35332 -wq4= 35333 -0LjRgtC10YHRjA== 35334 -YW5idWw= 35335 -IHJlZ2Fpbg== 35336 -IHRyYW5xdWls 35337 -UmVkbmVy 35338 -6Zuo 35339 -SUZB 35340 -IGlkZW9sb2dpY2Fs 35341 -IG1heW9yw61h 35342 -IGJ1cmVhdQ== 35343 -ZXRlcm0= 35344 -IERJRA== 35345 -7Iq3 35346 -IHdhdmluZw== 35347 -IGJlYg== 35348 -IMOhcg== 35349 -INC60LI= 35350 -IGVudm95 35351 -YW51dA== 35352 -0LjQutGD 35353 -IEVudmlyb25tZW50 35354 -IEFzc2Fzcw== 35355 -44KT44Gn 35356 -IEJyZWFk 35357 -INCi0YPRgg== 35358 -IHN0YWlyY2FzZQ== 35359 -IERpc2Vhc2U= 35360 -IGF1Y3Vu 35361 -IOuLiA== 35362 -IGNvbmZyb250YXRpb24= 35363 -IDE5NDE= 35364 -IGlyb255 35365 -IHdvcnNo 35366 -44KM44KL 35367 -IGZpY2s= 35368 -IE5hb21p 35369 -IGJhY2tzaWRl 35370 -aWV1eA== 35371 -S2Fw 35372 -IHZlZGVyZQ== 35373 -IGxlbmd0aHk= 35374 -IGJyZWFrZXI= 35375 -IFJvbGxl 35376 -IHByZWRhdG9y 35377 -IG5vc3Nvcw== 35378 -IGFkdmVydGlzZQ== 35379 -6LOH 35380 -0YDQvtC00LU= 35381 -UmVkbmVyd2VjaHNlbA== 35382 -cmV0ZW4= 35383 -IGNvbGxlY3RvcnM= 35384 -xLHEn8SxbcSxeg== 35385 -IHRyaWc= 35386 -IGF4ZXM= 35387 -aW50ZXJz 35388 -IHBlbmFsdGllcw== 35389 -IE9zbWFu 35390 -IEplbm5h 35391 -IGZsYWtlcw== 35392 -IHRyYWluZXJz 35393 -IHN0dW5uZWQ= 35394 -IFNjcm9sbA== 35395 -IFBpcA== 35396 -INC90LDRgdGC 35397 -IG5ow6A= 35398 -IFNtYWNr 35399 -4bqrbg== 35400 -cmF0b3M= 35401 -INGA0LDQsdC+0YLRiw== 35402 -IHVjeg== 35403 -IExlbW9u 35404 -IFNpbmQ= 35405 -IHBzeWNoaWM= 35406 -IEFiZw== 35407 -IG1hbW1hbHM= 35408 -IGltbWVyc2l2ZQ== 35409 -IGJvdHM= 35410 -IHZlcnNjaGllZGVuZQ== 35411 -IGdlcmFs 35412 -IGZvbGxvd2Vy 35413 -IOS7lg== 35414 -IHNlZ3VyaWRhZA== 35415 -IGltbWVyc2Vk 35416 -ZmVpdG8= 35417 -Y3Jvc3M= 35418 -IMO2bGQ= 35419 -7YOE 35420 -IOOBk+OBrg== 35421 -INeU15nXkA== 35422 -IEppYW4= 35423 -IGJpbGl5b3I= 35424 -YXJlYQ== 35425 -IGthZg== 35426 -IGdvZHQ= 35427 -55u45L+h 35428 -IOuwqeyGoQ== 35429 -IGRldHJpbWVudA== 35430 -5qWa 35431 -0ZbQuw== 35432 -IMSRw6J1 35433 -IGNobG9yaWRl 35434 -w7hyZQ== 35435 -bGVp 35436 -IG1vbnRl 35437 -IGRpZmbDqXJlbnRlcw== 35438 -4K+BLg== 35439 -IGNhcmVnaXZlcnM= 35440 -IGluYWRlcXU= 35441 -IGZhcmV3ZWxs 35442 -INGC0LjQv9Cw 35443 -b250ZWM= 35444 -IEVwaA== 35445 -SEhI 35446 -IFRvZG9z 35447 -INCh0KjQkA== 35448 -IHRyb3Y= 35449 -IGxpZ2U= 35450 -IGPDtG5n 35451 -IENpdg== 35452 -IGNhcGF6 35453 -IFZhbGxhaGk= 35454 -IHF1ZXN0ZQ== 35455 -IHJlcGxpY2E= 35456 -2LPYqA== 35457 -em5h 35458 -INGB0LvRg9C2 35459 -IFBU 35460 -d2F2ZQ== 35461 -aWVuaQ== 35462 -IHJlbGllZA== 35463 -ZGV2ZWxvcA== 35464 -IGRlbWU= 35465 -IEFtYW4= 35466 -IFsuLi5d 35467 -IGNvbXBsaW1lbnRz 35468 -dWFpcw== 35469 -IO2MqA== 35470 -IHNtZWxsaW5n 35471 -IGRhZHVyY2g= 35472 -2YjYqg== 35473 -IG9yYW5nZXM= 35474 -INC70LDQuQ== 35475 -IHN0YWJpbGl6YXRpb24= 35476 -5YCN 35477 -44KM44Gf 35478 -5qW9 35479 -IGFwcGxpYW5jZXM= 35480 -IGht 35481 -g5DrqbQ= 35482 -b2R5bmFtaWNz 35483 -IGNpxJk= 35484 -IENvdHQ= 35485 -TU9O 35486 -IE1hbmc= 35487 -5pSv5oyB 35488 -IGFsbGVyZGluZ3M= 35489 -zrnOus6u 35490 -c2hvdHM= 35491 -IHRz 35492 -IEfDtnI= 35493 -IENIQVI= 35494 -IDoo 35495 -IHdyYXRo 35496 -IGZpcXVl 35497 -IGbDvGhyZW4= 35498 -IHRlc3RhbWVudA== 35499 -IF5e 35500 -4bmb4bmj4bmHYQ== 35501 -QUxE 35502 -IHRleHRv 35503 -IERvZ3M= 35504 -IHNpYg== 35505 -IHBhdGhldGlj 35506 -b2Nrcw== 35507 -IHJhZGljYWxseQ== 35508 -IE1PUkU= 35509 -IEpBTUVT 35510 -IGluZ2w= 35511 -IFRlY2huaWNhbA== 35512 -IHBvcmNo 35513 -IFVU 35514 -INC+0LHRj9C30LDRgtC10LvRjNC90L4= 35515 -IHJlbmV3YWw= 35516 -IGFlc3RoZXRpY3M= 35517 -aWt1bQ== 35518 -IGJldmVyYWdl 35519 -ZGVybg== 35520 -IHByZWRpY3RpdmU= 35521 -IGNodXk= 35522 -IFJlZ2FyZGluZw== 35523 -IEZvcndhcmQ= 35524 -INmI2YQ= 35525 -IGNvbnRleHR1YWw= 35526 -IGR3YXJm 35527 -IHByZWhl 35528 -IGdvdmVybmVk 35529 -hYQ= 35530 -IHRyYWJhbGhhcg== 35531 -IG5lZ8OzY2lv 35532 -INCx0L7Qu9GM0YjQvtC5 35533 -0LXRh9Cw0YI= 35534 -INC00YPRhQ== 35535 -IGZsb29kcw== 35536 -IGJvd2xpbmc= 35537 -IE9C 35538 -IEjDpHI= 35539 -IGdyYWRpbmc= 35540 -7KO864qU 35541 -IGdhcnM= 35542 -ZGxpbmc= 35543 -IHJhaw== 35544 -64g= 35545 -Y3JlYXQ= 35546 -INGJ0LU= 35547 -IG5laWdoYm91cnM= 35548 -Zm9vZA== 35549 -UXVlcnk= 35550 -IGhlcm9pbg== 35551 -aWNlcHM= 35552 -IEtpbmRh 35553 -TkVU 35554 -IG1hcmk= 35555 -IGltaXRhdGU= 35556 -IGFjaHRlcg== 35557 -IHNldHRsZW1lbnRz 35558 -cmFyZQ== 35559 -Y2Npb25lcw== 35560 -IOuTnA== 35561 -IGZpaw== 35562 -aXR1bmc= 35563 -INC80LDQutGB0LjQvA== 35564 -IGVsZg== 35565 -IGRhbGxh 35566 -IFBvbHNjZQ== 35567 -IFB1bA== 35568 -0KfRgtC+ 35569 -IE1vcmdlbg== 35570 -2K3ZhQ== 35571 -IHN1cHJlbWFjeQ== 35572 -IGt5cw== 35573 -IEh1cnJpY2FuZQ== 35574 -IEdUQQ== 35575 -IEZlaA== 35576 -IGZpbmFsbWVudGU= 35577 -bXVuZA== 35578 -IEtyaWU= 35579 -w6lwb3F1ZQ== 35580 -IFR1Y2tlcg== 35581 -SVRU 35582 -IGx1cg== 35583 -IGRpcHBpbmc= 35584 -w6R2 35585 -IGVlcnN0ZQ== 35586 -IEZsaW50 35587 -YmlsZHVuZw== 35588 -4Li54LmJ 35589 -IHRvaW0= 35590 -IHByYWN5 35591 -IHRyYW5zZm9ybXM= 35592 -IHNwZWVkaW5n 35593 -IHByZXNlbnRlcg== 35594 -IGZlbGxvd3M= 35595 -ZmlsbGVk 35596 -aWV6YQ== 35597 -IGFkdmlzaW5n 35598 -IEludGVydmlldw== 35599 -0LjQs9GA 35600 -d2Vocg== 35601 -IERhbnRl 35602 -cHR1cmU= 35603 -iOusuA== 35604 -r7jr 35605 -kJA= 35606 -IENvdW50ZXI= 35607 -IGNyaXN0 35608 -IOynnA== 35609 -IGpldW5l 35610 -INGB0YLRgNCw0Yg= 35611 -IG1pZcSH 35612 -IHR1dG9y 35613 -IG1hc2FsYQ== 35614 -IHBvd2RlcmVk 35615 -IG5hdQ== 35616 -IEZyZWRlcmljaw== 35617 -IGJpbGxpbmc= 35618 -IEVpc2Vu 35619 -INC00L7QsdGA 35620 -IG1lc3Q= 35621 -5r0= 35622 -IHNuaXBw 35623 -IG1vbm8= 35624 -IEFsbw== 35625 -IE1lcmN5 35626 -w6lyaWVuY2U= 35627 -IGNhc3VhbHRpZXM= 35628 -IEFOTk9VTkNFUg== 35629 -5LuO 35630 -IHRvY2Fy 35631 -IGJhY3RlcmlhbA== 35632 -SG8= 35633 -IHN0cmVhaw== 35634 -IEpFTk4= 35635 -IHBsYXN0 35636 -0YHQu9C10LQ= 35637 -IHJlYXBw 35638 -IHBheWNoZWNr 35639 -IG1pbmVycw== 35640 -aGFidA== 35641 -IEphcA== 35642 -0L3Rg9GC 35643 -IHJlZGVtcHRpb24= 35644 -IHF1aXI= 35645 -aG5saWNo 35646 -IGFjY3VtdWxhdGlvbg== 35647 -IHNob3Zl 35648 -IGFkcmVuYWxpbmU= 35649 -TWFrZQ== 35650 -IEhlcm4= 35651 -b3NzaW5n 35652 -IFZpbA== 35653 -dWJieQ== 35654 -aGVydHo= 35655 -YnJlYWtz 35656 -IHNwdXI= 35657 -IERhaGE= 35658 -VVNUSU4= 35659 -IGNvbnRpbnVlcg== 35660 -IFNhdWw= 35661 -44Gu44Gv 35662 -IO2PrQ== 35663 -IOuQmOuptA== 35664 -IOunkOyUgA== 35665 -INC+0LY= 35666 -IHN1c3BlY3Rz 35667 -IGxhcXVlbGxl 35668 -IE11Y2hhcw== 35669 -IHbDtmxsaWc= 35670 -dWxlbg== 35671 -IGltcHJlcw== 35672 -IGxvYmI= 35673 -ZW5lZQ== 35674 -INC90LDQtg== 35675 -VGE= 35676 -IHLDqWFsaXTDqQ== 35677 -IFJleA== 35678 -IGhhcnZlc3Rpbmc= 35679 -IGVzdHI= 35680 -5rY= 35681 -b3NwYWNl 35682 -T1NT 35683 -IGRpc3R1cmJhbmNl 35684 -YXNzaWM= 35685 -IElzYWI= 35686 -IGTDqWNvdXY= 35687 -IEhhbXBzaGlyZQ== 35688 -IG9ybmFtZW50 35689 -IGx1w7Ru 35690 -IFVX 35691 -IGrEhQ== 35692 -6YKj5LmI 35693 -IHJlc3BlY3Rv 35694 -IGNvbXVuaWRhZA== 35695 -IGNvbWlnbw== 35696 -YWduYQ== 35697 -IGludHJpbnNpYw== 35698 -IEFsdW1uaQ== 35699 -IHNlc2xlcmk= 35700 -IGVzdGltYXRpb24= 35701 -4oCU4oCU 35702 -IHByb2R1aXQ= 35703 -44CC44CN 35704 -INCy0YA= 35705 -IHdoaXJs 35706 -IGFjY2Vz 35707 -w6d1 35708 -IHZhcmlhYmlsaXR5 35709 -IHZvZGth 35710 -aXRzdQ== 35711 -IGludGVybnNoaXBz 35712 -IGFsbG9jYXRl 35713 -UlI= 35714 -7ZuI 35715 -IGluc3RydWN0aW9uYWw= 35716 -dGFudA== 35717 -IOCuheCupA== 35718 -IGludml0ZXM= 35719 -IGhhaw== 35720 -IHNjYXJlcw== 35721 -IGVjbGlwc2U= 35722 -0L/QvtCy 35723 -0LrQvtC70Yw= 35724 -YXRpdmFz 35725 -IHN0YWJiZWQ= 35726 -IERPTQ== 35727 -5LiN5Yiw 35728 -cm9vdHM= 35729 -IFBpY3R1cmU= 35730 -7Zi8 35731 -IENIQQ== 35732 -aWVj 35733 -xLHEsQ== 35734 -aGFub2w= 35735 -IG1pc3VuZGVyc3RhbmQ= 35736 -UmF5 35737 -IHJvYWRtYXA= 35738 -b2N1bWVudGVk 35739 -aXppb25l 35740 -IE9saXZl 35741 -cmlmdA== 35742 -INeU16A= 35743 -5q+N 35744 -bGVzdA== 35745 -Ozs= 35746 -IEVB 35747 -6ZyA6KaB 35748 -0L7QtNGD 35749 -IGhvYmJpZXM= 35750 -IGJ1cmlhbA== 35751 -44Gr44Gh44Gv 35752 -0KQ= 35753 -bGVnZQ== 35754 -IEhK 35755 -IG9iamVjdGlvbg== 35756 -IOOBrQ== 35757 -Y3Rvcnk= 35758 -IGluY3JlbWVudGFs 35759 -IGd5bW4= 35760 -IGVwaWRlbWk= 35761 -0YHRi9C7 35762 -w5E= 35763 -IGFkdmFuY2VtZW50 35764 -IHBhcmNo 35765 -TmV3cw== 35766 -IGF5cg== 35767 -0LvQsNC8 35768 -INec16k= 35769 -IGRpcGxvbWE= 35770 -44Gh44KD44KT 35771 -IHJvYmJlZA== 35772 -T25seQ== 35773 -IGluY3Vy 35774 -IGNoYW50aW5n 35775 -IO2VtOuPhA== 35776 -IHJpY2hlcw== 35777 -IENhcm1lbg== 35778 -IG5vc3Rybw== 35779 -zrvOrQ== 35780 -IFBvd2Rlcg== 35781 -4LmA4Lir 35782 -IOyeiOycvOuptA== 35783 -IGdlcsOnZWt0ZW4= 35784 -IFBpa2FjaHU= 35785 -0LXQvNC+0L0= 35786 -T0xM 35787 -IHBsYW5ldGFyeQ== 35788 -IHNsb3dz 35789 -IGNsb2Nrd2lzZQ== 35790 -YWxpb24= 35791 -IOyM 35792 -IHZlcm4= 35793 -IGhvbW1l 35794 -IGVuZHBvaW50 35795 -IGlubm9jZW5jZQ== 35796 -IGVsZW1lbnRvcw== 35797 -IHNvcGhvbW9yZQ== 35798 -IG5vdGlvbnM= 35799 -IENvdWxkbg== 35800 -cHVy 35801 -IHphdA== 35802 -IG9ic2Vzcw== 35803 -IG1vdGl2bw== 35804 -IEt1Yg== 35805 -IERydWc= 35806 -QW50 35807 -IFBsYXllcnM= 35808 -IEh1bWFucw== 35809 -IG1lbGVl 35810 -IFdpbGRsaWZl 35811 -IFZQ 35812 -IHZvbGNhbmlj 35813 -IGNvbWlu 35814 -IEd1YW5n 35815 -IM+EzrnPgg== 35816 -INC+0YHQvtCx0LXQvdC90L4= 35817 -IFNpemU= 35818 -TGlzdGVu 35819 -IEFhYQ== 35820 -YXBwcm8= 35821 -IGJhcmJhcg== 35822 -IFBhcmtpbnNvbg== 35823 -0L3Rj9GC0Yw= 35824 -5Y2w 35825 -IHVuZGVyZXN0aW1hdGU= 35826 -IHN1YnN0aXR1dGlvbg== 35827 -IGNvc21ldGlj 35828 -5LiL5qyh 35829 -IHdpbGxlbg== 35830 -IGJlaWRl 35831 -YW5uaQ== 35832 -IGNvbmRpdGlvbmVk 35833 -IERlYmJpZQ== 35834 -IGlzdG8= 35835 -IEVkd2FyZHM= 35836 -7JuM7JqU 35837 -INGC0L7Qsg== 35838 -IGFiYnJldmk= 35839 -IE3DvG4= 35840 -IFByaW5j 35841 -IExpYW5n 35842 -IHN0aW5r 35843 -IHJhZGlvYWN0aXZl 35844 -44GG44KP 35845 -IGFjb250ZWM= 35846 -IHVuY29u 35847 -IFR1cmJv 35848 -44GQ 35849 -IGtpc3Nlcw== 35850 -5piv5LuA6bq8 35851 -0LXRgtGA0L7Qsg== 35852 -IGZyb250aWVy 35853 -IFNweQ== 35854 -IEJlbGFydXM= 35855 -IENCUw== 35856 -4buX 35857 -YW1vdG8= 35858 -7ZWc642w 35859 -INGB0YLRgNC+ 35860 -IEVuZmlu 35861 -IGJyZWFkdGg= 35862 -6Ziy 35863 -IENhZmU= 35864 -IERhZsO8cg== 35865 -IEJvdXI= 35866 -YXJhcw== 35867 -IGJsdWVwcmludA== 35868 -YW7EsQ== 35869 -IGNvbnN0YW50cw== 35870 -IGF0dGFja2Vy 35871 -IEZvcm11bGE= 35872 -emHEhw== 35873 -IHNvd2ll 35874 -IGV5ZWJyb3c= 35875 -b2Jvb2s= 35876 -IHNldHplbg== 35877 -56ys5LiJ 35878 -b25zaWRlcg== 35879 -YXduaW5n 35880 -IHPDtnlsZXll 35881 -IGludmFkZWQ= 35882 -IHByb25vdW5z 35883 -IGRvYnJ5 35884 -U2k= 35885 -INCl0L7Rgg== 35886 -IHZvbGxleWJhbGw= 35887 -IGxhbWVudA== 35888 -aXNjaGVz 35889 -YXJtZQ== 35890 -YXBp 35891 -IFdpa2k= 35892 -0LvQuNGI 35893 -IGthc2lo 35894 -IHBlc3M= 35895 -INGE0L7Rgg== 35896 -IFN1bA== 35897 -5b63 35898 -IHBzZXVkbw== 35899 -IG1lbW8= 35900 -IOyXsOyKtQ== 35901 -INC00L7Qu9C70LDRgNC+0LI= 35902 -INC/0LXRgNC10Lw= 35903 -IFJlYWNo 35904 -bWlyYWw= 35905 -YWx0ZWQ= 35906 -IHN0YXR1dA== 35907 -cmVhZGluZw== 35908 -IHPDtnlsZWQ= 35909 -IExpbmRzZXk= 35910 -IEFobWFk 35911 -67aA6w== 35912 -INCh0LXQs9C+0LTQvdGP 35913 -IHByenlnb3Q= 35914 -IGh5c3Rlcg== 35915 -VVJF 35916 -IE5laWdo 35917 -UmVwb3J0ZXI= 35918 -IEJ1bnU= 35919 -IFRyZWF0eQ== 35920 -IFJhbms= 35921 -IEZhbWU= 35922 -aW5pc2hlZA== 35923 -IGdlYXJlZA== 35924 -IGNvbXBvc2U= 35925 -b2RpYQ== 35926 -IExvbg== 35927 -IGplc3RlxZtteQ== 35928 -IERJUkVDVE9S 35929 -IGVsa2Fhcg== 35930 -IFZpZWw= 35931 -15DXqQ== 35932 -eW50aGlh 35933 -5Lim 35934 -IG3DqHJl 35935 -IFRvbWF0bw== 35936 -IGV4YXRhbWVudGU= 35937 -bmnEmQ== 35938 -IEZyZWk= 35939 -IERpZg== 35940 -IG9wZW5pbmdz 35941 -IGdyYXBoaWNhbA== 35942 -INGD0LTQvtCx 35943 -INCy0YHQvw== 35944 -IFdlZWtseQ== 35945 -0LXQstCw 35946 -IGhhbmdz 35947 -IHVuc2FmZQ== 35948 -IGVtYmxlbQ== 35949 -IEtvbGxlZ2lubmVu 35950 -YWxheQ== 35951 -IGtzaQ== 35952 -IGhpZGVz 35953 -IG9sbWF5 35954 -IGVudHN0ZQ== 35955 -IGFydGhyaXRpcw== 35956 -w59lcmRlbQ== 35957 -IGJpbm5lbg== 35958 -IGxpc3RlbnM= 35959 -IEhlc3M= 35960 -5YaN5L6G 35961 -IExvdWlzZQ== 35962 -bGRlbg== 35963 -0LXQvdGB 35964 -IFZlcnNpb24= 35965 -IEFncmljdWx0dXJl 35966 -7Iqk66W8 35967 -0LzQsNC9 35968 -64Sk7JqU 35969 -IHdpbmVz 35970 -IElORg== 35971 -cnVs 35972 -IEpL 35973 -xLF5b3JsYXI= 35974 -c2hpZWxk 35975 -cmVhdGg= 35976 -IHRlcnVz 35977 -IEx1bQ== 35978 -IGFudGljaXBhdGlvbg== 35979 -IGFjY3VzdG9tZWQ= 35980 -IE1pbmE= 35981 -IHdpZWxk 35982 -aW/DqA== 35983 -bWVyYQ== 35984 -IGNvdW50ZG93bg== 35985 -IGNsaW5n 35986 -IGNvbW1lbmQ= 35987 -IGZha3Rpc2t0 35988 -IGRlZmVuc2Vz 35989 -IGNvY2twaXQ= 35990 -INC60L7QvNCw0L3QtA== 35991 -IGRpc2h3YXM= 35992 -IFRoYW5vcw== 35993 -IGtpZG5leXM= 35994 -IHNlaGU= 35995 -IG1pY3JvYmVz 35996 -IGN1ZmY= 35997 -INCy0YvRgdC+0Lo= 35998 -IFNwaWN5 35999 -562J562J 36000 -4K614K6w 36001 -Y3VsdXM= 36002 -b3Jj 36003 -576F 36004 -aXhlcw== 36005 -IENyZWRpdA== 36006 -IHJhag== 36007 -IGJyaW5ndA== 36008 -IE5pc3M= 36009 -IGdyaW0= 36010 -IFNPTA== 36011 -IHRlbmlt 36012 -IFN1ZGFu 36013 -IFNwYXJ0 36014 -IHByb21vdGVz 36015 -IE5vc3Nh 36016 -INGB0L7RgdGC0L7Rj9C90Lg= 36017 -IOywqQ== 36018 -IHVuY29udA== 36019 -IExpYmVyYWw= 36020 -INCi0L7Qu9GM0LrQvg== 36021 -IFZpZWxl 36022 -IGt0w7NyZWo= 36023 -ICoqKio= 36024 -TWF4 36025 -INCn0YLQvtCx0Ys= 36026 -MzUw 36027 -IO2YvOyekA== 36028 -IOu2hOuTpOydtA== 36029 -IHdhcnA= 36030 -IHRlbmdh 36031 -IHN5bXBhdGhldGlj 36032 -IGJpemk= 36033 -IFphY2s= 36034 -aWVkbw== 36035 -IOuJtOw= 36036 -cGllbA== 36037 -INGC0L7Quw== 36038 -IHNjYWxlZA== 36039 -IFBFVEVS 36040 -IENPTU0= 36041 -IENhbWU= 36042 -IGNhdGFzdHJvcGhl 36043 -IHN3ZWF0eQ== 36044 -aWdyYXRpb24= 36045 -IHN0dWZmaW5n 36046 -IM+Azr/Ou8+N 36047 -IERyaXZlcg== 36048 -enlzdA== 36049 -VGVjaA== 36050 -IGFzc2Vzc2Vk 36051 -IFN1cmZhY2U= 36052 -xLFyxLFt 36053 -c3Vy 36054 -bGVyd2VpbGU= 36055 -INC00L7Qsw== 36056 -IHNodXR0aW5n 36057 -IGZyYWN0aW9ucw== 36058 -INGB0L7Quw== 36059 -ZXZlcnlvbmU= 36060 -IGVybg== 36061 -INCd0L7Qsg== 36062 -IGRlZmVuZGVycw== 36063 -IHZlcnN1Y2h0 36064 -44Oz44OA 36065 -IHBvbGl0eQ== 36066 -INCf0L7QvQ== 36067 -dmVyc3TDpG5k 36068 -IGJyb3dzZXJz 36069 -IHRyYW5zZm9ybWF0aXZl 36070 -IGRpY3RhdGU= 36071 -IExFR08= 36072 -IG5pbmd1bmE= 36073 -6rSR 36074 -IHBpeno= 36075 -IEhhcm9sZA== 36076 -IExvcGV6 36077 -2r7bjA== 36078 -YW7EsXo= 36079 -YXRjaGV0 36080 -2YrYqg== 36081 -IGxlcm5lbg== 36082 -IOq3gOyXrA== 36083 -IGhvdXNlZA== 36084 -IGNsZWFuc2U= 36085 -IFdBVA== 36086 -bGFyYXRpb24= 36087 -IGJ5dGVz 36088 -IHR1Y2tlZA== 36089 -IGZhdWx0cw== 36090 -0LTQvg== 36091 -Rlg= 36092 -IOyWvOuniOuCmA== 36093 -IGRlZm9ybQ== 36094 -IGNvbnRyYWN0aW5n 36095 -IFRJTUU= 36096 -aXJzZQ== 36097 -IG5lYmVu 36098 -IGNlcmM= 36099 -IEFybXN0cm9uZw== 36100 -IHRlc3Rlcg== 36101 -IHBhcmZhaXQ= 36102 -IGplYWxvdXN5 36103 -IHRveGlucw== 36104 -IGRpc2JlbA== 36105 -0YPRgNGL 36106 -aW1wcmVzc2lvbg== 36107 -IHByb3N0YXRl 36108 -IGZpcmV3YWxs 36109 -IGNsYXNzaWNz 36110 -0LXRh9GM 36111 -IHNvY2lhbGlzbQ== 36112 -IGdyYWNpb3Vz 36113 -INGB0L3QvtCy0LA= 36114 -INC00L3Rjw== 36115 -IGJ1cm5lcg== 36116 -IE1pbm9y 36117 -IOyasOumrOs= 36118 -IGplZGVz 36119 -IGNvbnRpbnV1bQ== 36120 -IGhvdHM= 36121 -IG9jY3VycmVuY2U= 36122 -IGFkbWluaXN0ZXJlZA== 36123 -INC30LDQvNC10YI= 36124 -IGhlc2l0YXRpb24= 36125 -IGRyaWxscw== 36126 -ZXJjYQ== 36127 -INCy0YLQvtGA0L7QuQ== 36128 -IHN0ZWFkaWx5 36129 -IGluc2FubGFy 36130 -IGloYW4= 36131 -7ZE= 36132 -IGhlbHBlcg== 36133 -IFNlbmlu 36134 -5YGc 36135 -0L7QstCw0L3QuNC1 36136 -IEVSSUM= 36137 -Ymxh 36138 -IEFjYWRlbWlj 36139 -IGh1bWFuaXRpZXM= 36140 -YmxhY2s= 36141 -dW1weQ== 36142 -b3J0ZXg= 36143 -IOygiOs= 36144 -INil2YY= 36145 -IGRpc2Nsb3Nl 36146 -IEVsaWphaA== 36147 -IM67zq0= 36148 -IFF1ZXI= 36149 -2KjZhA== 36150 -44Kh 36151 -VGVsbA== 36152 -YXJsZQ== 36153 -0ZbRgA== 36154 -IGF1Z21lbnRlZA== 36155 -IOu5hOyKtw== 36156 -IGFuZHJvaWQ= 36157 -4KSk 36158 -YXJtYQ== 36159 -IHN6ZXI= 36160 -Z2VvcmQ= 36161 -IGdlZWs= 36162 -IHlldXg= 36163 -IHBvbmc= 36164 -IOOBneOBhg== 36165 -IHRvcnR1cmVk 36166 -IEJhdGg= 36167 -emln 36168 -YXNvbmFibGU= 36169 -IG5ldHM= 36170 -IGJhcnU= 36171 -IEZsYXQ= 36172 -IFZhdGVy 36173 -IFRlcnJvcg== 36174 -IEF2bw== 36175 -IGNlcmVtb25pZXM= 36176 -cm9l 36177 -2YHYsw== 36178 -T3Bz 36179 -IGh5dmlu 36180 -IGFwcmVzZW50 36181 -b2xvcg== 36182 -INC40LPRgNGL 36183 -b3J0b24= 36184 -IOq3uOuerA== 36185 -IGxvb2tpbg== 36186 -IFRZ 36187 -IE1pbnQ= 36188 -QWRk 36189 -IG1pdGU= 36190 -IFNtb2tl 36191 -IG5vdGE= 36192 -IG1vc3M= 36193 -IEFiZW5k 36194 -IOy7qA== 36195 -IGV4YWdnZXJhdGVk 36196 -ZmlyZXM= 36197 -IHJlZGlzdA== 36198 -ZmZpdGk= 36199 -IG9wZW5uZXNz 36200 -6rCQ7J20 36201 -ZW5kZXU= 36202 -0LXQvdC90L7QuQ== 36203 -V2F0Y2g= 36204 -IGF2YXRhcg== 36205 -IFBleQ== 36206 -dXJ1bg== 36207 -IHNlbnph 36208 -IOyngOyXrQ== 36209 -IE5hdG9taWFzdA== 36210 -IGVtZXJnZW5jZQ== 36211 -cmF5cw== 36212 -IGNyYWZ0ZWQ= 36213 -Z2FyeQ== 36214 -44Gg44GR 36215 -w7xuZw== 36216 -LSI= 36217 -IGhhY2tlZA== 36218 -IHN0cmF5 36219 -ZW5jaWU= 36220 -ZW1v 36221 -IGNvbWVu 36222 -IEvEsXo= 36223 -IEphc21pbmU= 36224 -IEhpbmRp 36225 -bWFuYXM= 36226 -IGluZmluaXRlbHk= 36227 -ZW1vbg== 36228 -7J24642w7JqU 36229 -amFr 36230 -IHJvYXJpbmc= 36231 -w6lyaXF1ZQ== 36232 -c3dlaXNl 36233 -IFJvbGV4 36234 -5aCx5bCO 36235 -IFN0dWFydA== 36236 -Ym5i 36237 -IGRpYWdub3Nl 36238 -IGNvaGVyZW50 36239 -IE1K 36240 -5rqW5YKZ 36241 -IHBpa2U= 36242 -bGF2 36243 -IG9yY2hlc3RyYWw= 36244 -0LDRgdGC0Lg= 36245 -IHRlcm1pbmFy 36246 -IGdhdGhlcmluZ3M= 36247 -IGNvbXBsaWFudA== 36248 -IHVwZ3JhZGluZw== 36249 -IHJlZ3VsYXRvcg== 36250 -IGxhbsOn 36251 -6YCj 36252 -IG1lcmNoYW50cw== 36253 -dGF3YQ== 36254 -IG1vbml0b3JlZA== 36255 -IHJlbmRyZQ== 36256 -5Lik 36257 -IHVudGVyd2Vncw== 36258 -YW5ndWFyZA== 36259 -Z2FyZA== 36260 -IEJlbG93 36261 -ZHVpbm8= 36262 -INCm0LU= 36263 -IGltcGVkYW5jZQ== 36264 -7Jyh 36265 -5Lu9 36266 -IGFrdHVlbGw= 36267 -IFZhdGlj 36268 -5a2p 36269 -IHN0ZXdhcmRz 36270 -IGJyaWdodGVzdA== 36271 -IGtlbm4= 36272 -IGthdQ== 36273 -IE1hdHJpeA== 36274 -IEJhcms= 36275 -IPCfkQ== 36276 -IHRhcGVy 36277 -IGNhc2lubw== 36278 -16jXlA== 36279 -eXNpY2Fs 36280 -IGJ1aWxkZXJz 36281 -IGN6xYJvd2ll 36282 -IE5lcGFs 36283 -ICEi 36284 -IHRlcm1l 36285 -IGlubnljaA== 36286 -IG1hdGhz 36287 -IGRyYWZ0ZWQ= 36288 -IEJhbGs= 36289 -IGhlc2l0YW50 36290 -IHZvbHRhcg== 36291 -IHJldml2ZQ== 36292 -INGE0LjQu9GM0LzQsA== 36293 -IGFzc2Fzc2lu 36294 -IFNvbHV0aW9ucw== 36295 -IGR1ZWw= 36296 -IGJlYXJpbmdz 36297 -4LiE4Liw 36298 -IHJvb2tpZQ== 36299 -aWthdA== 36300 -IGJpc2N1aXRz 36301 -IGNvcmRz 36302 -0YPQstCw0YLQuA== 36303 -QVJJTg== 36304 -IHByb2dyZXNzaW5n 36305 -IEdpcg== 36306 -IHBlbmV0cmF0ZQ== 36307 -IFN0b3JhZ2U= 36308 -ZWlnaHQ= 36309 -INGC0YDRgw== 36310 -IGRvbsOtdA== 36311 -IHNpemlu 36312 -IG91dGRhdGVk 36313 -INC90LDRiNC4 36314 -IGFmZmly 36315 -IHNwb29ucw== 36316 -IG9uaQ== 36317 -IGZsYW5r 36318 -IEdvbA== 36319 -aMOj 36320 -IHDDqXJp 36321 -IGhvbm9yYWJsZQ== 36322 -IEJyZWF0aGU= 36323 -c2NlbmVz 36324 -IG9idmlhbWVudGU= 36325 -0LjQutGB 36326 -INep157X 36327 -IHNtb290aGll 36328 -nojr 36329 -IGRpbWU= 36330 -IO2WiOyWtOyalA== 36331 -IGFwcGVs 36332 -IENhdGhvbGljcw== 36333 -IHNpbmdsZXM= 36334 -IGxhdGVu 36335 -IMOnw7xua8O8 36336 -IFZhZGVy 36337 -5o+b 36338 -IHZhcmTEsQ== 36339 -IElzdGFuYnVs 36340 -Z3LDqQ== 36341 -IEVsc2E= 36342 -w6ts 36343 -IGludmVjZQ== 36344 -IGNyYW5l 36345 -IG9iZQ== 36346 -IFNoYXJr 36347 -IHNtYWNr 36348 -IHJlc3RvcmluZw== 36349 -Llw= 36350 -IOu5oOs= 36351 -IGZhZGVk 36352 -dW1iZXJz 36353 -U2luZ2luZw== 36354 -IGRlcHJlc3Npbmc= 36355 -dGhlc3Q= 36356 -IFdhaHI= 36357 -IG11bHRpdHVkZQ== 36358 -0YDQsNCy0YHRgtCy0YPQudGC0LU= 36359 -cmlqaw== 36360 -ZWth 36361 -IGNvbXBsZXRlcw== 36362 -IFdlbGxz 36363 -IHJveQ== 36364 -IFByYXk= 36365 -IEthbGF1 36366 -aXppbg== 36367 -aWHFgmVt 36368 -IGxvY29t 36369 -IE5hc2h2aWxsZQ== 36370 -IFBlbnRhZ29u 36371 -66+4 36372 -IE5FVw== 36373 -xIXEhw== 36374 -w61zcw== 36375 -IG1hcnJ5aW5n 36376 -IGZldWQ= 36377 -7ZmV 36378 -5oCl 36379 -KSE= 36380 -IE9wZXJhdGlvbnM= 36381 -0YPRlA== 36382 -IG1vamU= 36383 -IGluc3RydWN0ZWQ= 36384 -IOuIhOq1rA== 36385 -INeU15I= 36386 -INC/0L7QvNC+0YnRjNGO 36387 -IHNhYmlh 36388 -7JWY7Ja07JqU 36389 -cGxhbmU= 36390 -cHJp 36391 -INC/0L7Qu9C90L7RgdGC0YzRjg== 36392 -IEtpdHR5 36393 -IHByw7Nwcmlv 36394 -ZWRlcmU= 36395 -IGludGVyZXNhbnRl 36396 -INC00LU= 36397 -IGNvbmRlbnNlZA== 36398 -IGF2ZW50 36399 -VE9S 36400 -IGdyZWFzeQ== 36401 -QVJL 36402 -b3J0YQ== 36403 -QUo= 36404 -IGRpc3JlZw== 36405 -IGNvcnJlY3Rpb25z 36406 -IHN0ZXJv 36407 -IGluZmx1ZW56YQ== 36408 -IGRlc3Nlcw== 36409 -IGJhbGxvdHM= 36410 -IG1lZ2V0 36411 -IG1hZmlh 36412 -IGLDtmw= 36413 -bm9zdA== 36414 -INGB0YLQsNGC0Yw= 36415 -IHJlc3BvbmRlcg== 36416 -IGhpbnRlbg== 36417 -Z3Jhdg== 36418 -4Lit4Liw 36419 -eW5jaHJvbg== 36420 -IHZpZW5z 36421 -IHNhbW8= 36422 -IGR0 36423 -cGFubnQ= 36424 -IMWbd2lhdA== 36425 -INC30LDQv9C40YE= 36426 -IG1lcmdlZA== 36427 -IGtlcA== 36428 -IG1pc2xlYWRpbmc= 36429 -IGRpZ2Ftb3M= 36430 -IGFtbW9u 36431 -6L6b 36432 -Y2hldA== 36433 -IOqwgOyguA== 36434 -IHVuaQ== 36435 -IOuQmOuKlOuNsA== 36436 -INC90LDQv9GA0LDQsg== 36437 -INC60L7RgtC+0YDQvtCz0L4= 36438 -IGFuaW1hdGU= 36439 -15XXkNc= 36440 -0LXRgNCy 36441 -IG1pbmNlZA== 36442 -IGthdW0= 36443 -44GC44GB 36444 -z4DOtQ== 36445 -0LvQtdCz 36446 -ZXhpc3Rpbmc= 36447 -IHBsYXRhZm9ybQ== 36448 -IEtSSVM= 36449 -7Jug 36450 -IEZhbWlsaWVu 36451 -IExpYnlh 36452 -IGJpb2RpdmVyc2l0eQ== 36453 -IGlkaW90cw== 36454 -aXJkaQ== 36455 -IHN6eWI= 36456 -IFJvbGxpbmc= 36457 -w7xjaHQ= 36458 -INGD0LTQuNCy 36459 -0YHRg9C0 36460 -IHJlYWxpemFy 36461 -IGNhbm5lZA== 36462 -INGA0LDQvQ== 36463 -IG1ldGFib2xpYw== 36464 -IEJlZWY= 36465 -IGtpbGth 36466 -0LvRjtGB 36467 -IHJlZ2lzdHJ5 36468 -0LzQvtGC0YDQuNGC0LU= 36469 -IHZpZWzDpA== 36470 -IG9kYw== 36471 -IGNvbmRlbW5lZA== 36472 -5qmL 36473 -ZmFs 36474 -IERpbA== 36475 -d2/Fm2Np 36476 -QXc= 36477 -IHN0YXRpc3RpY2FsbHk= 36478 -IHNvZ2Vu 36479 -IEJFVEg= 36480 -IHNoYXZpbmc= 36481 -5bm4 36482 -b2NhbA== 36483 -IEZ1bm55 36484 -IHBlYWNlZnVsbHk= 36485 -IGFkZGljdGl2ZQ== 36486 -IEluc2VydA== 36487 -bGF1Zg== 36488 -IGV4cGVyaWVuY2lh 36489 -6aaW5YWI 36490 -0LjRgtC10LvRjw== 36491 -w61nZW4= 36492 -w6FnaW5h 36493 -IGFiZG9tZW4= 36494 -7ZWc64uk 36495 -aWN1cw== 36496 -aW1hbmE= 36497 -7I2o 36498 -YXJjaGluZw== 36499 -IGtvbmtyZXQ= 36500 -7JWY6w== 36501 -0LXQutCw 36502 -b3VmbA== 36503 -aXZlbA== 36504 -IG51ZGU= 36505 -w6h0cmVz 36506 -IG1vbnNpZXVy 36507 -IGNsYXNo 36508 -IHRoZXJhcGlzdHM= 36509 -IGN1YmVk 36510 -IHJldHJvdXZlcg== 36511 -IHdhdmVmb3Jt 36512 -IHBvdGVt 36513 -IEZvcm1lcg== 36514 -aXNpw7Nu 36515 -5bqc 36516 -INeQ150= 36517 -dW5kb3M= 36518 -IE1laW51bmc= 36519 -2LXZhA== 36520 -IEp1ZGU= 36521 -IG7DpXI= 36522 -IExlb25hcmRv 36523 -IENyaXN0bw== 36524 -IEdPVA== 36525 -0YHRgtGA0YPQug== 36526 -TEFO 36527 -IGfDpW5n 36528 -IGTDqWI= 36529 -IEZyYW5rZnVydA== 36530 -IGNyYXBweQ== 36531 -IGxpbA== 36532 -YW5uw6ll 36533 -INC80LXRgdGC0LU= 36534 -UkVU 36535 -IE5lcg== 36536 -IENPU1RB 36537 -IGplZGVt 36538 -IGN1cnRhaW5z 36539 -IGl0ZXJhdGlvbnM= 36540 -IHVuYXY= 36541 -IHBsYXF1ZQ== 36542 -b3J1bQ== 36543 -IM62 36544 -IG7Dum1lcm9z 36545 -IGRlc2Fw 36546 -sr0= 36547 -IGNvbXBpbGVk 36548 -IHJlZmxl 36549 -IHJhbmtpbmdz 36550 -IHJlcGFpcmVk 36551 -INCd0LDQv9GA 36552 -IGRvd25sb2Fkcw== 36553 -IGFybW91cg== 36554 -INeZ15XXqteo 36555 -IGxvbmdldml0eQ== 36556 -IFRPTkVS 36557 -INC60L7QvNC80LXQvdGC0LDRgA== 36558 -IGN6ZWdv 36559 -IG5vdGlmeQ== 36560 -IGFpcnBvcnRz 36561 -IGVuZHVyaW5n 36562 -bGV0dGU= 36563 -IGFwcGFyYXQ= 36564 -IGhhYmls 36565 -4buHYw== 36566 -bmFk 36567 -SUNP 36568 -IEJyYWg= 36569 -IHNlZ8O6bg== 36570 -IGdvdmVybm9ycw== 36571 -a2FoYQ== 36572 -IFNjaGx1c3M= 36573 -IG9kcG93aWVk 36574 -aXJ0aW5n 36575 -IHJlbXBs 36576 -IEFib3JpZ2luYWw= 36577 -aWRlbnRhbGx5 36578 -IGVuaGFuY2luZw== 36579 -bGljdGluZw== 36580 -IEhhd2FpaWFu 36581 -IHN0cml2aW5n 36582 -IE5pZXQ= 36583 -IHpuYWN6eQ== 36584 -IG9iZWRpZW5jZQ== 36585 -IG7DpWdvdA== 36586 -IGV4cGlyZWQ= 36587 -IDE5MTg= 36588 -cHJlc2VudGVk 36589 -IHByb3dhZA== 36590 -IFRlcnI= 36591 -IFByaW5jZXRvbg== 36592 -IG1vcmdlbg== 36593 -IGF0dHJhY3Rpbmc= 36594 -IFNpZ21h 36595 -aWduZXI= 36596 -IFJlY2h0cw== 36597 -IFBla2k= 36598 -IG1ldGh5 36599 -IGhhbW0= 36600 -IGRpcmVpdG8= 36601 -IGRlbGVnYXRpb24= 36602 -0LjQstCw0Y7Rgg== 36603 -IGdpbg== 36604 -WW91bmc= 36605 -IGRlcGVuZGVuY2llcw== 36606 -IEJyYWRsZXk= 36607 -YnVkcw== 36608 -IGZpcw== 36609 -IHB5dGFuaWU= 36610 -IGludGVyY29ubmVjdGVk 36611 -IGVtYmFpeG8= 36612 -IFNhcw== 36613 -IHJ1aA== 36614 -IFNpY2h0 36615 -U3Vy 36616 -IHN1cGVyYg== 36617 -IFNhYmJhdGg= 36618 -IERhbmdlcg== 36619 -a29s 36620 -IGhvdQ== 36621 -c3VwcA== 36622 -IE5hY2lvbmFs 36623 -IHN1Y2Nlc3Npb24= 36624 -IHbDoQ== 36625 -IE1hw59uYWhtZW4= 36626 -IEplc3NpZQ== 36627 -IElkYWhv 36628 -Zm9yZXN0 36629 -hZg= 36630 -INee15M= 36631 -INij2Yo= 36632 -IHN3ZWV0aGVhcnQ= 36633 -IG5lYXRseQ== 36634 -IEV2YW5nZWw= 36635 -6rOh 36636 -IFN1aXRl 36637 -w7pibGljYQ== 36638 -INGD0LvQuA== 36639 -IEFubm91bmNlcg== 36640 -bGlnaA== 36641 -IHNlbnNhdGlvbnM= 36642 -IHNoZWx0ZXJz 36643 -IGhhcnQ= 36644 -IHNxdWVlemluZw== 36645 -IFJpdmVycw== 36646 -IENvb2tpbmc= 36647 -7LGF 36648 -cGVyc29uYWw= 36649 -IG1hbm9z 36650 -0ZHRgtGB0Y8= 36651 -d2lq 36652 -IGdvZ2c= 36653 -IE1pbGxp 36654 -IEZQ 36655 -w7xuc3Q= 36656 -IExT 36657 -IHNwcmF5aW5n 36658 -IGZhdXg= 36659 -IGF1dG9ncmFwaA== 36660 -b2xvZ2lj 36661 -IHRvcm1lbnQ= 36662 -IGVuY3J5cHRlZA== 36663 -4buF 36664 -IGVzdHJl 36665 -57m8 36666 -4LE= 36667 -IHN0dW1ibGVk 36668 -IGFpZGVy 36669 -IHNhYmVu 36670 -eHRlcg== 36671 -IENpdGllcw== 36672 -IFTDvHJr 36673 -64ul 36674 -Y2hpbmU= 36675 -IHRvcHBpbmc= 36676 -IHBvaXNvbmVk 36677 -IFJvbWFuaWE= 36678 -15PXmQ== 36679 -gOuhnA== 36680 -INC/0L7RgNGP0LQ= 36681 -IGNoaXJwaW5n 36682 -IOyZhOs= 36683 -15HXog== 36684 -IGN1YW50bw== 36685 -IGRvbmF0aW5n 36686 -IFJlZ2VudA== 36687 -IEJlcnVm 36688 -IGRpc3RyYWN0aW5n 36689 -IHN0YW1pbmE= 36690 -IERhcnJlbg== 36691 -IOy2lQ== 36692 -bGlzdHM= 36693 -ZGFs 36694 -Y2h1c3M= 36695 -IGVjb25vbWlzdA== 36696 -44GI44O8 36697 -b3JndA== 36698 -IGlzdGl5b3J1bQ== 36699 -6L+b 36700 -IFN1cnByaXNl 36701 -IEhhbw== 36702 -IOy1nOqzoA== 36703 -IEdX 36704 -IElubmVy 36705 -IHF1aWVyZW4= 36706 -IG1pbmRlZA== 36707 -IHN1cGVyY29tcHV0ZXI= 36708 -IGRpYWdyYW1z 36709 -7Yqc6w== 36710 -6rKg7Ja0 36711 -INC+0LHRitGP0YE= 36712 -IGVzdGFiYW4= 36713 -IGRlc3Ryb3lz 36714 -IEJyZWFraW5n 36715 -IGthcsSxxZ8= 36716 -IHJlYnVpbGRpbmc= 36717 -nOuMgA== 36718 -0LvQuNCy0L4= 36719 -IFNhdWNl 36720 -IEZ1c2lvbg== 36721 -15XXntc= 36722 -IFF1aW5u 36723 -IGdhdWNoZQ== 36724 -INmI2KM= 36725 -IMg= 36726 -55Oc 36727 -IHRlY2hubw== 36728 -IGRpc3BhdGNo 36729 -IGHFn2s= 36730 -IGVpbnplbA== 36731 -IEdtYWls 36732 -554= 36733 -IOqwnOyduA== 36734 -INGB0LXQvNGM 36735 -IGpvdXJuZXlz 36736 -IGlodA== 36737 -IGZpYnJl 36738 -IGRyYW1hcw== 36739 -b3VjaGVk 36740 -IHJlbmFtZQ== 36741 -INC+0L/QtdGA 36742 -IHBvbw== 36743 -IERydQ== 36744 -INC40YLQvtCz 36745 -IHphc3Q= 36746 -IGNveg== 36747 -IHp1Y2No 36748 -IG9idGFpbmluZw== 36749 -IGNvbW11dGU= 36750 -IHN1Ym1lcg== 36751 -IFZpc2g= 36752 -IFJhYmI= 36753 -b2dn 36754 -IGh1dA== 36755 -7ZaI7Ja0 36756 -5q+U5aaC 36757 -ZXJlbWk= 36758 -IM68zrE= 36759 -IGRpc2t1dA== 36760 -INCx0YPQug== 36761 -IGltcGFpcmVk 36762 -ZGVwZW5k 36763 -INmI2Kc= 36764 -INGA0YPQug== 36765 -INCx0LDRgA== 36766 -IG94aWRhdGlvbg== 36767 -IHNpdHVhw6fDo28= 36768 -yZlu 36769 -dcOnw6Nv 36770 -IHNhZ3Rl 36771 -IFNFUg== 36772 -IENha2U= 36773 -IHR1cm1lcmlj 36774 -IEthaw== 36775 -YnVuZw== 36776 -IEvhuZvhuaPhuYdh 36777 -IHBvaXNvbmluZw== 36778 -IHNsaXBwaW5n 36779 -IFNheXM= 36780 -5bCx5Y+v5Lul 36781 -w7JuZw== 36782 -55+z 36783 -wqs= 36784 -IENsYXVkaWE= 36785 -IENoYXJhY3Rlcg== 36786 -0L3QuNGG 36787 -Y29hdA== 36788 -IHByb2dyZXNzZWQ= 36789 -IEZlcmd1cw== 36790 -IOyYpOuK 36791 -IG9hdA== 36792 -b3JkYWJsZQ== 36793 -IExleQ== 36794 -IEhlcmF1cw== 36795 -IHJlc3VsdGFkb3M= 36796 -IEtheWxh 36797 -IHJpZmY= 36798 -IGNoZWdvdQ== 36799 -IHhp 36800 -IHNwYWNpb3Vz 36801 -IHJlY29nbmlzZWQ= 36802 -IGVjaA== 36803 -IFRpZQ== 36804 -IGxhdW5jaGVy 36805 -Smlt 36806 -IHN1cHByZXNzaW9u 36807 -IEltcG9zc2libGU= 36808 -IGd1aXRhcnM= 36809 -IEZvdXJpZXI= 36810 -0LjRh9C10YHQutC40Lk= 36811 -IFRoZXJhcA== 36812 -IEthZg== 36813 -Y2VudGVyZWQ= 36814 -INGB0L7QvtGC0LLQtdGC 36815 -IGtsaW0= 36816 -IGNhcmJvaHlkcmF0ZXM= 36817 -aWduYW50 36818 -IEFzdHJvbg== 36819 -IGVtcGxl 36820 -IGRyYXN0aWM= 36821 -INC80LjRgNC1 36822 -0LLQuNC9 36823 -dXc= 36824 -IHByZXR0aWVy 36825 -IGRvbnV0cw== 36826 -IEF0aGVuYQ== 36827 -IGRpc3NlcnQ= 36828 -IHBsYW50ZQ== 36829 -IHVyYW5pdW0= 36830 -7J2M6w== 36831 -YXLDqQ== 36832 -IHJ6ZWN6 36833 -IGRpc3BsYXlpbmc= 36834 -5oiy 36835 -IHNhcmM= 36836 -csOjbw== 36837 -IHRhbXBvY28= 36838 -IHBoaWxvc29waGVycw== 36839 -IFJlY2h0 36840 -5pOa 36841 -IGNvbWVudGFyaW9z 36842 -eXNl 36843 -IOycpA== 36844 -IG1pc2U= 36845 -IEdpbg== 36846 -INC90L7QvA== 36847 -IEZST00= 36848 -bGluZXI= 36849 -YXRpZg== 36850 -IHNwb8WCZWM= 36851 -eGE= 36852 -INGC0YDRg9C0 36853 -IHdhZw== 36854 -6riw7JeQ 36855 -IE1H 36856 -IG9mZnNwcmluZw== 36857 -IFVuZGVyc3RhbmRpbmc= 36858 -5Y+q5piv 36859 -T1JB 36860 -IHdoaXJyaW5n 36861 -IHN1cnJlbmQ= 36862 -IHBva2Vy 36863 -IG1vbnVtZW50cw== 36864 -IOKZqQ== 36865 -IG9yZ2FuaXNlZA== 36866 -IFNvemlhbA== 36867 -IEZhY3Rvcnk= 36868 -0YXQsA== 36869 -IHJlc2VtYmxl 36870 -0LfQtA== 36871 -IGV4cGxvc2lvbnM= 36872 -IHBheXJvbGw= 36873 -IG9tbg== 36874 -IEpvcmdl 36875 -zrnPgw== 36876 -IGZyYWN0dXJl 36877 -IHBlcnNlY3V0aW9u 36878 -IGRlbWFpcw== 36879 -RUNI 36880 -LCk= 36881 -IGNyaWFy 36882 -IEpPU0g= 36883 -IGRlbW9ncmFwaGljcw== 36884 -IDE2MDA= 36885 -IGN1cnJlbmNpZXM= 36886 -IFRpcHM= 36887 -IOmAmeWAiw== 36888 -IFJlZmVy 36889 -IERhbmNpbmc= 36890 -IGluY29uc2lzdGVudA== 36891 -IGRlaA== 36892 -IGltbWVucw== 36893 -IG1laXN0 36894 -IGltcGF0aWVudA== 36895 -IGJlaGF2ZXM= 36896 -5p2+ 36897 -IOuCtOyaqQ== 36898 -IGJhY2tzdG9yeQ== 36899 -IGFncmVlaW5n 36900 -IMWB 36901 -aWhpbg== 36902 -IHRlbXBlcmF0dXJh 36903 -IEJhY2tncm91bmQ= 36904 -IG51dHplbg== 36905 -IOuFuQ== 36906 -IE3DpG5uZXI= 36907 -IGNvbGxhYm9yYXRpb25z 36908 -IEtvcw== 36909 -6YGO5Y67 36910 -IG5pZ2h0bWFyZXM= 36911 -65Ox 36912 -IFF1ZWVuc2xhbmQ= 36913 -IGFzc29jaWF0ZXM= 36914 -IEtvaw== 36915 -IGZhY3RvcmlhbA== 36916 -IEh5dW5n 36917 -IOq3uOuLpOydjA== 36918 -IGZpbGhv 36919 -IGVsw6l0 36920 -IO2WieuztQ== 36921 -sLE= 36922 -IGdlZnVuZGVu 36923 -IHNlbWljb25kdQ== 36924 -IGNvdW5zZWxvcnM= 36925 -IFVwcGVy 36926 -IEF1Yg== 36927 -aWNrZXJz 36928 -VmVy 36929 -IG5vcnRod2VzdA== 36930 -IE1haW50ZW5hbnQ= 36931 -IExha2Vz 36932 -0LDRj9Cy 36933 -aW50w6k= 36934 -7LC9 36935 -INCz0LDQtw== 36936 -IGdpb3Ju 36937 -IGRpZ2l0YWxseQ== 36938 -IENpcmN1aXQ= 36939 -7LyA 36940 -44KK44G+44GX44Gf 36941 -IGNoZWVyZnVs 36942 -IFBldGVyc29u 36943 -IERhbmlzaA== 36944 -YXRpdm9z 36945 -IGxpa2Vu 36946 -IGhhcmJvcg== 36947 -0LDQu9C40YHRgg== 36948 -eGU= 36949 -IGN1cmxz 36950 -IFJob2Q= 36951 -RW5k 36952 -IEVU 36953 -IGFjcXVhaW50 36954 -IEtlbHZpbg== 36955 -IHRyaWY= 36956 -IEF3YXk= 36957 -7J6Q64qU 36958 -dnM= 36959 -IHDDoWdpbmE= 36960 -IGlubGV0 36961 -IFNhbnRvcw== 36962 -IOyasOyZgA== 36963 -IHlhcMSxeW9yc3Vu 36964 -dGhlbWU= 36965 -IHNvdWZm 36966 -IGluamVjdGVk 36967 -IHDDs8W6bmllag== 36968 -aXZlcnNv 36969 -YW1wZWQ= 36970 -IGRhaGVy 36971 -IGRhZ2dlcg== 36972 -INC70Y7QsdC40Lw= 36973 -IHR1bW15 36974 -IGVubGlnaHRlbmVk 36975 -Y2VudHM= 36976 -IERhaA== 36977 -IGN1ZXN0 36978 -5L6G6Kqq 36979 -SUxZ 36980 -INeR16g= 36981 -IGJhbmdpbmc= 36982 -IEVtaWw= 36983 -IENsZXI= 36984 -IEJvcmRlcg== 36985 -0LjQttGD 36986 -IHByZXNlbnRlcnM= 36987 -IFNUVUQ= 36988 -Y29pbnM= 36989 -IO2ZjQ== 36990 -IHBlcmtz 36991 -IHBhcmFw 36992 -IGNlcnRhaW5lcw== 36993 -IExvcmU= 36994 -w7ZzdA== 36995 -IE1BUlRJTg== 36996 -IGJpb3M= 36997 -IHdoZXJlYnk= 36998 -dmVydHM= 36999 -IE1pcmFuZGE= 37000 -IHN0aXA= 37001 -5r6k 37002 -YW5kZXo= 37003 -15vXnA== 37004 -dWppbg== 37005 -IOq+ 37006 -IGFsbGVyZ2llcw== 37007 -cGxhdGU= 37008 -IHlhcMSxbA== 37009 -IHVuZGVydGFrZQ== 37010 -IOuCmOqwgA== 37011 -UGFydA== 37012 -IGvEsXrEsW0= 37013 -aGd1cnU= 37014 -44GC44Go 37015 -IEpvaG5z 37016 -IGV5ZWxhc2hlcw== 37017 -IGRyYWluZWQ= 37018 -IHN0w6Vy 37019 -44GC44KK44G+44GZ 37020 -IEphZGU= 37021 -IGNhbGVuZA== 37022 -ZmlsbQ== 37023 -IG1lc2E= 37024 -IGx1ZHppZQ== 37025 -IGF0dHJhY3Rz 37026 -IGp1aWNlcw== 37027 -INC60LjQuw== 37028 -IG5pZXV3ZQ== 37029 -IG1lbmNpb24= 37030 -IGlnbml0aW9u 37031 -IGJsYWRkZXI= 37032 -YW5kYWFn 37033 -IEV4dGVuc2lvbg== 37034 -7YKo 37035 -ZmVlZA== 37036 -INmI2Yc= 37037 -IHNwdW4= 37038 -IHTDpHQ= 37039 -0L7RgNC+0YI= 37040 -dHlhcmQ= 37041 -cm9uaWNz 37042 -IEh1Z2U= 37043 -0YPQttC0 37044 -c3RyaW5n 37045 -IHVuanVzdA== 37046 -IHByYXdu 37047 -IGZyb3N0aW5n 37048 -IGRpc2FwcGVhcmFuY2U= 37049 -aW9zYQ== 37050 -IGNhcmRp 37051 -IFByaWVzdA== 37052 -IGNpZW50w61maWM= 37053 -5ZOq6KOh 37054 -INCS0LDRgQ== 37055 -IOu2gO2DgQ== 37056 -IHRoaWV2ZXM= 37057 -IHBoeXNpcXVl 37058 -IEV1Z2VuZQ== 37059 -INCx0LvQuNC3 37060 -IG1vbm9wb2x5 37061 -IGJpb2dyYXBoeQ== 37062 -IGhvxZ8= 37063 -IHTDtg== 37064 -bWFj 37065 -IHNob2Nrcw== 37066 -7IS46w== 37067 -aGl0 37068 -IHNudWc= 37069 -IGluY2w= 37070 -IGRlZGlj 37071 -IHVsdHJhcw== 37072 -INC40LfQstC10YHRgg== 37073 -IHV0aWxpemF0aW9u 37074 -INGB0L7QstC10YDRiNC10L3QvdC+ 37075 -IHNlcnZp 37076 -c3RhZw== 37077 -MTgw 37078 -IHNld2Vy 37079 -IENob2ljZQ== 37080 -IGRpc2NoYXJnZWQ= 37081 -IEpE 37082 -0L7Qu9C10YI= 37083 -INC60LLQsNGA0YLQuA== 37084 -IHRlbGVzY29w 37085 -IEplxZtsaQ== 37086 -IE5hbmE= 37087 -Y2FsZQ== 37088 -INGC0L7QvQ== 37089 -bW1t 37090 -5LqG5ZCn 37091 -IGdlaGFidA== 37092 -64Kg 37093 -5oqV 37094 -4LiZ4LiZ 37095 -IGV0aGVy 37096 -IHplbg== 37097 -IHJlc2VhcmNoZWQ= 37098 -IEN6eWxp 37099 -5a6M5YWo 37100 -d29ya2Vycw== 37101 -IOqyveywsA== 37102 -IHNoZXJpZmY= 37103 -YWxsbw== 37104 -IHRpcG9z 37105 -IHByb3NlY3V0aW9u 37106 -IGZyb2dz 37107 -IGZhbHQ= 37108 -amQ= 37109 -IO2MlA== 37110 -IGZpbHRlcmVk 37111 -IE9mdA== 37112 -IOyN 37113 -IGRpc2Zy 37114 -IE11c3Rhbmc= 37115 -IHdvYWg= 37116 -IFJFQUxMWQ== 37117 -INC80L7Qs9C70Lg= 37118 -IGVudHJhZGE= 37119 -INC40LPRgNCw 37120 -IG1peGVz 37121 -INCw0LLRgtC+0LzQvtCx 37122 -0Jk= 37123 -IHNoaW4= 37124 -IHBhcmFub3JtYWw= 37125 -IHNvbWVwbGFjZQ== 37126 -IGRpc2hvbg== 37127 -ZXRhYW4= 37128 -IGZ1ZXJ0ZQ== 37129 -2bk= 37130 -IGRvb20= 37131 -7Iic 37132 -IGV4aXN0ZW50aWFs 37133 -IGJ1bGQ= 37134 -IFNESw== 37135 -INC/0YDQsNCy0LTQsA== 37136 -IHR1cm5vdmVy 37137 -IOyXrOq4sOyXkA== 37138 -IOCkuQ== 37139 -IG1vZGVsZWQ= 37140 -IGJ1Z8O8bg== 37141 -IGV4cGVyaW1lbnRhdGlvbg== 37142 -IG1vcm5pbmdz 37143 -IG1lZG8= 37144 -U3Rldmll 37145 -IHBsYXlhYmxl 37146 -IGFpcmxpbmVz 37147 -Z21lbnRz 37148 -IOq4sOu2hA== 37149 -IFRvbWI= 37150 -IE1WUA== 37151 -QVVESUVOQ0U= 37152 -IGNoZWNrb3V0 37153 -IHBhc3N0 37154 -IGJlaXNwaWVs 37155 -IExpbmtz 37156 -aGVhdnk= 37157 -IHF1ZXN0aW9uYWJsZQ== 37158 -IOyTsOs= 37159 -IHNpbGw= 37160 -IG1hbmlwdWxhdGVk 37161 -IExvcmVu 37162 -IOycvA== 37163 -IHZlcmdl 37164 -w6Fr 37165 -SUVT 37166 -IHNhYm90 37167 -IEN1c3RvbWVy 37168 -YWxlxbx5 37169 -IG5vbWluZWU= 37170 -IEdhZA== 37171 -IG5vdXZlbGxlcw== 37172 -IFNQRQ== 37173 -aXN0bGluZw== 37174 -IG92YWw= 37175 -0L7QsdGA0LDQtg== 37176 -aWZ0eQ== 37177 -6YeO 37178 -IGJlemVs 37179 -eWV0 37180 -IGZyZWlnaHQ= 37181 -IEhhbsSxbQ== 37182 -csOtYQ== 37183 -IHpvbmluZw== 37184 -IGluZGVt 37185 -IELDvA== 37186 -IGZlbWluaXNt 37187 -IHZvaXg= 37188 -IG9maWNpYWw= 37189 -IGRpeW9ydW0= 37190 -u5A= 37191 -IGFyb3Nl 37192 -IHBhcmFy 37193 -7J247KeA 37194 -IE1hcnRpbmU= 37195 -IExlY3Q= 37196 -IHJlc3Rlcg== 37197 -IGRyb3duaW5n 37198 -dXlh 37199 -Y2lkYQ== 37200 -IEFyaWVs 37201 -IDAy 37202 -INeU15Q= 37203 -57Sg 37204 -IFdlcnQ= 37205 -0KLRiw== 37206 -IHdpZG93 37207 -IHBhcmNobWVudA== 37208 -IGNvdHRhZ2U= 37209 -IFhM 37210 -IFNsYWNr 37211 -IE5FUw== 37212 -IHJvYmU= 37213 -IGdpbW0= 37214 -IGNhbWluaG8= 37215 -IEhhcnBlcg== 37216 -IGNpdHJ1cw== 37217 -IGZpcmVmaWdodGVycw== 37218 -IGRvcGFtaW5l 37219 -ZWxldHM= 37220 -IGRlbW9jcmF0 37221 -7KCc66Gc 37222 -IHBsYXliYWNr 37223 -b2o= 37224 -INC/0YDQvtC6 37225 -IFN1bGxpdmFu 37226 -c2VtYmxl 37227 -IFdvcnRo 37228 -IE11c3RhZmE= 37229 -4Liy4Lij 37230 -IG1ldHM= 37231 -6ZaA 37232 -0LvQvtGB0Yw= 37233 -IGluZXJ0aWE= 37234 -IHVuaWZvcm1z 37235 -6Laz 37236 -w6lyaW8= 37237 -15XXqNeU 37238 -w6ludA== 37239 -IOCukg== 37240 -INGB0LDQvNGL0YU= 37241 -IHZvdWxhaXM= 37242 -IFppbW1lcg== 37243 -6rKg6w== 37244 -INC90L7RgQ== 37245 -ZW5jaWFz 37246 -IHJlbGFjacOzbg== 37247 -IOqxuOs= 37248 -IGZhY3Rpb24= 37249 -IGdvc3A= 37250 -0L/QvtC70L7Qtg== 37251 -bmFw 37252 -aGFr 37253 -IHByb2NlZWRpbmdz 37254 -IOyGlA== 37255 -7JWE64uI 37256 -IOyekOq4sA== 37257 -IHdlcmQ= 37258 -IHNvZg== 37259 -IHNjaGxpbQ== 37260 -IGZsYXZvcmVk 37261 -IHF1YWRyYXRpYw== 37262 -IEJvb3Q= 37263 -IHB1YmxpY2l0eQ== 37264 -IENhcm8= 37265 -ID8i 37266 -0L3QuNGG0LA= 37267 -bWFuaWE= 37268 -IFNVUg== 37269 -IEJVUg== 37270 -bGFuY2U= 37271 -w6l0aWNh 37272 -IHpvYmFjenk= 37273 -IHRyaW8= 37274 -c2FtYQ== 37275 -IHRhxZ8= 37276 -IGFzeW1t 37277 -cmVzc2Vy 37278 -INiq2Lk= 37279 -INC/0LXRgQ== 37280 -IGJlZ2lubmluZ3M= 37281 -bGFkxLFt 37282 -INCx0YvRgdGC0YA= 37283 -IG1vbw== 37284 -IEdlbmV2YQ== 37285 -IOWcqA== 37286 -ZXJ1cw== 37287 -Ym9yYWg= 37288 -IHJlZnVzaW5n 37289 -YnVsbA== 37290 -IFdhaXRpbmc= 37291 -IEluZGl2aWR1YWw= 37292 -IGFub255bQ== 37293 -aW1lbnM= 37294 -IG1lZGlkYXM= 37295 -IGZyYWdyYW50 37296 -IGRpcmVjdGVtZW50 37297 -IOyVhOuniA== 37298 -dXJpYQ== 37299 -IHNwaGVyaWNhbA== 37300 -IGFiZ2U= 37301 -IFZpY3Rvcmlhbg== 37302 -IHNwZWN0YWNsZQ== 37303 -IFJvZHJpZ3Vleg== 37304 -IG9jdXA= 37305 -IE7DpHI= 37306 -bWFya3M= 37307 -bmd1bG8= 37308 -IEx1Y2k= 37309 -IHNob3V0ZWQ= 37310 -IHJlZ3VsYXRvcnM= 37311 -xJ9pbmk= 37312 -IGRpc2VudA== 37313 -INGA0YvQvQ== 37314 -64Ko 37315 -IOyCtOs= 37316 -IHByb2Jsw6htZXM= 37317 -IEZpbmdlcg== 37318 -YXNzZW1ibGU= 37319 -IHBlYXI= 37320 -IGRyb2l0ZQ== 37321 -IEV2ZXJ5d2hlcmU= 37322 -dGFt 37323 -0L7RgtC40LI= 37324 -0LLQvtC5 37325 -b3JkaW5hdGU= 37326 -IExhaw== 37327 -IG3hu5tp 37328 -IFRlbGV2aXNpb24= 37329 -IGV4cG9uZW50aWFsbHk= 37330 -YXZhcw== 37331 -IGJsZXY= 37332 -IE1U 37333 -5L+6 37334 -Q29ubmVsbA== 37335 -IOq1reuvvA== 37336 -INGB0LLQvtC40Lw= 37337 -IGFjaGE= 37338 -IER5bmFzdHk= 37339 -Smlu 37340 -IHRvcmU= 37341 -IGZsb3I= 37342 -INC80L3QvtCz0LjQtQ== 37343 -5rKS5LqL 37344 -b3dhbg== 37345 -YmFo 37346 -IOyjhA== 37347 -IENlbGE= 37348 -IOy1nOq3vA== 37349 -IHBlcm1ldHRyZQ== 37350 -IGFicmFz 37351 -IHZlcnN0ZWhlbg== 37352 -IGVzY29ydA== 37353 -IFRoZW0= 37354 -w6Rya2U= 37355 -cG9ydGVy 37356 -IGthaGthaGE= 37357 -IGhlY3Q= 37358 -IGRhdQ== 37359 -d2Fo 37360 -b2x2ZQ== 37361 -IEFnZXM= 37362 -c2NoYWZ0 37363 -IFN0ZWxs 37364 -bmVsbGU= 37365 -IEVuc3VpdGU= 37366 -INCS0YHQtdC8 37367 -IGNyw6lk 37368 -IFBQ 37369 -bG9yZHM= 37370 -Z3J1bnRpbmc= 37371 -IGNvbnRyYWN0aW9u 37372 -R290 37373 -IGFjcXVpcmluZw== 37374 -IHNvcHI= 37375 -IHBvaXNvbm91cw== 37376 -Uk5B 37377 -IGFuYXI= 37378 -IEhvZg== 37379 -Jyk= 37380 -IHJlbWFya2FibHk= 37381 -IGludGVybmFjaW9uYWw= 37382 -w7xja2U= 37383 -aW5xdQ== 37384 -IGR1eQ== 37385 -IGJlYXN0cw== 37386 -IExBTg== 37387 -IHByZWNlZGVudA== 37388 -IFJQTQ== 37389 -5ZGo 37390 -IHNlbG9u 37391 -IG1vcnRl 37392 -IGNvbWXDp291 37393 -0Y/Qu9Cw 37394 -IGludGVycHJldGluZw== 37395 -IEJ1cmtl 37396 -0YLRgNCw 37397 -IOydtOufrA== 37398 -IHBlc3NpbQ== 37399 -IE5vaw== 37400 -7Yyd 37401 -RmVtYWxl 37402 -IOyLpO0= 37403 -mYA= 37404 -IHN0aW11bGF0aW9u 37405 -IHNsaWNr 37406 -IOqwgOuKlA== 37407 -INC60LDQtw== 37408 -IEhCTw== 37409 -IHBhcGllcg== 37410 -IGvDtm5udGVu 37411 -0YPQsdC70Lg= 37412 -IENvbnN0YW50 37413 -U1BFQUtJTkc= 37414 -IGt0w7NyxIU= 37415 -IGNvc21ldGljcw== 37416 -IFRyZW5k 37417 -IHJvYmJlcnk= 37418 -IHRpdHQ= 37419 -IGdqb3J0 37420 -IGRpZXRhcnk= 37421 -oIw= 37422 -IEtpcmJ5 37423 -INC/0YDQuNC80LXRgNC90L4= 37424 -IHF1YWxpZmljYXRpb24= 37425 -IOyViQ== 37426 -IGNhYmluZXRz 37427 -IGh0dHA= 37428 -IEVyaWNh 37429 -576p 37430 -IGRpc2FkdmFudGFnZXM= 37431 -IGNoYXR0ZXJpbmc= 37432 -eXo= 37433 -ZmVpdA== 37434 -IGd1aWxk 37435 -IEVURg== 37436 -IERyYWdvbnM= 37437 -IEhFUkU= 37438 -dmVudGg= 37439 -2YTYp9mF 37440 -IG1hcmNow6k= 37441 -RGFt 37442 -IHBob3Rvbg== 37443 -IGVzdGFibGU= 37444 -TWFn 37445 -IG9saGFy 37446 -IGNvdXBsaW5n 37447 -IEhpbGZl 37448 -IFdpemFyZA== 37449 -INC80LDQu9C+ 37450 -aGVscA== 37451 -IGzDrW5lYQ== 37452 -IOyr 37453 -IHN0YW5kYWxvbmU= 37454 -IG1vcmFsZQ== 37455 -IHp3ZWl0ZQ== 37456 -44KI44KN44GX44GP 37457 -w6RocnQ= 37458 -IGRvdHRlZA== 37459 -IGRyaXBwaW5n 37460 -IEZsYWc= 37461 -6Z2S 37462 -cm9ja2V0 37463 -cmF0ZWd5 37464 -aXJpbQ== 37465 -IO2VmOuptOyEnA== 37466 -IHNvZ2VuYW4= 37467 -IFVubw== 37468 -IFNjaHV0eg== 37469 -IGVzdGlsbw== 37470 -IFN1YnM= 37471 -IERhaXN5 37472 -0J3QtdGC 37473 -Jy4uLg== 37474 -IHBsYXRpbnVt 37475 -IGJpcmw= 37476 -IFNvdmk= 37477 -IHZpb2xhdGU= 37478 -0YPQtdGC0YHRjw== 37479 -cmlsbA== 37480 -IHRyYXo= 37481 -IHNuaXA= 37482 -IGN1bXBs 37483 -4Lit4LiB 37484 -IGN1aw== 37485 -6YWS 37486 -IFBhcmxhbWVudA== 37487 -IGh5cGVydA== 37488 -IHB1bHA= 37489 -IHRvbmd1ZXM= 37490 -YXR0bw== 37491 -IGJ1c2Nh 37492 -aWhu 37493 -RVJP 37494 -INmK2Lk= 37495 -IHZhcmlhcw== 37496 -IE1hcmlhbg== 37497 -IGJvdW5kZWQ= 37498 -IHBpdGNoaW5n 37499 -IGRlZmljaWVuY3k= 37500 -IEJsZXNzZWQ= 37501 -IEV4ZXJj 37502 -dWNocw== 37503 -IG5oxrBuZw== 37504 -5pys5b2T 37505 -IHJhcGVk 37506 -aGFsZXM= 37507 -IG1hbGE= 37508 -cGlj 37509 -IDQwMQ== 37510 -xZtuaWVq 37511 -YXJpbmE= 37512 -65Ok7J2E 37513 -b3R0aQ== 37514 -INC00L7Qu9Cz0L4= 37515 -IHRyYWNrZXI= 37516 -IFNoZWxieQ== 37517 -IHZhbmlzaGVk 37518 -IGJha2VyeQ== 37519 -S2FwxLE= 37520 -SmVzdXM= 37521 -IEtS 37522 -Sk8= 37523 -hbg= 37524 -IGRpc2Nz 37525 -7ISv 37526 -7KeA6w== 37527 -15nXpg== 37528 -ZW1hcnk= 37529 -S2VuZHJh 37530 -IHnDvGs= 37531 -w7xja3Q= 37532 -IHZheg== 37533 -IGt1cA== 37534 -YWt0dQ== 37535 -INGB0L/QsNGB0LjQsdC+ 37536 -IGFpaw== 37537 -IG51cnNlcnk= 37538 -IGVuZGFuZ2VyZWQ= 37539 -w6ptZW1lbnQ= 37540 -ZW1hdGljcw== 37541 -IHJlc3BvbmRlcnM= 37542 -IFJlcHJlc2VudGF0aXZlcw== 37543 -IHNjdWxwdHVyZXM= 37544 -aWdrZWl0ZW4= 37545 -IGRlcGw= 37546 -IGludGVycHJldGF0aW9ucw== 37547 -IGRlYWRsaW5lcw== 37548 -IDE5NDI= 37549 -w5c= 37550 -IHN1Z2Fycw== 37551 -ZW11 37552 -bGl2ZWx5 37553 -IHJlY3JlYXRpb25hbA== 37554 -IGRpc3RvcnQ= 37555 -IHVuZGVyc2NvcmU= 37556 -IHVucXVvdGU= 37557 -IHNhZmVzdA== 37558 -IHN3b2xsZW4= 37559 -IGFuYWx5c2Vz 37560 -IGNvbW1lbmPDqQ== 37561 -5aa5 37562 -YW5kaW4= 37563 -INCl0L7RgNC+0YjQvg== 37564 -IGRpYXJy 37565 -44G+44GB 37566 -emllc3Q= 37567 -IHRvb3RoYnJ1c2g= 37568 -6aC76YGT 37569 -dWF0aW9ucw== 37570 -IGNhZGU= 37571 -IGJhY2tsYXNo 37572 -aGluZA== 37573 -IHJpc3F1ZQ== 37574 -emVzcw== 37575 -IOydtOyVvOq4sA== 37576 -IGVzcGVyYXI= 37577 -IHRyYW5zbGF0aW9ucw== 37578 -aW9uZWQ= 37579 -Z3JvYW5z 37580 -INC/0YPRgg== 37581 -IGdlbmV0aWNhbGx5 37582 -6YCg 37583 -IGhhcHBpZXN0 37584 -IHdlcms= 37585 -YXRvb24= 37586 -IG11c2k= 37587 -IGZ1bsOnw6Nv 37588 -IOyeheuLiOuLpA== 37589 -INGA0LDQuQ== 37590 -IGJldm9y 37591 -QkxBTks= 37592 -IHJlcGVudGFuY2U= 37593 -UHV0 37594 -IHBvdHJ6ZWI= 37595 -IHNhbGE= 37596 -IGNhbXBh 37597 -V0VS 37598 -IGRlY8OtYQ== 37599 -IHPDqWN1cml0w6k= 37600 -IEFwcHJlY2lhdGU= 37601 -0YfQuA== 37602 -IFJhbmRvbQ== 37603 -67OE 37604 -a2Fo 37605 -IG3Dtmo= 37606 -IHPDpGdlcg== 37607 -INeZ15vXldec 37608 -IDE5MA== 37609 -eHR1cmVz 37610 -RXU= 37611 -IGfDpA== 37612 -INeR16o= 37613 -IENyb2F0 37614 -YXBv 37615 -UExF 37616 -IHBlcnNpc3RlbmNl 37617 -5Yqp 37618 -IGJsZW5kcw== 37619 -IHRyZWZmZW4= 37620 -IFNhbnRpYWdv 37621 -eWRpYQ== 37622 -YWxkbw== 37623 -IFRlbnNvckZsb3c= 37624 -IER1YWw= 37625 -44Oc 37626 -IGNoaWZm 37627 -7Je0 37628 -IGNvbnRyYWN0ZWQ= 37629 -IHNlZ3JlZw== 37630 -IEZhaXJ5 37631 -IHdpc2VseQ== 37632 -IHZ1bG5lcmFiaWxpdGllcw== 37633 -IGhhbmRoZWxk 37634 -IGdhZGdldHM= 37635 -IGJvxZ8= 37636 -IFBvcHVsYXI= 37637 -IGN1cnZhdHVyZQ== 37638 -66y4 37639 -IE1BUlk= 37640 -7J207Io= 37641 -IGZvcm11bGF0aW9u 37642 -IGNlbGVyeQ== 37643 -IGJsdXJyeQ== 37644 -IFRT 37645 -YWxleg== 37646 -IHdz 37647 -IHByb2dyYW1t 37648 -IFN0YWNr 37649 -IEpJTQ== 37650 -0L7QstCw0LvQuA== 37651 -xLFsbA== 37652 -IHDDqHJl 37653 -IEthbnll 37654 -IERlbGF3YXJl 37655 -IOOBoA== 37656 -IGRhdW50aW5n 37657 -INCx0LXRgQ== 37658 -IFN0dXBpZA== 37659 -Ymln 37660 -ZmZpY2lhbA== 37661 -IHByZWNpcGl0YXRpb24= 37662 -IHBsdW5n 37663 -4bulYw== 37664 -YnVyc2U= 37665 -IGRhcmxl 37666 -IGNyaXBw 37667 -IHBpb25lZXI= 37668 -IGRpc3B1dA== 37669 -IHNlYW4= 37670 -44GT44KT44Gq 37671 -IHJlc2lzdG9y 37672 -IGFsbGVpbg== 37673 -aXBwbGVz 37674 -YXJlbA== 37675 -IGVuZG9ycw== 37676 -enVzdA== 37677 -INGA0LXQsdGP0YLQsA== 37678 -ZWRlZA== 37679 -IOy5tOuplOs= 37680 -IGxsZXZh 37681 -IGtlbm50 37682 -INCx0LDQuw== 37683 -IERvY3VtZW50 37684 -IEtuaWdodHM= 37685 -IGJ1Y2tsZQ== 37686 -IOyJrA== 37687 -IGFsaw== 37688 -IEV2ZXJ5ZGF5 37689 -YXR0ZXJz 37690 -IHRvaWxldHM= 37691 -IGp1Z2Fy 37692 -IOyeiOyngA== 37693 -IGdlbmF1c28= 37694 -IExhbmRlc3JlZ2llcnVuZw== 37695 -44Gj44Gx 37696 -aWpl 37697 -IHRyYWlsZXJz 37698 -IFRpZ2Vycw== 37699 -IGdpdHRp 37700 -IGZvcmdpdmluZw== 37701 -IGNvbmN1cnJlbnQ= 37702 -IFZ1 37703 -IO2Kue2eiA== 37704 -IEJST1dO 37705 -b3VuZGVk 37706 -Ijs= 37707 -IHRyZW1i 37708 -IHRpZXQ= 37709 -INGA0LXQttC40Lw= 37710 -IG51dHNoZWxs 37711 -0LXQu9C40Yc= 37712 -IGxvc2Vycw== 37713 -cmljdGluZw== 37714 -IHJlZGVlbQ== 37715 -ZGVmaW5lZA== 37716 -TmljZQ== 37717 -IGJyb2FkYmFuZA== 37718 -S08= 37719 -IHRlYXNpbmc= 37720 -IHBhcnRpc2Fu 37721 -xLFtYQ== 37722 -IOyerOuvuA== 37723 -IEpvdXJuZXk= 37724 -IHNsb3Blcw== 37725 -dW5pbmc= 37726 -Z3J1bnRz 37727 -IHTDpGxs 37728 -IHVuY292ZXJlZA== 37729 -IG15xZtsxJk= 37730 -IEVzdGhlcg== 37731 -5LqO 37732 -IEhlYWx0aHk= 37733 -IOuwkQ== 37734 -csOpZQ== 37735 -IHBvbGFyaXphdGlvbg== 37736 -IGZsYXY= 37737 -IGNhbWJpYXI= 37738 -IHly 37739 -IFJhbmNo 37740 -IHNwbGl0cw== 37741 -IHRyb3V2w6k= 37742 -5ZyL5a62 37743 -IHJlY29yZGVy 37744 -IGTDqXBhcnQ= 37745 -2YjYqA== 37746 -IEtyeQ== 37747 -IGludGVyZXNzYW50 37748 -IGVkZXJpbQ== 37749 -xZt3aWFk 37750 -aWxhdGVyYWw= 37751 -d3JpZ2h0 37752 -IHBvdXJyYQ== 37753 -w6p0ZXI= 37754 -IGNhbWVs 37755 -4Z4= 37756 -IHJhcGlkZW1lbnQ= 37757 -IG1lag== 37758 -IHN0aWZmbmVzcw== 37759 -QURBUw== 37760 -IGRpZmZlcnM= 37761 -IGFsb3Q= 37762 -IFNpZw== 37763 -0Y/RgtC10LvRjA== 37764 -IGFic3RyYWN0aW9u 37765 -5ZyY 37766 -IGtlaW5lcg== 37767 -Z3J1cHA= 37768 -IFNoZXJsb2Nr 37769 -7ZiU 37770 -IGNpdGU= 37771 -IG92ZXJmbG93 37772 -IHThuqFp 37773 -w7pjYXI= 37774 -YnVsYQ== 37775 -IGNvbmp1bnRv 37776 -IENJ 37777 -IG1vZGVyYXRvcg== 37778 -IGluZGlyZWN0bHk= 37779 -IGFsbGVpbmU= 37780 -4oI= 37781 -0YjQuNCx 37782 -INCx0LDQsQ== 37783 -IGRhbmFjaA== 37784 -IDE5Mzk= 37785 -IHByb21ldA== 37786 -IGRlc3RpbmF0aW9ucw== 37787 -IElsbHVzdA== 37788 -zrnOus+M 37789 -IHNhYmVz 37790 -IGhlaA== 37791 -IEdlc2V0emVudA== 37792 -IE1peg== 37793 -0LXQvdC60L4= 37794 -IE15cw== 37795 -0Kw= 37796 -IEp1ZGFpc20= 37797 -IG11c3RhY2hl 37798 -IHN0aW1tdA== 37799 -IEdhemE= 37800 -IHZvbHRl 37801 -IG51bw== 37802 -IG3Ds24= 37803 -IENvbXB1dA== 37804 -4Li54LmI 37805 -IFJhZGk= 37806 -IGV4Y2VwdGlvbmFsbHk= 37807 -IGFzc3VtZXM= 37808 -6ZaL5b+D 37809 -44GI44Gw 37810 -aW5mb3Jt 37811 -IHNocmluZQ== 37812 -5pOK 37813 -IGltcGxpY2F0aW9u 37814 -IEZpdHo= 37815 -5rKS6Zec5L+C 37816 -IS4= 37817 -IGx0 37818 -IGFsbG95 37819 -IGV0aGlj 37820 -IG1vbmFzdGVyeQ== 37821 -7Iuc7KOg 37822 -aWNhw6fDo28= 37823 -IGNvb3JkaW5hdGluZw== 37824 -IE1vdG8= 37825 -IG92ZXJsb29r 37826 -IGNob2lz 37827 -IGFudGliaW90aWM= 37828 -IE1pbm5l 37829 -IEJK 37830 -IEFwYQ== 37831 -b3JpYW4= 37832 -IHNwaWxsZWQ= 37833 -SmFt 37834 -IGh1c2JhbmRz 37835 -IGNyZWF0aW9ucw== 37836 -IGHDsQ== 37837 -w7xzc2Vs 37838 -IOydtOyaqQ== 37839 -IGFuYWx5c2U= 37840 -cm9zZQ== 37841 -IHB1bmNoZWQ= 37842 -IHByZXNxdWU= 37843 -IGFzdHJvbm9teQ== 37844 -IHNjaHdpZXJpZw== 37845 -IEVib2xh 37846 -IGNpcw== 37847 -IGFjZXQ= 37848 -IEZY 37849 -ZW5kcmU= 37850 -IOydjOyVhQ== 37851 -IHdlYnBhZ2U= 37852 -IGZyZWFrZWQ= 37853 -IGxhdHRl 37854 -IOy/oA== 37855 -IOuouOs= 37856 -TmV2ZXI= 37857 -R3Jh 37858 -7ZmU66W8 37859 -ZXllZA== 37860 -IOuwnOudvA== 37861 -IGVzcGVyYQ== 37862 -IGFwYXJlY2U= 37863 -cmHDp8Ojbw== 37864 -IGRpc3J1cHRpdmU= 37865 -IEpvaW50 37866 -dXJvdXM= 37867 -cmVhcw== 37868 -IHF1ZXLDrWE= 37869 -IGRpc3RyaWJ1dGlvbnM= 37870 -IGV4cG9uZW50 37871 -7LmY66W8 37872 -IGRs 37873 -emhvdQ== 37874 -IEhlYXJpbmc= 37875 -5beu5LiN5aSa 37876 -IENyYXc= 37877 -IGZsb2F0cw== 37878 -b3VuY2Vk 37879 -TGFi 37880 -V29ybGQ= 37881 -IGJ1cmRlbnM= 37882 -IGF1dGhvcml0YXJpYW4= 37883 -IEJvbHQ= 37884 -INC+0LTQvdGD 37885 -IHBpZ2Vvbg== 37886 -IGRpc3RyYWN0aW9ucw== 37887 -IEhlcmF1c2ZvcmRlcg== 37888 -IHplc3Q= 37889 -ZXNj 37890 -IHNoYWtlcw== 37891 -YXRhcw== 37892 -INmF2LQ= 37893 -aG9sZXM= 37894 -IHRoaW5rZXJz 37895 -YWx0YQ== 37896 -IGFyY2hl 37897 -IFN1aw== 37898 -YW5oYQ== 37899 -IHRlbXB0aW5n 37900 -IHlvdXR1YmVy 37901 -IHbDrA== 37902 -IGR6aWHFgmE= 37903 -IFZhdGljYW4= 37904 -UGFyaw== 37905 -IHN1cGVycw== 37906 -IE5pa2tp 37907 -64qQ6w== 37908 -b3Jhbmc= 37909 -cmFtaWVudA== 37910 -6ay8 37911 -IOqwluqzoA== 37912 -IGRlc3NlcnRz 37913 -IGF2ZXJl 37914 -IEdyZWdvcnk= 37915 -IOuTpOyWtOyY 37916 -IGNvc3Rpbmc= 37917 -IENsaW5pYw== 37918 -IHJlYmVscw== 37919 -IE1vYg== 37920 -IGJ1bmxhcg== 37921 -IFlvdXJz 37922 -ZXJ0aW1l 37923 -IHJldGFsaQ== 37924 -bWFyYQ== 37925 -YXR1cw== 37926 -YWxsZXM= 37927 -INC00YA= 37928 -INC00LjRgQ== 37929 -IGRpc2NvdW50cw== 37930 -IEdVWQ== 37931 -INC60LDQutC+0LU= 37932 -IEV4cGVyaW1lbnQ= 37933 -cmVtZW50 37934 -IFhpYW5n 37935 -IGJhdGU= 37936 -V0U= 37937 -IHNwZWNpYWxpemU= 37938 -IGRlaXR5 37939 -IExva2k= 37940 -bWFn 37941 -IE5pdA== 37942 -V2VzdA== 37943 -IG1hdGVybmFs 37944 -IHF1aXM= 37945 -5Z+65pys 37946 -YnJva2Vu 37947 -IGxhc2Vycw== 37948 -IGhha2s= 37949 -IEFuZ2Vscw== 37950 -IG1hc3Rlcnk= 37951 -YW50aXM= 37952 -VGlmZmFueQ== 37953 -ZWVl 37954 -55E= 37955 -b3JlbQ== 37956 -IGluYWNj 37957 -IGp1cmlzZGljdGlvbnM= 37958 -IEthcmRhc2g= 37959 -5py6 37960 -SWw= 37961 -IFNpbm4= 37962 -5YuV55S7 37963 -IGF0aGxldGljcw== 37964 -Y8SZ 37965 -IGxvb3NlbHk= 37966 -IGRpZXRh 37967 -QWc= 37968 -ID8/ 37969 -IOuMgO2RnA== 37970 -IHN1cGVydg== 37971 -IG51dHJpdA== 37972 -IGRyaWZ0aW5n 37973 -IOyEoOyDneuLmA== 37974 -INC/0L7QvdGP0Ls= 37975 -IFZpY3Rvcnk= 37976 -2YTYqQ== 37977 -15XXoNeU 37978 -INC/0LjRiA== 37979 -IHNoYXZlZA== 37980 -IG1lc3VyZQ== 37981 -b25kZW4= 37982 -2YPYsQ== 37983 -IGV4aWxl 37984 -IERlc2Rl 37985 -IFBpbnRlcmVzdA== 37986 -IGF0dGFjaG1lbnRz 37987 -IGhvbWJyZXM= 37988 -IGZpbmVz 37989 -IOyEuOyDgQ== 37990 -IHNsZWVwcw== 37991 -IFRhY28= 37992 -IElSQQ== 37993 -cmlvcw== 37994 -IG9sbA== 37995 -ZXRlcw== 37996 -IHVudXQ= 37997 -ZmFzaGlvbmVk 37998 -IHRyZWJhbGw= 37999 -IE5lYXJseQ== 38000 -INGA0LXQsNC70YzQvdC+ 38001 -IGNoaWw= 38002 -6YCx 38003 -xJ9h 38004 -IE1FTA== 38005 -cm9zY29w 38006 -IENH 38007 -IHZlbmdl 38008 -IGRpc2h3YXNoZXI= 38009 -YWxnaWM= 38010 -IG1vZGlmaWVy 38011 -IGVtYmFzc3k= 38012 -dGltZXI= 38013 -ZW1pY3M= 38014 -IGludHJpY2F0ZQ== 38015 -IGV2ZXQ= 38016 -IOuMgOuwlQ== 38017 -IGlzb3Q= 38018 -INC90LDRg9GH 38019 -IFF1aXo= 38020 -cmVzbw== 38021 -zrTPjg== 38022 -IHllbGxlZA== 38023 -IGZlZGVy 38024 -RUxMRVI= 38025 -IGV4Y2VlZGVk 38026 -b25hcw== 38027 -aWNhbm8= 38028 -INC20LjQstC+0YI= 38029 -IE1hbw== 38030 -IEthenV0bw== 38031 -IOOFi+OFi+OFi+OFiw== 38032 -IGZyb250bGluZQ== 38033 -IEh1bmdhcmlhbg== 38034 -IMO8YmVyYWxs 38035 -YXdhdA== 38036 -IGdyaXBz 38037 -acOnw7Vlcw== 38038 -YXJueWE= 38039 -IM2h 38040 -IHNlaWQ= 38041 -IGFuYWs= 38042 -IGFjYWJvdQ== 38043 -7ZWR 38044 -IG5vdG9yaW91cw== 38045 -IEdvZHppbGxh 38046 -IG92ZXJjb21pbmc= 38047 -IFBlbmQ= 38048 -IG9sYWJpbGly 38049 -w7xsbWU= 38050 -IGVyaGFsdGVu 38051 -44KJ44GE 38052 -6re5 38053 -IE1ldGVy 38054 -IHN0YWFu 38055 -T2w= 38056 -IGNoYXRz 38057 -IEJ1ZW5vcw== 38058 -w612ZQ== 38059 -YWx1YWJsZQ== 38060 -IHN0cmF0ZWdpY2FsbHk= 38061 -IGNvbXByaXNlZA== 38062 -INC/0LXRgNGB0L7QvdCw0LY= 38063 -IHdhbm4= 38064 -IENlbg== 38065 -0L3QuNGC0LU= 38066 -n4E= 38067 -INGC0L7QsdC+0Lk= 38068 -aWFk 38069 -IGthcmRlxZ9pbQ== 38070 -IENvbmdyZXNzbWFu 38071 -cmVhbWluZw== 38072 -aG9tbWU= 38073 -IGNvbW11bmF1dA== 38074 -IGFsY29ob2xpYw== 38075 -IHBpY2tsZWQ= 38076 -IGFjb3Jk 38077 -cG9zaXRpb24= 38078 -ZWfDs2w= 38079 -IHRyb3VibGluZw== 38080 -IE1hcmNoZWc= 38081 -IHp1bWluZGVzdA== 38082 -IHNlYW1sZXNzbHk= 38083 -IG9sdW4= 38084 -IFRWcw== 38085 -INC/0YDQsNC60YLQuNGH0LXRgdC60Lg= 38086 -IGJhY2tlbmQ= 38087 -44GT44KT44Gr44Gh44Gv 38088 -aWRhYmxl 38089 -IGdhZGdldA== 38090 -IGZhw6dv 38091 -IE1hcmNoZWdpYW5p 38092 -IOuwpA== 38093 -IGFjY2lkZW50YWw= 38094 -IExQ 38095 -IGVsZGVzdA== 38096 -IEFkbWlyYWw= 38097 -IG7Eg20= 38098 -bGV2ZXI= 38099 -IHBhc3RlbA== 38100 -IGZvbmRv 38101 -Q29ubmll 38102 -IHRlcmNlcg== 38103 -IHBhY3Q= 38104 -IE1vbnRl 38105 -IG1lYXRz 38106 -IFNNUw== 38107 -IEF1c3RyYWxpYW5z 38108 -57w= 38109 -UmhldHQ= 38110 -IGV4YWN0ZW1lbnQ= 38111 -IOu5vA== 38112 -IE1PRA== 38113 -56E= 38114 -IFJhcHQ= 38115 -IE5vY2g= 38116 -IGFib3J0 38117 -IE5hdmFs 38118 -IEZ1amk= 38119 -SU5URVI= 38120 -INC90L7QstGL0Lk= 38121 -IG1pZWpzY2U= 38122 -IElDVQ== 38123 -IEdyYWR1YXRl 38124 -IEdsZW4= 38125 -YXJkaQ== 38126 -IMiY 38127 -IHNvbGRlcg== 38128 -IHByb2Zlc3Npb25z 38129 -IG9ydGhvZw== 38130 -b21u 38131 -aW50cm9kdQ== 38132 -IERlbmlzZQ== 38133 -7J6Q66W8 38134 -IGNvcnJlc3BvbmRlbmNl 38135 -QU1B 38136 -IGluZmxpY3Q= 38137 -IGZhbmQ= 38138 -IEfDvA== 38139 -INGH0LXRgg== 38140 -IHRyYWNlZA== 38141 -IHBhdGVudHM= 38142 -IGFtYnVzaA== 38143 -IGxvdHRh 38144 -ZmZlcg== 38145 -IFdhZ25lcg== 38146 -IGltcGVyc29u 38147 -IGV4dHLDqm1lbWVudA== 38148 -2YLYqg== 38149 -Y29uZHVjdA== 38150 -QXR0 38151 -IE11ZWxsZXI= 38152 -IEFsaWNpYQ== 38153 -IGN5Yw== 38154 -IGhhY2tlcg== 38155 -IHR5cw== 38156 -IGhhaWw= 38157 -INC30LDRj9Cy 38158 -IHBhc3Nv 38159 -IOy2lOqwgA== 38160 -IM6I 38161 -IHBhY2thZ2Vk 38162 -IEN5bnRoaWE= 38163 -aGVldA== 38164 -5Lit5Zu9 38165 -IE5pc3Nhbg== 38166 -IFF1ZXN0bw== 38167 -6ag= 38168 -ZGlk 38169 -IM68zrnOsQ== 38170 -IEVsbGlz 38171 -IEFuYWx5c2lz 38172 -Y2Vtb3M= 38173 -IGFzZWc= 38174 -IE15c3Rlcg== 38175 -IENhbw== 38176 -IHR1dg== 38177 -IEluZHVzdHJ5 38178 -7KO86rOg 38179 -b3RhbA== 38180 -IHBlcXVlw7Fv 38181 -YnJhcw== 38182 -IGNvbXByZWhlbmQ= 38183 -IFNpbXBzb24= 38184 -0YHRgtCy0LjQtQ== 38185 -b2NyYWN5 38186 -0LjRh9C10YHQutC4 38187 -IE11c2g= 38188 -IExhdXJpZQ== 38189 -IHRyaWFuZ3VsYXI= 38190 -IFByZXNlbnRz 38191 -IEt1bmRlbg== 38192 -57S5 38193 -5q2m 38194 -IElzcw== 38195 -IERlY2s= 38196 -4buDbg== 38197 -IERhcmtuZXNz 38198 -IGluZmxhbW1hdG9yeQ== 38199 -ZXJlbWlhaA== 38200 -IHdhcm1lZA== 38201 -dmV5YXJk 38202 -IE1lbW9yeQ== 38203 -ZXR0eQ== 38204 -IHRheHBheWVycw== 38205 -4LiT 38206 -2KE= 38207 -IHByYWN0aXNl 38208 -64us6w== 38209 -IGRyaWxsZWQ= 38210 -bcO8xZ8= 38211 -bG9nbw== 38212 -IEZhY2g= 38213 -pOuhnA== 38214 -IMO8YnJpZ2Vucw== 38215 -IGtvbm50ZW4= 38216 -IG5vcm1hbG1lbnRl 38217 -IGFyZ3Vlcw== 38218 -aWxpbmd1YWw= 38219 -sOulvA== 38220 -ZWdhbA== 38221 -IHRyYXZhaWxs 38222 -b3Z5 38223 -0LDRgtC+ 38224 -IHJ1dGg= 38225 -IExpZ2h0cw== 38226 -IGNvbnNpc3RlZA== 38227 -15HXqNeZ150= 38228 -IHN0ZXJlb3R5cGU= 38229 -IHBheWVy 38230 -IFJlZQ== 38231 -IEFpcmJuYg== 38232 -IGRyb3duZWQ= 38233 -IFpvZQ== 38234 -IGNhbm9weQ== 38235 -IGJhcnI= 38236 -INC90L7Rhw== 38237 -IHBhZ2Fu 38238 -IGphcnM= 38239 -IHLDqg== 38240 -ZXJ2ZXI= 38241 -5oi/ 38242 -aWViZW4= 38243 -IGVzcGVjdA== 38244 -IEZp 38245 -IHVud2lsbGluZw== 38246 -IHRlY2huaWNpYW4= 38247 -4bq3dA== 38248 -bWVtYmVy 38249 -IENhbmFs 38250 -2LPZhQ== 38251 -IGxpZWJlcg== 38252 -IGluZmVyZW5jZQ== 38253 -IGhvbm9yaW5n 38254 -5ZG1 38255 -IENhbXBhaWdu 38256 -IGxpbmVhZ2U= 38257 -IFN0cmVzcw== 38258 -IHZpY3Rvcmllcw== 38259 -IGRlamE= 38260 -16M= 38261 -w6p0ZXM= 38262 -YmxpY2s= 38263 -INC80LXQvdC10LU= 38264 -b3Rocw== 38265 -IENvdXBsZQ== 38266 -SmFzb24= 38267 -IE5pY29sYXM= 38268 -0LXQutGB 38269 -bGli 38270 -IGhlcnJhbWllbnQ= 38271 -INeQ15XXnteo 38272 -INCy0LjQtNC40Lw= 38273 -bWlsbGltZXRlcg== 38274 -IHNpbGhvdWV0dGU= 38275 -IGRyaXZld2F5 38276 -IGNoZXJpc2g= 38277 -44Wg44Wg 38278 -IHJhbnNvbQ== 38279 -IGludGVyZGlzY2lwbGluYXJ5 38280 -IFBvcnRhbA== 38281 -IHRyYWc= 38282 -dGhvb2Q= 38283 -IHRlZGlvdXM= 38284 -IGdsb3NzeQ== 38285 -IHByw6lwYXI= 38286 -IENheQ== 38287 -IFRvb2s= 38288 -IEJvdHRvbQ== 38289 -IHppZw== 38290 -5as= 38291 -5Y2x 38292 -cmVwcmVzZW50ZWQ= 38293 -4LmA4Lil4Lii 38294 -IGRlc2Fycm9sbG8= 38295 -7ISc6w== 38296 -IHZpc2Nvcw== 38297 -IG1pbGxpZ3JhbQ== 38298 -IEd1bmQ= 38299 -IGZlcm1lbnQ= 38300 -ZHJ1bQ== 38301 -IGRyYXdlcnM= 38302 -TGF1Z2g= 38303 -IHBlbG9z 38304 -IHBhdmVtZW50 38305 -IG1lbW9pcg== 38306 -YXZhaXQ= 38307 -IDIwNTA= 38308 -pOulvA== 38309 -IHJhesOzbg== 38310 -IGZsb3VyaXNo 38311 -IHN0ZXJu 38312 -5LiI 38313 -IENodW5n 38314 -IHNlcnBlbnQ= 38315 -IEdlbnRsZW1lbg== 38316 -55yf55qE5b6I 38317 -a29vaw== 38318 -IGx1dA== 38319 -aW1wb3J0ZQ== 38320 -cGFyZW50 38321 -IHdzeg== 38322 -IHNjcmVl 38323 -IE1pdGFyYmVpdGVy 38324 -5be0 38325 -bXV0 38326 -IOyWmOq4sOulvA== 38327 -IHNlbWJsZQ== 38328 -IE9X 38329 -IGludmVzdGlnYXRvcg== 38330 -IENoZXJ5bA== 38331 -IEdlcmFsZA== 38332 -IHByZXJl 38333 -IGNvbXBhcmVz 38334 -bnl0 38335 -IGRpZmVyZW7Dp2E= 38336 -Py0= 38337 -IHF1w6E= 38338 -16jXmQ== 38339 -U2Vu 38340 -IGhlcHM= 38341 -IGdyYXR1aXQ= 38342 -IGNvbnNvcnQ= 38343 -IFNUT1A= 38344 -IFByb3Rlc3RhbnQ= 38345 -IGVsZWN0cm9kZQ== 38346 -4pc= 38347 -IHNlY3VyZWx5 38348 -0LjRh9C10YHQutC+0Lk= 38349 -IHTDpMOk 38350 -IHJlZ2lzdGVycw== 38351 -IEhlYXZlbmx5 38352 -b2dseQ== 38353 -aXNzw6Q= 38354 -IFBoeXNpY3M= 38355 -IE1lcmtlbA== 38356 -IHLDqXY= 38357 -6Zmi 38358 -IGVyYXNlZA== 38359 -IFNhY3JhbWVudG8= 38360 -IGNvZmZpbg== 38361 -IGV4YWNlcg== 38362 -IGxhbno= 38363 -IHBvZXRz 38364 -dWxpZg== 38365 -IOy5mOs= 38366 -IE5lcmQ= 38367 -IE5DVA== 38368 -IEhvdXI= 38369 -bmVobWVy 38370 -npjrj4Q= 38371 -IFByaW5jaQ== 38372 -U3c= 38373 -bWllcw== 38374 -YXJtZWQ= 38375 -IEJlYXRsZXM= 38376 -IHByb3BhZ2F0aW9u 38377 -IGV4Y2hhbmdlZA== 38378 -IGN1bXVsYXRpdmU= 38379 -IOynkeyXkA== 38380 -IGRlZmVhdGluZw== 38381 -5oqx 38382 -YmVscw== 38383 -IHdlcw== 38384 -IE9keXNzZXk= 38385 -5L2g5oOz 38386 -YXZpb3I= 38387 -IOychOyXkA== 38388 -IGJyaXQ= 38389 -IGhpam8= 38390 -REFZ 38391 -INin2YTYqtmK 38392 -INCh0LXRgNCz 38393 -0YPQutCw 38394 -ZWRzacSZ 38395 -IGltcG9z 38396 -IGVsbGFz 38397 -IGZpcmVhcm1z 38398 -IE5S 38399 -INeR15A= 38400 -INCf0L7QutCw 38401 -YXdp 38402 -IOyEseqztQ== 38403 -IHB1cGlscw== 38404 -IFRhY2s= 38405 -IGZyYXNl 38406 -IFNoaXA= 38407 -IHN0YWQ= 38408 -5Lic 38409 -IEdyZWF0ZXI= 38410 -dW51bg== 38411 -aW1tdW5n 38412 -Z3Jvd24= 38413 -IE5YVA== 38414 -IEFtZXJpY2Fz 38415 -Zm94 38416 -IG1hbnRlbg== 38417 -6aCQ5YKZ 38418 -INGB0L7Qug== 38419 -IHJpa3Q= 38420 -bGVjdHJpYw== 38421 -ZGVlcA== 38422 -INC30L3QsNC10YjRjA== 38423 -IGJlbnV0 38424 -IEluZnJhc3Q= 38425 -IEVtaXI= 38426 -INC+0YLQv9GA0LDQsg== 38427 -IEtpbWNoaQ== 38428 -IEZpbm5pc2g= 38429 -tOyggQ== 38430 -aW5haXJl 38431 -IG9pa2U= 38432 -5riF5qWa 38433 -IGhvc3RhZ2U= 38434 -IEJ1dHRvbg== 38435 -2YLZig== 38436 -ZWtpbmc= 38437 -IEthemFraA== 38438 -IGNvbWZvcnRpbmc= 38439 -IHNvZw== 38440 -IGdyZWV0ZWQ= 38441 -Z3VpdGFy 38442 -cGF5ZXI= 38443 -IHJlbGF0aW9uYWw= 38444 -IGNvbnN0cnVpcg== 38445 -54m55Yil 38446 -b3BpYW4= 38447 -IFZvbHVtZQ== 38448 -aWV0aA== 38449 -0YHRgtCy0L7QvA== 38450 -dXJyZWN0aW9u 38451 -bGnFm215 38452 -IGhlbWlzcGhlcmU= 38453 -IEJlYW4= 38454 -SUdO 38455 -IGvDtnTDvA== 38456 -IEZhbGxvdXQ= 38457 -IGJyYWNl 38458 -57m857qM 38459 -z4DOrA== 38460 -IEhBUw== 38461 -IGfDqQ== 38462 -IGNoYXJhY3Rlcml6ZQ== 38463 -4bq3Yw== 38464 -IE1pbGt5 38465 -IHR1bW9ycw== 38466 -IG51aXQ= 38467 -IEdheg== 38468 -IOyeiOuLpOuKlA== 38469 -INCz0LDRgA== 38470 -ZXNzbWVudA== 38471 -IEFiZQ== 38472 -IOu9kQ== 38473 -IEVpbnNhdHo= 38474 -SklO 38475 -asOk 38476 -Q3J5 38477 -IFByb21pc2Vk 38478 -INGB0LXRgNC0 38479 -b2t1cw== 38480 -IHNjYWxhYmxl 38481 -INC/0L7RgdC80L7RgtGA0LXRgtGM 38482 -w7xja2xpY2g= 38483 -IHJlYWxpc20= 38484 -IG1heW8= 38485 -IGp1dmVuaWxl 38486 -IGhlYWRsaWdodHM= 38487 -IGfDtnLDvMWf 38488 -IFJlZm9ybQ== 38489 -IGhhbHZlcw== 38490 -Y3puZQ== 38491 -IGJyZWFrdXA= 38492 -xbxlag== 38493 -IHLDpHR0 38494 -RGF5 38495 -IOydvOuzuA== 38496 -IG11ZXJ0ZQ== 38497 -IHR1bmVz 38498 -IFNtaWxl 38499 -cmVjb3Jk 38500 -IHJlY2hlcmNoZQ== 38501 -YXRpc2ZpZWQ= 38502 -IHBvemk= 38503 -IGNlbGVicmF0aW9ucw== 38504 -aXNleHVhbA== 38505 -IFJPQg== 38506 -dGhpcmRz 38507 -IEZvcnR1bmU= 38508 -INGC0L7QuQ== 38509 -IGJyYW5kZWQ= 38510 -bG9v 38511 -IGR1ZA== 38512 -IHJhbmRvbWl6ZWQ= 38513 -IGNvbWJpbg== 38514 -5LiA5Lqb 38515 -aWVyYW4= 38516 -Y3plbmlh 38517 -jeODqw== 38518 -IGN1cmF0b3I= 38519 -IGFydGVyeQ== 38520 -INGD0Yg= 38521 -INGH0LjRgg== 38522 -IHN1YnNpZGllcw== 38523 -IGJsb3Nzb20= 38524 -IFR3aWxpZ2h0 38525 -IGh5dsOk 38526 -IFBvbXBl 38527 -IENpc2Nv 38528 -INCf0YDQvg== 38529 -IGJpcmk= 38530 -IGdlcm4= 38531 -IHJlYnVpbHQ= 38532 -IHdjemU= 38533 -IGJlbmVmaWNp 38534 -IGRydW1tZXI= 38535 -IHNvbGlkcw== 38536 -IGRpeW9yc3Vu 38537 -44GC44KK44GM44Go44GG44GU44GW44GE44G+44GX44Gf 38538 -bGF0ZWQ= 38539 -IG11ZGR5 38540 -IGhvbG9n 38541 -IGNsYXBz 38542 -IFJpbmdz 38543 -IE9rZXk= 38544 -IEJyYXZl 38545 -IHZhbHVhdGlvbg== 38546 -IG1pZ3JhbnQ= 38547 -IGludGVybWl0dA== 38548 -IGVpZ2VuZQ== 38549 -aWxpYXJ5 38550 -44O844OI 38551 -bWFya3Q= 38552 -a3I= 38553 -IFJpYg== 38554 -4buZaQ== 38555 -IGFjY3VzYXRpb25z 38556 -IGFyYWI= 38557 -d2FzaA== 38558 -IEJhcmR6bw== 38559 -IHVnaA== 38560 -ZXN0ZXJz 38561 -b3BocmVu 38562 -IGFsaW1lbnRvcw== 38563 -IFV6 38564 -1oI= 38565 -IDY1MA== 38566 -INC/0YDQuNC10YU= 38567 -Rkk= 38568 -IHNhbXBhaQ== 38569 -IHBhcmzDqQ== 38570 -aGVzaW9u 38571 -IHPEsXI= 38572 -IGFwcGFyYXR1cw== 38573 -IGNvcnJlbGF0ZWQ= 38574 -IFByaW5jaXBhbA== 38575 -IGNvcnI= 38576 -IE9mZmljaWFs 38577 -0LjRh9C10YHQutC40LU= 38578 -IHRlcm1pbmFscw== 38579 -U2hvdWxk 38580 -IHZhY3Vu 38581 -IHN0ZWxsdA== 38582 -IG1vb2k= 38583 -ZXR6dW5n 38584 -INC60YDQsA== 38585 -IGRhaQ== 38586 -INC/0L7Qtg== 38587 -VGVhbQ== 38588 -IFBQRQ== 38589 -INCe0YE= 38590 -IExlYWg= 38591 -IEl2eQ== 38592 -eXN0 38593 -IHVoaGg= 38594 -IG5pZ2h0dGltZQ== 38595 -IHRyZW5keQ== 38596 -IHNlY3VyaXRpZXM= 38597 -IGNvbnRpbmVudHM= 38598 -IGZpcnN0aGFuZA== 38599 -IFZlcm9u 38600 -IOuCrg== 38601 -IGJyb3dzaW5n 38602 -IENhZGE= 38603 -dHJv 38604 -IHRyYW1w 38605 -cmVpYg== 38606 -IGVyc3RtYWw= 38607 -aXJsZXI= 38608 -IHBzaWM= 38609 -IGdldGly 38610 -IE5Q 38611 -IGR6aWVjaQ== 38612 -0L7QsdGA0LDQtw== 38613 -IG1hZ2ljaWFu 38614 -IHNjcnV0aW55 38615 -IHNsYWI= 38616 -IE9U 38617 -aXN0eQ== 38618 -aXJpZXM= 38619 -b3Jlc3Q= 38620 -IHRhc2tlZA== 38621 -IG1vcmFsbHk= 38622 -7JW87KeA 38623 -dXN0ZXJlZA== 38624 -IGZvb2xz 38625 -IGlycmVzcG9ucw== 38626 -IGVpbmY= 38627 -IHZp4buHYw== 38628 -IHNjb3I= 38629 -IHBpbGxvd3M= 38630 -IEdlZ2Vu 38631 -IHR1dHRl 38632 -IHF1YXJ0ZXJseQ== 38633 -IGRpZG50 38634 -IEd5bQ== 38635 -IEV0aGVy 38636 -INir 38637 -0LvQuNGI0LrQvtC8 38638 -IHNpZ25hbGluZw== 38639 -IE5vZGU= 38640 -IERvbmNz 38641 -IHlhaA== 38642 -IEthbmFs 38643 -IGZhZGluZw== 38644 -ZXRpbg== 38645 -IGluZmx1ZW5jZXJz 38646 -IG1lZGFscw== 38647 -IGVuZ2luZWVyZWQ= 38648 -IGZlcm1lbnRlZA== 38649 -6rKg7KeA66eM 38650 -IEJlZXRob3Zlbg== 38651 -157XqQ== 38652 -aW5lbnRhbA== 38653 -IOyVjOugpA== 38654 -w7x0ZmVu 38655 -YWxueWE= 38656 -IG92ZXJl 38657 -IGRlbmt0 38658 -0LDQutGC0LXRgA== 38659 -IOKY 38660 -IG5lY2VzaXQ= 38661 -IGdlbmVyYXRvcnM= 38662 -Z3Jhc3M= 38663 -INC/0L7QtNGD0Lw= 38664 -bGllw59lbg== 38665 -QmFy 38666 -nOuPmQ== 38667 -INC00LXRgtC10Lk= 38668 -IHN1Y2tpbmc= 38669 -IHN0ZW5jaWw= 38670 -IHByaW1v 38671 -IEJyZWF0aA== 38672 -c3Ryb20= 38673 -IGltbWVuc2VseQ== 38674 -IGFwcHJlaA== 38675 -7KCV7J20 38676 -UG9w 38677 -IGpvbmc= 38678 -IEdpdWw= 38679 -IEFESEQ= 38680 -IGjDtnJlbg== 38681 -IGVsbw== 38682 -aXZlbnQ= 38683 -IHJ1cw== 38684 -IG91dHJhZ2VvdXM= 38685 -IG1hc3RlcmVk 38686 -IOy7pA== 38687 -2YjZgQ== 38688 -aXBlcw== 38689 -IFJ1ZHk= 38690 -SmFjb2I= 38691 -IGJ1bGxpc2g= 38692 -IHRhcHBlZA== 38693 -IGZhdWQ= 38694 -aXpvcGhyZW4= 38695 -INGB0L7RhQ== 38696 -IERhcmxpbmc= 38697 -IDE5NjM= 38698 -IFByZXZlbnRpb24= 38699 -spQ= 38700 -IGFiZG9taW5hbA== 38701 -c3RvbmVz 38702 -IGF2YWllbnQ= 38703 -4buVaQ== 38704 -bWFrZQ== 38705 -IHNhcmU= 38706 -IEluc3RhbnQ= 38707 -0LrQsNC8 38708 -IGtlZXBlcg== 38709 -IGJsYW5rZXRz 38710 -44Gn44GX44KH44GG 38711 -IHN3ZWF0cw== 38712 -IE1pbm5lYXBvbGlz 38713 -5YWo6YOo 38714 -IGdlbm9tbWVu 38715 -IGZhc3Rlbg== 38716 -IEJydXNzZWxz 38717 -5ZG8 38718 -IGNhZmV0ZXI= 38719 -IGFic29yYmluZw== 38720 -IGhhZ28= 38721 -IEVsbW8= 38722 -IGd1c3Rv 38723 -IFlhcA== 38724 -TcO6c2ljYQ== 38725 -IHRlcnQ= 38726 -IGJhbmRh 38727 -IG1pbHk= 38728 -IHRoZXJlYWZ0ZXI= 38729 -IFN0b2NraG9sbQ== 38730 -IENhcnNvbg== 38731 -IGNhbGlicmF0aW9u 38732 -YXZhxZ8= 38733 -YW5zYQ== 38734 -aWtrZQ== 38735 -IGZvcmVzZWU= 38736 -IHF1YWxjaGU= 38737 -IGRlc3Rl 38738 -5qQ= 38739 -w7xuw7x6 38740 -IGZvcmdl 38741 -RGlz 38742 -ZXN0ZW4= 38743 -IM60zrnOsQ== 38744 -IGVuY2Fwcw== 38745 -IEdlc3By 38746 -IGNoZXJjaGVy 38747 -aWNrZXRz 38748 -0YLQvtGA0Ys= 38749 -Q3I= 38750 -INCi0LDQutC20LU= 38751 -IHJhYmJpdHM= 38752 -IERvdA== 38753 -aGVpdGVu 38754 -IGNhdXNhbA== 38755 -IEZvc3Rlcg== 38756 -YWrEhWM= 38757 -IGJlcmVpdA== 38758 -IGF5dWRhcg== 38759 -6auZ 38760 -44Gz 38761 -c29uZw== 38762 -Y29tYg== 38763 -IGZyaW5nZQ== 38764 -IGN5YmVyc2VjdXJpdHk= 38765 -IOucqA== 38766 -IGtpZXI= 38767 -IGJlc2Now6RmdA== 38768 -INC60L7QvdGG0LU= 38769 -IGZhY2lsaXQ= 38770 -IE5hbWVu 38771 -IGJpbGF0ZXJhbA== 38772 -dHg= 38773 -IFdpc3NlbnNjaGFmdA== 38774 -IG51YW5jZXM= 38775 -IHJpcHBpbmc= 38776 -IGZ5 38777 -IFNpY2hlcmhlaXQ= 38778 -IEdoYW5h 38779 -b2xvbg== 38780 -IHRvcHBlZA== 38781 -IE1vcm9jY28= 38782 -IHJhZGlhbA== 38783 -IExFRQ== 38784 -IEFuZHJlYXM= 38785 -ZWRk 38786 -IOyXtOs= 38787 -IEFpcmxpbmVz 38788 -44GT44KN 38789 -IHZhbG9yZXM= 38790 -6rec 38791 -SHk= 38792 -INC30LDQtNCw0Yc= 38793 -IEtlbmRhbGw= 38794 -INGF0LDRgA== 38795 -IFZhbXA= 38796 -IHB5dGhvbg== 38797 -IG1hbmFnZWFibGU= 38798 -IEdlbnRl 38799 -b2lzZQ== 38800 -aWNpYXJ5 38801 -IGltcG9zcw== 38802 -IEJ1bm55 38803 -aWVzdGE= 38804 -QW5kcmV3 38805 -IHNlcnQ= 38806 -IENlYw== 38807 -enphcmVsbGE= 38808 -IGF1dG9tb2JpbGU= 38809 -IFRpZXJl 38810 -YWxsb3dz 38811 -5YaG 38812 -IOuwgA== 38813 -IFNjb3Jw 38814 -IEplbGx5 38815 -YWdhcmE= 38816 -IFN0cmV0Y2g= 38817 -IHJlZGVm 38818 -IGV4YWNlcmI= 38819 -IFNIQQ== 38820 -w6lm 38821 -b3JzYQ== 38822 -IGZsYXdlZA== 38823 -IE5vZWw= 38824 -PyE/ 38825 -IHByb2NlbnQ= 38826 -IG1lbnN0cnU= 38827 -INC/0YDQvtGH 38828 -IGluZmFudHM= 38829 -8J+OtQ== 38830 -cGF1c2U= 38831 -IFJhY2luZw== 38832 -IDE5NDg= 38833 -IHN1cGVyaW50ZW5kZW50 38834 -aWRvcmVz 38835 -aWR5 38836 -YnJhaGlt 38837 -IHVubHVja3k= 38838 -IHBlcms= 38839 -YW5jaQ== 38840 -IOunjOuCmA== 38841 -INCc0L7RgdC60LI= 38842 -IGZpbmFucw== 38843 -IGRpZmVyZW5jaWE= 38844 -oIjsnbQ= 38845 -6YWN 38846 -T1JZ 38847 -IFRhYw== 38848 -24zYpw== 38849 -IGRlc2Vt 38850 -INCy0LDQttC90L4= 38851 -IEpV 38852 -IOyeiOyeluyVhOyalA== 38853 -IM6d 38854 -IGluZm9ybWF0aW9ucw== 38855 -IEhFTA== 38856 -aHN0 38857 -INC/0L7Qs9C+0LLQvtGA 38858 -IHZvaXR1cmU= 38859 -IHJldXM= 38860 -w6RuZGln 38861 -INC/0L7RhdC+0LY= 38862 -amluZw== 38863 -IGRydQ== 38864 -YWx0cmE= 38865 -IHByb2R1aXRz 38866 -IGtpdGU= 38867 -IGV5ZWJhbGw= 38868 -IEJlbHQ= 38869 -IFJlc3RhdXJhbnQ= 38870 -IGdhbWI= 38871 -IHBvcnJpZGdl 38872 -aXR0ZXJz 38873 -IGNvbnZlcnRz 38874 -IHlhcmTEsW0= 38875 -IG3DoXhpbW8= 38876 -d2lydHNjaGFmdA== 38877 -IO2VmOuCmOs= 38878 -IOykgA== 38879 -IGljZWJlcmc= 38880 -IHZvcmJlaQ== 38881 -IDI1Ng== 38882 -b2NyYXRpYw== 38883 -IHJlY2tsZXNz 38884 -b25uZXI= 38885 -IG3DunM= 38886 -IGxvZ2ljYWxseQ== 38887 -IFByaXNvbg== 38888 -IE5ldHo= 38889 -IHZhY2FudA== 38890 -IG5pbW10 38891 -IEhBUlI= 38892 -INC30L7Qsg== 38893 -IERlZQ== 38894 -cmluZ2U= 38895 -bmllc3Q= 38896 -IFJ1bGVz 38897 -7Iqk65+9 38898 -Y3Vzc2lvbnM= 38899 -IGZsb3JhbA== 38900 -IGNvbnN0cmFpbmVk 38901 -IGRpZmZlcmVudGlhdGlvbg== 38902 -IFF1ZWJlYw== 38903 -INuB24zaug== 38904 -IHDDumJsaWNh 38905 -aXRlbA== 38906 -IGFjY29tbW9kYXRpb25z 38907 -IEdyw7w= 38908 -7Zw= 38909 -IHBpY2tsZXM= 38910 -0LjRh9C10YHQutC40YU= 38911 -IGNvbW1pc3Npb25z 38912 -IEJhZWs= 38913 -IMOnb2N1xJ8= 38914 -IE1lZGl1bQ== 38915 -IHBlcmlvZGljYWxseQ== 38916 -IHdvbmRlcmZ1bGx5 38917 -IHN0YWZmaW5n 38918 -7JuQ6w== 38919 -cmlyZQ== 38920 -Zmxl 38921 -IE1jTA== 38922 -INGC0LXQvw== 38923 -INC/0LXRgNC10Lo= 38924 -0L3QvtC70L7Qsw== 38925 -IO2BrOqyjA== 38926 -55m854++ 38927 -IHByb3NwZXJvdXM= 38928 -IFNwaXJpdHVhbA== 38929 -IENoaWNr 38930 -RElB 38931 -INCf0YDQuNCy0LXRgg== 38932 -IHBlcsOt 38933 -0YzRjtGC 38934 -IGNvbnN1bHRhbnRz 38935 -IEVhcmw= 38936 -5LuK5bm0 38937 -IHJ1aW5pbmc= 38938 -0L7RgNC1 38939 -IHBlbnNlcg== 38940 -IHRha2llag== 38941 -IHN0cmVuZ3RoZW5lZA== 38942 -IExpcXVpZA== 38943 -0L7QvdC10YY= 38944 -0LDQstCw0YLRjA== 38945 -IGNhbWVy 38946 -IGRpc2FncmVlbWVudA== 38947 -IGJhdGhpbmc= 38948 -IFlvc2g= 38949 -YWFs 38950 -cHJlY2hlbg== 38951 -UklTQURBUw== 38952 -IHN1cGVyc3Rhcg== 38953 -5oGt 38954 -0LvRj9GC0Yw= 38955 -IG5pYg== 38956 -IFRoZXJt 38957 -IERBTklFTA== 38958 -IHBhdw== 38959 -IGxpcXVpZHM= 38960 -IGNhcGFjaXQ= 38961 -YXJrZW4= 38962 -IHZhZ2luYQ== 38963 -IG1hc2hlZA== 38964 -IGVtZXJnZXM= 38965 -eXNjeQ== 38966 -IHVucmVsYXRlZA== 38967 -IEd1aWxk 38968 -IGludmVydGVk 38969 -aXRpdmVz 38970 -VHJh 38971 -IGJlZ3I= 38972 -IGFsdGU= 38973 -7KeV 38974 -44KB44Gm 38975 -INGA0LDQt9GA0LDQsdC+0YI= 38976 -ZmluZGVy 38977 -INC00LDQu9C10LU= 38978 -INCx0LvQsNCz0L7QtNCw0YA= 38979 -d2Fsa2Vy 38980 -IGNyYXRlcg== 38981 -YXNzYWRvcnM= 38982 -cmVuY2Vz 38983 -aW5za2k= 38984 -IEtJTQ== 38985 -IEVsbGlvdA== 38986 -MjAxNw== 38987 -IFNy 38988 -aW5rYQ== 38989 -YW5vdg== 38990 -IOyemOuquw== 38991 -IHByb3ByaWV0YXJ5 38992 -ZGlzcGxheXN0eWxl 38993 -INGB0LjQvA== 38994 -INC40LfQsQ== 38995 -IFBhbmVs 38996 -IGluc3RpbmN0cw== 38997 -IENvbW11bmljYXRpb25z 38998 -6bq7 38999 -bWlkdA== 39000 -IOunjOuTpOyWtA== 39001 -INGB0LvQvtCy0LA= 39002 -IEdpbGJlcnQ= 39003 -55uu5YmN 39004 -0KLQsNC6 39005 -dm9vcmJlZWxk 39006 -0LXRjtGB0Yw= 39007 -YXJ5bg== 39008 -cXVleg== 39009 -IGRhcnQ= 39010 -0ZbRiA== 39011 -IEh1dA== 39012 -U2Fs 39013 -IHNvdXRoZWFzdA== 39014 -IHBlc3RpY2lkZXM= 39015 -IGhlbGljb3B0ZXJz 39016 -IGVuZHVyZWQ= 39017 -aWFkYQ== 39018 -IGJyZXdpbmc= 39019 -7Jes6w== 39020 -INGB0LLQvtCx0L7QtA== 39021 -IFNhaW50cw== 39022 -IEZyYW7Dp2Fpcw== 39023 -IEVjb25vbWljcw== 39024 -IGRpc2xvYw== 39025 -b3Bob2JpYQ== 39026 -Q2FtZXI= 39027 -IG5lZ290aWF0ZWQ= 39028 -INGB0YLQsNC70Lg= 39029 -7Iqk7YE= 39030 -b2dpZQ== 39031 -IHRzdW5hbWk= 39032 -IHBlZWxlZA== 39033 -IG1vdGl2YXRpb25z 39034 -6Kit 39035 -b3N0YXQ= 39036 -Zmxhbg== 39037 -IERBQw== 39038 -IGthdg== 39039 -J1JF 39040 -IFBlYXJzb24= 39041 -YmJl 39042 -Y3plbmll 39043 -IGF0ZW7Dp8Ojbw== 39044 -7Ya166C5 39045 -44Gj44Gh 39046 -INGD0LTQsNGA 39047 -IGludHJvZHVjdG9yeQ== 39048 -IEljaQ== 39049 -64yA6w== 39050 -YWthdA== 39051 -IHRyZW5jaA== 39052 -IHByb2NlZWRlZA== 39053 -IENvaW4= 39054 -IGRlcmVjaG8= 39055 -IFJlZGU= 39056 -5q+b 39057 -0LDQvdC90YvQuQ== 39058 -IGluY2FyY2VyYXRlZA== 39059 -IFJpY2htb25k 39060 -Um9jaw== 39061 -IFBhdg== 39062 -IEthcm1h 39063 -dWdlcw== 39064 -IGNvbnRlw7o= 39065 -67mE 39066 -IOq3uOunjA== 39067 -IEdvbmU= 39068 -IHdzcMOzxYI= 39069 -IFJhaG1lbg== 39070 -dW5rZW4= 39071 -IOykkeyalO2VnA== 39072 -IGli 39073 -IGF0dGFjaGluZw== 39074 -SGF5 39075 -IHN1a2E= 39076 -7I25 39077 -IHBpdm90YWw= 39078 -IFJlc3BlY3Q= 39079 -w61kYQ== 39080 -SUI= 39081 -IFZlcmFudHdvcnQ= 39082 -d2lldA== 39083 -IGZvcmVuc2lj 39084 -0YDQuNGB0YI= 39085 -INC/0YDQuNC90YbQuNC/0LU= 39086 -IG1hcmtpbmdz 39087 -IGtldHRsZQ== 39088 -IE9wZXJh 39089 -IERvY3RvcnM= 39090 -IHNocmVkZGVk 39091 -IHJlY3Vlcg== 39092 -IHZpZ2ls 39093 -IEZhaWw= 39094 -IGVudHJldg== 39095 -INC00YPRiA== 39096 -IG91dGJyZWFrcw== 39097 -6LWw5ZCn 39098 -IM+Azr8= 39099 -IHJvZ3Vl 39100 -YW5nbGVk 39101 -IHllYXJseQ== 39102 -IENyZWVk 39103 -IHdhbQ== 39104 -IGxvdHVz 39105 -6rO86w== 39106 -44CB44CB 39107 -IFNwaXQ= 39108 -IEl0dQ== 39109 -IHN0cmFpbnM= 39110 -IHN0YW1wZWQ= 39111 -IHBsYWludA== 39112 -IHBvdGlvbg== 39113 -IGNvbnNvbGlkYXRpb24= 39114 -6KmV 39115 -0L7Rh9C60YM= 39116 -IHZsb2dnaW5n 39117 -IHNsYXRl 39118 -IEF1ZnQ= 39119 -IEluY29y 39120 -4burbmc= 39121 -p5A= 39122 -ZW5o 39123 -IGhlacOf 39124 -IGRvbWVzdA== 39125 -IFN0cm9t 39126 -5Y2z 39127 -YWtpcw== 39128 -IGZyYWdlbg== 39129 -IGZpbmVy 39130 -IFN1Zw== 39131 -IHVwaGlsbA== 39132 -IMOpw6lu 39133 -4oCmKQ== 39134 -INGB0L7Qvw== 39135 -IENvcmV5 39136 -IHNpZWJpZQ== 39137 -IG11c2U= 39138 -IGNsb3Zlcw== 39139 -IHBvdXM= 39140 -IEZpbmFueg== 39141 -IFJvdXRl 39142 -YW1hdA== 39143 -IG11dHVhbGx5 39144 -INCy0L3Rg9GC0YDQuA== 39145 -IFNlbGVuYQ== 39146 -65Q= 39147 -IEdhdXNzaWFu 39148 -67aA7YSw 39149 -INeR15s= 39150 -IGVqZXJj 39151 -5b6u 39152 -a2Vh 39153 -IEdlcnJ5 39154 -IFNpYw== 39155 -5aSn55qE 39156 -IDE5NjY= 39157 -aWVzZQ== 39158 -IGZvc3NpbHM= 39159 -IGVzdGFk 39160 -IEthbmU= 39161 -Y2nEhw== 39162 -IOycoO2KnOs= 39163 -INC/0LDQvA== 39164 -IENydWlzZQ== 39165 -aW50w6lyaWV1cg== 39166 -IGJla2FubnQ= 39167 -IFBvZGU= 39168 -IGRlbWFuZGVy 39169 -UmVt 39170 -IGludmFkZQ== 39171 -IGRlY29yYXRpbmc= 39172 -cm9waWM= 39173 -IGNvd2JveQ== 39174 -IFBob3Rv 39175 -b3BvbGl0 39176 -IOy7rOufrOs= 39177 -IHJlYXA= 39178 -IGhhbmR3cml0aW5n 39179 -4LmE4Lij 39180 -IOua 39181 -INio2LnYrw== 39182 -IE10 39183 -2YA= 39184 -IHNwYWNlc2hpcA== 39185 -IG5hdGlvbmFsaXNt 39186 -IGNvdW5jaWxz 39187 -IEdyaWZmaW4= 39188 -IEFobWVk 39189 -IGNsaWNo 39190 -IE9M 39191 -d2w= 39192 -IFBpbG90 39193 -5a6u 39194 -IGFjcm9ueW0= 39195 -IGdlbHM= 39196 -IGVsZWN0cm9seQ== 39197 -6JM= 39198 -INC80L3QvtC5 39199 -IGVwaXNvZA== 39200 -IERpZXNlcw== 39201 -IEFUUA== 39202 -IGVkaXlvcnVt 39203 -IGV4cHJlc3Nlcw== 39204 -IGV4aGliaXRz 39205 -Q29tbQ== 39206 -INC60YDRg9C/ 39207 -IG1hdGFy 39208 -IDIwMjU= 39209 -IEFydGVt 39210 -dmFzaXZl 39211 -csOg 39212 -IGJlxZ8= 39213 -6buD 39214 -IGxpemFyZA== 39215 -IGZpbGxl 39216 -IOyniOusuA== 39217 -INC80L7RiQ== 39218 -IHTDvHI= 39219 -IGN1bHByaXQ= 39220 -IHdvdmVu 39221 -IEFOWQ== 39222 -bmlt 39223 -IHRheQ== 39224 -IHByb21pbg== 39225 -IGFjb21wYQ== 39226 -IGlkw6k= 39227 -IGJvaWxlcg== 39228 -IFRoZW1lbg== 39229 -IGF2ZW51ZQ== 39230 -IE11ZA== 39231 -INC90L7QstGL0LU= 39232 -IHdpdG5lc3Npbmc= 39233 -IGxhbmNl 39234 -IENIQU4= 39235 -IEJldmVy 39236 -2KrZhQ== 39237 -IGNoZW1vdGhlcmFweQ== 39238 -S2luZw== 39239 -IGLEmWTEmQ== 39240 -IGF0dWFs 39241 -IHRpdmU= 39242 -IHRhbGtpbg== 39243 -IHF1ZWRhcg== 39244 -aWXDnw== 39245 -ZWRlbA== 39246 -IOyWtOygnA== 39247 -IGpvZ2Fy 39248 -IMO2cg== 39249 -IHVuZGVydGFraW5n 39250 -IFN0cmVuZ3Ro 39251 -IG1pbGjDtWVz 39252 -IFdpbmU= 39253 -IE1vbHQ= 39254 -6K6y 39255 -44GR44KM 39256 -IHVuZGVybWluZQ== 39257 -IEFyY2hpdmVz 39258 -dmFuYQ== 39259 -bWVyY2lhbA== 39260 -TUM= 39261 -IGNhc3Rl 39262 -0L/RgA== 39263 -IGxlZ2lzbGF0b3Jz 39264 -dWxhdG9ycw== 39265 -w6puaW8= 39266 -IOuNsOs= 39267 -INGF0L7RgtC40YLQtQ== 39268 -INC90LXQug== 39269 -IHN1cm4= 39270 -IGNvbnNjaQ== 39271 -IFBPVw== 39272 -IGN1bGluYXJ5 39273 -IEtBVA== 39274 -IEZvbGtz 39275 -0YvQstCw0LXQvA== 39276 -INCy0L7Qug== 39277 -44GR44KL 39278 -c2VydmljZQ== 39279 -cHRz 39280 -INC/0L7QsdC10LQ= 39281 -5piv5ZWK 39282 -IHRlbnRz 39283 -IG5vcmQ= 39284 -U1RF 39285 -IHJlcHVibGljYW4= 39286 -IHd5aw== 39287 -IG1pbmlvbnM= 39288 -6JmV 39289 -IG1lbWFuZw== 39290 -amVzdA== 39291 -IGNvbXBhcmF0aXZl 39292 -IHR5bGU= 39293 -Y2FyYm9u 39294 -YmVkaW5ndA== 39295 -a3Nlbg== 39296 -IG5lZ2F0aXZpdHk= 39297 -IHNqw6Rsdg== 39298 -IGTDug== 39299 -5omA5pyJ 39300 -IHJlY2FsbGVk 39301 -Y3Jh 39302 -IFRhZGE= 39303 -INGA0YPQutC4 39304 -INC+0L/RgNC10LTQtdC7 39305 -IHByb2NyYXN0 39306 -IGpvZ29z 39307 -IE9v 39308 -IEhlYXJ0cw== 39309 -IMOpY2g= 39310 -IGtzacSFxbw= 39311 -IGNvYXJzZQ== 39312 -IFR1YmU= 39313 -IEdyZWVucw== 39314 -IMOpbg== 39315 -IGR1bWJiZWxs 39316 -INGC0Lg= 39317 -IHF1ZXJlcg== 39318 -2KfYrQ== 39319 -z4POtc65 39320 -INC/0YDQsNCy0LjQu9GM0L3Qvg== 39321 -INC/0LDQvw== 39322 -IGNvbXByYQ== 39323 -IHTDqXI= 39324 -IEFudGVz 39325 -IG9wdGltdW0= 39326 -IGJpc2N1aXQ= 39327 -zrrOuQ== 39328 -YWN6ZWdv 39329 -IOyLnOqwhOydtA== 39330 -IE1hcmluZXM= 39331 -dmVybw== 39332 -IHZhY2NpbmF0aW9ucw== 39333 -IHBldHR5 39334 -cml0ZXJz 39335 -INCw0Ls= 39336 -Y291bnRyeQ== 39337 -IGNvdW50ZXJz 39338 -IGF0dGVuZGFudA== 39339 -IEh1aQ== 39340 -44Go44GE44GG44GT44Go44Gn 39341 -Y2th 39342 -0YHRgtCy0LXQvdC90YvQuQ== 39343 -Z3V5 39344 -IHRyaWNrZWQ= 39345 -IFJFRA== 39346 -IHRocmlsbGluZw== 39347 -z4DOv865 39348 -IHBpZ2d5 39349 -IGFudW5jaQ== 39350 -T1JURVI= 39351 -IFZhbHVl 39352 -IHJvbmQ= 39353 -IEFEQQ== 39354 -IHBvc2Vy 39355 -aG9yZXM= 39356 -IFJvbGFuZA== 39357 -k68= 39358 -IG5vaXI= 39359 -INep15DX 39360 -67Cc 39361 -aWVtYW5k 39362 -INC/0L7RgtC10YA= 39363 -6rOz 39364 -IOqxsQ== 39365 -IGZvcm1hdHRpbmc= 39366 -IExlZA== 39367 -6KeA55y+ 39368 -IGtpbGxlcnM= 39369 -IMSR4bqleQ== 39370 -IGhhYXI= 39371 -YWdhaW4= 39372 -ITwv 39373 -IHNvbWV0aGlu 39374 -IGNvdWdoaW5n 39375 -IG5hdmU= 39376 -IHByb3NwZWN0aXZl 39377 -IEhL 39378 -IFJlc2N1ZQ== 39379 -bWF5YmU= 39380 -Z2dlcg== 39381 -INGA0LDQsdC+0YLRgw== 39382 -15XXnNed 39383 -dGFpbHM= 39384 -7ZWY7ZWY 39385 -IGV5ZWxpZA== 39386 -IGN1c3RvbWl6YXRpb24= 39387 -YXZpbGlvbg== 39388 -IHByb2NoYWlu 39389 -IGdsYXpl 39390 -5oOF5rOB 39391 -U2lt 39392 -INC+0L/QsNGB 39393 -IG1vc3F1aXRvZXM= 39394 -IGZlbnQ= 39395 -IGNhcGFjaXRpZXM= 39396 -IGFwb3N0bGVz 39397 -IGFsdHVyYQ== 39398 -IOusuw== 39399 -IHNlcm9udA== 39400 -IEFueXRpbWU= 39401 -pbTripQ= 39402 -IGNvc3BsYXk= 39403 -IHNwYWM= 39404 -IHNhbWVu 39405 -44OE 39406 -dWNj 39407 -acOocmVz 39408 -IHNpYmxpbmc= 39409 -IENvY2s= 39410 -IOuPhQ== 39411 -INC/0YDQtdC00YHRgtCw0LLQu9GP 39412 -IGluc3RhbGxtZW50 39413 -IGRpamU= 39414 -IE1DVQ== 39415 -IEVI 39416 -IE5pbmc= 39417 -IHByZXBhcmVz 39418 -IGh5cG9jcg== 39419 -cHR5 39420 -IGthZMSxbg== 39421 -IEZyb3plbg== 39422 -aGF1bA== 39423 -IEt5bGll 39424 -6YCZ5qij55qE 39425 -IHNodWZmbGU= 39426 -IGVsZW1lbnRhbA== 39427 -IGF1w59lcg== 39428 -IEtOT1c= 39429 -IEFMSVNTQQ== 39430 -WkE= 39431 -7LKg 39432 -576O5YWD 39433 -IHJlY2l0ZQ== 39434 -IHNjcmli 39435 -IDExNQ== 39436 -5LyR 39437 -IHN0YXJyZWQ= 39438 -IGxlcXVlbA== 39439 -IGJyZXdlcg== 39440 -IE9wcG9ydHVu 39441 -IHLDpA== 39442 -IGNob3BzdGlja3M= 39443 -IEthaA== 39444 -IEV0aGlvcGlh 39445 -IGhhbmRtYWRl 39446 -IGVyZm9sZw== 39447 -IER6 39448 -aXR0ZW5z 39449 -6KqN54K6 39450 -0LLQsNC7 39451 -zrfOvQ== 39452 -5Yqe 39453 -44OT 39454 -YnJpbmdlbg== 39455 -IHVucGx1Zw== 39456 -IG9mZnM= 39457 -IGhlcm1hbg== 39458 -bGllZA== 39459 -YXNvbmlj 39460 -IFNlcmJpYQ== 39461 -IEd1YXRlbQ== 39462 -IC4uLiI= 39463 -IGVycmVpY2hlbg== 39464 -IGFtYmlndW91cw== 39465 -IFdoaXRuZXk= 39466 -enVm 39467 -TUFORA== 39468 -oLU= 39469 -IHNxdWVlemVk 39470 -44Gd44GG44Gg 39471 -eWFz 39472 -6b6N 39473 -IFNob2Nr 39474 -IHV0aWxpc2U= 39475 -dWtv 39476 -Ym9sdA== 39477 -IG1vdGlm 39478 -IGlubWF0ZXM= 39479 -IGNvcnJ1cHRlZA== 39480 -IGNvbmNyZXQ= 39481 -IENyaXRpY2Fs 39482 -IFNpbmdpbmc= 39483 -INGE0YPQvdC6 39484 -6a2U 39485 -bm92YQ== 39486 -cmViYmU= 39487 -ZHQ= 39488 -VW5pcw== 39489 -IHdlYmNhbQ== 39490 -IGNhbW91Zmw= 39491 -S2Vu 39492 -IGxhd3N1aXRz 39493 -IENvbnN1bWVy 39494 -IHJlY29sbA== 39495 -IGtsZWluZXI= 39496 -IEZJRkE= 39497 -IDE5NjI= 39498 -6K2m 39499 -IG1hbGFk 39500 -IOywvQ== 39501 -IMOldA== 39502 -IGluZmx1ZW5jZXI= 39503 -IEFydGlzdA== 39504 -c3Rp 39505 -44Gq44KL44G744Gp 39506 -4Lin4Lii 39507 -eXPFgg== 39508 -IEJpYW4= 39509 -iOuEpA== 39510 -IGZpcmVwbGFjZQ== 39511 -IEFwcGxpY2F0aW9u 39512 -IG1uaWVq 39513 -IGFjaWRpYw== 39514 -IE1vcm1vbg== 39515 -c3Nh 39516 -5YuZ 39517 -IHNuZWFreQ== 39518 -IG9qb3M= 39519 -IHZvdWQ= 39520 -IERhaQ== 39521 -IGdyYXNzcm9vdHM= 39522 -IFVuYmVsaWV2YWJsZQ== 39523 -IEdhYmU= 39524 -IEV4dHJlbWU= 39525 -IGhhc3NsZQ== 39526 -IGNvYg== 39527 -bXVtYmxpbmc= 39528 -UGFzcw== 39529 -jOufrA== 39530 -IHN5c3RlbWF0aWNhbGx5 39531 -IHNldmVudGVlbg== 39532 -z4DOtc65 39533 -4pmh 39534 -INC60L7Rgg== 39535 -IHNlbmRpcmk= 39536 -IGJhdGhyb29tcw== 39537 -IFN0ZXJu 39538 -IEFyZHVpbm8= 39539 -6Lk= 39540 -Y3JpYmluZw== 39541 -IHJlb3BlbmluZw== 39542 -IGNlcnY= 39543 -cGVl 39544 -QVJJ 39545 -IGNhZHJl 39546 -IEFuY2g= 39547 -TGVl 39548 -IE1BWA== 39549 -IG3DpG5u 39550 -IGNob3Jlcw== 39551 -IGFkZXNzbw== 39552 -5p2R 39553 -IE5pZw== 39554 -IGRpc3NlcnRhdGlvbg== 39555 -IFZheQ== 39556 -U1RBTEs= 39557 -0LDQutCw 39558 -YXZhdA== 39559 -56C0 39560 -IHB1bmt0 39561 -IHBhZGRpbmc= 39562 -IFRlbXBs 39563 -IGVqZQ== 39564 -IO2EsA== 39565 -IGF6dA== 39566 -IOuMgO2GteuguQ== 39567 -IHJlYXJyYW5nZQ== 39568 -w6FjaA== 39569 -IOyCrOuejOuTpA== 39570 -IGZyZWFraW4= 39571 -Y3JpcmU= 39572 -IOy7pOs= 39573 -IEV4cGxhaW4= 39574 -IM+Ez4nOvQ== 39575 -IGJvZGlseQ== 39576 -IExlaXN0 39577 -IHNpZ3Vp 39578 -IGJ1bmtlcg== 39579 -IGF6dWw= 39580 -IEhhdXNo 39581 -U3Vi 39582 -INCQ0L3QtA== 39583 -INC60YDQsNC5 39584 -IGlsbGVnYWxseQ== 39585 -IE11eQ== 39586 -IEZlaQ== 39587 -IEJhbmFuYQ== 39588 -IHNjaG9sYXJseQ== 39589 -IFByenk= 39590 -IE1vc3M= 39591 -IEZpbHRlcg== 39592 -IOyWtOuWoQ== 39593 -IE1heHdlbGw= 39594 -dGVuc2U= 39595 -IGxvbmdpdHVk 39596 -IGxhbmdzYW0= 39597 -INee16c= 39598 -c21pdGg= 39599 -aXphZGE= 39600 -INC90L7RgNC80LDQu9GM0L3Qvg== 39601 -IFZvbGw= 39602 -IEVsZW5h 39603 -5pa56Z2i 39604 -INGF0L7RgtGM 39605 -IERhYmVp 39606 -IGNvbnNlcnZhdGl2ZXM= 39607 -IHByw7Nwcmlh 39608 -IERpZXNlcg== 39609 -IEJyZW5kYQ== 39610 -b29raWU= 39611 -IGJhbmM= 39612 -44Ov 39613 -7J207KY= 39614 -7JuD7J2M 39615 -IGtlaA== 39616 -IHdlZGRpbmdz 39617 -IHRodW5kZXJzdG9ybQ== 39618 -5pS+5b+D 39619 -IENvb3JkaW4= 39620 -7IiY6rCA 39621 -IHByemVjaQ== 39622 -6ZKx 39623 -T1NTVEFMSw== 39624 -bWFhbg== 39625 -IOqxtOs= 39626 -INio2Yc= 39627 -IMW8YWQ= 39628 -IHlhY2h0 39629 -IGfDtnQ= 39630 -IGJsZWFjaA== 39631 -IHNob3J0ZW4= 39632 -INGB0YLQsNC70L4= 39633 -dXNhbg== 39634 -IOyekOyXsA== 39635 -IGRlcnM= 39636 -eGlz 39637 -jZTri4g= 39638 -IHF1YW50aWRhZGU= 39639 -IG9wcHJlc3NlZA== 39640 -INC30LDQutC+0L3Rhw== 39641 -5LiI5aSr 39642 -44GI44GI 39643 -INGH0LXRgtGL 39644 -INCd0LDQv9GA0LjQvNC10YA= 39645 -dWxw 39646 -5oCW 39647 -2YLZiNmE 39648 -0L7Rh9C1 39649 -zqzOuw== 39650 -emVuaXU= 39651 -IGZvcm1hdGlvbnM= 39652 -IHNwYXJrZWQ= 39653 -IEVudHdpY2tsdW5n 39654 -YWxscw== 39655 -IHZpdmly 39656 -IGV4cGlyYXRpb24= 39657 -b3RpbmU= 39658 -INCn0LXRgA== 39659 -IFR1cm5pbmc= 39660 -IHRhcmlmZnM= 39661 -IG5hc3TEmXA= 39662 -IGFiaWRl 39663 -aWtzaQ== 39664 -IGZsYXNoZXM= 39665 -IGRpc3B1dGVz 39666 -IOyytA== 39667 -IG1lcmFr 39668 -IGVub3Jtb3VzbHk= 39669 -emFobA== 39670 -IGbDvGhydA== 39671 -0LLQvtC9 39672 -INC30LDQstC40YE= 39673 -IHBlcnNldmVyYW5jZQ== 39674 -IGRpdmlkZW5kcw== 39675 -IGNvbnRlc3RhbnRz 39676 -IHByb3N6xJk= 39677 -IEZyYW5rZW4= 39678 -44KN44GG 39679 -IGV4cGxvcmVy 39680 -IGJ1ZmZhbG8= 39681 -4oCV 39682 -IGVjb2xvZ3k= 39683 -IHNjYWxhcg== 39684 -IGNyYW4= 39685 -zrXPhM6xzrk= 39686 -xbx5xIc= 39687 -IOyalOs= 39688 -IGdpYQ== 39689 -IEdvZw== 39690 -IFByaXY= 39691 -IOunkOydhA== 39692 -IFJlYXNvbg== 39693 -cmFrdGlvbg== 39694 -IERlYm9yYWg= 39695 -IGtpdHRlbg== 39696 -IEVkaW4= 39697 -5Lm+ 39698 -cGllag== 39699 -IOuLtA== 39700 -IG3DoXF1 39701 -IGJpZGRpbmc= 39702 -IGFmZmluaXR5 39703 -IGFpa2E= 39704 -Zm9saw== 39705 -IENvbnNl 39706 -IGRldXRzY2hlbg== 39707 -6IY= 39708 -IGRlYml0 39709 -xLHEn8Sxbg== 39710 -aXNlbA== 39711 -IOykkeq1rQ== 39712 -IOutkOqwgA== 39713 -IHRydXN0d29ydGh5 39714 -IFN0YXJ0ZWQ= 39715 -5pWR 39716 -w7xyZA== 39717 -INC/0L7QvdGP0YLQvdC+ 39718 -IHNjaWVudGlmaWNhbGx5 39719 -UG9kcw== 39720 -Q1JPU1NUQUxL 39721 -IHByZWd1bnRhcw== 39722 -IGNhbG1pbmc= 39723 -IFByZW1pZXJl 39724 -15vXqQ== 39725 -INGF0L7Qu9C+0LQ= 39726 -IGNhcGl0YQ== 39727 -IHRvbWE= 39728 -IG11cm0= 39729 -IGZ1ZXJ6YQ== 39730 -IEhhbmk= 39731 -5oiR5pyJ 39732 -w7xm 39733 -YXJsb3M= 39734 -IGjDpHVm 39735 -44GR44Gm 39736 -IG9zb2J5 39737 -amVnbw== 39738 -INC/0LjRgQ== 39739 -IGNhbG1seQ== 39740 -aWRldA== 39741 -YnVjaA== 39742 -Z29uZQ== 39743 -IHZpc2Nvc2l0eQ== 39744 -IG1vZGFs 39745 -IGdlc2Ft 39746 -IEh6 39747 -IG11bmljaXBhbGl0aWVz 39748 -IGNpcmN1bGF0aW5n 39749 -b2xpbmE= 39750 -U2hv 39751 -6aKR 39752 -IEJlbmVk 39753 -b2x1 39754 -IHJlc3Rz 39755 -IGzDpW5n 39756 -INCe0LTQvdCw0LrQvg== 39757 -IHByemV3 39758 -IHBlcHA= 39759 -IG1hcnJpYWdlcw== 39760 -IEJJRw== 39761 -YW5kYW4= 39762 -IG1hZ2ljYWxseQ== 39763 -IGJhYnlz 39764 -IOuMkw== 39765 -IGhhY2tlcnM= 39766 -QmFieQ== 39767 -IE1vbnN0 39768 -IGNpZXI= 39769 -IEFyYWJz 39770 -INC80LDQs9Cw0Lc= 39771 -IEluZG9uZXNpYW4= 39772 -44GE44GG44GT44Go 39773 -IE1hcmt0 39774 -IGRhY2h0ZQ== 39775 -IFNjaMO8bGVy 39776 -IFZORA== 39777 -IHNwaWVsdA== 39778 -IHBlcmx1 39779 -44K0 39780 -5a2Y 39781 -INC/0YDQvtGF0L7QtA== 39782 -IHNhbHRlZA== 39783 -IGltcHJvdmlz 39784 -IEluc3Ry 39785 -dmVsbWVudGU= 39786 -IG5lc3M= 39787 -IGZ1bmd1cw== 39788 -IGNvbGxhYm9yYXRvcnM= 39789 -IFZpcnVz 39790 -ZXN0YXI= 39791 -IHByb2plY3Rvcg== 39792 -INCf0YDQsNCy 39793 -IGFnaWxpdHk= 39794 -15nXoNeV 39795 -ZXJlbA== 39796 -INCy0L7Qt9Cy 39797 -INCx0LDQtw== 39798 -IENhdGh5 39799 -xJ91 39800 -INCz0L7QstC+0YDQuNC7 39801 -YmlsaXR5 39802 -IExhbmM= 39803 -IEtpbWJlcmx5 39804 -IEJyaWVm 39805 -5YW3 39806 -IHV0dmVjaw== 39807 -IGdvZ2dsZXM= 39808 -IHByZXNjaG9vbA== 39809 -56eN 39810 -QVRIRVI= 39811 -IG1vdGl2ZXM= 39812 -IEJvbmc= 39813 -RVg= 39814 -IGNoaWxseQ== 39815 -IEFkdmlzb3J5 39816 -4oCL4oCL 39817 -INC60L7RgtC+0YDQvtC8 39818 -IHRyYWl0b3I= 39819 -IGRlbWFzaWFkbw== 39820 -INGG0LXQvQ== 39821 -INC80L7QuA== 39822 -5Z6L 39823 -IG11bHRpZg== 39824 -7JSs 39825 -IEFsZXhpcw== 39826 -IHppZXQ= 39827 -IFJhbWE= 39828 -YnJhbmNl 39829 -IHNhbmN0aW9u 39830 -aXRvdXM= 39831 -15XXmg== 39832 -IOuztOuC 39833 -0YHRgtCw0L3QvtCy 39834 -6Laj 39835 -INGA0LXRgQ== 39836 -IENodXJjaGlsbA== 39837 -INC/0YDQtdC3 39838 -IElP 39839 -IEdlZQ== 39840 -IEdhdGhlcg== 39841 -YXRvcmk= 39842 -VHlsZXI= 39843 -INC90LXQvNC90L7Qtg== 39844 -IGLDpWRl 39845 -IEtpbGxlcg== 39846 -IHR1YmVy 39847 -IFJhbWFkYW4= 39848 -4b8= 39849 -aWVodA== 39850 -IHN0cmFuZ2VseQ== 39851 -0LvRgw== 39852 -IHJlZGVzaWdu 39853 -IGluY3VtYg== 39854 -IGJlcmFiZXI= 39855 -IFZvbGtzd2FnZW4= 39856 -bWV0YWw= 39857 -ZHp5 39858 -cGNpw7Nu 39859 -IOyViuyVhA== 39860 -5ZSx 39861 -5aS0 39862 -IEdvb2RuZXNz 39863 -0LjQstCw0LXRgtGB0Y8= 39864 -YmFobg== 39865 -IEFudGFyY3RpY2E= 39866 -0LXQutGC0L7RgA== 39867 -IGhvbWVvd25lcnM= 39868 -emVpZ3Q= 39869 -IO2YhOyerA== 39870 -7KeA64+E 39871 -IGdlb2dyYXBoaWNhbA== 39872 -dGhpbmtpbmc= 39873 -IGdvc3Rh 39874 -IEltYW0= 39875 -dWxpZmxvd2Vy 39876 -ZGFn 39877 -YW5udA== 39878 -YWtvdg== 39879 -IGRvd253YXJkcw== 39880 -7LK06rCA 39881 -Q1VCRQ== 39882 -INCa0YHRgtCw0YLQuA== 39883 -INC/0L7Qu9C+0LI= 39884 -IHBsYXRlYXU= 39885 -44GE44GN 39886 -4bil 39887 -IGNobG9yaW5l 39888 -IGFjY2VsZXJhdG9y 39889 -IHNvbHZlcw== 39890 -IEdyYXNz 39891 -cGlhbm8= 39892 -INqp2Kc= 39893 -INio2Ko= 39894 -IFJvY2hlc3Rlcg== 39895 -INmH2Yo= 39896 -IGNvbGxlY3Rz 39897 -jZTrnbw= 39898 -IENoZWVy 39899 -bGluZ2Vu 39900 -INGA0LDQt9Cz 39901 -IGFtw6lyaWM= 39902 -aHRh 39903 -RUNU 39904 -IGFydGlmaWM= 39905 -IFBheVBhbA== 39906 -aGFuYQ== 39907 -U3RlcGhlbg== 39908 -IEdlc3Q= 39909 -cGhhbHQ= 39910 -IHJlcGxpY2F0aW9u 39911 -IFdpbGxpZQ== 39912 -IG5ldXRy 39913 -IGlycmF0aW9uYWw= 39914 -IGRhZG9z 39915 -IEFpZA== 39916 -a2Ft 39917 -YW50ZXI= 39918 -INC00YPQttC1 39919 -IGRldG9u 39920 -IGhhcmU= 39921 -IGJldHM= 39922 -YmFnYWk= 39923 -IHN0YWluZWQ= 39924 -IHBsYXVzaWJsZQ== 39925 -IHBlZWxpbmc= 39926 -IGNyw610 39927 -IGdyb3Rl 39928 -7Law 39929 -pbTqsow= 39930 -YWx0ZXQ= 39931 -UGhvbmU= 39932 -Rmls 39933 -U1FM 39934 -IGdlZmFsbGVu 39935 -5Y+U 39936 -IHNhw7pkZQ== 39937 -IFRhbWls 39938 -Y291cw== 39939 -INCz0LvQsNCy0L3QvtC1 39940 -IGF0cmF2w6lz 39941 -dXNzaWE= 39942 -IHp3ZWl0ZW4= 39943 -IEVsdmlz 39944 -IG1vdmVy 39945 -IGxpbWl0ZQ== 39946 -6L+9 39947 -YXJleg== 39948 -pbTqs6A= 39949 -IEtyYW5rZW4= 39950 -w7xyZQ== 39951 -IOyViuyVhOyalA== 39952 -IHRow6BuaA== 39953 -IHByb2ZvdW5kbHk= 39954 -IGJlZHJvb21z 39955 -IHRvb3RocGFzdGU= 39956 -IEFjY2VwdA== 39957 -w6l0aWNv 39958 -IGvDvMOn 39959 -IEFyeQ== 39960 -YWRpbg== 39961 -IGdyYW51bGFy 39962 -ZWN0ZWQ= 39963 -IG1lbmphZGk= 39964 -IGNvbXBldGVuY2U= 39965 -ZG9j 39966 -IHNwYXJrbGluZw== 39967 -IOyii+ydhA== 39968 -IGNvbnN0cnVjdGluZw== 39969 -IGFtdXNlbWVudA== 39970 -IEluc3VyYW5jZQ== 39971 -IEZldWVy 39972 -IHJlbm92YXRpb24= 39973 -c3VjaA== 39974 -cGxhdA== 39975 -IHByb3N0aA== 39976 -IGJleQ== 39977 -IENvbXBsZXRlbHk= 39978 -IHpvZA== 39979 -YWxu 39980 -VmljdA== 39981 -IGNvbmZpcm1z 39982 -w6R0eg== 39983 -4pY= 39984 -aGFtbWVy 39985 -INC30L3QsNC10YI= 39986 -IGFkbWlyZWQ= 39987 -oOulvA== 39988 -IEZydWl0 39989 -ZXJ0ZW4= 39990 -IG5pZWNl 39991 -IFRpbnk= 39992 -IHBsdW1iaW5n 39993 -ZXJtYQ== 39994 -INC70LXQs9C60L4= 39995 -IHdpbmRzaGllbGQ= 39996 -INGB0LzQtdGA 39997 -IGJ6dw== 39998 -IGFib2xpdGlvbg== 39999 -IFNhZGhndXJ1 40000 -IHByZWFjaGVk 40001 -IENyZWF0aW5n 40002 -54mb 40003 -cGVyZWQ= 40004 -IHZvbG9udA== 40005 -IHF1aW50 40006 -IHByaW50ZXJz 40007 -IG5lZ3Jv 40008 -IGdyb3NzZQ== 40009 -IFRoeQ== 40010 -IEZlbGxvd3M= 40011 -5o6l5LiL5L6G 40012 -IHN0YW5pZQ== 40013 -IG5ld2NvbQ== 40014 -IEh1ZQ== 40015 -IEZyZXVuZGU= 40016 -IENvbnN0cnVjdGlvbg== 40017 -IGFkdmVyc2l0eQ== 40018 -IG5lZ2F0aXZlcw== 40019 -IGhhemFyZG91cw== 40020 -IGNvbXBlbGxlZA== 40021 -IHdvaw== 40022 -IE95 40023 -0L/QsA== 40024 -qqjr 40025 -IHJlbmRleg== 40026 -IG92ZXJj 40027 -IHdlYXZpbmc= 40028 -INC40LTQtdGC 40029 -IHByb3NlY3V0b3Jz 40030 -IGF1ZGlvYm9vaw== 40031 -IGFuY2VzdG9y 40032 -IHVuZGVyZ29pbmc= 40033 -IHBvdW5kaW5n 40034 -44GC44KK44GM44Go44GG44GU44GW44GE44G+44GZ 40035 -IO2SgA== 40036 -IOy2pA== 40037 -IHR1bGVl 40038 -IOyXtOw= 40039 -IHpvYWxz 40040 -IG5laW4= 40041 -6a2a 40042 -IG9rZQ== 40043 -IEpveWNl 40044 -IG51ZA== 40045 -IGRpbGlnZW5jZQ== 40046 -IExhYnM= 40047 -IHZlbnRz 40048 -IGFuY2VzdHJhbA== 40049 -4Lir4Lih 40050 -INC80YPQttGH 40051 -IG5vbcOpcw== 40052 -6KGo56S6 40053 -d2FsaQ== 40054 -cWluZw== 40055 -IE11bHRpcGxl 40056 -IENvbnN1bHQ= 40057 -IGlzdGVkaQ== 40058 -IERveQ== 40059 -YWthaA== 40060 -IGRpc2NpcGxpbmVk 40061 -IGFsdGVybmF0aW5n 40062 -55I= 40063 -IHZlcm1l 40064 -INC+0Yk= 40065 -IHRvdGE= 40066 -IFByYWc= 40067 -IHN3b3Ju 40068 -IGJlYmVy 40069 -IEF1ZmdhYmU= 40070 -7Jq06w== 40071 -6L6m5rOV 40072 -IHl1cA== 40073 -IHJlY2xhaW0= 40074 -b251dA== 40075 -IGF1Y3VuZQ== 40076 -IGFtcGg= 40077 -IMWbd2ll 40078 -IGFh 40079 -aXNjb3Zlcg== 40080 -IEFyZw== 40081 -Y2llxbw= 40082 -IGRlc3Nhcw== 40083 -IFfDpGg= 40084 -4bu5 40085 -INC00LDQstC90L4= 40086 -IHNpbGVudGx5 40087 -YXJj 40088 -IO2bhOuztA== 40089 -IHR3ZWV0aW5n 40090 -IE9uZA== 40091 -6aGe 40092 -pqzrqbQ= 40093 -IGJvd2Vs 40094 -7IWo7Ja07JqU 40095 -6IGK 40096 -T1NF 40097 -IHByb3Bpbw== 40098 -IEt1bnN0 40099 -a3VuZw== 40100 -IGRvbm7DqWVz 40101 -IEhvcml6b24= 40102 -IEZyb2c= 40103 -5YCL5Lq6 40104 -IGFyaXN0 40105 -w6Js 40106 -INC60L7Qtg== 40107 -IHNlZ3VuZG9z 40108 -IFNob3J0bHk= 40109 -IENyb3dk 40110 -aXJhbg== 40111 -IHfFgmHFm2Np 40112 -IExhYw== 40113 -aWRlbnRl 40114 -IOqwgOyekA== 40115 -IGxlbg== 40116 -IFNVUw== 40117 -IE1vdG9ycw== 40118 -IFRyZW50 40119 -b21pZQ== 40120 -IHRyYW5zbWl0dGVy 40121 -IEFzc2Fk 40122 -IHBzeWNoaWF0cmlj 40123 -INC20LjRgtGM 40124 -IG91dGxpbmVz 40125 -IGVmZmVjdGl2ZW1lbnQ= 40126 -IFJlbGlnaW9u 40127 -cHJlaA== 40128 -INC00L7Qu9C20L3QsA== 40129 -IM2hwrA= 40130 -IENvbnNlcnZhdGlvbg== 40131 -IOG7 40132 -INC30LDQuQ== 40133 -IHJlc2lkZQ== 40134 -IGNvbXBsZXRv 40135 -S0VO 40136 -IOuCmOyYpOuKlA== 40137 -IHN1YnVyYmFu 40138 -IHLDqXBvbmRyZQ== 40139 -INGA0LDQt9C70LjRhw== 40140 -IGdhbGxlcmllcw== 40141 -IHJhcHQ= 40142 -5oSf6Kyd 40143 -KS4uLg== 40144 -IGNydWVsdHk= 40145 -IFZNd2FyZQ== 40146 -7Yis 40147 -IGhhecSxcg== 40148 -IGdyb3VwaW5n 40149 -IFJpZGVy 40150 -IHN5bGxhYmxl 40151 -IGJlaXNwaWVsc3dlaXNl 40152 -IHNhZmVndWFyZA== 40153 -IHBlbMOtY3VsYQ== 40154 -YXJ0aQ== 40155 -INCh0L4= 40156 -IGNoZWdh 40157 -INC60L7QvNGD 40158 -IHNlaXNt 40159 -IGhhcm1sZXNz 40160 -IFdhcnJpb3Jz 40161 -44GE44Gk 40162 -INC/0YE= 40163 -IHNoYW1lbGVzcw== 40164 -IEJhdW0= 40165 -aW5zdGFsbA== 40166 -IHRvb2xraXQ= 40167 -IHBpcGVsaW5lcw== 40168 -IHB1c3N5 40169 -IGNvbmNlYWw= 40170 -IHByb3Rlc3Rpbmc= 40171 -b2Nob25k 40172 -IGR1YQ== 40173 -IFBvc2U= 40174 -IGhlbGl1bQ== 40175 -IFVY 40176 -aWtsZQ== 40177 -IFN1ZmY= 40178 -IOyEuOqzhA== 40179 -aW5nZXJz 40180 -INGB0LvRg9GH0LDQuQ== 40181 -IGRlc2NlbmRpbmc= 40182 -IOaykuaciQ== 40183 -IG1vbnRhZ2U= 40184 -SGlnaA== 40185 -IOydtOyW 40186 -IElkaQ== 40187 -INeR16E= 40188 -IGV4cHJlc3NpdmU= 40189 -56eL 40190 -INC/0L7Qu9C10Lc= 40191 -IHBvbmU= 40192 -IGFkb2xlc2NlbnQ= 40193 -0LDQvdC90YvQtQ== 40194 -IGFzc2Fzc2luYXRpb24= 40195 -d2Vpc2Vu 40196 -ZW1hdGljYWxseQ== 40197 -YXV0aA== 40198 -IHVyZw== 40199 -IGdhbmhhcg== 40200 -IGZ1bmRv 40201 -IFJob2Rl 40202 -INC40YHRgtC+0YDQuNC4 40203 -IGNvbXBhcnRpbA== 40204 -5pWi 40205 -IGRpbWluaXNoZWQ= 40206 -IGFwcHJlbnRpY2U= 40207 -INCR0YPQtA== 40208 -IHBob3RvbnM= 40209 -IGPDs2Q= 40210 -5bmV 40211 -5qyK 40212 -b25haw== 40213 -IGFkZWxhbnRl 40214 -IGNodQ== 40215 -b3BpYw== 40216 -IGFpeMOt 40217 -ZWRkYXI= 40218 -IENvbmdyYXRz 40219 -bW9y 40220 -5aW95ZCn 40221 -IHJlc2VydmF0aW9ucw== 40222 -IFRvYnk= 40223 -IEtlcm4= 40224 -IHJhemVt 40225 -IGZvcmdlZA== 40226 -IGhvcnJpZnlpbmc= 40227 -2YrYuQ== 40228 -IEpvaW5pbmc= 40229 -44Op44Kk 40230 -IEF1dGg= 40231 -ZGFo 40232 -IGNvbnNpZw== 40233 -IGludGltaWRhdGVk 40234 -IHBlcmlwaGVyYWw= 40235 -IG1lbm8= 40236 -IGRldGVjdGluZw== 40237 -IHRlb3I= 40238 -IHRhZ2dlZA== 40239 -IG5vc3RhbGdpYw== 40240 -IOuvuOyViA== 40241 -5YC8 40242 -IHZlcmRp 40243 -IGxhYmVsaW5n 40244 -0L/QvtC0 40245 -YXN0ZXM= 40246 -IHZpc3Q= 40247 -IGN5dA== 40248 -IGZsaXBz 40249 -0YDQuNC3 40250 -YmFsYW5jZWQ= 40251 -44Gq44GP 40252 -INC+0YjQuNCx 40253 -IGRlc3Rpbg== 40254 -bGFzc2U= 40255 -ZXJlaQ== 40256 -IGthbG8= 40257 -IGFycXU= 40258 -IHBsYW5v 40259 -IG9yZGluYW5jZQ== 40260 -IGNvbXBpbGF0aW9u 40261 -IFZvY8Oqcw== 40262 -IEVjbw== 40263 -IOy2lOyynA== 40264 -IGVuY2ltYQ== 40265 -IEdhcnJldHQ= 40266 -IENvcmQ= 40267 -w7Zsa2Vy 40268 -IEFycm93 40269 -IHByb3RvbnM= 40270 -LOKAiw== 40271 -IOyymOs= 40272 -IHNjYW5k 40273 -IGJlaWdl 40274 -Y29uZw== 40275 -IGJpa2luZw== 40276 -IFRM 40277 -0YPQvdC0 40278 -IOyGlOyngQ== 40279 -IFZpbGxh 40280 -IEpBQ0s= 40281 -5Lul5Y+K 40282 -IMO2xJ9yZW4= 40283 -IHRlbWFz 40284 -IEt5dW5n 40285 -SmVubg== 40286 -IGN1ZA== 40287 -IGltcG9zaW5n 40288 -IGNvbW1hbmRtZW50cw== 40289 -IE1lYW5z 40290 -IETDpHI= 40291 -IHJlY29tZW5k 40292 -IGRpc3Bvc2l0aW9u 40293 -2KfZhw== 40294 -IHRodQ== 40295 -IHJlZHVjdGlvbnM= 40296 -IGRpdQ== 40297 -INeV15DX 40298 -INC40YHRgdC70LXQtA== 40299 -dGhyZW4= 40300 -IGxhZG9z 40301 -IFJC 40302 -aXhlZA== 40303 -IOyP 40304 -RnI= 40305 -c3RpbGw= 40306 -IG9sbWFz 40307 -Q0hVQ0s= 40308 -IO2GoA== 40309 -IEluZGVwZW5kZW50 40310 -0JLQng== 40311 -IHBpdHM= 40312 -IHVuZGVydGFrZW4= 40313 -IGbDuHI= 40314 -IE5hdw== 40315 -IOyekeyXhQ== 40316 -IHNoZXBoZXJk 40317 -IGxhbmd1ZQ== 40318 -IEphYg== 40319 -IERydW0= 40320 -IEVsZWt0 40321 -5ous 40322 -44GY44KD44Gq44GE 40323 -4buRdA== 40324 -IOydtOyqvQ== 40325 -IGJlZ2lubmVu 40326 -IEZ1cnk= 40327 -4buDdQ== 40328 -c2VjdGlvbnM= 40329 -IHNwcmF5ZWQ= 40330 -IG3DoXI= 40331 -IFZvbHQ= 40332 -IFNlb25n 40333 -0LjRgtC10Ls= 40334 -ZHVjdGlvbg== 40335 -YXNhbg== 40336 -IGp1ZGdtZW50cw== 40337 -aW1hYW4= 40338 -nteq 40339 -IHNpZW50bw== 40340 -IEFDVA== 40341 -IEJI 40342 -ZGV2 40343 -IOyii+yVhO2VmA== 40344 -IGpvcm4= 40345 -SVNUSU4= 40346 -IHJvYXI= 40347 -IGltbWVyc2lvbg== 40348 -YWZmbGVz 40349 -IHRyYWluZWU= 40350 -IEJpbGxib2FyZA== 40351 -cmVzc2Vz 40352 -IFdhcm0= 40353 -IFJvYmVydG8= 40354 -IHV0aWxpeno= 40355 -IElnb3I= 40356 -IHJhc2g= 40357 -IGFuYWx5dGlj 40358 -aXJhbQ== 40359 -IHN5bW1ldHJpY2Fs 40360 -IGxpZmVzcGFu 40361 -IGVhdGVy 40362 -IEJsb29tYmVyZw== 40363 -YXRlcmlhbA== 40364 -IOuvvw== 40365 -IGlzdGVy 40366 -IGludmFsdWFibGU= 40367 -IGFzc2lzdGluZw== 40368 -IHNoYWNr 40369 -zrzOsc+EzrE= 40370 -amlz 40371 -ZW5peg== 40372 -INC/0YDQtdC00LvQvtC2 40373 -IGRlY2xhcmluZw== 40374 -IFZpa2luZw== 40375 -IEFzc2lt 40376 -IGV4cGVuZGl0dXJl 40377 -IHBvc2luZw== 40378 -IE9udW4= 40379 -IGluaWM= 40380 -0LDRjtGC0Yw= 40381 -cmV2 40382 -IG1pZWRv 40383 -IGZpbHRoeQ== 40384 -IElC 40385 -IERpc2NvdmVy 40386 -aWNodGV0 40387 -bWlsbGlvbg== 40388 -toTrk6TsnbQ= 40389 -IGFtYmlndQ== 40390 -IEZseW5u 40391 -YmFyZHppZWo= 40392 -IGluY29tcA== 40393 -0LDQstC90L4= 40394 -emlh 40395 -IGluZmx1ZW5jaW5n 40396 -IHdvcmxkbHk= 40397 -IFNhbGVzZm9yY2U= 40398 -emV0 40399 -IHBhcnRpY3VsaWVy 40400 -IEtvY2g= 40401 -IDE5NDM= 40402 -IHRvbmVy 40403 -INGN0LrRgdC/0LXRgA== 40404 -IHN1c2NyaQ== 40405 -IHRyaWdnZXJpbmc= 40406 -SUNFUw== 40407 -7Iqk6rCA 40408 -zrTOsQ== 40409 -0YDQsNCx0L7Rgg== 40410 -IGFmdGVyd2FyZA== 40411 -cGluZQ== 40412 -IElM 40413 -YXJldGg= 40414 -INC/0LDQuw== 40415 -IHNha2Vy 40416 -IDE5NDc= 40417 -QUY= 40418 -dXlvcnN1bg== 40419 -IOyKpOs= 40420 -IHF1YW50aWZ5 40421 -IG1lbnRvcnNoaXA= 40422 -IGxsZWdh 40423 -IFRhbWFyYQ== 40424 -IG9wdGltaXppbmc= 40425 -IGZyb250cw== 40426 -b3N0ZXJz 40427 -IGVzcXVlcg== 40428 -IHN1Ym1pc3Npb25z 40429 -IGFubmlo 40430 -IHN1Y3Rpb24= 40431 -bHVlbmNl 40432 -Y2hpZWRlbg== 40433 -SU5HUw== 40434 -INeR15Q= 40435 -INGB0YbQtdC9 40436 -IHdpZWx1 40437 -IG9iamV0bw== 40438 -IGJvb2Jz 40439 -IEdlc2Now6RmdA== 40440 -IGVhcmJ1ZHM= 40441 -INGA0LDQvdGM0YjQtQ== 40442 -IHJvdXRpbmVseQ== 40443 -IGNvbGxhZ2Vu 40444 -0L7QtNGL 40445 -IENpbm5hbW9u 40446 -IGJhaXg= 40447 -2K/ZhQ== 40448 -ZnJhZ2U= 40449 -INC60L3QvtC/ 40450 -IGRlY2VwdGlvbg== 40451 -IHVuZXhwZWN0ZWRseQ== 40452 -IHNtZWxsZWQ= 40453 -IGxvb3M= 40454 -IGhpZ2hsaWdodGVy 40455 -IOq4sOuzuA== 40456 -IEdsYXNnb3c= 40457 -b3dhbmE= 40458 -bW4= 40459 -IEplcmVtaWFo 40460 -IERhdGFi 40461 -aWV0ZQ== 40462 -IGJhdw== 40463 -IHByb3BpYQ== 40464 -IHByb3ByaQ== 40465 -T09PT09PT08= 40466 -aW5rZXI= 40467 -IHBlcnR1cmI= 40468 -IEZha2U= 40469 -7J207JY= 40470 -aW1taW5n 40471 -IHVuZG9jdW1lbnRlZA== 40472 -IHRyYWJhamFuZG8= 40473 -IHJvYW0= 40474 -INC00L7Qu9C20L3Qvg== 40475 -IGFyYmU= 40476 -IGFuaQ== 40477 -YXRhbA== 40478 -IGFyYWRh 40479 -IEFuZGE= 40480 -IOybgA== 40481 -IEJyYW5jaA== 40482 -b2lyZXM= 40483 -IG91dHNpZGVy 40484 -ZG9sbGFy 40485 -5b2T54S2 40486 -aXNzZXM= 40487 -YmVhbnM= 40488 -IEdpZw== 40489 -552h 40490 -cmFkb3M= 40491 -IFN1dA== 40492 -IExhbmNl 40493 -ZWRzacSZYmlvcg== 40494 -IGNvbGE= 40495 -b25lbnRz 40496 -IHJlY29uc2lkZXI= 40497 -44K544OI 40498 -IG1vbmRv 40499 -44Oz44ON44Or 40500 -IHVuc3VjY2Vzcw== 40501 -IEvDpA== 40502 -6L65 40503 -IHJlZ2Vs 40504 -IGJpc29n 40505 -ZXR1cw== 40506 -IHVucmF2ZWw= 40507 -IHN3ZWV0aWU= 40508 -IHJlcHLDqXNlbnQ= 40509 -b3VyaW5n 40510 -IGdyb3VuZHdhdGVy 40511 -IEJldw== 40512 -IHNjcmF0Y2hlZA== 40513 -IGNhc3NldHRl 40514 -IGNpZGVy 40515 -cGlz 40516 -INGB0LDQvNCw 40517 -IGdsb2JhbGl6YXRpb24= 40518 -IGRlZ3JhZGF0aW9u 40519 -IGRlZ2VuZXI= 40520 -IFJvc2ll 40521 -aWNrdA== 40522 -IG92ZXJ3ZWlnaHQ= 40523 -IE1FTQ== 40524 -IGd1YXJkaWFucw== 40525 -IGNvbnNlYw== 40526 -SG1t 40527 -5oiR5Zyo 40528 -INC/0L7RgtGA0LXQsQ== 40529 -IG1ldmE= 40530 -IGdyYWZmaXRp 40531 -IGZsaXJ0 40532 -IEJQ 40533 -IGp1c3Rv 40534 -IFRob3VzYW5kcw== 40535 -55Sc 40536 -n6zsmrQ= 40537 -Lio= 40538 -IFJBVw== 40539 -IGZsdW9y 40540 -aXlp 40541 -YW50YWw= 40542 -amVk 40543 -IFNoZW5n 40544 -IEVsaXNl 40545 -IENoYXJnZQ== 40546 -7J207Yq4 40547 -IGNvbmVz 40548 -bmllcw== 40549 -Z2lh 40550 -INC90LDRh9Cw0LvQsA== 40551 -IERoYXJtYQ== 40552 -IOuLpOyWkQ== 40553 -IGZhdm9ycw== 40554 -IFRydW5n 40555 -aGV0dG8= 40556 -IHBvenc= 40557 -IGxvbmdv 40558 -IGtlbHU= 40559 -IGRpZ2VzdGlvbg== 40560 -IEVpZw== 40561 -IFRIRVJF 40562 -IHRpZXJz 40563 -IHN1bms= 40564 -IG15c3RpY2Fs 40565 -enVi 40566 -IMOJdA== 40567 -IGFudGljaXBhdGluZw== 40568 -IFZpbmU= 40569 -WVk= 40570 -IGNvbmNlbnRyYXRpbmc= 40571 -IEFncmVlbWVudA== 40572 -INC+0LrQvtC70L4= 40573 -IGxpZHQ= 40574 -IFlhbw== 40575 -INGB0LvQuNGI0LrQvtC8 40576 -csOt 40577 -SVNUSU5DVA== 40578 -IE9GRklD 40579 -IHNvYWtpbmc= 40580 -IHNpaWhlbg== 40581 -IHJlZmVyZW5jaW5n 40582 -IFRhbXBh 40583 -YW5leQ== 40584 -IHJlc3B1ZXN0YQ== 40585 -IENvYWxpdGlvbg== 40586 -INGB0L7Qs9C70LDRgQ== 40587 -YW5raW5k 40588 -IOub 40589 -IFl1bW15 40590 -67Cw 40591 -IG9uYw== 40592 -dWnDp8Ojbw== 40593 -IHRoZW8= 40594 -IG11cmFs 40595 -IFRlYWNoZXJz 40596 -IHdhaXRz 40597 -IHJlbnRpbmc= 40598 -IEhhcm1vbg== 40599 -IGXFnw== 40600 -IE11bmljaA== 40601 -7Zmc 40602 -7Ja8 40603 -Y2FyZHM= 40604 -IHJvdWdl 40605 -IG7Dqm4= 40606 -Y2x1Yg== 40607 -IHVuc2Vlbg== 40608 -IGRlcHJlY2k= 40609 -IGNvbXB1dGVk 40610 -IHdpcGluZw== 40611 -IEVsbGk= 40612 -aWRlbnRpZmllZA== 40613 -IGNsdXR0ZXI= 40614 -cm9sZXVt 40615 -IHRlbGVm 40616 -IGxldmVsaW5n 40617 -IFdvb2R5 40618 -IEd1cw== 40619 -IEJlbm5ldHQ= 40620 -IHNpdGlv 40621 -acWC 40622 -IHBvc3Nlc3Npb25z 40623 -IE5hdGFzaGE= 40624 -b2xkb3du 40625 -INGB0L7QvtCx0Yk= 40626 -IExpYw== 40627 -IOunjOuToA== 40628 -IGxvcnNxdWU= 40629 -d2Vo 40630 -INC80LDQvA== 40631 -bGl0ZXI= 40632 -YWRvbW8= 40633 -IGZpbmk= 40634 -z47Pgg== 40635 -INGD0LHQuNC5 40636 -IGluZGlzcA== 40637 -IHRlbGV2aXM= 40638 -IHDDoQ== 40639 -IENyZW8= 40640 -w61sbA== 40641 -IGd1cg== 40642 -IE1BTA== 40643 -INGA0LDQt9C90YvRhQ== 40644 -IHppZWhlbg== 40645 -IGZhc2hpb25lZA== 40646 -IGRlYmF0aW5n 40647 -IFNvdXA= 40648 -IFByb3ZpbmNl 40649 -6re466CH 40650 -IGltcHJvcGVy 40651 -IGltYWdlbg== 40652 -INGB0LTQtdC70LDQuw== 40653 -IGxvZ29z 40654 -IGV2ZW50bw== 40655 -6KeG 40656 -4bqjbw== 40657 -bGFyZGE= 40658 -INC90LDQt9GL0LLQsNC10YLRgdGP 40659 -IHZlcmY= 40660 -IHNjcmVlbnNob3Rz 40661 -15XXk9ei 40662 -IEF1cm9yYQ== 40663 -IEJhbGk= 40664 -dGVyZWQ= 40665 -IGNvbnRhZ2lvdXM= 40666 -IGNvbXBhcnRpcg== 40667 -dmVuaWRvcw== 40668 -cmlrZQ== 40669 -INCy0YvQs9C70Y/QtNC40YI= 40670 -IGZyZWVkb21z 40671 -bmljYXM= 40672 -oKTshJw= 40673 -IHJlZHV6 40674 -IEVjdQ== 40675 -IGFib25u 40676 -IFNFw5E= 40677 -IEJpdGNo 40678 -IHByb2pldG8= 40679 -0LjRh9C90L4= 40680 -ZXR0cmU= 40681 -QU5OQQ== 40682 -dGhhbms= 40683 -IEFP 40684 -5omA5Lul5ZGi 40685 -YXJuaXNo 40686 -aWXDn2Vu 40687 -IHJpcHBsZQ== 40688 -IHBhbnRyeQ== 40689 -IEdI 40690 -zrPOsQ== 40691 -IOydtOuyiOyXkA== 40692 -IHZhbGlkYXRlZA== 40693 -IGJydXNoZWQ= 40694 -IEVtaW4= 40695 -IERhcnRo 40696 -ZXNpbg== 40697 -LC4= 40698 -IHZhbGxl 40699 -IGplcnNleQ== 40700 -dWxhbg== 40701 -UmVhZA== 40702 -IFJhbmdlcnM= 40703 -IHNvb3RoaW5n 40704 -IGNvbXBsZW1lbnRhcnk= 40705 -IFZlcmtlaHI= 40706 -YWNha3Q= 40707 -IGJhdGh0 40708 -IE5E 40709 -U29u 40710 -IO2ZlOyepQ== 40711 -IEF2aQ== 40712 -IFNBTA== 40713 -YWlzc2U= 40714 -IHNlbWFpbmVz 40715 -IFN1cnY= 40716 -d2llcg== 40717 -INCy0LjQtNC10Ls= 40718 -IHNpZXRl 40719 -lOuPhA== 40720 -IFJhbXNheQ== 40721 -IFF1ZWVuc2Jvcm91Z2g= 40722 -IE1lbmdl 40723 -IEZvb2Rz 40724 -IHRoZW9sb2dpY2Fs 40725 -IFsj 40726 -INCy0L7QvdC4 40727 -IGltbWlu 40728 -aW9zaXR5 40729 -IEFiZ2VvcmQ= 40730 -IEFjaG8= 40731 -IMOU 40732 -IHN0YWlucw== 40733 -IHJlYWxpc3RpY2FsbHk= 40734 -IGZhc2hpb25hYmxl 40735 -IENFT3M= 40736 -IFNraWxs 40737 -INCy0LbQtQ== 40738 -IGRldmVy 40739 -IFBsdWc= 40740 -5qo= 40741 -UG9k 40742 -IGxvYWY= 40743 -IGdlYnJhY2h0 40744 -IGFic29yYnM= 40745 -IEdyYW5ueQ== 40746 -IG1hbHdhcmU= 40747 -YWfEmQ== 40748 -IGNpdmlsaXphdGlvbnM= 40749 -IM+B 40750 -IGjDpGx0 40751 -0KHQog== 40752 -Z3JlYXQ= 40753 -IGxheWVyaW5n 40754 -c2luZ3M= 40755 -INCy0ZbQvQ== 40756 -IHJlY29nbml6YWJsZQ== 40757 -IHdvag== 40758 -IHdldGVu 40759 -56ys5LiA5YCL 40760 -zrPOvw== 40761 -U3R1ZGVudA== 40762 -IGTDqWZpbg== 40763 -cGxlYXNl 40764 -ZW5jaA== 40765 -IGF0dGlj 40766 -IE90dGF3YQ== 40767 -IG9wdGVk 40768 -IGNhcHRpdg== 40769 -IG3Fgg== 40770 -IFlB 40771 -IFdhbmQ= 40772 -IGJvdW50eQ== 40773 -IDI3MA== 40774 -IHNwZWN1bGF0ZQ== 40775 -IGVuaGFuY2VtZW50 40776 -IGNvbW1vZGl0aWVz 40777 -IE1pbHRvbg== 40778 -ZWo= 40779 -YWxvbQ== 40780 -RGFz 40781 -IGNvb2xkb3du 40782 -16jXkNec 40783 -INeQ16Q= 40784 -IHdjemXFm25pZWo= 40785 -IGVsb25n 40786 -IGRpb2Rl 40787 -aW5hw6fDo28= 40788 -IElyaXM= 40789 -IEli 40790 -IHN1bW1vbmVk 40791 -IHJlc3Bl 40792 -IFJhY2g= 40793 -5rOo5oSP 40794 -IMK7Og== 40795 -6YaS 40796 -IHZ1cg== 40797 -IG1vdmltZW50bw== 40798 -IGZsdWVudA== 40799 -IEV2b2x1dGlvbg== 40800 -IEJ1dHQ= 40801 -aWZpY2FjacOzbg== 40802 -lJTslrQ= 40803 -INGN0L3QtdGA0LM= 40804 -IG1hbmlwdWxhdGluZw== 40805 -IHBvc2l0aXY= 40806 -0LzQvtGB 40807 -IHdpeg== 40808 -IGludG94 40809 -zq3PgQ== 40810 -0LXQvNGB0Y8= 40811 -aXZlc3Nl 40812 -aW1pemk= 40813 -IOyauA== 40814 -IGtub2Nrcw== 40815 -IGNvbmdlc3Rpb24= 40816 -IElkZWFsbHk= 40817 -IEhvbGRpbmc= 40818 -IHBvYnJl 40819 -IEpVTA== 40820 -IOu2hOuTpOydgA== 40821 -IM6xzro= 40822 -IEZlcmd1c29u 40823 -IExhYm9yYXRvcnk= 40824 -cmljaHRlbg== 40825 -cm9waHk= 40826 -cHJvZHVjdGlvbg== 40827 -YXNzdW5n 40828 -SVRB 40829 -IHNpw6hjbGU= 40830 -16jXqg== 40831 -Y2lzaW9u 40832 -INek15Q= 40833 -IElyZW5l 40834 -YW5jYQ== 40835 -IOyCrOqzoA== 40836 -IHBpbnBvaW50 40837 -IGRlc2lnbmF0aW9u 40838 -xZ9hbQ== 40839 -bMSxxZ8= 40840 -YWF0 40841 -IG7DpWdyYQ== 40842 -IG15dGhpY2Fs 40843 -IERlY2xhcmF0aW9u 40844 -IOyeoeyVhA== 40845 -IGJ5dGU= 40846 -LuKZqg== 40847 -RGVs 40848 -IO2NvA== 40849 -IG51dHJpdGlvdXM= 40850 -INGA0YPQsdC70LXQuQ== 40851 -5YKz 40852 -U0FZ 40853 -TWFzdGVy 40854 -INGE0L7RgtC+0LPRgNCw0YQ= 40855 -IOuSpOyXkA== 40856 -IG5laA== 40857 -IGRva3VtZW50 40858 -56qB 40859 -IGN6YXN1 40860 -IGNvbnRpbnVh 40861 -IFNpbGVudA== 40862 -IHRlbnNvcg== 40863 -IHRhbnRh 40864 -IGlyZ2VuZHdv 40865 -IExFVA== 40866 -IFNoYWt0 40867 -bGFtYQ== 40868 -Y2hsYWc= 40869 -IGRpbmdlbg== 40870 -0YHRgtGA0LA= 40871 -IGVocmxpY2g= 40872 -IE1hY2h0 40873 -cmVscw== 40874 -w6BjaWVz 40875 -dmlkZW8= 40876 -IG5hdHVyYWxl 40877 -IFNURVZF 40878 -dW1t 40879 -QkFDSw== 40880 -IDcyMA== 40881 -44Gn44GX44Gf 40882 -IG1vbWVuY2ll 40883 -IFN3YW4= 40884 -IHRlY2huaWNpYW5z 40885 -IGdlZWhy 40886 -IE1lbmQ= 40887 -UmVn 40888 -IHNjYWZm 40889 -IGFpZGU= 40890 -IOuztOuKlA== 40891 -IHByZXNzZXM= 40892 -bGVyZGU= 40893 -XCc= 40894 -IHVsdHJhc291bmQ= 40895 -IGRpc2NsYWltZXI= 40896 -IE1pdHM= 40897 -IEhvbGlkYXk= 40898 -IGV4dGVybmFsbHk= 40899 -IEZhdGU= 40900 -SU5P 40901 -IENhdHM= 40902 -67CV 40903 -dW1v 40904 -Y29udHJvbA== 40905 -IHRoZUNVQkU= 40906 -dGlj 40907 -aWVydW5ncw== 40908 -INC30L3QsNC60L7QvA== 40909 -IGZyZWVzdHlsZQ== 40910 -TUFOREFSSU4= 40911 -IGlzZQ== 40912 -YXVydXM= 40913 -6Kix 40914 -IFN0cmF0ZWd5 40915 -IEJlYW0= 40916 -csOkZ2U= 40917 -IGV4cGxvaXRlZA== 40918 -44GI44Gj 40919 -aWRpcw== 40920 -IGNoaW1l 40921 -IFBlbmluc3VsYQ== 40922 -IG1lcml0cw== 40923 -IGFsdHJv 40924 -IFRPUA== 40925 -IFNlbnM= 40926 -IEthbnQ= 40927 -b3Jhcw== 40928 -IHJveWFsdHk= 40929 -IElERQ== 40930 -5aSJ 40931 -cmFjeQ== 40932 -IFRIT00= 40933 -b21vcw== 40934 -IGzDpG5nZXI= 40935 -IG51bWJlcmVk 40936 -VW0= 40937 -IE5peWU= 40938 -zrjOtw== 40939 -enlrYQ== 40940 -bGltZQ== 40941 -IFBlcnNvbmVu 40942 -IHZhbGlkaXR5 40943 -IGNvbnRyYXQ= 40944 -IENvbWlj 40945 -w6dvbnM= 40946 -IEhlaWRp 40947 -IHpn 40948 -IHJlbmFtZWQ= 40949 -IGN1bWlu 40950 -IEpG 40951 -aW5lbA== 40952 -IGVuZm9yY2Vk 40953 -IGNoYW1h 40954 -0LvQuNGH0L3Qvg== 40955 -4bq7 40956 -INC00LXQvdC10LM= 40957 -IHByb2Z1bmQ= 40958 -IHBlbHZpYw== 40959 -IHBhbGF2cmE= 40960 -IGV4dHJhcw== 40961 -IGFua2xlcw== 40962 -7JeQ7ISc64+E 40963 -IFRG 40964 -IGluc2FuZWx5 40965 -INC80Y/RgQ== 40966 -IHLDqXBvbnNl 40967 -IGfDtnN0ZXI= 40968 -IEJCUQ== 40969 -INGD0YfQsNGB0YI= 40970 -IHNoYWtlbg== 40971 -44Kr44Oz44K/ 40972 -IGFsbW9uZHM= 40973 -ZGlzaA== 40974 -IFBH 40975 -IEJsaXp6YXJk 40976 -0YzQvtCz0L4= 40977 -IOOF 40978 -IGtuYXBw 40979 -VG9v 40980 -IHVuZGU= 40981 -IG1vdW50cw== 40982 -0L7QvNC40L3QsA== 40983 -IG5vcnRoZWFzdA== 40984 -IGNlbnNvcnNoaXA= 40985 -0Y/RgtGM0YHRjw== 40986 -bHI= 40987 -IGxhd21ha2Vycw== 40988 -IHPDpWRhbg== 40989 -IGluc2lkZXI= 40990 -IGNsZWFudXA= 40991 -IE5hZGE= 40992 -w7Nj 40993 -IGhhcnZlc3RlZA== 40994 -IERlc3B1w6lz 40995 -7ZqN 40996 -IHJlZHVuZGFudA== 40997 -RU5B 40998 -IGRlbGVnYXRl 40999 -IGJ1cmc= 41000 -IEFsaXNvbg== 41001 -5paw6IGe 41002 -IGNlbGVzdGlhbA== 41003 -IHNpbm5lcnM= 41004 -IG1hcnR5cg== 41005 -IFBlcm0= 41006 -IHNwZWNpbWVucw== 41007 -IG1pdG9jaG9uZA== 41008 -IG1hcmF2aWw= 41009 -IGNhdmFscnk= 41010 -IGFycmF5cw== 41011 -IGFubmV4 41012 -IGxhYm9yYXRvcmllcw== 41013 -IEJ5eg== 41014 -IGF0YWM= 41015 -INGB0LvQvtC20L3Qvg== 41016 -IHRvcGw= 41017 -IGdlcmk= 41018 -IENvbWJhdA== 41019 -0YHRj9GC 41020 -ZWtlbg== 41021 -INCS0LvQsNC0 41022 -IGFqdXN0 41023 -IG1hcnF1ZQ== 41024 -IGxvb2tvdXQ= 41025 -IExvbA== 41026 -IHJvb2Z0b3A= 41027 -IE9yaW9u 41028 -INCx0L7QuQ== 41029 -IGhlYXJ0YnJlYWtpbmc= 41030 -IGRldHRv 41031 -emg= 41032 -w6R0dGVy 41033 -Y2VyYQ== 41034 -IGhlYXRz 41035 -IGFudGlxdQ== 41036 -IHVuZmluaXNoZWQ= 41037 -IEthenU= 41038 -xLFsxLE= 41039 -IHNsaWdodGVzdA== 41040 -bGVv 41041 -IHbDpXJh 41042 -IHZlcnNjaGllZGVuZW4= 41043 -IGxvdGlvbg== 41044 -5L2g5bCx 41045 -5oy6 41046 -0YjQtdCz0L4= 41047 -Y3Rpb25hbA== 41048 -IOydtOyg 41049 -ZHJhZ29u 41050 -IHJlc29uYXRlcw== 41051 -IGlubQ== 41052 -YXZpYw== 41053 -IGZ1bGZpbA== 41054 -IOq4sOuMgA== 41055 -IGp1c3RhbWVudGU= 41056 -INC00L7RgdGC0YPQvw== 41057 -IOq3uOqxtA== 41058 -IHJlY29uY2lsZQ== 41059 -IFNjaMO2bg== 41060 -IEF2b2lk 41061 -6rmA 41062 -J0Q= 41063 -IGNvbmZpbmVtZW50 41064 -IO2R 41065 -IG1vdGl2YXRpbmc= 41066 -IEJyaXR0YW55 41067 -IOOBmQ== 41068 -IHNjcmVhbWVk 41069 -b2JqZWN0 41070 -IGRlY3JlZQ== 41071 -IHRyYXZhaWxsZQ== 41072 -aXNzaWJsZQ== 41073 -IGJ1c3RlZA== 41074 -cHJvY2Vzcw== 41075 -IG1hc3NhY3Jl 41076 -IG5naMSp 41077 -aWx5bg== 41078 -INCy0YDQvtC00LU= 41079 -IHBvZXRpYw== 41080 -IG5o4bqldA== 41081 -IGlyb25pY2FsbHk= 41082 -dXN1 41083 -bmlv 41084 -IHN0YWdpbmc= 41085 -b21lZGljYWw= 41086 -bGVhc2Vk 41087 -IOyDiOuhnOyatA== 41088 -IE5a 41089 -YWN0aW5n 41090 -IEJhdHRsZWZpZWxk 41091 -cGxheWZ1bA== 41092 -Vmk= 41093 -IHNlw7FvcmE= 41094 -IHByb21wdHM= 41095 -bGljaGtlaXQ= 41096 -IMOnxLFrYXI= 41097 -amlhbmc= 41098 -IHBpY2t5 41099 -IENhdmU= 41100 -IG1pcmFjdWxvdXM= 41101 -IEh1Z2hlcw== 41102 -MjAxNg== 41103 -IHh1 41104 -IERvcm90aHk= 41105 -IHZpcnR1ZXM= 41106 -IHJldHJhY3Q= 41107 -IHR5cg== 41108 -IGNoYXJpc21hdGlj 41109 -IGJvbGE= 41110 -6bw= 41111 -IOunkOyUgOs= 41112 -IHBhcmVudGFs 41113 -IG1pbGxpb25haXJl 41114 -YXJpYXQ= 41115 -5pS/5bqc 41116 -IGludm9rZQ== 41117 -xbxlbmll 41118 -IGV4dHJlbWVz 41119 -IEFrdQ== 41120 -aXZpZGFkZQ== 41121 -IO+3ug== 41122 -IOyLnOyyrQ== 41123 -IEdhcmxpYw== 41124 -UklB 41125 -INC00L7RgQ== 41126 -IFBvbnQ= 41127 -IG1pbGo= 41128 -ZWxsaQ== 41129 -IHJhY2tldA== 41130 -IGNvbXBldGl0 41131 -IFdoaXM= 41132 -IHJlYWx0 41133 -aWdubWVudA== 41134 -ZXN0cmU= 41135 -IHBlcm5haA== 41136 -IE9wZW5pbmc= 41137 -IEZT 41138 -IERlbW9rcmF0ZW4= 41139 -YWNlbWVudHM= 41140 -IHdvcmxkdmlldw== 41141 -IHBsYXlvZmZz 41142 -IENBRA== 41143 -IMOpdGFudA== 41144 -IHllbWVr 41145 -IHNlbnRpbWVudHM= 41146 -b2RlbA== 41147 -YnVzdGVy 41148 -YcWf 41149 -IEtZ 41150 -Y3rEmQ== 41151 -IHNjaMO2bmU= 41152 -YXBl 41153 -IFJhc3BiZXJyeQ== 41154 -IGNyZWRpdGVk 41155 -IEhpZGRlbg== 41156 -IHNhdXNhZ2Vz 41157 -cnVjZQ== 41158 -IEJldg== 41159 -aWxhbnRybw== 41160 -IHBva2Vtb24= 41161 -IOqwgOqyqQ== 41162 -IHByb2NlZWRpbmc= 41163 -IHZlaW8= 41164 -IDE3NQ== 41165 -6Lg= 41166 -bWF4 41167 -IGZyYXRlcg== 41168 -7KCE7JeQ 41169 -IGVnZW50 41170 -IDI1MDA= 41171 -dXNjaA== 41172 -VHViZQ== 41173 -IGFtcGxpZnk= 41174 -IHByYXdk 41175 -IG9kb3I= 41176 -IFNjYW4= 41177 -IHBsb3R0aW5n 41178 -aXRobWV0aWM= 41179 -IHJlc2lnbmVk 41180 -IFNDT1RU 41181 -IHN0ZXJlb3R5 41182 -IGRvYWJsZQ== 41183 -IENvbXBsZXg= 41184 -2YHZig== 41185 -dMSxbQ== 41186 -0YDQuNCz 41187 -bGFyZGFu 41188 -ZXNv 41189 -REVO 41190 -IGhvb2RpZQ== 41191 -IENBVA== 41192 -2KfYtw== 41193 -IGJvbmRlZA== 41194 -IEJ1cm5z 41195 -0L7Qv9Cw0YE= 41196 -IHLEmQ== 41197 -zrXOuc6x 41198 -INC+0YLQtNC10LvRjA== 41199 -IHRpbWVsZXNz 41200 -IFZpag== 41201 -IFBhbmFtYQ== 41202 -IHJlb3JnYW4= 41203 -IFTDpA== 41204 -IFBsdXRv 41205 -T3Jhbmdl 41206 -INC/0L7QudC0 41207 -IEJyaXN0b2w= 41208 -dWNlZA== 41209 -IOuQmOyWtA== 41210 -IHVuYmVkaW5ndA== 41211 -YWRsZQ== 41212 -IHZvbHVudGVlcmVk 41213 -IG1pZWxp 41214 -IEVkaW5idXJnaA== 41215 -aWthbA== 41216 -IGFsdGVu 41217 -IEFyc2Vu 41218 -IG1vdXZlbWVudA== 41219 -IGFudGlxdWU= 41220 -IGJo 41221 -IEhlcnM= 41222 -IHNhdXRl 41223 -IGFzcGlyZQ== 41224 -IHNwaGVyZXM= 41225 -IFdhbQ== 41226 -4bqvbQ== 41227 -IHdpcGVz 41228 -IDI4MA== 41229 -IFZlaA== 41230 -IGNvbG9jYQ== 41231 -0LDRhA== 41232 -INCy0L7Qt9C80L7QttC90L7RgdGC0Yw= 41233 -IHBoeXNpb2xvZ2ljYWw= 41234 -aHdh 41235 -ZXR1 41236 -IHByb2xvbmdlZA== 41237 -IGV4cGVyacOqbmNpYQ== 41238 -INCy0LjQtNC90L4= 41239 -IHF1YXJhbnQ= 41240 -IHB1ZWRhbg== 41241 -6JQ= 41242 -dmluZQ== 41243 -IFVTREE= 41244 -cGhlbQ== 41245 -IGZvcm1pZGFibGU= 41246 -IGZsYXR0ZXI= 41247 -7Ja07KeA 41248 -IGLDqW4= 41249 -4LmB4LiV 41250 -IOusvOuhoA== 41251 -IGZhY3Rpb25z 41252 -IExlYXZpbmc= 41253 -INeQ16rXlA== 41254 -IEV4cGVydA== 41255 -ZGlv 41256 -IFZlcmQ= 41257 -44G/44Gf44GE 41258 -IHNpbnQ= 41259 -2YbYrw== 41260 -bnVtYmVy 41261 -IG93ZWQ= 41262 -IGluZHVjZQ== 41263 -IEZyZWRkaWU= 41264 -YWJv 41265 -IEZpbGlwaW5v 41266 -r7zr 41267 -YmVsaWV2YWJseQ== 41268 -YXRobG9u 41269 -YW1hYW4= 41270 -IGRldmVuaXI= 41271 -IEdvcw== 41272 -IEplbmtpbnM= 41273 -YmFpdA== 41274 -IGJpbnM= 41275 -IE1JQ0g= 41276 -dXlvcnVt 41277 -aWdyYWRl 41278 -aXNzbw== 41279 -IOyXtA== 41280 -IOyVhOu5oA== 41281 -IGRpYXJyaGVh 41282 -IHRvcm5hcg== 41283 -YWRkaW4= 41284 -IHVuZ2Vmw6Rocg== 41285 -IHJlc3Ryb29t 41286 -IHBzeWNoaWF0cmlzdA== 41287 -IEtpY2tzdGFydGVy 41288 -IGdlcmE= 41289 -IGFscmVk 41290 -IFdyYXA= 41291 -z4zPgw== 41292 -IHNpbm5lcg== 41293 -Q0hFRVJJTkc= 41294 -IGtpbG93 41295 -IGRldGVybWluYW50 41296 -IGRlbW9uaWM= 41297 -aWRlbmNlcw== 41298 -Y2hhcw== 41299 -IERlZA== 41300 -5byV 41301 -IHN0dW1ibGU= 41302 -IFVycw== 41303 -IGRlY2VpdmVk 41304 -IFRFUg== 41305 -IEPDsw== 41306 -ZWxsZWQ= 41307 -IG5vdHdlbmQ= 41308 -IOyngOq4iOq5jOyngA== 41309 -IHBhcnRpZG8= 41310 -IGRlc2NlbmRlZA== 41311 -IHZhcmTEsXI= 41312 -IGVuYWN0ZWQ= 41313 -IGN6xJnFm2Np 41314 -5bel5L2c 41315 -IHRyYWluZWVz 41316 -IGF1ZGlibGU= 41317 -IG1hbGY= 41318 -IHZlbw== 41319 -w6xu 41320 -IEdQQQ== 41321 -IEFwcGU= 41322 -5YK3 41323 -IHJ1dA== 41324 -IENhcmxh 41325 -a2FjaA== 41326 -IHNhdmlvcg== 41327 -aXRjaGVk 41328 -IGNsaW1heA== 41329 -0LDRgtC10LvRjw== 41330 -IE1jQ29ubmVsbA== 41331 -0L7Qu9GP 41332 -ZXJleWU= 41333 -INGB0L7Qt9C9 41334 -IGNhYm8= 41335 -IFNuZQ== 41336 -IEFmZm9yZGFibGU= 41337 -IHNhcsOg 41338 -IGxlZ2l0aW1hY3k= 41339 -IHNjYXJjZQ== 41340 -Li4uPC8= 41341 -IDEwOA== 41342 -IGFjdW0= 41343 -IEZyYW5rbHk= 41344 -IHJhZGlhdG9y 41345 -IGdlbmVyYWxz 41346 -IGRpdmlkZXM= 41347 -IGNoZWVzZWNha2U= 41348 -IHNvcmNlcg== 41349 -IG1pc2NvbmNlcHRpb24= 41350 -IGhhcmRzaGlwcw== 41351 -IE9uZVBsdXM= 41352 -w7x5b3JzdW4= 41353 -IFNvdmlldHM= 41354 -IEl0YWxpYQ== 41355 -aWNraQ== 41356 -IEFmdGVyd2FyZHM= 41357 -IHJpZGljdWxvdXNseQ== 41358 -IGdkemllxZs= 41359 -IE5vdGVz 41360 -2YPYp9mG 41361 -IHJvbWFu 41362 -IG9yZ2FuaXplcg== 41363 -IGNvdXJ0eWFyZA== 41364 -INGH0LXQu9C+0LLQtdGH 41365 -IFdpdG5lc3M= 41366 -INC/0Y/Rgg== 41367 -IENoaWxs 41368 -IFZhbHZl 41369 -IM6szrvOuw== 41370 -IEtQ 41371 -Y2hsdXNz 41372 -IGRlZmxlY3Q= 41373 -IFRvbmk= 41374 -IGNsYWly 41375 -IHN0YWNraW5n 41376 -5L2O 41377 -cmFzemFt 41378 -IFNvbnJh 41379 -44Gj44Gh44KD 41380 -IEF0YXJp 41381 -IHBhc8Oz 41382 -IGNoYXJtcw== 41383 -YW5zdA== 41384 -IHRlcmNl 41385 -IExpbGx5 41386 -IHBzeWNob2xvZ2ljYWxseQ== 41387 -IGPFkw== 41388 -dXN0ZQ== 41389 -pbTs 41390 -Q1RW 41391 -IG1pZWw= 41392 -55qH 41393 -Q2FyZQ== 41394 -IOKAkQ== 41395 -IHNuYXBwZWQ= 41396 -44Gp44KC 41397 -IOqwkOs= 41398 -0L7RgtGL 41399 -IG3DqnM= 41400 -Lj8= 41401 -IHRvbm5lcw== 41402 -15XXk9eU 41403 -4LiE4LiZ 41404 -VHU= 41405 -IGRpc3RyaWJ1dGluZw== 41406 -IGNyYWNrZXJz 41407 -IGNvcmHDp8Ojbw== 41408 -w6Rtw6Ru 41409 -5L2g5Zyo 41410 -Y2xhbWF0aW9u 41411 -0L7RgNC0 41412 -k5zrprTqsozsmpQ= 41413 -IFVudGVyc2NoaWVk 41414 -RmluZQ== 41415 -Y2tv 41416 -INGA0LXQsdC10L0= 41417 -IHNwaWM= 41418 -IGRvY3RvcmFs 41419 -INGB0LrQvtGA0LXQtQ== 41420 -dW5pdmVycw== 41421 -YWN1bGE= 41422 -IMOWc3RlcnJlaWNo 41423 -IGdyaW5kZXI= 41424 -IGFtYm9z 41425 -IHZhc3RseQ== 41426 -6YCZ5YCL5piv 41427 -IGNvbmZlc3NlZA== 41428 -IFNoaA== 41429 -YW5kZXJz 41430 -IEd1YW4= 41431 -INC90LXQvtCx0YXQvtC00LjQvNC+ 41432 -IGNoYW1waW9uc2hpcHM= 41433 -IFZ1bA== 41434 -IFBoaQ== 41435 -IE1lYXN1cmU= 41436 -5pyo 41437 -IGluc2dlc2FtdA== 41438 -5oWi5oWi 41439 -dmV0dGU= 41440 -IGdlbm9t 41441 -aW5kdW5n 41442 -Z2xp 41443 -RGV0 41444 -IHVubXV0ZQ== 41445 -44G+44KK 41446 -IHNhdWNlcw== 41447 -IER3 41448 -15HXqg== 41449 -IEJSRQ== 41450 -IG51cnR1cmU= 41451 -IGRldGFpbmVk 41452 -IEJlZXI= 41453 -INC80LjRgNCw 41454 -0LLQtQ== 41455 -IEJpcmRz 41456 -IG1laWxsZXVy 41457 -IHJld2luZA== 41458 -IHBvcmU= 41459 -15nXlg== 41460 -w6lnZXI= 41461 -cXVlbGE= 41462 -IHRyb3VzZXJz 41463 -IHNpaW7DpA== 41464 -IEdhZ2E= 41465 -IEJSQU5E 41466 -bGViZW4= 41467 -IHJhc3BiZXJyeQ== 41468 -5LuY 41469 -aWxpaw== 41470 -IHZlcnPDo28= 41471 -bGFr 41472 -IGxvZ2Fy 41473 -IE1JREk= 41474 -IOychO2VnA== 41475 -INC/0YDQvtC40LfQvtGI 41476 -IHN0ZXJpbA== 41477 -IGhhcm1lZA== 41478 -0LDQstC70LjQsg== 41479 -INGB0YHRi9C7 41480 -IGxhY2tlZA== 41481 -IGNvbnRhY3Rpbmc= 41482 -IOq4sOyekA== 41483 -IGdlZsOkaHI= 41484 -IGNveQ== 41485 -aWtlbA== 41486 -IGJpbmdl 41487 -IG9ydGhvZ29uYWw= 41488 -IGVudGVuZHU= 41489 -IFRoaXJ0eQ== 41490 -IHNtYXJ0ZXN0 41491 -5aSa5bCR 41492 -IHJhc2E= 41493 -IFF14buRYw== 41494 -0YvQstCw0Y7Rgg== 41495 -IHNsdXQ= 41496 -0LvRg9GH 41497 -aWd0ZW4= 41498 -INGA0LDQsQ== 41499 -IHRhbWFu 41500 -IHF1YWxpZGFkZQ== 41501 -IGRvbWluYXRpb24= 41502 -IHNpbnVz 41503 -IHByb2dyYW1tZXJz 41504 -IGFsbGVyZ3k= 41505 -IFRvcnJlcw== 41506 -IEF1c3RyaWFu 41507 -bmFudHM= 41508 -5a6M5oiQ 41509 -TWVs 41510 -INGD0LLQtdC70LjRhw== 41511 -IEFnZw== 41512 -IHNvaw== 41513 -IHBsdWNr 41514 -IGJpbmRz 41515 -IHByb3Bvcg== 41516 -IE1hZg== 41517 -IG9zb2I= 41518 -IFZJQw== 41519 -6aU= 41520 -INC30LDRh9C10Lw= 41521 -IGV4aGliaXRpb25z 41522 -IGV0dGk= 41523 -Y3ph 41524 -INC90LDRiNC40YU= 41525 -IE1pdHRl 41526 -0L7QsdGL0YLQuA== 41527 -IGNsb2Nrcw== 41528 -IHJpY28= 41529 -5pS7 41530 -INC40YHRgtC+0YDQuNGP 41531 -IHNjaGl6b3BocmVu 41532 -IGZsdWZm 41533 -INGB0L7QsdC40YA= 41534 -IGFwb3k= 41535 -IHByaW5jZXM= 41536 -IGJyYWNlcw== 41537 -IEZJUg== 41538 -IFNuYQ== 41539 -IDsp 41540 -dmVuZXM= 41541 -IHZ1ZWx0YQ== 41542 -IG1pZXM= 41543 -IGJyb29t 41544 -IG1lcnJ5 41545 -IGVzcGVjaWFsbWVudGU= 41546 -IEFsYmFu 41547 -INC/0L7RgdGC0L7Rj9C90L3Qvg== 41548 -IExlbmE= 41549 -IEN1bHQ= 41550 -YWxzbw== 41551 -IHF1b3Rpbmc= 41552 -IGdlbmVyZQ== 41553 -IFlhcg== 41554 -IExhZ2U= 41555 -IGRlbW9zdA== 41556 -IGRhZ2U= 41557 -IEVjdWFkb3I= 41558 -IGFudsOkbmQ= 41559 -dcOfZW4= 41560 -IOuwm+yVhA== 41561 -IHBzeWNob2xvZ2lzdHM= 41562 -IExhcnM= 41563 -IHBvc3Nh 41564 -IG91dGdvaW5n 41565 -IG1ldGlj 41566 -IGJhZ2dhZ2U= 41567 -ZXJpYQ== 41568 -IHJpY2h0aWdl 41569 -7Iuc7JeQ 41570 -INGB0L7RhdGA0LDQvQ== 41571 -IHJvb3Rpbmc= 41572 -IGRyb3BsZXRz 41573 -55qG44GV44KT 41574 -IG5hc2Fs 41575 -IENveA== 41576 -WGk= 41577 -IGRpc3Bvc2FibGU= 41578 -IGJ1dGNoZXI= 41579 -IFphcg== 41580 -IEFybWVuaWFu 41581 -IOu/jOs= 41582 -IEZvb2w= 41583 -IENCRA== 41584 -IHNvc3Q= 41585 -IHBlcmlzaA== 41586 -IFLDqXA= 41587 -57Sw 41588 -44Gd44KM44Gn44Gv 41589 -IEZyZXVk 41590 -IGZhbmRvbQ== 41591 -IGJsb3F1ZQ== 41592 -IGludmVudG9y 41593 -IGFicmU= 41594 -IMOpbm9ybcOpbWVudA== 41595 -IGltcG9ydHM= 41596 -6Yg= 41597 -IG90dXI= 41598 -IFJ5dQ== 41599 -IOKGkg== 41600 -IHNlY29uZG8= 41601 -IGluY29tcGV0 41602 -IGluY2FyY2VyYXRpb24= 41603 -IGFzY2VuZA== 41604 -YmVuZQ== 41605 -5Zac5qyi 41606 -IG9sdXJz 41607 -bm9jaA== 41608 -IGJyZWVkcw== 41609 -0LvQuNC3 41610 -IFZlcmbDvGc= 41611 -IG1haWxpbmc= 41612 -cmVhbGx5 41613 -IGVzZg== 41614 -IHBlbGU= 41615 -IGxlYXNo 41616 -IGRpc2tz 41617 -INC30LDQvNC10Yc= 41618 -7JWE7JWE 41619 -YWJvdXRz 41620 -IE11bGw= 41621 -IERlbnQ= 41622 -ZWRlcmVlbg== 41623 -RHJpdmU= 41624 -IHRpcHBpbmc= 41625 -IG5pZ2dh 41626 -b3JkdW0= 41627 -IHBvcnRlcg== 41628 -IGthcmFva2U= 41629 -IGRvY3VtZW50YXJpZXM= 41630 -IFJJR0hU 41631 -IFB1cmQ= 41632 -INC+0YHRgtCw0L0= 41633 -0LrQu9Cw0LQ= 41634 -w6lyZW5jZQ== 41635 -IOqxuOuhnA== 41636 -INGC0L7Qvw== 41637 -IFdvbmc= 41638 -5LiN5a+5 41639 -INC/0YDQuNGA 41640 -IG5vbWluYWw= 41641 -IGF1bGE= 41642 -INGN0LrRgNCw0L0= 41643 -IGNoZXJjaGU= 41644 -IFRocg== 41645 -5YW25a6e 41646 -IGxhdWZlbg== 41647 -IEthdGhsZWVu 41648 -IHJlYWN0b3Jz 41649 -aWhhdA== 41650 -IHNpZGVk 41651 -IFNpbW9uZQ== 41652 -IGd1aWRlbGluZQ== 41653 -aW1wb3J0YW50 41654 -YnVtcHM= 41655 -dG9uZQ== 41656 -IGVudHJlcHJpc2Vz 41657 -IGNvbnN0aXR1dGU= 41658 -b3Njb3Bl 41659 -IE15c3Rlcnk= 41660 -Y3ljbGVz 41661 -IFdhcnNhdw== 41662 -IGJ1cnN0cw== 41663 -IFpob25n 41664 -5a6M5LqG 41665 -IFNBUkFI 41666 -IOuKkOq7 41667 -6Y0= 41668 -IGJlYWNvbg== 41669 -5Y2H 41670 -QURF 41671 -IOyngOuCmA== 41672 -IGVyc2No 41673 -IGludGVnZXJz 41674 -IENyb3NzaW5n 41675 -c291cmNl 41676 -IHNjaG9vbGluZw== 41677 -IFJPTQ== 41678 -YXRvcml1bQ== 41679 -IOyeiOqyjA== 41680 -IHLDtGxl 41681 -0JXQnQ== 41682 -Q2hhdA== 41683 -IHNocmlua2luZw== 41684 -IHJlaW1idXJzZQ== 41685 -IGx1bWJlcg== 41686 -w7xja3M= 41687 -IHNhbGFo 41688 -TW90aGVy 41689 -IGthbGk= 41690 -IFFhdGFy 41691 -b3Rpb25hbA== 41692 -IG9wYWNpdHk= 41693 -IG5lZQ== 41694 -IENvcnk= 41695 -IOy4oQ== 41696 -IHR1cmJ1bGVudA== 41697 -emVycw== 41698 -INGC0LXRgdGC 41699 -IMOpY3JpdA== 41700 -IOuztO2GtQ== 41701 -IGRpc2dyYWNl 41702 -IOy5tA== 41703 -IGNvdXJ0ZXN5 41704 -aW5nYQ== 41705 -IGh1Z2dpbmc= 41706 -IEFCUw== 41707 -bWl0aA== 41708 -IGluc3VmZmljaWVudA== 41709 -IGNyb29rZWQ= 41710 -IOq3uOuMgOuhnA== 41711 -7Iuk7Q== 41712 -IHNpbXVsYXRlZA== 41713 -IOuEpOqwgA== 41714 -IGLDtg== 41715 -IE90dG8= 41716 -TElORw== 41717 -IGlsbHVzdHJhdGVz 41718 -IERlc3Ryb3k= 41719 -IDE5NjE= 41720 -IFRhZ2Vu 41721 -IG1lbG9u 41722 -IFBhc2NhbA== 41723 -UVVF 41724 -INC/0L7Qu9GD0YfQuNGC0Yw= 41725 -IGluY2lkZW5jZQ== 41726 -IFN0ZXZlbnM= 41727 -IEdpbnM= 41728 -cnVl 41729 -IHVucmVhc29uYWJsZQ== 41730 -IEppZQ== 41731 -eXNpY3M= 41732 -IOuqsOudvA== 41733 -IGZpc2hlcw== 41734 -qbTs 41735 -IHByZWN1cnM= 41736 -IG1vZ8SZ 41737 -dGlnaHQ= 41738 -ZXTDqQ== 41739 -IG11bmRpYWw= 41740 -7JeI64uk 41741 -4oCmIQ== 41742 -QlU= 41743 -IHNvY2lvbG9neQ== 41744 -IGJydXRhbGl0eQ== 41745 -IHBlcnNvbmFqZQ== 41746 -IG7DrXZlbA== 41747 -IGZhemVt 41748 -IGVzc2Vu 41749 -IGR3ZWxsaW5n 41750 -IGNvbW1lcmNpYWxseQ== 41751 -IGVkaXRz 41752 -IGR1ZXM= 41753 -IEdTQQ== 41754 -7J246rCA 41755 -IO2XiO2MnQ== 41756 -IFlhaG9v 41757 -0LXQvdC10YA= 41758 -7Jyo 41759 -0YPRiNC60Lg= 41760 -bGVmdA== 41761 -IGNhcHRpdmU= 41762 -Y2lwaGVy 41763 -INee157X 41764 -INCz0YDQvtC8 41765 -IGlubmF0ZQ== 41766 -IGltcHVs 41767 -IOyXrOyekA== 41768 -IHN3YWxsb3dlZA== 41769 -IFRhYmlp 41770 -7J207Is= 41771 -INGB0L7RgdGC0LDQsg== 41772 -IG95dW4= 41773 -IG9icmlnYWRv 41774 -IEFwaA== 41775 -S2F0aWU= 41776 -IGNlbmE= 41777 -IEFsbMSBaA== 41778 -2YjYsw== 41779 -IHByenlw 41780 -IHBlcHQ= 41781 -IHZvbHVudGFyaWx5 41782 -IE/En2x1bQ== 41783 -IEVsbw== 41784 -b3Vl 41785 -Qmly 41786 -YnVyZ2Vy 41787 -IFNCUw== 41788 -IDYwMDA= 41789 -IHByb21vdGlvbmFs 41790 -IEhlcnJu 41791 -IHN0YW1waW5n 41792 -IHF1YWxpZnlpbmc= 41793 -IGNvc21vcw== 41794 -IGFmYXI= 41795 -5rGf 41796 -YWJ1cw== 41797 -IGRhZHM= 41798 -44Gt44GH 41799 -INGN0LrQvtC90L7QvA== 41800 -aW5jYXJu 41801 -IOyWtOuU 41802 -INC70LXQtg== 41803 -IEJFVA== 41804 -INC90LDQudC0 41805 -b250ZXI= 41806 -IHJldXNhYmxl 41807 -IGtvbW1h 41808 -IEJpag== 41809 -IFRlcmF6 41810 -IE9sw6E= 41811 -IOyVhOy5qA== 41812 -INGA0LDQt9C80LXRgA== 41813 -YXdhbg== 41814 -IGNhcnRh 41815 -5pCe 41816 -aWNlbGVzcw== 41817 -IHNtZQ== 41818 -IFR1dGFq 41819 -IMiYaQ== 41820 -IHByb2JhdGlvbg== 41821 -IGFkZXF1YXRlbHk= 41822 -IFByZXNpZGVudGlhbA== 41823 -aW5kcnVjaw== 41824 -YmxhZGU= 41825 -IHZldWxlbnQ= 41826 -IGNpb8Oo 41827 -5YyF5ous 41828 -IHJldmVyYg== 41829 -IGdlZ2Vuw7xiZXI= 41830 -IEVzcGVybw== 41831 -IGJlZ2U= 41832 -IFNUVURFTlQ= 41833 -c291bmQ= 41834 -IETDvA== 41835 -IG9mZmVuZA== 41836 -ICIuLg== 41837 -a2VubnQ= 41838 -INGB0LvRg9GI 41839 -IHB1cnBvc2VseQ== 41840 -IExpdA== 41841 -IO2bqA== 41842 -dWNoZXI= 41843 -IGhpbmE= 41844 -w71jaA== 41845 -aWdub24= 41846 -VEhF 41847 -IGdsaWRl 41848 -b3VyY2luZw== 41849 -INij2YbYpw== 41850 -IG9sbHV0 41851 -IGFyY2hldHk= 41852 -IHNoYWR5 41853 -IHNvbW0= 41854 -IGVwaWxl 41855 -S2VlcA== 41856 -IG5hamJhcmR6aWVq 41857 -4KSV 41858 -aXR1dGlvbmFs 41859 -INC80LDQuQ== 41860 -IHNpbmZ1bA== 41861 -IEJyb254 41862 -INCz0LvRg9Cx 41863 -IHZhbQ== 41864 -IHByZXNldHM= 41865 -IERhZw== 41866 -IOyZhOyEsQ== 41867 -IGNyZWVr 41868 -aXR1cmVz 41869 -IExvcmRz 41870 -w7Z0dA== 41871 -VU5U 41872 -UmE= 41873 -IGluZXF1YWxpdGllcw== 41874 -IGNvbGxhdGVyYWw= 41875 -IHdyaXN0cw== 41876 -IGdyb3VwZWQ= 41877 -INC+0LHRi9GH0L3Qvg== 41878 -IGFybW9yZWQ= 41879 -IHR1bmc= 41880 -IGNvbnZlcmdl 41881 -IGJvaw== 41882 -IERvZGdl 41883 -0L3Rj9GP 41884 -IGZsZWVpbmc= 41885 -IE1hcnRpbmV6 41886 -IERyZWFtcw== 41887 -a2Vr 41888 -IHNvY2lhbGU= 41889 -IFBsYXph 41890 -2K/YqQ== 41891 -IGtlbGw= 41892 -IFN0ZWxsZW4= 41893 -ZmVsdA== 41894 -INGB0L/QsNGB 41895 -IFB2 41896 -IGNhbmNpw7Nu 41897 -IEhlcnQ= 41898 -IEJhbGFuY2U= 41899 -IHNlbHZlcw== 41900 -IHZhbmRhYWc= 41901 -IHByeQ== 41902 -IG5hamxl 41903 -INCy0LjQtNC40YLQtQ== 41904 -IHZlbHZldA== 41905 -IGdyb290 41906 -IGZvdXQ= 41907 -5qih 41908 -IFNjaHVsZW4= 41909 -IE1vaGFtbWVk 41910 -IENlbnRlcnM= 41911 -IGhhdmVy 41912 -IGZyZXVlbg== 41913 -pO2KuA== 41914 -0LvQsNC9 41915 -UE9T 41916 -aW5raQ== 41917 -IOuLtQ== 41918 -IHBhcmFseXplZA== 41919 -R0xJU0g= 41920 -IGNhc3Rz 41921 -IFZD 41922 -7J207IWY 41923 -INiq2r4= 41924 -56Wo 41925 -IOykmA== 41926 -INeo15XXpg== 41927 -IHN1Y2Vk 41928 -IHByb2dyZXNzZXM= 41929 -IEXEn2Vy 41930 -sOuPhA== 41931 -IGluc3RhbGxhdGlvbnM= 41932 -cGVkbw== 41933 -0LXRgNCx 41934 -aW50ZXJwcmV0 41935 -IOqzoOuvvA== 41936 -IEF6ZXJiYWk= 41937 -aXZpZGFkZXM= 41938 -IOyjhOyGoQ== 41939 -IGVudGZlcg== 41940 -IGNod2ls 41941 -IEhlcmJlcnQ= 41942 -IEFsZXhhbmRyaWE= 41943 -eXR5 41944 -IHNlY2hz 41945 -IGNhbGliZXI= 41946 -IFdlaXNl 41947 -IEhlY2s= 41948 -IFl1Zw== 41949 -INin2YTYtw== 41950 -IHBlc2Fy 41951 -IGNpZ2Fy 41952 -IG3DqWw= 41953 -IGhhaXJk 41954 -IHByenlwYWRrdQ== 41955 -IGNvbmZpZGVudGx5 41956 -IGFuYXJjaA== 41957 -IEdpYW4= 41958 -IGRvYnJl 41959 -Y2rEmQ== 41960 -YXd5 41961 -IFJlY2U= 41962 -IEdvYmllcm5v 41963 -IGNhcmdh 41964 -dW1zeQ== 41965 -IG5vcnRl 41966 -IGhhbmRsZXI= 41967 -IHJlc3BlY3Rpbmc= 41968 -IGFsbGllZA== 41969 -IFBpZXQ= 41970 -aWNodGxpY2g= 41971 -IG9sZHM= 41972 -IGR1c3R5 41973 -IGdyeQ== 41974 -IC0uLi4= 41975 -R0hU 41976 -IG5lbw== 41977 -0YfQuNC60Lg= 41978 -0LXQttC0 41979 -YWlkZQ== 41980 -INCx0YPQu9C+ 41981 -7Y28 41982 -IHRlbXBvcmFkYQ== 41983 -IGRvdXRl 41984 -4piG 41985 -IOyIoA== 41986 -IEpVU1RJTg== 41987 -YXV0bw== 41988 -IHJhdGlvbmFsZQ== 41989 -cHJvYg== 41990 -IGZpc2h5 41991 -IGRvb3J3YXk= 41992 -IGVtcHRpbmVzcw== 41993 -0LXQvdC90LDRjw== 41994 -IGJyYWc= 41995 -INCT0LTQtQ== 41996 -54i+ 41997 -IHRyYW5zaWVudA== 41998 -IG1pdHRsZXJ3ZWlsZQ== 41999 -IEJyZXQ= 42000 -IGZpag== 42001 -IGRlcG9zaXRlZA== 42002 -TlM= 42003 -IOyVnuyXkA== 42004 -IGtpbXNl 42005 -IGNoYXJpdGllcw== 42006 -IE1pbGxlbm4= 42007 -ZG9ncw== 42008 -IG1veWVu 42009 -IG51ZXZvcw== 42010 -IENvb2tpZQ== 42011 -cGFyYWJsZQ== 42012 -ZG9pbmc= 42013 -IFNhaWw= 42014 -IGljeQ== 42015 -aGFiYQ== 42016 -IHF1ZWVucw== 42017 -IGNob2NvbGF0ZXM= 42018 -IE5heQ== 42019 -INGE0LjQvQ== 42020 -IHZlYw== 42021 -IGhlbG1ldHM= 42022 -VE0= 42023 -IEFybWVk 42024 -IGltcGFpcm1lbnQ= 42025 -IFR1cw== 42026 -IE3Dqm1l 42027 -b21leg== 42028 -IFJlcXU= 42029 -IEludmVzdGln 42030 -7Y6Y 42031 -IGdvbHBl 42032 -IFJhYw== 42033 -aWdyYXBo 42034 -IGt3ZXN0 42035 -IHNhaWxvcnM= 42036 -IHN0YXR1dG9yeQ== 42037 -IG1pbGVzdG9uZXM= 42038 -IE1hc2g= 42039 -IEdlc2V0emVudHd1cmY= 42040 -6Yo= 42041 -IGNvbG91cmVk 42042 -aHVtYQ== 42043 -IHllcmU= 42044 -IHN1YnRpdGxlcw== 42045 -IGVtYm9kaWVk 42046 -IG1pc3NjaGllbg== 42047 -IGlQaA== 42048 -w7x0emVu 42049 -IGRldGFjaGVk 42050 -IGRlc2NyacOnw6Nv 42051 -Y2lhbW8= 42052 -IHJlY29pbA== 42053 -INCt0YLQvtGC 42054 -IGV4cG9ydGVk 42055 -IEFsb25l 42056 -YW50cnk= 42057 -IGVzdGFu 42058 -IFNvZA== 42059 -IGxhdm9ybw== 42060 -5oqK5a6D 42061 -16jXkQ== 42062 -IMSR4buL 42063 -IHN3YWc= 42064 -IFBDQg== 42065 -IEthaXNlcg== 42066 -IE1vZGVy 42067 -anVn 42068 -IHRleHRpbGU= 42069 -VHc= 42070 -IG5hYw== 42071 -ZnJlaQ== 42072 -IHJldGFyZA== 42073 -aXNjZXJu 42074 -IHRhbGxlc3Q= 42075 -IEx1Y2E= 42076 -UmFo 42077 -IHByZWFjaGVy 42078 -IGp1dA== 42079 -IFJpY2E= 42080 -aWNpZW5jeQ== 42081 -IMSRaeG7gXU= 42082 -IGthdWZlbg== 42083 -IG5ldHQ= 42084 -IGRpc2N1dA== 42085 -IGRlcHJpdmVk 42086 -oa0= 42087 -IHNwcmljaHQ= 42088 -IGVuY2xvc2Vk 42089 -IFN1YnN0 42090 -56eR 42091 -IFJhYmJpdA== 42092 -cHJpc2Vk 42093 -IGJpdGNoZXM= 42094 -7J+B 42095 -54mI 42096 -IHRhcGE= 42097 -IEVzc2Vu 42098 -IEJhbw== 42099 -IGRldmllbnQ= 42100 -IFd1aGFu 42101 -IFRpcHA= 42102 -IGRpc2FzdA== 42103 -0YHRgtCy0YM= 42104 -dWJsaXF1ZQ== 42105 -IHF1YWxpdMOp 42106 -IGluYWRlcXVhdGU= 42107 -IGJhcmdhaW5pbmc= 42108 -IEdvdGNoYQ== 42109 -0LXQstC40Yc= 42110 -aWV2b3Vz 42111 -ZXJ0b24= 42112 -Ymx1ZQ== 42113 -IOybgOyngQ== 42114 -IHNhbmRib3g= 42115 -IFJlaW4= 42116 -6Kaq 42117 -IOydtOqyg+uPhA== 42118 -IHNheA== 42119 -em9nZW4= 42120 -dW7DpGNoc3Q= 42121 -IGhlcmtlcw== 42122 -IC0s 42123 -emVuaQ== 42124 -cmlzaW5n 42125 -IHJlc3Bvc3Rh 42126 -IHByb21vdGlvbnM= 42127 -IFVudGVyc3TDvHQ= 42128 -IE1BUw== 42129 -Tm90aGluZw== 42130 -b3RpY3M= 42131 -INCy0YvQuQ== 42132 -IHJvdGF0ZXM= 42133 -a2llbg== 42134 -IGhhYmxh 42135 -IERhbmk= 42136 -dW5pb24= 42137 -IHdhY2s= 42138 -IGFyY2hhZW9sb2dpY2Fs 42139 -IEN1cnRpcw== 42140 -IEhvcml6 42141 -IOqzqOs= 42142 -IHdhaXZlcg== 42143 -5Zi/ 42144 -Qm9u 42145 -IHJvdGF0ZWQ= 42146 -IHBpdGNoZXI= 42147 -IGluYWQ= 42148 -IGh1Z3M= 42149 -IE5vcnRoZWFzdA== 42150 -15nXqteZ 42151 -IHBsZWE= 42152 -IGN1cGNha2U= 42153 -IExZ 42154 -IGZhbWlsaQ== 42155 -IGdyb28= 42156 -IEJsYWly 42157 -IGxpag== 42158 -IGhhYml0YXRz 42159 -IGNvbW11bmlzbQ== 42160 -b3NpdW0= 42161 -YmFycw== 42162 -IEZyZWVtYW4= 42163 -bmVv 42164 -IGRpZmZ1c2U= 42165 -IGN5bGluZGVycw== 42166 -IERlYmF0 42167 -7ZaI64qU642w 42168 -0LXRiNC1 42169 -IGZpbmdlcnByaW50cw== 42170 -IGFtYXI= 42171 -0LLQuNC0 42172 -IOygleuPhOuhnA== 42173 -IGFmZmlsaWF0ZWQ= 42174 -INGF0L7Rh9C10YI= 42175 -44Gw44GE 42176 -IGV0aXF1 42177 -IGNow61uaA== 42178 -5oGt5Zac 42179 -IGNydWlzaW5n 42180 -IFdlaWhu 42181 -55S1 42182 -IFRpdGFuaWM= 42183 -57SA 42184 -IE5hc3Q= 42185 -IOuTpOs= 42186 -INCy0LDQuw== 42187 -IGRlbWk= 42188 -IEtyaXN0aW4= 42189 -TUlO 42190 -IHJpZ29y 42191 -IG1vdG8= 42192 -IExBS0U= 42193 -IO2ZnA== 42194 -IOunjOyVvQ== 42195 -IFN0cm8= 42196 -IHByb3RvdHlwZXM= 42197 -IExD 42198 -7J247J2E 42199 -0YDQuNC8 42200 -IHZpb2xhdGluZw== 42201 -IGdpb3Jubw== 42202 -IGNoaWxkaXNo 42203 -5rCU 42204 -INeQ15fXkw== 42205 -IG92ZXJkb3Nl 42206 -YWdvZ3Vl 42207 -0LDQtNGG 42208 -aGV1cw== 42209 -INCz0L7QstC+0YDRjw== 42210 -IGluY3I= 42211 -IGRlYmF0ZWQ= 42212 -2YXZhA== 42213 -IGNoaWNrcw== 42214 -IHF1aW4= 42215 -TEFVR0hJTkc= 42216 -IHRpZ2h0ZW5pbmc= 42217 -IHN1cGVydmlzb3Jz 42218 -IEhhd2s= 42219 -IEJheg== 42220 -INC/0L7QstGC0L7RgA== 42221 -INCx0LvQvtC6 42222 -xIFu 42223 -IGR1bXBpbmc= 42224 -IGZhY3Rv 42225 -YmVyZ2Vy 42226 -IGFyc2VuYWw= 42227 -IEFmcmljYW5z 42228 -oYA= 42229 -IGNhZmV0ZXJpYQ== 42230 -ZmVlZGluZw== 42231 -cXVpbGE= 42232 -IHBhxYRzdHdv 42233 -xLFudA== 42234 -hLE= 42235 -IGVudmlyb25tZW50YWxseQ== 42236 -IGRlc3Byw6lz 42237 -IFdpbGx5 42238 -IFBhxYRzdHdv 42239 -IEdH 42240 -IGNoYWN1bg== 42241 -IGRpcmVjdGlvbmFs 42242 -IGjDtnJ0 42243 -IPCd 42244 -ZW5hcnk= 42245 -IHZvaWNlZA== 42246 -YcSfxLE= 42247 -IHBvcGU= 42248 -IGNvbXJhZGVz 42249 -IEdpYnNvbg== 42250 -IEFDQw== 42251 -dmlr 42252 -IG1vZGVsbGluZw== 42253 -IGFnZ2k= 42254 -44Gq44KT44Gn44GZ 42255 -IGNvbnZlcnNpb25z 42256 -IGF2ZXJhZ2Vz 42257 -RWxsaWU= 42258 -IGdlc3RlbGx0 42259 -IFVF 42260 -b3NhaWM= 42261 -0JLQvtGC 42262 -U2F5 42263 -INGB0LDQvNC+0LPQvg== 42264 -IG1lc3VyZXM= 42265 -aXNpZXJ0 42266 -Z2FzcA== 42267 -dm9pY2U= 42268 -IGNoZWNrcG9pbnQ= 42269 -IHBlcmNlbnRhZ2Vz 42270 -IGRpc3J1cHRlZA== 42271 -IFR1Yw== 42272 -IEhvbWVy 42273 -IFdBWQ== 42274 -IFR1cmtz 42275 -aGVlbg== 42276 -aW1vdG8= 42277 -IE9D 42278 -w61uYQ== 42279 -emllbA== 42280 -IG11ZGFy 42281 -44OQ44Kk 42282 -Z2VzZXR6dA== 42283 -IG1lam9yZXM= 42284 -IENK 42285 -0L3QsNGA0YPQtg== 42286 -IG1vZHVsdXM= 42287 -IG1vZHVsYXRpb24= 42288 -IHJlcGxpZXM= 42289 -IGxhcnZh 42290 -IGdpZGVy 42291 -IE1hbmRhcmlu 42292 -INC/0L7RgdC80L7RgtGA0LjQvA== 42293 -IHNhY3JpZmljaW5n 42294 -IHByZcOnbw== 42295 -IG95c3RlcnM= 42296 -IE15YW4= 42297 -b2xvZ3Vl 42298 -IFdpdA== 42299 -IGTDuw== 42300 -IExldXRlbg== 42301 -IHBhdGVy 42302 -IEtFTk5FVEg= 42303 -0LDQsdCw0YI= 42304 -YXJ0aHk= 42305 -IHNvY2llZGFk 42306 -IG5pw7Fv 42307 -0LXQstC+0Lk= 42308 -IGrEmQ== 42309 -IGFkdmVydGlzZWQ= 42310 -IFBlcHNp 42311 -dXRldXI= 42312 -IG1hc3Nl 42313 -IHNjYXR0ZXJpbmc= 42314 -IHnDtm4= 42315 -IGRlc2FwYXJl 42316 -IEh1YmJsZQ== 42317 -IEjDqQ== 42318 -a3LDpA== 42319 -IERhcmU= 42320 -IG92ZXJyaWRl 42321 -IEVsYWluZQ== 42322 -IER1Ymxpbg== 42323 -ZHVsbGFo 42324 -TWF0 42325 -IEdhcnI= 42326 -Li4uJw== 42327 -IGFkdWx0aG9vZA== 42328 -RVo= 42329 -IGJlbGFuZ3Jpams= 42330 -aWVuemE= 42331 -IHVuaXZlcnNv 42332 -IHN0ZWxsYXI= 42333 -7ZSE6w== 42334 -IOqysOq1rQ== 42335 -IGNvbnN0ZWxsYXRpb24= 42336 -IFNoZWxsZXk= 42337 -IG11bHRpdA== 42338 -IG1hc2NvdA== 42339 -IGhvc3BpdGFsaXplZA== 42340 -IPCdmA== 42341 -0L7RgNGL 42342 -YWRpYQ== 42343 -IE1pa2V5 42344 -IEFtZXJpa2E= 42345 -IGhhaXJ5 42346 -SG9sZA== 42347 -4bqvbg== 42348 -a2llZ28= 42349 -6KeC 42350 -4LmA4LiU 42351 -IHJpdmFscnk= 42352 -IEpvbmFo 42353 -IHN1cmdlb25z 42354 -IHJlbGF0YWJsZQ== 42355 -6JI= 42356 -IHN3aW1z 42357 -IGJpbGxpb25haXJl 42358 -bW9kZXJu 42359 -IGRvY3VtZW50aW5n 42360 -IERhZQ== 42361 -IHN3YXRjaA== 42362 -IHB1aXNzZQ== 42363 -IG1hc3Vr 42364 -IG1hcmM= 42365 -IGtyw7M= 42366 -IFBldGVyc2J1cmc= 42367 -IEFyaXN0b3RsZQ== 42368 -aXhl 42369 -UHJvZHU= 42370 -INC90LjQvNC4 42371 -IGthbmE= 42372 -INCp 42373 -IHZvbWl0 42374 -IFdvcmtlcnM= 42375 -cG9wdWxhcg== 42376 -IEJpZWJlcg== 42377 -0LXRgtC4 42378 -w6l0aXF1ZQ== 42379 -IGVuY2FudA== 42380 -Z3Jhbg== 42381 -Zmly 42382 -IGFudGhlbQ== 42383 -0YHRg9C00LDRgA== 42384 -TGFzdA== 42385 -IGhhZw== 42386 -IHZpY2luaXR5 42387 -cmVuY2hlZA== 42388 -YW5kaW5n 42389 -INCz0L7Qu9C+0YE= 42390 -IENvcm5lcg== 42391 -0JLRiw== 42392 -b3Nhcw== 42393 -aWV2ZXJz 42394 -Y2lvbmFs 42395 -IHZpZ29y 42396 -IHJlam9pY2U= 42397 -IGNpxIU= 42398 -INC60L7Qvw== 42399 -IHF1YWxjb3Nh 42400 -ZGVzc3Vz 42401 -INC10LI= 42402 -IFNjYW5kaW4= 42403 -IFNtb290aA== 42404 -5L2g6K+0 42405 -aGFwZQ== 42406 -IOuLrOudvA== 42407 -IFRV 42408 -IGx5cmlj 42409 -IGJlc3M= 42410 -6ZA= 42411 -0YHRgtGA0YPQvNC10L3Rgg== 42412 -IEFjdGluZw== 42413 -IE9yY2hlc3Q= 42414 -w6ljb2xl 42415 -IGRvbG9y 42416 -IO2LsA== 42417 -IHZlcmdlc3Nlbg== 42418 -IGV5ZWxpZHM= 42419 -IFRhbno= 42420 -0LLQtdGA0LY= 42421 -IOyVoOs= 42422 -dcOp 42423 -IHNjw6huZQ== 42424 -IOyasOumrOuKlA== 42425 -IGNyYXRl 42426 -a2ljaw== 42427 -IFRoZW1l 42428 -IDMyMA== 42429 -IGdhcm5pc2g= 42430 -IG1ldHJl 42431 -IGNvbnZleA== 42432 -cGxhbnRz 42433 -ZXNpYW4= 42434 -IOqxsOyngA== 42435 -IG3DqWRp 42436 -IE1lZGFs 42437 -MTMw 42438 -IEFsbWE= 42439 -5pyJ6bue 42440 -Q29sYQ== 42441 -INCy0LDRgNC40LDQvdGC 42442 -IGdvcmQ= 42443 -IGF2YW56 42444 -IHdoaXNwZXJpbmc= 42445 -IGludGVzdGluZQ== 42446 -0KDQlQ== 42447 -IExJU0E= 42448 -YW3EsXo= 42449 -U1BE 42450 -IHBlYw== 42451 -IHBhc3RvcnM= 42452 -IG114buRbg== 42453 -b2NyZQ== 42454 -U3Vu 42455 -INGC0LDQutGD0Y4= 42456 -IHJldml0YWw= 42457 -IGluY29tZXM= 42458 -IGRldGFpbGluZw== 42459 -IEJhY29u 42460 -IOuFuOuemOs= 42461 -IHBhcnJvdA== 42462 -IGNvbGxhYm9yYXRlZA== 42463 -aGVzaWE= 42464 -IHNldmE= 42465 -IHBoeXNpY2lzdA== 42466 -IEJBQ0s= 42467 -15zXmQ== 42468 -IGJpcG9sYXI= 42469 -z4HOtc6v 42470 -Y3Jvcw== 42471 -IGtlZA== 42472 -IGVjb25vbWljYWw= 42473 -IGVuZGluZ3M= 42474 -IHRpY2tz 42475 -IOq3vA== 42476 -IE9saXY= 42477 -b25ncw== 42478 -IGNvbnRpbmVudGFs 42479 -IHdlaXRlcmhpbg== 42480 -IGFjdGl2YXRpbmc= 42481 -IHBvbGxlbg== 42482 -IEFuaw== 42483 -YmF5 42484 -INec15c= 42485 -IEVnZ3M= 42486 -IFJBTVNBWQ== 42487 -IEJFUg== 42488 -IO2bqOyUrA== 42489 -IHBhc3NhZG8= 42490 -IGdyb3VuZGJyZWFraW5n 42491 -cHJlc2E= 42492 -IGhpbGZ0 42493 -IFRlY2huaWNhbGx5 42494 -0YbQuNC5 42495 -Tkk= 42496 -IHR1cm5vdXQ= 42497 -IExhcA== 42498 -IEd3ZW4= 42499 -IFZpa3Q= 42500 -IGVzY29sYQ== 42501 -IENpbmVtYQ== 42502 -5rC4 42503 -IOOBhg== 42504 -IGNvbnN1bW8= 42505 -IFB1cmR1ZQ== 42506 -IHNlbWFuYXM= 42507 -IFBSRVNJRA== 42508 -xrBuZw== 42509 -IHNhY2g= 42510 -5oCO6bq86L6m 42511 -IHNhdmFnZQ== 42512 -IFJX 42513 -IDU1MA== 42514 -Ym9sZA== 42515 -IFNpbW1vbnM= 42516 -IHNsYW5n 42517 -IE5hcnU= 42518 -IFRoZW8= 42519 -7ZaI64uk 42520 -Lu+/vQ== 42521 -IHNlaXp1cmU= 42522 -IGhpdmU= 42523 -IGNlbGxwaG9uZQ== 42524 -5aW2 42525 -aWlpaQ== 42526 -IE11c2ljYWw= 42527 -IE51Y2xlYXI= 42528 -6KGX 42529 -w6F2ZWlz 42530 -IHByZXN0aWdl 42531 -IGJhbG0= 42532 -IHJlZmlsbA== 42533 -eWFo 42534 -aGFydA== 42535 -IHRhcHM= 42536 -IGRpc3Bvc2U= 42537 -IE1pY2s= 42538 -IHRoZXJtb21ldGVy 42539 -44Gq44KJ 42540 -IG9iZWRpZW50 42541 -IGluZm9ybWHDp8O1ZXM= 42542 -IFdpZGU= 42543 -bW9t 42544 -U3Vk 42545 -IHN1c3BlbmQ= 42546 -IE9ic2Vydg== 42547 -INC70LXRgQ== 42548 -IHRyYXRhcg== 42549 -IEthdHJpbmE= 42550 -IHRoZXJlcw== 42551 -5Lqe 42552 -IHRleHRlZA== 42553 -IHN0w7Zy 42554 -IHNuYWls 42555 -IEZpb25h 42556 -IHZpY3RvcmlvdXM= 42557 -IGxpYnJhcmlhbg== 42558 -cHJhY3Q= 42559 -IGZpbm8= 42560 -IEFybXM= 42561 -cHB0 42562 -bHVr 42563 -IHR5cmVz 42564 -IHRvYw== 42565 -IEtvbW11bmVu 42566 -56+A55uu 42567 -IHJldm9sdA== 42568 -IG1vdGl2YXRlcw== 42569 -IGJpc2V4dWFs 42570 -IHd1cw== 42571 -IGhhbmRsYXI= 42572 -IE1VRUxMRVI= 42573 -IGV4cGVjdGFuY3k= 42574 -IGVtYm9keQ== 42575 -IFByaW1hcnk= 42576 -5Y6f5Zug 42577 -0YDQtdC5 42578 -IHVuc2NyZXc= 42579 -aWFudGx5 42580 -LOKApg== 42581 -IHNuZWw= 42582 -IHByZXZhbGVuY2U= 42583 -IGVydXB0aW9u 42584 -IGRlc2NyaXB0aXZl 42585 -dmFn 42586 -INCx0YPQutCy 42587 -IG3Dqm1lcw== 42588 -IGV0aG4= 42589 -IGhpam9z 42590 -IEFiZHVs 42591 -IFphaGw= 42592 -YmVsdA== 42593 -IGfDtnN0 42594 -IFRoZXJlc2E= 42595 -IFNVTg== 42596 -IEJha2U= 42597 -IOW/qw== 42598 -IG9wdGljcw== 42599 -IGFwb2NhbHlwc2U= 42600 -cHVycG9zZQ== 42601 -IHLDs8W8bnljaA== 42602 -IGNydXM= 42603 -INCX0LXQvA== 42604 -IGhhcmRlbmVk 42605 -IFRE 42606 -IGdyYXZleWFyZA== 42607 -IFNpYmVy 42608 -IFBvcnRlcg== 42609 -IGV4cGxvZGVz 42610 -IFNvZmlh 42611 -INCS0LXQtNGM 42612 -IHdlYWtlbmVk 42613 -5piv5oiR 42614 -VUxM 42615 -IHBpbmt5 42616 -IGNoYXBlbA== 42617 -IEZyZXM= 42618 -INC/0YDQuNCz 42619 -TUVS 42620 -IFNjaG1pZHQ= 42621 -IER1ZA== 42622 -5p+l 42623 -ZXN0ZW5z 42624 -IG51YW5jZQ== 42625 -IG1vZGlmeWluZw== 42626 -IE3DtmdsaWNoa2VpdGVu 42627 -IEFuYXQ= 42628 -IGVjY2VudHJpYw== 42629 -IFNjcmV3 42630 -IExlaA== 42631 -IGhvbW9nZW5lb3Vz 42632 -IFRhbGw= 42633 -IFJpY2FyZG8= 42634 -w5o= 42635 -aWducw== 42636 -INC70LjRiA== 42637 -IGdlZnJhZ3Q= 42638 -UnVu 42639 -Y2FzdGVy 42640 -bm9pc2U= 42641 -IGFzeW5jaHJvbg== 42642 -xJlkemll 42643 -INee15c= 42644 -IHN1cHByZXNzZWQ= 42645 -QXJ0aHVy 42646 -zq7Pgg== 42647 -w6Jy 42648 -ZGlzdA== 42649 -INC60LDQtA== 42650 -IGjDtnI= 42651 -IDEzNQ== 42652 -IE1vemFydA== 42653 -INGB0L7QsdGL0YLQuA== 42654 -IE51cnNpbmc= 42655 -IEhhaGFo 42656 -IERvcA== 42657 -IHBvbGljZW1hbg== 42658 -tOyXkOyEnA== 42659 -IOq0gOugqA== 42660 -aHl1aw== 42661 -IHJ1Z2dlZA== 42662 -IG51Z2dldHM= 42663 -IENvbW1z 42664 -U3R1ZA== 42665 -INGB0LLQvtC1 42666 -IGN6YXNpZQ== 42667 -44K9 42668 -IHLDqWdpb24= 42669 -IGZpc2hlcm1lbg== 42670 -IExU 42671 -w5M= 42672 -Y2lhxbw= 42673 -aGVp 42674 -IGNydW1icw== 42675 -IEltbWVy 42676 -IEZlbGQ= 42677 -dGhlc2U= 42678 -IGFkdmVydGlzZXJz 42679 -IHJvYW1pbmc= 42680 -IGZ1bm5pZXN0 42681 -IE5ZVQ== 42682 -IGhlaGU= 42683 -IHBva2luZw== 42684 -IOyViOuPvA== 42685 -aXN0aWNhbA== 42686 -IG9wYXF1ZQ== 42687 -dcOn 42688 -d2lyZQ== 42689 -IFdlYmVy 42690 -IEphY3F1ZXM= 42691 -IDIxMA== 42692 -w7xw 42693 -dXl1 42694 -IGVuZmVybWVk 42695 -IGJ1bXBlZA== 42696 -IFNldw== 42697 -IENoYW5lbA== 42698 -IHBlcnPDtm5saWNo 42699 -IGJldHJheWFs 42700 -IGFsbGV2aWF0ZQ== 42701 -IHbDpGjDpG4= 42702 -IGd1ZXNzZXM= 42703 -IENlbGluZQ== 42704 -YXNzaW5n 42705 -c3Ryb2tl 42706 -IOyhsOs= 42707 -5aSP 42708 -INGC0LXRhdC90L7Qu9C+0LM= 42709 -INC+0YHRgtGA 42710 -IHNvaWVudA== 42711 -RGVhcg== 42712 -IGpz 42713 -IGdlc3Byb2NoZW4= 42714 -YXRoaQ== 42715 -57+7 42716 -xaFl 42717 -U2V0 42718 -b2dlcg== 42719 -IFJpZw== 42720 -INC80LXRhw== 42721 -IHNlcnZpY2lvcw== 42722 -IFJ1dA== 42723 -INCe0Lk= 42724 -IE15YW5tYXI= 42725 -aWZpZQ== 42726 -IHNuYXBwaW5n 42727 -IEthbWVyYQ== 42728 -IGZlc3RpdmU= 42729 -IEZZ 42730 -IENhcm9seW4= 42731 -0ZbQsQ== 42732 -IGxlZ2dpbmdz 42733 -IHlhdA== 42734 -IGVyZ29u 42735 -IGVwaXPDs2Q= 42736 -IGFub21hbHk= 42737 -dWVzdG9z 42738 -SWQ= 42739 -IGV2YWN1YXRpb24= 42740 -IGdpZ2FieXRlcw== 42741 -IGFuZGFyZQ== 42742 -IFJlbnQ= 42743 -bXQ= 42744 -aXN0aW5l 42745 -IGVzdHJhdA== 42746 -ZXR0dQ== 42747 -IHJlY2ViZXI= 42748 -IGRyYW1hdA== 42749 -cmljdWxhcg== 42750 -YWxuxLF6 42751 -IFNlbmk= 42752 -IG95bg== 42753 -IENoZW1pY2Fs 42754 -INGB0YU= 42755 -IHR1cmY= 42756 -IDE5MTc= 42757 -aXNjZXJuaWJsZQ== 42758 -IG1hbnRlbmVy 42759 -IGV4Y2Vy 42760 -IHNwZWN0cmFs 42761 -IG5ldXJvc2NpZW5jZQ== 42762 -IG1pY3JvZg== 42763 -IGZvcmVpZ25lcg== 42764 -IExhbmth 42765 -5L2g5Y+v5Lul 42766 -INGC0LLQvtGA 42767 -IHRvc3NlZA== 42768 -IHBvYmxhY2nDs24= 42769 -IG1hdGVpeA== 42770 -IHNpZWxsw6Q= 42771 -IG90dA== 42772 -IGNvbXB1bHM= 42773 -YWt1a2Fu 42774 -IG1hbmlmZXN0ZWQ= 42775 -IOyTuA== 42776 -IHV0bW9zdA== 42777 -IHJldmVyc2Fs 42778 -IHBsYWNlYm8= 42779 -IGJsYXQ= 42780 -IFN0dW5kZQ== 42781 -bWFuc2hpcA== 42782 -IGF0dGU= 42783 -IOyGjOqwnA== 42784 -IGlzdGVt 42785 -IGFubmF0 42786 -IFBsYXlzdGF0aW9u 42787 -IHphZA== 42788 -IHF1aXR0aW5n 42789 -IGZhbWluZQ== 42790 -IFJvdWdo 42791 -IEZsYW1l 42792 -IGhldXQ= 42793 -IG9wb3J0dW5pZGFk 42794 -IGZhaXNhaXQ= 42795 -IERQ 42796 -IGRpY2llbmRv 42797 -IE1lbGFuaWU= 42798 -IENhcm5l 42799 -bWVn 42800 -cGV0dG8= 42801 -SlVO 42802 -INC70Y7QsdC+0Lk= 42803 -IG9zdGU= 42804 -IEpKb25haw== 42805 -IHRoZWF0cmljYWw= 42806 -IGludmluY2k= 42807 -IGNvbW11bmlvbg== 42808 -dm9jYWw= 42809 -RWg= 42810 -IERldGFpbHM= 42811 -IHN0cm9sbA== 42812 -IFJheW1vbmQ= 42813 -IEFtZWxpYQ== 42814 -kaU= 42815 -IHByb2R1a3Q= 42816 -IG51ZXZhcw== 42817 -IG11c3Ru 42818 -bWF5xLE= 42819 -Y29sb3JlZA== 42820 -ZGVj 42821 -IGhqw6Rs 42822 -IHNlbnRpbWVudGFs 42823 -IHJlYWxtcw== 42824 -IGtyaXQ= 42825 -IHNleHQ= 42826 -IFBzeWNob2xvZ3k= 42827 -6IiJ 42828 -aGls 42829 -INC60L7RgNCw0LE= 42830 -IOuCtOydvA== 42831 -IFVuZGVyc3Rvb2Q= 42832 -IEd1dGVu 42833 -IGdhbmdz 42834 -IGV2ZW5pbmdz 42835 -5oCO5qij 42836 -RW50 42837 -IExlZ2FjeQ== 42838 -IENvbmdv 42839 -IGR1cmNoYXVz 42840 -IGJ1b3k= 42841 -ZXJlbGxh 42842 -V0FO 42843 -UHJl 42844 -INGA0LXQtA== 42845 -IENyaXNpcw== 42846 -44Gq44Gf 42847 -IOydvOydtA== 42848 -IG1hbnVzY3JpcHRz 42849 -0LXRgtGA 42850 -IG5vbnByb2ZpdHM= 42851 -IGRpY3RhdG9y 42852 -IGJhc2tldHM= 42853 -IElzaA== 42854 -IHBlcnRv 42855 -IGRhdGFzZXRz 42856 -IGFtcGxl 42857 -Z2ViYXV0 42858 -IGNvbnRyaWJ1dG9y 42859 -IGNpYW8= 42860 -IGNvbmZpcm1pbmc= 42861 -IFVDTEE= 42862 -4pms 42863 -INGB0L0= 42864 -IG92ZXJ0dXJu 42865 -5ZCJ 42866 -IHVucmVhbGlzdGlj 42867 -IFBpZWNl 42868 -b2NhdGU= 42869 -IGbDpGxsdA== 42870 -cG94 42871 -IOuztOyLnOuptA== 42872 -IOuplOs= 42873 -IENyZWF0aW9u 42874 -0Y7QtNCw 42875 -INeU15A= 42876 -IHdoYWNr 42877 -b2xpdGhpYw== 42878 -Y2VseQ== 42879 -INGB0L7QstGA0LXQvA== 42880 -IHNlcXVlbnRpYWw= 42881 -IHByb2Zlc2lvbmFs 42882 -IGNvb2xz 42883 -IHJlcGVudGU= 42884 -IGFpcmU= 42885 -ZW5uZXM= 42886 -cml0b3M= 42887 -INCS0LjQtA== 42888 -IGvDtnI= 42889 -IEJpdHRl 42890 -dWxhcnM= 42891 -IGluY29ycmVjdGx5 42892 -IHNoYXJwbHk= 42893 -IGJvbWJhcmQ= 42894 -64uY7J20 42895 -IGNocm9tb3NvbWU= 42896 -IGFkdmVydGlzZW1lbnRz 42897 -aHVu 42898 -INGJ0L7QsQ== 42899 -INCU0LDQttC1 42900 -IGJhdGh0dWI= 42901 -IFNubw== 42902 -2ZDZkQ== 42903 -IGJ1ZmZldA== 42904 -IEdyaWQ= 42905 -IEJyZXc= 42906 -aXNldA== 42907 -IEltcG9ydGFudA== 42908 -w7xtw7x6 42909 -IHZldG8= 42910 -IFdlcms= 42911 -IFNoYW0= 42912 -a3Jh 42913 -aWxlZW4= 42914 -aGVhcmQ= 42915 -IGRyYWluaW5n 42916 -IGtsYXNz 42917 -IGJha2F5xLFt 42918 -Y3R1cmU= 42919 -5L2g6Kqq 42920 -YW1vdXI= 42921 -IHNwb25zb3JzaGlw 42922 -IGRpc3RpbGw= 42923 -IHBhdGlv 42924 -IGtvbWI= 42925 -IG92ZXJ3aGVsbWluZ2x5 42926 -IEphbWFpY2E= 42927 -dWl0ZW4= 42928 -TGl0dGxl 42929 -IExPVA== 42930 -dGHEhw== 42931 -IGNvbW1hbmRlcnM= 42932 -IFdhdHRz 42933 -IE9wdGlvbnM= 42934 -7J2066m0 42935 -QUNU 42936 -IGluZGlzcGVucw== 42937 -IEZvcnNjaA== 42938 -b3RvbQ== 42939 -IM6tz4fOtc65 42940 -IHByYWlzaW5n 42941 -IOyYgeyDgeydhA== 42942 -IGFtYW4= 42943 -IGh5cG5vdA== 42944 -dGhtcw== 42945 -IG5hc3plag== 42946 -IG1vdXJuaW5n 42947 -IFNBWQ== 42948 -Y3lq 42949 -INCz0L7RgdGD0LTQsNGA 42950 -IGNhdQ== 42951 -bWVl 42952 -IHRhZGk= 42953 -TWVk 42954 -IGNhbGlkYWQ= 42955 -44Of44O8 42956 -IHN0cmlwZQ== 42957 -IM61zr0= 42958 -IEthdHk= 42959 -IEVzY2FwZQ== 42960 -IOOCkw== 42961 -IG3DvHNzdGU= 42962 -INin2YTYpw== 42963 -0LrRgg== 42964 -IGpvYmJhcg== 42965 -IEplanU= 42966 -b3Jhcg== 42967 -IFNlcsOh 42968 -IE1lc3Np 42969 -w6F6 42970 -IFRyYW4= 42971 -IHBpZXJjaW5n 42972 -IGFyaXRobWV0aWM= 42973 -IHN0YWdnZXJpbmc= 42974 -IHBsdWdnaW5n 42975 -IEtBUg== 42976 -dmw= 42977 -tOyY 42978 -IFJlZ2llcnVuZw== 42979 -IE9jenl3acWbY2ll 42980 -IEVkZ2Fy 42981 -IGNvbmR1Y3Rpdml0eQ== 42982 -eWVsbGluZw== 42983 -dmFpcw== 42984 -YWRpYW4= 42985 -IGJ1bGt5 42986 -INGB0YDQsNCy 42987 -INC/0YDQvtC8 42988 -IHBhdmVk 42989 -IGJlbmRz 42990 -IFNraWxsc2hhcmU= 42991 -IE1tbW0= 42992 -IEhvcnJvcg== 42993 -IHR1bWI= 42994 -IGdvb2Z5 42995 -IE1lb3c= 42996 -15nXnNeV 42997 -IFdhc3M= 42998 -IFNjYWxl 42999 -IFJhaw== 43000 -IHByb2plY3Rpbmc= 43001 -IGxpbmd1aXN0aWM= 43002 -IFdvcmxkcw== 43003 -ZW5zZW1ibGU= 43004 -IHBlZ2E= 43005 -c3RvcHBhYmxl 43006 -IGltYmFsYW5jZQ== 43007 -IMO4 43008 -IHRocmlsbGVy 43009 -0LrQvtC70YzQutGD 43010 -IGxlZnRvdmVycw== 43011 -IGNhdmVhdA== 43012 -IFNUUg== 43013 -dW5kYWk= 43014 -IHdhdGVyeQ== 43015 -IE1hcmlu 43016 -44Oz44Kw 43017 -IGVnZ3BsYW50 43018 -IEpC 43019 -2YXZg9mG 43020 -dmlkaWE= 43021 -IEZJTg== 43022 -aWNhYmxl 43023 -IHBvZG9i 43024 -IGNvaGVzaXZl 43025 -IFZlcmbDvGd1bmc= 43026 -IFBsYXRv 43027 -0LDRgNC40Yk= 43028 -IGtvdA== 43029 -INCf0L7QvA== 43030 -INC00L7QutGD0Lw= 43031 -IGltcGxhbnRz 43032 -aXNzZXo= 43033 -QnJl 43034 -IGdhc3Bz 43035 -IFRFRA== 43036 -cmF0bw== 43037 -Skk= 43038 -IGF2ZW51ZXM= 43039 -IENob25n 43040 -bGFkxLE= 43041 -2LHYtg== 43042 -IGluaWNp 43043 -IFN1YmFydQ== 43044 -5pWF 43045 -6YGK5oiy 43046 -4LiL 43047 -IGFjaHQ= 43048 -IEFyY2hpdGVjdHVyZQ== 43049 -INCy0LXRidC4 43050 -IERldk9wcw== 43051 -IHRvcHBpbmdz 43052 -IG9ic29s 43053 -YWluYQ== 43054 -IEJhbmdrb2s= 43055 -ZXN0cnVjdA== 43056 -IGtvYg== 43057 -IOuTrw== 43058 -INGA0LDQt9C90YvQtQ== 43059 -IHJlZQ== 43060 -IGJpanZvb3JiZWVsZA== 43061 -IERlbW9jcmFjeQ== 43062 -4LmA4Lij4Liy 43063 -INC60L7QvdGC 43064 -IHNlw6c= 43065 -IHJhaGF0 43066 -IHBhcmxpYW1lbnRhcnk= 43067 -IEJhc2g= 43068 -5oqT 43069 -emlhxYI= 43070 -SVRDSA== 43071 -IEJ1YmJsZQ== 43072 -a3TDsw== 43073 -V2hvYQ== 43074 -IGZsYXRz 43075 -5pWI 43076 -em5l 43077 -IHNlcnZpY2lv 43078 -IERldw== 43079 -1bjWgg== 43080 -IHVudGVyc3TDvHR6ZW4= 43081 -IFdpbmRz 43082 -6YKj5Liq 43083 -IOyWmOuKlA== 43084 -IGV2YWx1YXRpb25z 43085 -IHJlY2E= 43086 -IGVsdmVz 43087 -Y2hlZXI= 43088 -IGphbA== 43089 -IHJlc3RlZA== 43090 -IHF1aWVuZXM= 43091 -IEJyb29rZQ== 43092 -IOuniOydjOyXkA== 43093 -IGludGVu 43094 -IG9hdHM= 43095 -IHJlZmVyZWU= 43096 -IHBuZXVtb25pYQ== 43097 -IGRlbHZl 43098 -cGVhY2U= 43099 -ZW55 43100 -IG1vc3RyYQ== 43101 -IENhbm5vbg== 43102 -z4HOv8+N 43103 -INCQ0Ls= 43104 -IG1vbnVtZW50YWw= 43105 -zr/Pjc68zrU= 43106 -aW1tZXJz 43107 -YXZpYW4= 43108 -INC00LXQu9Cw0LXRgg== 43109 -IHBpdGNoZXM= 43110 -IEdyb3Zl 43111 -IHNlbWluYXJz 43112 -IHLDqWN1cA== 43113 -IFZvb3I= 43114 -IGRldmVu 43115 -IGRC 43116 -IGJvb3N0aW5n 43117 -ZWdhbg== 43118 -IHdlbHQ= 43119 -IEd1YXRlbWFsYQ== 43120 -IG1pbGVhZ2U= 43121 -IGJlaGFuZA== 43122 -IFdhYXI= 43123 -IFN1cmY= 43124 -IGNhdWxpZmxvd2Vy 43125 -IFR5cg== 43126 -IG1pdGVpbmFuZGVy 43127 -IGRhcmluZw== 43128 -IFNpdHRpbmc= 43129 -ZGxlZA== 43130 -IHJlc2VudG1lbnQ= 43131 -bcOkw59pZw== 43132 -IGZpbG1tYWtpbmc= 43133 -d2FydHM= 43134 -dGhvdWdodA== 43135 -b2xvZ2lxdWU= 43136 -IENPUg== 43137 -IGFjY291bnRlZA== 43138 -IGFwZXI= 43139 -IElOVA== 43140 -b2xhcmU= 43141 -IGFjb21wYcOx 43142 -6K2Y 43143 -IMahaQ== 43144 -5Lmd 43145 -IG1lcm1haWQ= 43146 -IEJlbnRsZXk= 43147 -YXRvcmU= 43148 -IHByZW4= 43149 -IGV0aGFub2w= 43150 -IGFzdHJvbm9tZXJz 43151 -c2VhdA== 43152 -a2VlcGVycw== 43153 -IGV4ZW1wdGlvbg== 43154 -IGFtbw== 43155 -IOuCmOyEnA== 43156 -IGluaGFs 43157 -IGJvd3M= 43158 -0YHQutGD0Y4= 43159 -MzAwMA== 43160 -IGZlcm1lbnRhdGlvbg== 43161 -IHNpbmtz 43162 -IGNvbWVyY2lhbA== 43163 -IHN0dW1w 43164 -IGNlbGU= 43165 -IFNpc3RlcnM= 43166 -IFJlZ2lzdGVy 43167 -IHNvb3J0 43168 -IG5hdG9taWFzdA== 43169 -IOq3uOumvA== 43170 -IMWeZXk= 43171 -IGh5cGVk 43172 -IFJhZmFlbA== 43173 -IEVpcw== 43174 -IEJhc2ls 43175 -IEFzc2Fzc2lu 43176 -IEFkZQ== 43177 -csOlbg== 43178 -IG9ubGFy 43179 -IG1vdmltaWVudG8= 43180 -IGFkZGl0aW9uYWxseQ== 43181 -IHNsaXQ= 43182 -IENocnk= 43183 -IEludGVydmlld2Vy 43184 -15zXpw== 43185 -IGRpc2w= 43186 -IGxpZ2dlcg== 43187 -0YPQutC4 43188 -YmVyaXNo 43189 -INGA0Y/QtNC+0Lw= 43190 -QVJPTg== 43191 -XSws 43192 -IGx1bWnDqHJl 43193 -IG9sdmlk 43194 -IGZyZXVl 43195 -IFRpbmc= 43196 -IEvDtg== 43197 -IGdlbw== 43198 -IGR5ZWQ= 43199 -44Gn44GN 43200 -0YjQtdC5 43201 -IMW8eWNpZQ== 43202 -IGll 43203 -IHRheHBheWVy 43204 -IHBlxYI= 43205 -IGTDqWNpZMOp 43206 -IGPFk3Vy 43207 -IGVudHdpY2tlbHQ= 43208 -IEhR 43209 -S0s= 43210 -b2Rhcg== 43211 -IGhvbmU= 43212 -IGNvbmZpYW5jZQ== 43213 -IGlzc3Vpbmc= 43214 -IGRpYWdub3N0 43215 -IOyehA== 43216 -INC60YDRg9GC 43217 -INC60LDRgQ== 43218 -IMO+ 43219 -IHJlc3RyaWN0aXZl 43220 -IENhc3Rybw== 43221 -IHXEnw== 43222 -IGVtcHJl 43223 -IE1vbw== 43224 -IEZpZ3VyZQ== 43225 -cGhvbmV0aWM= 43226 -UHJvZg== 43227 -INC/0YDQtQ== 43228 -IHRpbHRlZA== 43229 -IE5lZ2F0aXZl 43230 -IExpbWl0ZWQ= 43231 -bWVubw== 43232 -bGFtYXRpb24= 43233 -IHRydXN0ZWVz 43234 -IGludGVuc2VseQ== 43235 -IGHDp8SxbA== 43236 -IFVzZWQ= 43237 -IHp1bA== 43238 -IGFwcHJlY2lhdGl2ZQ== 43239 -IHRpbmM= 43240 -IGNvbnF1ZXN0 43241 -INi52YbYrw== 43242 -IHN1aWNpZGFs 43243 -IG11bGhlcmVz 43244 -IGRldGFjaA== 43245 -IGthbWVyYQ== 43246 -IEFpclBvZHM= 43247 -SU5ESVNUSU5DVA== 43248 -0LPQu9C40Lk= 43249 -IOuDhA== 43250 -IHdyZXN0bGU= 43251 -5rSX 43252 -IGZpcmVhcm0= 43253 -IGxpcmU= 43254 -cHJh 43255 -IGpld2Vscw== 43256 -IENvcm5lbGw= 43257 -IO2VoOqyjOyalA== 43258 -IHN1Y2tlcg== 43259 -IG5vbWJyZXV4 43260 -IEZlcm0= 43261 -7JuQ7J20 43262 -IFBpcw== 43263 -INC40LfRg9GH 43264 -IG1pdGVu 43265 -IGNldg== 43266 -IFVSTHM= 43267 -IENBUw== 43268 -IOWPr+S7pQ== 43269 -ZmluZGVu 43270 -IGJyYXZlcnk= 43271 -INGB0LvQvtCy0L4= 43272 -IG5lbmh1bWE= 43273 -IGVuY3VlbnRyYQ== 43274 -IFNoaXJsZXk= 43275 -IHBlcmNlcHQ= 43276 -ZnJhbWVz 43277 -IFJvdmVy 43278 -IEFsYmVydGE= 43279 -b2Nj 43280 -IOudvOqzoA== 43281 -IHPDunBlcg== 43282 -IHByZXN1bWU= 43283 -IGdsYW5k 43284 -IHBhY2luZw== 43285 -IG5ldXJvdA== 43286 -IHNubw== 43287 -IHBsb3R0ZWQ= 43288 -IHBhxYRzdHdh 43289 -IE93bmVy 43290 -IERlZmVuY2U= 43291 -cmlkZ2Vz 43292 -IHdhbGxwYXBlcg== 43293 -b25pYW4= 43294 -QnJv 43295 -IEFyaWFuYQ== 43296 -55u05o6l 43297 -a3J5 43298 -IG5hcnJhdGlvbg== 43299 -IGNyaWFuw6dh 43300 -IEFscmlnaHR5 43301 -IOydvQ== 43302 -IOyTsOqzoA== 43303 -IGxpYmVyYXRlZA== 43304 -IGV4Y2VlZHM= 43305 -IGRvbWluYXRpbmc= 43306 -IGJha8Sxbg== 43307 -bGs= 43308 -IHNsYXBwZWQ= 43309 -0JfQtA== 43310 -dW1lbnRhbA== 43311 -Z2V0dGFibGU= 43312 -IFJveg== 43313 -IEd1bA== 43314 -b3V2ZXJ0 43315 -IHNtYXNoaW5n 43316 -YXp1amU= 43317 -U2ly 43318 -IGdyYXRlZA== 43319 -5L2g5pyJ 43320 -QVRU 43321 -IGFydGljdWxhdGVk 43322 -IHN0b3Jh 43323 -IGV4dHJhdGVy 43324 -4buJ 43325 -z4PPiQ== 43326 -d2ly 43327 -IE1ldGU= 43328 -SW1w 43329 -IGhvb3I= 43330 -cGhhc2U= 43331 -INGH0YPQtA== 43332 -INCx0YDQsNGC 43333 -IGlkYWc= 43334 -IGNpbnE= 43335 -IGFwYXJlY2Vy 43336 -IElDRQ== 43337 -5YiX 43338 -IHF1aWV0ZXI= 43339 -IGZhbHNjaA== 43340 -YWRpYw== 43341 -INC/0LvRjtGB 43342 -IE1lbnU= 43343 -dXhl 43344 -IFTDtGk= 43345 -IE1JTA== 43346 -IEhhag== 43347 -dmVyYnM= 43348 -IHR1YmluZw== 43349 -IG1hY2hzdA== 43350 -IGRhbGw= 43351 -VGVy 43352 -IGdlbGVu 43353 -IGN1Y3VtYmVycw== 43354 -IHdpZGdldHM= 43355 -IGRldnJhaXQ= 43356 -IG1pa2U= 43357 -IGludHJh 43358 -7ZWt 43359 -IMOF 43360 -IEh1bmQ= 43361 -5qeL 43362 -cXVhcnRlcg== 43363 -IGV3 43364 -IGtlbHVhcg== 43365 -IG1hdHM= 43366 -IFRyaWNr 43367 -IEluZmluaXRl 43368 -nqg= 43369 -IHBlYWM= 43370 -IFByb3Rl 43371 -4KWI 43372 -IDE3MDA= 43373 -IFJhaXM= 43374 -4LmK 43375 -w6RobHQ= 43376 -aWZpY2E= 43377 -YWltZXI= 43378 -YcSH 43379 -IGFrbA== 43380 -IFZvbHZv 43381 -IFR5c29u 43382 -IFJvbmc= 43383 -aXJzaW4= 43384 -IOKZpQ== 43385 -IHBhcm9keQ== 43386 -bmF0aW9uYWw= 43387 -cG9k 43388 -YXlk 43389 -YW1ibGVk 43390 -IGdvdmVybm1lbnRhbA== 43391 -IGNvbmZvcnQ= 43392 -aWNpZGVz 43393 -IG5hc3pl 43394 -IFNoZXBoZXJk 43395 -IEtvbnRha3Q= 43396 -IGRpc3Byb3BvcnRpb25hdGVseQ== 43397 -INC60LvRjtGH 43398 -IHTDrXR1bG8= 43399 -IHNpbmE= 43400 -IGNvbXBvc2l0aW9ucw== 43401 -IFBG 43402 -IHZlcmts 43403 -IHN1aXZyZQ== 43404 -IGFzdGE= 43405 -IHN0YWtlaG9sZGVy 43406 -IHNhbW1h 43407 -IEJMQUNL 43408 -IG5vZGln 43409 -IGxldmE= 43410 -IGp1ZWdvcw== 43411 -IGVybnN0 43412 -IGJvdHRvbXM= 43413 -IFNpZ25hbA== 43414 -IHBvbGx1dA== 43415 -IGR1cmE= 43416 -TXVzaWs= 43417 -INC60L7QvNC90LA= 43418 -INCy0YHQtdC5 43419 -YWx0ZXI= 43420 -IFN0ZWY= 43421 -IEJpZ1F1ZXJ5 43422 -IFZlcmFudHdvcnR1bmc= 43423 -IOuLueyXsA== 43424 -IHF1aXp6 43425 -IExldHRlcg== 43426 -IEludmVzdG1lbnQ= 43427 -0YjRgg== 43428 -kOuNsA== 43429 -IGVuY29kaW5n 43430 -IHTDpG5rZXI= 43431 -IEt3 43432 -YW5uaWU= 43433 -5Yud 43434 -MTEw 43435 -IHp3eQ== 43436 -IOynpw== 43437 -IGRhdw== 43438 -ZXN0w6Q= 43439 -IGRlY2VpdmU= 43440 -IEzDpG5kZXI= 43441 -aXNrbw== 43442 -IHBvZHN0YXc= 43443 -IFBoYXJhb2g= 43444 -7LOk 43445 -6ZmQ 43446 -w7psdA== 43447 -IHR5w7Y= 43448 -IG11c2lteQ== 43449 -6LOq 43450 -IHBj 43451 -IE5U 43452 -IENvc3Rjbw== 43453 -IOWwjw== 43454 -IM+Dzr/PhQ== 43455 -IHVuaW4= 43456 -cm91bmRz 43457 -IHJlbWluZGVycw== 43458 -IHB1aXNxdQ== 43459 -IGtyaWpnZW4= 43460 -IHdvcmtmbG93cw== 43461 -bmV0ZW4= 43462 -IOuQmOyngA== 43463 -IHNsZWVr 43464 -IGNvd29ya2Vycw== 43465 -YW1pZW50b3M= 43466 -IHdpdGNoZXM= 43467 -YmFhcg== 43468 -ZXRpZXM= 43469 -IHVubmF0dXJhbA== 43470 -IFNpY2s= 43471 -IEVmZW5kaQ== 43472 -44Oz44OA44Ob 43473 -amNpZQ== 43474 -IGNoYW1hZG8= 43475 -7JiA7Iq164uI64uk 43476 -IHByemVkc2nEmWJpb3I= 43477 -IGJvb2tzdG9yZQ== 43478 -IOyeoOq5kA== 43479 -IFNlcGFy 43480 -YW5naQ== 43481 -RXZldA== 43482 -IGVtZXJnZW5jaWVz 43483 -IFhNTA== 43484 -0L3QtA== 43485 -pbTrqbQ= 43486 -IOq/iA== 43487 -IOuTpOqzoA== 43488 -IHN1dA== 43489 -IFdpeg== 43490 -5bGV 43491 -IGR5bmFtaWNhbGx5 43492 -b3BlcmF0aW9u 43493 -ZG90 43494 -IGluZWZmaWNpZW50 43495 -Y2xlYXJz 43496 -IG11bmRhbmU= 43497 -IFZlcm9uaWNh 43498 -6Iy2 43499 -2LHYqg== 43500 -cG9zZQ== 43501 -cGFp 43502 -IG55bG9u 43503 -IGF1bWVudGFy 43504 -IGFsbHRzw6U= 43505 -dmFr 43506 -IGNhcGFjaWRhZA== 43507 -IFdyZXN0bGluZw== 43508 -IGZlcnRpbGU= 43509 -IG3DqWc= 43510 -IE5hbm8= 43511 -0LDRgtC10LvQuA== 43512 -IOyWtOyp 43513 -IHRvY2E= 43514 -IEVn 43515 -4oE= 43516 -IOyz 43517 -bHVlbnQ= 43518 -IHNvbGVt 43519 -IGNpbmVtYXQ= 43520 -IFF1ZWw= 43521 -IG9yYml0cw== 43522 -IEhhcm0= 43523 -cmljYW5lcw== 43524 -IGJsdXJyZWQ= 43525 -5aaC5L2V 43526 -INin2YTYsNmK 43527 -IGppbg== 43528 -IGdyZW5hZGVz 43529 -IGF0cm9j 43530 -IHdoZXJlaW4= 43531 -IHJlcGxlbg== 43532 -IENvbWljcw== 43533 -ZWRhYW4= 43534 -IGRlbmlt 43535 -IGVtYmFycmFzc21lbnQ= 43536 -IEdvbWV6 43537 -IEJ1c2Fu 43538 -aXZpdGllcw== 43539 -IHNhbGl2YQ== 43540 -IG1lcms= 43541 -IGlsZ2lsaQ== 43542 -INC60YDRg9Cz 43543 -IG9jY3VwYXRpb25hbA== 43544 -IFNhaGli 43545 -U3Rh 43546 -IGFkdmlzZXI= 43547 -IFRydWx5 43548 -IFlFQUg= 43549 -IOyeiOuKlOuNsOyalA== 43550 -emV3 43551 -YmFyZW4= 43552 -IHN0b2w= 43553 -IGJlbG9uZ2luZ3M= 43554 -IFJlc2VhcmNoZXJz 43555 -IGVmZW5kaW0= 43556 -z4XPhw== 43557 -xYLEhWN6 43558 -IFVuZw== 43559 -IEp1Yg== 43560 -IGNlcmVicmFs 43561 -4buHdQ== 43562 -INem16g= 43563 -INC/0L7QtNCw0YA= 43564 -IG1hcmNoZWQ= 43565 -IGF3YWtlbg== 43566 -IGFrbw== 43567 -IGFjZXB0 43568 -IGluaXRpYXRpb24= 43569 -6K+J 43570 -bG90 43571 -IHfFgmFz 43572 -IE1vbmdvbA== 43573 -dXRyYWw= 43574 -IHRlbnRhbmc= 43575 -IGludmVyc2lvbg== 43576 -IOydtO2bhA== 43577 -IGxvaw== 43578 -xYJieW0= 43579 -UlM= 43580 -IHN0b3M= 43581 -IGludGVyYWN0cw== 43582 -IENhbGVuZGFy 43583 -IHZhbmlzaA== 43584 -IHBoeXNpb2xvZ3k= 43585 -IGxpbmVhcmx5 43586 -IEpZ 43587 -xJ9hbg== 43588 -ZnVuZGVk 43589 -aXppZXJ0 43590 -IHptaWFu 43591 -IEdyaWxs 43592 -IHVuYmVsaWV2YWJseQ== 43593 -b3RlY2hub2xvZ3k= 43594 -IENhcnM= 43595 -INmG24E= 43596 -IEZvbGdl 43597 -IEJldmVybHk= 43598 -w6Rpc2NoZW4= 43599 -IGF1bWVudG8= 43600 -7JuM7ISc 43601 -IG1haWxib3g= 43602 -IHN0ZWVkcw== 43603 -IFBlYWs= 43604 -5ben 43605 -IHd5a29y 43606 -IHByYXdkYQ== 43607 -0LjRgtGL 43608 -IGRpc2NvdXJz 43609 -IGFjY3VzZQ== 43610 -Y2Vzc28= 43611 -dWlyZQ== 43612 -INC/0L7Qv9Cw0LQ= 43613 -IHRoYQ== 43614 -IG1lYXN1cmFibGU= 43615 -YmVlcGluZw== 43616 -IElubmVu 43617 -INC/0Y/RgtGM 43618 -IGNvbXBldGVk 43619 -IEl0YWxpYW5z 43620 -IGVuY29udHJh 43621 -IG5pZXc= 43622 -IGZpbHRyYXRpb24= 43623 -INC/0YDQvtGE0LXRgdGB 43624 -IHBhamFtYXM= 43625 -IGNpbGFudHJv 43626 -IFNvYw== 43627 -THVj 43628 -IOq5gOs= 43629 -IE9kZA== 43630 -IGh5ZHJhdGlvbg== 43631 -0LzQvtCy 43632 -IHBseXdvb2Q= 43633 -IENvbXBldGl0aW9u 43634 -0LjQt9C90LXRgQ== 43635 -ZmxpZ2h0 43636 -IEJlaXQ= 43637 -Ym91cmc= 43638 -IGNvaWxz 43639 -IGPDom1lcmE= 43640 -IGFtZW5kZWQ= 43641 -xIFt 43642 -QW5nZWw= 43643 -IFN0YWN5 43644 -Zmxv 43645 -IG5vcm1hbGU= 43646 -IGNvbnNvbmFudA== 43647 -IGFjY29tcGFueWluZw== 43648 -0LrRlg== 43649 -IGlycml0YXRlZA== 43650 -IGbDpXR0 43651 -IGNyb2NvZGlsZQ== 43652 -kJjripQ= 43653 -IGFsYmVpdA== 43654 -IFBoaWxvc29waHk= 43655 -57Sv 43656 -xYY= 43657 -eXRpYw== 43658 -IHLDqGc= 43659 -IGZyYW7Dp2E= 43660 -IGF0dGVudGl2ZQ== 43661 -SGFt 43662 -IGFscmVkZWRvcg== 43663 -5p2/ 43664 -c2Vp 43665 -INGB0LLQuNC0 43666 -IGdpbWJhbA== 43667 -IGNoaW5h 43668 -IPCfjrY= 43669 -INCS0LDQvA== 43670 -IHN0aW11bGF0aW5n 43671 -IE9yYQ== 43672 -eXRlcw== 43673 -IGhlZnQ= 43674 -IGhhdGVycw== 43675 -IGNvbXBsZXhlcw== 43676 -IDAz 43677 -csOzZA== 43678 -Y2xlYXI= 43679 -IGJlc3RlaHQ= 43680 -55WZ6KiA 43681 -d255 43682 -bW9pbA== 43683 -IHNsb3BweQ== 43684 -IGluc2lnbmlmaWNhbnQ= 43685 -IGR1YmJlZA== 43686 -IOuWoA== 43687 -IGNvbnNpZ28= 43688 -0LvRg9GI0LDQuQ== 43689 -U24= 43690 -INeU16Y= 43691 -IM6M 43692 -IG5hZHppZQ== 43693 -IGZyZXNobWVu 43694 -dGFh 43695 -IHV3YWfEmQ== 43696 -IEZhdm9yaXRl 43697 -IENyaW1pbmFs 43698 -IGV2aWRlbg== 43699 -IHN5bWI= 43700 -TGVz 43701 -IEJlYXU= 43702 -dW5lZA== 43703 -cGxlbWVudA== 43704 -QWM= 43705 -IGRlcm1hdA== 43706 -IE5vbGFu 43707 -0YvQvw== 43708 -IHNpdHQ= 43709 -IGV2ZXJsYXN0aW5n 43710 -IGVzdGF2YW0= 43711 -INC80LjQug== 43712 -IGtow6Fj 43713 -IGludml0 43714 -IHRyZWJsZQ== 43715 -IGppZw== 43716 -bWFuaQ== 43717 -IHR1dm8= 43718 -IFJVUw== 43719 -IEVyZGU= 43720 -IER6acSZa3VqxJk= 43721 -IGJsdWViZXJyaWVz 43722 -a2VsbA== 43723 -YWNpb25z 43724 -54i3 43725 -0LLQuA== 43726 -TEVU 43727 -IHNwcm91dA== 43728 -IHNwb3I= 43729 -IGLDqm4= 43730 -IE1vbmE= 43731 -IENvbnRhaW4= 43732 -IEtleXM= 43733 -0L7Qt9GP 43734 -IGZ1bmNpw7Nu 43735 -IHJhcHBlbGxl 43736 -IGV2b2x2ZXM= 43737 -IHNjcmFwaW5n 43738 -IGNvbWVudMOhcmlvcw== 43739 -IHByYXRpcXVl 43740 -IGF1eGlsaWFyeQ== 43741 -IFNwb25nZQ== 43742 -0YHQutC40Lw= 43743 -dXZv 43744 -INGB0LDQvNC+ 43745 -IHNhbms= 43746 -IGhpZ2h3YXlz 43747 -IGludmVudGlvbnM= 43748 -INC40L3QvtCz0LTQsA== 43749 -IGNyZWF0aXZlbHk= 43750 -IGJlbmNobWFya3M= 43751 -b25jw6k= 43752 -YWxhbA== 43753 -IHNvdHRv 43754 -IGNhbHZlcw== 43755 -IE1vdg== 43756 -IGxhdmVuZGVy 43757 -IGV5ZWJhbGxz 43758 -IGF3YWl0aW5n 43759 -IFBhdHk= 43760 -2YTZhw== 43761 -IGVtYnJvaWRlcnk= 43762 -IGR1aA== 43763 -IGNhbWFy 43764 -IEJPQg== 43765 -IHNwYWNlZA== 43766 -IGfFgm9z 43767 -0LDQtdC80YHRjw== 43768 -IGVzY2FwZXM= 43769 -IFJvZ3Vl 43770 -emN6 43771 -6J4= 43772 -rOulvA== 43773 -IE1vxbxl 43774 -INC10YHRgtC1 43775 -IEJ1cmFkYQ== 43776 -6Yyy 43777 -d2Q= 43778 -dXV1dQ== 43779 -IHNhc2g= 43780 -IEx1Yg== 43781 -IG5vdGVib29rcw== 43782 -IG1hZQ== 43783 -IGNvbmZsaWN0aW5n 43784 -IHN1bW1lcnRpbWU= 43785 -YWNhcw== 43786 -IGJhdWVu 43787 -Ymxvd2luZw== 43788 -4bqhbw== 43789 -IOyWuOygnA== 43790 -5LuK5pel44Gv 43791 -IFNlbmhvcg== 43792 -IGlQaG9uZXM= 43793 -IFF1YXJ0ZXI= 43794 -IOygnOuMgOuhnA== 43795 -dcOf 43796 -IOuniOustOs= 43797 -IHNldHRsZXJz 43798 -IGNyZXN0 43799 -IHRyYW5zYw== 43800 -5pu+ 43801 -IHJpb3Rz 43802 -IGNsb25lcw== 43803 -IE9wcmFo 43804 -zq/Otg== 43805 -IHBhbHM= 43806 -Li4uLi4uLg== 43807 -44GU44GW44GE44G+44GZ 43808 -INGA0L7RgdGB 43809 -IExhc2Vy 43810 -IHphY3p5 43811 -IHNldmk= 43812 -IHJlZ2VuZXJhdGlvbg== 43813 -7Je8 43814 -d291bGQ= 43815 -IMO8emVyaW5l 43816 -IFN0cmHDn2U= 43817 -IHZlbmdlYW5jZQ== 43818 -IHJlcg== 43819 -IFNhZmFyaQ== 43820 -IEhFWQ== 43821 -55Wr 43822 -IHNhY2Fy 43823 -IGltYWdlbQ== 43824 -IEJ1bmRlc3Q= 43825 -bWVzYW4= 43826 -IFBhc3Rl 43827 -IHNpeno= 43828 -INC/0L7RgdGC0YPQvw== 43829 -15TXlQ== 43830 -dHJhZA== 43831 -IGZyYW7Dp2Fpc2U= 43832 -IEJvdQ== 43833 -IGJhcnJl 43834 -IFpoaQ== 43835 -IEdlZXo= 43836 -aWhhZA== 43837 -IHJlY29ub2M= 43838 -IHBlbGln 43839 -IGluZGljZXM= 43840 -IOuwlOuA 43841 -IGNvbmR1Y3Rpb24= 43842 -IOyVhQ== 43843 -IHpla2Vy 43844 -IGZ1bQ== 43845 -IFfDvHI= 43846 -YnJlYWtlcg== 43847 -IHNwcml0ZQ== 43848 -Q3Jvd2Q= 43849 -IG9wZW5lcg== 43850 -IG9sdg== 43851 -IGJ1ZW5hcw== 43852 -IFNpbGs= 43853 -IEhJTQ== 43854 -a29w 43855 -Y29tcGw= 43856 -IHBvc3Nvbm8= 43857 -s4A= 43858 -IG9zY2lsbGF0b3I= 43859 -IFNpdGg= 43860 -6IOh 43861 -0LDQttC4 43862 -IHJhZnQ= 43863 -aGFsbA== 43864 -IHNjaG5lbGxlcg== 43865 -IGltcG9ydGluZw== 43866 -IGFzc2VtYmxpbmc= 43867 -IHViaXF1 43868 -IGFjdGl2YXRlcw== 43869 -YWNjaQ== 43870 -k5zrpbw= 43871 -IGNvbXBvc2Vycw== 43872 -IEFDTA== 43873 -Q29uZg== 43874 -IOy9mA== 43875 -INC90LXQutC+0YLQvtGA0YvQtQ== 43876 -IGNhbmRpZXM= 43877 -5Yqg5YWl 43878 -IE11c3M= 43879 -4LmD4LiK 43880 -IGR1ZGE= 43881 -0L3QuNC60L7QvA== 43882 -bWVkZW4= 43883 -IOyWtOuVjA== 43884 -IFllc2h1YQ== 43885 -emFn 43886 -aG9kb3U= 43887 -IGFsb3Vk 43888 -IFBhbG1lcg== 43889 -aW1pemU= 43890 -44K344On 43891 -IG1hcml0aW1l 43892 -IGNvbW11bmFs 43893 -IGJhZGdlcw== 43894 -IHJ1Z2J5 43895 -IG1hcnNobWFsbG93 43896 -IGZpZXJ5 43897 -IGFjY291bnRhbnQ= 43898 -IGFibGE= 43899 -IE1vbnJvZQ== 43900 -IEZvbnQ= 43901 -IEJvb3N0 43902 -IEJhcm5lcw== 43903 -YW5zd2Vy 43904 -IEJ1cm5pbmc= 43905 -IOS4jeaYrw== 43906 -IGFuZ2Vm 43907 -IFdlc2xleQ== 43908 -bGxz 43909 -7LU= 43910 -16nXnA== 43911 -aWxpxZtteQ== 43912 -15DXnw== 43913 -YW11cmE= 43914 -IEZ1ag== 43915 -IHBhbmk= 43916 -IFRyb3A= 43917 -YXJiZWl0ZW4= 43918 -IHJ1ZQ== 43919 -IFJhcmU= 43920 -w6RuZ2Vu 43921 -INGB0LzQvtGC0YDQtdGC0Yw= 43922 -INCa0LDRgA== 43923 -IE1UVg== 43924 -Ym9hcmRpbmc= 43925 -XVs= 43926 -IOugiOs= 43927 -c3RhbmJ1bA== 43928 -cGllbHQ= 43929 -IEhhcmR5 43930 -IEVuZ2FnZW1lbnQ= 43931 -IERpZW5zdA== 43932 -IHfDpHJlbg== 43933 -IGZ1ZWdv 43934 -IGVzdHJ1Y3Q= 43935 -IGNhbGFt 43936 -IFJlc3BvbnNl 43937 -IOOChA== 43938 -IE1vaGFtbWFk 43939 -IHJlc2lzdGluZw== 43940 -IGR1cmFudA== 43941 -6IGv 43942 -5Ya1 43943 -IE9MRUQ= 43944 -IHZlcno= 43945 -bcOkbg== 43946 -INmG25I= 43947 -IHBhcmFub2lk 43948 -IEF3YXJl 43949 -IEVuZ2luZWVycw== 43950 -IHByb2NlZHVyYWw= 43951 -IHBlcnNvbm5hZ2U= 43952 -IGZhcmtsxLE= 43953 -6aGG 43954 -Zmxvd2luZw== 43955 -INC80LXRgdGC0LA= 43956 -IEJhcmU= 43957 -aXN0ZW0= 43958 -IHBvY3rEhXRrdQ== 43959 -IHBlcnNvbmFqZXM= 43960 -IOyWtOugtQ== 43961 -rYk= 43962 -INCl0L7RgtGP 43963 -IHVuc2V0dA== 43964 -IEFic29s 43965 -IOG6pXk= 43966 -IE1BWU9S 43967 -0L/QvtC70L3QtQ== 43968 -IGluZm9ybWluZw== 43969 -IGFtcHM= 43970 -0J/RgA== 43971 -IOutlA== 43972 -YWVkYQ== 43973 -INeU15HX 43974 -4bqlbg== 43975 -a2VsaWpr 43976 -IGF0aGVpc3Q= 43977 -IHRyb3V0 43978 -IG5ldWVz 43979 -IE5va2lh 43980 -bWFjaGVu 43981 -IHdob2xlc2FsZQ== 43982 -xLFyZA== 43983 -SW5z 43984 -INGN0L8= 43985 -IHByaWNr 43986 -IEtpbmRlcm4= 43987 -4LiX4Liz 43988 -IGNsYXNzeQ== 43989 -IMOubnQ= 43990 -IFNob3BpZnk= 43991 -INGB0L7RgA== 43992 -INC30LDQutGA0Ys= 43993 -enVr 43994 -IHVuaXZlcnNhbGx5 43995 -IHRlYXNwb29ucw== 43996 -IHJlY291bnQ= 43997 -IG7DpWdvbnRpbmc= 43998 -IFh1ZQ== 43999 -aXNpw6htZQ== 44000 -IHdlYWtlc3Q= 44001 -IHRlxZ9la2vDvHI= 44002 -IG1hdGhlbWF0aWNhbGx5 44003 -IEhvcw== 44004 -IO2VnOuLpA== 44005 -IHBhcnRhZ2Vy 44006 -IERhcnI= 44007 -6ro= 44008 -IM61zro= 44009 -IGdlcm1z 44010 -IGdlbGly 44011 -IGR1bA== 44012 -LC0= 44013 -IOyWuOs= 44014 -INee16Y= 44015 -INGP0YA= 44016 -IHF1b3RpZA== 44017 -IHByenlzeg== 44018 -IGhhcmRuZXNz 44019 -IGFxdWF0aWM= 44020 -IEp1bmdsZQ== 44021 -IFBDUg== 44022 -IEVsaW90 44023 -IG9zdHI= 44024 -IG1hcGE= 44025 -ZXNzw6Q= 44026 -IEdJUg== 44027 -IERyaXZpbmc= 44028 -IFNhbWk= 44029 -IE1lZGllbg== 44030 -IENvbXBhbmllcw== 44031 -IFBoYXJt 44032 -c2VpdHM= 44033 -IFJpbQ== 44034 -IM6/z4DOvw== 44035 -IHdlaXRlcmVu 44036 -IHBpenphcw== 44037 -IEx5ZGlh 44038 -IEhlaWdodHM= 44039 -IHNpbmNlcml0eQ== 44040 -IG5vc3Nhcw== 44041 -IGTFgg== 44042 -IGFsYXJtaW5n 44043 -IENhdWM= 44044 -INGB0LzRi9GB 44045 -ZmFjaW5n 44046 -YmFncw== 44047 -V1c= 44048 -INi02Yo= 44049 -IGNvdXJ0cm9vbQ== 44050 -IFBoaWxsaXA= 44051 -IOqyg+yymOufvA== 44052 -IFNwaWVsZXI= 44053 -44KP44GL 44054 -IGthbnQ= 44055 -IGFkbWl0dGluZw== 44056 -44OB44Oj44Oz44ON44Or 44057 -IGNvbnRhaW5tZW50 44058 -5byg 44059 -IHJlbW92YWJsZQ== 44060 -IGp1bXBlcg== 44061 -Zm9jdXNlZA== 44062 -INC40YLQvtCz0LU= 44063 -INCi0LXQvA== 44064 -IHZhc2U= 44065 -IFVTQw== 44066 -IE1vbmF0ZQ== 44067 -IEphY29icw== 44068 -IEhPTA== 44069 -aWtlZA== 44070 -ZXJ3ZWlzZQ== 44071 -IGdvb2RpZXM= 44072 -IGhvbWFnZQ== 44073 -15vXqdeZ15U= 44074 -IHF1YWlz 44075 -IGluaWNpYWw= 44076 -IGd1YXJkaW5n 44077 -IGRheno= 44078 -IGNvbWJvcw== 44079 -INGD0L/RgNCw0LI= 44080 -IFRhbGVudA== 44081 -5aWH5oCq 44082 -IMOzcg== 44083 -IGludGVybWl0dGVudA== 44084 -IE1jQ2FydGh5 44085 -IHNwYW5z 44086 -IHR5cmU= 44087 -IHF1eQ== 44088 -6IiI 44089 -anV0 44090 -IFplbnQ= 44091 -IGdhdA== 44092 -5aSn5ZOl 44093 -IHNjYWZmb2xk 44094 -IG5lY2VzYXJpbw== 44095 -IFphaGxlbg== 44096 -IFNBTkQ= 44097 -IFBV 44098 -RXZlcnl0aGluZw== 44099 -LS0tLS0tLS0tLS0tLS0tLQ== 44100 -INCy0LfRj9GC0Yw= 44101 -IHNwYXJrcw== 44102 -IHBlbmR1bHVt 44103 -157Xnw== 44104 -IOyDieq5 44105 -IG11bHRpcGxpZXI= 44106 -INC70LDQtNC90L4= 44107 -dXJhdA== 44108 -IHVwc2V0dGluZw== 44109 -6KGA 44110 -YmFr 44111 -IOy1nOuMgA== 44112 -IGFuw6Fs 44113 -IEpPRQ== 44114 -IGtvc3Rlbg== 44115 -IFBhdHR5 44116 -IEd1aW4= 44117 -Y2tlZA== 44118 -IEVneXB0aWFucw== 44119 -IENpdGl6ZW5z 44120 -16jXmw== 44121 -INCV0YnQtQ== 44122 -INC50L7Qs9C+ 44123 -IHNub3dmbA== 44124 -IGxla2tlcg== 44125 -IGFjb3N0 44126 -IEJhYmU= 44127 -IGdhbWJsZQ== 44128 -IGFkamVjdGl2ZQ== 44129 -0LrQuNC80Lg= 44130 -b3lz 44131 -IG1vbnRyZQ== 44132 -IEh5dW5kYWk= 44133 -IG1vaXN0dXJpemluZw== 44134 -IG1venphcmVsbGE= 44135 -T09P 44136 -IGZhY3VsdA== 44137 -IGRvZXQ= 44138 -IGZlYXJsZXNz 44139 -IGVzcHJlc3Nv 44140 -IGFsbG9yYQ== 44141 -IENpbmM= 44142 -44O844K4 44143 -IGNvbnRlw7pkbw== 44144 -IFBlbG9zaQ== 44145 -IG1pbmRlcg== 44146 -cm9vdA== 44147 -IO2VoOs= 44148 -INC/0LDQtA== 44149 -IENhbGxpbmc= 44150 -IENvbmZpZw== 44151 -IENvbnNvbGU= 44152 -aW5za3k= 44153 -w6luZXJnaWU= 44154 -IHNvbGl0YXJ5 44155 -0L7QtNC1 44156 -IGd1YXJkZWQ= 44157 -MTYw 44158 -INC/0YHQuNGF 44159 -IFNoYXA= 44160 -IHRpdHJl 44161 -b2xvZ25l 44162 -INC/0LDRgNGD 44163 -IFBSRQ== 44164 -44O844OJ 44165 -IGxu 44166 -IE1pdGds 44167 -IENhcnJ5 44168 -IHNwaW5k 44169 -IENhbnRvbg== 44170 -IGtpbmdkb21z 44171 -cmVtbw== 44172 -IHJhZ2luZw== 44173 -IGluY2FwYWJsZQ== 44174 -IFdS 44175 -5YaN6KeB 44176 -INGB0L7QsdGB0YLQstC10L0= 44177 -INC60LDQutC40YU= 44178 -IFNIRQ== 44179 -64u57Z6I 44180 -IHNjYXJjaXR5 44181 -IHBlcmRl 44182 -IGV4aXRz 44183 -IFNpbmdlcg== 44184 -IHN1cHBlcg== 44185 -IG11bmljaXBhbGl0eQ== 44186 -IERpdmVyc2l0eQ== 44187 -IHRpcm8= 44188 -aWVscw== 44189 -IGzDrWRlcg== 44190 -IGJsdWZm 44191 -IGF0cmE= 44192 -bHlz 44193 -IG1haGQ= 44194 -IGPDs2RpZ28= 44195 -IEhhcmxlbQ== 44196 -cnVsZQ== 44197 -aWNpdHk= 44198 -IHNpbXBsaXN0aWM= 44199 -IEtvbnN0 44200 -5YGl 44201 -RUxMSQ== 44202 -IGbDtnJzdGE= 44203 -IGNvbnN0aXR1dGVz 44204 -INGB0YLQvtGA0L7QvdGD 44205 -IHVyZ2Vk 44206 -IFBhbmRh 44207 -7LCo6w== 44208 -cmVjZQ== 44209 -IHBhdHJpb3Q= 44210 -IENydXNo 44211 -IHdpbms= 44212 -0L7QudGC0Lg= 44213 -dXJhbsOnYQ== 44214 -IHNlaXp1cmVz 44215 -IGVsZWN0cm9k 44216 -IERvbmtleQ== 44217 -IElV 44218 -IE1PUw== 44219 -IGFsa2Fs 44220 -7LSJ 44221 -YmVzb25kZXJl 44222 -IHBhcmFsbGVscw== 44223 -IGJpdHRlcm5lc3M= 44224 -w6R0dHJl 44225 -ZXNzaW9uYWw= 44226 -IHNveWJlYW4= 44227 -IGNvbGxhYg== 44228 -IFJlcG9ydGluZw== 44229 -5aeU 44230 -INC60L7QvNC/0LDQvdC40Lg= 44231 -IHdzenlzY3k= 44232 -IENydW5jaA== 44233 -aXNlZW4= 44234 -IGFtYmFzc2Fkb3Jz 44235 -IENoZXY= 44236 -5Y2I 44237 -0L7QstGL0LU= 44238 -c2Nh 44239 -INGA0LXRiNC40Ls= 44240 -0L7RgtC+ 44241 -IGdsZWljaHplaXRpZw== 44242 -bWVybg== 44243 -w7xzdA== 44244 -IEhhZQ== 44245 -s7TqsqDsirXri4jri6Q= 44246 -IHNob3Jlcw== 44247 -IGRlcHJlc3M= 44248 -IGFob3I= 44249 -IFN0ZXVlcg== 44250 -YWho 44251 -IHJldmlzZQ== 44252 -INGB0LDQvNGL0LU= 44253 -amF0 44254 -IGhlcmJhbA== 44255 -IGN1w6FudA== 44256 -IGJ1bmE= 44257 -bmllanN6ZQ== 44258 -RmluYWxseQ== 44259 -15XXlg== 44260 -Y2pl 44261 -IOyeiOqxsOuToOyalA== 44262 -IOuCmOuI 44263 -IHByemVzdA== 44264 -44O844Og 44265 -bGljYQ== 44266 -IER1Y2g= 44267 -5bCN5bCN 44268 -0ZbQudGB0Yw= 44269 -cGFzc2Vu 44270 -IHNhdGlzZmllcw== 44271 -IEFkZGl0aW9uYWw= 44272 -IGPDoW1hcmE= 44273 -0LXRh9C10L3QuNC1 44274 -IHBvbXA= 44275 -IOunkOydtA== 44276 -IE1pbGxz 44277 -0LXQstC40LQ= 44278 -IHJlc3BlY3RhYmxl 44279 -IGZpbGFtZW50 44280 -IHZlbmRlcg== 44281 -IG1hdHRlcmVk 44282 -b3VyZQ== 44283 -7Li1 44284 -S29yZWFu 44285 -IGVzdHVkaW8= 44286 -IGNhY3R1cw== 44287 -IFZpdmU= 44288 -IFJhZw== 44289 -IGNvbXBsaXF1w6k= 44290 -INmI24E= 44291 -IHRhbw== 44292 -pr8= 44293 -U2luY2U= 44294 -IGplb3BhcmQ= 44295 -IFNlbGw= 44296 -5bqU 44297 -IOyYmw== 44298 -IGtldG8= 44299 -IGludGVsaWc= 44300 -IEFuZ2Vi 44301 -IHRpZGVu 44302 -IHNvY2lv 44303 -IHJlbWluaXNjZW50 44304 -IGNhcmVnaXZlcg== 44305 -U3BhY2U= 44306 -IEV4ZXJjaXNl 44307 -IEJlY29tZQ== 44308 -w6p0cw== 44309 -YWtr 44310 -IS4u 44311 -INGB0L/RgNC+0YE= 44312 -IM6xz4DOvw== 44313 -IHNob290aW5ncw== 44314 -IGFwZQ== 44315 -IFNhbW15 44316 -IEt1bmc= 44317 -IGN1w6Fs 44318 -IEx1cA== 44319 -5p2f 44320 -5L6G5Yiw 44321 -INGB0YLRg9C0 44322 -IHN3ZWV0ZXI= 44323 -IGNvbXVt 44324 -IEFkcw== 44325 -aHl1bmc= 44326 -INCx0YPQtNGD0Yk= 44327 -IHdhZmZsZQ== 44328 -IE9yYg== 44329 -IGxhdXQ= 44330 -IGZvcmVjYXN0aW5n 44331 -5ao= 44332 -IHJhcHBpbmc= 44333 -IHByZWZlcnM= 44334 -IGJlbno= 44335 -IG5paw== 44336 -IEJhaG4= 44337 -IHNhbmRpbmc= 44338 -IGltbWluZW50 44339 -INC/0YDQvtCx0LvQtdC80Ys= 44340 -IGRvaXZlbnQ= 44341 -0L7Qu9Cw 44342 -IMW8eWNpYQ== 44343 -aWh1 44344 -IGV4aXN0ZW0= 44345 -IEludGVyaW9y 44346 -IFRha2Vz 44347 -IHRvZGRsZXI= 44348 -IGRpY3RhdG9yc2hpcA== 44349 -IFNtaXRoc29u 44350 -IEFsbGFodQ== 44351 -z47Pgc6x 44352 -7JWY7Iq164uI64uk 44353 -IFZvdGU= 44354 -IFNtZWxscw== 44355 -0L7QtNC90L4= 44356 -IGhpbmRzaWdodA== 44357 -VlI= 44358 -IFBhdGNo 44359 -IEphaHJlcw== 44360 -IHNvdXZlbmly 44361 -IG5ldXRyb24= 44362 -IGxvbmd0aW1l 44363 -IHNheWlu 44364 -5LmQ 44365 -YXNha2k= 44366 -INC+0YHRgtCw0L3QvtCy 44367 -IGV4cGVsbGVk 44368 -IGNyeXB0b2N1cnJlbmNpZXM= 44369 -IE11cmRlcg== 44370 -IENpdGl6ZW4= 44371 -V0FZ 44372 -IHBsdQ== 44373 -IGxlbW9uYWRl 44374 -IGNvbnZlbmllbnRseQ== 44375 -IEhJ 44376 -IDIwMjM= 44377 -16nXldeq 44378 -0LDRhtC40L7QvQ== 44379 -IOubsA== 44380 -INmE2YPZhg== 44381 -INC90LXQvNC90L7QttC60L4= 44382 -IHVudXNlZA== 44383 -IG1haW9yaWE= 44384 -IGFzdHJvbG9neQ== 44385 -IERvd250 44386 -Tmljaw== 44387 -IHByZW9jY3Vw 44388 -IGRlbWFpbg== 44389 -157Xog== 44390 -INCy0L7QtNGL 44391 -IFNhbnNrcml0 44392 -IHByw6p0 44393 -IHN0cmFuZGVk 44394 -IHJlZmlu 44395 -INC/0YDQuNC90LjQvA== 44396 -INC/0L7QstC10YDRhQ== 44397 -4K+NPw== 44398 -IHpyb2I= 44399 -IGludGVydHc= 44400 -IERhdmlkc29u 44401 -0LvQtdC90LA= 44402 -INC/0L7QvdGP0YLRjA== 44403 -IFJlbm8= 44404 -INC/0L7Qu9GD0YfQuNC70L7RgdGM 44405 -IGNvcnJlc3BvbmRlbnQ= 44406 -IFVyYW4= 44407 -ZWxzZQ== 44408 -wrfCtw== 44409 -IHR1dG9yaW5n 44410 -IGdyYW5kZGF1Z2h0ZXI= 44411 -bHVkZWQ= 44412 -IHN0ZXNzbw== 44413 -IGjhur90 44414 -IGdlZ2FuZ2Vu 44415 -INCd0JA= 44416 -IGFudGln 44417 -YmFja2dyb3VuZA== 44418 -IGdlZGFhbg== 44419 -IGZhdm9yZWQ= 44420 -IEVtbWFudWVs 44421 -IGlvZA== 44422 -IGNsYW1wcw== 44423 -IGNvbXBsZQ== 44424 -IEFkdmFuY2U= 44425 -IOyeiOqzoOyalA== 44426 -IFJveA== 44427 -IOyXkOs= 44428 -IGludGVzdGluZXM= 44429 -IHBlcmN1c3Npb24= 44430 -IGxlZ2l0aW1hdGVseQ== 44431 -IEV0ZXJuYWw= 44432 -ZmFtaWx5 44433 -YWxvZw== 44434 -QnJhZA== 44435 -0LXQvdC40YLRjA== 44436 -INGB0L3QsNGH0LDQu9Cw 44437 -IGNlcnRh 44438 -IGFra29y 44439 -IM61zrTPjg== 44440 -IG9jdGF2ZQ== 44441 -IFZhYw== 44442 -0LzQvtGC0YDQuA== 44443 -IMOJdGF0cw== 44444 -IGxvbmd1ZQ== 44445 -IGRpc3NvY2k= 44446 -0YDRj9C0 44447 -aGVpbg== 44448 -IHBhbnRhbGxh 44449 -IGluZGljYXRpb25z 44450 -IEx0 44451 -IEdyYWRl 44452 -6KOd 44453 -b2luZQ== 44454 -YnVn 44455 -IFZlcml6b24= 44456 -IEFsw6lt 44457 -IHZpZW5uZW50 44458 -INGH0LjRgdGC 44459 -IEJlbmk= 44460 -IFRzY2g= 44461 -IFRQ 44462 -IGluc3VsdGluZw== 44463 -IFdlaWdodA== 44464 -IGFkYXB0YXRpb25z 44465 -IGhhYsOtYW4= 44466 -IGNsaXF1ZQ== 44467 -b8WbY2k= 44468 -anVuYQ== 44469 -IHN1Y2hlbg== 44470 -IEdvZXM= 44471 -IEV4b2R1cw== 44472 -Q2hv 44473 -IGFudGlz 44474 -IO2MjOs= 44475 -c2V2ZW4= 44476 -INGH0LDRgdC+0LI= 44477 -IGJhbGxpc3RpYw== 44478 -em9ueQ== 44479 -SUNJQQ== 44480 -INC/0YDQtdGB0YI= 44481 -IHNpbXBsZXNtZW50ZQ== 44482 -IENvbGxhYm9y 44483 -RnJlZA== 44484 -INGC0LXQu9C10YTQvtC9 44485 -IFJhdmk= 44486 -7ZW07KQ= 44487 -0L/QtdGA0LI= 44488 -IOyeiOycvOuLiOq5jA== 44489 -IMOzdA== 44490 -IGFsZWc= 44491 -w7pw 44492 -IGRpc3JlZ2FyZA== 44493 -IGluZGVudA== 44494 -Y2xvdWQ= 44495 -Y2hsYWdlbg== 44496 -IGl0ZXJhdGU= 44497 -IGdlbmVyYWxpemVk 44498 -44GX44G+44GX44Gf 44499 -4KS5 44500 -ZWxlcmk= 44501 -IGRpc2FzdHJvdXM= 44502 -INGB0YLQsNC70LA= 44503 -s5E= 44504 -S05PV04= 44505 -IHJpY2huZXNz 44506 -IGNvbnNjaWVudA== 44507 -aWNodHM= 44508 -INGN0LvQtdC8 44509 -2KjYrw== 44510 -aXJlbnM= 44511 -IGhhdW50aW5n 44512 -cnVjdHVyZXM= 44513 -YXR0YWNr 44514 -IGN1cGNha2Vz 44515 -c3F1ZQ== 44516 -IG5hc3plZ28= 44517 -IGFudGhyb3BvbG9neQ== 44518 -44Gf44Gg 44519 -44G144G1 44520 -Y2hhZQ== 44521 -IGRpc2NvdmVycw== 44522 -IFBlcnNvbmFsaXR5 44523 -IM6kzr8= 44524 -IGRpxJ9lcg== 44525 -5Y2A 44526 -INC90LXRkQ== 44527 -IEFuaXRh 44528 -IFvimao= 44529 -IENhcm0= 44530 -IEJlbm55 44531 -7Iqs 44532 -IHB1cGls 44533 -IG9jYXM= 44534 -w6RsbGV0 44535 -asWbxIc= 44536 -5aSn5LiI5aSr 44537 -YW1lbnRhbA== 44538 -INC+0YLQvdC+0YE= 44539 -IHBpZA== 44540 -IGFybXA= 44541 -UkVF 44542 -INC+0YLQutGA0YvQsg== 44543 -IHVkYQ== 44544 -IFN5bmRyb21l 44545 -IFN0YW5kYXJkcw== 44546 -44GI44KL 44547 -IHBvaW50ZXJz 44548 -IGVuYW0= 44549 -IFRpZw== 44550 -w616 44551 -INC90LDQvNC4 44552 -IHVuY2hhbmdlZA== 44553 -IHR1cm1vaWw= 44554 -4bupbmc= 44555 -ISEi 44556 -NTAwMA== 44557 -IOusvOyWtOs= 44558 -IG1lcmdpbmc= 44559 -IGVudHNjaGVpZGVu 44560 -5Ye65p2l 44561 -Zm9ybWU= 44562 -IHRyaW1tZWQ= 44563 -IGRhcmVk 44564 -IGFzcGlyYXRpb24= 44565 -IE15dGhpY2Fs 44566 -IEhlag== 44567 -IEFsZWo= 44568 -0YbQvg== 44569 -0L7RgtGD 44570 -WmU= 44571 -INC40L3RgdGC0YDRg9C80LXQvdGC 44572 -IFJUWA== 44573 -IGxvY2FsaXplZA== 44574 -55qE6K+d 44575 -IHN1cnJvdW5kcw== 44576 -IGVtcGllemE= 44577 -IGNsYXNl 44578 -IOC4gQ== 44579 -IFJhcGlk 44580 -b21pbm91cw== 44581 -aWdhaWw= 44582 -INGI0LjRgA== 44583 -IGzDpg== 44584 -IHphc2Fk 44585 -IHVuZm9sZGluZw== 44586 -PyE/IQ== 44587 -IOyInOqwhA== 44588 -IFBvbHNraQ== 44589 -IEthdWY= 44590 -IENlbHQ= 44591 -aXRpYw== 44592 -IHRvb2xib3g= 44593 -IFBvY2tldA== 44594 -IOyEnOuhnA== 44595 -IGJlbGtp 44596 -IGFkbWlyYXRpb24= 44597 -cGhy 44598 -IFByb2R1a3Q= 44599 -IFRydWNr 44600 -44GO 44601 -IGRyYXXDn2Vu 44602 -d2HFgg== 44603 -IEhlYnJld3M= 44604 -IO2VmOqyjA== 44605 -IEFDRQ== 44606 -dXJnZW5jZQ== 44607 -YXVyYWlz 44608 -IGNoYXJpdGFibGU= 44609 -xLF0 44610 -IGFybWFz 44611 -IEdlZGFua2Vu 44612 -cmVhdGluZw== 44613 -cG9ydGU= 44614 -IGltcHJpbnQ= 44615 -ZsOkaA== 44616 -INC/0L7QtNGF0L7QtA== 44617 -IG91dHNldA== 44618 -4Lin4LiB 44619 -0LXQvdC90L7Qs9C+ 44620 -Q2xhc3M= 44621 -IHZhbml0eQ== 44622 -IFZPSUNFUw== 44623 -IDI2MA== 44624 -cmVzaWRlbnQ= 44625 -VVNF 44626 -IOqwgOyatOuNsA== 44627 -6b0= 44628 -IHRocm91Z2hwdXQ= 44629 -IGN1bWE= 44630 -7Jqx 44631 -44O844Oz 44632 -INC/0LvQvtGJ 44633 -IHBhcnRpcw== 44634 -IEFuaW1hdGlvbg== 44635 -p4jr 44636 -Q3Jl 44637 -w7Z0emxpY2g= 44638 -IG1hZ2c= 44639 -IGNsdW1zeQ== 44640 -IGJvdHRsZW5l 44641 -IGJpcmxpa3Rl 44642 -IEdhbWI= 44643 -INeb158= 44644 -IG1ldHJvcG9saXRhbg== 44645 -6K+l 44646 -5o6S 44647 -T29o 44648 -IG9iamVjdGlvbnM= 44649 -INmF2Ko= 44650 -INC80LXQuw== 44651 -IHJlbW5hbnRz 44652 -IFhhdmllcg== 44653 -UmljaA== 44654 -IG9sc2E= 44655 -IFBpbGw= 44656 -IGdyb2Fucw== 44657 -IE5hcnVob2RvdQ== 44658 -IENvbnRyYWN0 44659 -0LDQtNCw 44660 -bmFp 44661 -INGE0LjQtw== 44662 -IG9wcw== 44663 -4bqhdA== 44664 -IHBhcmFjaHV0ZQ== 44665 -IG5lbGw= 44666 -IEVudHNjaGVpZHVuZw== 44667 -15zXmded 44668 -IHRydXRoZnVs 44669 -IHNoYXJwZXI= 44670 -IGJ1cmVhdWNyYWN5 44671 -Y2FydA== 44672 -INC40L3Rgg== 44673 -d2llaw== 44674 -IHdpbGxpbmdseQ== 44675 -IEhlcm1hbg== 44676 -IG1laHJlcmU= 44677 -IGVsaXRlcw== 44678 -IEFybW9y 44679 -44OI44Of44O8 44680 -IGVtYm9yYQ== 44681 -IFJlY29nbg== 44682 -INC70Y7QsdC70Y4= 44683 -IEV4Y2VsbGVuY2U= 44684 -aWJlbA== 44685 -IGV4cG9ydGluZw== 44686 -7LK07KCB 44687 -S2VsbHk= 44688 -Q2FtZXJhbWFu 44689 -IHNsaXBz 44690 -IGZpZ3VyYQ== 44691 -IOOBoQ== 44692 -IGtvbGw= 44693 -IFBhbmRlbWll 44694 -54+t 44695 -IHRpbWVk 44696 -bGllw59saWNo 44697 -INee15s= 44698 -IHBlcsOtb2Rv 44699 -5b+X 44700 -aXZhdA== 44701 -IHF1ZXN0aW9ubmFpcmU= 44702 -IHDDqXJpb2Rl 44703 -56m2 44704 -IHNpZ2hz 44705 -IGFsbGVnaWFuY2U= 44706 -IFhW 44707 -IEtlbnN1a2U= 44708 -IEdlc3VuZGhlaXRz 44709 -IHBvc2l0aXZv 44710 -IEphbmVpcm8= 44711 -IFNFRQ== 44712 -INin2LPYqg== 44713 -IEtlbHNleQ== 44714 -dG9iZXI= 44715 -IM6xzrvOu86s 44716 -IFBhcmVudA== 44717 -IERheXRvbg== 44718 -IEJpbGRlcg== 44719 -b3VyYWdl 44720 -IHNlcmVz 44721 -IG11Y2jDrXNpbW8= 44722 -IFJlYWxt 44723 -IE9GRklDRVI= 44724 -ZXJzb25pYw== 44725 -44KC44Gu 44726 -b255YQ== 44727 -IOq4iQ== 44728 -IGFuY2VzdHJ5 44729 -IEp1cmFzc2lj 44730 -IGNlbnRpZ3JhZGU= 44731 -4bqldQ== 44732 -dWrEhWM= 44733 -bWFucw== 44734 -IHRpbw== 44735 -IE1vxbw= 44736 -IHRyYWdlbg== 44737 -IHN0YXJlZA== 44738 -IHNjaGVtYXRpYw== 44739 -IHBhc3NvdQ== 44740 -IG1lYXRiYWxscw== 44741 -xYJvxZvEhw== 44742 -IHN5bmNocm9ub3Vz 44743 -IHBlcm1pcw== 44744 -YXJpYWw= 44745 -IHplcg== 44746 -IHBhcml0eQ== 44747 -IEF2YXRhcg== 44748 -aW5kZWVy 44749 -ZXN0b24= 44750 -IG1laWTDpG4= 44751 -IENseQ== 44752 -tIk= 44753 -IGVzdHJvZ2Vu 44754 -IGNlbnRpbWV0 44755 -55m6 44756 -IGNvbnZpY3Rpb25z 44757 -IHBvc3NpYW1v 44758 -IHBlcmR1 44759 -IHBhdGhvZ2Vucw== 44760 -IFF1aW4= 44761 -IFByb2dyYW1z 44762 -IFBvaW50cw== 44763 -cmFtZW50 44764 -cmFpbA== 44765 -IHZ5 44766 -IGdyYWZ0 44767 -IGJhcnQ= 44768 -IExvdHVz 44769 -4Kg= 44770 -IOuztOyLnA== 44771 -cmFtZXI= 44772 -RmF0aGVy 44773 -IOucuw== 44774 -INeU150= 44775 -IHRyYXplcg== 44776 -IHRhcms= 44777 -w6hjZXM= 44778 -Zm9ydGg= 44779 -INGB0LTQtdC70LDQu9C4 44780 -IHp1Y2NoaW5p 44781 -IHdha3R1 44782 -IGVudGVydGFpbmVk 44783 -IE1pbGxpYXJkZW4= 44784 -IHNoYWt5 44785 -IHByemVkZQ== 44786 -uIzr 44787 -IHJldmVyc2libGU= 44788 -IE5BVQ== 44789 -dWlucw== 44790 -w6lyw6p0 44791 -YW5uZW4= 44792 -IEh1bnRpbmc= 44793 -IEZlbGxvdw== 44794 -w6lsaW9y 44795 -IHJvdGF0aW9ucw== 44796 -IGdyYW5ueQ== 44797 -eHRvbg== 44798 -INGB0YLQsNC90L7QstC40YLRgdGP 44799 -INC90LDRh9Cw0Ls= 44800 -IGFydGVyaWVz 44801 -cmnDsw== 44802 -INC/0L7Qu9GM0LfQvtCy 44803 -INCR0Ys= 44804 -IG5vdmVsdHk= 44805 -cG91bmQ= 44806 -IHdlaXJkZXN0 44807 -IGJvaXM= 44808 -w6ltaWU= 44809 -dXBs 44810 -QVRB 44811 -IHRlaGQ= 44812 -IE5pcg== 44813 -c8SxbsSxeg== 44814 -ISIs 44815 -5ZGK6K+J 44816 -IGltbW9ydA== 44817 -IGVsaw== 44818 -0LDQvdC40Yc= 44819 -IGZhYnJpY2F0aW9u 44820 -IE5vaXNl 44821 -IEF2YW50 44822 -2LHbjA== 44823 -d2F0 44824 -IHdob29zaGluZw== 44825 -INeb15k= 44826 -INCX0L3QsNGH0LjRgg== 44827 -IGNlbnRyaWY= 44828 -YW5zaW5n 44829 -U291bmQ= 44830 -IOudvOs= 44831 -IGNhcHRpb25z 44832 -4LON 44833 -IG9yZ2Fz 44834 -IGRvbHBoaW5z 44835 -IEJsZW5k 44836 -IFRhag== 44837 -IENDVFY= 44838 -IGlub20= 44839 -IGVkaXRpb25z 44840 -IGJ1cm5vdXQ= 44841 -IGLDpHR0cmU= 44842 -IENhc2E= 44843 -b3ZpY2g= 44844 -IG1vbHRlbg== 44845 -IGJsaW5kZm9sZA== 44846 -IEd1ZQ== 44847 -5pe26Ze0 44848 -IHNwaW5uZXI= 44849 -IG3DtmdsaWNoc3Q= 44850 -IFbDoA== 44851 -ZW5lY2E= 44852 -IG3DqWRpY28= 44853 -5bm55Zib 44854 -w6FzdGljbw== 44855 -IGFyZA== 44856 -IFN1bmRheXM= 44857 -IFJlbW90ZQ== 44858 -IOyWvOuniA== 44859 -IHRyxrDhu5tj 44860 -7IWo6w== 44861 -IGRvcHA= 44862 -IGJlxJ8= 44863 -aWNhbmE= 44864 -IOuCmOykkeyXkA== 44865 -546H 44866 -IGhvbGluZXNz 44867 -ZGlyZWN0 44868 -IOyYge2ZlA== 44869 -IGN1bHBh 44870 -IFN0aXRjaA== 44871 -bGlnaHRseQ== 44872 -0LDQvNC10L0= 44873 -INC80LXRiA== 44874 -INC/0LXRhw== 44875 -IHlodGU= 44876 -b3NwaGVyZQ== 44877 -IOyTsOuKlA== 44878 -w6lr 44879 -IHNlcmlvdXNuZXNz 44880 -IGdhcm1lbnRz 44881 -IGNvbmNpc2U= 44882 -IFNK 44883 -IHZlcmxvcmVu 44884 -IHBhcmVjZXI= 44885 -IFVOQw== 44886 -7Iqk7YOA 44887 -IGVuZmFudA== 44888 -IGJvbWJlcg== 44889 -IEdpZnQ= 44890 -IOyii+uLpA== 44891 -IHJoeXRobXM= 44892 -IEtsYXI= 44893 -5Lq65rCR 44894 -b3duaWs= 44895 -IFJldmVyZW5k 44896 -IGVtaXR0ZWQ= 44897 -bGFzc2Vu 44898 -IHJldmVuaXI= 44899 -IGFyaXNpbmc= 44900 -IHByZWNpc2FtZW50ZQ== 44901 -IGludGVycG9s 44902 -IFRlbmVtb3M= 44903 -b2JlZA== 44904 -IHRlY25vbG9naWE= 44905 -IG5lcmVkZQ== 44906 -IFZpc2E= 44907 -IHNhdmE= 44908 -IGVzY3JldmVy 44909 -IGFzc2F1bHRlZA== 44910 -IEZsZWlzY2g= 44911 -IENvdW5jaWxsb3Jz 44912 -IOqwgOq5jA== 44913 -IGJlZ2c= 44914 -IERldmVsb3Blcg== 44915 -IEJyb256ZQ== 44916 -IEJvbnVz 44917 -INeo16c= 44918 -ZmFjdA== 44919 -IGVuZGxlc3NseQ== 44920 -IG1hY2Ft 44921 -IHJ6ZWN6eXdpxZtjaWU= 44922 -IGhvdmVyaW5n 44923 -w6hnZQ== 44924 -IHBvb3Jlc3Q= 44925 -IFNjaGVk 44926 -bWlsZQ== 44927 -aXNzZW1lbnRz 44928 -YWPEgw== 44929 -IOumvQ== 44930 -IHZhY2Npbg== 44931 -IGZ1dHVyaXN0aWM= 44932 -IFdpbmRvdw== 44933 -0L/QsNGA 44934 -INGA0L7RgQ== 44935 -IGxvd2Vycw== 44936 -YWNz 44937 -INCQ0LvQtdC60YHQsNC90LQ= 44938 -IEFsZXJ0 44939 -aWVtZQ== 44940 -IENhdWNhcw== 44941 -IGphd3M= 44942 -IGh1bnRlZA== 44943 -7Je9 44944 -INio2YY= 44945 -INec16DXlQ== 44946 -IHR1cmJpbmVz 44947 -IGx1bXBz 44948 -IEFsbGllcw== 44949 -YWhsdA== 44950 -IHN1YnNjcmlwdGlvbnM= 44951 -IG5vdXZlYXV4 44952 -dWdlcg== 44953 -Ym9uZXM= 44954 -IGJlcnJ5 44955 -IOyEoOusvA== 44956 -IE1hbnVmYWN0 44957 -IEx1bmNo 44958 -6re4656Y 44959 -IGh5ZHJhdGVk 44960 -IGFjaGVp 44961 -IFlheg== 44962 -IFRpYmV0YW4= 44963 -IFF1YW50dW0= 44964 -IEplcm9tZQ== 44965 -INC+0YnRg9GJ 44966 -0L7QstCw0L0= 44967 -bW90aW9u 44968 -IENvbnRyb2xsZXI= 44969 -ZW5lcmdldGlj 44970 -INGB0LrQvtGA0L4= 44971 -IHZvd2Vscw== 44972 -INGD0LbQsNGB 44973 -IGhvb2Y= 44974 -IEJ1bGxldA== 44975 -aW1hZ2lu 44976 -16DXmded 44977 -IGVuZ2FnZW1lbnRz 44978 -IEJsdWVz 44979 -IGHDsWFk 44980 -IGZwcw== 44981 -IGNhdGVycA== 44982 -IHPhu5E= 44983 -IFRyaWJl 44984 -57aa 44985 -0L/QvtC9 44986 -aWZlcmF0aW9u 44987 -IHJ1bWFo 44988 -IFB1bmo= 44989 -bGFi 44990 -IGNvbXByZWhlbnNpb24= 44991 -YnJpbmdpbmc= 44992 -V28= 44993 -IHRpaw== 44994 -IGFueWhvdw== 44995 -5Lul5YmN 44996 -w6F0aWNhcw== 44997 -IHNpdHplbg== 44998 -IGtvbGF5 44999 -IENvbmZlZGVyYXRl 45000 -IENhbGxlZA== 45001 -IG5hc3p5Y2g= 45002 -IGR6acSZa2k= 45003 -IGNsb2Fr 45004 -IEdvb2c= 45005 -IEFzaGU= 45006 -6LGh 45007 -ZW5hbg== 45008 -INC80YvRiA== 45009 -INCy0LXRgg== 45010 -IFNwbw== 45011 -IFNrZXQ= 45012 -IEhlbmRlcnNvbg== 45013 -aWxhaA== 45014 -INCx0LXQt9C+0L/QsNGB 45015 -IHNla2FsaQ== 45016 -7Ja06rCA 45017 -IHNuYXJl 45018 -IHLhurFuZw== 45019 -IGbDtnJzw7Y= 45020 -c3p5Y2g= 45021 -IMO8YmVycw== 45022 -IHN0cmF0w6ln 45023 -IOy6kOs= 45024 -IHJhcHBlcnM= 45025 -IGNlcA== 45026 -IEhhc3Rh 45027 -IGhvcnJpYmx5 45028 -IGZyw7xo 45029 -INio2Lk= 45030 -IG1hbnRsZQ== 45031 -44CF 45032 -ZnVuZGluZw== 45033 -IHp1c3Q= 45034 -IFBlbnM= 45035 -c2Vk 45036 -IO2XpA== 45037 -IGdlcmVraQ== 45038 -IGFsYXJtcw== 45039 -IFdoYQ== 45040 -IE1hcmt1cw== 45041 -YWtzaQ== 45042 -INCQ0LvQtQ== 45043 -a2xvcmU= 45044 -IMOpbmVy 45045 -IHRpbGRl 45046 -Ym94aW5n 45047 -IOyEng== 45048 -IGVuY29udHJhbW9z 45049 -IFBoYXI= 45050 -0L3QsNC60L7QvA== 45051 -w7NzdA== 45052 -IMSwcw== 45053 -IOuLmA== 45054 -IHNxdWF0cw== 45055 -IHByZXRlbmRlZA== 45056 -IGRleg== 45057 -IOq0nOywruyVhA== 45058 -amFjaA== 45059 -65286rOg 45060 -IO2ZleynhA== 45061 -IEFuc2No 45062 -aW1lcms= 45063 -IGNvbmp1Z2F0ZQ== 45064 -IHBlbmluc3VsYQ== 45065 -IGdvcmlsbGE= 45066 -IHBob3RvZ3JhcGhlZA== 45067 -IEF1bnF1ZQ== 45068 -IGVudHJlbg== 45069 -IERldXRzY2hlbg== 45070 -IEFsYWRkaW4= 45071 -IOustOyEnA== 45072 -IFN0ZWxsYQ== 45073 -IEVsZWN0aW9u 45074 -b3V0aW5l 45075 -R3JhbmQ= 45076 -IFdhaw== 45077 -IFNlcmdpbw== 45078 -aG9yc2U= 45079 -YWhvbg== 45080 -IEZhbWlsaWVz 45081 -IGhhdGluZw== 45082 -IEJldHQ= 45083 -4LiZ4Liw4LiE4Liw 45084 -IGN1cmxpbmc= 45085 -IElzcmFlbGlz 45086 -INec15DX 45087 -IE15ZXJz 45088 -IHNjYW5uZWQ= 45089 -IEJFQw== 45090 -aWxlcmk= 45091 -IGNhbGxl 45092 -IE1pbmg= 45093 -IG1pY3Jvbg== 45094 -IGNvbmR1Yw== 45095 -w612 45096 -INCy0L7Qt9GM 45097 -IGFjdGlvbmFibGU= 45098 -IFRydXN0ZWVz 45099 -IHRpZWY= 45100 -IGhlYWRlcnM= 45101 -IGFuaW1hbGVz 45102 -7JuA 45103 -0LvQvtGF 45104 -dW5pdHk= 45105 -bHlh 45106 -IGphbmdhbg== 45107 -IGhhbmk= 45108 -IGNhc2luZw== 45109 -IGrDs3ZlbmVz 45110 -IFNwbGl0 45111 -IENhcmxv 45112 -IEJlaW0= 45113 -5bCN5LiN6LW3 45114 -IG51YW5jZWQ= 45115 -IHRlZGR5 45116 -IENsYW4= 45117 -w6RjaGVu 45118 -cGllcg== 45119 -INC00L7Qv9C+0LvQvQ== 45120 -IGRpYXBlcg== 45121 -ZWZmZWN0aXZl 45122 -IE5pYWdhcmE= 45123 -IHdhcnQ= 45124 -IGNvcnJv 45125 -IEthbXBm 45126 -enRl 45127 -IGTDqXZlbG9wcGVtZW50 45128 -IGF0dGFja2Vycw== 45129 -IFNoZXJtYW4= 45130 -IDE5MTQ= 45131 -IG1lb3c= 45132 -IFDDpQ== 45133 -7Lo= 45134 -Y2l0 45135 -IGNvdXBl 45136 -IOq3uOuLpOydjOyXkA== 45137 -IGh1bW91cg== 45138 -IGNvbGU= 45139 -IFdhcm5pbmc= 45140 -IFRpbA== 45141 -Y2FsbQ== 45142 -YnVhdA== 45143 -IGNpbmU= 45144 -a2llag== 45145 -S2V2aW4= 45146 -IG1pbGxpZ3JhbXM= 45147 -15PXqA== 45148 -YXJpYW1lbnRl 45149 -IG9ybw== 45150 -IEhvZA== 45151 -ZXJ0b3M= 45152 -IGxpaGF0 45153 -IGZ1bGxlc3Q= 45154 -IGdyYW5kaQ== 45155 -INCx0L7Qug== 45156 -IHdob2xseQ== 45157 -IG1haGRvbGw= 45158 -IGNvbnRyb2xs 45159 -IEJ1bnVu 45160 -6IqC 45161 -IGRpcHBlZA== 45162 -IHJlZ2nDs24= 45163 -INmE2Yg= 45164 -INCx0LDQsw== 45165 -IHByZW1pZXJz 45166 -IGNo4buL 45167 -IOaJgOS7pQ== 45168 -6LGG 45169 -aWRleg== 45170 -IHF1b3Rh 45171 -IGdoZWU= 45172 -YXJrYW4= 45173 -IGdlbGF0aW4= 45174 -IENsZXJr 45175 -YmJsZXM= 45176 -IFBhaWdl 45177 -IHN0YWdlZA== 45178 -IHNvY2lhaXM= 45179 -IEJpemlt 45180 -IHZlbG9jaWRhZGU= 45181 -IG1hbGFyaWE= 45182 -IHNob3J0ZW5lZA== 45183 -IHNhbHV0 45184 -IEhlaGU= 45185 -IHbhu4s= 45186 -IFRhaXdhbmVzZQ== 45187 -IEFycmk= 45188 -Z3Jlcw== 45189 -5Y675LqG 45190 -KCk= 45191 -cmlhZA== 45192 -kZDr 45193 -IOOBvuOBmQ== 45194 -IG1hc2N1bGluaXR5 45195 -TFA= 45196 -IOuWoQ== 45197 -IHTDqXJtaW4= 45198 -IFbDpA== 45199 -IFNlaXRlbg== 45200 -IHJlc3BlY3RmdWxseQ== 45201 -w6Fv 45202 -IHRvdGFsZW1lbnQ= 45203 -IHNjcmFwcw== 45204 -IGluZnJpbmc= 45205 -IEJvc2U= 45206 -YW1hcg== 45207 -IEx1aXph 45208 -IEFSTQ== 45209 -INC/0LvQvtGF0L4= 45210 -IG1laWxsw6Q= 45211 -IERpb24= 45212 -5byA5aeL 45213 -IHNvdWhh 45214 -IGdlc2NoYWZmdA== 45215 -IGNvbnZvbHV0aW9u 45216 -IOKAkeKAkQ== 45217 -IDE0NA== 45218 -bGluZ3Q= 45219 -IG3DpG5uaXNr 45220 -IGd1c3RhZG8= 45221 -IGNvaW5lZA== 45222 -IEx1bHU= 45223 -5a6D55qE 45224 -b3BvdA== 45225 -IFByYXllcg== 45226 -IHJvYXN0aW5n 45227 -IGNocm9tb3NvbWVz 45228 -6aOv 45229 -0LXQu9C1 45230 -Qmx1ZQ== 45231 -IEVyZm9sZw== 45232 -6Ieq55Sx 45233 -INC/0YDQuNC00YPQvA== 45234 -IHJpc2tpbmc= 45235 -IEd1YXJkaWFucw== 45236 -IDIwMjQ= 45237 -w6hzZQ== 45238 -INCx0YPQtNGC0L4= 45239 -IGNvbnNlcnZl 45240 -IEJyaW5naW5n 45241 -IEFzdHJh 45242 -4LmA4LiC 45243 -INC60LDQutGD0Y4= 45244 -cmVzcGFjZQ== 45245 -INCe0L8= 45246 -INCy0L7QutGA0YPQsw== 45247 -5oWL 45248 -IG1hc2tlZA== 45249 -IFNoeQ== 45250 -IE5pbQ== 45251 -ZW5kYXM= 45252 -IO2PrOyduA== 45253 -IOuqqOyWkQ== 45254 -IHZhbGV1cg== 45255 -IE5lZ3Jv 45256 -IENEcw== 45257 -aW5rbGluZw== 45258 -IG1vbnTDs24= 45259 -IEhvbmQ= 45260 -UmVhbA== 45261 -IGZ1bGxuZXNz 45262 -IFdob29wcw== 45263 -IFNoYW5r 45264 -IEJyYW4= 45265 -IHRyYW5zbHVj 45266 -IGVycg== 45267 -IEdhcmRlbnM= 45268 -b3l1 45269 -IGFmZmlybWF0aXZl 45270 -5LiL5LiA 45271 -IHBvdHRlcnk= 45272 -bGl2ZQ== 45273 -aWF1 45274 -bW91bnQ= 45275 -IGZsdWN0dWF0aW9ucw== 45276 -5Z+O 45277 -w61lbQ== 45278 -IHB1bHNlcw== 45279 -IGNyaWFuw6dhcw== 45280 -zq/Osc+C 45281 -IGJhc3Rh 45282 -RU5OSVM= 45283 -INC60L7RgNC/ 45284 -IEZ1bms= 45285 -IOmAmQ== 45286 -w6VydA== 45287 -INC30LDRgtC10Lw= 45288 -IHBhcmFzaXRlcw== 45289 -44OZ 45290 -IGFpcmZsb3c= 45291 -IFh1YW4= 45292 -R8O8bG1l 45293 -IGJsb29taW5n 45294 -IG11bW15 45295 -IGJhbw== 45296 -IENsYXA= 45297 -YW50aWNz 45298 -c2tpbg== 45299 -Y2VudHJpYw== 45300 -YmVmb3Jl 45301 -IFJJQ0hBUkQ= 45302 -IEhhaG4= 45303 -VEFLRQ== 45304 -INGC0YDQtdGC0Yw= 45305 -IHByZXNzdXJlZA== 45306 -IEt1cno= 45307 -aXN0aQ== 45308 -INC90LDRiNC10LPQvg== 45309 -IHNlbWljb25kdWN0b3I= 45310 -IENsaW50 45311 -IHBsdXA= 45312 -IE9yaWdpbg== 45313 -IEV2ZW50cw== 45314 -IOqxseyglQ== 45315 -bXBmZW4= 45316 -TkVZ 45317 -IERX 45318 -IOu2ge2VnA== 45319 -IGluZm9ybXM= 45320 -IGZvcnNr 45321 -IGFtaWdh 45322 -IENpbmNpbm4= 45323 -U3Ry 45324 -IHBhcmlzaA== 45325 -IOy7pO2U 45326 -IHNpemk= 45327 -IHBsYW50YXRpb24= 45328 -IGJsaXZlcg== 45329 -INC/0L7Qu9C40YI= 45330 -IHN1YmRpdg== 45331 -IHJhbnQ= 45332 -IHByaW5jaXBhbHM= 45333 -5ZCm 45334 -IGt1bm5l 45335 -w7xnZW4= 45336 -YXJlc3BhY2U= 45337 -IHZhbGxhaGk= 45338 -IGNvbGxhcHNpbmc= 45339 -2KfZhNmF 45340 -IGxpZGVy 45341 -IHRhbWE= 45342 -IGdhZ25lcg== 45343 -cm9sbGU= 45344 -IOunkOyUgOuTnOs= 45345 -IGNhdGhlZHJhbA== 45346 -IFdlYnM= 45347 -IFBvbGl0aWNz 45348 -44GX44G+ 45349 -44Gj44Gm44KL 45350 -IERlbmlz 45351 -IHR1bw== 45352 -IHJlZnJhY3Q= 45353 -IGRpc2ludGVncg== 45354 -c3Rlcw== 45355 -INC70Y7QsdC+0LI= 45356 -IHdpbHQ= 45357 -IHRydXN0cw== 45358 -IGtvbXVu 45359 -IEJhc2tldA== 45360 -fiEh 45361 -bmFl 45362 -INCa0L7Quw== 45363 -IHN5bGxhYmxlcw== 45364 -IEhlbnJp 45365 -IE5hYg== 45366 -2YjYuQ== 45367 -IHdu 45368 -IGthbXA= 45369 -IFByYWd1ZQ== 45370 -IEJyZWFrZmFzdA== 45371 -IOq3uOuftA== 45372 -IGNodXQ= 45373 -IDMzMA== 45374 -IEluZHVzdHJpZXM= 45375 -5LiN566h 45376 -IGnFn2k= 45377 -IEdvbGRtYW4= 45378 -IMSwbnM= 45379 -dXNzYQ== 45380 -aXRoZQ== 45381 -hJA= 45382 -IFNPVU5E 45383 -0LDQu9GM0L3Ri9C8 45384 -Lig= 45385 -INCz0L7RgNCw0Lc= 45386 -IGRhZ2VnZW4= 45387 -IOuu 45388 -IHdhaXRlcg== 45389 -bGVuZ3Ro 45390 -IM+Dz4TOsQ== 45391 -IGNodW5reQ== 45392 -U2E= 45393 -IHJ1c3R5 45394 -IEp1ZGl0aA== 45395 -NzUw 45396 -IGVwb3h5 45397 -7Lmg 45398 -5Y+y 45399 -bWV0cm8= 45400 -IHJlamVjdGluZw== 45401 -IHNxdWlzaHk= 45402 -IHBsdXBhcnQ= 45403 -IG3DqXRo 45404 -IGFzcGlyaW5n 45405 -IERyYW1h 45406 -IHVwbGlmdA== 45407 -p4jri6Q= 45408 -Li4uLi4uLi4uLi4uLi4uLg== 45409 -oKTsmpQ= 45410 -IHTDqWNuaWNh 45411 -IHBhc2FuZG8= 45412 -VGhvc2U= 45413 -INGA0LDQt9C00LXQuw== 45414 -IG1lZGlvY3Jl 45415 -IE5pY2tlbA== 45416 -IHN1cGVyaGVyb2Vz 45417 -IG1pc3Npb25hcnk= 45418 -IFBhcmVjZQ== 45419 -IHJvdGF0aW9uYWw= 45420 -IHByZXR0 45421 -44Gd44GG44Gd44GG 45422 -IGxhbWE= 45423 -IGNhbnlvbg== 45424 -IGJldGVy 45425 -IFByb3Zvc3Q= 45426 -IGh2aXM= 45427 -IGRlYWN0aXY= 45428 -IEhlbHM= 45429 -cGZsaWNodA== 45430 -U29tZXRoaW5n 45431 -IFBpZXJjZQ== 45432 -IOqygOywsA== 45433 -bHVuZ2Vu 45434 -IHNpemluZw== 45435 -IGxhdGl0dWRl 45436 -IE5vbmV0aGVsZXNz 45437 -b21uaWE= 45438 -IFNhYnJpbmE= 45439 -IER5bmFtaWM= 45440 -5YO5 45441 -b250YQ== 45442 -7IaQ 45443 -IGRpcmVjdGl2ZQ== 45444 -IERlcG90 45445 -IGZ1ZWxlZA== 45446 -IGV4cGlyZQ== 45447 -IGNvbcO6bg== 45448 -IFNleHVhbA== 45449 -IEdvcmU= 45450 -IHJlc3RsZXNz 45451 -IEpBS0U= 45452 -0YLQtdGA0LXRgQ== 45453 -INGC0YDQsNC9 45454 -IEhvbHo= 45455 -5bCG 45456 -IEFjdG9y 45457 -5p2v 45458 -Y2FsbA== 45459 -IGVtYWlsZWQ= 45460 -IFBlYXI= 45461 -0YPQtNC4 45462 -0YDQsNC7 45463 -IG3DoHk= 45464 -IENIRUVSSU5H 45465 -5a6J5YWo 45466 -IHJldGFpbGVy 45467 -IHByb3Ry 45468 -IGRpc2NhcmRlZA== 45469 -IEhJUw== 45470 -IGV2YW5nZWxpY2Fs 45471 -IEVsc2U= 45472 -IGV4cGxvcmVz 45473 -IGNyaXRpY2l6aW5n 45474 -aWZpaw== 45475 -IHdoaXBwaW5n 45476 -IG9waXM= 45477 -b3VzZWQ= 45478 -RnJlZQ== 45479 -IO2MrA== 45480 -IG1pY3M= 45481 -cnVubmluZw== 45482 -T2I= 45483 -aXRpw6k= 45484 -IG5lY2VzaXRh 45485 -IERvbWluaWNhbg== 45486 -IEJhZ2g= 45487 -IHRlbmRlbmNpZXM= 45488 -IE1ldHJvcG9saXRhbg== 45489 -xZFs 45490 -INC30L3QsNC10Lw= 45491 -IFphbQ== 45492 -IERlYWRwb29s 45493 -YWxlxbw= 45494 -IGludmVzdGlnYXRpdmU= 45495 -IFByb251bmNpYXRpb24= 45496 -IGVtdWxhdGU= 45497 -IGJhbmNv 45498 -IC3imao= 45499 -5Yi7 45500 -IG92ZXJhcmNoaW5n 45501 -bGljaGVz 45502 -INCy0L7Qt9Cy0YDQsNGJ 45503 -IFNjYXJ5 45504 -IEtpYQ== 45505 -5Zyf 45506 -cm9udGluZw== 45507 -aW5uZWQ= 45508 -INuB2Yg= 45509 -7IiY66W8 45510 -576O5ZGz 45511 -d2Vs 45512 -IOuzhOuhnA== 45513 -IHVuaW50ZW50aW9u 45514 -YWFT 45515 -IG5pY2VzdA== 45516 -IFRlc3Rpbmc= 45517 -IElTSUw= 45518 -b2dlbm91cw== 45519 -INif 45520 -IGxpZXV0ZW5hbnQ= 45521 -IGJyYXVjaA== 45522 -IFRpcg== 45523 -ZHJpdmU= 45524 -IHRvbGVyYW50 45525 -IHNob290ZXJz 45526 -IOyYiOu7kA== 45527 -5q66 45528 -b250b24= 45529 -IHRlcmlh 45530 -aWV0ZXQ= 45531 -Um9u 45532 -bGVpZ2g= 45533 -Z2Fl 45534 -IG9sbWFr 45535 -IENsb25l 45536 -c29sZA== 45537 -IHNrZWxldG9ucw== 45538 -IGluY3VtYmVudA== 45539 -0L7QvNC1 45540 -Q09O 45541 -IGxldmVu 45542 -IG1pbGxlbm5pYWxz 45543 -IGVxdWF0b3I= 45544 -IEZlZGVy 45545 -IEFsZXhhbmRyYQ== 45546 -IHZyaWo= 45547 -IEhlYWx0aGNhcmU= 45548 -IO2VkQ== 45549 -IGVtcGhhc2l6aW5n 45550 -IGRpYWxvZ3Vlcw== 45551 -IGNoaWxsZWQ= 45552 -IHByb3c= 45553 -IFBhc3Npb24= 45554 -IExhZGVu 45555 -YXJpZXN0 45556 -YXBocmFn 45557 -IGFkZGl0aXZl 45558 -IFN0YWF0 45559 -IE5lcHQ= 45560 -IEhBTQ== 45561 -4LmA4Lit 45562 -ZGF5cw== 45563 -IO2WiOuNmA== 45564 -IHZvaWxh 45565 -INGF0Ls= 45566 -IERldXRzY2hl 45567 -cXVpcg== 45568 -T3Blbg== 45569 -IHJhbmdlZA== 45570 -IGxldmVycw== 45571 -IE1hbnNpb24= 45572 -cGFyZWQ= 45573 -IFRpdGFucw== 45574 -YXRvaXJl 45575 -IGVuZ2FnZXM= 45576 -eWV6 45577 -bmFkZW4= 45578 -IG9ic3RydWN0 45579 -IEVtbXk= 45580 -5ZWG 45581 -sKU= 45582 -IHRyb3Bo 45583 -IHRha2Vhd2F5cw== 45584 -Ky4= 45585 -dHljem5pZQ== 45586 -aMOpc2l0ZXo= 45587 -IHBvZMOtYQ== 45588 -IOyjvOuKlA== 45589 -IGNpdGF0aW9u 45590 -IEFxdWE= 45591 -IGRlYnVnZ2luZw== 45592 -0LLQsNC9 45593 -IOuLueyLoA== 45594 -INin2YTZig== 45595 -IGluc3RhbnRhbmVvdXM= 45596 -IEF1dHVtbg== 45597 -IGtlcGFkYQ== 45598 -IGdldGFu 45599 -aGluaQ== 45600 -eW50aGVzaXM= 45601 -INC/0LXRgNC4 45602 -IE1hY2Vk 45603 -UGFj 45604 -dW50dQ== 45605 -QnJh 45606 -INCz0L7RgNCw0LfQtNC+ 45607 -IDE5NTk= 45608 -INGC0LXQvNC/0LXRgA== 45609 -IHNhbmU= 45610 -IE9VUg== 45611 -YXN1 45612 -IOustOyX 45613 -IHZhbGxleXM= 45614 -IGxpc3Rpbmdz 45615 -IHByemVkc3Rhdw== 45616 -IGd1bW15 45617 -IGNvcnRpc29s 45618 -IE9icmln 45619 -IEFsbGllZA== 45620 -0L7QttGD 45621 -IGfDqW7DqXI= 45622 -IGRvY3M= 45623 -IENoaWxp 45624 -IEFiZHVsbGFo 45625 -S2l0 45626 -IGNvbnRyaWJ1dG9ycw== 45627 -0LPQvtGA 45628 -0LvQtdGA 45629 -IGJpbmRlcg== 45630 -IG1vZMOobGU= 45631 -7YWQ 45632 -IGludGVpcm8= 45633 -bWlz 45634 -ZmVyYQ== 45635 -2KfYsA== 45636 -TWFuaWE= 45637 -IO2ZnOuPmQ== 45638 -IOu0kOyalA== 45639 -IEpheg== 45640 -57uT 45641 -0ZbQu9GM0LrQuA== 45642 -cmlzaG5h 45643 -IOq1sA== 45644 -IHRhbWFuaG8= 45645 -IGFwcGxpYW5jZQ== 45646 -IFJlc2lzdGFuY2U= 45647 -IExPT0s= 45648 -IEh5cA== 45649 -IEhlaWw= 45650 -RmlyZQ== 45651 -dWp1 45652 -IGhlYWxz 45653 -IG1hbHQ= 45654 -IFZFUlk= 45655 -INGF0L7Rh9C10YjRjA== 45656 -IGxpbmdlcg== 45657 -IE5hcnI= 45658 -IFJlZ3VsYXI= 45659 -IExvb3A= 45660 -IExlbm8= 45661 -IHNvcnRpZQ== 45662 -IFNlcnZl 45663 -IOydtQ== 45664 -IEx1ZWdv 45665 -aXR0w6Q= 45666 -IHVuZGVz 45667 -6LO9 45668 -5aaC5p6c5L2g 45669 -IHNsaXBwZXJz 45670 -IG9uZGE= 45671 -IMSQw6J5 45672 -IHRhcGVk 45673 -IHRyYXZlcnNl 45674 -IHJlbGF0aXZpdHk= 45675 -IFlvc2hp 45676 -Y2pvbg== 45677 -aWxhdGVk 45678 -YWN0aXZlbHk= 45679 -INCh0L7Qsg== 45680 -5oiR6KeJ5b6X 45681 -IFBPTA== 45682 -0KDQmA== 45683 -aW5mbGFtbQ== 45684 -Y2hlZXJmdWw= 45685 -INee15DX 45686 -ID4+Ww== 45687 -bWluc3Rlcg== 45688 -INCy0LvQuA== 45689 -IGlkZW50aWZpZXI= 45690 -IExhbWJkYQ== 45691 -IHRyb3M= 45692 -IGZsYXdsZXNz 45693 -IGRldHJpbWVudGFs 45694 -IGJ1bmxhcsSx 45695 -V2Fy 45696 -IHJlZ2nDo28= 45697 -55yf55qE5piv 45698 -IEJpa2U= 45699 -Y2Vzc29ycw== 45700 -IGPDuW5n 45701 -IFJO 45702 -IOq9gw== 45703 -IGvDvMOnw7xr 45704 -IEJlZ2lubmluZw== 45705 -7Zi46w== 45706 -IGdld2U= 45707 -IGRlbm90ZQ== 45708 -IEFsYmVydG8= 45709 -IHByb2Jpb3Q= 45710 -IG9kZQ== 45711 -IG1vbGFy 45712 -IGJ1cnN0aW5n 45713 -YXNzdW1lZA== 45714 -IGZvb3RwcmludHM= 45715 -dmVkYQ== 45716 -IHN0ZXJvaWRz 45717 -IGZsYW1pbmc= 45718 -IEVsbGVy 45719 -IGVya2VubmVu 45720 -w6R0emVu 45721 -IGxpZmVjeWNsZQ== 45722 -IERPVQ== 45723 -IEthcmVuYQ== 45724 -IEd1ZXJyYQ== 45725 -6L+Y5piv 45726 -IHNpbmlzdGVy 45727 -IHBvZMOpaXM= 45728 -IHBhcmFi 45729 -IG9rbw== 45730 -IG1hdMOpcmk= 45731 -IGNhcmlj 45732 -c29uYXJv 45733 -IHByYXRpY2FtZW50ZQ== 45734 -0YPRgdCw 45735 -IGNvbXVucXVl 45736 -IHZpZ2lsYW50 45737 -IHJlZ2ltZXM= 45738 -IFNob290aW5n 45739 -IHJhaWRz 45740 -IE5vcmE= 45741 -IFdpZWRlcg== 45742 -bWVucw== 45743 -INGB0L7QtA== 45744 -IOqyveyasOyXkOuKlA== 45745 -INCy0YXQvtC0 45746 -IGF1dG9iaQ== 45747 -IFNjaG4= 45748 -IFJvYmJpZQ== 45749 -IEZpdG5lc3M= 45750 -INC60L7QvdGE 45751 -IHBlbmd1aW4= 45752 -0LzQvtGC0YDRjw== 45753 -INC80LjQvdC40Lw= 45754 -cGxheXM= 45755 -IGRlbGVnYXRlcw== 45756 -TWVy 45757 -IHNpc3RlbQ== 45758 -IE1pY2hhZWxz 45759 -bWFsZQ== 45760 -2KfYuQ== 45761 -IGPDoWNo 45762 -IEjDpA== 45763 -INeZ15XXk9ei 45764 -IHN1cGVycG93ZXI= 45765 -IHN0cm9u 45766 -IHJvdmVy 45767 -IGTDqXBlbmQ= 45768 -6Zmz 45769 -IHJldGlyaW5n 45770 -IHZhbXBpcmVz 45771 -IG1lcmRl 45772 -IENoYW5naW5n 45773 -IHRhbWU= 45774 -IHNwb2tlc3BlcnNvbg== 45775 -IGNheQ== 45776 -IGZsaXJ0aW5n 45777 -IEdyw7Y= 45778 -IHfDpHI= 45779 -IHd5Yg== 45780 -IGNvZXVy 45781 -4bqhbmg= 45782 -IOyZgOyEnA== 45783 -IGNvbm5haXM= 45784 -IEh1bmRyZWRz 45785 -IEJlYQ== 45786 -IM6xz4A= 45787 -cHJ1Y2g= 45788 -IHNvY2llZGFkZQ== 45789 -IFdoaWxzdA== 45790 -IEthaXQ= 45791 -ZXNwYWNl 45792 -IGNoaWE= 45793 -IEVybQ== 45794 -IOuwlOq/ 45795 -IGZlbmNlcw== 45796 -IE1vcnRhbA== 45797 -6rKB 45798 -INCz0YDQsNGE 45799 -IEhvbWVsYW5k 45800 -IEpVTg== 45801 -aXNzdA== 45802 -IHBhcmxhcg== 45803 -IHNwb3J0eQ== 45804 -w6lv 45805 -IGRlZXBlbg== 45806 -IEJlaGF2aW9y 45807 -6YCP 45808 -5ZOI5ZOI5ZOI 45809 -IGVycmFuZA== 45810 -IHJvdGFyeQ== 45811 -IFdlbGxpbmd0b24= 45812 -V2luZA== 45813 -IG1lc2VsYQ== 45814 -4bqjbmc= 45815 -aWVuZGU= 45816 -IGV4Y2VsbA== 45817 -IEdlbml1cw== 45818 -IEVkdWFyZG8= 45819 -5pyJ5Lq6 45820 -IMWfdW51 45821 -IMSwc3RhbmJ1bA== 45822 -IHByb2R1dG8= 45823 -IOOFjuOFjg== 45824 -T0ZG 45825 -IHdvbGx0 45826 -54iG 45827 -IOuJtOyKpA== 45828 -IGxhc3M= 45829 -IGhlcnR6 45830 -IGFyb21hdGlj 45831 -INC30LLQvtC9 45832 -IGF1dG9j 45833 -IEx1c3Q= 45834 -IDExMg== 45835 -IM6X 45836 -IHJldmlld2Vycw== 45837 -IHJlY2VwdGl2ZQ== 45838 -5bCN5LqG 45839 -w6JuZA== 45840 -b2dsbw== 45841 -IOyVhOuLmQ== 45842 -IG5nbw== 45843 -0ZbRgtC4 45844 -w6V0 45845 -Y29ubw== 45846 -IHRla3Jhcg== 45847 -IOyjvOqzoA== 45848 -IGdlbG1pxZ8= 45849 -IGJlZHRpbWU= 45850 -IEFyZ2g= 45851 -QURB 45852 -INCz0L7RgNC+0LTQsA== 45853 -IMSH 45854 -IGFsbGlhbmNlcw== 45855 -Z2lnZ2xpbmc= 45856 -IHllcmRl 45857 -IHNwaWVz 45858 -IGd1dGVz 45859 -w6dp 45860 -IGFsbHRpZA== 45861 -IExhaA== 45862 -npDr 45863 -IGRva8WCYWQ= 45864 -2YjZig== 45865 -IHRveGljaXR5 45866 -IGNhbmNlbGxhdGlvbg== 45867 -IDE5NTg= 45868 -ZHJv 45869 -IOyekeydgA== 45870 -IE1vdG9yb2xh 45871 -IG11bHRpbg== 45872 -IGVudGh1c2lhc3Rz 45873 -IE1pZ2h0eQ== 45874 -IENvY29udXQ= 45875 -OuOAjA== 45876 -IFBpY3R1cmVz 45877 -IHNhbmdyZQ== 45878 -IGJsaW5raW5n 45879 -b2xlc29tZQ== 45880 -IOyKpO2DgOydvA== 45881 -RlA= 45882 -IGJvb21pbmc= 45883 -INC00LXRgdGP0YI= 45884 -IHJhdGNoZXQ= 45885 -IHRpbWVsaW5lcw== 45886 -bGVuZXNz 45887 -IGNhZ2Vz 45888 -IEdvb2RuaWdodA== 45889 -b21ldGltZXM= 45890 -IGN1bm5pbmc= 45891 -IFJpc2s= 45892 -dWxlZA== 45893 -ZGFkZQ== 45894 -IHByYXRh 45895 -IGd1c3RhcsOtYQ== 45896 -YW11cw== 45897 -IEppbnBpbmc= 45898 -IGVzdHJ1dA== 45899 -IGRlc2NvYnJpcg== 45900 -IE3EgQ== 45901 -IEFsbGFu 45902 -IOWIhg== 45903 -INec16c= 45904 -IHByZXNlcnY= 45905 -IFN0cmF3YmVycnk= 45906 -xI8= 45907 -THU= 45908 -IGtybw== 45909 -IFJlcG9ydHM= 45910 -7IWU7JW8 45911 -IHZhbHQ= 45912 -IHBvdXZhaXQ= 45913 -IGFwcGFy 45914 -IEJvbmU= 45915 -IHByZWZlcmFibHk= 45916 -IFJlcMO6YmxpY2E= 45917 -5bCx5Yiw 45918 -IGhlcnpsaWNo 45919 -IGNoaW1uZXk= 45920 -IMOnZXY= 45921 -IHZpc2Fz 45922 -IHZlcnI= 45923 -IGN1bHRpdmF0aW9u 45924 -IEFybWVuaWE= 45925 -INCy0LTRgNGD0LM= 45926 -IGNvY2tybw== 45927 -cmV0Y2hlZA== 45928 -YXJ0eg== 45929 -INC70Y7QtNGP0Lw= 45930 -IHBvbMOtdGljYXM= 45931 -IFBhbno= 45932 -IEFLQQ== 45933 -IOuIjOufrA== 45934 -IGVycm8= 45935 -IGNhbXBlcg== 45936 -IDEwMg== 45937 -4KS4 45938 -ZG9uZQ== 45939 -IGhvYXJk 45940 -INCf0L7RgtC+0Lw= 45941 -amVvbmc= 45942 -IGRlc3Rh 45943 -cGFr 45944 -IGluaW0= 45945 -IGdyb3dlcnM= 45946 -IE1lc3NhZ2U= 45947 -IGVsZWN0b3I= 45948 -ZW5nYWdl 45949 -IEZvcmJlcw== 45950 -IENpbmNpbm5hdGk= 45951 -IGRpZmbDqXJlbmNl 45952 -ZGY= 45953 -IHNwYXI= 45954 -IGF3YWl0cw== 45955 -IFVTU1I= 45956 -IFJpc2luZw== 45957 -IEhvxZ8= 45958 -IGZvb3Rpbmc= 45959 -IGNvbmRpY2lvbmVz 45960 -0YLQvtGA0L7Qsg== 45961 -IGNsaW5pY2lhbg== 45962 -IERpc2t1c3M= 45963 -5aOT 45964 -16jXkg== 45965 -16U= 45966 -aXRlaXQ= 45967 -Z3Jlbg== 45968 -IGNoYXJpc21h 45969 -IGxldWtl 45970 -IGlycml0YXRpbmc= 45971 -IGNpcmNh 45972 -IFJob2Rlcw== 45973 -IHBpb3I= 45974 -IGhhbmRpY2Fw 45975 -cm95YWJsZQ== 45976 -IHZ1bGw= 45977 -T0c= 45978 -IGluw61jaW8= 45979 -aWVyaQ== 45980 -IHNwbGFzaGluZw== 45981 -IGRlbWlzZQ== 45982 -IGFzc2lzdGly 45983 -0YfRgtC+ 45984 -IGNvdmVydA== 45985 -IEd1ZA== 45986 -4LiJ 45987 -a2zDpHI= 45988 -IOyekOq+uA== 45989 -IHZlcsOkbmRlcnQ= 45990 -IFJFTQ== 45991 -IENvbnZlbg== 45992 -YXRnZQ== 45993 -IHBpZXJ3c3pl 45994 -IGNsZXJneQ== 45995 -bGluZ3Rvbg== 45996 -bGl2 45997 -VlBO 45998 -INGB0L7QttCw0Ls= 45999 -IEhhdGU= 46000 -44Go44GT44KN 46001 -z4bOvw== 46002 -IFJlc3BvbnM= 46003 -0L7Qt9C0 46004 -IGV0bWVr 46005 -IGNoZW1pbg== 46006 -2YXYqQ== 46007 -IOqwgOyhsQ== 46008 -VHJl 46009 -IHVtYXM= 46010 -IEJ1cnRvbg== 46011 -IHBhdHJpYXJjaA== 46012 -IFNtaXRoc29uaWFu 46013 -pZg= 46014 -TW9vbg== 46015 -QWly 46016 -IG1lZGlvcw== 46017 -IGVyYXNlcg== 46018 -IHdvbGx0ZW4= 46019 -IHBhcmVpbA== 46020 -IEJpbGxpZQ== 46021 -5oq9 46022 -0LXRgNGC0LI= 46023 -IHBhcmxhbWVudA== 46024 -IGFnb255 46025 -IFFVRQ== 46026 -c2VxdWVudGx5 46027 -QW5vdGhlcg== 46028 -IFdoZXc= 46029 -IEFubnVhbA== 46030 -IHNlYmVu 46031 -7IOB7J2E 46032 -dmFsdWVz 46033 -npzrp4w= 46034 -IHNpbm9u 46035 -ZXJlYWw= 46036 -IEVubGlnaHQ= 46037 -IENoZW1pc3RyeQ== 46038 -IENhdGFsdW55YQ== 46039 -IGRvY3Ry 46040 -YW50b24= 46041 -IHN0dWs= 46042 -IFBsYXRl 46043 -IEthcmRhc2hpYW4= 46044 -IGZpbG9z 46045 -IFdldA== 46046 -INC/0L7Qv9GL0YI= 46047 -IHVua25vd25z 46048 -IFNjaG9u 46049 -IEJhbGR3aW4= 46050 -IHRlbGVzY29wZXM= 46051 -IEd1Y2Np 46052 -b3hpZGU= 46053 -IENvbnNlcnZhdGl2ZQ== 46054 -7ISx7J2E 46055 -IGhpbmF1cw== 46056 -UG93ZXI= 46057 -IOqxtOqwlQ== 46058 -IHByZXZhaWw= 46059 -b3JtYW4= 46060 -bWFjaGluZQ== 46061 -IDE5NDY= 46062 -IHVuYmVs 46063 -IHNjaGF1dA== 46064 -IHBpZWw= 46065 -ZWVudGg= 46066 -IG9iamVjdGl2ZWx5 46067 -IGNoYWtyYQ== 46068 -YXVkaW8= 46069 -IGNoaWNvcw== 46070 -IFZhdWx0 46071 -5bCI 46072 -IG1lZGljaW5hbA== 46073 -IFRhaWw= 46074 -V2hpbGU= 46075 -IGFzcGhhbHQ= 46076 -IGZyb3pl 46077 -IEVL 46078 -dW5jaGluZw== 46079 -bm9zaXM= 46080 -MjAxNQ== 46081 -IEdyaQ== 46082 -IG9kZGx5 46083 -IE3DpHI= 46084 -IEFlZw== 46085 -Y29sbw== 46086 -UGFy 46087 -IOuTpOyWtOs= 46088 -IHZpbmRlbg== 46089 -IE9WRVI= 46090 -IGljZWQ= 46091 -IHNjb3Jw 46092 -IGhhYw== 46093 -cXVhbGlmaWVk 46094 -INGD0LLQuNC00LXRgtGM 46095 -ZXJtbw== 46096 -SEVO 46097 -IHNvaQ== 46098 -IG11bHRpcGxlcw== 46099 -IGxheW91dHM= 46100 -IGJsaW5kbmVzcw== 46101 -IEJvd3Nlcg== 46102 -INC/0L7QtNGC 46103 -IMOO 46104 -dmVudGlvbmFs 46105 -IG1hdGE= 46106 -bWFkxLE= 46107 -IGdlZXo= 46108 -IGNhZGVuY2U= 46109 -IHdhxbxuZQ== 46110 -IENocmlzdGll 46111 -dmVuZ2U= 46112 -Q2FsbA== 46113 -IHR1cm5hcm91bmQ= 46114 -IGJsb2I= 46115 -INCv0Lo= 46116 -IFZvaWNlb3Zlcg== 46117 -IHBlcmls 46118 -IEphaW1l 46119 -IEhPWQ== 46120 -bGFuZQ== 46121 -IHNlYmVs 46122 -IER1bw== 46123 -IEhpc3RvcmljYWw= 46124 -IGRuaQ== 46125 -IGdlbWE= 46126 -eWs= 46127 -IHNhYmVt 46128 -4bqvbmc= 46129 -IHZhcnM= 46130 -IFJvbm5pZQ== 46131 -IFJvbmFsZG8= 46132 -IFBlcnF1w6g= 46133 -bnNpbm4= 46134 -aGFpcg== 46135 -IHJlbGVudGxlc3M= 46136 -IGx5bg== 46137 -IHRyYXZlbGVy 46138 -5oCO6bq85LqG 46139 -bmluZQ== 46140 -IGFudGlt 46141 -IOy8gA== 46142 -IHNub3diYWxs 46143 -INGF0LDRgNCw0LrRgtC10YA= 46144 -IGludGVybnM= 46145 -IGNvbnN0aXR1ZW5jeQ== 46146 -INCd0LDQvA== 46147 -15zXnA== 46148 -VkVM 46149 -IHZpa3RpZ3Q= 46150 -IGFwb3lv 46151 -2YTYqA== 46152 -IGphcmQ= 46153 -IGhlaWdodGVuZWQ= 46154 -0YDQvtGB0YI= 46155 -IFNNSVRI 46156 -INC00LXQu9Cw 46157 -IHJlcGFpcmluZw== 46158 -IHJpZ3Q= 46159 -IFNoZWlraA== 46160 -IEJyaXRuZXk= 46161 -IGV2ZXJ5dGltZQ== 46162 -IGFkdmVudHVyb3Vz 46163 -b2NrZXk= 46164 -ZXJudA== 46165 -IGF0YXF1ZQ== 46166 -IEFsdGVybmF0aXZlbHk= 46167 -ZWZmZWN0 46168 -IHBhbGF2cmFz 46169 -IEVsbGlvdHQ= 46170 -IHLDqXVzc2k= 46171 -IGh5cGVydGVuc2lvbg== 46172 -IE1hbnVhbA== 46173 -IHByb3BoZXRpYw== 46174 -IGhhbmRj 46175 -0YzQtQ== 46176 -IHJlZnJhaW4= 46177 -IFNxdWlk 46178 -7J6h 46179 -INC60L7QvNCw0L0= 46180 -w6RsbGVu 46181 -IGxsZWfDsw== 46182 -IGJhc2g= 46183 -aW9ueQ== 46184 -INGB0LrQu9Cw0LQ= 46185 -INC60LDQsQ== 46186 -IGNhcmVsZXNz 46187 -IFBvb2w= 46188 -IHRyw6Fz 46189 -IGZpbHM= 46190 -IFNjaHI= 46191 -IHNwcmF3ZA== 46192 -IE1vbmF0ZW4= 46193 -IHVuZm9yZ2V0dGFibGU= 46194 -IENvdHRvbg== 46195 -IGluY29udmVuaWVudA== 46196 -IFJY 46197 -b3Jpcw== 46198 -IGh1bWJsZWQ= 46199 -16rXlw== 46200 -INii2b4= 46201 -IGluY3Jlw60= 46202 -IEtvbW1lbnRhcmU= 46203 -6IiS 46204 -cmFjacOzbg== 46205 -IHZhbnRhZ2U= 46206 -IFNlYWw= 46207 -IOydtOqxsOulvA== 46208 -IGpvdWU= 46209 -44Gd44GG44Gn44GZ44Gt 46210 -IOyYpOuemA== 46211 -INC40YHQv9GL0YI= 46212 -b2Jlbg== 46213 -IGdyYXRl 46214 -IGNvbnRyb2xl 46215 -IFBlcmN5 46216 -xYJhZGE= 46217 -IHNpbXVsdGFuZW91cw== 46218 -IHByb3RvdHk= 46219 -IGdyb8OfZXI= 46220 -IGJld3Vzc3Q= 46221 -aW5pemk= 46222 -IHBhc3NpZXJlbg== 46223 -IEhhcHBpbmVzcw== 46224 -5YmH 46225 -c2hp 46226 -Z2VodA== 46227 -IHN0YXRpb25lZA== 46228 -IEVyZ2Vibmlz 46229 -IGRpcmVjdGFtZW50ZQ== 46230 -IHN1cnZpdmVz 46231 -IHBlcnNvbmVz 46232 -QkVSRw== 46233 -IHZvbWl0aW5n 46234 -IGNvbmhlY2Vy 46235 -IGFkam91cg== 46236 -IENpdmlj 46237 -cGVp 46238 -YnVyc3Q= 46239 -IOuLpOuLiA== 46240 -6Y8= 46241 -IHNsZWQ= 46242 -IHBsYXRhZm9ybWE= 46243 -IFNlY3Q= 46244 -IERlZmlu 46245 -55m76Yyy 46246 -w6lub20= 46247 -Y2huZXQ= 46248 -IHByb2ZpdGFiaWxpdHk= 46249 -IGVycmVpY2h0 46250 -4buPaQ== 46251 -Y2F0aW9u 46252 -IOyngOq4 46253 -IHBlcmRyZQ== 46254 -IGZlbG9ueQ== 46255 -IDE5NTc= 46256 -5oiR5b6I 46257 -IHVuc3VjY2Vzc2Z1bA== 46258 -IG5hZ3lvbg== 46259 -IGVsYXN0aWNpdHk= 46260 -IGZhY2FkZQ== 46261 -IGVhcnRobHk= 46262 -INCw0LzQtdGA0LjQutCw0L0= 46263 -IGNvbm4= 46264 -Y2xh 46265 -RHU= 46266 -IHBvbGl0aXF1ZXM= 46267 -IGhhbG8= 46268 -aWFudGVz 46269 -INC80L7QtdC5 46270 -44Oz44OJ 46271 -dG9uZXM= 46272 -ZWxpZXI= 46273 -6K6a 46274 -aHRha2luZw== 46275 -IHdpY2h0aWdl 46276 -IGFubm8= 46277 -IExvaw== 46278 -aWxsaW9ucw== 46279 -IHZpdmVy 46280 -IHNvbGNoZW4= 46281 -IHN1Zg== 46282 -IFNhbHo= 46283 -IE52aWRpYQ== 46284 -enVnZQ== 46285 -IFNwaWtl 46286 -VmlkZW8= 46287 -IHR3b3I= 46288 -IEFsYQ== 46289 -6JGJ 46290 -IGhhbnlh 46291 -IEFkbQ== 46292 -7J21 46293 -IFBhdGllbnRlbg== 46294 -IE9uaW9u 46295 -IEtvYmU= 46296 -IFNjZW5l 46297 -IFJhc2g= 46298 -5qiZ 46299 -0YDQsNGB0YI= 46300 -aXN0YW5p 46301 -R2VuZXJhbA== 46302 -bGV5ZQ== 46303 -aW1iYXA= 46304 -IGNvbmNlYWxlZA== 46305 -IEZyaWRheXM= 46306 -IFdvb2w= 46307 -INC90L7QstGL0YU= 46308 -2LTYsQ== 46309 -IOqysOqzvA== 46310 -IGplZG9jaA== 46311 -tOyLnA== 46312 -k6Trj4Q= 46313 -IOyepeuCnA== 46314 -dWt0 46315 -TG91 46316 -IOuoueyWtA== 46317 -IEV4cGVjdA== 46318 -INC00L7QvNC+0Lk= 46319 -IGlycmVzcG9uc2libGU= 46320 -IGFjZXJjYQ== 46321 -IFp1c3Q= 46322 -16jXmA== 46323 -VUk= 46324 -IHlvdXR1YmVycw== 46325 -IFBvc2l0aXZl 46326 -IHNvY2lvZQ== 46327 -IHNuYXRjaA== 46328 -6IOM 46329 -IHJlZnJlc2hlZA== 46330 -IG5vbWluYXRpb25z 46331 -IFBhdHQ= 46332 -IG9ic29sZXRl 46333 -IGRlbWnFnw== 46334 -5Y+k 46335 -b3JtdcWf 46336 -IOyGlOynge2eiA== 46337 -IGZsYQ== 46338 -IGNyYXppZXN0 46339 -IFppZQ== 46340 -IFTDug== 46341 -emVw 46342 -aWNlbQ== 46343 -IOupi+yeiA== 46344 -IGN5bmljYWw= 46345 -44Gd44KT44Gq 46346 -IHRyZXNw 46347 -IGNyYXo= 46348 -1aXV 46349 -IG5lbGxl 46350 -IG1waA== 46351 -IE5lcmVk 46352 -IEtvYg== 46353 -IEVjaw== 46354 -qLjri4g= 46355 -SmFu 46356 -INCi0L7Qs9C00LA= 46357 -IGRlY2k= 46358 -IFZvZw== 46359 -IGJ1YmJsaW5n 46360 -6YCA 46361 -w7ph 46362 -IHByb2R1Y3Rvcw== 46363 -aWJlcmFs 46364 -IHJlcGxpY2F0ZWQ= 46365 -IEltcHJvdmU= 46366 -aWxsYXJ5 46367 -Q2hh 46368 -IHLDqWR1 46369 -g5DtlZjrqbQ= 46370 -IGNvbm5vdA== 46371 -IEtyaXQ= 46372 -INC00YPRhdC+0LI= 46373 -IHRyZWFkbWlsbA== 46374 -IFBX 46375 -INC30L7QstGD0YI= 46376 -IGNsYW1z 46377 -IGRyYWZ0aW5n 46378 -IDE5NTY= 46379 -dW50YQ== 46380 -IGV4cGVuZGl0dXJlcw== 46381 -IEhvb3Zlcg== 46382 -V09P 46383 -0YjQtdC1 46384 -IGRlZHVjdGlvbg== 46385 -bW9uYXJ5 46386 -IHJlY2li 46387 -IHBvdm8= 46388 -IOuNlOs= 46389 -IFBBTA== 46390 -IEJsb3c= 46391 -IHd5cA== 46392 -IGRlc3RhYw== 46393 -ZGVhbA== 46394 -R3JhZW1l 46395 -IG7DqWNlc3NhaXJl 46396 -IGRhbW5lZA== 46397 -IDE5Mzg= 46398 -IOyLpOygnOuhnA== 46399 -IHRyb29w 46400 -IGluc2lnaHRmdWw= 46401 -IFRK 46402 -INC+0YHQsg== 46403 -IGZpZGVsaXR5 46404 -IFNraXA= 46405 -IE1heW8= 46406 -66ed 46407 -YXBwZQ== 46408 -IGJsYXM= 46409 -IFdZ 46410 -IEdO 46411 -Y3Rhcg== 46412 -U3U= 46413 -IGN1ZW50 46414 -aGV3cw== 46415 -IGNvcnBzZXM= 46416 -QWJz 46417 -IHdhc3Rld2F0ZXI= 46418 -IGNpZWs= 46419 -IE9udQ== 46420 -IGV4cGxvc2l2ZXM= 46421 -IGFybWE= 46422 -IFNURVBIQU4= 46423 -cG9saXRpaw== 46424 -IE9zYWth 46425 -dGHFgg== 46426 -IHlhcMSxeW9y 46427 -IGl6cXVpZXI= 46428 -IGJlbGV6YQ== 46429 -IFd5YXR0 46430 -5ZC4 46431 -IHN1aw== 46432 -IHNwZWNqYWw= 46433 -IGRhbmtl 46434 -d2hpc3RsZQ== 46435 -IGbDrXNpY2E= 46436 -IEhhcnJpZXQ= 46437 -IOyVhO2MjA== 46438 -IHdpbGxrb21tZW4= 46439 -aXBpbmc= 46440 -INGB0LzQvtGC0YDQuNGC0LU= 46441 -INC80L7QttC10YjRjA== 46442 -IGluYWNjdXJhdGU= 46443 -IGFycm9nYW5jZQ== 46444 -IFJlbW8= 46445 -zrPOrA== 46446 -YXNzZWQ= 46447 -IGRlbGl2ZXJpZXM= 46448 -IHN0aW5reQ== 46449 -INC/0LXRgNC10LY= 46450 -amF5 46451 -IHRyYW5zaXRpb25hbA== 46452 -IHJlcmU= 46453 -IE5HT3M= 46454 -IEFUTQ== 46455 -2K7Yqg== 46456 -aW9sb2d5 46457 -INCy0LvQsNC0 46458 -IHNjaG1l 46459 -IFNoaW5l 46460 -7JWh 46461 -cGFudHM= 46462 -IHNlcmdl 46463 -IHNlbmhvcg== 46464 -IGFiZHVjdA== 46465 -IEJyeWFudA== 46466 -VkVT 46467 -IGF3YWtlbmVk 46468 -IExheg== 46469 -cm9wb2xpcw== 46470 -IExhbw== 46471 -6L6b6Ium 46472 -IHZpbGxh 46473 -IHN1bW1lcnM= 46474 -IGVudGhhbA== 46475 -IDE5NDk= 46476 -Vmlh 46477 -IOyWtOyo 46478 -IHRlbmRvbg== 46479 -IHZpb2xldA== 46480 -IGludGVsbGVjdHVhbGx5 46481 -IGJvdW5jZWQ= 46482 -YXJhdXM= 46483 -IDE5MTk= 46484 -IHZyYWFn 46485 -IHNwZWw= 46486 -IFNjaHdhcg== 46487 -U2NvdHQ= 46488 -IEluZG8= 46489 -IOunnQ== 46490 -IGNhbm9uaWNhbA== 46491 -IElLRQ== 46492 -IHRoYXTDrXM= 46493 -IG1lbGxhbg== 46494 -5q+S 46495 -aWdtYXQ= 46496 -Q291bGQ= 46497 -Li4uPyk= 46498 -IGZvYXJ0ZQ== 46499 -IEt1bWFy 46500 -cmVuZG8= 46501 -IMOpbMOp 46502 -4LQ= 46503 -dmFsdWF0aW9u 46504 -Y2FzZXM= 46505 -IGludHVpdGl2ZWx5 46506 -aG9uZw== 46507 -ZXR0ZWQ= 46508 -IHNvdXZlbg== 46509 -IG1vcmI= 46510 -IGNvcnM= 46511 -IE5W 46512 -IEhhc2Fu 46513 -5oOF5Ya1 46514 -aWV2ZWQ= 46515 -IOyngOq4iOydgA== 46516 -IGR1bXBsaW5n 46517 -IGNvbnRyw7RsZQ== 46518 -IGFtYmlndWl0eQ== 46519 -5qmf5pyD 46520 -IGNvZw== 46521 -IFNjcmlwdHVyZXM= 46522 -IGNhaQ== 46523 -IGJldmVy 46524 -5aSn5a626YO9 46525 -IGh1aXM= 46526 -IGFpbWU= 46527 -IGVya2zDpHJlbg== 46528 -IExN 46529 -IEZleQ== 46530 -6Zq+ 46531 -4K6x4K6k 46532 -IHN1cGVydmlzZWQ= 46533 -IGpld2U= 46534 -c3Bs 46535 -INGG0LXQvdGC0YA= 46536 -IGNvbGxpc2lvbnM= 46537 -2YTZgQ== 46538 -IEhvZ3dhcnRz 46539 -IER1cmhhbQ== 46540 -15XXow== 46541 -IHBob3NwaGF0ZQ== 46542 -IG92ZXJzZWU= 46543 -IGluc3BlY3Rpb25z 46544 -IGJyaW5j 46545 -IFphaw== 46546 -IHBheW9mZg== 46547 -IGNoYXVk 46548 -IEh1bmdlcg== 46549 -w6Nvcw== 46550 -dmly 46551 -IGZpYW5jZQ== 46552 -IGJvdWc= 46553 -bGl2ZWQ= 46554 -Y3J5 46555 -5Zue5L6G 46556 -IGpvaW50bHk= 46557 -IGdpcmxmcmllbmRz 46558 -IE5leHVz 46559 -pqzqsqDsirXri4jri6Q= 46560 -IEt3YW5n 46561 -5ZOI5ZuJ 46562 -5aeR 46563 -xYLEmQ== 46564 -IE5lZGVu 46565 -aWVjZQ== 46566 -IGluc2VydGluZw== 46567 -5p+T 46568 -IE11bW15 46569 -IEdsb2Jl 46570 -IGxlZQ== 46571 -IGdlcm1hbg== 46572 -IGNyZWFtcw== 46573 -YWNobw== 46574 -IGNoxrBh 46575 -IEdhbGlsZQ== 46576 -IGbDvHJz 46577 -IGVzdGl2ZXI= 46578 -Y2lkb3M= 46579 -Q2hyaXN0aWFu 46580 -IGxvcnNxdQ== 46581 -IGN1dGVzdA== 46582 -dmFsZQ== 46583 -INC60YDQtdC/ 46584 -IHdhcnk= 46585 -IHNsaWNpbmc= 46586 -IGVzcGVyYW5kbw== 46587 -IFZhbmRlcg== 46588 -IERlaXhh 46589 -IDE5NTQ= 46590 -IG3Ds3dpxIU= 46591 -0ZbRlA== 46592 -IHRvb2xpbmc= 46593 -IHJlc3Rvcg== 46594 -IHBvc2ljacOzbg== 46595 -IGludGVudGFy 46596 -IEFwYWNoZQ== 46597 -T1VM 46598 -INmI2Kg= 46599 -IG1hdGnDqHJl 46600 -44O844KT 46601 -IGxpbmVu 46602 -IGVzdHJhdMOpZw== 46603 -IE11dHRh 46604 -6aGv 46605 -6KGM5LqG 46606 -IHBhcnRpbmc= 46607 -IG1pbmltaXppbmc= 46608 -IGFwcHJlbmRyZQ== 46609 -5pyd 46610 -INCw0L3Qs9C70LjQuQ== 46611 -IERvbw== 46612 -IEZpcmVmb3g= 46613 -Y8OzbW8= 46614 -IGdlb3BvbGl0 46615 -IG1ha2Fu 46616 -IG1vZ2VsaWpr 46617 -IM+AzrXPgc65 46618 -IGPhu6k= 46619 -IGluc3RhbGxlcg== 46620 -IGRpYnVq 46621 -IEhlYXRo 46622 -bG9vcA== 46623 -IEJyb2tlbg== 46624 -SFlVTg== 46625 -c2hlbGY= 46626 -IGZpemVy 46627 -IGVuaGFuY2Vz 46628 -5L6L44GI44Gw 46629 -INC00L7RgdGC0Lg= 46630 -IFBVQg== 46631 -IEtvbGxlZ2lu 46632 -IGF0dGFpbmVk 46633 -xL4= 46634 -IG1pc3RyZXNz 46635 -IE9mdGVudGltZXM= 46636 -157Xmded 46637 -IGJld2U= 46638 -IFNvcmE= 46639 -cmF1ZW4= 46640 -YmF1bQ== 46641 -IHJvbGxlcnM= 46642 -IG1lcmluZw== 46643 -IFBBQw== 46644 -INC90ZY= 46645 -IFLDqXB1YmxpcXVl 46646 -INGC0YDQsNCy 46647 -IFZhbmd1YXJk 46648 -dWNpb25lcw== 46649 -IOustOuMgA== 46650 -IGdvdXI= 46651 -r6Q= 46652 -IM+J 46653 -IHNhdW5h 46654 -IHBlaW5l 46655 -IFZhbGVyaWU= 46656 -IFNpa2g= 46657 -ZmVuZGltaXo= 46658 -YmVybw== 46659 -INGH0Lg= 46660 -IGRvxZt3aWFk 46661 -IEV1cm9z 46662 -IGNvbW1lbnRhaXJlcw== 46663 -IHR3ZWFrcw== 46664 -IEZhc3Rlcg== 46665 -INGA0LDRgdC6 46666 -IHByb2dyZXNzaXZlbHk= 46667 -IEV1Y2g= 46668 -Ym9ybw== 46669 -IEluZ3JlZA== 46670 -Q2Fw 46671 -IHVuY2hlY2s= 46672 -IOyYpOuluA== 46673 -IHdyZQ== 46674 -IEZU 46675 -w7ZydW5n 46676 -IG1lbW9yaXplZA== 46677 -IERpbm5lcg== 46678 -IFBoZXc= 46679 -b3VibA== 46680 -IHB1dGE= 46681 -IGFkbWl0cw== 46682 -0LXQt9C00LU= 46683 -b3BvZA== 46684 -IHBhbmRh 46685 -IGhpbmdlcw== 46686 -Y2lwZQ== 46687 -IHRyYW5zYWN0 46688 -IHBvZGlh 46689 -IHBpY3M= 46690 -IGNyaXRlcmlvbg== 46691 -IE9yY2hlc3RyYQ== 46692 -IEJsb2c= 46693 -IHNvbGVtbg== 46694 -IFBpeGFy 46695 -VGhyZWU= 46696 -INCy0L3QuNC3 46697 -IFZvbHVudGU= 46698 -IFNhdmFnZQ== 46699 -IFBWQw== 46700 -IENhZg== 46701 -IHd5a29u 46702 -IGdyYWRlcnM= 46703 -IGNyb3VjaA== 46704 -IGNsaWNoZQ== 46705 -IHNveWJlYW5z 46706 -IE1VUg== 46707 -IEdvbnphbGV6 46708 -IE1pbWk= 46709 -IEJvbHNvbmFybw== 46710 -IGRpYXBocmFn 46711 -IGJpbGFuZw== 46712 -65CY64qU 46713 -6YKj5oiR5YCR 46714 -IHJlZ3VsYXRpbmc= 46715 -TWM= 46716 -SnVkZ2U= 46717 -INC90L7Qtg== 46718 -IGpha8SF 46719 -aXRlc3Nl 46720 -IFdpag== 46721 -IGxhdGE= 46722 -Z3JvYW5pbmc= 46723 -UE9TSU5H 46724 -INeQ15XXqteV 46725 -IGhhZ2E= 46726 -IGdyb3VuZGluZw== 46727 -IHZpb2xlbnRseQ== 46728 -IHRpbGxz 46729 -IGVuZ2Fn 46730 -IEhvbGxvdw== 46731 -INC/0L7Qv9GD0LvRj9GA 46732 -IHdwcm93YWQ= 46733 -IHJlcGxhY2Vz 46734 -IGZsdW9yZXNjZW50 46735 -dXJnaWNhbA== 46736 -aWdnbHk= 46737 -IFRyYWRpdGlvbmFs 46738 -dHRl 46739 -INmE2Yc= 46740 -IHBob3NwaG9ydXM= 46741 -IGFwcm9u 46742 -IFdhdGVycw== 46743 -IEt1bHR1cg== 46744 -0LDQstCw0Lk= 46745 -IG9saXZlcw== 46746 -INeU15DXnA== 46747 -IHRlaWx3ZWlzZQ== 46748 -IHNlbmNpbGw= 46749 -IHByZW5kcw== 46750 -IG5hcnJvd2Vy 46751 -IGrDpHR0ZQ== 46752 -IEluZm9ybWF0aW9uZW4= 46753 -7IOB7J20 46754 -IHN0YXJ2ZQ== 46755 -IGZyaWNr 46756 -IEJld2Vn 46757 -4KSy 46758 -IGRvbHBoaW4= 46759 -IExBVUdIVEVS 46760 -IElOVEVSVklF 46761 -5ZSJ 46762 -IHlhbmzEscWf 46763 -IHRvcnBlZG8= 46764 -IHNob3J0YWdlcw== 46765 -7J2065Oc 46766 -xLFsZMSx 46767 -IHBhd3M= 46768 -IG96b25l 46769 -IGN1bHRpdmF0ZWQ= 46770 -IEZvdA== 46771 -IG5vdG9y 46772 -0L3QvtC3 46773 -INC60L7RiA== 46774 -IHRvdWNoc2NyZWVu 46775 -IEFsbHk= 46776 -5pyA6L+R 46777 -IOunm+yeiOyWtOyalA== 46778 -INCh0LXRgA== 46779 -INCy0L/QvtC70L3QtQ== 46780 -IHBhcHJpa2E= 46781 -IER1c3Rpbg== 46782 -IGVmZWN0bw== 46783 -IG9waW5p 46784 -IG11dXQ= 46785 -IGjhu41j 46786 -IGludGVyamVjdA== 46787 -xJl0 46788 -IGJ1dHRz 46789 -dXJleg== 46790 -IFBpa2U= 46791 -IEhvaw== 46792 -IEd1aW5lYQ== 46793 -IENhdGhlZHJhbA== 46794 -IDE0MDA= 46795 -Q3Jh 46796 -Kyw= 46797 -66eb 46798 -s7Trj4TroZ0= 46799 -YWJ5cmlu 46800 -IHZpZGVvZw== 46801 -INC+0YDRg9C2 46802 -IHXFvg== 46803 -IGJ1c2NhbmRv 46804 -IEFzc2lzdGFuY2U= 46805 -6Zm9 46806 -IG1lbGhvcmVz 46807 -7KG0 46808 -IOuBvA== 46809 -IFJK 46810 -INiq2YU= 46811 -IG9taW4= 46812 -IG1vdG9yY3ljbGVz 46813 -IFNhcHA= 46814 -IHN1cHBseWluZw== 46815 -IEFsZ3Vu 46816 -IGFlcm9zcGFjZQ== 46817 -16LXnA== 46818 -b2NjdXA= 46819 -bGVpc3Q= 46820 -IOqxsOuKlA== 46821 -IGNvbXBsZXRh 46822 -YnJlcw== 46823 -ISg= 46824 -INCf0YDQtdC0 46825 -IGRpc2FkdmFudGFnZWQ= 46826 -IEF0dGVuZA== 46827 -IEp1ZGFo 46828 -4buLY2g= 46829 -eWxlbmU= 46830 -YWN0bHk= 46831 -IHNldHVwcw== 46832 -IGFtbW9uaWE= 46833 -IFNjaHdlaXo= 46834 -IFNoYW1l 46835 -IGJhbmRl 46836 -IEZ1ZWw= 46837 -IHRyb3VibGVzb21l 46838 -IG51bWVybw== 46839 -IE1PTQ== 46840 -INC/0YDQtdC00LvQsNCz 46841 -bWVudGlvbmVk 46842 -INCx0L7Qu9GM0YjQvtC1 46843 -IFZpa3Rvcg== 46844 -IFN0eWxlcw== 46845 -IGNydWNpZmllZA== 46846 -cnVjdHVyZWQ= 46847 -ZW52aXJvbg== 46848 -IG1vcmFscw== 46849 -IG1lZGl0YXRpbmc= 46850 -IGF4aWFs 46851 -aXNhbmNl 46852 -IEFic3Q= 46853 -R3JlZW4= 46854 -IOqxtOw= 46855 -IHF1YWRyYW50 46856 -IHBlcmdp 46857 -IGNhbWVyYW1hbg== 46858 -IFNlcXU= 46859 -IHBhdXNlZA== 46860 -IExhdWdoaW5n 46861 -6reA 46862 -Py4u 46863 -IMW7ZQ== 46864 -IHBlcm1pdGly 46865 -IGRldGVjdG9ycw== 46866 -IEhVRA== 46867 -YXZhbA== 46868 -IOyXrOq4sOq5jOyngA== 46869 -IGh1YnM= 46870 -IGJlc3RpbW10 46871 -INCx0YPQtNC10YLQtQ== 46872 -SU5URVJQT1NJTkc= 46873 -IHRlbmdhbg== 46874 -IGNyYXZl 46875 -IEJ1bmRlc3JlZ2llcnVuZw== 46876 -IEJsb29keQ== 46877 -IHVzYWJpbGl0eQ== 46878 -IEVhcw== 46879 -IMSR4buZbmc= 46880 -IDE5NTU= 46881 -IGtyaWVnZW4= 46882 -IGhhYml0dWFs 46883 -IGVzc2VudGlhbHM= 46884 -cmltaW5hbA== 46885 -IHJvb21tYXRlcw== 46886 -6YKj5bCx 46887 -INC/0LXRgNC10YXQvtC0 46888 -IG5naGk= 46889 -IG1lbmluZw== 46890 -IFN5bXBob255 46891 -IEh1Zw== 46892 -YWdnaQ== 46893 -IHdpZWQ= 46894 -IG1pdGFk 46895 -44Gj44Gm44GE44GG 46896 -dGVlbnRo 46897 -aWRhxIc= 46898 -U2F2ZQ== 46899 -IHJvYmnEhw== 46900 -IGJvdW5jZXM= 46901 -sJbsl5A= 46902 -c3RhcnM= 46903 -IHByYWdtYXRpYw== 46904 -IGNvZ25pdGlvbg== 46905 -IHdyYXBwZXI= 46906 -IHdhcnRlbg== 46907 -YWRo 46908 -IHBlbnNh 46909 -IEhlcnR6 46910 -IG7Emw== 46911 -IFJlaWQ= 46912 -IFBDcw== 46913 -IE1vbGU= 46914 -IC4uLi4u 46915 -IHByZWNpbw== 46916 -IENoYW1waW9uc2hpcHM= 46917 -6rCA6529 46918 -IHbDqXI= 46919 -IGNvcnJpZG9ycw== 46920 -IEVsZWN0cm9uaWM= 46921 -U2w= 46922 -INCw0LvQtQ== 46923 -IG92ZXJ0aHJvdw== 46924 -IGthYnVs 46925 -IFJFUw== 46926 -IEN5YmVycHVuaw== 46927 -0L7Qs9C+0LQ= 46928 -INCd0LDQsg== 46929 -IHdhbg== 46930 -IG1hbmlmZXN0YXRpb25z 46931 -IGN1YWxlcw== 46932 -IFdpc2U= 46933 -IEzDtnN1bmc= 46934 -IGV4Zm9s 46935 -IGVhcm5z 46936 -0YPRgdGC0LjRgtGM 46937 -IHNhcHA= 46938 -IEJyYXVu 46939 -IEJSQU5ET04= 46940 -7LmZ 46941 -IHNhbm8= 46942 -IEZFTA== 46943 -0YvQstCw0LnRgtC10YHRjA== 46944 -0L7QttC00LXQvdC40Y8= 46945 -IHNld24= 46946 -RnVu 46947 -IHJlY2lwcm9jYWw= 46948 -IGV4cGFuc2l2ZQ== 46949 -IFRyYWZmaWM= 46950 -IGt0w7NyZWdv 46951 -INmI2LM= 46952 -5pil 46953 -IOu5qA== 46954 -cHJvdmU= 46955 -aWdhcmU= 46956 -IGxvaA== 46957 -2KfYtg== 46958 -SG9wZQ== 46959 -IGRldm90ZWVz 46960 -IEdvbQ== 46961 -IHN0ZWFscw== 46962 -IFVtcw== 46963 -IFR3aWNl 46964 -44Ky 46965 -aXlpbQ== 46966 -IHJoeXRobWlj 46967 -IFZvcnRl 46968 -IHByZWZpeA== 46969 -b21pbmF0aW9u 46970 -IGRhdG8= 46971 -IGN1c3RhcmQ= 46972 -IFZPSUNF 46973 -5bee 46974 -IG1lbnk= 46975 -aXN0b3Jz 46976 -IO2YkQ== 46977 -IOyCtOyVhA== 46978 -IO2DhA== 46979 -IGtvcnQ= 46980 -IGFiYQ== 46981 -IFZlcmE= 46982 -ZXB5 46983 -IOy5tOuplOudvA== 46984 -IHN1Ym1lcmdlZA== 46985 -IENsb2Nr 46986 -IHRodW1ibmFpbHM= 46987 -IGJvYXN0 46988 -IEZhcmU= 46989 -ISFd 46990 -IMWbbQ== 46991 -IGthaWtraQ== 46992 -IFRlY2hub2xvZ2llcw== 46993 -7Jm4 46994 -44OS 46995 -0LjRgtCw0Lk= 46996 -5bCP5pmC 46997 -INCw0YI= 46998 -IGtub2Jz 46999 -IHJlaWNodA== 47000 -xrDhu6NuZw== 47001 -Z2xpbw== 47002 -IOunm+ydtA== 47003 -6rCQ7J2E 47004 -IGpvdGth 47005 -IEhhbmR5 47006 -IEhhYmVu 47007 -bm91cw== 47008 -IGlubGFuZA== 47009 -IGFtYXpvbg== 47010 -aG9vdGluZw== 47011 -U0w= 47012 -IGxlaXN0ZW4= 47013 -fiI= 47014 -IHByb3Zva2U= 47015 -IFR3aXN0 47016 -INeR15c= 47017 -IGRlcGFydGVk 47018 -6rCc66W8 47019 -IGtvbnNl 47020 -IENhcnd5bg== 47021 -7ZWY7Iug 47022 -aWRlbnRhbA== 47023 -RVNDTw== 47024 -IHR0ZW9rYm9ra2k= 47025 -IGRpemVuZG8= 47026 -57e0 47027 -xLFuZGFraQ== 47028 -aW1hc3U= 47029 -YWZhcg== 47030 -IGxhbmRmaWxs 47031 -IGNvcnJlY3Rpbmc= 47032 -IGNsZWFycw== 47033 -IE51bW1lcg== 47034 -SEFN 47035 -IGNhcnRyaWRnZXM= 47036 -IERpZXNlbA== 47037 -cGFjZWQ= 47038 -IG9ibGl2 47039 -IG1veWVucw== 47040 -IFNpbm5l 47041 -IFByZWlz 47042 -aWxpeg== 47043 -INGB0LzQvtC2 47044 -IGJyb2FkZW4= 47045 -5LuW5piv 47046 -eGVz 47047 -IGNhcmJvaHlkcmF0ZQ== 47048 -7Zi5 47049 -c2Vvaw== 47050 -IGVjaG9lcw== 47051 -IGNlc3M= 47052 -67CU 47053 -INCx0LjQt9C90LXRgQ== 47054 -IGxsYW1hZG8= 47055 -IGVzc2VudA== 47056 -IOydvOuwmA== 47057 -IEFpcmVz 47058 -cGhlbg== 47059 -IHplYnJh 47060 -IHN5bWJvbGlzbQ== 47061 -T25jZQ== 47062 -IHJhY2tz 47063 -IEthZmth 47064 -INGB0LXRgNGM0LXQtw== 47065 -IHNpbm4= 47066 -cGljaW91cw== 47067 -a2Fh 47068 -IG1vdGhlcmZ1Y2tlcg== 47069 -IGFwcHJlbnRpY2VzaGlw 47070 -IHJwbQ== 47071 -IHRheGF0aW9u 47072 -IGZ1cnJ5 47073 -IFNhY3JlZA== 47074 -INGA0LDQt9C8 47075 -cG9yYQ== 47076 -ZW5nZXM= 47077 -IO2XiOs= 47078 -INGB0LjQvQ== 47079 -IHNhbml0aXplcg== 47080 -IGNyaW5nZQ== 47081 -IFNjYQ== 47082 -0L7Rh9C90L4= 47083 -IG9mZXJl 47084 -IG1lbG9kaWVz 47085 -IFZlbHZldA== 47086 -IElocmVy 47087 -IEh5YnJpZA== 47088 -IEdpb3Y= 47089 -IGlyZ2VuZHdhcw== 47090 -IGRlcGVuZGU= 47091 -IFVzZXJz 47092 -IGh1bXA= 47093 -ZHJpdmluZw== 47094 -IHNm 47095 -IHJ1dGhsZXNz 47096 -4LmA4LiE 47097 -IGxlbW9ucw== 47098 -IGbDtnJldA== 47099 -IE9q 47100 -INC80LDQvNCw 47101 -IGludGVycGVyc29uYWw= 47102 -IGdldg== 47103 -IGFibm9ybQ== 47104 -0LjRgdC7 47105 -INC40L3QtA== 47106 -IGtvbnRyb2xs 47107 -IHJlZ3Jlcw== 47108 -IGxlZGdl 47109 -IGVyesOkaGx0 47110 -IFRhY3Q= 47111 -IGFycml2w6k= 47112 -IHN1YnN0YW50aXZl 47113 -IHNwb29uZnVs 47114 -endpc2NoZW4= 47115 -b29vb28= 47116 -IGNvbnRlbmlkbw== 47117 -IGJlc2w= 47118 -4buDbQ== 47119 -a3Rlbg== 47120 -SmFtaWU= 47121 -IHNhbmR5 47122 -5LiN5ZCM 47123 -4os= 47124 -IHBhc2U= 47125 -IGRldHRl 47126 -IEJlbGdpYW4= 47127 -6rCc6w== 47128 -dWxhcmVz 47129 -cnVk 47130 -aWdvcg== 47131 -IO2MrOs= 47132 -IHJlbWVkaWVz 47133 -IGJsYXN0aW5n 47134 -IFNpY2g= 47135 -INC+0LbQuNC0 47136 -IG1vbnN0cg== 47137 -IG1hbmlmb2xk 47138 -IGdsYXViZW4= 47139 -IEVTVA== 47140 -IHN0cmVhbWxpbmU= 47141 -IGxvYmJ5aW5n 47142 -IEdvdGhpYw== 47143 -dG9pcmU= 47144 -Li4n 47145 -IGTDqW1vY3I= 47146 -INC90LDQsdC70Y7QtA== 47147 -IHdzcMOzbA== 47148 -IGN6xJnFm8SH 47149 -5LiL6Z2i 47150 -aXPDqXM= 47151 -Z2FuZ2Vu 47152 -IGJlenBpZQ== 47153 -cmVtbGlu 47154 -6rCd 47155 -U3RpbGw= 47156 -IHJlc2lkZXM= 47157 -IGdlbGVjZWs= 47158 -IHTDqWzDqXBob25l 47159 -IHBld24= 47160 -IGxlb3BhcmQ= 47161 -IGNvbXBsaW1lbnRhcnk= 47162 -IGNyaWI= 47163 -IEFuaW1hbHM= 47164 -IGdlaWw= 47165 -ZXNzZWw= 47166 -IGdhcmRlcg== 47167 -IGNhdGNoeQ== 47168 -5qi5 47169 -IEV0cw== 47170 -IENvbW1lcmNpYWw= 47171 -IERFTk5JUw== 47172 -IENvb3JkaW5hdG9y 47173 -IEFiaWdhaWw= 47174 -ZmZmZmZm 47175 -4bqlcA== 47176 -IHBlcXVlw7Fh 47177 -IGluamVjdGlvbnM= 47178 -Y2VrdA== 47179 -IHBoaWxhbnRocm9weQ== 47180 -IHB1Y2s= 47181 -IGNlbGVicmF0ZXM= 47182 -IER1bms= 47183 -IERsYXRlZ28= 47184 -44G+44Gg 47185 -zrTOrg== 47186 -Z3JhZHVhdGU= 47187 -IE1vYmls 47188 -dGlsbA== 47189 -YWNhbQ== 47190 -IHlvbGtz 47191 -IHRhbmdsZWQ= 47192 -IG1hbmlhYw== 47193 -IG9ibGlnZWQ= 47194 -IExhaW5r 47195 -IHZlcmRlcg== 47196 -IERhbW9u 47197 -IG11dGFudA== 47198 -IGhvcHBpbmc= 47199 -IHJlaW5z 47200 -IGludmVydGVy 47201 -IGNvbnRlbXB0 47202 -16DXoQ== 47203 -bGVhcm5pbmc= 47204 -TWlzcw== 47205 -INCT0L7RgQ== 47206 -IE1leWVy 47207 -6ruY7ISc 47208 -6aOO 47209 -15XXoNeZ150= 47210 -YXNraW5n 47211 -IHRyaW1taW5n 47212 -IHRyZWFzdXJ5 47213 -IHNlbnRl 47214 -QXVzdA== 47215 -IFVudGVyc3TDvHR6dW5n 47216 -IENvbWVkeQ== 47217 -IEFuYWtpbg== 47218 -6bk= 47219 -0YDRg9GC 47220 -IEhhcmk= 47221 -b2dyYXBoZXJz 47222 -IG9hdG1lYWw= 47223 -IEJvdHM= 47224 -5LiN5LqG 47225 -INC/0LDQu9GM 47226 -IGFja25vd2xlZGdlbWVudA== 47227 -eGlj 47228 -IOq0gOyLrA== 47229 -Z2FzcGluZw== 47230 -IOOBlQ== 47231 -IHRlcnJhY2U= 47232 -IG9ybmFtZW50cw== 47233 -IE1FUg== 47234 -Y29tbWl0dGVl 47235 -IOyXhuyKteuLiOuLpA== 47236 -IHJpag== 47237 -6bM= 47238 -16bXnQ== 47239 -bGVtZQ== 47240 -IGxpYmVydGllcw== 47241 -IGZlbGxhcw== 47242 -IENvcHBlcg== 47243 -YmVuY2g= 47244 -IElkZWE= 47245 -4buNbg== 47246 -0YjQsA== 47247 -IHZlcnNpw7Nu 47248 -z4TOv8+N 47249 -INCc0Lg= 47250 -INC/0YDQuNC70L7Qtg== 47251 -IGJveGVy 47252 -IFRhbm5lcg== 47253 -IE1veQ== 47254 -7LmY64qU 47255 -VGhy 47256 -IHRpbmhhbQ== 47257 -IHBvbGlzaGluZw== 47258 -IGNvbnNlcXVlbnRseQ== 47259 -IGFtZW5pdGllcw== 47260 -IEtJ 47261 -IEdSRUVO 47262 -IEZyYW5raWU= 47263 -0L3QuNGC 47264 -aXR0ZWw= 47265 -0YHQutC+0LU= 47266 -dXJzZWQ= 47267 -IHVwYnJpbmdpbmc= 47268 -IHRo4bup 47269 -IOyLneycvOuhnA== 47270 -IHdoaW0= 47271 -IGNoaW5lc2U= 47272 -Y29uZmlkZW5jZQ== 47273 -IEplZGVy 47274 -44Gq44Gu44Gn 47275 -YWpjaWU= 47276 -IFRvdXM= 47277 -IFBvd2Vycw== 47278 -4burYQ== 47279 -b3RoZXJtYWw= 47280 -INCy0YvRiNC1 47281 -cmFsZQ== 47282 -2KfYrg== 47283 -IOyngOybkA== 47284 -IMOpcGlzb2Rl 47285 -IHN1bHBo 47286 -IGVuY2FyYQ== 47287 -a3JhZnQ= 47288 -YWxhcsSx 47289 -IENvbWVz 47290 -IGRpdnVs 47291 -IFJ1ZG9scGg= 47292 -IE11c2U= 47293 -IHV0ZW5z 47294 -IOyekOyjvA== 47295 -IHBhbmE= 47296 -IFZlZ2V0YQ== 47297 -IFBIUA== 47298 -IE5TQQ== 47299 -ZW50aW4= 47300 -IENhcm5lZ2ll 47301 -2KfZig== 47302 -acSZY3k= 47303 -SGFycnk= 47304 -IGbEsXI= 47305 -0KHQvw== 47306 -IGdsYWRseQ== 47307 -IGF2ZXJhZ2luZw== 47308 -7ZWY6rKg7Iq164uI64uk 47309 -0LvRj9GO0YLRgdGP 47310 -INCc0LXQvdGP 47311 -IHF1b3RhdGlvbg== 47312 -cmlyZXM= 47313 -aXRjaGVucw== 47314 -YXllZA== 47315 -IHVuYXR0 47316 -IFBlcmV6 47317 -INC+0YLQvNC10YI= 47318 -IHRhY3RpbGU= 47319 -IEV1aA== 47320 -aXNpbmk= 47321 -YnVo 47322 -IGhhdMSxcg== 47323 -IOyeiOycvA== 47324 -IHBvbGljeW1ha2Vycw== 47325 -s7TshLjsmpQ= 47326 -YWPEsQ== 47327 -IM66zrk= 47328 -IHJlZ2lzdGVyaW5n 47329 -cmV0bw== 47330 -IFNwcmlua2xl 47331 -IEdyYW1teQ== 47332 -YXh0ZXI= 47333 -INCx0Lg= 47334 -IHNpdHRlcg== 47335 -IHByZWRpYw== 47336 -IHRoaW5seQ== 47337 -IHN0cnVt 47338 -IGFnZ3Jhdg== 47339 -IGFoYQ== 47340 -2LHYrA== 47341 -bWVsbG93 47342 -IGNvbnN0YW50ZQ== 47343 -IExhdXQ= 47344 -aXN0b24= 47345 -IHRyYW5zaXRpb25lZA== 47346 -IENhbWJvZGlh 47347 -44GE44GN44G+44GZ 47348 -6Lef5aSn5a62 47349 -YXJ0ZWQ= 47350 -IG1pc2Y= 47351 -IFB1bmt0ZQ== 47352 -jOuToA== 47353 -IHRyZW1ibGluZw== 47354 -IGdlc3Bhbm50 47355 -INi52YTZitmH 47356 -INC90LjQutCw0LrQuNGF 47357 -IOu2gOuTnOs= 47358 -INGA0LDQt9Cy0LjRgg== 47359 -IGl0Y2h5 47360 -IGNpZW50bw== 47361 -IHBsYWlucw== 47362 -IGtpdHRlbnM= 47363 -IGJhY2tsb2c= 47364 -IFByZXNpZGluZw== 47365 -cHRh 47366 -IGhhdm9j 47367 -IERhcnJpbg== 47368 -INCb0Y7QsQ== 47369 -IHNlZ3JlZ2F0ZWQ= 47370 -IGdoZXR0bw== 47371 -IGVybGVidA== 47372 -IGRydWdpZWo= 47373 -IFNpeHQ= 47374 -5Y+D 47375 -4Lij4Liw 47376 -dWVuY2lh 47377 -IO2VmOq4sA== 47378 -IOuGjQ== 47379 -IHJvYmk= 47380 -IHBpb25lZXJz 47381 -IG1pbGxpYXJkcw== 47382 -IFdpdGNoZXI= 47383 -IOustOyXhw== 47384 -b3Jybw== 47385 -bWFzcw== 47386 -IGRpdmVyZ2VuY2U= 47387 -IFJpdmVyYQ== 47388 -IE5vb2RsZXM= 47389 -IGVuZHJvaXQ= 47390 -IEtvc3Rlbg== 47391 -INC00YDRg9Cz0LA= 47392 -IG3DrW5pbW8= 47393 -IEthemFraHN0YW4= 47394 -2KrZhw== 47395 -INCy0L7Qt9C00YM= 47396 -IGdlc2NocmllYmVu 47397 -IE5pbA== 47398 -0YHQutC4 47399 -IEZyw7xo 47400 -IGJldmVyYWdlcw== 47401 -5rqQ 47402 -IEdvbg== 47403 -5pio 47404 -QXJpbg== 47405 -IEludHJv 47406 -b2NhbHlwdGlj 47407 -IGV4aGF1c3Rpb24= 47408 -IFN0YXR1cw== 47409 -IEJhdHRlcnk= 47410 -w6lzeg== 47411 -o7zr 47412 -YWlyeQ== 47413 -IOuztOyXrOuTnOs= 47414 -IGRpc3Bhcml0eQ== 47415 -2Yw= 47416 -IFR1Y3Nvbg== 47417 -IGJyaWdodGx5 47418 -cHJvYmxlbQ== 47419 -IGJpb21hc3M= 47420 -6ZmN 47421 -p4k= 47422 -IGh1cmRsZQ== 47423 -IHdhdmVsZW5ndGhz 47424 -IDw8 47425 -IHRlYW1lZA== 47426 -RkZGRg== 47427 -IFNsaW0= 47428 -b21pYWw= 47429 -IHVudmVpbGVk 47430 -IFZlcmVpbg== 47431 -2YLYtw== 47432 -ZXN0cnk= 47433 -IGNsw6Fz 47434 -IGNoZWRkYXI= 47435 -IGFjY3VzaW5n 47436 -IFNjaWVudGlmaWM= 47437 -INCx0YPQtNC1 47438 -IEN5cnVz 47439 -zrXPhM61 47440 -hpPqs6A= 47441 -IOuzhA== 47442 -IGN1cmQ= 47443 -IHJlZmVycmFscw== 47444 -c2hpZnQ= 47445 -5Y2V 47446 -bmlrw7N3 47447 -IG1pZXI= 47448 -IGNvbmZyb250aW5n 47449 -6rKD64+E 47450 -YXds 47451 -IHRyeWlu 47452 -IOq3uOuemOyalA== 47453 -IGNoaWFy 47454 -IOyYpOuKmOuPhA== 47455 -5pS/5rK7 47456 -ZXNxdWU= 47457 -IG1pc21vcw== 47458 -IFNoYWs= 47459 -IHNvY2lhdXg= 47460 -IHBpxZ8= 47461 -IGtpxZ9p 47462 -IGN5YW4= 47463 -aGF5 47464 -YmV3 47465 -Ym9k 47466 -IM65 47467 -IE1haW5seQ== 47468 -0Y7RgtGM 47469 -aGFiaXR1ZGU= 47470 -INGB0L/QvtC60L7QuQ== 47471 -6Lef5oiR 47472 -IHByZWNvbg== 47473 -IE1hbmR5 47474 -8J+kow== 47475 -aWxsb3M= 47476 -IGdydXBw 47477 -IGNydW1ibGU= 47478 -IGNvbnN0cnVjdG9y 47479 -ZXJ2aWNlcw== 47480 -IGxpZ2h0aG91c2U= 47481 -IENvbmNlcHQ= 47482 -0LDQvdGC0Lg= 47483 -YWx0cm8= 47484 -aG9wZQ== 47485 -IEFsbGVn 47486 -7Ja066W8 47487 -cGllY2Vz 47488 -b3VudGVy 47489 -IO2VmOuLiOq5jA== 47490 -IOyduO2EsOs= 47491 -IHbDqXJpdGFibGU= 47492 -IHRocmVhZGVk 47493 -YmxpbmQ= 47494 -gpjrnbw= 47495 -IHRyYXlz 47496 -IEVkaXNvbg== 47497 -IMOWeg== 47498 -IFN0ZXZpZQ== 47499 -IGxlbmRlcg== 47500 -IGJyaWdhZGU= 47501 -IGRldXRzY2hl 47502 -bXVmZmxlZA== 47503 -YmFydA== 47504 -IGluc2FuaXR5 47505 -IHNhdnZ5 47506 -IHNlbnNhdGlvbmFs 47507 -IGRlcmVjaG9z 47508 -IE1Y 47509 -INC/0YDQtdC/ 47510 -IHRocmVhdGVucw== 47511 -IHJlYWx0w6A= 47512 -IGluZGljYXRpdmU= 47513 -IGNob3Bz 47514 -IGJlbmVmaXRpbmc= 47515 -IFZlcm5vbg== 47516 -IFN0cmFuZA== 47517 -bnVu 47518 -cXVlbnRseQ== 47519 -MTAx 47520 -IGVlbA== 47521 -7IiZ 47522 -cmludHM= 47523 -INmF2LM= 47524 -INio2K8= 47525 -INC/0L7RgdGC0YDQvg== 47526 -IHlhcG3EscWf 47527 -IG9sbWFzxLE= 47528 -IGllZGVyZWVu 47529 -b2zDqQ== 47530 -a2Vm 47531 -IOuwnOyDnQ== 47532 -IHJhaW5lZA== 47533 -IGFsbWlnaHR5 47534 -INCy0YvQtA== 47535 -IENQUg== 47536 -RnJl 47537 -IGluaGFiaXRlZA== 47538 -IGFyYmV0cw== 47539 -IGFraW4= 47540 -0LDRgdGC0LI= 47541 -dmFuaWE= 47542 -IGjDpHVmaWc= 47543 -IE1hdHRl 47544 -c29ycnk= 47545 -SmVubnk= 47546 -INCz0YDQsNC0 47547 -IHdoaXQ= 47548 -IGJyb2tlcnM= 47549 -5a+f 47550 -IGhpbmU= 47551 -YXN0ZW4= 47552 -INCz0YDRgw== 47553 -TUI= 47554 -IFBSSQ== 47555 -U2Fi 47556 -IHdyZXN0bGVy 47557 -IGZhY2lsaXRhdGluZw== 47558 -IGVoa8Ok 47559 -IENyZWQ= 47560 -IDEyNw== 47561 -IG5vdGhpbg== 47562 -IG1hbmRhdGVk 47563 -5a+M 47564 -0YPRgtGB0YLQsg== 47565 -RnJhbms= 47566 -IHdvcnM= 47567 -IGR6aWXFhA== 47568 -IFVuZGVyZ3JvdW5k 47569 -IHpuYWpkdQ== 47570 -IELDpA== 47571 -IFByaW56aXA= 47572 -0LDRgtC10LvQtdC5 47573 -IHZldGVyaW5hcg== 47574 -IHNwbGVuZGlk 47575 -IHJvenA= 47576 -IHBzeWNob3BhdGg= 47577 -aWdvbg== 47578 -IGhvcHM= 47579 -IGPhuqdu 47580 -IFhpYW4= 47581 -IHRyb2lzacOobWU= 47582 -IHByb2R1Y3Rv 47583 -IGRlxJ9lcg== 47584 -IENvbnRpbnVpbmc= 47585 -0LjQstCw0Ls= 47586 -Y8Sxaw== 47587 -IG1vaXN0dXJpemVy 47588 -V2hpdGU= 47589 -IHNpaXM= 47590 -IEV2ZXJlc3Q= 47591 -aWVuY2Vk 47592 -IGPhuqNt 47593 -IEphcG9u 47594 -tOyghA== 47595 -IHRlbsOtYW4= 47596 -IGVuY2FudGE= 47597 -TW0= 47598 -IGRyb3Bkb3du 47599 -IEl5YQ== 47600 -s7TrqbQ= 47601 -IHdvcmRpbmc= 47602 -IFNxdWVlemU= 47603 -IE1hcGxl 47604 -IGNsYXJpZmllZA== 47605 -IE11bmljaXA= 47606 -IFJvdWdl 47607 -IE5pY2tp 47608 -IEdvbw== 47609 -dm9sdA== 47610 -dGVr 47611 -ZmVjdHVyZQ== 47612 -ZnJlZA== 47613 -YXJyaXZl 47614 -44O844GE 47615 -dGV6 47616 -RXA= 47617 -IG9icmFz 47618 -IFZJRA== 47619 -IFJpdg== 47620 -IE1vZGk= 47621 -aWJl 47622 -IGFjb250ZWNlbmRv 47623 -IGltaXRhdGlvbg== 47624 -IGNhbW91ZmxhZ2U= 47625 -IHNwYW5uaW5n 47626 -IFNFQ1JFVA== 47627 -IE9yZW8= 47628 -7IaM66as 47629 -IGh1bmNo 47630 -IGNhxYJl 47631 -IHNwb250YW5lb3VzbHk= 47632 -IFBlcmQ= 47633 -IGV0YXA= 47634 -IEhvbGU= 47635 -IERpc2FiaWxpdHk= 47636 -IGFmdGVybGlmZQ== 47637 -5oGp 47638 -IHRlc3RpZmllZA== 47639 -IHByZXN1cA== 47640 -IHBldHJvbGV1bQ== 47641 -IGNvbnRyYXJpbw== 47642 -IEFzc2Vzc21lbnQ= 47643 -xJ9sdQ== 47644 -IHBlc3Rz 47645 -IGRpbGln 47646 -INCy0YHRgtGA0LXRgg== 47647 -IGNvbnPDqXF1 47648 -IGNhbm5vbnM= 47649 -IGNhbm9l 47650 -IE1pbGU= 47651 -IGNpdG95 47652 -IGJlZ2dlZA== 47653 -IE1pbm5pZQ== 47654 -xYJ5Y2g= 47655 -IHByaW5jaXBl 47656 -z4DPjM69 47657 -bW5pZWo= 47658 -IHdlcnQ= 47659 -IOuLpOuTpA== 47660 -YW5zZQ== 47661 -IHVuY2xlcw== 47662 -IHByb3ZvY2F0aXZl 47663 -IGludGVyc2VjdGlvbnM= 47664 -IGRlbW9jcmF0cw== 47665 -IEp1bGl1cw== 47666 -0LjQvdC60Lg= 47667 -eWd1c2Fs 47668 -INec15U= 47669 -IGdqb3JkZQ== 47670 -IGdhc2tldA== 47671 -IEJvY2s= 47672 -IMSwbg== 47673 -YnJlYXQ= 47674 -IEVxdWl0eQ== 47675 -YXJkxLE= 47676 -INC60LDQvdCw0LvQtQ== 47677 -INC00L3QtdC5 47678 -IHThu5tp 47679 -IGZpeHR1cmU= 47680 -IGFidXNlcw== 47681 -IHZheWE= 47682 -IG91dmVydA== 47683 -IG11bHRpY3VsdHVyYWw= 47684 -IGNvbnRleHRv 47685 -IFNlc2FtZQ== 47686 -IGTDqXBs 47687 -IGNvbnNvbW0= 47688 -IFBhcnRl 47689 -IHBlbQ== 47690 -IENvbmFu 47691 -INCx0ZbQu9GM 47692 -IHBlcnN1YWRlZA== 47693 -IGRyYWlucw== 47694 -TW9v 47695 -Rk9SRQ== 47696 -INCx0LDRgg== 47697 -IGZvZA== 47698 -IFByb2R1Y3Rz 47699 -7KeE7Kec 47700 -ICJb 47701 -IFdpY2s= 47702 -IE5hcnV0bw== 47703 -0L3QsNC70Lg= 47704 -cnl3 47705 -IGxvZGdl 47706 -IGluaA== 47707 -IHZvbnRhZGU= 47708 -IGRpag== 47709 -IEplc8O6cw== 47710 -TG9va2luZw== 47711 -IGZvcmVhcm0= 47712 -IEludGVncmF0aW9u 47713 -IEhBUlJJUw== 47714 -IHRvb2xiYXI= 47715 -bGVhZGVy 47716 -IHNlbGRvbQ== 47717 -INCx0YDQvtGB 47718 -IEtvb2s= 47719 -0L7QvdC0 47720 -IG1vbm9wb2w= 47721 -IG1pbGxldA== 47722 -IGxpcmE= 47723 -IEFzaWFucw== 47724 -IDE4OTA= 47725 -Y2nEn2lt 47726 -IGVkZW4= 47727 -IElLRUE= 47728 -IE5laWdoYm9y 47729 -IEthenV5YQ== 47730 -w7xk 47731 -IHBzeWNoZWRlbA== 47732 -IGVudmlzaW9uZWQ= 47733 -5Z2X 47734 -IO+3uw== 47735 -IHd1bmRlcg== 47736 -IEJ1bGdhcmlh 47737 -QnJpZA== 47738 -IG1hcnJvdw== 47739 -IGRlcGljdGlvbg== 47740 -IFRpbg== 47741 -IFBoYXJpc2U= 47742 -IGVpbnppZ2U= 47743 -IGJsaW5kbHk= 47744 -44Gb44Gm 47745 -IGRlZmVucw== 47746 -RGlyZQ== 47747 -IHZpYnJhdGluZw== 47748 -IHRyb2xscw== 47749 -IGRpc3Jlc3BlY3RmdWw= 47750 -IHdvZA== 47751 -IHN0aW11bGk= 47752 -IGNyZWVwaW5n 47753 -IGNsYWlyZW1lbnQ= 47754 -IHNjYXJpZXN0 47755 -IGTDqWNvdXZyaXI= 47756 -IDEwNA== 47757 -INCy0LXRgNGF 47758 -IMWCYXQ= 47759 -IHLDs8W8bmU= 47760 -IGJhcmxleQ== 47761 -IFJlcGw= 47762 -IFR3ZQ== 47763 -a2tl 47764 -IOOBneOCjA== 47765 -IFJlZG1p 47766 -IE1ldHJvaWQ= 47767 -IM6uz4TOsc69 47768 -Q2hlY2s= 47769 -IFNFTg== 47770 -IGlkbw== 47771 -0YLQvtGA0LjQuA== 47772 -w7Nw 47773 -VU5LTk9XTg== 47774 -IMOkbmRlcm4= 47775 -IEp1aWNl 47776 -IEdlc2ljaHQ= 47777 -5bCx5pyD 47778 -INC90LDRgdGC0L7Qu9GM0LrQvg== 47779 -7YOV 47780 -wq0= 47781 -ZXhoYWxlcw== 47782 -IOy0iQ== 47783 -IGpzZW0= 47784 -z4DPic+C 47785 -IGl0dA== 47786 -66qF7J20 47787 -IHJlbWl4 47788 -IGJsb3Nzb21z 47789 -IFJlbmVl 47790 -aXNhdGlvbnM= 47791 -7Iqk7YSw 47792 -IOuztOydtOuKlA== 47793 -dWVzdGFz 47794 -b3BlZGlh 47795 -IEFpbQ== 47796 -7J207KaI 47797 -c2NlbmU= 47798 -IGxlYWthZ2U= 47799 -dWNrdA== 47800 -U2Fk 47801 -QXNr 47802 -IHN1c3BlbnNl 47803 -IGltcG9zdA== 47804 -IFN0cmF0ZWdpYw== 47805 -IEl0w61z 47806 -4oCM 47807 -IGtleWJvYXJkcw== 47808 -IGFtdXNpbmc= 47809 -b2dy 47810 -aWRlcm1hbg== 47811 -npY= 47812 -INCy0LjQttGD 47813 -IGRpcHM= 47814 -IGFwb2xvZ2l6ZWQ= 47815 -IFNUQVI= 47816 -IGVzY3VlbGE= 47817 -IENoaW5n 47818 -0L3QtdC90LjRjw== 47819 -IOu2gOu2hOydtA== 47820 -IEZsZWV0 47821 -IHNhbWI= 47822 -IGVudHNwcmVjaGVuZA== 47823 -IGVsZWN0cm9kZXM= 47824 -IEZyZWloZWl0 47825 -5oiR5LiN55+l6YGT 47826 -IFNocmlt 47827 -acOfZQ== 47828 -IHNlbGVjdGlvbnM= 47829 -IGZvcmRp 47830 -IGRvc3M= 47831 -0Y/Rhw== 47832 -IGRpc2NyaW1pbmF0ZQ== 47833 -IEF1w59lcmRlbQ== 47834 -IGRlc2Vudm9sdg== 47835 -IEludGVybmFs 47836 -IEJlbmVkaWN0 47837 -5a+G 47838 -IFNoaXY= 47839 -TWlzc3k= 47840 -INC+0LHQvdCw0YDRg9C2 47841 -INC90LDRgdGC0YDQvg== 47842 -IGNvbnRyb2xhcg== 47843 -IExpYQ== 47844 -IG9waW9pZHM= 47845 -YW50dQ== 47846 -IGN1cGJvYXJk 47847 -5oGQ 47848 -0LPQtQ== 47849 -YWNodHM= 47850 -IGN1cmF0ZWQ= 47851 -IHhlbQ== 47852 -IHdlYXJ5 47853 -IGJyZXRocmVu 47854 -IGJ1ZGdldGluZw== 47855 -IHBvdXJ0YW50 47856 -6Zq7 47857 -YWlzaWE= 47858 -INC+0YLQstC10Yc= 47859 -IEdJUw== 47860 -zrzOsc65 47861 -INep15TXldeQ 47862 -IHNhdWQ= 47863 -IGzhu5s= 47864 -0JXQog== 47865 -dWJpbmU= 47866 -INC90YPQttC10L0= 47867 -IGtpZG5hcHBpbmc= 47868 -IGJyYXQ= 47869 -IFRlcnJl 47870 -IE1vbmV0 47871 -IOuniOyKpO2B 47872 -IGZsYXNoeQ== 47873 -IElTQk4= 47874 -IGZyZWVsYW5jZQ== 47875 -aWFnZQ== 47876 -IGp1bmdl 47877 -7Lap 47878 -Y2VyYWw= 47879 -INGC0L7Rh9C60Lg= 47880 -IGZvcm11bGF0ZQ== 47881 -IEZFUg== 47882 -IERhcnRtb3V0aA== 47883 -7Jy866m07ISc 47884 -5aKD 47885 -b3dpxIU= 47886 -IOuUlOyekA== 47887 -IHJlZ2ltZW50 47888 -IG1ldGFib2xpc21v 47889 -IFBhcnI= 47890 -IOy2qeu2hA== 47891 -IHNhbml0eQ== 47892 -IExhbA== 47893 -IEfDtg== 47894 -IEdsYQ== 47895 -IHByb3Rv 47896 -IG1pY3Jvc2NvcGlj 47897 -IGthbmc= 47898 -IFNjYWxpYQ== 47899 -IHB1Zw== 47900 -IFNjb3Jl 47901 -IFNhdmFubmFo 47902 -IGdhcmRl 47903 -IE5PUg== 47904 -5bCN5ZCn 47905 -IHNjaGVpbnQ= 47906 -IHDDs8WC 47907 -IGNvcnJp 47908 -IGJydXRl 47909 -IMWCYWQ= 47910 -5LuW5Lus 47911 -IHN1Y2NlZWRpbmc= 47912 -IGJpY3ljbGVz 47913 -Tm9u 47914 -IHNlZWtlcnM= 47915 -IHVuY29uZGl0aW9uYWw= 47916 -IHJoeW1lcw== 47917 -IEdhcmFnZQ== 47918 -IGludm9pY2U= 47919 -IGNhbnZp 47920 -bmVjaw== 47921 -IGN1c3RvbWl6YWJsZQ== 47922 -aXJpdHVhbA== 47923 -UXVlZW4= 47924 -7ZWY7Iuc64qU 47925 -IHBvd2VybGVzcw== 47926 -IGNzYWs= 47927 -5LiN5Lya 47928 -aXNvZnQ= 47929 -IOygle2ZlQ== 47930 -IG5ow6Ju 47931 -IE1BTkQ= 47932 -IEhhZg== 47933 -IHJldm9sdmVz 47934 -5Lmf5Y+v5Lul 47935 -b3Zhbg== 47936 -YXJvbw== 47937 -IEdyaW5k 47938 -6Zuq 47939 -IGluZGlzcGVuc2FibGU= 47940 -IGNvbnN1bHRlZA== 47941 -IENsaW5pY2Fs 47942 -QWNj 47943 -IG9saG9z 47944 -IG1vbnRlcg== 47945 -IEhhbmE= 47946 -ZXRhaA== 47947 -IHZhYW4= 47948 -IHRpZ2Vycw== 47949 -IGNhdWN1cw== 47950 -8J+Ygg== 47951 -s7TsnpA= 47952 -cG93ZXJz 47953 -aXVtcw== 47954 -IO2GoOs= 47955 -IHRyYWRpY2lvbmFs 47956 -IHJlc29uYXRlZA== 47957 -IOyLoOq4sA== 47958 -dGhlbQ== 47959 -Um9iZXJ0 47960 -IGVsZW1lbnRv 47961 -IGFudGlk 47962 -INC+0LHRgQ== 47963 -IG5hdGl2ZXM= 47964 -IGxvY2E= 47965 -b3dtZW50 47966 -IFRpZ2h0 47967 -IOaAnQ== 47968 -IG1lbGFu 47969 -IE51ZQ== 47970 -YW1pcw== 47971 -IHNvcmdlbg== 47972 -YXPEsW5h 47973 -SG9tZQ== 47974 -IFBVQkc= 47975 -IGF3ZnVsbHk= 47976 -IFNob3Jl 47977 -IFBlcmNow6k= 47978 -IExhdQ== 47979 -IENpbmRlcmVsbGE= 47980 -IENoZXN0 47981 -IHNlbWFudGlj 47982 -IGRlc2VydGVk 47983 -IE1vbW8= 47984 -IEhlcm5hbmRleg== 47985 -Z2VuZXM= 47986 -IEFkdWx0 47987 -0LjRh9C10YHQutC+0LPQvg== 47988 -b3NoaW1h 47989 -IGNhcmFjdGVyw61zdGljYXM= 47990 -IEtM 47991 -tOyepQ== 47992 -b2Nhcg== 47993 -IGZlaGx0 47994 -IGRydWs= 47995 -IFBvcHB5 47996 -RU5HTElTSA== 47997 -IFZlcmdsZWljaA== 47998 -QnJpZW4= 47999 -IHJlY29tcA== 48000 -INGB0LQ= 48001 -IG1lcmdlcg== 48002 -IG1hcmtldGVycw== 48003 -IGhvbmV5bW9vbg== 48004 -IHBlbnNv 48005 -IGJlbGxp 48006 -0LXRgtGD 48007 -IGJhbmtlcg== 48008 -Q2FtZXJh 48009 -IFN0YWxs 48010 -IFN0YW1w 48011 -IEJpdGU= 48012 -0LXQttC00LU= 48013 -IHPDvHI= 48014 -IGfDvMOn 48015 -IFBhc3NvdmVy 48016 -IEJ1Z8O8bg== 48017 -INGB0L7QttCw0LvQtdC90LjRjg== 48018 -INC90LjQtw== 48019 -IG1hbnVyZQ== 48020 -IGdsYWNpZXI= 48021 -6KuH 48022 -UkFZ 48023 -dGVycm9y 48024 -IHNhbGFkcw== 48025 -IGh1cnJpY2FuZXM= 48026 -IERlc2lnbmVy 48027 -YXRvcmlv 48028 -IGZhY3R1YWw= 48029 -IFRhbW15 48030 -INC30LLRg9GH 48031 -IGludHJvZHVjdGlvbnM= 48032 -IGhvdXNla2VlcGluZw== 48033 -IGhhbmdlcg== 48034 -64uY6w== 48035 -YWt0ZQ== 48036 -IENvbGE= 48037 -J10= 48038 -IEdlbmRlcg== 48039 -0L7RgNC+0L0= 48040 -aXBzZQ== 48041 -aWNpYXM= 48042 -IHN1Y2Nlc3NpdmU= 48043 -IHBvbGl0aWM= 48044 -IGjDtmhlcg== 48045 -IFFpYW8= 48046 -IEdpbW1l 48047 -INC70L7Qtg== 48048 -IHNlYg== 48049 -IFdlaXRlcg== 48050 -IFNha3VyYQ== 48051 -IEJvdWxkZXI= 48052 -IEFtw6lyaWNh 48053 -cGXFgm5pZQ== 48054 -IHRlY25vbG9nw61h 48055 -aXNob3Bz 48056 -ZnVy 48057 -IG1vb25saWdodA== 48058 -IGRpc3BlcnNlZA== 48059 -IHJleg== 48060 -0LXQvdC90L7QtQ== 48061 -0LDQu9GM0L3Rg9GO 48062 -IFR3ZWx2ZQ== 48063 -IEhPUg== 48064 -7Iuk7Z6I 48065 -aWxhZ2U= 48066 -IHNoYWRlZA== 48067 -IHJlc3VtZXM= 48068 -IFBlYW51dA== 48069 -IE1JTEw= 48070 -YXBvbnM= 48071 -IFVGQw== 48072 -IFNvbGU= 48073 -IGpveXN0aWNr 48074 -IE9saXZpZXI= 48075 -d2FybWluZw== 48076 -IHN5bGxhYnVz 48077 -INC+0LHRidC1 48078 -IGhp4buHbg== 48079 -IGZlc3Rh 48080 -IGNyYWRsZQ== 48081 -IFphYw== 48082 -IHJlbWVtYnJhbmNl 48083 -IOqwmeyVhOyEnA== 48084 -IHBpxJlr 48085 -IGNvZXhpc3Q= 48086 -IFZJSQ== 48087 -IMOhcmVhcw== 48088 -IHV3YcW8 48089 -IG9ic2VydmVycw== 48090 -IG3DpG5uaXNrb3I= 48091 -Y29vbg== 48092 -IERBTQ== 48093 -IG5hc3p5bQ== 48094 -IGFsbGlnYXRvcg== 48095 -IEZyZWV6ZQ== 48096 -IEVzdGF0ZQ== 48097 -INGC0YDQsNC00Lg= 48098 -IHVuZGVyY292ZXI= 48099 -IG5pZXM= 48100 -IEZlaGxlcg== 48101 -cGxpbg== 48102 -IEthYnVs 48103 -aWxhdGU= 48104 -IOqzoOyWkQ== 48105 -IG1vcA== 48106 -7IS8 48107 -IGFuZGVyZXI= 48108 -IEtFTEw= 48109 -0L7QutC4 48110 -INC20LXRgdGC 48111 -IGdyYXppbmc= 48112 -IGRhw60= 48113 -IGNhcGl0YWxpemU= 48114 -IGFwZXg= 48115 -IG51cnR1cmluZw== 48116 -IGNvcnRhcg== 48117 -IGNvbnRyYWM= 48118 -xLFtxLF6xLE= 48119 -IHRhbmRlbQ== 48120 -6YO95pyJ 48121 -Z2VtZW50 48122 -INGB0LjRgdGC0LXQvNCw 48123 -IG1hbnF1ZQ== 48124 -aWFqxIU= 48125 -V09S 48126 -INin2Kg= 48127 -IGNhcnRz 48128 -QU5P 48129 -IOuwm+qzoA== 48130 -IENlbmE= 48131 -IEJpb2xvZ3k= 48132 -aWRhcg== 48133 -IGHFvA== 48134 -ZXJuZQ== 48135 -YW51 48136 -IHRoYW5rZWQ= 48137 -IHN1Ym1hcmluZXM= 48138 -IG1hbmlj 48139 -INC80L7Qtw== 48140 -5LyK 48141 -aW5zdGFudA== 48142 -ZXNzZW50aWFs 48143 -IHNhbXVyYWk= 48144 -IHBhc3Rp 48145 -IGFsYW4= 48146 -IGJyb2No 48147 -IGJha2Vy 48148 -IEd1aWxs 48149 -qLw= 48150 -IHdpdGhkcmF3bg== 48151 -64ud 48152 -UGVyZmVjdA== 48153 -cXVlbmN5 48154 -IHN0cmVhbWxpbmVk 48155 -IDEzMDA= 48156 -tOuPhA== 48157 -IOuWoOs= 48158 -IOOBr+OBhA== 48159 -IGh2YWQ= 48160 -5LiA5a6a6KaB 48161 -IHZlcmJhbGx5 48162 -IEtvbnM= 48163 -IOyhsOyLrA== 48164 -IGRpZXo= 48165 -5o6w5o6w 48166 -IGNodWNrbGluZw== 48167 -IE1paA== 48168 -IHJhbGxpZXM= 48169 -IG1hbnRlcg== 48170 -IGVhcm5lc3Q= 48171 -c3VwZXI= 48172 -IGdlY2U= 48173 -IFJlbmQ= 48174 -IEdlcmFkZQ== 48175 -amVuaWdlbg== 48176 -IFZhbGw= 48177 -IOyeiOuCmA== 48178 -INGB0LrQsNC30LDQu9Cw 48179 -IHRyYWJhbGg= 48180 -INC90LDRiNC10Lw= 48181 -INC80LXRhQ== 48182 -aWtpdA== 48183 -IG5vdW5z 48184 -IG5ldXJvbG9naWNhbA== 48185 -IG1vdGl2YXRpb25hbA== 48186 -IE1jTWFob24= 48187 -IEZpbmlzaGVk 48188 -IOuztOydtA== 48189 -IEZpZWxkcw== 48190 -IGFkb2xlc2NlbnRz 48191 -IFRpc2No 48192 -IE5lYmVu 48193 -IEZsb3dlcnM= 48194 -IEVuZXJn 48195 -IGRpcmV0 48196 -IFRoaQ== 48197 -IFBpY2Fz 48198 -5oOc 48199 -5oCO5LmI5qC3 48200 -IGF2ZXRl 48201 -IEZvcnM= 48202 -IENoYXBlbA== 48203 -TsOjbw== 48204 -RXQ= 48205 -INGB0L7QtNC10YDQtg== 48206 -cmVubw== 48207 -IHN2ZW4= 48208 -IGRvc3TEmXA= 48209 -bmVl 48210 -IFNuYXBkcmFnb24= 48211 -IElEcw== 48212 -7JWY64qU642w 48213 -16jXmg== 48214 -IHN1bmZsb3dlcg== 48215 -IHBlcnBldHVhbA== 48216 -57OW 48217 -IGtuaWdodHM= 48218 -IGdpcmQ= 48219 -IFRvbGQ= 48220 -IHZvbGNhbm9lcw== 48221 -IGFkdmVyc2FyeQ== 48222 -IEVjb25vbXk= 48223 -IGV4dHJhcG9s 48224 -IGJsdWV0b290aA== 48225 -IHpvb21pbmc= 48226 -IHNreXM= 48227 -IGdlbmlhbA== 48228 -w61jdWxvcw== 48229 -YW1icmU= 48230 -INC80LXRgA== 48231 -IHRlZW55 48232 -IHN0cmVzc2luZw== 48233 -7JWM 48234 -T05Z 48235 -IHRyYW5zbHVjZW50 48236 -IHJvdW5kaW5n 48237 -IGdydWVz 48238 -15nXoNeU 48239 -YXByw6hz 48240 -IHBydWViYQ== 48241 -IHBvbHlnb24= 48242 -IGJsdWViZXJyeQ== 48243 -IFByb2dyYW1t 48244 -IHRyZW5jaGVz 48245 -IHNlYmFnYWk= 48246 -IHBhbGF0ZQ== 48247 -IGxhdWRl 48248 -IGJlaGF2ZWQ= 48249 -IGxvbmdpdHVkaW5hbA== 48250 -IE1vZHVsZQ== 48251 -IGFkbWly 48252 -zrvOuQ== 48253 -R3JlZw== 48254 -IHd5c3Q= 48255 -IHByb3BhZ2F0ZQ== 48256 -IG1vbGRz 48257 -IFR1Yg== 48258 -IExvdWQ= 48259 -dXN0bw== 48260 -IHVuc3RvcHBhYmxl 48261 -IHJlaW5mb3JjaW5n 48262 -6Z2e5bi455qE 48263 -INC/0YDQvtCx0LvQtdC80LA= 48264 -IHBvdGVuY2lhbA== 48265 -IGhlbXA= 48266 -7J6U 48267 -4KSv 48268 -IG9wdGlj 48269 -IGVyZm9sZ3JlaWNo 48270 -0YHRiw== 48271 -0L7Qu9GM0YjQtQ== 48272 -dXJzdA== 48273 -IFBvaXM= 48274 -IHJlc3BvbmRlbnRz 48275 -IG5laG1l 48276 -IEV4dGVybmFs 48277 -b2xhdGU= 48278 -SHl1bg== 48279 -IHF1YXJ0eg== 48280 -IG1hdGhlbWF0aWNpYW4= 48281 -IGLDoXNpY2FtZW50ZQ== 48282 -IGFpbA== 48283 -7KCc66W8 48284 -YXR0dXR0bw== 48285 -IG5vb2l0 48286 -IGFmZmxpY3Q= 48287 -IE9sZ2E= 48288 -6K23 48289 -INC90LDRgg== 48290 -IGRpdGVz 48291 -IHJlYWxpZGFkZQ== 48292 -IGvDpG4= 48293 -IHVuaXF1ZW5lc3M= 48294 -IHBhZHJlcw== 48295 -IHN1YnNpZGk= 48296 -IHBpZ2VvbnM= 48297 -zrLOsQ== 48298 -c3RhZA== 48299 -IGRlcmVu 48300 -INCh0LvQtdC0 48301 -ZG9v 48302 -INC+0L/QuNGB0LDQvdC40Lg= 48303 -IGFtYmVy 48304 -IGdvb3NlYnVtcHM= 48305 -IGZyw6Vnb3I= 48306 -IFZpdGFs 48307 -IElzcmFlbGl0ZXM= 48308 -d2Fzc2Vy 48309 -SXNu 48310 -IGNvbW1pdHM= 48311 -IFNURVZFTg== 48312 -IEJldsO2bGtlcg== 48313 -dWl0aXZl 48314 -IGxlZ2Vu 48315 -IGJydWs= 48316 -0LjRgNC+0LLQsNC9 48317 -eW5lbg== 48318 -aGVsbQ== 48319 -IGdlbmVyYXRpb25hbA== 48320 -IEzDpG5kZXJu 48321 -zr/Ouc+Az4zOvQ== 48322 -dXp1 48323 -IGNhbGxlcg== 48324 -0L7QvdGM 48325 -w7xtw7w= 48326 -IGJlc2Fy 48327 -IHBsYXRz 48328 -IG1pZ3JhdGVk 48329 -IGphcA== 48330 -IFdBUg== 48331 -IGRpc3NlY3Q= 48332 -IFp1c2No 48333 -IFplaXRlbg== 48334 -IExpb25z 48335 -IERG 48336 -4pQ= 48337 -0LrQuNCy 48338 -IHBlZGVzdHJpYW5z 48339 -IE1hcmlseW4= 48340 -ZG9jaw== 48341 -IHlodA== 48342 -IHJlaW5jYXJu 48343 -IFNvbm8= 48344 -IEdyb3d0aA== 48345 -0YPRgdC+0LI= 48346 -IGR1bmdlb25z 48347 -IGJhZ3Vz 48348 -a2ljaA== 48349 -INGD0LrRgNCw0Zc= 48350 -6Yar 48351 -IEtlbGxlcg== 48352 -Y2hlbWlzdHJ5 48353 -SmFwYW5lc2U= 48354 -IHdpbGxzdA== 48355 -IGRlY29tcG9zaXRpb24= 48356 -INGB0YLQtdC9 48357 -IHJldml2ZWQ= 48358 -7ZWZ6rWQ 48359 -IMWT 48360 -5L2Q 48361 -7Iu4 48362 -aXBweQ== 48363 -IGhvdXJseQ== 48364 -asOkbg== 48365 -IFdvcmtzaG9w 48366 -nbzshJw= 48367 -IGN1YXJ0bw== 48368 -IHBhdHJpbQ== 48369 -IEJ1cmNo 48370 -IOyeiOq4sA== 48371 -IGhlcGF0 48372 -IGjDoG5n 48373 -IOuMgO2VtA== 48374 -INCy0LDRiNC4 48375 -IHJld29yaw== 48376 -IHBhcnNl 48377 -IMOnxLFrdMSx 48378 -IFNheA== 48379 -IE1vbmdv 48380 -IEFhYWg= 48381 -cmFtYmxl 48382 -REo= 48383 -IHN0YWJpbGl6ZWQ= 48384 -IFNwZWVjaA== 48385 -Qm9va3M= 48386 -IGh1cmRsZXM= 48387 -IFdP 48388 -IExhbWJvcmc= 48389 -IDE5MzM= 48390 -IHZvcmJlcmU= 48391 -IGNsaW5pY2FsbHk= 48392 -IGJyZWF0aHRha2luZw== 48393 -IEdhdGV3YXk= 48394 -0L/QtdGA0LLRi9GF 48395 -dXRlcnM= 48396 -IOu5tQ== 48397 -IHlldGVy 48398 -IHB1bGxleQ== 48399 -IG11ZmZpbg== 48400 -IFByZWZlcg== 48401 -IFBlbmNl 48402 -IGluZm9ybWHDp8Ojbw== 48403 -7Iqk7Yq46w== 48404 -44K444Oj 48405 -IFR1cnRsZQ== 48406 -IFJlZ2luYQ== 48407 -IExvYWQ= 48408 -ZG9lcw== 48409 -cGFuemU= 48410 -uJQ= 48411 -IG1pbmE= 48412 -IExhdGlub3M= 48413 -YW1tZXJz 48414 -IFRvcnQ= 48415 -IEJleW9uY2U= 48416 -0LjQvNC+0YHRgtC4 48417 -INCy0L7Qv9GA0L7RgdGL 48418 -IGJ1bHVu 48419 -6ICM5bey 48420 -aW5law== 48421 -YmVyZWljaA== 48422 -IHBhc3R1cmU= 48423 -IE9B 48424 -IE1lbHQ= 48425 -IEV0dA== 48426 -IERZ 48427 -IG9id29obA== 48428 -IGxlYWd1ZXM= 48429 -0YLQtdGB0Yw= 48430 -INC60YPRgQ== 48431 -IHZvcnM= 48432 -IHRvcHA= 48433 -b2dyYXBoaWNhbA== 48434 -YXNzdA== 48435 -IGxpbmRv 48436 -IOuwne2YlA== 48437 -IHLDqWZs 48438 -IGNsaW1icw== 48439 -IHZhcnNh 48440 -IG1ldGh5bA== 48441 -IEthcmVyZQ== 48442 -xrDhu58= 48443 -UmFk 48444 -IHByZXBhcmVkbmVzcw== 48445 -0L7QvdGH 48446 -IE9E 48447 -IENHSQ== 48448 -IOCkrg== 48449 -IHNwZWVjaGxlc3M= 48450 -IGxhc2Np 48451 -IGJvbGFn 48452 -INGF0L7Rh9C10YLRgdGP 48453 -IGdyaWV2aW5n 48454 -IEpvaGFubmVz 48455 -IENhcnJvbGw= 48456 -YWRha2k= 48457 -iKzr 48458 -IHPFgnU= 48459 -IGlubmVyaGFsYg== 48460 -IGd5bW5hc3RpY3M= 48461 -0L/RgNC4 48462 -aWZpcXVlcw== 48463 -IGthcmF0ZQ== 48464 -IGRvbXU= 48465 -44Gd44KM44Gn 48466 -T1RIRVI= 48467 -IGRlbWFuZMOp 48468 -IGJvb2tsZXQ= 48469 -IEt5b3Rv 48470 -IHdvaA== 48471 -IE1hcsOtYQ== 48472 -dmlvbGVudA== 48473 -SkU= 48474 -IGzDs2c= 48475 -IGJydXRhbGx5 48476 -Y290 48477 -INmF24w= 48478 -IFdhcnN6 48479 -5a6I 48480 -d29s 48481 -IG1pa8Ok 48482 -IFByb25vdW5jZQ== 48483 -IEJyZW5kYW4= 48484 -IHJvdXA= 48485 -IGl0YWxpYW5v 48486 -5aaC5q2k 48487 -INC60L7QvNC/0YzRjtGC 48488 -IHVyZ2luZw== 48489 -ZWRlcw== 48490 -IGNhcmJvbm8= 48491 -IFJpY2hhcmRzb24= 48492 -INCd0LDRhw== 48493 -IFRyYWluZXI= 48494 -IENyaW1lYQ== 48495 -IGRpYXBlcnM= 48496 -IGNvdmV0 48497 -IE1haGFy 48498 -IEh1dGNo 48499 -IEF1c3c= 48500 -YmVydHk= 48501 -IGluZGlmZmVyZW50 48502 -0LrRgNC10YI= 48503 -dWxkYWRl 48504 -IGhhcm1z 48505 -otmG 48506 -bGVzaWE= 48507 -IGdpbw== 48508 -IE1pc3RyZXNz 48509 -IEtub3g= 48510 -IEZSRUU= 48511 -IOujqOs= 48512 -INC90LDRiNCw 48513 -IGludmluY2libGU= 48514 -IG1haWRlbg== 48515 -IEplZXo= 48516 -IGJyZXZl 48517 -cG9sZQ== 48518 -IGNyaXRpY2lzbXM= 48519 -IFJ1c2lh 48520 -4KSu 48521 -cGhpbg== 48522 -IENvbXBhcmU= 48523 -IEJPTg== 48524 -IHNuZWFraW5n 48525 -IFJhaWxz 48526 -IEdlcmFs 48527 -IDE5NTM= 48528 -SG9sYQ== 48529 -INC+0L/Ri9GC 48530 -IHJhaW5mb3Jlc3Q= 48531 -IGJlbHVt 48532 -IE9iaQ== 48533 -IElTUw== 48534 -44KM44Gq44GE 48535 -INCh0LI= 48536 -IGJsb25k 48537 -IHd6Z2w= 48538 -IHBvd2llZHppYcWC 48539 -IGNob2tpbmc= 48540 -IFNvbmdz 48541 -IEJpcmF6 48542 -IHllbGxz 48543 -IHN0eWxpc3Q= 48544 -z4zPhM61 48545 -IHNjaHJlaWJlbg== 48546 -IEphdw== 48547 -IEVsZXZlbg== 48548 -IFJpZg== 48549 -Ly4= 48550 -IOyYpOuenOunjA== 48551 -IHRyZWF0aWVz 48552 -dWZmZWQ= 48553 -IOKIkg== 48554 -IHJvb2Zz 48555 -4LmA4Liq 48556 -IOu7 48557 -IHNwYXJrbGU= 48558 -IEtpZXY= 48559 -IEFyZ3U= 48560 -ZXJlY2h0 48561 -INCd0LDQtNC+ 48562 -IEZJTA== 48563 -IG1vbHRh 48564 -IERldmk= 48565 -IGNhbXBl 48566 -IGJlbmV2b2w= 48567 -IFRvdWdo 48568 -IG1vaW0= 48569 -IGV2YWN1YXRl 48570 -IGVycmFkbw== 48571 -5amG 48572 -0YDRg9Cz0L4= 48573 -IO2OmA== 48574 -IM6TzrnOsQ== 48575 -IHdlYWtlbg== 48576 -IGlsbHVtaW5hdGVk 48577 -IHNpZ2xv 48578 -IFZhY2M= 48579 -0LjQtdC5 48580 -YWxpcw== 48581 -INGD0YHRgtGA0L7QuQ== 48582 -IGRvbmE= 48583 -xYJvcw== 48584 -w7xtYW4= 48585 -IHByb2R1Y2Npw7Nu 48586 -IGNsb3Q= 48587 -IE1hbmdv 48588 -IHVuZWFzeQ== 48589 -IHNodXRz 48590 -IEV4YW1wbGVz 48591 -dmVsbA== 48592 -ZWJl 48593 -IHByb21wdGx5 48594 -IFRlbGVz 48595 -INC/0YDQvtGI0Ls= 48596 -IHB1ZXJ0YQ== 48597 -IMO8YmVyemV1Zw== 48598 -IGNvY2g= 48599 -c29jaWFs 48600 -IEJlbnNvbg== 48601 -IE1ldGg= 48602 -IEV4cGVk 48603 -IHN1cHBsZW1lbnRhbA== 48604 -IGNvbmNlaXZl 48605 -INeY15XXkQ== 48606 -IGNhcHRpdml0eQ== 48607 -j5nslYg= 48608 -INGF0YPQtA== 48609 -Zm9ybWluZw== 48610 -IHVwbG9hZHM= 48611 -IHR1cmJ1bGVuY2U= 48612 -am9pbnQ= 48613 -IHNhdGlzZmFjdG9yeQ== 48614 -IEFuaW1l 48615 -IHdhc2hlcw== 48616 -IGxpYmVyYWxz 48617 -IFN1bnNoaW5l 48618 -IFJFQUw= 48619 -dWJsaWs= 48620 -YmluYXJ5 48621 -VG9ueQ== 48622 -IHBvbGFyaXplZA== 48623 -IGVucmljaGVk 48624 -dGFraW5n 48625 -IOuBneuCmA== 48626 -IHBsZWFzdXJlcw== 48627 -IGV4dGVybWlu 48628 -aW5lc2U= 48629 -YXRs 48630 -dsOkcg== 48631 -0LDRgNGL 48632 -IG15xZs= 48633 -bmFycmF0b3I= 48634 -INC+0LTQvdC+0Lw= 48635 -IG5handpxJk= 48636 -IG1vYmlsaXpl 48637 -IG1pbGxvcg== 48638 -IGF0YQ== 48639 -5re3 48640 -IHBvbMOtdGljbw== 48641 -IHBsZWFk 48642 -IHBhaW50ZXJz 48643 -IFNvdw== 48644 -0L7RhA== 48645 -IOyYm+uCoA== 48646 -INGH0YLQvtCx 48647 -IHNhYm9y 48648 -IFVuZGVydA== 48649 -IEpFUlJZ 48650 -xaHDrQ== 48651 -IOuwluyXkA== 48652 -IHByw6ljw6lk 48653 -IGFubm90YXRpb24= 48654 -IEluYXVkaWJsZQ== 48655 -IHRleHR1cmVk 48656 -IGZpc2hlcm1hbg== 48657 -dm9yZGFu 48658 -aWNoZXJ1bmc= 48659 -IOyggeydtA== 48660 -IGdlemVpZ3Q= 48661 -IG1hbmRhdGVz 48662 -IGJlYWs= 48663 -IFRXTw== 48664 -IEFrYmFy 48665 -aWxpYW4= 48666 -IHRp4bq/cA== 48667 -IHN1cGVyaW9yaXR5 48668 -aW5rdQ== 48669 -IGx5cw== 48670 -IEZDQw== 48671 -IENQQQ== 48672 -dXN0ZXJpbmc= 48673 -bmljb3M= 48674 -YW5qYQ== 48675 -IGNoaWxscw== 48676 -IENhZ2U= 48677 -IHNlYWxpbmc= 48678 -IHNhw6c= 48679 -IGRlZGFucw== 48680 -IEFsZ2Vy 48681 -IHNwZXppZQ== 48682 -IGNvbG9zcw== 48683 -xLF5xLE= 48684 -Y2xvY2t3aXNl 48685 -IGV4YWN0YW1lbnRl 48686 -IGllbWFuZA== 48687 -YW3EsQ== 48688 -IG1hbmRhcg== 48689 -cmFq 48690 -ZmFjZWQ= 48691 -YWd1YQ== 48692 -IOq5lOs= 48693 -IGluc2Jlc29uZGVyZQ== 48694 -IGRyaXp6bGU= 48695 -IGRpbWluaXNo 48696 -IFlvZGE= 48697 -QUk= 48698 -IGJpbG1peW9ydW0= 48699 -IE1NQQ== 48700 -YXRlZ29yeQ== 48701 -INC/0LXRgNC10L8= 48702 -IHBhcnRpY2lwYXI= 48703 -IG5vcm1hbGl6ZWQ= 48704 -IGNvbXBsZXhpdGllcw== 48705 -5rSy 48706 -5o6n 48707 -0LDRgNC+0LI= 48708 -bWlzdA== 48709 -aWNoYQ== 48710 -R3JvdXA= 48711 -IHJlc2lsaWVuY3k= 48712 -IG5vZ2xl 48713 -IENOQw== 48714 -cHLDvA== 48715 -IHBoeXNpY2lzdHM= 48716 -0L3QvtC6 48717 -TEk= 48718 -IHN0dWZmcw== 48719 -IHNpc3RlbWFz 48720 -IGludGVyZmVyaW5n 48721 -IE1hcnZpbg== 48722 -w6lyY2l0bw== 48723 -IOyXhuqzoA== 48724 -IHNvbmlj 48725 -IGVxdWl2 48726 -IGFib3Jk 48727 -IFJhbWVu 48728 -IDA5 48729 -bWVkaW0= 48730 -YXRpcXVlcw== 48731 -INC00LXQu9Cw0Y7Rgg== 48732 -IHVuYW5pbW91c2x5 48733 -IHNraXJ0cw== 48734 -IO2KueuzhA== 48735 -IFByaXg= 48736 -a2FtaQ== 48737 -IGZydWl0aW9u 48738 -IGJpcnRoZGF5cw== 48739 -0LjQutC+0Lw= 48740 -IGluYXVndXJhbA== 48741 -IGNvcnJlbGF0ZQ== 48742 -IFRvcnk= 48743 -IOuCmOyB 48744 -IGRldw== 48745 -IFByZWNpcw== 48746 -aWhp 48747 -IOusuOygnOqwgA== 48748 -IGNpdGluZw== 48749 -IExhbmE= 48750 -IEthZw== 48751 -IHBsYXl0aHJvdWdo 48752 -IFByb3RvY29s 48753 -ZnJpc3Q= 48754 -aG92YWg= 48755 -IG1lcmNpZnVs 48756 -IGJpbGluZ3VhbA== 48757 -IEd1aXRhcg== 48758 -cmg= 48759 -IGdsYW1vcm91cw== 48760 -IFZpa2luZ3M= 48761 -IE9vb29o 48762 -7ZWY64qU642w 48763 -IFVnYW5kYQ== 48764 -IGNvbGxhcHNlcw== 48765 -ZW50cnk= 48766 -IGFudGlveGlkYW50cw== 48767 -64KY6w== 48768 -0YjQsNGP 48769 -IHRyaXZpYQ== 48770 -IGfDpGxsZXI= 48771 -IGZ1bmdp 48772 -IG1pbGtz 48773 -IGRpY2h0 48774 -zrzOtw== 48775 -cG9rZQ== 48776 -INCy0YvQv9GD0YHQug== 48777 -IGZlZWRlcg== 48778 -IEFsY29ob2w= 48779 -aG93ZXI= 48780 -IGRlc2VydmluZw== 48781 -IFJlYmVs 48782 -aW9zaXM= 48783 -IDEwMw== 48784 -IGhhbmRvdXQ= 48785 -IGVubQ== 48786 -IGxhbmRsb3Jkcw== 48787 -IGdlb2xvZ3k= 48788 -cmlscw== 48789 -IGNvYnJh 48790 -IFZvbGQ= 48791 -IFBhbmNo 48792 -IEdSRUc= 48793 -IHByb3Nz 48794 -IGJyYWNlbGV0cw== 48795 -IFZlZ2E= 48796 -IHJvenVt 48797 -5qy+ 48798 -0LDQt9C0 48799 -IEx5bmQ= 48800 -IEhvbm9ycw== 48801 -IHN1cnJlbmRlcmVk 48802 -IGxpYnJhcmlhbnM= 48803 -MTI1 48804 -INGB0LjQsw== 48805 -IHVuaWZvcm1seQ== 48806 -IEVhZ2xlcw== 48807 -7JWZ 48808 -0LjRgtCw0L0= 48809 -YW5kaWQ= 48810 -IOygiOuMgA== 48811 -INi2 48812 -IGFycmVzdHM= 48813 -IENTVg== 48814 -IEF6ZXJiYWlqYW4= 48815 -b3J0aWM= 48816 -IERY 48817 -IEFkdmVudHVyZXM= 48818 -IGFidXM= 48819 -IEZhdQ== 48820 -IHNjaGxpbW0= 48821 -IHJhdHRsaW5n 48822 -IGNvbnN1bWVz 48823 -IFRvbGtpZW4= 48824 -IHJlc3VycmVjdGVk 48825 -IFhZ 48826 -7Yq46rCA 48827 -INCy0YvRgdGC0YPQvw== 48828 -IEFuZ2ll 48829 -xbxlbmlh 48830 -TWlj 48831 -IFNoZWlsYQ== 48832 -YWNodGV0 48833 -IG92ZXJzdA== 48834 -IGzDog== 48835 -IGluZWZmZWN0aXZl 48836 -5p2h 48837 -5oCO5LmI5LqG 48838 -5b+Z 48839 -IHdpY2h0aWdlcg== 48840 -IHZpbm8= 48841 -IHB1bQ== 48842 -IGFuZ2xlZA== 48843 -IFBpb25l 48844 -IE3hu7k= 48845 -44Gd44KM44Gv 48846 -d2/Fm8SH 48847 -ZHJhdw== 48848 -4Lix4LmI 48849 -bWFya2V0cw== 48850 -IGNhZmVz 48851 -IENlbQ== 48852 -4p2k 48853 -IFN1aXQ= 48854 -TUs= 48855 -IGVtcGhhc2l6ZXM= 48856 -IHRvcnRpbGxh 48857 -IG1lam9yYXI= 48858 -IFN1cnZpdg== 48859 -Y2FzdGluZw== 48860 -IGVkdWNhY2nDs24= 48861 -IEd1bQ== 48862 -dWVseQ== 48863 -IOyXrOq4sOuKlA== 48864 -IHN0cmV0Y2h5 48865 -ZW7Dp2E= 48866 -IHdpdGhob2xk 48867 -IGV4aXRpbmc= 48868 -IGVudGhhbHB5 48869 -IFRyYW5zaXQ= 48870 -xLFsbcSxxZ8= 48871 -YWxpZXM= 48872 -IHNhbHZhcg== 48873 -IGxlYW5lZA== 48874 -IGdyb8OfZXM= 48875 -IGZpdHQ= 48876 -0LDQutC4 48877 -U2FyYWg= 48878 -IGhvc3RlbA== 48879 -IGZpbmdlcm5h 48880 -IG5hZHppZWrEmQ== 48881 -d2l2ZXM= 48882 -UmVj 48883 -IHNwb29s 48884 -0LDRgtC+0LI= 48885 -IEVuZW15 48886 -IGZ1cnk= 48887 -IGRldHRh 48888 -IEZheQ== 48889 -6Zqo 48890 -0Y/RjtGC 48891 -IGFwcm94aW1hZGFtZW50ZQ== 48892 -IHNpbG9z 48893 -IG1hZ2lzdA== 48894 -IGNyZWU= 48895 -IEtyYW5r 48896 -IERPV04= 48897 -IHN0YXJ0bGVk 48898 -IHJlYm9ybg== 48899 -IFVtd2VsdA== 48900 -IFN1emFubmU= 48901 -0L3QuNGG0Ys= 48902 -b3V0ZXo= 48903 -IEpBQw== 48904 -eWFyZHM= 48905 -cmFkYXM= 48906 -cmF1 48907 -aXB0cw== 48908 -aGFpbA== 48909 -IHBhcmFncmFwaHM= 48910 -IG1lZ2xpbw== 48911 -IGlzb2xhdGluZw== 48912 -IGFjZWl0ZQ== 48913 -IEhhcnNo 48914 -IGN5c3Q= 48915 -IEJsb2NrY2hhaW4= 48916 -INGF0L7RgNC+0YjQuNC5 48917 -IHZpcnR1b3Vz 48918 -IGludmVzdGlnYWNpw7Nu 48919 -IGRldm9pcg== 48920 -IG1hc3R1cmI= 48921 -IFNhbGU= 48922 -2YrYsdip 48923 -IM6n 48924 -IFN0cmHDn2Vu 48925 -IGRpa2s= 48926 -IGFmb3Jl 48927 -IEp1bmdrb29r 48928 -IGNob2NpYcW8 48929 -IERlYmF0dGU= 48930 -IHdlaXJkbHk= 48931 -IHZpYWpl 48932 -cmVnaXN0 48933 -SGVscA== 48934 -IGtpbmRlcmVu 48935 -IGZvcm11bGF0ZWQ= 48936 -IGVuZmlt 48937 -IFRvd2FyZHM= 48938 -0LrQvtGX 48939 -aXZlcmluZw== 48940 -INC00LXRgtC4 48941 -Y2hhcmdlcg== 48942 -IHB1cmw= 48943 -IGFjYWRlbWljYWxseQ== 48944 -IE51cnNl 48945 -IGRlbGV0aW5n 48946 -YXlv 48947 -IHJlZnVzYWw= 48948 -IGRlcGljdHM= 48949 -IERyYWN1bGE= 48950 -IHRvYXN0ZWQ= 48951 -IFpvbWJpZQ== 48952 -IFN1cGVyaW9y 48953 -IEJvbGQ= 48954 -IHF1aXp6ZXM= 48955 -IGdsZQ== 48956 -NDUw 48957 -IGNvbWXDp28= 48958 -eW5u 48959 -IHZlcnN0 48960 -IE9sYWY= 48961 -IHBvbW9j 48962 -IFNhc2s= 48963 -65g= 48964 -IFRDUA== 48965 -IFByb3BlcnR5 48966 -7ZWY7KOg 48967 -4Lic4Lih 48968 -Ym9vbQ== 48969 -YXJvcw== 48970 -INGA0L7RgdGB0LjQuQ== 48971 -INCx0YvQstCw0LXRgg== 48972 -5Ye65Y67 48973 -IOydtOyVvOq4sOulvA== 48974 -IGNvbWJpZW4= 48975 -dmFjYw== 48976 -IGViZW5mYWxscw== 48977 -cGFyYQ== 48978 -INC30Lw= 48979 -IGRlc3BlcmF0aW9u 48980 -b3JkcmU= 48981 -INep15zXmQ== 48982 -IGdlbmVyb3VzbHk= 48983 -INCe0Lo= 48984 -IG9yYml0aW5n 48985 -Pjwv 48986 -IGVzcMOt 48987 -IENPUA== 48988 -5a2p5a2Q 48989 -dmlzaWJsZQ== 48990 -INC/0YDQtdGB0YLRg9C/ 48991 -IHN0aXRjaGVk 48992 -4K+ILg== 48993 -IGxhdGVudA== 48994 -IFByYWI= 48995 -IE1jTg== 48996 -IEhlYWxpbmc= 48997 -IEN1cmlvc2l0eQ== 48998 -Y2VydA== 48999 -IOuvvOyjvA== 49000 -IHBhdGllbnRseQ== 49001 -IFlU 49002 -Zm9yZWlnbg== 49003 -IHbhuqtu 49004 -IGluZHVzdHJp 49005 -IGNvY2t0YWlscw== 49006 -IGJyaWdodGVu 49007 -IGNvbnNvbGlkYXRlZA== 49008 -0LDRgNC0 49009 -bHRyeQ== 49010 -IGdyaWxsZQ== 49011 -IGJvbmE= 49012 -IGRpbGlnZW50bHk= 49013 -IFdyZXN0bGVNYW5pYQ== 49014 -ZXJrdA== 49015 -ZW5lcmd5 49016 -OTk5 49017 -4K6V4K61 49018 -IHRvdGU= 49019 -aW9ubw== 49020 -RElP 49021 -IHNjaGl6b3BocmVuaWE= 49022 -IHBvc3Rwb25lZA== 49023 -IFFpdQ== 49024 -IM+Dz4XOvQ== 49025 -IHpkasSZ 49026 -IHNwYW5uZW5k 49027 -IERJUw== 49028 -UmVs 49029 -IHJoaW4= 49030 -aW1tdW5l 49031 -T2xk 49032 -IHBsw7Z0emxpY2g= 49033 -IG1vdW5k 49034 -IGFzdHJvbm9taWNhbA== 49035 -IEd1aWQ= 49036 -IEN1bA== 49037 -SEk= 49038 -IMWg 49039 -IHJlcG8= 49040 -IE1hdXJpY2U= 49041 -5LiA54K5 49042 -IGJhbmRpdHM= 49043 -IERlc2t0b3A= 49044 -w6Rzcw== 49045 -ZnRh 49046 -IGxpY2VuY2U= 49047 -IGltYWdpbmFy 49048 -IEVudHJlcHJlbmU= 49049 -eG8= 49050 -IOunm+yeiOuKlA== 49051 -INeU15E= 49052 -IHB1bXBraW5z 49053 -IGthbnNzYQ== 49054 -IGrEmXp5 49055 -IGNvbW11bmF1dMOp 49056 -YsO8cg== 49057 -IGVyaMO2 49058 -IFdvbHZlcg== 49059 -IFNoYXJpbmc= 49060 -5Luk 49061 -IHBha2Fp 49062 -IGluc3VsdGVk 49063 -0JzRiw== 49064 -0L7Rlw== 49065 -IGNvbnNpc3Rl 49066 -5oyR 49067 -IHlvdW5nc3RlcnM= 49068 -IGdsZWljaGVu 49069 -d2VkZXI= 49070 -IG1vdGU= 49071 -IGNsYXVzZXM= 49072 -w6l0YXQ= 49073 -cHJ1cw== 49074 -IHdhc3Q= 49075 -57uZ5oiR 49076 -IENyaXNw 49077 -IOeEtuW+jA== 49078 -IG9mZmVuZGVycw== 49079 -IGNvbnZlY3Rpb24= 49080 -IGNvbmZpYW4= 49081 -b2xsb3c= 49082 -YW1ldA== 49083 -INGX0YU= 49084 -56ys5LqM5YCL 49085 -ZmZpY2llbmN5 49086 -IHVuZ2xhdWI= 49087 -aWdhbnM= 49088 -IG1hcmtldGVk 49089 -IFZBTg== 49090 -IHByb2NsYWltZWQ= 49091 -IGPDqWx1bGFz 49092 -IGNvbGxpZGU= 49093 -IE9jdWx1cw== 49094 -YWRvcmU= 49095 -Smk= 49096 -IHN1c3RhaW5pbmc= 49097 -IEZhc2M= 49098 -IHNldHp0 49099 -IG5vc2FsdHJlcw== 49100 -TW9zdA== 49101 -INCy0Yc= 49102 -IG5hdWM= 49103 -IEJoYXI= 49104 -54i454i4 49105 -5oiR6Lef5L2g6Kyb 49106 -IHnDqnU= 49107 -IHRpbWVzdA== 49108 -IHBlcnRhbWE= 49109 -aXJtaQ== 49110 -IHp3cg== 49111 -IHZlcmJlc3M= 49112 -IHZvcnRleA== 49113 -IFNUQUNL 49114 -2KvYsQ== 49115 -uYTr 49116 -lJTsmKQ= 49117 -IGxpbmthZ2U= 49118 -IEZyYXNlcg== 49119 -ZW5hcmlv 49120 -IOudvOuKlA== 49121 -IOyEoOuwsA== 49122 -aHRoYWw= 49123 -IOq5jA== 49124 -IEtow7RuZw== 49125 -w4M= 49126 -IHNjcmFtYmxlZA== 49127 -IEVpbms= 49128 -IG1pY3Jvb3JnYW4= 49129 -IG5hcmNpc3Npc3Q= 49130 -IEtvbWJhdA== 49131 -IOunoQ== 49132 -IEFHQQ== 49133 -IHBlcmZla3Q= 49134 -IFNlcmll 49135 -ZGV0ZXJt 49136 -LSc= 49137 -IHBvbnl0YWls 49138 -IGtvc2th 49139 -7JM= 49140 -IG9iZWM= 49141 -IGNoZXN0cw== 49142 -dmVlcg== 49143 -IHVwcmlzaW5n 49144 -IHN0b2tlZA== 49145 -YXNzb2Np 49146 -IHByb2R1w6fDo28= 49147 -IFNoYXBl 49148 -7KCc6rCA 49149 -IOuUsA== 49150 -IGpvbg== 49151 -IGluYWR2ZXJ0 49152 -YW50YXM= 49153 -INC90LDQutC+0L3QtdGG 49154 -IOWwjeWVig== 49155 -IEFyc2VuYWw= 49156 -IHByb3RlZw== 49157 -IGxpYmVydMOp 49158 -IGdsYXJl 49159 -5Yia 49160 -5bey57uP 49161 -IHZlcmVpbg== 49162 -IGluc2VydHM= 49163 -IEphbmE= 49164 -IHd5ZGFqZQ== 49165 -xYJ1bQ== 49166 -ICUu 49167 -b3JpZ2luZQ== 49168 -IHN5bmFnb2d1ZQ== 49169 -IGZhbGxhaXQ= 49170 -IGRpc29iZWQ= 49171 -IGFudGlj 49172 -IEN5Y2w= 49173 -IGFzeW5jaHJvbm91cw== 49174 -IOuyjOyNqA== 49175 -IGdlc3VuZA== 49176 -IGdhZ24= 49177 -IHBlYQ== 49178 -IGdyaW4= 49179 -w6lzdA== 49180 -IHNhdWM= 49181 -IE3DpGQ= 49182 -7ZW064+E 49183 -cHBz 49184 -IM61z4DOuQ== 49185 -IHBldXBsZQ== 49186 -IGRlYmVu 49187 -IEJyZWU= 49188 -INGA0L7Qu9GM 49189 -INC60LDQutC40Lw= 49190 -IMO6dGls 49191 -IGRpc3RyaWJ1dG9y 49192 -0LDQu9GL 49193 -IHN3b2rEhQ== 49194 -IGZvbGtsb3Jl 49195 -IHJlY2VpdmVycw== 49196 -IE1PTw== 49197 -Ymlucw== 49198 -YXN0cmU= 49199 -7JWI6w== 49200 -IOuEo+qzoA== 49201 -IG11bHRpbWVkaWE= 49202 -IGdlYmF1dA== 49203 -0L7QstGL0YU= 49204 -w6N5 49205 -IGRhbmU= 49206 -b2tvbA== 49207 -ZW1pdGlzbQ== 49208 -T05FWQ== 49209 -IHlhxJ8= 49210 -IGNoYXVmZg== 49211 -5a655piT 49212 -IGVzZnVlcg== 49213 -xINu 49214 -ZXJ0YXM= 49215 -IGZvbmN0aW9ubmU= 49216 -b21pbmE= 49217 -IGl2b3J5 49218 -IFlvdXR1YmVy 49219 -IFNreXdhbGtlcg== 49220 -0LjRh9C10YHQutCw0Y8= 49221 -dG9p 49222 -IHZleWE= 49223 -IGdlbGVybnQ= 49224 -IGNoYW5jZWxsb3I= 49225 -IFN0YXRpc3RpY3M= 49226 -IHdlbGRlZA== 49227 -IG9uZGFu 49228 -IFNlaQ== 49229 -IG1lZGljYWxseQ== 49230 -IGVuZXJnaXplZA== 49231 -IFZpYQ== 49232 -INCy0LjQug== 49233 -IHVuaW50ZXI= 49234 -IGhpZ2huZXNz 49235 -IO2MlOs= 49236 -IGFtcGxpZmllZA== 49237 -IFNlcmdleQ== 49238 -IE1pbnM= 49239 -d2FybQ== 49240 -cGVsbA== 49241 -b3BoaWxl 49242 -IGjDqA== 49243 -IEJlbG8= 49244 -IFNrZXRjaA== 49245 -IGNoYXJhY3Rlcml6YXRpb24= 49246 -YW5zZW4= 49247 -INGC0YPRgA== 49248 -IOOFi+OFi+OFiw== 49249 -Tm90ZQ== 49250 -IGtvxZ8= 49251 -IGNpZXJ0 49252 -Zmx1 49253 -IGJhaHQ= 49254 -IERvd250b3du 49255 -IENSSVM= 49256 -b2RpZQ== 49257 -MTQw 49258 -IGxpdHJlcw== 49259 -IGdyaWV2 49260 -5qeY 49261 -IOyUqOqwgA== 49262 -IHN1Y2NlZWRz 49263 -IF9f 49264 -ZW50aW5n 49265 -IHZpbW9z 49266 -IHPDrA== 49267 -ZGVmZW5zZQ== 49268 -IE1jRA== 49269 -IE1hcmlvbg== 49270 -IERvbnQ= 49271 -IEREUg== 49272 -IExhemFy 49273 -IERBUg== 49274 -IGt1dg== 49275 -S24= 49276 -IHNlbWJsYQ== 49277 -IGFpcmJvcm5l 49278 -IFZpb2xlbmNl 49279 -65CQ 49280 -IHJlc3RyYWludA== 49281 -IHdoaXN0bGVz 49282 -IHNjb2xkZWQ= 49283 -IGFjY2Vzbw== 49284 -IGFic29sdXRhbWVudGU= 49285 -IFR5bA== 49286 -IFNhcA== 49287 -toDrtoQ= 49288 -aXTDpHRlbg== 49289 -YWRlbQ== 49290 -IMO9 49291 -IHByZXNjcmliZQ== 49292 -IE1hZ2U= 49293 -IEhlbGVuYQ== 49294 -5b6I5pyJ 49295 -5Lqy 49296 -dnQ= 49297 -IHZpZW5lbg== 49298 -IHNuZWV6 49299 -IG1vbMOp 49300 -xrDhu59uZw== 49301 -IHRyYW5zcG9ydGluZw== 49302 -IExlYW4= 49303 -IGt1bmc= 49304 -0YPRgNCw 49305 -z4TOrQ== 49306 -dXRjaGVz 49307 -b25kZXJz 49308 -bGl5b3I= 49309 -TmF0 49310 -IHppag== 49311 -IG1hbW1hbA== 49312 -IGvDpHl0 49313 -IEpvYW5uYQ== 49314 -c2VudA== 49315 -IOCkuA== 49316 -IHZlc3RlZA== 49317 -IEVyZmFocnVuZw== 49318 -b2tlZQ== 49319 -IGNsaXBwaW5n 49320 -IExpc3RlbmluZw== 49321 -ICgj 49322 -ZsO2 49323 -IHZpZGFyZQ== 49324 -IGJyaXR0bGU= 49325 -IFNUQVJU 49326 -IERhbWFz 49327 -IFlvZw== 49328 -44KT44Go 49329 -Z2FydA== 49330 -IHZlcmxpZXI= 49331 -IGhlYXJ0ZmVsdA== 49332 -IGRvxZvEhw== 49333 -7LmY6rCA 49334 -LsK7 49335 -IG1heGltYWw= 49336 -IGRpc3RpbnRvcw== 49337 -IOyZnOuDkO2VmOuptA== 49338 -IHNhaWxlZA== 49339 -IGNvbnZleWVk 49340 -IFRpbmRlcg== 49341 -IFNVUEVS 49342 -0L3QuNGG0YM= 49343 -Y29udHJvbGxlZA== 49344 -IGZ1bno= 49345 -IGJhc3RhcmRz 49346 -IEdpbnNidXJn 49347 -IG51b3Zv 49348 -IFBlcmU= 49349 -IEpFUw== 49350 -IERpbmdlbg== 49351 -IEJldHM= 49352 -dW1iYQ== 49353 -YWNjacOzbg== 49354 -IOyeiOyngOunjA== 49355 -IHJldHJh 49356 -IExhdXJlbnQ= 49357 -IHBvenk= 49358 -IGdyb292ZXM= 49359 -IG3DoXF1aW5h 49360 -IG1pbmlvbg== 49361 -IGRlaW5lbg== 49362 -IFNoYXVu 49363 -15nXmQ== 49364 -IGhvbm9yYXJ5 49365 -b3NhdXJ1cw== 49366 -IHplaXQ= 49367 -IGVzcGVjaWU= 49368 -IEJDRQ== 49369 -0LDRgtC1 49370 -SnVzdGlu 49371 -IFdoZWVscw== 49372 -IOydtO2VtA== 49373 -INio2YrZhg== 49374 -IHByb3B1bHNpb24= 49375 -IHBlcmNlYmVy 49376 -IE5ld21hbg== 49377 -5bQ= 49378 -Y3Vsb3Npcw== 49379 -TWk= 49380 -INCw0LrQutGD 49381 -IG1hc3RlcmluZw== 49382 -IGzDpGg= 49383 -IGZpc3Rz 49384 -5LuU 49385 -IG1hcmluYWRl 49386 -TGlsbHk= 49387 -IOuFuOugpQ== 49388 -IFlI 49389 -IHVyZ2VudGx5 49390 -IGluZm9ybWF0aW9uYWw= 49391 -IGFjb3Jkbw== 49392 -aXp6eQ== 49393 -44GE44GP 49394 -7J207Ja0 49395 -aW1hcg== 49396 -IOuCmOyYpOs= 49397 -IHR3ZW50aWVz 49398 -IHJhc3A= 49399 -IGJ1bXB5 49400 -2KjYqQ== 49401 -d29ya2Vy 49402 -IHF1aWNrZXN0 49403 -IGF0dGFjaGVz 49404 -0LLQuNCz 49405 -IOuCmO2DgOs= 49406 -IHB1cmVl 49407 -IG92ZXJzaXplZA== 49408 -IHN0aXJyZWQ= 49409 -IGpha2lt 49410 -IGhvbWljaWRl 49411 -44KC44GX 49412 -aXNjaWxsYQ== 49413 -IOyxmQ== 49414 -IHNwZWN1bGF0aXZl 49415 -IGFzc2lzdHM= 49416 -bWFpbg== 49417 -asOkaHI= 49418 -aW5kZXQ= 49419 -IMWfdXI= 49420 -IGZvcmVjYXN0cw== 49421 -IGRpdmVyc2lvbg== 49422 -IHRhcmU= 49423 -IG9nbA== 49424 -IE9yZ2FuaXNhdGlvbg== 49425 -IENoZXZ5 49426 -IGJhamE= 49427 -YW5kxLFy 49428 -INmI2YTYpw== 49429 -IHJhZGlhbnQ= 49430 -IGxpYWlzb24= 49431 -IGRlbW9rcmF0 49432 -IE1BUkM= 49433 -z4DOv8+F 49434 -IHJ1bnQ= 49435 -IHByw6ljaXM= 49436 -IGdldmVu 49437 -IHbDqWhpYw== 49438 -IEpFU1M= 49439 -U1RS 49440 -IOyWmOs= 49441 -IHZpc2lvbmFyeQ== 49442 -IGJ1cmFkYW4= 49443 -IOOBguOCig== 49444 -IHJlYmlydGg= 49445 -IGV4aGliaXRlZA== 49446 -IE1ldGFsbA== 49447 -b2xpZQ== 49448 -ZWx5bg== 49449 -IGZsYXZvdXJz 49450 -IGVzY3JpdG8= 49451 -IERlbGV0ZQ== 49452 -IOyVjOyVmOyWtA== 49453 -INGD0LrRgNCw0ZfQvQ== 49454 -IGludGVycnVwdGluZw== 49455 -IGlkZW50aWZpYw== 49456 -IFN1enVraQ== 49457 -IExhbmRpbmc= 49458 -5Lu25LqL5oOF 49459 -YW5kaQ== 49460 -IGVzdHJhbg== 49461 -IGNvdWxldXI= 49462 -IGFncmFk 49463 -IFNueQ== 49464 -IOCuh+Cusg== 49465 -IGFuZGVy 49466 -IHJ1YQ== 49467 -IHByaXNl 49468 -IGxhdXJl 49469 -IO2KgA== 49470 -IG1vZGVyYXRpb24= 49471 -IGVyZmFocmVu 49472 -IGRlY29uc3Q= 49473 -IFJlZXNl 49474 -IFBL 49475 -ZXRvcw== 49476 -44GT44KM44Gn 49477 -IEdyYXZpdHk= 49478 -IEVyZW4= 49479 -IG92ZXJib2FyZA== 49480 -IG3DvHNzdA== 49481 -IEVtYWls 49482 -0LXRgNC8 49483 -eWRp 49484 -acSZZHp5 49485 -IExPVQ== 49486 -IEZ1w59iYWxs 49487 -IFJE 49488 -YWx0cw== 49489 -IOyKpO2KuOs= 49490 -INCa0YDQsNGB 49491 -IHRlbGV2 49492 -INGA0L4= 49493 -IHJlc2lnbmF0aW9u 49494 -IGppbmdsZQ== 49495 -IFN0dWRpZW4= 49496 -IElY 49497 -IFNlbnRpbmVs 49498 -IFBhbmc= 49499 -6YQ= 49500 -SmFrZQ== 49501 -IHBlcnNvbmFnZW0= 49502 -IG3DqWRpYQ== 49503 -IENoZXJu 49504 -YW50aWNhbGx5 49505 -IHRo4budaQ== 49506 -IHBhcmFseXNpcw== 49507 -IGphcGFuZXNl 49508 -IGNvbmV4 49509 -IGVmaWM= 49510 -IHVuZGVyc2lkZQ== 49511 -IG5lb2w= 49512 -IGZpYW4= 49513 -0LjQvNC+0YHRgtGM 49514 -IHF1aXJreQ== 49515 -IHBpc3Rh 49516 -IENsZW1lbnQ= 49517 -bm90aGluZw== 49518 -INC/0L7QtdGF 49519 -IGhvcnJlbmQ= 49520 -IGNvbnNvbGlkYXRl 49521 -cGxveXM= 49522 -ZW1ha2Vy 49523 -SmVubmlmZXI= 49524 -IG51bcOpcm8= 49525 -IGZhbW9zbw== 49526 -IE5lcHR1bmU= 49527 -IO2WiOyWtA== 49528 -INC/0YDQtdC30LjQtA== 49529 -IHNpdGNvbQ== 49530 -IHNlcmlv 49531 -IG11ZQ== 49532 -IGdsYW5kcw== 49533 -IGLDtnJqYXI= 49534 -IFlK 49535 -IFJpb3Q= 49536 -cGFyYWd1cw== 49537 -IHNlZ3VyYW7Dp2E= 49538 -IGltbWF0dXJl 49539 -IE1hZG9ubmE= 49540 -4LiN 49541 -IGxpbmdlcmluZw== 49542 -IGFjZXNzbw== 49543 -IE9yaWVudA== 49544 -IFJlY29tbQ== 49545 -IGNvbXBsYWM= 49546 -Zm91bmRlZA== 49547 -YXR0ZW5k 49548 -IGNpZWxv 49549 -IFpoYW4= 49550 -bmFpcmVz 49551 -Y2Nv 49552 -INeQ16A= 49553 -IHN0YXRh 49554 -IGNvbnRyYWRpY3Rvcnk= 49555 -IFPDqQ== 49556 -IFNBTg== 49557 -IENvbm5pZQ== 49558 -IOuLueyLnA== 49559 -INGB0LDQvNC+0Lk= 49560 -IG1hamVzdGlj 49561 -IFBlbmd1aW4= 49562 -IENPTUU= 49563 -w61jaW9z 49564 -cGVybw== 49565 -IG1n 49566 -IGZhdWM= 49567 -IGNvcnJlcg== 49568 -IEdvdHRlcw== 49569 -IEFuZ2xv 49570 -SGFy 49571 -4buXaQ== 49572 -IHZpdGVzc2U= 49573 -IGFubm91bmNlcg== 49574 -IE9tYWhh 49575 -a3Vt 49576 -IHNwYXJlZA== 49577 -INGA0LDQt9Cw 49578 -INC/0L7Qu9GD0YfQuNGC0YHRjw== 49579 -IHTDpGjDpG4= 49580 -INC/0L7QvdCw0LQ= 49581 -IHBlcnRhaW5pbmc= 49582 -IFJhdGU= 49583 -aWVybg== 49584 -R29sZA== 49585 -IHRlc3Rl 49586 -IGRlxJ9pbGQ= 49587 -IGRhbXBpbmc= 49588 -IFBhcnRuZXJzaGlw 49589 -enlzdGE= 49590 -Z2VsZA== 49591 -IHNtb2tlcw== 49592 -IE1hcnJpYWdl 49593 -7Kq97JeQ 49594 -6IWz 49595 -aXNjZQ== 49596 -IHRyeW5h 49597 -IERpcmVjdG9yeQ== 49598 -IOuCmOyYrA== 49599 -IHNoYW1lZnVs 49600 -IG1lbnRyZQ== 49601 -IGFzc2lnbmluZw== 49602 -5piv6YCZ5qij 49603 -IHJlcGVydG9pcmU= 49604 -IG9iamV0b3M= 49605 -56ix 49606 -IHVuZGVyd29ybGQ= 49607 -IGVuZGVhdm9ycw== 49608 -IGlnbml0ZQ== 49609 -INmI2Kw= 49610 -IGV4cGVyaWVudA== 49611 -INCX0LDQvw== 49612 -INC30LDQutC70Y7Rhw== 49613 -IHZvbHRhZ2Vz 49614 -IG5pZWdv 49615 -IGRlZmljaXRz 49616 -IGJ1ZW5vcw== 49617 -IFNsZWVwaW5n 49618 -IFNhbGVt 49619 -IHVubG9ja2luZw== 49620 -IGludGVyYWN0ZWQ= 49621 -IGVudGVuZGV1 49622 -IFN1cGVyaW50ZW5kZW50 49623 -IHN6Y3plZ8OzbA== 49624 -IHF1YXM= 49625 -IHBhbGluZw== 49626 -IGtobw== 49627 -2KjYrQ== 49628 -IGNvbGFib3I= 49629 -INC/0YDQuNCz0L7RgtC+0LI= 49630 -IG1hdXY= 49631 -IEp1ZGFz 49632 -IEFzc2lzdA== 49633 -INGC0LXRgNGA0Lg= 49634 -INC90LDRgdC60L7Qu9GM0LrQvg== 49635 -IHN1YnNpZHk= 49636 -IEVtYmFzc3k= 49637 -IGRhZ2Vu 49638 -IFNhbnRv 49639 -6Iis 49640 -16nXldeR 49641 -IGFicnVwdGx5 49642 -IEFkYXB0 49643 -IHZhYWs= 49644 -IHBvc3RhbA== 49645 -IGludmVzdGly 49646 -IGZpcXVlaQ== 49647 -IGRvd250aW1l 49648 -IFdlYmI= 49649 -IE5DQUE= 49650 -IEVzdG95 49651 -0L7Qu9C+0YI= 49652 -IOyCrOqxtA== 49653 -IG5hdGlvbmFsaXN0 49654 -IEthdGhyeW4= 49655 -IEtvcA== 49656 -6ao= 49657 -U2Vhbg== 49658 -T05B 49659 -IEJq 49660 -16LXnQ== 49661 -w61i 49662 -aWRhbWVudGU= 49663 -INCz0LvQsNC30LA= 49664 -IHVubmll 49665 -IGdlbWFha3Q= 49666 -IElOVEVSVklFV0VS 49667 -IEhhdXQ= 49668 -zq/Ovw== 49669 -Z2VvaXM= 49670 -d3lkZA== 49671 -INC60L7Qu9C4 49672 -IHRpZ2h0ZW5lZA== 49673 -IHBsYW5uZXJz 49674 -IGhlcnVt 49675 -IGfDtnLDvG4= 49676 -IGVsZWN0cm9uaWNhbGx5 49677 -IGNlcmFt 49678 -IOuLpOyWke2VnA== 49679 -IGVwaWxlcHN5 49680 -IGXEnw== 49681 -bGlucw== 49682 -IFNoaW55 49683 -5qCh 49684 -INGB0L7Qu9C9 49685 -IG1hY2Fyb24= 49686 -IGltcGFjdG8= 49687 -IFZlZ2Fu 49688 -emXFhA== 49689 -IFJhcGhh 49690 -IFBhcnM= 49691 -IExFTw== 49692 -44GK44Gj 49693 -Y8O8 49694 -INec15TXmdeV16o= 49695 -IMOkaG5saWNo 49696 -IGZsb3Nz 49697 -IEFa 49698 -IG3DtmNodGVu 49699 -IGdyb29taW5n 49700 -IGdyYXNzZXM= 49701 -cmFuY2g= 49702 -IHJlY2liaXI= 49703 -IGJvdW5jeQ== 49704 -IEhvYmJ5 49705 -IHZpa3RpZw== 49706 -IGJlZ2l0dQ== 49707 -IFBpY2Fzc28= 49708 -IEt1c2g= 49709 -66qo 49710 -IG9ic3RydWN0aW9u 49711 -IOu2hOychA== 49712 -IG1pY3JvYg== 49713 -IFdlc3RtaW5zdGVy 49714 -cm9wcw== 49715 -ZHVs 49716 -IGRldm8= 49717 -IExlaHJlcg== 49718 -IEFkdmlzb3I= 49719 -dWNrZW4= 49720 -INCx0YPQvA== 49721 -IGZsYXR0ZXJpbmc= 49722 -IFRydW1hbg== 49723 -IFNlbXByZQ== 49724 -IE1jQ2Fpbg== 49725 -IEhpbmR1cw== 49726 -SnVsaWE= 49727 -IHdhdGVyc2hlZA== 49728 -IGx1c2g= 49729 -7KCE6w== 49730 -QmVmb3Jl 49731 -INCS0YLQvtGA 49732 -IFNhYVM= 49733 -IHNpdHp0 49734 -IGJlZXRsZQ== 49735 -IEVzc2VudGlhbA== 49736 -ZW5rbw== 49737 -IOuVjOuPhA== 49738 -IHJldnZpbmc= 49739 -IHBvb3Jlcg== 49740 -IGNvZXJj 49741 -IGlkZWU= 49742 -IGNvw7s= 49743 -YWxldA== 49744 -IHpkcm93 49745 -IGZlbmRlcg== 49746 -Z3Jvd3Ro 49747 -RElORw== 49748 -IHpkZQ== 49749 -5LiK6Z2i 49750 -RU5UUw== 49751 -IGZhY2V0cw== 49752 -6Zqq 49753 -dXNoaW1h 49754 -IMWfZWg= 49755 -IHBhcmFzaXRl 49756 -IGxhcHNl 49757 -IE1lZXI= 49758 -IEt1bmQ= 49759 -IHNsb2c= 49760 -IGJydW5jaA== 49761 -IENoYXJ0 49762 -YXJ6 49763 -IE1VUw== 49764 -IG9mZmVuc2Vz 49765 -IGluZ2zDqXM= 49766 -IGZvbGlhZ2U= 49767 -b3BsYW4= 49768 -QXV0 49769 -IEphY3F1 49770 -dGFr 49771 -aWVtYnJl 49772 -IHhlbg== 49773 -IG5vbWluZWVz 49774 -IGJpb21lZGljYWw= 49775 -w6lzdXM= 49776 -IGVzdHV2 49777 -z4TPjA== 49778 -QVRIQU4= 49779 -IO2VnOuNsA== 49780 -IGhlZWQ= 49781 -Y3Jvc3N0YWxr 49782 -QmlsbA== 49783 -IHNwb3VzZXM= 49784 -INGB0Y7Qtg== 49785 -IHZlcnNv 49786 -IFN2ZW4= 49787 -IENhdQ== 49788 -Y3V6 49789 -IOuztOyEuOyalA== 49790 -INGF0L7Qt9GP 49791 -IG1vY2tpbmc= 49792 -IE9uYQ== 49793 -IETDoQ== 49794 -IGZydWl0ZnVs 49795 -IGJhbnF1ZXQ= 49796 -dWRkaW5n 49797 -aW5jdGlvbnM= 49798 -ZGVydA== 49799 -c3Vk 49800 -IGRlc2Nvbg== 49801 -IEpD 49802 -IMKn 49803 -IHB1Ymxp 49804 -64iI 49805 -6YGV44GG 49806 -IGVudHNjaGllZGVu 49807 -IFJPSQ== 49808 -44GN44Gf 49809 -IOyDneqyvA== 49810 -IGvDpHl0dA== 49811 -eWFuaQ== 49812 -c2hhdw== 49813 -IHVubGVhc2g= 49814 -IG1hbm5l 49815 -IGhpc3RvZ3JhbQ== 49816 -5oql 49817 -4Lit4Liw4LmE4Lij 49818 -IGdu 49819 -IGZlbGxh 49820 -IGVpbmdlcw== 49821 -IEJ1aWx0 49822 -IHJlcHJlc2VudGE= 49823 -IHB1bmlzaGluZw== 49824 -IG91dHNpZGVycw== 49825 -0L3Rg9GC0YzRgdGP 49826 -Y3VycmVudA== 49827 -IGZhbWlsaWFyaXR5 49828 -INC00LjQsg== 49829 -IHByb2pldHM= 49830 -IGFxdWVsZXM= 49831 -IEdsdWU= 49832 -dGhvc2U= 49833 -IGluY2VwdGlvbg== 49834 -IGFxdWVsbG9z 49835 -IGlsbHVzaW9ucw== 49836 -IGF0dGVuZHM= 49837 -cmVzZQ== 49838 -IHN3YXJt 49839 -IHN3YWI= 49840 -IHJlZ2FyZGV6 49841 -IHBvc2nDp8Ojbw== 49842 -IGFraGly 49843 -IGV4dHJhY3Rpbmc= 49844 -IGFuZWNkb3Rl 49845 -IFRhbGU= 49846 -INCy0LjQvQ== 49847 -IGFiZ2Vz 49848 -IG9sdcWf 49849 -IGNvbXBsaWNhZG8= 49850 -IGNvdmFyaQ== 49851 -0ZbRgtGM 49852 -RGVy 49853 -INeZ15Q= 49854 -Rm9ybQ== 49855 -IOyWtOyojOuToA== 49856 -IHJlYWRhYmxl 49857 -IGluaGliaXQ= 49858 -IGRlY2lwaGVy 49859 -IEFuZ3J5 49860 -cGc= 49861 -4K614K6k 49862 -INGB0L7QsdGB0YLQstC10L3QvdC+ 49863 -IHNhbWg= 49864 -IGVzY3I= 49865 -IGVuY29tcGFzc2Vz 49866 -IGF1c3Rlcg== 49867 -IGNvbmZpc2M= 49868 -IE1hbmRhbA== 49869 -IH0= 49870 -YXRjaGVy 49871 -PSM= 49872 -55qE5pe25YCZ 49873 -INC60LjQvdC+ 49874 -IHN0YWw= 49875 -bHVuZ3M= 49876 -IHZvbGU= 49877 -IHJlcXVpcw== 49878 -IOOCiA== 49879 -IHDDqW4= 49880 -IGxlY3R1cmVy 49881 -IGluc2NyaXB0aW9u 49882 -IGNlcnZpY2Fs 49883 -IFRyZWFzdXJl 49884 -IEpX 49885 -Y29taW5ncw== 49886 -IGV5ZXNpZ2h0 49887 -IFRhaWxz 49888 -w61zaW1v 49889 -IHdvcmtzaGVldA== 49890 -IHN3aWZ0bHk= 49891 -IGNvbm9z 49892 -IGVsaW1pbmF0ZXM= 49893 -IEJsYXpl 49894 -0LDQu9C+0LM= 49895 -IHBpY3R1cmVk 49896 -IGdpcmFmZmU= 49897 -IExvZ2lj 49898 -5ZiJ 49899 -IGVucmljaG1lbnQ= 49900 -Rml0 49901 -IHVuaW50ZW5kZWQ= 49902 -IHBlcnNlY3V0ZWQ= 49903 -YWthcA== 49904 -67CY 49905 -IGJhcmJlcg== 49906 -IGFyYmVpdGV0 49907 -IFN1cnByaXNpbmdseQ== 49908 -IEF1dG9i 49909 -dW5rdQ== 49910 -cHJvdg== 49911 -IExvY2g= 49912 -b2J5bA== 49913 -INC/0L7QtNCz0L7RgtC+0LI= 49914 -IMOpY29ub21pcXVl 49915 -IHBhdHQ= 49916 -IGNlYXNlZA== 49917 -INGB0L/QuNGB 49918 -IG51Y2xlaQ== 49919 -IGlzdGU= 49920 -IFdhZw== 49921 -IHp1cGXFgm5pZQ== 49922 -IHByb3ZlcmI= 49923 -IEFow60= 49924 -5Zue5Y67 49925 -bGlhbW8= 49926 -IHJlbGlhYmx5 49927 -IHBpaw== 49928 -IFRyYWRpbmc= 49929 -IENvbGVtYW4= 49930 -IM6xzr3OsQ== 49931 -IG1hZ2FyaQ== 49932 -IFBISUw= 49933 -IHNoZWRkaW5n 49934 -b2huZXI= 49935 -IHBvcm5vZ3JhcGh5 49936 -IGJlbmVmaWNpYXJpZXM= 49937 -4oCi 49938 -ZW5pbg== 49939 -IHJlc29sdmluZw== 49940 -INGB0L/QvtGA0YI= 49941 -INCx0LXQsw== 49942 -IG5lY3Rhcg== 49943 -dWx0dXJh 49944 -aW1zaWNhbA== 49945 -jIDrpbw= 49946 -5bm05YmN 49947 -44GX44KD 49948 -IHZpc8Ojbw== 49949 -6YGO5L6G 49950 -w7/Dv8O/w7/Dv8O/w7/Dvw== 49951 -YXR0Zm9ybQ== 49952 -IOunnuuKlA== 49953 -IHBpbGdyaW1hZ2U= 49954 -IG1hdGluZw== 49955 -IFJlYXBlcg== 49956 -IEJyZWY= 49957 -55Sf5rS7 49958 -INeR15M= 49959 -IG5vdmFtZW50ZQ== 49960 -IGdyaWxsaW5n 49961 -IFdpcmVsZXNz 49962 -IFJvbWFuaWFu 49963 -0ps= 49964 -7Jyg6w== 49965 -aGFpdA== 49966 -IEJvcmE= 49967 -QVJSWQ== 49968 -IGh5cG90aGVzZXM= 49969 -6ams 49970 -aWt1dA== 49971 -IOyVhOuyhA== 49972 -INGW0Lc= 49973 -IG5hdGlvbmFsZQ== 49974 -2KrZiQ== 49975 -w7xsbHQ= 49976 -IMOpbMOpbWVudHM= 49977 -IFdhcmU= 49978 -ICgt 49979 -0LDQu9GM0L3QvtC8 49980 -IGluZGljdA== 49981 -IFN0b25lcw== 49982 -44Gf44KB 49983 -ZXhwbG9zaW9u 49984 -IOuDhOyDiA== 49985 -IGZlbGlj 49986 -IGp1ZGljaWFyeQ== 49987 -IGluY2FybmF0aW9u 49988 -IGlubmluZw== 49989 -IGZvcm11bA== 49990 -IHNoaXBtZW50 49991 -IHJlaW5kZWVy 49992 -5pKt 49993 -INC+0LfQvdCw0Yc= 49994 -IGVudm9s 49995 -dW5keQ== 49996 -INC30L3QsNGC0Yw= 49997 -INCy0LjQtNC10LvQuA== 49998 -IGV4Y2x1ZGluZw== 49999 -ZGVhdGg= 50000 -IGJlcm0= 50001 -IHNvcHJhdHR1dHRv 50002 -IGRlYmlkbw== 50003 -IFppZw== 50004 -IE92 50005 -IEtFVklO 50006 -IFBhbGU= 50007 -IE1pcmU= 50008 -IGFuZGFy 50009 -aW5jbHVkaW5n 50010 -IHN3YXBwZWQ= 50011 -IG1pc2NvbmNlcHRpb25z 50012 -IHNwb25n 50013 -csOpYWw= 50014 -IG9yYml0YWxz 50015 -IGhhc2h0YWdz 50016 -b3JpdA== 50017 -IG1hdXZhaXM= 50018 -0LjRgdCw 50019 -IGxpdnJlcw== 50020 -IElQUw== 50021 -IDA0 50022 -w7Zn 50023 -aW5zdHI= 50024 -INCy0L3QtdGI 50025 -IGhpY2U= 50026 -aXPDqWU= 50027 -IG93ZXM= 50028 -IGVzaW1lcms= 50029 -IFVI 50030 -IGlycml0YXRpb24= 50031 -IGdpZ2dsZXM= 50032 -IGNvbG9uaWFsaXNt 50033 -IEJsaXNz 50034 -c3RyaW5ncw== 50035 -IHJldW5pdGVk 50036 -IFBzYWtp 50037 -d2FjaA== 50038 -IGNsaWZmcw== 50039 -IEZhbHNl 50040 -w6Rn 50041 -cGlwZQ== 50042 -IHdob3BwaW5n 50043 -IG1lcmluZ3Vl 50044 -IGJ1bmc= 50045 -aW5kdXN0cmll 50046 -IGxlY2hl 50047 -IExveQ== 50048 -IGRyaWU= 50049 -IHBhc3NhdA== 50050 -IG9sZWg= 50051 -IGPDqXU= 50052 -IEdhYnJpZQ== 50053 -IHJlZWZz 50054 -IGJvbWJlcnM= 50055 -IGVwaXPDs2Rpbw== 50056 -IFJ1Zw== 50057 -IFByb3Nl 50058 -b25vcw== 50059 -IG9iZXNl 50060 -IGdvb2c= 50061 -IHBpYWNl 50062 -Zmxhbnplbg== 50063 -6ZKf 50064 -IGZsYXBz 50065 -IEFsdG8= 50066 -6aOf44G5 50067 -Rmlu 50068 -IHJlc2l6ZQ== 50069 -6re4656o 50070 -6LK7 50071 -TmF0aGFu 50072 -nojroKQ= 50073 -INGC0LDQuQ== 50074 -IE5GVA== 50075 -IHNuZWV6ZQ== 50076 -IHNocm91ZA== 50077 -acOp 50078 -IHZlcmFtZW50ZQ== 50079 -IGNhc2NhZGU= 50080 -IE9vaw== 50081 -7JeG7J20 50082 -IGluZnVzZWQ= 50083 -ZnBz 50084 -Y2VudGVy 50085 -IGdyYXBwbGluZw== 50086 -IFdvaG51bmc= 50087 -IFR1bWI= 50088 -IEltbWE= 50089 -IER1eWd1c2Fs 50090 -0LXQvdGC0Lg= 50091 -IHN0ZXdhcmRzaGlw 50092 -IGhhcnA= 50093 -IGVuZG9yc2Vk 50094 -xLFsYW4= 50095 -INC+0LTQvdC40Lw= 50096 -IGNvbXBldGVuY3k= 50097 -IGJlcnQ= 50098 -IFRhbGVz 50099 -IHJoZQ== 50100 -IG9oaA== 50101 -IOqwhOuLqA== 50102 -IG1STkE= 50103 -IGdhbmdzdGVy 50104 -IFJ1bm5lcg== 50105 -0LXQvdC90YvQvA== 50106 -cGhvcmlh 50107 -IHfFgmHFm2Npd2ll 50108 -IHF1YXJ0bw== 50109 -IG9yZ2FuaXNl 50110 -IFZldA== 50111 -UGFk 50112 -INmF2Ks= 50113 -IHN0aW5rcw== 50114 -IER1bA== 50115 -dWVt 50116 -aXNpZWo= 50117 -VG9w 50118 -IHR1c3Nlbg== 50119 -IEVmZW5kaW1peg== 50120 -IEJvdWxl 50121 -IFNsb3Zlbg== 50122 -IEzDtg== 50123 -0ZHQtw== 50124 -0YDQuNC/ 50125 -Y2F2ZQ== 50126 -IGJvw64= 50127 -IGFwb2xvZ2lzZQ== 50128 -IE1hcmx5 50129 -IEV4cG9ydA== 50130 -IENhaXRsaW4= 50131 -IHRhdmFsbGE= 50132 -IGVudGFpbHM= 50133 -IGJyb20= 50134 -IENvcGVuaA== 50135 -IHdhbG51dA== 50136 -IGluc2lzdHM= 50137 -IGN14buZYw== 50138 -IFF1aXQ= 50139 -IERldmljZQ== 50140 -15LXnQ== 50141 -IERPVA== 50142 -IHZlbG9jaWRhZA== 50143 -TElF 50144 -Q29vbA== 50145 -IHNhbml0YXRpb24= 50146 -IG9saG8= 50147 -IEVC 50148 -IO2ZleyLpO2eiA== 50149 -INCc0LjRhQ== 50150 -IHp1aw== 50151 -IHN1cm5hbWU= 50152 -IFNjaHVsZA== 50153 -cnVmZg== 50154 -Y3VsdHVyYWw= 50155 -INGB0YLQvtC70YzQutC+ 50156 -5pma5LiK 50157 -jOuNsA== 50158 -IHRvcnRv 50159 -IGJhY2t1cHM= 50160 -0YDQuNC5 50161 -cmVsYXg= 50162 -IHN5bmVyZ3k= 50163 -IGJ1ZmZz 50164 -IGFwbw== 50165 -IFdlbGxuZXNz 50166 -cm91bmRlZA== 50167 -IHVuaXZlcnNlcw== 50168 -IGZlcmE= 50169 -IHN0YW5kYnk= 50170 -IFNpbHZh 50171 -IEpJ 50172 -ZW5zb3JlZA== 50173 -IOyXhuuLpA== 50174 -INCQ0LI= 50175 -INC+0YLQtNC10Ls= 50176 -IGbDuA== 50177 -IFJvY2tlZg== 50178 -IENvbXBhc3M= 50179 -IEJlYXJz 50180 -IOS4jeimgQ== 50181 -VHVybg== 50182 -IHRo4buxYw== 50183 -IHBvc3NpYmlsZQ== 50184 -IGVzdGVt 50185 -IENyb2F0aWE= 50186 -IHTDpHTDpA== 50187 -IENBTA== 50188 -4LmA4Lie 50189 -INGB0YLRgNCw0YU= 50190 -IHNhbHRz 50191 -IG1pbmltYWxpc3Q= 50192 -IGluY29ycG9yYXRlcw== 50193 -INmG24HbjNq6 50194 -YWNhbw== 50195 -IHNsYW1tZWQ= 50196 -IGNhbWE= 50197 -VGV4dA== 50198 -ISEhISEh 50199 -IGFsY2Fueg== 50200 -w6ltYQ== 50201 -IGluY2Vuc2U= 50202 -IGhhcmRlbg== 50203 -IGdyYW50aW5n 50204 -IE5haQ== 50205 -IEZpcm1h 50206 -IGh5cG9j 50207 -am9i 50208 -IFJI 50209 -enVy 50210 -0LjQu9GP 50211 -IMW6 50212 -IGRhcmVz 50213 -YW5o 50214 -IOunjO2BvA== 50215 -IGN1ZXN0acOzbg== 50216 -IExpbWE= 50217 -5pmv 50218 -IGFzc3VudG8= 50219 -IElQTw== 50220 -IEJlbmdhbA== 50221 -IEJpZXI= 50222 -IHBzeWNoZQ== 50223 -IGFjcXVhaW50ZWQ= 50224 -IEfDvG4= 50225 -0L7Qt9C4 50226 -xZtjacSF 50227 -QUc= 50228 -IG1hbGZ1bmN0aW9u 50229 -IGFzdGVyb2lkcw== 50230 -aXJleg== 50231 -YW1vcnBo 50232 -INGB0L7RgtGA0YPQtA== 50233 -IGZyZXNod2F0ZXI= 50234 -IGFycmFu 50235 -INC/0YDRiw== 50236 -0L3QvtCz 50237 -IGRpYWJldGlj 50238 -INmC2KfZhA== 50239 -IG9wcHJlc3M= 50240 -IGNhcGFjaXRhbmNl 50241 -cGVyZm9ybWFuY2U= 50242 -Y3JhdGVz 50243 -IGFwb3N0bGU= 50244 -IEpFTg== 50245 -T1VMRA== 50246 -SW50cm8= 50247 -IHN0YWxscw== 50248 -IEFCT1VU 50249 -Y3RpY2FtZW50ZQ== 50250 -IGRpbGlnZW50 50251 -IG1hbmlmZXN0cw== 50252 -IFBha2lzdGFuaQ== 50253 -ICgn 50254 -5Zy6 50255 -= 50256 diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/zh.wav b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/zh.wav deleted file mode 100644 index 7534f624c04860f363d4f9d523623de04ae0131e..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/main/resources/rawfile/zh.wav and /dev/null differ diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/mock/Libentry.mock.ets b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index eebf1ed910f6a8f2a9e7e565aa71b179b7b8b537..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/mock/mock-config.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/mock/mock-config.json5 deleted file mode 100644 index 4eefde7e033477bf018fed9911cc23ec85844d9a..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2025 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. -*/ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/ohosTest/ets/test/Ability.test.ets b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0d535ec29c2b9e33fc59273ef43d7708879aa6da..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,125 +0,0 @@ -/* -* Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; -import Want from '@ohos.app.ability.Want'; -import Base from '@ohos.base'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; - -const BUNDLE = 'MSLiteWhisperDemo_'; -const TAG = 'abilityTest'; -const domain: number = 0xF811; -const answer1 = '播放示例音频'; -const answer2 = '识别示例音频'; - -export default function abilityTest() { - let driver: Driver = Driver.create(); - describe('MSLiteWhisperDemoTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - /* - * @tc.number: MSLiteWhisperDemoTest_000 - * @tc.name: Start Ability - * @tc.desc: Start Ability - * @tc.size: MediumTest - * @tc.type: Function - * @tc.level Level 1 - */ - it('EntryAbility', 0, async (done: Function) => { - hilog.info(domain, TAG, BUNDLE + 'EntryAbility_001 begin'); - // 开启应用 - let want: Want = { - bundleName: 'com.example.cdemo_test', - abilityName: 'EntryAbility' - }; - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - abilityDelegator.startAbility(want, (err: Base.BusinessError) => { - hilog.info(domain, TAG, 'StartAbility get err ' + JSON.stringify(err)); - expect(err).assertNull(); - }) - await driver.delayMs(3000); - hilog.info(domain, TAG, BUNDLE + 'EntryAbility_001 end'); - done(); - }) - /** - * @tc.number : MSLiteWhisperDemoTest_001 - * @tc.name : IfExists - * @tc.desc : IfExists - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('IfExists', 0, async (done: Function) => { - hilog.info(domain, TAG, BUNDLE + 'IfExists_001 begin'); - await driver.delayMs(1000); - await driver.assertComponentExist(ON.text('MSLite Whisper Demo')); - await driver.assertComponentExist(ON.text(answer1)); - await driver.assertComponentExist(ON.text(answer2)); - expect(true).assertTrue(); - hilog.info(domain, TAG, BUNDLE + 'IfExists_001 end'); - done(); - }) - - /** - * @tc.number : MSLiteWhisperDemoTest_002 - * @tc.name : Play the recording - * @tc.desc : Play the recording - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('RecordingPlay', 0, async (done: Function) => { - hilog.info(domain, TAG, BUNDLE + 'RecordingPlay_001 begin'); - await driver.delayMs(1000); - // 点击播放示例音频按钮 - hilog.info(domain, TAG, BUNDLE + 'RecordingPlay_001 click play button'); - await driver.assertComponentExist(ON.text('播放示例音频')); - let msPlay = await driver.findComponent(ON.text('播放示例音频')); - await msPlay.click(); - await driver.delayMs(1000); - expect(true).assertTrue(); - hilog.info(domain, TAG, BUNDLE + 'RecordingPlay_001 end'); - done(); - }) - - /** - * @tc.number : MSLiteWhisperDemoTest_003 - * @tc.name : RecordingPredict - * @tc.desc : RecordingPredict - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('RecordingPredict', 0, async (done: Function) => { - hilog.info(domain, TAG, BUNDLE + 'RecordingPredict_001 begin'); - await driver.delayMs(1000); - // 点击'识别示例音频'按钮 - hilog.info(domain, TAG, BUNDLE + 'RecordingPredict_001 click predict button'); - await driver.assertComponentExist(ON.text('识别示例音频')); - let msPredict = await driver.findComponent(ON.text('识别示例音频')); - await msPredict.click(); - await driver.delayMs(5000); - - // 语音识别 - await driver.assertComponentExist(ON.text('识别内容', 1)) - await driver.assertComponentExist(ON.text('我认为跑步最重要的就是给我带来了身体健康', 1)); - await driver.delayMs(5000); - expect(true).assertTrue(); - hilog.info(domain, TAG, BUNDLE + 'RecordingPredict_001 end'); - done(); - }) - }) -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/ohosTest/ets/test/List.test.ets b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 384d4df44ceefbfd73b7d943c0def7be8a53bc85..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/ohosTest/module.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/ohosTest/module.json5 deleted file mode 100644 index bc58c2596b653834c953823a479bcf6ca8591467..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/test/List.test.ets b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/test/List.test.ets deleted file mode 100644 index fe5c6e49f993c2b2e1c0ab2e39fe09cfe610b948..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/test/LocalUnit.test.ets b/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 6a032b376faa380388f60f8544c0acffe1cc74c0..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/hvigor/hvigor-config.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/hvigor/hvigor-config.json5 deleted file mode 100644 index 813cb95a44d59c9c9a479661bdc50066b4ad1f05..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2025 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.2", - "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/MindSporeLiteKit/MindSporeLiteCDemoASR/hvigorfile.ts b/MindSporeLiteKit/MindSporeLiteCDemoASR/hvigorfile.ts deleted file mode 100644 index 1307c03303328d961439d1f6983b09e728b5e8ce..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2025 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/MindSporeLiteKit/MindSporeLiteCDemoASR/oh-package.json5 b/MindSporeLiteKit/MindSporeLiteCDemoASR/oh-package.json5 deleted file mode 100644 index 32207de28c1530c559110c2887c9fb72d4a7e2fd..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/oh-package.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2025 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.2", - "description": "Please describe the basic information.", - "dependencies": { - "@nutpi/chinese_transverter": "^1.0.4" - }, - "devDependencies": { - "@ohos/hypium": "1.0.21", - "@ohos/hamock": "1.0.0" - }, - "dynamicDependencies": {} -} diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/ohosTest.md b/MindSporeLiteKit/MindSporeLiteCDemoASR/ohosTest.md deleted file mode 100644 index 9d8460d3da777eb4acf9e349c1eae8ca3699384f..0000000000000000000000000000000000000000 --- a/MindSporeLiteKit/MindSporeLiteCDemoASR/ohosTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# MindSporeLiteCDemoASR 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------------------ | ------------ | -------------------- | ------------------------ | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 查看预览界面Text和Button | 进入预览界面 | | 预览界面存在Text和Button | 是 | Pass | -| 播放示例音频功能测试 | 进入预览界面 | 点击播放示例音频按钮 | 示例音频播放正常 | 是 | Pass | -| 识别示例音频功能测试 | 进入预览界面 | 点击识别示例音频按钮 | 正确输出音频识别内容 | 是 | Pass | - diff --git a/MindSporeLiteKit/MindSporeLiteCDemoASR/screenshots/MIndSporeLiteCDemoASR.PNG b/MindSporeLiteKit/MindSporeLiteCDemoASR/screenshots/MIndSporeLiteCDemoASR.PNG deleted file mode 100644 index 262dabaa5ac262cf69d94cd03fc2d7da054656ed..0000000000000000000000000000000000000000 Binary files a/MindSporeLiteKit/MindSporeLiteCDemoASR/screenshots/MIndSporeLiteCDemoASR.PNG and /dev/null differ diff --git a/OtaBackup/.gitignore b/OtaBackup/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/OtaBackup/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/OtaBackup/AppScope/app.json5 b/OtaBackup/AppScope/app.json5 deleted file mode 100644 index 740d1f8f1afd992f40e5e926a437cd6a98382d97..0000000000000000000000000000000000000000 --- a/OtaBackup/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/OtaBackup/AppScope/resources/base/element/string.json b/OtaBackup/AppScope/resources/base/element/string.json deleted file mode 100644 index 20f1b0832d957eec262b31d998c6e8030b803d7f..0000000000000000000000000000000000000000 --- a/OtaBackup/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "OtaBackup" - } - ] -} diff --git a/OtaBackup/AppScope/resources/base/media/background.png b/OtaBackup/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/OtaBackup/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/OtaBackup/AppScope/resources/base/media/foreground.png b/OtaBackup/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/OtaBackup/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/OtaBackup/AppScope/resources/base/media/layered_image.json b/OtaBackup/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/OtaBackup/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/OtaBackup/build-profile.json5 b/OtaBackup/build-profile.json5 deleted file mode 100644 index c4e8cef12735e3a7929c1740117603c46528ebe4..0000000000000000000000000000000000000000 --- a/OtaBackup/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/OtaBackup/code-linter.json5 b/OtaBackup/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/OtaBackup/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/OtaBackup/entry/.gitignore b/OtaBackup/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/OtaBackup/entry/build-profile.json5 b/OtaBackup/entry/build-profile.json5 deleted file mode 100644 index 6bd6457a2fed846cc10698666fa1268219f1bee1..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/build-profile.json5 +++ /dev/null @@ -1,33 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/OtaBackup/entry/hvigorfile.ts b/OtaBackup/entry/hvigorfile.ts deleted file mode 100644 index b0e3a1ab98a91bc918d6404b2413111a5011f14a..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/OtaBackup/entry/obfuscation-rules.txt b/OtaBackup/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/OtaBackup/entry/oh-package.json5 b/OtaBackup/entry/oh-package.json5 deleted file mode 100644 index 248c3b7541a589682a250f86a6d3ecf7414d2d6a..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/OtaBackup/entry/src/main/ets/entryability/EntryAbility.ets b/OtaBackup/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 091797f50409f128c08442915b02ae52d3df6299..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,48 +0,0 @@ -import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/OtaBackup/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/OtaBackup/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 2cedb74107adfc8929705f014c9018961c0aacf6..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,34 +0,0 @@ -// [Start backup_service] -import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; - -const TAG = `EntryBackupAbility`; - -/** - * serviceExt进程入口 - */ -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup () { - console.info(TAG,`onBackup ok`); - await Promise.resolve(); - } - - /** - * 数据恢复处理接口。接口是同步接口,其内部所有的异步操作请进行同步等待。 - * - * @param bundleVersion 版本信息 - */ - async onRestore (bundleVersion : BundleVersion): Promise { - console.info(TAG, `onRestore ok ${JSON.stringify(bundleVersion)}`); - //bundleVersion.name的前缀为“0.0.0.0”时,表示终端设备从HarmonyOS升级到HarmonyOS NEXT数据迁移场景 - if (bundleVersion.name.startsWith("0.0.0.0")){ - // 在此处实现终端设备从HarmonyOS 4.x升级到HarmonyOS NEXT后,应用数据的转换和迁移 - // 涉及异步操作请进行同步等待 - console.info(TAG, `HarmonyOS to HarmonyOS NEXT scenario`); - } else { - // 在此处实现从HarmonyOS NEXT设备迁移到HarmonyOS NEXT设备后,应用数据的处理。无特殊要求,可以空实现 - // 涉及异步操作请进行同步等待 - console.info(TAG, `Other scenario`); - } - } -} -// [End backup_service] \ No newline at end of file diff --git a/OtaBackup/entry/src/main/ets/pages/Index.ets b/OtaBackup/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 8e2d24ad42693fc877d51bb7820f0a9da68fa135..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,23 +0,0 @@ -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/OtaBackup/entry/src/main/module.json5 b/OtaBackup/entry/src/main/module.json5 deleted file mode 100644 index 53024e8f020cc0824592631ba6924108c8028f0f..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/module.json5 +++ /dev/null @@ -1,50 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "phone" - ], - "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": [ - "ohos.want.action.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/OtaBackup/entry/src/main/resources/base/element/color.json b/OtaBackup/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/OtaBackup/entry/src/main/resources/base/element/float.json b/OtaBackup/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/OtaBackup/entry/src/main/resources/base/element/string.json b/OtaBackup/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/OtaBackup/entry/src/main/resources/base/media/background.png b/OtaBackup/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/OtaBackup/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/OtaBackup/entry/src/main/resources/base/media/foreground.png b/OtaBackup/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/OtaBackup/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/OtaBackup/entry/src/main/resources/base/media/layered_image.json b/OtaBackup/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/OtaBackup/entry/src/main/resources/base/media/startIcon.png b/OtaBackup/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/OtaBackup/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/OtaBackup/entry/src/main/resources/base/profile/backup_config.json b/OtaBackup/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/OtaBackup/entry/src/main/resources/base/profile/main_pages.json b/OtaBackup/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/OtaBackup/entry/src/main/resources/dark/element/color.json b/OtaBackup/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/OtaBackup/entry/src/mock/mock-config.json5 b/OtaBackup/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41bfdf76d6f793007240d80983a52f15f97..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/OtaBackup/entry/src/ohosTest/ets/test/Ability.test.ets b/OtaBackup/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f67579d6e31b5f5aeea463e216b9b141048..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/OtaBackup/entry/src/ohosTest/ets/test/List.test.ets b/OtaBackup/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/OtaBackup/entry/src/ohosTest/module.json5 b/OtaBackup/entry/src/ohosTest/module.json5 deleted file mode 100644 index 509a3a28a3e6be8d7f98cc563fa8195657d77d1d..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/OtaBackup/entry/src/test/List.test.ets b/OtaBackup/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/OtaBackup/entry/src/test/LocalUnit.test.ets b/OtaBackup/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/OtaBackup/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/OtaBackup/hvigor/hvigor-config.json5 b/OtaBackup/hvigor/hvigor-config.json5 deleted file mode 100644 index 7a7ab8914d8db6ab89758e185df5855dffe88d04..0000000000000000000000000000000000000000 --- a/OtaBackup/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/OtaBackup/hvigorfile.ts b/OtaBackup/hvigorfile.ts deleted file mode 100644 index 47113e2e36ecefde41c136272a0bd6ff745cffe4..0000000000000000000000000000000000000000 --- a/OtaBackup/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/OtaBackup/oh-package-lock.json5 b/OtaBackup/oh-package-lock.json5 deleted file mode 100644 index 6b264af261c4152dee3641068ee2fff156299e4b..0000000000000000000000000000000000000000 --- a/OtaBackup/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.24": "@ohos/hypium@1.0.24" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.24": { - "name": "", - "version": "1.0.24", - "integrity": "sha512-3dCqc+BAR5LqEGG2Vtzi8O3r7ci/3fYU+FWjwvUobbfko7DUnXGOccaror0yYuUhJfXzFK0aZNMGSnXaTwEnbw==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.24.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/OtaBackup/oh-package.json5 b/OtaBackup/oh-package.json5 deleted file mode 100644 index c72aa05d549507e5ea6ce0bc0a8080c450508c7d..0000000000000000000000000000000000000000 --- a/OtaBackup/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "modelVersion": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/OtaBackupEx/.gitignore b/OtaBackupEx/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/OtaBackupEx/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/OtaBackupEx/AppScope/app.json5 b/OtaBackupEx/AppScope/app.json5 deleted file mode 100644 index 740d1f8f1afd992f40e5e926a437cd6a98382d97..0000000000000000000000000000000000000000 --- a/OtaBackupEx/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.myapplication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/OtaBackupEx/AppScope/resources/base/element/string.json b/OtaBackupEx/AppScope/resources/base/element/string.json deleted file mode 100644 index 0862b68db823aa8c5d62437723d75bdeaca8d1d4..0000000000000000000000000000000000000000 --- a/OtaBackupEx/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "OtaBackupEx" - } - ] -} diff --git a/OtaBackupEx/AppScope/resources/base/media/background.png b/OtaBackupEx/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/OtaBackupEx/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/OtaBackupEx/AppScope/resources/base/media/foreground.png b/OtaBackupEx/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/OtaBackupEx/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/OtaBackupEx/AppScope/resources/base/media/layered_image.json b/OtaBackupEx/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/OtaBackupEx/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/OtaBackupEx/build-profile.json5 b/OtaBackupEx/build-profile.json5 deleted file mode 100644 index c4e8cef12735e3a7929c1740117603c46528ebe4..0000000000000000000000000000000000000000 --- a/OtaBackupEx/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/OtaBackupEx/code-linter.json5 b/OtaBackupEx/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/OtaBackupEx/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/OtaBackupEx/entry/.gitignore b/OtaBackupEx/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/OtaBackupEx/entry/build-profile.json5 b/OtaBackupEx/entry/build-profile.json5 deleted file mode 100644 index 6bd6457a2fed846cc10698666fa1268219f1bee1..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/build-profile.json5 +++ /dev/null @@ -1,33 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/OtaBackupEx/entry/hvigorfile.ts b/OtaBackupEx/entry/hvigorfile.ts deleted file mode 100644 index b0e3a1ab98a91bc918d6404b2413111a5011f14a..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/OtaBackupEx/entry/obfuscation-rules.txt b/OtaBackupEx/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/OtaBackupEx/entry/oh-package.json5 b/OtaBackupEx/entry/oh-package.json5 deleted file mode 100644 index 248c3b7541a589682a250f86a6d3ecf7414d2d6a..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/OtaBackupEx/entry/src/main/ets/entryability/EntryAbility.ets b/OtaBackupEx/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 091797f50409f128c08442915b02ae52d3df6299..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,48 +0,0 @@ -import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/OtaBackupEx/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 6e1af216cda13d836c156f1e5bc8f9ab80490bd5..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -// [Start backup_service_ex] -import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; - -const TAG = `BackupExtensionAbility`; - -interface ErrorInfo { - type: string, - errorCode: number, - errorInfo: string -} - -interface DetailInfo { - type: string, - detail: string -} - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - console.info(TAG, 'onBackup ok'); - } - - async onRestoreEx(bundleVersion: BundleVersion, restoreInfo: string): Promise { - console.info(TAG, `onRestoreEx ok ${JSON.stringify(bundleVersion)}`); - let errorInfo: ErrorInfo = { - type: "ErrorInfo", - errorCode: 0, - errorInfo: "app diy error info" - } - if (bundleVersion.name.startsWith("0.0.0.0")){ - // 在此处实现终端设备从HarmonyOS 4.x到HarmonyOS NEXT的应用数据处理。 - // 涉及异步操作请进行同步等待 - console.info(TAG, `HarmonyOS to HarmonyOS NEXT scenario`); - - // 如果升级场景与克隆场景没有差异化数据处理诉求,此处可以忽略。 - if (this.IsOtaScenario(restoreInfo)) { - // 在此处实现终端设备从HarmonyOS 4.x到HarmonyOS NEXT升级场景的特有数据处理。无特殊要求,此处可以忽略。 - console.info(TAG, `Ota Scenario`) - } else { - // 在此处实现终端设备从HarmonyOS 4.x到HarmonyOS NEXT克隆场景的特有数据处理。无特殊要求,此处可以忽略。 - console.info(TAG, `Clone Scenario`) - } - } else { - // 在此处实现从HarmonyOS NEXT设备迁移到HarmonyOS NEXT设备后,应用数据的处理。无特殊要求,可以空实现。 - // 涉及异步操作请进行同步等待 - console.info(TAG, `Other scenario`); - } - return JSON.stringify(errorInfo); - } - - /** - * 判断是否是升级场景 - * @param restoreInfo 预留字段,应用恢复过程中需要的扩展参数 - * @returns 升级场景返回true,否则返回false - */ - IsOtaScenario(restoreInfo: string): boolean { - let details:Array = JSON.parse(restoreInfo); - return details.some((detailInfo) => { - //设备从HarmonyOS 4.x升级到HarmonyOS NEXT/5.0.x场景判断条件 - return detailInfo.type == 'isSameDevice' && detailInfo.detail == 'true'; - }); - } -} -// [End backup_service_ex] \ No newline at end of file diff --git a/OtaBackupEx/entry/src/main/ets/pages/Index.ets b/OtaBackupEx/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 8e2d24ad42693fc877d51bb7820f0a9da68fa135..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,23 +0,0 @@ -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/main/module.json5 b/OtaBackupEx/entry/src/main/module.json5 deleted file mode 100644 index 53024e8f020cc0824592631ba6924108c8028f0f..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/module.json5 +++ /dev/null @@ -1,50 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "phone" - ], - "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": [ - "ohos.want.action.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/OtaBackupEx/entry/src/main/resources/base/element/color.json b/OtaBackupEx/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/main/resources/base/element/float.json b/OtaBackupEx/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/OtaBackupEx/entry/src/main/resources/base/element/string.json b/OtaBackupEx/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/main/resources/base/media/background.png b/OtaBackupEx/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/OtaBackupEx/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/OtaBackupEx/entry/src/main/resources/base/media/foreground.png b/OtaBackupEx/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/OtaBackupEx/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/OtaBackupEx/entry/src/main/resources/base/media/layered_image.json b/OtaBackupEx/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/main/resources/base/media/startIcon.png b/OtaBackupEx/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/OtaBackupEx/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/OtaBackupEx/entry/src/main/resources/base/profile/backup_config.json b/OtaBackupEx/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/main/resources/base/profile/main_pages.json b/OtaBackupEx/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/OtaBackupEx/entry/src/main/resources/dark/element/color.json b/OtaBackupEx/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/mock/mock-config.json5 b/OtaBackupEx/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41bfdf76d6f793007240d80983a52f15f97..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/ohosTest/ets/test/Ability.test.ets b/OtaBackupEx/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f67579d6e31b5f5aeea463e216b9b141048..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/ohosTest/ets/test/List.test.ets b/OtaBackupEx/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/ohosTest/module.json5 b/OtaBackupEx/entry/src/ohosTest/module.json5 deleted file mode 100644 index 509a3a28a3e6be8d7f98cc563fa8195657d77d1d..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/OtaBackupEx/entry/src/test/List.test.ets b/OtaBackupEx/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/OtaBackupEx/entry/src/test/LocalUnit.test.ets b/OtaBackupEx/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/OtaBackupEx/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/OtaBackupEx/hvigor/hvigor-config.json5 b/OtaBackupEx/hvigor/hvigor-config.json5 deleted file mode 100644 index 7a7ab8914d8db6ab89758e185df5855dffe88d04..0000000000000000000000000000000000000000 --- a/OtaBackupEx/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/OtaBackupEx/hvigorfile.ts b/OtaBackupEx/hvigorfile.ts deleted file mode 100644 index 47113e2e36ecefde41c136272a0bd6ff745cffe4..0000000000000000000000000000000000000000 --- a/OtaBackupEx/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/OtaBackupEx/oh-package-lock.json5 b/OtaBackupEx/oh-package-lock.json5 deleted file mode 100644 index 6b264af261c4152dee3641068ee2fff156299e4b..0000000000000000000000000000000000000000 --- a/OtaBackupEx/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.24": "@ohos/hypium@1.0.24" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.24": { - "name": "", - "version": "1.0.24", - "integrity": "sha512-3dCqc+BAR5LqEGG2Vtzi8O3r7ci/3fYU+FWjwvUobbfko7DUnXGOccaror0yYuUhJfXzFK0aZNMGSnXaTwEnbw==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.24.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/OtaBackupEx/oh-package.json5 b/OtaBackupEx/oh-package.json5 deleted file mode 100644 index c72aa05d549507e5ea6ce0bc0a8080c450508c7d..0000000000000000000000000000000000000000 --- a/OtaBackupEx/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "modelVersion": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/.gitignore b/PerformanceAnalysisKit/HiAppEvent/EventSub/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/PerformanceAnalysisKit/HiAppEvent/EventSub/AppScope/app.json5 b/PerformanceAnalysisKit/HiAppEvent/EventSub/AppScope/app.json5 deleted file mode 100644 index 11ec180f4bdd0479c366174be005d029057fa76b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.eventsub", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/AppScope/resources/base/element/string.json b/PerformanceAnalysisKit/HiAppEvent/EventSub/AppScope/resources/base/element/string.json deleted file mode 100644 index 5e8cd8a19f7473dae53e6273e9b38ea3e70d4f4e..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EventSub" - } - ] -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/AppScope/resources/base/media/app_icon.png b/PerformanceAnalysisKit/HiAppEvent/EventSub/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiAppEvent/EventSub/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/README_zh.md b/PerformanceAnalysisKit/HiAppEvent/EventSub/README_zh.md deleted file mode 100644 index 9b83c21fa497145224ddb335660c4bcafd5bdc29..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/README_zh.md +++ /dev/null @@ -1,501 +0,0 @@ -# 事件订阅 - -### 介绍 - -本示例主要展示用HiAppEvent如何实现事件订阅(AppEvent),并列举了订阅如下系统事件的例子: - -崩溃事件(CrashEvent)、系统卡死事件(FreezeEvent)、系统资源泄漏事件(PssLeakEvent)、系统踩内存事件(ASANEvent)以及主线程超时事件 - -(TimeOutEvent)。 - -该工程中的展示的代码详细描述可查如下链接: - -- [事件订阅(ArkTS)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/dfx/hiappevent-watcher-app-events-arkts.md) - -- [事件订阅(C/C++)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/dfx/hiappevent-watcher-app-events-ndk.md) - -- [订阅崩溃事件(ArkTS)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-crash-events-arkts.md) - -- [订阅崩溃事件(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-crash-events-ndk.md) - -- [订阅卡死事件(ArkTS)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-freeze-events-arkts.md) - -- [订阅卡死事件(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-freeze-events-ndk.md) - -- [订阅资源泄漏事件(ArkTS)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-resourceleak-events-arkts.md) - -- [订阅资源泄漏事件(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-resourceleak-events-ndk.md) - -- [订阅踩内存事件(ArkTS)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-address-sanitizer-events-arkts.md) - -- [订阅踩内存事件(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-address-sanitizer-events-ndk.md) - -- [订阅主线程超时事件(ArkTS)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-mainthreadjank-events-arkts.md) - -- [订阅主线程超时事件(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hiappevent-watcher-mainthreadjank-events-ndk.md) - -### 效果预览 - -| 主页 | -| :----------------------------------------------------------: | -| z | - -#### 使用说明 - -请先按照工程目录添加三方库文件jsoncpp相关文件,否则编译无法通过;jsoncpp官方下载地址为https://github.com/open-source-parsers/jsoncpp,下载完成后在文件夹内运行python脚本“amalgamate.py”(需要有python环境),脚本运行完成后将生成名为“dist”的文件夹,打开后即可得到jsoncpp.cpp,json.h和json-forward.h三个文件。 - -##### 1.事件订阅(ArkTS&C++)使用说明:订阅崩溃(APP_CRASH)事件 - -1.在应用侧主界面,点击"WatchAppCrash ArkTS&C++"按钮,触发一次崩溃(APP_CRASH)事件; - -2.在DevEco Studio侧下方导航栏,切换到"Log"窗口,日志过滤选择"All log of selected app",搜索内容设置为"AppEvent HiAppEvent"。此时窗口仅显示符合条件的日志,打印日志结果为: - -```text -AppEvent HiAppEvent succeed to read events with onReceive callback form C API // C++读事件成功 -AppEvent HiAppEvent eventInfo.domain=OS -AppEvent HiAppEvent eventInfo.name=APP_CRASH -AppEvent HiAppEvent eventInfo.eventType=1 -AppEvent HiAppEvent eventInfo.params.time=1503513021502 -AppEvent HiAppEvent eventInfo.params.bundle_name=com.samples.eventsub -AppEvent HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/APP_CRASH_1503513021744_16523.log"] -AppEvent HiAppEvent succeed to read event with onReceive callback from ArkTS // ArkTS读事件成功 -AppEvent HiAppEvent eventName=APP_CRASH -AppEvent HiAppEvent eventInfo.params.time=1503513021502 -AppEvent HiAppEvent eventInfo.params.bundle_name="com.samples.eventsub" -AppEvent HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/APP_CRASH_1503513021744_16523.log"] -``` - -注意: - -1.EntryAbility.ets的onCreate()方法中同时注册了崩溃事件的ArkTS观察者和C++观察者,故读取时均能读到,不影响结果。 - -2.C++读事件比ArkTS写事件先出现的原因可能是C++层的日志打印执行速度更快,不影响结果。 - -##### 2.事件订阅(ArkTS)使用说明:订阅按钮点击(click)事件 - -1.在应用侧主界面,点击"writeEvent ArkTS"按钮,从ets层触发一次按钮点击事件打点; - -2.在DevEco Studio侧下方导航栏,切换到"Log"窗口,日志过滤选择"All log of selected app",搜索内容设置为"AppEvent HiAppEvent"。此时窗口仅显示符合条件的日志,打印日志结果为: - -```text -AppEvent HiAppEvent succeed to read events with onTrigger callback form C API -AppEvent HiAppEvent eventInfo={"domain_":"button","name_":"click","type_":4,"time_":1503514787492,"tz_":"","pid_":18178,"tid_":18178,"clickTime":100} -AppEvent HiAppEvent eventInfo.domain=button -AppEvent HiAppEvent eventInfo.name=click -AppEvent HiAppEvent eventInfo.eventType=4 -AppEvent HiAppEvent eventInfo.params.clickTime=100 -AppEvent HiAppEvent succeed to read event with onTrigger callback from ArkTS. -AppEvent HiAppEvent onTrigger: curRow=1, curSize=120 -AppEvent HiAppEvent eventPkg.packageId=0 -AppEvent HiAppEvent eventPkg.row=1 -AppEvent HiAppEvent eventPkg.size=120 -AppEvent HiAppEvent eventPkg.info={"domain_":"button","name_":"click","type_":4,"time_":1503514787492,"tz_":"","pid_":18178,"tid_":18178,"clickTime":100} -AppEvents writeEvent ArkTS success -``` - -注意: - -1.EntryAbility.ets的onCreate()方法中同时注册了按钮点击事件的ArkTS观察者和C++观察者,故读取时均能读到,不影响结果。 - -2.C++读事件比ArkTS写事件先出现的原因可能是C++层的日志打印执行速度更快,不影响结果。 - -##### 3.事件订阅(C/C++)使用说明:订阅按钮点击(click)事件 - -1.在应用侧主界面,点击"writeEvent C++"按钮,从c++层触发一次按钮点击事件打点; - -2.在DevEco Studio侧下方导航栏,切换到"Log"窗口,日志过滤选择"All log of selected app",搜索内容设置为"AppEvent HiAppEvent"。此时窗口仅显示符合条件的日志,打印日志结果为: - -```text -AppEvent HiAppEvent succeed to read events with onTrigger callback form C API -AppEvent HiAppEvent eventInfo={"domain_":"button","name_":"click","type_":4,"time_":1503515278195,"tz_":"","pid_":18178,"tid_":18178,"clickTime":1503515278} -AppEvent HiAppEvent eventInfo.domain=button -AppEvent HiAppEvent eventInfo.name=click -AppEvent HiAppEvent eventInfo.eventType=4 -AppEvent HiAppEvent eventInfo.params.clickTime=1503515278 -AppEvent HiAppEvent succeed to read event with onTrigger callback from ArkTS. -AppEvent HiAppEvent onTrigger: curRow=1, curSize=127 -AppEvent HiAppEvent eventPkg.packageId=1 -AppEvent HiAppEvent eventPkg.row=1 -AppEvent HiAppEvent eventPkg.size=127 -AppEvent HiAppEvent eventPkg.info={"domain_":"button","name_":"click","type_":4,"time_":1503515278195,"tz_":"","pid_":18178,"tid_":18178,"clickTime":1503515278} -``` - -注意: - -1.EntryAbility.ets的onCreate()方法中同时注册了按钮点击事件的ArkTS观察者和C++观察者,故读取时均能读到,不影响结果。 - -2.为了区分ArkTS、C++中设置的自定义打点参数clickTime,点击"writeEvent C++"按钮,配置的clickTime是一个时间戳,而点击"writeEvent ArkTS"按钮,配置的 - -clickTime是整数100。 - -3.C++读事件比ArkTS写事件先出现的原因可能是C++层的日志打印执行速度更快,不影响结果。 - -##### 4.订阅崩溃事件(ArkTS&C++) - -1.在应用侧主界面,点击"appCrash ArkTS&C++"按钮触发崩溃,应用退出后重启应用; - -2.在DevEco Studio侧下方导航栏,切换到"Log"窗口,日志过滤选择"All log of selected app",搜索内容设置为"HiAppevent"。此时窗口仅显示符合条件的日志,打印日志结果为: - -```text -HiAppEvent eventInfo.WatcherType=OnTrigger -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=APP_CRASH -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1501890680817 -HiAppEvent eventInfo.params.crash_type=JsError -HiAppEvent eventInfo.params.foreground=1 -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.samples.eventsub -HiAppEvent eventInfo.params.pid=2579 -HiAppEvent eventInfo.params.uid=20010051 -HiAppEvent eventInfo.params.uuid=114e22cab85a934b58dca7442edb14bad4301a7fe9a4f5ee5c662c557ada08b1 -HiAppEvent eventInfo.params.exception={"message":"Unexpected Text in JSON: Empty Text","name":"SyntaxError","stack":" at anonymous entry (entry/src/main/ets/pages/Index.ets:65:13)\n"} -HiAppEvent eventInfo.params.hilog.size=100 -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/APP_CRASH_1501890680961_2579.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为C++ onTrigger类型观察者日志输出 -HiAppEvent eventInfo.WatcherType=OnReceive -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=APP_CRASH -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1501890680817 -HiAppEvent eventInfo.params.crash_type=JsError -HiAppEvent eventInfo.params.foreground=1 -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.samples.eventsub -HiAppEvent eventInfo.params.pid=2579 -HiAppEvent eventInfo.params.uid=20010051 -HiAppEvent eventInfo.params.uuid=114e22cab85a934b58dca7442edb14bad4301a7fe9a4f5ee5c662c557ada08b1 -HiAppEvent eventInfo.params.exception={"message":"Unexpected Text in JSON: Empty Text","name":"SyntaxError","stack":" at anonymous entry (entry/src/main/ets/pages/Index.ets:65:13)\n"} -HiAppEvent eventInfo.params.hilog.size=100 -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/APP_CRASH_1501890680961_2579.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为C++ onReceive类型观察者日志输出 -HiAppEvent onReceive: domain=OS -HiAppEvent eventName=APP_CRASH -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=APP_CRASH -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1501890680817 -HiAppEvent eventInfo.params.crash_type=JsError -HiAppEvent eventInfo.params.foreground=true -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.samples.eventsub -HiAppEvent eventInfo.params.pid=2579 -HiAppEvent eventInfo.params.uid=20010051 -HiAppEvent eventInfo.params.uuid=114e22cab85a934b58dca7442edb14bad4301a7fe9a4f5ee5c662c557ada08b1 -HiAppEvent eventInfo.params.exception={"message":"Unexpected Text in JSON: Empty Text","name":"SyntaxError","stack":" at anonymous entry (entry/src/main/ets/pages/Index.ets:65:13)\n"} -HiAppEvent eventInfo.params.hilog.size=100 -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/APP_CRASH_1501890680961_2579.log"] -HiAppEvent eventInfo.params.log_over_limit=false -HiAppEvent eventInfo.params.test_data=100 -// 以上为ArkTS onReceive类型观察者日志输出 -``` - -注意: - -1.要确认日志输出中的eventInfo.name为APP_CRASH。 - -2.C++实现了onReceive和onTrigger两种观察者,ArkTS实现了onReceive观察者。 - -##### 5.订阅卡死事件(ArkTS&C++) - -1.在应用侧主界面,点击"appFreeze ArkTS&C++"按钮触发卡死(可能需要几秒),应用退出后重启应用; - -2.在DevEco Studio侧下方导航栏,切换到"Log"窗口,日志过滤选择"All log of selected app",搜索内容设置为"HiAppevent"。此时窗口仅显示符合条件的日志,打印日志结果为: - -```text -HiAppEvent eventInfo.WatcherType=OnReceive -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=APP_FREEZE -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1501891964864 -HiAppEvent eventInfo.params.foreground=1 -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.samples.eventsub -HiAppEvent eventInfo.params.process_name=com.samples.eventsub -HiAppEvent eventInfo.params.pid=5105 -HiAppEvent eventInfo.params.uid=20010051 -HiAppEvent eventInfo.params.uuid=c450b09dcefc0f9bd9b6cb4230e0c8f2d1b1e3c5becf82d272ef1a3241c958da -HiAppEvent eventInfo.params.exception={"message":"App main thread is not response!","name":"THREAD_BLOCK_6S"} -HiAppEvent eventInfo.params.hilog.size=88 -HiAppEvent eventInfo.params.event_handler.size=0 -HiAppEvent eventInfo.params.event_handler_3s.size=0 -HiAppEvent eventInfo.params.event_handler_6s.size=0 -HiAppEvent eventInfo.params.peer_binder.size=0 -HiAppEvent eventInfo.params.threads.size=38 -HiAppEvent eventInfo.params.memory={"pss":0,"rss":0,"sys_avail_mem":1000060,"sys_free_mem":485304,"sys_total_mem":1935816,"vss":0} -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/APP_FREEZE_1501891977850_5105.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为C++ onReceive类型观察者日志输出 -HiAppEvent eventInfo.WatcherType=OnTrigger -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=APP_FREEZE -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1501891964864 -HiAppEvent eventInfo.params.foreground=1 -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.samples.eventsub -HiAppEvent eventInfo.params.process_name=com.samples.eventsub -HiAppEvent eventInfo.params.pid=5105 -HiAppEvent eventInfo.params.uid=20010051 -HiAppEvent eventInfo.params.uuid=c450b09dcefc0f9bd9b6cb4230e0c8f2d1b1e3c5becf82d272ef1a3241c958da -HiAppEvent eventInfo.params.exception={"message":"App main thread is not response!","name":"THREAD_BLOCK_6S"} -HiAppEvent eventInfo.params.hilog.size=88 -HiAppEvent eventInfo.params.event_handler.size=0 -HiAppEvent eventInfo.params.event_handler_3s.size=0 -HiAppEvent eventInfo.params.event_handler_6s.size=0 -HiAppEvent eventInfo.params.peer_binder.size=0 -HiAppEvent eventInfo.params.threads.size=38 -HiAppEvent eventInfo.params.memory={"pss":0,"rss":0,"sys_avail_mem":1000060,"sys_free_mem":485304,"sys_total_mem":1935816,"vss":0} -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/APP_FREEZE_1501891977850_5105.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为C++ onTrigger类型观察者日志输出 -HiAppEvent onReceive: domain=OS -HiAppEvent eventName=APP_FREEZE -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=APP_FREEZE -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1501891964864 -HiAppEvent eventInfo.params.foreground=true -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.samples.eventsub -HiAppEvent eventInfo.params.process_name=com.samples.eventsub -HiAppEvent eventInfo.params.pid=5105 -HiAppEvent eventInfo.params.uid=20010051 -HiAppEvent eventInfo.params.uuid=c450b09dcefc0f9bd9b6cb4230e0c8f2d1b1e3c5becf82d272ef1a3241c958da -HiAppEvent eventInfo.params.exception={"message":"App main thread is not response!","name":"THREAD_BLOCK_6S"} -HiAppEvent eventInfo.params.hilog.size=88 -HiAppEvent eventInfo.params.event_handler.size=0 -HiAppEvent eventInfo.params.event_handler_size_3s=0 -HiAppEvent eventInfo.params.event_handler_size_6s=0 -HiAppEvent eventInfo.params.peer_binder.size=0 -HiAppEvent eventInfo.params.threads.size=38 -HiAppEvent eventInfo.params.memory={"pss":0,"rss":0,"sys_avail_mem":1000060,"sys_free_mem":485304,"sys_total_mem":1935816,"vss":0} -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/APP_FREEZE_1501891977850_5105.log"] -HiAppEvent eventInfo.params.log_over_limit=false -HiAppEvent eventInfo.params.test_data=100 -// 以上为ArkTS onReceive类型观察者日志输出 -``` - -注意: - -1.如果在应用重启时立即在log窗口搜索日志会出现日志暂时未出现的情况,原因是Freeze事件处理时间较长,等待10秒即可。 - -2.要确认日志输出中的eventInfo.name为APP_FREEZE。 - -3.C++实现了onReceive和onTrigger两种观察者,ArkTS实现了onReceive观察者。 - -##### 6.订阅资源泄漏事件(ArkTS&C++) - -1.先在设备“开发者选项”中打开“系统资源泄漏日志”,并重启设备; - -2.在应用侧主界面,点击"pssLeak ArkTS&C++"按钮触发资源泄露事件,等待15~30分钟,会上报应用内存泄漏事件; - -3.在DevEco Studio侧下方导航栏,切换到"Log"窗口,日志过滤选择"All log of selected app",搜索内容设置为"HiAppevent"。此时窗口仅显示符合条件的日志,打印日志结果为: - -```text -HiAppEvent eventInfo.WatcherType=OnReceive -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=RESOURCE_OVERLIMIT -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1502049167732 -HiAppEvent eventInfo.params.pid=1587 -HiAppEvent eventInfo.params.uid=20010043 -HiAppEvent eventInfo.params.resource_type=pss_memory -HiAppEvent eventInfo.params.bundle_name=com.example.eventsub -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.memory={"pss":2100257,"rss":1352644,"sys_avail_mem":250272,"sys_free_mem":60004,"sys_total_mem":1992340,"vss":2462936} -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/resourcelimit/RESOURCE_OVERLIMIT_1725614572401_6808.log","/data/storage/el2/log/resourcelimit/RESOURCE_OVERLIMIT_1725614572412_6808.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -以上为C++ OnReceive类型观察者日志输出 -HiAppEvent eventInfo.WatcherType=OnTrigger -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=RESOURCE_OVERLIMIT -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1502049167732 -HiAppEvent eventInfo.params.pid=1587 -HiAppEvent eventInfo.params.uid=20010043 -HiAppEvent eventInfo.params.resource_type=pss_memory -HiAppEvent eventInfo.params.bundle_name=com.example.eventsub -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.memory={"pss":2100257,"rss":1352644,"sys_avail_mem":250272,"sys_free_mem":60004,"sys_total_mem":1992340,"vss":2462936} -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/resourcelimit/RESOURCE_OVERLIMIT_1725614572401_6808.log","/data/storage/el2/log/resourcelimit/RESOURCE_OVERLIMIT_1725614572412_6808.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为C++ onTrigger类型观察者日志输出 -HiAppEvent onReceive: domain=OS -HiAppEvent eventName=RESOURCE_OVERLIMIT -HiAppEvent eventInfo={"domain":"OS","name":"RESOURCE_OVERLIMIT","eventType":1,"params":{"bundle_name":"com.example.eventsub","bundle_version":"1.0.0","memory":{"pss":2100257,"rss":1352644,"sys_avail_mem":250272,"sys_free_mem":60004,"sys_total_mem":1992340,"vss":2462936},"pid":20731,"resource_type":"pss_memory","time":1502348798106,"uid":20010044,"external_log": ["/data/storage/el2/log/resourcelimit/RESOURCE_OVERLIMIT_1725614572401_6808.log", "/data/storage/el2/log/resourcelimit/RESOURCE_OVERLIMIT_1725614572412_6808.log"], "log_over_limit": false}}eventInfo.params.bundle_version=1.0.0 -// 以上为ArkTS onReceive类型观察者日志输出 -``` - -注意: - -1.如果设备“开发者选项”中没有“系统资源泄漏日志”选项,或有该选项但重启后该选项自动关闭,则无法测试该功能。 - -2.要确认日志输出中的eventInfo.name为RESOURCE_OVERLIMIT。 - -3.C++实现了onReceive和onTrigger两种观察者,ArkTS实现了onReceive观察者。 - -##### 7.订阅踩内存事件(ArkTS&C++) - -1.点击DevEco Studio界面中的“entry”,点击“Edit Configurations”,点击“Diagnostics”,勾选“Address Sanitizer”,保存设置。 - -2.在应用侧主界面,点击"appAsanEvent ArkTS&C++"按钮触发踩内存事件,应用退出后重启应用; - -3.在DevEco Studio侧下方导航栏,切换到"Log"窗口,日志过滤选择"All log of selected app",搜索内容设置为"HiAppevent"。此时窗口仅显示符合条件的日志,打印日志结果为: - -```text -HiAppEvent eventInfo.WatcherType=OnTrigger -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=ADDRESS_SANITIZER -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1609739933049 -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.example.cpp -HiAppEvent eventInfo.params.pid=6628 -HiAppEvent eventInfo.params.uid=20010050 -HiAppEvent eventInfo.params.type="stack-buffer-overflow" -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/ADDRESS_SANITIZER_1609739933234_6628.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为C++ OnTrigger观察者日志输出 -HiAppEvent eventInfo.WatcherType=OnReceive -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=ADDRESS_SANITIZER -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1609739933049 -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.example.cpp -HiAppEvent eventInfo.params.pid=6628 -HiAppEvent eventInfo.params.uid=20010050 -HiAppEvent eventInfo.params.type="stack-buffer-overflow" -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/ADDRESS_SANITIZER_1609739933234_6628.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为C++ OnReceiver观察者日志输出 -HiAppEvent onReceive: domain=OS -HiAppEvent eventName=ADDRESS_SANITIZER -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=ADDRESS_SANITIZER -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1609739473665 -HiAppEvent eventInfo.params.crash_type=JsError -HiAppEvent eventInfo.params.foreground=true -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.example.eventsub -HiAppEvent eventInfo.params.pid=4116 -HiAppEvent eventInfo.params.uid=20010053 -HiAppEvent eventInfo.type=stack-buffer-overflow -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/ADDRESS_SANITIZER_1609739473837_4116.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为ArkTS onReceive类型观察者日志输出 -``` - -注意: - -1.如果在勾选“Address Sanitizer”设置后,应用无法在设备上打开,可能是DevEco Studio和设备版本的原因,请切换版本尝试。 - -2.要确认日志输出中的eventInfo.name为ADDRESS_SANITIZER。 - -3.C++实现了onReceive和onTrigger两种观察者,ArkTS实现了onReceive观察者。 - -##### 8.订阅主线程超时事件(ArkTS&C++) - -1.测试设备应能使用开发者使用nolog版本,开发者模式处于关闭状态,可以使能主线程超时检测抓取trace的功能,建议使用真机测试; - -2.在应用侧主界面,快速连续点击两次"timeOut350 ArkTS&C++"按钮触发主线程超时事件; - -3.在DevEco Studio侧下方导航栏,切换到"Log"窗口,日志过滤选择"All log of selected app",搜索内容设置为"HiAppevent"。此时窗口仅显示符合条件的日志,打印日志结果为: - -```text -HiAppEvent eventInfo.WatcherType=OnReceive -HiAppEvent eventInfo.domain=OS -HiAppEvent eventInfo.name=MAIN_THREAD_JANK -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1609739933049 -HiAppEvent eventInfo.params.pid=6628 -HiAppEvent eventInfo.params.uid=20010050 -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.example.cpp -HiAppEvent eventInfo.params.begin_time=1609739932900 -HiAppEvent eventInfo.params.end_time=1609739933049 -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/MAIN_THREAD_JANK_1609739933234_6628.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为C++ OnReceiver观察者日志输出 -HiAppEvent onReceive: domain=OS -HiAppEvent eventName=MAIN_THREAD_JANK -HiAppEvent eventInfo.eventType=1 -HiAppEvent eventInfo.params.time=1609739473665 -HiAppEvent eventInfo.params.bundle_version=1.0.0 -HiAppEvent eventInfo.params.bundle_name=com.example.eventsub -HiAppEvent eventInfo.params.pid=4116 -HiAppEvent eventInfo.params.uid=20010053 -HiAppEvent eventInfo.params.begin_time=1717593620016 -HiAppEvent eventInfo.params.end_time=1717593620518 -HiAppEvent eventInfo.params.external_log=["/data/storage/el2/log/hiappevent/APP_CRASH_1609739473837_4116.log"] -HiAppEvent eventInfo.params.log_over_limit=0 -// 以上为ArkTS onReceive类型观察者日志输出 -``` - -注意: - -1.如果测试设备无法达到"使用nolog版本,开发者模式处于关闭状态,可以使能主线程超时检测抓取trace的功能"的条件,无法触发回调,日志不会输出。 - -2.要确认日志输出中的eventInfo.name为MAIN_THREAD_JANK。 - -3.C++实现了onReceive观察者,ArkTS实现了onReceive观察者。 - -### 工程目录 - -```text -entry/src/main -├─cpp -│ ├─json -│ │ └─json.h // 自行添加 -│ │ └─json-forwards.h // 自行添加 -│ ├─types -│ │ └─libentry -│ │ └─Index.d.ts // 定义ArkTS接口 -│ ├─CMakeLists.txt // 导入so链接 -│ ├─napi_init.cpp // 功能函数,观察者定义 -│ └─jsoncpp.cpp // 自行添加 -└─ets - ├─entryability - │ └─EntryAbility.ets // 新增接口调用 - └─pages - └─Index.ets // 主页 -``` - -### 具体实现 - -1.在entry/src/main/cpp下添加三方库文件jsoncpp.cpp和目录"json","json"目录下添加json.h和json-forwards.h; -2.编辑"CMakeLists.txt"文件,添加源文件及动态库; -3.编辑"napi_init.cpp"文件,导入依赖的文件,定义onReceive和onTrigger类型观察者相关方法,注册为ArkTS接口; -4.编辑"index.d.ts"文件,定义ArkTS接口; -5.编辑"EntryAbility.ets"文件,在onCreate()函数中新增观察者调用(包括ArkTS添加观察者和调用C++接口从而调用观察者); -6.编辑"Index.ets"文件,新增按钮触发各种事件。 - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机; -2. 本示例已适配API14版本SDK,版本号:5.0.2.58; -3. 本示例需要使用DevEco Studio(5.0.3.910)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```text -git init -git config core.sparsecheckout true -echo code/DocsSample/PerformanceAnalysisKit/HiAppEvent/EventSub/ > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/build-profile.json5 b/PerformanceAnalysisKit/HiAppEvent/EventSub/build-profile.json5 deleted file mode 100644 index 846b5dd1c6542109d441faa53b2680a93e2138fe..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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": "5.0.2(14)", - "compileSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS" - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/.gitignore b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/build-profile.json5 b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/build-profile.json5 deleted file mode 100644 index 97134211dbb87d7d24908b51c6428d1f3d76df19..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a", - "x86_64" - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": true, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/hvigorfile.ts b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/hvigorfile.ts deleted file mode 100644 index e042e3f963ab27941d3b34f1f027da9933b81df1..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/obfuscation-rules.txt b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/obfuscation-rules.txt deleted file mode 100644 index fdbb5b9852d7dd5f39bddaeb21ab5ee1f3346749..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/obfuscation-rules.txt +++ /dev/null @@ -1,22 +0,0 @@ -# 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/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/oh-package.json5 b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/oh-package.json5 deleted file mode 100644 index d55b3e8de9d84c6b79c43869a2b2f0948633f7ec..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/CMakeLists.txt b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index fa2f9febd17f978b15af959a2b18032d46f06a46..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(CPP) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -# 新增jsoncpp.cpp(解析订阅事件中的json字符串)源文件 -add_library(entry SHARED napi_init.cpp jsoncpp.cpp) -# 新增动态库依赖libhiappevent_ndk.z.so和libhilog_ndk.z.so(日志输出) -target_link_libraries(entry PUBLIC libace_napi.z.so libhilog_ndk.z.so libhiappevent_ndk.z.so) diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/napi_init.cpp b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index e525f468ff2a39836e302a46debc2a2db111de58..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,668 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start EventSub_napi_Header] -#include "napi/native_api.h" -#include "json/json.h" -#include "hilog/log.h" -#include "hiappevent/hiappevent.h" -#include "hiappevent/hiappevent_event.h" - -#undef LOG_TAG -#define LOG_TAG "testTag" -// [End EventSub_napi_Header] - -// 定义一变量,用来缓存创建的观察者的指针。 -// [Start EventSub_onReceive_ptr] -static HiAppEvent_Watcher *eventWatcherR; -// [End EventSub_onReceive_ptr] -// [Start EventSub_onTrigger_ptr] -static HiAppEvent_Watcher *eventWatcherT; -// [End EventSub_onTrigger_ptr] - -// [Start CrashEvent_OnReceive] -static void OnReceiveCrashEvent(const struct HiAppEvent_AppEventGroup *appEventGroups, int i, int j) -{ - if (strcmp(appEventGroups[i].appEventInfos[j].domain, DOMAIN_OS) == 0 && - strcmp(appEventGroups[i].appEventInfos[j].name, EVENT_APP_CRASH) == 0) { - Json::Value params; - Json::Reader reader(Json::Features::strictMode()); - Json::FastWriter writer; - if (reader.parse(appEventGroups[i].appEventInfos[j].params, params)) { - auto time = params["time"].asInt64(); - auto crashType = params["crash_type"].asString(); - auto foreground = params["foreground"].asBool(); - auto bundleVersion = params["bundle_version"].asString(); - auto bundleName = params["bundle_name"].asString(); - auto pid = params["pid"].asInt(); - auto uid = params["uid"].asInt(); - auto uuid = params["uuid"].asString(); - auto exception = writer.write(params["exception"]); - auto hilogSize = params["hilog"].size(); - auto externalLog = writer.write(params["external_log"]); - auto logOverLimit = params["log_over_limit"].asBool(); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.time=%{public}lld", time); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.crash_type=%{public}s", - crashType.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.foreground=%{public}d", foreground); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_version=%{public}s", - bundleVersion.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_name=%{public}s", - bundleName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.pid=%{public}d", pid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uid=%{public}d", uid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uuid=%{public}s", uuid.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.exception=%{public}s", - exception.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.hilog.size=%{public}d", hilogSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.external_log=%{public}s", - externalLog.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.log_over_limit=%{public}d", - logOverLimit); - } - } -} -// [End CrashEvent_OnReceive] -// [Start FreezeEvent_OnReceive_Output] -// OnReceiveFreezeEvent超出50行限制,将日志输出单独抽出 -static void FreezeEventOutput(Json::Value params, Json::FastWriter writer) -{ - auto time = params["time"].asInt64(); - auto foreground = params["foreground"].asBool(); - auto bundleVersion = params["bundle_version"].asString(); - auto bundleName = params["bundle_name"].asString(); - auto processName = params["process_name"].asString(); - auto pid = params["pid"].asInt(); - auto uid = params["uid"].asInt(); - auto uuid = params["uuid"].asString(); - auto exception = writer.write(params["exception"]); - auto hilogSize = params["hilog"].size(); - auto handleSize = params["event_handler"].size(); - auto handleSize3s = params["event_handler_size_3s"].asString(); - auto handleSize6s = params["event_handler_size_6s"].asString(); - auto peerBindSize = params["peer_binder"].size(); - auto threadSize = params["threads"].size(); - auto memory = writer.write(params["memory"]); - auto externalLog = writer.write(params["external_log"]); - auto logOverLimit = params["log_over_limit"].asBool(); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.time=%{public}lld", time); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.foreground=%{public}d", foreground); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_version=%{public}s", - bundleVersion.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_name=%{public}s", - bundleName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.process_name=%{public}s", - processName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.pid=%{public}d", pid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uid=%{public}d", uid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uuid=%{public}s", uuid.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.exception=%{public}s", - exception.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.hilog.size=%{public}d", hilogSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.event_handler.size=%{public}d", - handleSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.event_handler_3s.size=%{public}s", - handleSize3s.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.event_handler_6s.size=%{public}s", - handleSize6s.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.peer_binder.size=%{public}d", - peerBindSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.threads.size=%{public}d", threadSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.memory=%{public}s", memory.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.external_log=%{public}s", - externalLog.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.log_over_limit=%{public}d", - logOverLimit); -} -// [End FreezeEvent_OnReceive_Output] -// [Start FreezeEvent_OnReceive] -static void OnReceiveFreezeEvent(const struct HiAppEvent_AppEventGroup *appEventGroups, int i, int j) -{ - if (strcmp(appEventGroups[i].appEventInfos[j].domain, DOMAIN_OS) == 0 && - strcmp(appEventGroups[i].appEventInfos[j].name, EVENT_APP_FREEZE) == 0) { - Json::Value params; - Json::Reader reader(Json::Features::strictMode()); - Json::FastWriter writer; - if (reader.parse(appEventGroups[i].appEventInfos[j].params, params)) { - FreezeEventOutput(params, writer); - } - } -} -// [End FreezeEvent_OnReceive] -// [Start PssLeakEvent_OnReceive] -static void OnReceivePssLeakEvent(const struct HiAppEvent_AppEventGroup *appEventGroups, int i, int j) -{ - if (strcmp(appEventGroups[i].appEventInfos[j].domain, DOMAIN_OS) == 0 && - strcmp(appEventGroups[i].appEventInfos[j].name, EVENT_RESOURCE_OVERLIMIT) == 0) { - Json::Value params; - Json::Reader reader(Json::Features::strictMode()); - Json::FastWriter writer; - if (reader.parse(appEventGroups[i].appEventInfos[j].params, params)) { - auto time = params["time"].asInt64(); - auto pid = params["pid"].asInt(); - auto uid = params["uid"].asInt(); - auto resourceType = params["resourceType"].asString(); - auto bundleName = params["bundle_name"].asString(); - auto bundleVersion = params["bundle_version"].asString(); - auto memory = writer.write(params["memory"]); - auto externalLog = writer.write(params["external_log"]); - std::string logOverLimit = params["log_over_limit"].asBool() ? "true" : "false"; - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.time=%{public}lld", time); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.pid=%{public}d", pid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uid=%{public}d", uid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.resource_type=%{public}s", - resourceType.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_name=%{public}s", - bundleName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_version=%{public}s", - bundleVersion.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.memory=%{public}s", memory.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.external_log=%{public}s", - externalLog.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.log_over_limit=%{public}d", - logOverLimit.c_str()); - } - } -} -// [End PssLeakEvent_OnReceive] -// [Start AsanEvent_OnReceive] -static void OnReceiveAsanEvent(const struct HiAppEvent_AppEventGroup *appEventGroups, int i, int j) -{ - if (strcmp(appEventGroups[i].appEventInfos[j].domain, DOMAIN_OS) == 0 && - strcmp(appEventGroups[i].appEventInfos[j].name, EVENT_ADDRESS_SANITIZER) == 0) { - Json::Value params; - Json::Reader reader(Json::Features::strictMode()); - Json::FastWriter writer; - if (reader.parse(appEventGroups[i].appEventInfos[j].params, params)) { - auto time = params["time"].asInt64(); - auto bundleVersion = params["bundle_version"].asString(); - auto bundleName = params["bundle_name"].asString(); - auto pid = params["pid"].asInt(); - auto uid = params["uid"].asInt(); - auto type = params["type"].asString(); - auto boolFlag = params["log_over_limit"].asBool(); - std::string logOverLimit = params["log_over_limit"].asBool() ? "true" : "false"; - auto externalLog = writer.write(params["external_log"]); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.time=%{public}lld", time); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_version=%{public}s", - bundleVersion.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_name=%{public}s", - bundleName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.pid=%{public}d", pid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uid=%{public}d", uid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.type=%{public}s", type.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.external_log=%{public}s", - externalLog.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.log_over_limit=%{public}s", - logOverLimit.c_str()); - } - } -} -// [End AsanEvent_OnReceive] -// [Start TimeOutEvent_OnReceive] -static void OnReceiveTimeOutEvent(const struct HiAppEvent_AppEventGroup *appEventGroups, int i, int j) -{ - if (strcmp(appEventGroups[i].appEventInfos[j].domain, DOMAIN_OS) == 0 && - strcmp(appEventGroups[i].appEventInfos[j].name, EVENT_MAIN_THREAD_JANK) == 0) { - Json::Value params; - Json::Reader reader(Json::Features::strictMode()); - Json::FastWriter writer; - if (reader.parse(appEventGroups[i].appEventInfos[j].params, params)) { - auto time = params["time"].asInt64(); - auto pid = params["pid"].asInt(); - auto uid = params["uid"].asInt(); - auto bundleName = params["bundle_name"].asString(); - auto bundleVersion = params["bundle_version"].asString(); - auto beginTime = params["begin_time"].asInt64(); - auto endTime = params["end_time"].asInt64(); - auto externalLog = writer.write(params["external_log"]); - auto logOverLimit = params["logOverLimit"].asBool(); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.time=%{public}lld", time); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.pid=%{public}d", pid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uid=%{public}d", uid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_name=%{public}s", - bundleName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_version=%{public}s", - bundleVersion.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.begin_time=%{public}lld", beginTime); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.end_time=%{public}lld", endTime); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.external_log=%{public}s", - externalLog.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.log_over_limit=%{public}d", - logOverLimit); - } - } -} -// [End TimeOutEvent_OnReceive] -// [Start AppEvent_Crash_C++_Add_Watcher] -// 定义变量,用来缓存创建的观察者的指针。 -static HiAppEvent_Watcher *eventWatcherR1; - -static void OnReceive1(const char *domain, const struct HiAppEvent_AppEventGroup *appEventGroups, uint32_t groupLen) -{ - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent success to read events with onReceive callback form C API \n"); - for (int i = 0; i < groupLen; ++i) { - for (int j = 0; j < appEventGroups[i].infoLen; ++j) { - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.domain=%{public}s", - appEventGroups[i].appEventInfos[j].domain); - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.name=%{public}s", - appEventGroups[i].appEventInfos[j].name); - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.eventType=%{public}d", - appEventGroups[i].appEventInfos[j].type); - if (strcmp(appEventGroups[i].appEventInfos[j].domain, DOMAIN_OS) != 0 || - strcmp(appEventGroups[i].appEventInfos[j].name, EVENT_APP_CRASH) != 0) { - continue; - } - Json::Value params; - Json::Reader reader(Json::Features::strictMode()); - Json::FastWriter writer; - if (reader.parse(appEventGroups[i].appEventInfos[j].params, params)) { - // 开发者可以获取到崩溃事件发生的时间戳 - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.params.time=%{public}lld", - params["time"].asInt64()); - // 开发者可以获取到崩溃应用的包名 - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.params.bundle_name=%{public}s", - params["bundle_name"].asString().c_str()); - auto external_log = writer.write(params["external_log"]); - // 开发者可以获取到崩溃事件发生时的故障日志文件 - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.params.external_log=%{public}s", - external_log.c_str()); - } - } - } -} -static napi_value RegisterWatcherCrash(napi_env env, napi_callback_info info) -{ - // 开发者自定义观察者名称,系统根据不同的名称来识别不同的观察者。 - eventWatcherR1 = OH_HiAppEvent_CreateWatcher("AppCrashWatcher1"); - // 设置订阅的事件名称为EVENT_APP_CRASH,即崩溃事件。 - const char *names[] = {EVENT_APP_CRASH}; - // 开发者订阅感兴趣的事件,此处订阅了系统事件。 - OH_HiAppEvent_SetAppEventFilter(eventWatcherR1, DOMAIN_OS, 0, names, 1); - // 开发者设置已实现的回调函数,观察者接收到事件后回立即触发OnReceive1回调。 - OH_HiAppEvent_SetWatcherOnReceive(eventWatcherR1, OnReceive1); - // 使观察者开始监听订阅的事件。 - OH_HiAppEvent_AddWatcher(eventWatcherR1); - return {}; -} -// [End AppEvent_Crash_C++_Add_Watcher] -// [Start AppEvent_Click_C++_Add_Watcher] -// 定义变量,用来缓存创建的观察者的指针。 -static HiAppEvent_Watcher *eventWatcherT1; -// 开发者可以自行实现获取已监听到事件的回调函数,其中events指针指向内容仅在该函数内有效。 -static void OnTake1(const char *const *events, uint32_t eventLen) -{ - Json::Reader reader(Json::Features::strictMode()); - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent success to read events with onTrigger callback form C API \n"); - for (int i = 0; i < eventLen; ++i) { - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo=%{public}s", events[i]); - Json::Value eventInfo; - if (reader.parse(events[i], eventInfo)) { - auto domain = eventInfo["domain_"].asString(); - auto name = eventInfo["name_"].asString(); - auto type = eventInfo["type_"].asInt(); - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.domain=%{public}s", domain.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.name=%{public}s", name.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.eventType=%{public}d", type); - if (domain == "button" && name == "click") { - auto clickTime = eventInfo["clickTime"].asInt64(); - OH_LOG_INFO(LogType::LOG_APP, "AppEvents HiAppEvent eventInfo.params.clickTime=%{public}lld", - clickTime); - } - } - } -} - -// 开发者可以自行实现订阅回调函数,以便对获取到的事件打点数据进行自定义处理。 -static void OnTrigger1(int row, int size) -{ - // 接收回调后,获取指定数量的已接收事件。 - OH_HiAppEvent_TakeWatcherData(eventWatcherT1, row, OnTake1); -} - -static napi_value RegisterWatcherClick(napi_env env, napi_callback_info info) -{ - // 开发者自定义观察者名称,系统根据不同的名称来识别不同的观察者。 - eventWatcherT1 = OH_HiAppEvent_CreateWatcher("ButtonClickWatcher1"); - // 设置订阅的事件名称为click。 - const char *names[] = {"click"}; - // 开发者订阅感兴趣的应用事件,此处订阅了button相关事件。 - OH_HiAppEvent_SetAppEventFilter(eventWatcherT1, "button", 0, names, 1); - // 开发者设置已实现的回调函数,需OH_HiAppEvent_SetTriggerCondition设置的条件满足方可触发。 - OH_HiAppEvent_SetWatcherOnTrigger(eventWatcherT1, OnTrigger1); - // 开发者可以设置订阅触发回调的条件,此处是设置新增事件打点数量为1个时,触发onTrigger回调。 - OH_HiAppEvent_SetTriggerCondition(eventWatcherT1, 1, 0, 0); - // 使观察者开始监听订阅的事件。 - OH_HiAppEvent_AddWatcher(eventWatcherT1); - return {}; -} -// [End AppEvent_Click_C++_Add_Watcher] - -// [Start EventSub_OnReceive_All] -static void OnReceive(const char *domain, const struct HiAppEvent_AppEventGroup *appEventGroups, uint32_t groupLen) -{ - for (int i = 0; i < groupLen; ++i) { - for (int j = 0; j < appEventGroups[i].infoLen; ++j) { - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnReceive"); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.domain=%{public}s", - appEventGroups[i].appEventInfos[j].domain); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.name=%{public}s", - appEventGroups[i].appEventInfos[j].name); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.eventType=%{public}d", - appEventGroups[i].appEventInfos[j].type); - - // 处理崩溃事件 - OnReceiveCrashEvent(appEventGroups, i, j); - // 处理卡死事件 - OnReceiveFreezeEvent(appEventGroups, i, j); - // 处理内存泄漏事件 - OnReceivePssLeakEvent(appEventGroups, i, j); - // 处理ASAN事件 - OnReceiveAsanEvent(appEventGroups, i, j); - // 处理主线程卡顿事件 - OnReceiveTimeOutEvent(appEventGroups, i, j); - } - } -} -// [End EventSub_OnReceive_All] - -// [Start CrashEvent_OnTrigger] -static void OnTriggerCrashEvent(std::string domain, std::string name, Json::Value eventInfo, Json::FastWriter writer) -{ - if (domain == DOMAIN_OS && name == EVENT_APP_CRASH) { - auto time = eventInfo["time"].asInt64(); - auto crashType = eventInfo["crash_type"].asString(); - auto foreground = eventInfo["foreground"].asBool(); - auto bundleVersion = eventInfo["bundle_version"].asString(); - auto bundleName = eventInfo["bundle_name"].asString(); - auto pid = eventInfo["pid"].asInt(); - auto uid = eventInfo["uid"].asInt(); - auto uuid = eventInfo["uuid"].asString(); - auto exception = writer.write(eventInfo["exception"]); - auto hilogSize = eventInfo["hilog"].size(); - auto externalLog = writer.write(eventInfo["external_log"]); - auto logOverLimit = eventInfo["log_over_limit"].asBool(); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.time=%{public}lld", time); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.crash_type=%{public}s", crashType.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.foreground=%{public}d", foreground); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_version=%{public}s", - bundleVersion.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_name=%{public}s", bundleName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.pid=%{public}d", pid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uid=%{public}d", uid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uuid=%{public}s", uuid.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.exception=%{public}s", exception.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.hilog.size=%{public}d", hilogSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.external_log=%{public}s", - externalLog.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.log_over_limit=%{public}d", logOverLimit); - } -} -// [End CrashEvent_OnTrigger] -// [Start FreezeEvent_OnTrigger] -static void OnTriggerFreezeEvent(std::string domain, std::string name, Json::Value eventInfo, Json::FastWriter writer) -{ - if (domain == DOMAIN_OS && name == EVENT_APP_FREEZE) { - auto time = eventInfo["time"].asInt64(); - auto foreground = eventInfo["foreground"].asBool(); - auto bundleVersion = eventInfo["bundle_version"].asString(); - auto bundleName = eventInfo["bundle_name"].asString(); - auto processName = eventInfo["process_name"].asString(); - auto pid = eventInfo["pid"].asInt(); - auto uid = eventInfo["uid"].asInt(); - auto uuid = eventInfo["uuid"].asString(); - auto exception = writer.write(eventInfo["exception"]); - auto hilogSize = eventInfo["hilog"].size(); - auto handleSize = eventInfo["event_handler"].size(); - auto handleSize3s = eventInfo["event_handler_size_3s"].asString(); - auto handleSize6s = eventInfo["event_handler_size_6s"].asString(); - auto peerBindSize = eventInfo["peer_binder"].size(); - auto threadSize = eventInfo["threads"].size(); - auto memory = writer.write(eventInfo["memory"]); - auto externalLog = writer.write(eventInfo["external_log"]); - auto logOverLimit = eventInfo["log_over_limit"].asBool(); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.time=%{public}lld", time); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.foreground=%{public}d", foreground); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_version=%{public}s", - bundleVersion.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_name=%{public}s", bundleName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.process_name=%{public}s", - processName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.pid=%{public}d", pid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uid=%{public}d", uid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uuid=%{public}s", uuid.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.exception=%{public}s", exception.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.hilog.size=%{public}d", hilogSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.event_handler.size=%{public}d", handleSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.event_handler_3s.size=%{public}s", - handleSize3s.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.event_handler_6s.size=%{public}s", - handleSize6s.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.peer_binder.size=%{public}d", peerBindSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.threads.size=%{public}d", threadSize); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.memory=%{public}s", memory.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.external_log=%{public}s", - externalLog.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.log_over_limit=%{public}d", logOverLimit); - } -} -// [End FreezeEvent_OnTrigger] -// [Start PssLeakEvent_OnTrigger] -static void OnTriggerPssLeakEvent(std::string domain, std::string name, Json::Value eventInfo, Json::FastWriter writer) -{ - if (domain == DOMAIN_OS && name == EVENT_RESOURCE_OVERLIMIT) { - auto time = eventInfo["time"].asInt64(); - auto pid = eventInfo["pid"].asInt(); - auto uid = eventInfo["uid"].asInt(); - auto resourceType = eventInfo["resourceType"].asString(); - auto bundleName = eventInfo["bundle_name"].asString(); - auto bundleVersion = eventInfo["bundle_version"].asString(); - auto memory = writer.write(eventInfo["memory"]); - auto externalLog = writer.write(eventInfo["external_log"]); - std::string logOverLimit = eventInfo["log_over_limit"].asBool() ? "true" : "false"; - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.time=%{public}lld", time); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.pid=%{public}d", pid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uid=%{public}d", uid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.resource_type=%{public}s", - resourceType.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_name=%{public}s", bundleName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_version=%{public}s", - bundleVersion.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.memory=%{public}s", memory.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.external_log=%{public}s", - externalLog.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.log_over_limit=%{public}d", - logOverLimit.c_str()); - } -} -// [End PssLeakEvent_OnTrigger] -// [Start AsanEvent_OnTrigger] -static void OnTriggerAsanEvent(std::string domain, std::string name, Json::Value eventInfo, Json::FastWriter writer) -{ - if (domain == DOMAIN_OS && name == EVENT_ADDRESS_SANITIZER) { - auto time = eventInfo["time"].asInt64(); - auto bundleVersion = eventInfo["bundle_version"].asString(); - auto bundleName = eventInfo["bundle_name"].asString(); - auto pid = eventInfo["pid"].asInt(); - auto uid = eventInfo["uid"].asInt(); - auto asanType = eventInfo["type"].asString(); - auto externalLog = writer.write(eventInfo["external_log"]); - std::string logOverLimit = eventInfo["log_over_limit"].asBool() ? "true" : "false"; - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.time=%{public}lld", time); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_version=%{public}s", - bundleVersion.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.bundle_name=%{public}s", bundleName.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.pid=%{public}d", pid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.uid=%{public}d", uid); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.crash_type=%{public}s", asanType.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.external_log=%{public}s", - externalLog.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.params.log_over_limit=%{public}s", - logOverLimit.c_str()); - } -} -// [End AsanEvent_OnTrigger] -// [Start EventSub_OnTake_All] -// 开发者可以自行实现获取已监听到事件的回调函数,其中events指针指向内容仅在该函数内有效。 -static void OnTake(const char *const *events, uint32_t eventLen) -{ - Json::Reader reader(Json::Features::strictMode()); - Json::FastWriter writer; - for (int i = 0; i < eventLen; ++i) { - Json::Value eventInfo; - if (reader.parse(events[i], eventInfo)) { - auto domain = eventInfo["domain_"].asString(); - auto name = eventInfo["name_"].asString(); - auto type = eventInfo["type_"].asInt(); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.WatcherType=OnTrigger"); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.domain=%{public}s", domain.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.name=%{public}s", name.c_str()); - OH_LOG_INFO(LogType::LOG_APP, "HiAppEvent eventInfo.eventType=%{public}d", type); - - // 处理崩溃事件 - OnTriggerCrashEvent(domain, name, eventInfo, writer); - // 处理卡死事件 - OnTriggerFreezeEvent(domain, name, eventInfo, writer); - // 处理内存泄漏事件 - OnTriggerPssLeakEvent(domain, name, eventInfo, writer); - // 处理ASAN事件 - OnTriggerAsanEvent(domain, name, eventInfo, writer); - } - } -} -// [End EventSub_OnTake_All] -// [Start EventSub_OnTrigger] -// 开发者可以自行实现订阅回调函数,以便对获取到的事件打点数据进行自定义处理。 -static void OnTrigger(int row, int size) -{ - // 接收回调后,获取指定数量的已接收事件。 - OH_HiAppEvent_TakeWatcherData(eventWatcherT, row, OnTake); -} -// [End EventSub_OnTrigger] -// [Start EventSub_RegisterWatcher_All] -static napi_value RegisterWatcher(napi_env env, napi_callback_info info) -{ - // 开发者自定义观察者名称,系统根据不同的名称来识别不同的观察者。 - eventWatcherT = OH_HiAppEvent_CreateWatcher("onTriggerWatcher"); - eventWatcherR = OH_HiAppEvent_CreateWatcher("onReceiverWatcher"); - // 设置订阅的事件名称为click, EVENT_APP_CRASH。 - const char *names[] = {"click", EVENT_APP_CRASH, EVENT_APP_FREEZE, EVENT_RESOURCE_OVERLIMIT, - EVENT_ADDRESS_SANITIZER, EVENT_MAIN_THREAD_JANK}; - int namesSize = sizeof(names) / sizeof(names[0]); - // 开发者订阅感兴趣的应用事件 - OH_HiAppEvent_SetAppEventFilter(eventWatcherT, "button", 0, names, namesSize); - OH_HiAppEvent_SetAppEventFilter(eventWatcherT, DOMAIN_OS, 0, names, namesSize); - // 开发者设置已实现的回调函数,需OH_HiAppEvent_SetTriggerCondition设置的条件满足方可触发。 - OH_HiAppEvent_SetWatcherOnTrigger(eventWatcherT, OnTrigger); - // 开发者可以设置订阅触发回调的条件,此处是设置新增事件打点数量为1个时,触发onTrigger回调。 - OH_HiAppEvent_SetTriggerCondition(eventWatcherT, 1, 0, 0); - // 使观察者开始监听订阅的事件。 - OH_HiAppEvent_AddWatcher(eventWatcherT); - // 开发者订阅感兴趣的应用事件 - OH_HiAppEvent_SetAppEventFilter(eventWatcherR, "button", 0, names, namesSize); - OH_HiAppEvent_SetAppEventFilter(eventWatcherR, DOMAIN_OS, 0, names, namesSize); - // 开发者设置已实现的回调函数,观察者接收到事件后回立即触发OnReceive回调。 - OH_HiAppEvent_SetWatcherOnReceive(eventWatcherR, OnReceive); - // 使观察者开始监听订阅的事件。 - OH_HiAppEvent_AddWatcher(eventWatcherR); - return {}; -} -// [End EventSub_RegisterWatcher_All] -// [Start EventSub_RemoveWatcher_All] -// [Start AppEvent_C++_RemoveWatcher] -static napi_value RemoveWatcher(napi_env env, napi_callback_info info) -{ - // 使观察者停止监听事件 - // [StartExclude AppEvent_C++_RemoveWatcher] - OH_HiAppEvent_RemoveWatcher(eventWatcherT); - OH_HiAppEvent_RemoveWatcher(eventWatcherR); - // [EndExclude AppEvent_C++_RemoveWatcher] - OH_HiAppEvent_RemoveWatcher(eventWatcherT1); - OH_HiAppEvent_RemoveWatcher(eventWatcherR1); - return {}; -} -// [End AppEvent_C++_RemoveWatcher] -// [End EventSub_RemoveWatcher_All] -// [Start EventSub_DestroyWatcher_All] -// [Start AppEvent_C++_DestroyWatcher] -static napi_value DestroyWatcher(napi_env env, napi_callback_info info) -{ - // 销毁创建的观察者,并置eventWatcher为nullptr。 - // [StartExclude AppEvent_C++_DestroyWatcher] - OH_HiAppEvent_DestroyWatcher(eventWatcherT); - OH_HiAppEvent_DestroyWatcher(eventWatcherR); - eventWatcherT = nullptr; - eventWatcherR = nullptr; - // [EndExclude AppEvent_C++_DestroyWatcher] - OH_HiAppEvent_DestroyWatcher(eventWatcherT1); - OH_HiAppEvent_DestroyWatcher(eventWatcherR1); - eventWatcherT1 = nullptr; - eventWatcherR1 = nullptr; - return {}; -} -// [End AppEvent_C++_DestroyWatcher] -// [End EventSub_DestroyWatcher_All] -// [Start AppEvent_Click_C++_WriteAppEvent] -static napi_value WriteAppEvent(napi_env env, napi_callback_info info) -{ - auto params = OH_HiAppEvent_CreateParamList(); - OH_HiAppEvent_AddInt64Param(params, "clickTime", time(nullptr)); - OH_HiAppEvent_Write("button", "click", EventType::BEHAVIOR, params); - OH_HiAppEvent_DestroyParamList(params); - OH_LOG_INFO(LogType::LOG_APP, "writeEvent C++ success"); - return {}; -} -// [End AppEvent_Click_C++_WriteAppEvent] -// [Start AsanEvent_AddressTest] -static napi_value AddressTest(napi_env env, napi_callback_info info) -{ - // 任意实数 - int num = 1; - int length = 10; - // 构造数组越界写入 - int a[length]; - a[length] = num; - return {}; -} -// [End AsanEvent_AddressTest] -// [Start EventSub_Init_All] -// [Start AppEvent_C++_Init] -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - // [StartExclude AppEvent_C++_Init] - {"registerWatcher", nullptr, RegisterWatcher, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"addressTest", nullptr, AddressTest, nullptr, nullptr, nullptr, napi_default, nullptr}, - // [EndExclude AppEvent_C++_Init] - { "registerWatcherCrash", nullptr, RegisterWatcherCrash, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "registerWatcherClick", nullptr, RegisterWatcherClick, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "writeAppEvent", nullptr, WriteAppEvent, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -// [End AppEvent_C++_Init] -// [End EventSub_Init_All] -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/types/libentry/Index.d.ts b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 6829fba35cdc34f11c08cadc1db975a10fda3d99..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start EventSub_Index.d.ts_All] -export const registerWatcher: () => void; -export const addressTest: () => void; -// [Start AppEvent_C++_Index.d.ts] -export const registerWatcherCrash: () => void; -export const registerWatcherClick: () => void; -export const writeAppEvent: () => void; -// [End AppEvent_C++_Index.d.ts] -// [End EventSub_Index.d.ts_All] diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/types/libentry/oh-package.json5 b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 88838fa0b2042f057b1d730054d5698b61c7fb58..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/ets/entryability/EntryAbility.ets b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index e049d357c7ec2b8e6ba66ed7dd60d050a3a8b0c8..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start EventSub_EntryAbility_Header] -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -// [Start AppEvent_Crash_Click_ArkTS_Header] -import { hiAppEvent, hilog } from '@kit.PerformanceAnalysisKit'; -// [End AppEvent_Crash_Click_ArkTS_Header] -import { hidebug } from '@kit.PerformanceAnalysisKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { window } from '@kit.ArkUI'; -// [End EventSub_EntryAbility_Header] -// [Start EventSub_Capi_Header] -import testNapi from 'libentry.so'; -// [End EventSub_Capi_Header] -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - // [Start AppEvent_Crash_ArkTS_Add_Watcher] - hiAppEvent.addWatcher({ - // 开发者可以自定义观察者名称,系统会使用名称来标识不同的观察者 - name: 'AppCrashWatcher', - // 订阅过滤条件,这里是订阅了系统事件中的崩溃事件 - appEventFilters: [ - { - domain: hiAppEvent.domain.OS, - names: [hiAppEvent.event.APP_CRASH] - } - ], - // 实现onReceive回调,监听到事件后实时回调 - onReceive: (domain: string, appEventGroups: Array) => { - hilog.info(0x0000, 'testTag', 'AppEvents HiAppEvent success to read event with onReceive callback from ArkTS'); - hilog.info(0x0000, 'testTag', `domain=${domain}`); - for (const eventGroup of appEventGroups) { - hilog.info(0x0000, 'testTag', `AppEvents HiAppEvent eventName=${eventGroup.name}`); - for (const eventInfo of eventGroup.appEventInfos) { - // 开发者可以获取到崩溃事件发生的时间戳 - hilog.info(0x0000, 'testTag', `AppEvents HiAppEvent eventInfo.params.time=${JSON.stringify(eventInfo.params['time'])}`); - // 开发者可以获取到崩溃应用的包名 - hilog.info(0x0000, 'testTag', `AppEvents HiAppEvent eventInfo.params.bundle_name=${JSON.stringify(eventInfo.params['bundle_name'])}`); - // 开发者可以获取到崩溃事件发生时的故障日志文件 - hilog.info(0x0000, 'testTag', `AppEvents HiAppEvent eventInfo.params.external_log=${JSON.stringify(eventInfo.params['external_log'])}`); - } - } - } - }); - // [End AppEvent_Crash_ArkTS_Add_Watcher] - // [Start AppEvent_Click_ArkTS_Add_Watcher] - hiAppEvent.addWatcher({ - // 开发者可以自定义观察者名称,系统会使用名称来标识不同的观察者 - name: 'ButtonClickWatcher', - // 开发者可以订阅感兴趣的应用事件,此处是订阅了按钮事件 - appEventFilters: [{ domain: 'button' }], - // 开发者可以设置订阅回调触发的条件,此处是设置为事件打点数量满足1个 - triggerCondition: { row: 1 }, - // 开发者可以自行实现订阅回调函数,以便对订阅获取到的事件打点数据进行自定义处理 - onTrigger: (curRow: number, curSize: number, holder: hiAppEvent.AppEventPackageHolder) => { - // 如果返回的holder对象为null,表示订阅过程发生异常。因此,在记录错误日志后直接返回 - if (holder == null) { - hilog.error(0x0000, 'testTag', 'AppEvents HiAppEvent holder is null'); - return; - } - hilog.info(0x0000, 'testTag', 'AppEvents HiAppEvent success to read event with onTrigger callback from ArkTS'); - hilog.info(0x0000, 'testTag', `AppEvents HiAppEvent onTrigger: curRow=%{public}d, curSize=%{public}d`, curRow, curSize); - let eventPkg: hiAppEvent.AppEventPackage | null = null; - // 根据设置阈值大小(默认为1条事件)去获取订阅事件包,直到将订阅数据全部取出 - // 返回的事件包对象为null,表示当前订阅数据已被全部取出,此次订阅回调触发结束 - while ((eventPkg = holder.takeNext()) != null) { - // 开发者可以对事件包中的事件打点数据进行自定义处理,此处是将事件打点数据打印在日志中 - hilog.info(0x0000, 'testTag', `AppEvents HiAppEvent eventPkg.packageId=%{public}d`, eventPkg.packageId); - hilog.info(0x0000, 'testTag', `AppEvents HiAppEvent eventPkg.row=%{public}d`, eventPkg.row); - hilog.info(0x0000, 'testTag', `AppEvents HiAppEvent eventPkg.size=%{public}d`, eventPkg.size); - for (const eventInfo of eventPkg.data) { - hilog.info(0x0000, 'testTag', `AppEvents HiAppEvent eventPkg.info=%{public}s`, eventInfo); - } - } - } - }); - // [End AppEvent_Click_ArkTS_Add_Watcher] - // [Start Crash&FreezeEvent_ArkTS_Add_Event] - // 开发者完成参数键值对赋值 - let params: Record = { - 'testData': 100, - }; - // 开发者可以设置事件的自定义参数 - hiAppEvent.setEventParam(params, hiAppEvent.domain.OS, hiAppEvent.event.APP_CRASH).then(() => { - }).catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag', `HiAppEvent code: ${err.code}, message: ${err.message}`); - }); - hiAppEvent.setEventParam(params, hiAppEvent.domain.OS, hiAppEvent.event.APP_FREEZE).then(() => { - }).catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag', `HiAppEvent code: ${err.code}, message: ${err.message}`); - }); - // [End Crash&FreezeEvent_ArkTS_Add_Event] - // [Start CrashEvent_ArkTS_Add_Watcher] - // 添加崩溃事件观察者 - hiAppEvent.addWatcher({ - // 开发者可以自定义观察者名称,系统会使用名称来标识不同的观察者 - name: 'crashEventWatcher', - // 开发者可以订阅感兴趣的系统事件,此处是订阅了崩溃事件 - appEventFilters: [ - { - domain: hiAppEvent.domain.OS, - names: [hiAppEvent.event.APP_CRASH] - } - ], - // 开发者可以自行实现订阅实时回调函数,以便对订阅获取到的事件数据进行自定义处理 - onReceive: (domain: string, appEventGroups: Array) => { - hilog.info(0x0000, 'testTag', `HiAppEvent onReceive: domain=${domain}`); - for (const eventGroup of appEventGroups) { - // 开发者可以根据事件集合中的事件名称区分不同的系统事件 - hilog.info(0x0000, 'testTag', `HiAppEvent eventName=${eventGroup.name}`); - for (const eventInfo of eventGroup.appEventInfos) { - // 开发者可以对事件集合中的事件数据进行自定义处理,此处是将事件数据打印在日志中 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.domain=${eventInfo.domain}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.name=${eventInfo.name}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.eventType=${eventInfo.eventType}`); - // 开发者可以获取到崩溃事件发生的时间戳 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.time=${eventInfo.params['time']}`); - // 开发者可以获取到崩溃事件发生的崩溃类型 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.crash_type=${eventInfo.params['crash_type']}`); - // 开发者可以获取到崩溃应用的前后台状态 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.foreground=${eventInfo.params['foreground']}`); - // 开发者可以获取到崩溃应用的版本信息 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.bundle_version=${eventInfo.params['bundle_version']}`); - // 开发者可以获取到崩溃应用的包名 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.bundle_name=${eventInfo.params['bundle_name']}`); - // 开发者可以获取到崩溃应用的进程id - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.pid=${eventInfo.params['pid']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.uid=${eventInfo.params['uid']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.uuid=${eventInfo.params['uuid']}`); - // 开发者可以获取到崩溃事件发生的异常类型、异常原因和异常调用栈 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.exception=${JSON.stringify(eventInfo.params['exception'])}`); - // 开发者可以获取到崩溃事件发生时日志信息 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.hilog.size=${eventInfo.params['hilog'].length}`); - // 开发者可以获取到崩溃事件发生时的故障日志文件 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.external_log=${JSON.stringify(eventInfo.params['external_log'])}`); - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.log_over_limit=${eventInfo.params['log_over_limit']}`); - // 开发者可以获取到崩溃事件的自定义数据test_data - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.test_data=${eventInfo.params['testData']}`); - } - } - } - }); - // [End CrashEvent_ArkTS_Add_Watcher] - // [Start FreezeEvent_ArkTS_Add_Watcher] - // 添加卡死事件观察者 - hiAppEvent.addWatcher({ - // 开发者可以自定义观察者名称,系统会使用名称来标识不同的观察者 - name: 'freezeEventWatcher', - // 开发者可以订阅感兴趣的系统事件,此处是订阅了卡死事件 - appEventFilters: [ - { - domain: hiAppEvent.domain.OS, - names: [hiAppEvent.event.APP_FREEZE] - } - ], - // 开发者可以自行实现订阅实时回调函数,以便对订阅获取到的事件数据进行自定义处理 - onReceive: (domain: string, appEventGroups: Array) => { - hilog.info(0x0000, 'testTag', `HiAppEvent onReceive: domain=${domain}`); - for (const eventGroup of appEventGroups) { - // 开发者可以根据事件集合中的事件名称区分不同的系统事件 - hilog.info(0x0000, 'testTag', `HiAppEvent eventName=${eventGroup.name}`); - for (const eventInfo of eventGroup.appEventInfos) { - // 开发者可以对事件集合中的事件数据进行自定义处理,此处是将事件数据打印在日志中 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.domain=${eventInfo.domain}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.name=${eventInfo.name}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.eventType=${eventInfo.eventType}`); - // 开发者可以获取到卡死事件发生的时间戳 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.time=${eventInfo.params['time']}`); - // 开发者可以获取到卡死应用的前后台状态 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.foreground=${eventInfo.params['foreground']}`); - // 开发者可以获取到卡死应用的版本信息 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.bundle_version=${eventInfo.params['bundle_version']}`); - // 开发者可以获取到卡死应用的包名 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.bundle_name=${eventInfo.params['bundle_name']}`); - // 开发者可以获取到卡死应用的进程名称 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.process_name=${eventInfo.params['process_name']}`); - // 开发者可以获取到卡死应用的进程id - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.pid=${eventInfo.params['pid']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.uid=${eventInfo.params['uid']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.uuid=${eventInfo.params['uuid']}`); - // 开发者可以获取到卡死事件发生的异常类型、异常原因 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.exception=${JSON.stringify(eventInfo.params['exception'])}`); - // 开发者可以获取到卡死事件发生时日志信息 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.hilog.size=${eventInfo.params['hilog'].length}`); - // 开发者可以获取到卡死事件发生时主线程未处理消息 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.event_handler.size=${eventInfo.params['event_handler'].length}`); - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.event_handler_size_3s=${eventInfo.params['event_handler_size_3s']}`); - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.event_handler_size_6s=${eventInfo.params['event_handler_size_6s']}`); - // 开发者可以获取到卡死事件发生时同步binder调用信息 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.peer_binder.size=${eventInfo.params['peer_binder'].length}`); - // 开发者可以获取到卡死事件发生时全量线程调用栈 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.threads.size=${eventInfo.params['threads'].length}`); - // 开发者可以获取到卡死事件发生时内存信息 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.memory=${JSON.stringify(eventInfo.params['memory'])}`); - // 开发者可以获取到卡死事件发生时的故障日志文件 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.external_log=${JSON.stringify(eventInfo.params['external_log'])}`); - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.log_over_limit=${eventInfo.params['log_over_limit']}`); - // 开发者可以获取到卡死事件的自定义数据test_data - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.test_data=${eventInfo.params['testData']}`); - } - } - } - }); - // [End FreezeEvent_ArkTS_Add_Watcher] - // [Start PssleakEvent_ArkTS_Add_Watcher] - // 添加资源泄露事件观察者 - hiAppEvent.addWatcher({ - // 开发者可以自定义观察者名称,系统会使用名称来标识不同的观察者 - name: 'pssleakwatcher', - // 开发者可以订阅感兴趣的系统事件,此处是订阅了资源泄漏事件 - appEventFilters: [ - { - domain: hiAppEvent.domain.OS, - names: [hiAppEvent.event.RESOURCE_OVERLIMIT] - } - ], - // 开发者可以自行实现订阅实时回调函数,以便对订阅获取到的事件数据进行自定义处理 - onReceive: (domain: string, appEventGroups: Array) => { - hilog.info(0x0000, 'testTag', `HiAppEvent onReceive: domain=${domain}`); - for (const eventGroup of appEventGroups) { - // 开发者可以根据事件集合中的事件名称区分不同的系统事件 - hilog.info(0x0000, 'testTag', `HiAppEvent eventName=${eventGroup.name}`); - for (const eventInfo of eventGroup.appEventInfos) { - // 开发者可以获取到资源泄漏事件发生时内存信息 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.memory=${JSON.stringify(eventInfo)}`); - } - } - } - }); - // [End PssleakEvent_ArkTS_Add_Watcher] - // [Start AsanEvent_ArkTS_Add_Watcher] - // 添加踩地址事件观察者 - hiAppEvent.addWatcher({ - // 开发者可以自定义观察者名称,系统会使用名称来标识不同的观察者 - name: 'addressSanitizerWatcher', - // 开发者可以订阅感兴趣的系统事件,此处是订阅了踩内存事件 - appEventFilters: [ - { - domain: hiAppEvent.domain.OS, - names: [hiAppEvent.event.ADDRESS_SANITIZER] - } - ], - // 开发者可以自行实现订阅系统事件回调函数,以便对订阅获取到的事件数据进行自定义处理 - onReceive: (domain: string, appEventGroups: Array) => { - hilog.info(0x0000, 'testTag', `HiAppEvent onReceive: domain=${domain}`); - for (const eventGroup of appEventGroups) { - // 开发者可以根据事件集合中的事件名称区分不同的系统事件 - hilog.info(0x0000, 'testTag', `HiAppEvent eventName=${eventGroup.name}`); - for (const eventInfo of eventGroup.appEventInfos) { - // 开发者可以对事件集合中的事件数据进行自定义处理,此处是将事件数据打印在日志中 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.domain=${eventInfo.domain}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.name=${eventInfo.name}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.eventType=${eventInfo.eventType}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.time=${eventInfo.params['time']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.bundle_version=${eventInfo.params['bundle_version']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.bundle_name=${eventInfo.params['bundle_name']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.pid=${eventInfo.params['pid']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.uid=${eventInfo.params['uid']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.type=${eventInfo.params['type']}`); - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.external_log=${JSON.stringify(eventInfo.params['external_log'])}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.log_over_limit=${eventInfo.params['log_over_limit']}`); - } - } - } - }); - // [End AsanEvent_ArkTS_Add_Watcher] - // [Start TimeOutEvent_ArkTS_Add_Watcher] - // 添加主线程超时事件观察者 - hiAppEvent.addWatcher({ - // 开发者可以自定义观察者名称,系统会使用名称来标识不同的观察者 - name: 'timeOutWatcher', - // 开发者可以订阅感兴趣的系统事件,此处是订阅了主线程超时事件 - appEventFilters: [ - { - domain: hiAppEvent.domain.OS, - names: [hiAppEvent.event.MAIN_THREAD_JANK] - } - ], - // 开发者可以自行实现订阅实时回调函数,以便对订阅获取到的事件数据进行自定义处理 - onReceive: (domain: string, appEventGroups: Array) => { - hilog.info(0x0000, 'testTag', `HiAppEvent onReceive: domain=${domain}`); - for (const eventGroup of appEventGroups) { - // 开发者可以根据事件集合中的事件名称区分不同的系统事件 - hilog.info(0x0000, 'testTag', `HiAppEvent eventName=${eventGroup.name}`); - for (const eventInfo of eventGroup.appEventInfos) { - // 开发者可以对事件集合中的事件数据进行自定义处理,此处是将事件数据打印在日志中 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.domain=${eventInfo.domain}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.name=${eventInfo.name}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.eventType=${eventInfo.eventType}`); - // 开发者可以获取到主线程超时事件发生的时间戳 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.time=${eventInfo.params['time']}`); - // 开发者可以获取到主线程超时应用的版本信息 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.bundle_version=${eventInfo.params['bundle_version']}`); - // 开发者可以获取到主线程超时应用的包名 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.bundle_name=${eventInfo.params['bundle_name']}`); - // 开发者可以获取到主线程超时应用的pid、uid - hilog.info(0x0000, 'testTag', ` eventInfo.params.pid=${eventInfo.params['pid']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.uid=${eventInfo.params['uid']}`); - // 开发者可以获取主线程处理开始和结束时间 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.begin_time=${eventInfo.params['begin_time']}`); - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo.params.end_time=${eventInfo.params['end_time']}`); - // 开发者可以获取到主线程超时事件发生时的故障日志文件 - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.external_log=${JSON.stringify(eventInfo.params['external_log'])}`); - hilog.info(0x0000, 'testTag', - `HiAppEvent eventInfo.params.log_over_limit=${eventInfo.params['log_over_limit']}`); - } - } - } - }); - // [End TimeOutEvent_ArkTS_Add_Watcher] - // [Start EventSub_Call_Capi_Function] - // 调用C++观察者 - testNapi.registerWatcher(); - // [End EventSub_Call_Capi_Function] - // [Start AppEvent_Call_Capi_Function] - // 在onCreate()函数中添加C API接口调用 - // 启动时,注册崩溃事件观察者 - testNapi.registerWatcherCrash(); - // 启动时,注册按钮点击事件观察者 - testNapi.registerWatcherClick(); - // [End AppEvent_Call_Capi_Function] - } - - 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/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 29feaca7669174be5c2b0e2366529ee94ab7e726..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/ets/pages/Index.ets b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 012f585f486d6aa13d409b327a955d2104c85541..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start EventSub_Header] -import { BusinessError } from '@kit.BasicServicesKit'; -import { hiAppEvent, hilog } from '@kit.PerformanceAnalysisKit'; -// [End EventSub_Header] -// [Start PssleakEvent_Header] -import hidebug from '@ohos.hidebug'; -// [End PssleakEvent_Header] -// [Start EventSub_Index_Capi_Header] -import testNapi from 'libentry.so'; -// [End EventSub_Index_Capi_Header] -@Entry -@Component -struct Index { - @State leakedArray: string[][] = []; - - build() { - Row() { - Column() { - // [Start AppEvent_Crash_Button] - Button('WatchAppCrash ArkTS&C++') - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('80%') - .height('5%') - .onClick(() => { - // 在按钮点击函数中构造一个crash场景,触发崩溃事件 - let result: object = JSON.parse(''); - }) - // [End AppEvent_Crash_Button] - // [Start AppEvent_Click_ArkTS_Button] - Button('writeEvent ArkTS') - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('80%') - .height('5%') - .onClick(() => { - // 在按钮点击函数中进行事件打点,以记录按钮点击事件 - let eventParams: Record = {'clickTime': 100}; - let eventInfo: hiAppEvent.AppEventInfo = { - // 事件领域定义 - domain: 'button', - // 事件名称定义 - name: 'click', - // 事件类型定义 - eventType: hiAppEvent.EventType.BEHAVIOR, - // 事件参数定义 - params: eventParams, - }; - hiAppEvent.write(eventInfo).then(() => { - hilog.info(0x0000, 'testTag', `AppEvents writeEvent ArkTS success`); - }).catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag', `AppEvents HiAppEvent err.code: ${err.code}, err.message: ${err.message}`); - }); - }) - // [End AppEvent_Click_ArkTS_Button] - // [Start CrashEvent_Button] - Button($r('app.string.Crash_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('80%') - .height('5%') - .onClick(() => { - // 在按钮点击函数中构造一个crash场景,触发应用崩溃事件 - JSON.parse(''); - }) - // [End CrashEvent_Button] - // [Start PssleakEvent_Button] - Button($r('app.string.Pssleak_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('80%') - .height('5%') - .onClick(() => { - // 设置一个简单的资源泄漏场景 - hidebug.setAppResourceLimit('pss_memory', 1024, true); - for (let i = 0; i < 20 * 1024; i++) { - this.leakedArray.push(new Array(1).fill('leak')); - } - }) - // [End PssleakEvent_Button] - // [Start TimeOutEvent_Button] - Button($r('app.string.TimeOut_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('80%') - .height('5%') - .onClick(() => { - let t = Date.now(); - while (Date.now() - t <= 350) { - } - }) - // [End TimeOutEvent_Button] - } - .width('50%') - - Column() { - // [Start AppEvent_CPP_Button] - Button('writeEvent C++') - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('80%') - .height('5%') - .onClick(() => { - testNapi.writeAppEvent(); - }) - // [End AppEvent_CPP_Button] - // [Start FreezeEvent_Button] - Button($r('app.string.Freeze_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('80%') - .height('5%') - .onClick(() => { - setTimeout(() => { - while (true) { - } - }, 1000) - }) - // [End FreezeEvent_Button] - // [Start AsanEvent_Button] - Button($r('app.string.AsanEvent_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('80%') - .height('5%') - .onClick(() => { - testNapi.addressTest(); - }) - // [End AsanEvent_Button] - } - .width('50%') - } - .height('100%') - } -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/module.json5 b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/module.json5 deleted file mode 100644 index 9f7f873fbc51484895e18fcfd60b2498521aecb0..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/element/color.json b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/element/string.json b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 0d26f1acdb40e72a2e7b63750b3868e3243e857a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "EventSub" - }, - { - "name": "WatchAppCrash_Button", - "value": "WatchAppCrash ArkTS&C++" - }, - { - "name": "WriteEventArkTS_Button", - "value": "writeEvent ArkTS" - }, - { - "name": "Crash_Button", - "value": "appCrash ArkTS&C++" - }, - { - "name": "Pssleak_Button", - "value": "pssleak ArkTS&C++" - }, - { - "name": "TimeOut_Button", - "value": "timeOut350 ArkTS&C++" - }, - { - "name": "WriteEventCPP_Button", - "value": "writeEvent C++" - }, - { - "name": "Freeze_Button", - "value": "appFreeze ArkTS&C++" - }, - { - "name": "AsanEvent_Button", - "value": "appAsanEvent ArkTS&C++" - } - ] -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/background.png b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/startIcon.png b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/profile/backup_config.json b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/profile/main_pages.json b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/en_US/element/string.json b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 0d26f1acdb40e72a2e7b63750b3868e3243e857a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "EventSub" - }, - { - "name": "WatchAppCrash_Button", - "value": "WatchAppCrash ArkTS&C++" - }, - { - "name": "WriteEventArkTS_Button", - "value": "writeEvent ArkTS" - }, - { - "name": "Crash_Button", - "value": "appCrash ArkTS&C++" - }, - { - "name": "Pssleak_Button", - "value": "pssleak ArkTS&C++" - }, - { - "name": "TimeOut_Button", - "value": "timeOut350 ArkTS&C++" - }, - { - "name": "WriteEventCPP_Button", - "value": "writeEvent C++" - }, - { - "name": "Freeze_Button", - "value": "appFreeze ArkTS&C++" - }, - { - "name": "AsanEvent_Button", - "value": "appAsanEvent ArkTS&C++" - } - ] -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/zh_CN/element/string.json b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index be2be09f9623cc56844054669224befc0de5d0ac..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "事件订阅" - }, - { - "name": "WatchAppCrash_Button", - "value": "WatchAppCrash ArkTS&C++" - }, - { - "name": "WriteEventArkTS_Button", - "value": "writeEvent ArkTS" - }, - { - "name": "Crash_Button", - "value": "appCrash ArkTS&C++" - }, - { - "name": "Pssleak_Button", - "value": "pssleak ArkTS&C++" - }, - { - "name": "TimeOut_Button", - "value": "timeOut350 ArkTS&C++" - }, - { - "name": "WriteEventCPP_Button", - "value": "writeEvent C++" - }, - { - "name": "Freeze_Button", - "value": "appFreeze ArkTS&C++" - }, - { - "name": "AsanEvent_Button", - "value": "appAsanEvent ArkTS&C++" - } - ] -} diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/mock/Libentry.mock.ets b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index 37c4693badee0bced9f50f020403147ada0e8d44..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const nativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default nativeMock; \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/mock/mock-config.json5 b/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/mock/mock-config.json5 deleted file mode 100644 index 25f4db9dcf89e656abe1a6776fe21cd00fc94dac..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/hvigor/hvigor-config.json5 b/PerformanceAnalysisKit/HiAppEvent/EventSub/hvigor/hvigor-config.json5 deleted file mode 100644 index a2c44fdf8f9ac103168672568ff000ac395a2edc..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiAppEvent/EventSub/hvigorfile.ts b/PerformanceAnalysisKit/HiAppEvent/EventSub/hvigorfile.ts deleted file mode 100644 index 79d8761856e2996edc0649eca63b96b2c883b28a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiAppEvent/EventSub/oh-package.json5 b/PerformanceAnalysisKit/HiAppEvent/EventSub/oh-package.json5 deleted file mode 100644 index b7f346f7ddb2fc98ac428c55207a63ff89ea1c70..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiAppEvent/EventSub/ohosTest.md b/PerformanceAnalysisKit/HiAppEvent/EventSub/ohosTest.md deleted file mode 100644 index fe414f3988573487d87ccc43d7f6fcf8e95e9d37..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiAppEvent/EventSub/ohosTest.md +++ /dev/null @@ -1,6 +0,0 @@ -# EventSub测试用例归档 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------ | ------------ | ------------ | ------------ | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 否 | Pass | -| 主页按钮点击 | 位于主页 | 依次点击按钮 | 输出预期日志 | 否 | Pass | \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/screenshots/Screenshot_20250219094941818.jpeg b/PerformanceAnalysisKit/HiAppEvent/EventSub/screenshots/Screenshot_20250219094941818.jpeg deleted file mode 100644 index 7ad5f104644e23b295bace3bfea4c9274effc341..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiAppEvent/EventSub/screenshots/Screenshot_20250219094941818.jpeg and /dev/null differ diff --git a/PerformanceAnalysisKit/HiAppEvent/EventSub/screenshots/Screenshot_20250909094941818.jpg b/PerformanceAnalysisKit/HiAppEvent/EventSub/screenshots/Screenshot_20250909094941818.jpg deleted file mode 100644 index de3513d5bc942739d2ed609b0c6b197f8f42019a..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiAppEvent/EventSub/screenshots/Screenshot_20250909094941818.jpg and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/app.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/app.json5 deleted file mode 100644 index e6d77a787cec31e2a468c2de811d7e6c3c1b6010..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.hitracechain_arkts_sample_a", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/element/string.json deleted file mode 100644 index c345ca427849bf40806cea223c7c849a232e485c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "HitraceChain_ArkTS_Sample_A" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/README_zh.md b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/README_zh.md deleted file mode 100644 index 5cce5a9ef3d727ddddc10c2f6fe6051856cfded5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/README_zh.md +++ /dev/null @@ -1,97 +0,0 @@ -# HiTraceChain ArkTS接口使用样例 - -### 介绍 - -本示例主要展示了使用HiTraceChain提供分布式跟踪接口。 - -HiTraceChain是基于云计算分布式跟踪调用链思想,在端侧业务流程(涉及跨线程、跨进程、跨设备)中的一种轻量级实现。hiTraceChain在业务控制面流程中,生成和传递唯一跟踪标识,在业务流程中输出的各类信息中(包括应用事件、系统时间、日志等)记录该跟踪标识。在调试、问题定位过程中,开发者可以通过该唯一跟踪标识将本次业务流程端到端的各类信息快速关联起来。 - -本样例介绍在async/await和promise/then异步任务中使用HiTraceChain。 - -该工程中的展示的代码详细描述可查如下链接: - -- [使用HiTraceChain打点(ArkTS)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/dfx/hitracechain-guidelines-arkts.md) - -### 效果预览 - -| 主页 | -| :----------------------------------------------------------------------------------: | -| `z` | - -#### 使用说明 - -1. 在DevEco Studio Terminal 中执行如下命令: - -``` -$ hitrace -t 10 app | grep onClick -``` - -2. 点击设备上的“clickTime=0”按钮(需在10秒内完成,否则步骤3捕获不到trace数据),触发业务逻辑。 使用关键字“testTag”过滤日志,查看该业务代码打印的hilog日志。 - -``` -06-04 17:46:45.156 55451-55451 C02D33/com.exa...tion/HiTraceC com.examp...lication I [a92ab116052648e 0 0]HiTraceBegin name:testTag: hiTraceChain begin flags:0x01. -06-04 17:46:45.157 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I [a92ab116052648e 0 0]promise task -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I [a92ab116052648e 0 0]test1_1 -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I [a92ab116052648e 0 0]test2 -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I hiTraceChain end in main thread -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I [a92ab116052648e 3457eff 0]test1_2 -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I [a92ab116052648e 3457eff 0]test3 -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication E [a92ab116052648e 1bb5a1b 35d9c46]Random number is too small -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I hiTraceChain end in promise/then -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I [a92ab116052648e 2ddfb70 3457eff]test1_3 -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I [a92ab116052648e 225a1d9 2ddfb70]then task -06-04 17:46:45.158 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I hiTraceChain end in async/await -06-04 17:46:45.163 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I [a92ab116052648e 3a75cb2 520a92]Succeeded in writing an app event -06-04 17:46:45.163 55451-55451 A00000/com.exa...ation/testTag com.examp...lication I hiTraceChain end in hiAppEvent -``` - -3. 在DevEco Studio Terminal窗口查看trace数据,HiTraceChain跟踪开启期间,HiTraceMeter打点得到的trace日志会自动携带HiTraceId信息。 - -``` - e.myapplication-55451 ( 55451) [010] .... 27164.174417: tracing_mark_write: B|55451|H:[a92ab116052648e,0,0]#onClick|M62|clickTime=1 -``` - -### 工程目录 - -``` -└── entry - └── src - └── main - └── ets - ├── entryability - │ └── EntryAbility.ets - ├── entrybackupability - │ └── EntryBackupAbility.ets - └── pages - └── Index.ets //主页 -``` - -### 具体实现 - -1. ArkTS项目可以在"@kit.PerformanceAnalysisKit"中导入对应模块即可在各种场景下调用对应函数,如在index.ets中直接调用,或者在EntryAbility.ets函数中在应用的各个生命周期内添加功能函数以实现应用自动在“启动”或“结束”时进行性能分析。 - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机; -2. 本示例已适配API20版本SDK,版本号:6.0.0.47; -3. 本示例需要使用DevEco Studio(6.0.0.858)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/ > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/build-profile.json5 deleted file mode 100644 index f9f311acef30dae790bd712ea67cad948ca1d509..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0(20)", - "compileSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS" - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/build-profile.json5 deleted file mode 100644 index 1d2fc52afb11467a138506d8509a3ca2c123707e..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/obfuscation-rules.txt b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/oh-package.json5 deleted file mode 100644 index 4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/ets/entryability/EntryAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6a95f638674014a6d6088fb8a25f00854a309e53..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1fca37ecc34e1079aaf6557f1272cd694aa0068c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/ets/pages/Index.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 60e39884a50ba52aa6a582136859acb4843b2339..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hitracechain_arkts_sample_code_a] -import { BusinessError } from '@kit.BasicServicesKit'; -import { hiAppEvent, hilog, hiTraceChain, hiTraceMeter } from '@kit.PerformanceAnalysisKit'; - -async function test3() { - hilog.info(0x0000, 'testTag', 'test3'); -} - -async function test2() { - hilog.info(0x0000, 'testTag', 'test2'); -} - -async function test1() { - hilog.info(0x0000, 'testTag', 'test1_1'); - await test2(); - hilog.info(0x0000, 'testTag', 'test1_2'); - await test3(); - hilog.info(0x0000, 'testTag', 'test1_3'); -} - -@Entry -@Component -struct Index { - @State message: string = 'clickTime=0'; - @State clickTime: number = 0; - - build() { - Row() { - Column() { - Button(this.message) - .fontSize(20) - .margin(5) - .width(350) - .height(60) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.clickTime++; - this.message = 'clickTime=' + this.clickTime; - // 业务开始前,开启分布式跟踪 - // INCLUDE_ASYNC表示会在系统支持的异步机制里自动传递HiTraceId - let traceId = hiTraceChain.begin('testTag: hiTraceChain begin', hiTraceChain.HiTraceFlag.INCLUDE_ASYNC); - // 开始HiTraceMeter同步打点,该接口API version 19开始支持 - hiTraceMeter.startSyncTrace(hiTraceMeter.HiTraceOutputLevel.COMMERCIAL, 'onClick', this.message); - - // 在按钮点击函数中进行事件打点,以记录按钮点击事件 - 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', 'Succeeded in writing an app event'); - // 按钮点击事件处理结束,关闭异步处理分支的分布式跟踪 - hiTraceChain.end(traceId); - hilog.info(0x0000, 'testTag', 'hiTraceChain end in hiAppEvent'); - }).catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag', `HiAppEvent err.code: ${err.code}, err.message: ${err.message}`); - // 异常处理结束,关闭异步处理分支的分布式跟踪 - hiTraceChain.end(traceId); - hilog.info(0x0000, 'testTag', 'hiTraceChain end in hiAppEvent'); - }); - - // 创建Promise对象执行随机数生成任务,若随机数大于0.5,则正常返回结果,反之则返回异常信息 - const promise: Promise = new Promise((resolve: Function, reject: Function) => { - hilog.info(0x0000, 'testTag', 'promise task'); - const randomNumber: number = Math.random(); - if (randomNumber > 0.5) { - resolve(randomNumber); - } else { - reject(new Error('Random number is too small')); - } - }); - - // then方法的回调函数处理Promise对象的执行结果 - promise.then((result: number) => { - // 成功时执行 - hilog.info(0x0000, 'testTag', 'Random number is %{public}d', result); - // 回调函数处理结束,关闭异步处理分支的分布式跟踪 - hiTraceChain.end(traceId); - hilog.info(0x0000, 'testTag', 'hiTraceChain end in promise/then'); - }).catch((error: BusinessError) => { - // 失败时执行 - hilog.error(0x0000, 'testTag', error.message); - // 异常处理结束,关闭异步处理分支的分布式跟踪 - hiTraceChain.end(traceId); - hilog.info(0x0000, 'testTag', 'hiTraceChain end in promise/then'); - }); - - // 执行async/await异步任务 - let res = test1(); - // then方法的回调函数处理异步任务的执行结果 - res.then(() => { - hilog.info(0x0000, 'testTag', 'then task'); - // 功能同hiTraceChain.end,关闭异步处理分支的分布式跟踪 - hiTraceChain.clearId(); - hilog.info(0x0000, 'testTag', 'hiTraceChain end in async/await'); - }); - - // 结束HiTraceMeter同步打点,该接口API version 19开始支持 - hiTraceMeter.finishSyncTrace(hiTraceMeter.HiTraceOutputLevel.COMMERCIAL); - // 业务结束后,关闭分布式跟踪 - hiTraceChain.end(traceId); - hilog.info(0x0000, 'testTag', 'hiTraceChain end in main thread'); - }) - } - .width('100%') - } - .height('100%') - } -} -// [End hitracechain_arkts_sample_code_a] \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/module.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/module.json5 deleted file mode 100644 index d700a40c54cefb5c84bb352cf7a89b37acd0f342..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "ohos.want.action.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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/element/float.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/startIcon.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/profile/backup_config.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/profile/main_pages.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/dark/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/mock/mock-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/hvigor/hvigor-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/hvigor/hvigor-config.json5 deleted file mode 100644 index e0c92fdad58a7851692e144df9a4b1f4953ec26c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/oh-package.json5 deleted file mode 100644 index 34a126da756d306c9412997bcd7d57a34b6da0a2..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/ohosTest.md b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/ohosTest.md deleted file mode 100644 index 519de1061cdf567c9a47035833c781802f105b5a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 性能分析工具测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------ | ------------ | ---------------------- | ------------ | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 否 | Pass | -| 主页按钮点击 | 位于主页 | 按readme的使用说明操作 | 输出预期日志 | 否 | Pass | diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/screenshots/Snipaste_2025-10-17_15-32-47.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/screenshots/Snipaste_2025-10-17_15-32-47.png deleted file mode 100644 index e3b876436723f935c661f19112d9da240ba48f92..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_A/screenshots/Snipaste_2025-10-17_15-32-47.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/app.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/app.json5 deleted file mode 100644 index d9e4a4d5610ac58d3550859037fed2adf385b54b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.hitracechain_arkts_sample_b", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/element/string.json deleted file mode 100644 index 1e2207deffd02203c383104d0b61b50d6bcf9fd8..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "HitraceChain_ArkTS_Sample_B" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/README_zh.md b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/README_zh.md deleted file mode 100644 index 2f506eb5a34b46d902da851646235ee79c636512..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/README_zh.md +++ /dev/null @@ -1,79 +0,0 @@ -# HiTraceChain ArkTS接口使用样例 - -### 介绍 - -本示例主要展示了使用HiTraceChain提供分布式跟踪接口。 - -HiTraceChain是基于云计算分布式跟踪调用链思想,在端侧业务流程(涉及跨线程、跨进程、跨设备)中的一种轻量级实现。hiTraceChain在业务控制面流程中,生成和传递唯一跟踪标识,在业务流程中输出的各类信息中(包括应用事件、系统时间、日志等)记录该跟踪标识。在调试、问题定位过程中,开发者可以通过该唯一跟踪标识将本次业务流程端到端的各类信息快速关联起来。 - -本样例介绍在异步宏任务setInterval和setTimeout中使用HiTraceChain。 - -该工程中的展示的代码详细描述可查如下链接: - -- [使用HiTraceChain打点(ArkTS)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/dfx/hitracechain-guidelines-arkts.md) - -### 效果预览 - -| 主页 | -| :----------------------------------------------------------------------------------: | -| `z` | - -#### 使用说明 - -1. 点击设备上的“clickTime=0”按钮触发业务逻辑。 使用关键字“testTag”过滤日志,查看该业务代码打印的hilog日志。 - -``` -06-05 15:46:04.544 49568-49568 A00000/com.exa...ation/testTag com.examp...lication I HiTraceId is invalid, begin hiTraceChain -06-05 15:46:04.544 49568-49568 C02D33/com.exa...tion/HiTraceC com.examp...lication I [a92ab34b3c84ea7 0 0]HiTraceBegin name:testTag: hiTraceChain begin flags:0x00. -06-05 15:46:04.544 49568-49568 A00000/com.exa...ation/testTag com.examp...lication I [a92ab34b3c84ea7 0 0]HiTraceFlag INCLUDE_ASYNC is enabled -06-05 15:46:04.544 49568-49568 A00000/com.exa...ation/testTag com.examp...lication I hiTraceChain end in main thread -06-05 15:46:05.547 49568-49568 A00000/com.exa...ation/testTag com.examp...lication I [a92ab34b3c84ea7 0 0]Interval 1s: randomNumber is 0.863610 -06-05 15:46:06.548 49568-49568 A00000/com.exa...ation/testTag com.examp...lication I [a92ab34b3c84ea7 0 0]Interval 1s: randomNumber is 0.365460 -06-05 15:46:07.047 49568-49568 A00000/com.exa...ation/testTag com.examp...lication I [a92ab34b3c84ea7 3cafdfd 0]setTimeout 2.5s -06-05 15:46:07.048 49568-49568 A00000/com.exa...ation/testTag com.examp...lication I [a92ab34b3c84ea7 dc842f 3cafdfd]Random number is 0.524236 -``` - -### 工程目录 - -``` -└── entry - └── src - └── main - └── ets - ├── entryability - │ └── EntryAbility.ets - ├── entrybackupability - │ └── EntryBackupAbility.ets - └── pages - └── Index.ets //主页 -``` - -### 具体实现 - -1. ArkTS项目可以在"@kit.PerformanceAnalysisKit"中导入对应模块即可在各种场景下调用对应函数,如在index.ets中直接调用,或者在EntryAbility.ets函数中在应用的各个生命周期内添加功能函数以实现应用自动在“启动”或“结束”时进行性能分析。 - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机; -2. 本示例已适配API20版本SDK,版本号:6.0.0.47; -3. 本示例需要使用DevEco Studio(6.0.0.858)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/ > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/build-profile.json5 deleted file mode 100644 index f9f311acef30dae790bd712ea67cad948ca1d509..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0(20)", - "compileSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS" - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/build-profile.json5 deleted file mode 100644 index 1d2fc52afb11467a138506d8509a3ca2c123707e..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/obfuscation-rules.txt b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/oh-package.json5 deleted file mode 100644 index 4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/ets/entryability/EntryAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6a95f638674014a6d6088fb8a25f00854a309e53..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1fca37ecc34e1079aaf6557f1272cd694aa0068c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/ets/pages/Index.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 7ad2395a734de3378859ce5e335322bfa852d545..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hitracechain_arkts_sample_code_b] -import { BusinessError } from '@kit.BasicServicesKit'; -import { hilog, hiTraceChain } from '@kit.PerformanceAnalysisKit'; - -@Entry -@Component -struct Index { - @State message: string = 'clickTime=0'; - @State clickTime: number = 0; - - build() { - Row() { - Column() { - Button(this.message) - .fontSize(20) - .margin(5) - .width(350) - .height(60) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.clickTime++; - this.message = 'clickTime=' + this.clickTime; - // 获取当前线程的HiTraceId - let traceId = hiTraceChain.getId(); - // 如果traceId无效,为当前线程开启分布式跟踪 - if (!hiTraceChain.isValid(traceId)) { - hilog.info(0x0000, 'testTag', 'HiTraceId is invalid, begin hiTraceChain'); - traceId = hiTraceChain.begin('testTag: hiTraceChain begin'); - // 使能traceId的INCLUDE_ASYNC,INCLUDE_ASYNC表示会在系统支持的异步机制里自动传递HiTraceId - hiTraceChain.enableFlag(traceId, hiTraceChain.HiTraceFlag.INCLUDE_ASYNC); - // 将使能INCLUDE_ASYNC的HiTraceId设置到当前线程 - hiTraceChain.setId(traceId); - // 查询INCLUDE_ASYNC是否设置成功 - if (hiTraceChain.isFlagEnabled(hiTraceChain.getId(), hiTraceChain.HiTraceFlag.INCLUDE_ASYNC)) { - hilog.info(0x0000, 'testTag', 'HiTraceFlag INCLUDE_ASYNC is enabled'); - } - } - - const promise: Promise = new Promise((resolve: Function, reject: Function) => { - // 创建异步重复定时任务,每1s执行一次 - let intervalID = setInterval(() => { - // 为当前异步重复定时任务设置HiTraceId - hiTraceChain.setId(traceId); - const randomNumber: number = Math.random(); - hilog.info(0x0000, 'testTag', 'Interval 1s: randomNumber is %{public}d', randomNumber); - // 关闭当前异步重复定时任务的分布式跟踪 - hiTraceChain.end(traceId); - }, 1000) - - // 创建异步定时任务,2.5s后执行,结束异步重复定时任务 - setTimeout(() => { - // 为异步定时任务设置HiTraceId - hiTraceChain.setId(traceId); - // 为异步定时任务生成分支标识spanId - let traceIdTimeout = hiTraceChain.createSpan(); - // 为异步定时任务设置带spanId的HiTraceId - hiTraceChain.setId(traceIdTimeout); - hilog.info(0x0000, 'testTag', 'setTimeout 2.5s'); - // 结束异步重复定时任务 - clearInterval(intervalID); - const randomNumber: number = Math.random(); - if (randomNumber > 0.5) { - resolve(randomNumber); - } else { - reject(new Error('Random number is too small')); - } - // 关闭异步定时任务的分布式跟踪 - hiTraceChain.end(traceId); - }, 2500) - }) - - promise.then((result: number) => { - // 成功时执行 - hilog.info(0x0000, 'testTag', 'Random number is %{public}d', result); - // 回调函数处理结束,关闭异步处理分支的分布式跟踪 - hiTraceChain.end(traceId); - }).catch((error: BusinessError) => { - // 失败时执行 - hilog.error(0x0000, 'testTag', error.message); - // 异常处理结束,关闭异步处理分支的分布式跟踪 - hiTraceChain.end(traceId); - }); - - // 业务结束后,关闭分布式跟踪 - hiTraceChain.end(traceId); - hilog.info(0x0000, 'testTag', 'hiTraceChain end in main thread'); - }) - } - .width('100%') - } - .height('100%') - } -} -// [End hitracechain_arkts_sample_code_b] \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/module.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/module.json5 deleted file mode 100644 index d700a40c54cefb5c84bb352cf7a89b37acd0f342..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "ohos.want.action.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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/element/float.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/startIcon.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/profile/backup_config.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/profile/main_pages.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/dark/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/mock/mock-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/hvigor/hvigor-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/hvigor/hvigor-config.json5 deleted file mode 100644 index e0c92fdad58a7851692e144df9a4b1f4953ec26c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/oh-package.json5 deleted file mode 100644 index 34a126da756d306c9412997bcd7d57a34b6da0a2..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/ohosTest.md b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/ohosTest.md deleted file mode 100644 index 519de1061cdf567c9a47035833c781802f105b5a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 性能分析工具测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------ | ------------ | ---------------------- | ------------ | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 否 | Pass | -| 主页按钮点击 | 位于主页 | 按readme的使用说明操作 | 输出预期日志 | 否 | Pass | diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/screenshots/Snipaste_2025-10-17_15-32-47.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/screenshots/Snipaste_2025-10-17_15-32-47.png deleted file mode 100644 index e3b876436723f935c661f19112d9da240ba48f92..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_ArkTS_Sample_B/screenshots/Snipaste_2025-10-17_15-32-47.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/app.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/app.json5 deleted file mode 100644 index d0945138c17c2375662eda881dc45d43782d5120..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.hitracechain_ndk", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/element/string.json deleted file mode 100644 index 95e578284748fa6f8d28ed50dfbfdd4e7b4ddea5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "HitraceChain_NDK" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/README_zh.md b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/README_zh.md deleted file mode 100644 index 0956a7c28fd2bda194cfc73ca22e3e509f2ac052..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/README_zh.md +++ /dev/null @@ -1,86 +0,0 @@ -# HiTraceChain NDK接口使用样例 - -### 介绍 - -本示例主要展示了使用HiTraceChain提供分布式跟踪接口。 - -HiTraceChain是基于云计算分布式跟踪调用链思想,在端侧业务流程(涉及跨线程、跨进程、跨设备)中的一种轻量级实现。hiTraceChain在业务控制面流程中,生成和传递唯一跟踪标识,在业务流程中输出的各类信息中(包括应用事件、系统时间、日志等)记录该跟踪标识。在调试、问题定位过程中,开发者可以通过该唯一跟踪标识将本次业务流程端到端的各类信息快速关联起来。 - -该工程中的展示的代码详细描述可查如下链接: - -- [使用HiTraceChain打点(C/C++)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/dfx/hitracechain-guidelines-ndk.md) - -### 效果预览 - -| 主页 | -| :----------------------------------------------------------------------------------: | -| `z` | - -#### 使用说明 - -1. 点击设备上的“clickTime=0”按钮触发业务逻辑。 使用关键字“testTag”过滤日志,查看该业务代码打印的hilog日志。 - -``` -06-05 21:26:01.006 9944-9944 C02D33/com.exa...tion/HiTraceC com.examp...lication I [a92ab19ae90197d 0 0]HiTraceBegin name:testTag: hiTraceChain begin flags:0x00. -06-05 21:26:01.006 9944-9944 A00000/com.exa...ation/testTag com.examp...lication I [a92ab19ae90197d 0 0]HiTraceId is valid -06-05 21:26:01.006 9944-9944 A00000/com.exa...ation/testTag com.examp...lication I [a92ab19ae90197d 0 0]HITRACE_FLAG_INCLUDE_ASYNC is enabled -06-05 21:26:01.007 9944-9944 A00000/com.exa...ation/testTag com.examp...lication I Add, HiTraceChain end -06-05 21:26:01.007 9944-9944 A00000/com.exa...ation/testTag com.examp...lication I Test NAPI 2 + 3 = 5 -06-05 21:26:01.007 9944-13961 A00000/com.exa...ation/testTag com.examp...lication I [a92ab19ae90197d 2544fdb 0]Print1 -06-05 21:26:01.007 9944-13961 A00000/com.exa...ation/testTag com.examp...lication I Print1, HiTraceChain end -06-05 21:26:01.008 9944-13962 A00000/com.exa...ation/testTag com.examp...lication I [a92ab19ae90197d 236699a 2544fdb]Print2 -06-05 21:26:01.008 9944-13962 A00000/com.exa...ation/testTag com.examp...lication I Print2, HiTraceChain end -``` - -### 工程目录 - -``` -└── entry - └── src - └── main - ├── cpp - │ ├── CMakeLists.txt - │ ├── napi_init.cpp - │ └── types - │ └── libentry - │ ├── Index.d.ts - │ └── oh-package.json5 - └── ets - ├── entryability - │ └── EntryAbility.ets - ├── entrybackupability - │ └── EntryBackupAbility.ets - └── pages - └── Index.ets -``` - -### 具体实现 - -1. ArkTS项目可以在"@kit.PerformanceAnalysisKit"中导入对应模块即可在各种场景下调用对应函数,如在index.ets中直接调用,或者在EntryAbility.ets函数中在应用的各个生命周期内添加功能函数以实现应用自动在“启动”或“结束”时进行性能分析。 -2. C++项目可以在CMakeLists.txt里的target_link_libraries中添加对应功能的包,在napi_init.cpp中添加注册自定义C++功能函数(还需在index.d.ts中声明)后,即可在各种场景下通过"libentry.so"库自定义一个对象来调用注册声明的测试函数即可。 - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机; -2. 本示例已适配API20版本SDK,版本号:6.0.0.47; -3. 本示例需要使用DevEco Studio(6.0.0.858)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/ > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/build-profile.json5 deleted file mode 100644 index f9f311acef30dae790bd712ea67cad948ca1d509..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0(20)", - "compileSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS" - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/build-profile.json5 deleted file mode 100644 index f3d112306bd8c6ec733f59e86a9dd7450a60a8a8..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - }, - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/obfuscation-rules.txt b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/oh-package.json5 deleted file mode 100644 index 5d993e5251fd56950970aa593aefef1b8d71e976..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/CMakeLists.txt b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index e8d578188cb3df822a8250c0b39a845f1ff61313..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# [Start hitracechain_ndk_cmake_code] -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(HiTraceChainTest03) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libhitrace_ndk.z.so libhilog_ndk.z.so) -# [End hitracechain_ndk_cmake_code] \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/napi_init.cpp b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index f4f966d0c4c97c625c8ae50ecfcbf72923c359b9..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hitracechain_ndk_native_code] -#include - -#include "hilog/log.h" -#include "hitrace/trace.h" -#include "napi/native_api.h" - -#undef LOG_TAG -#define LOG_TAG "testTag" - -void Print2(HiTraceId id) -{ - // 为当前线程设置HiTraceId - OH_HiTrace_SetId(&id); - // 生成分支标识spanId - id = OH_HiTrace_CreateSpan(); - // 为当前线程设置带spanId的HiTraceId - OH_HiTrace_SetId(&id); - OH_LOG_INFO(LogType::LOG_APP, "Print2"); - // 结束当前线程分布式跟踪,功能同OH_HiTrace_EndChain() - OH_HiTrace_ClearId(); - OH_LOG_INFO(LogType::LOG_APP, "Print2, HiTraceChain end"); -} - -void Print1(HiTraceId id) -{ - // 为当前线程设置HiTraceId - OH_HiTrace_SetId(&id); - // 生成分支标识spanId - id = OH_HiTrace_CreateSpan(); - // 为当前线程设置带spanId的HiTraceId - OH_HiTrace_SetId(&id); - OH_LOG_INFO(LogType::LOG_APP, "Print1"); - std::thread(Print2, OH_HiTrace_GetId()).detach(); - // 结束当前线程分布式跟踪 - OH_HiTrace_EndChain(); - OH_LOG_INFO(LogType::LOG_APP, "Print1, HiTraceChain end"); -} - -static napi_value Add(napi_env env, napi_callback_info info) -{ - // 任务开始,开启分布式跟踪 - HiTraceId hiTraceId = OH_HiTrace_BeginChain("testTag: hiTraceChain begin", HiTrace_Flag::HITRACE_FLAG_DEFAULT); - // 判断生成的hiTraceId是否有效,有效则输出一行hilog日志 - if (OH_HiTrace_IsIdValid(&hiTraceId)) { - OH_LOG_INFO(LogType::LOG_APP, "HiTraceId is valid"); - } - // 使能HITRACE_FLAG_INCLUDE_ASYNC标志位,表示会在系统支持的异步机制里自动传递HiTraceId - OH_HiTrace_EnableFlag(&hiTraceId, HiTrace_Flag::HITRACE_FLAG_INCLUDE_ASYNC); - // 判断hitraceId的HITRACE_FLAG_INCLUDE_ASYNC标志位是否已经使能,使能则把hiTraceId设置到当前线程TLS中 - if (OH_HiTrace_IsFlagEnabled(&hiTraceId, HiTrace_Flag::HITRACE_FLAG_INCLUDE_ASYNC)) { - OH_HiTrace_SetId(&hiTraceId); - OH_LOG_INFO(LogType::LOG_APP, "HITRACE_FLAG_INCLUDE_ASYNC is enabled"); - } - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - - // 创建线程执行打印任务,传递当前线程的HiTraceId - std::thread(Print1, OH_HiTrace_GetId()).detach(); - // 任务结束,结束分布式跟踪 - OH_HiTrace_EndChain(); - OH_LOG_INFO(LogType::LOG_APP, "Add, HiTraceChain end"); - - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} -// [End hitracechain_ndk_native_code] \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/types/libentry/Index.d.ts b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/types/libentry/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 846e4c7e13ead48abe6019bd40f3a13bf8f9c083..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/ets/entryability/EntryAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6a95f638674014a6d6088fb8a25f00854a309e53..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1fca37ecc34e1079aaf6557f1272cd694aa0068c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/ets/pages/Index.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 2d8f89001b29f63e1a37657dd661e2e7b397d4c0..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hitracechain_ndk_page_code] -import { hilog } from '@kit.PerformanceAnalysisKit'; -import testNapi from 'libentry.so'; - -const DOMAIN = 0x0000; - -@Entry -@Component -struct Index { - @State message: string = 'clickTime=0'; - @State clickTime: number = 0; - - build() { - Row() { - Column() { - Button(this.message) - .fontSize(20) - .margin(5) - .width(350) - .height(60) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.clickTime++; - this.message = 'clickTime=' + this.clickTime; - hilog.info(DOMAIN, 'testTag', 'Test NAPI 2 + 3 = %{public}d', testNapi.add(2, 3)); - }) - } - .width('100%') - } - .height('100%') - } -} -// [End hitracechain_ndk_page_code] \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/module.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/module.json5 deleted file mode 100644 index d700a40c54cefb5c84bb352cf7a89b37acd0f342..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "ohos.want.action.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/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/element/float.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/startIcon.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/profile/backup_config.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/profile/main_pages.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/dark/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/mock/Libentry.mock.ets b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index eebf1ed910f6a8f2a9e7e565aa71b179b7b8b537..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/mock/mock-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/hvigor/hvigor-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/hvigor/hvigor-config.json5 deleted file mode 100644 index e0c92fdad58a7851692e144df9a4b1f4953ec26c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/oh-package.json5 deleted file mode 100644 index 34a126da756d306c9412997bcd7d57a34b6da0a2..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/ohosTest.md b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/ohosTest.md deleted file mode 100644 index 519de1061cdf567c9a47035833c781802f105b5a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 性能分析工具测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------ | ------------ | ---------------------- | ------------ | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 否 | Pass | -| 主页按钮点击 | 位于主页 | 按readme的使用说明操作 | 输出预期日志 | 否 | Pass | diff --git a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/screenshots/Snipaste_2025-10-17_15-32-47.png b/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/screenshots/Snipaste_2025-10-17_15-32-47.png deleted file mode 100644 index e3b876436723f935c661f19112d9da240ba48f92..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceChain_NDK/screenshots/Snipaste_2025-10-17_15-32-47.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/app.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/app.json5 deleted file mode 100644 index 19b31bd47ff4d45d25d0736de16d5fcb379135f5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.hitracemeter_arkts", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/element/string.json deleted file mode 100644 index 15db0933119c555aabc9d0fe3313c74dd31138cd..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "HitraceMeter_ArkTS" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/README_zh.md b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/README_zh.md deleted file mode 100644 index 57db0111502e71f659baa82fc985175023a5593c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/README_zh.md +++ /dev/null @@ -1,89 +0,0 @@ -# HiTraceMeter ArkTS接口使用样例 - -### 介绍 - -本示例主要展示了使用HiTraceMeter提供系统性能打点接口。开发者通过在关键代码位置调用HiTraceMeter接口提供的API接口,能够有效跟踪进程轨迹、查看系统性能。 - -该工程中的展示的代码详细描述可查如下链接: - -- [使用HiTraceMeter跟踪性能(ArkTS)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/dfx/hitracemeter-guidelines-arkts.md) - -### 效果预览 - -| 主页 | -| :----------------------------------------------------------------------------------: | -| `z` | - -#### 使用说明 - -1.在主界面点击Hello World文本;DevEco Studio Terminal 中执行如下命令: - -``` -PS D:\xxx\xxx> hdc shell -$ hitrace --trace_begin app -``` - -2.执行抓取trace命令后,先在设备中点击几次HiTraceMeter ArkTS按钮,继续在Terminal窗口执行命令: - -``` -$ hitrace --trace_dump | grep myTest -``` - -3.成功输出如下数据即为成功: - -``` -e.myapplication-39945 ( 39945) [010] .... 347921.342267: tracing_mark_write: S|39945|H:myTestAsyncTrace|1001|M62|categoryTest|key=value -e.myapplication-39945 ( 39945) [010] .... 347921.342280: tracing_mark_write: C|39945|H:myTestCountTrace|1|M62 -e.myapplication-39945 ( 39945) [010] .... 347921.342327: tracing_mark_write: S|39945|H:myTestAsyncTrace|1002|M62|categoryTest|key=value -e.myapplication-39945 ( 39945) [010] .... 347921.342333: tracing_mark_write: C|39945|H:myTestCountTrace|2|M62 -e.myapplication-39945 ( 39945) [010] .... 347921.342358: tracing_mark_write: F|39945|H:myTestAsyncTrace|1001|M62 -e.myapplication-39945 ( 39945) [010] .... 347921.342365: tracing_mark_write: F|39945|H:myTestAsyncTrace|1002|M62 -e.myapplication-39945 ( 39945) [010] .... 347921.342387: tracing_mark_write: B|39945|H:myTestSyncTrace|M62|key=value -e.myapplication-39945 ( 39945) [010] .... 347921.342586: tracing_mark_write: S|39945|H:myTestAsyncTrace|1003|M62|categoryTest|key0=value0,key1=value1,key2=value2,key3=value3,key4=value4,key5=value5,key6=value6,key7=value7,key8=value8,key9=value9 -e.myapplication-39945 ( 39945) [010] .... 347921.342615: tracing_mark_write: F|39945|H:myTestAsyncTrace|1003|M62 -``` - -### 工程目录 - -``` -└── entry - └── src - └── main - └── ets - ├── entryability - │ └── EntryAbility.ets - ├── entrybackupability - │ └── EntryBackupAbility.ets - └── pages - └── Index.ets //主页 -``` - -### 具体实现 - -1. ArkTS项目可以在"@kit.PerformanceAnalysisKit"中导入对应模块即可在各种场景下调用对应函数,如在index.ets中直接调用,或者在EntryAbility.ets函数中在应用的各个生命周期内添加功能函数以实现应用自动在“启动”或“结束”时进行性能分析。 - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机; -2. 本示例已适配API20版本SDK,版本号:6.0.0.47; -3. 本示例需要使用DevEco Studio(6.0.0.858)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/ > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/build-profile.json5 deleted file mode 100644 index f9f311acef30dae790bd712ea67cad948ca1d509..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0(20)", - "compileSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS" - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/build-profile.json5 deleted file mode 100644 index 1d2fc52afb11467a138506d8509a3ca2c123707e..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/obfuscation-rules.txt b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/oh-package.json5 deleted file mode 100644 index 4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/ets/entryability/EntryAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6a95f638674014a6d6088fb8a25f00854a309e53..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1fca37ecc34e1079aaf6557f1272cd694aa0068c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/ets/pages/Index.ets b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 4931ea7c5010640bc84765480c2d17ef3d50e599..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hitracemeter_arkts_code] -import { hiTraceMeter, hilog } from '@kit.PerformanceAnalysisKit'; - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = (this.message == 'Hello HiTrace') ? 'Hello World' : 'Hello HiTrace'; - const COMMERCIAL = hiTraceMeter.HiTraceOutputLevel.COMMERCIAL; - - let traceCount = 0; - // 第一个异步跟踪任务开始 - hiTraceMeter.startAsyncTrace(COMMERCIAL, 'myTestAsyncTrace', 1001, 'categoryTest', 'key=value'); - // 开始计数任务 - traceCount++; - hiTraceMeter.traceByValue(COMMERCIAL, 'myTestCountTrace', traceCount); - // 业务流程 - hilog.info(0x0000, 'testTrace', 'myTraceTest running, taskId: 1001'); - - // 第二个异步跟踪任务开始,同时第一个跟踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同 - hiTraceMeter.startAsyncTrace(COMMERCIAL, 'myTestAsyncTrace', 1002, 'categoryTest', 'key=value'); - // 开始计数任务 - traceCount++; - hiTraceMeter.traceByValue(COMMERCIAL, 'myTestCountTrace', traceCount); - // 业务流程 - hilog.info(0x0000, 'testTrace', 'myTraceTest running, taskId: 1002'); - - // 结束taskId为1001的异步跟踪任务 - hiTraceMeter.finishAsyncTrace(COMMERCIAL, 'myTestAsyncTrace', 1001); - // 结束taskId为1002的异步跟踪任务 - hiTraceMeter.finishAsyncTrace(COMMERCIAL, 'myTestAsyncTrace', 1002); - - // 开始同步跟踪任务 - hiTraceMeter.startSyncTrace(COMMERCIAL, 'myTestSyncTrace', 'key=value'); - // 业务流程 - hilog.info(0x0000, 'testTrace', 'myTraceTest running, synchronizing trace'); - // 结束同步跟踪任务 - hiTraceMeter.finishSyncTrace(COMMERCIAL); - - // 若通过HiTraceMeter性能打点接口传递的参数的生成过程比较复杂,此时可以通过isTraceEnabled判断当前是否开启应用trace捕获, - // 在未开启应用trace捕获时,避免该部分性能损耗 - if (hiTraceMeter.isTraceEnabled()) { - let customArgs = 'key0=value0'; - for (let index = 1; index < 10; index++) { - customArgs += `,key${index}=value${index}` - } - hiTraceMeter.startAsyncTrace(COMMERCIAL, 'myTestAsyncTrace', 1003, 'categoryTest', customArgs); - hilog.info(0x0000, 'testTrace', 'myTraceTest running, taskId: 1003'); - hiTraceMeter.finishAsyncTrace(COMMERCIAL, 'myTestAsyncTrace', 1003); - } else { - hilog.info(0x0000, 'testTrace', 'myTraceTest running, trace is not enabled'); - } - }) - } - .width('100%') - } - .height('100%') - } -} -// [End hitracemeter_arkts_code] \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/module.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/module.json5 deleted file mode 100644 index d700a40c54cefb5c84bb352cf7a89b37acd0f342..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "ohos.want.action.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/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/element/float.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/startIcon.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/profile/backup_config.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/profile/main_pages.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/dark/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/mock/mock-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/hvigor/hvigor-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/hvigor/hvigor-config.json5 deleted file mode 100644 index e0c92fdad58a7851692e144df9a4b1f4953ec26c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/oh-package.json5 deleted file mode 100644 index 34a126da756d306c9412997bcd7d57a34b6da0a2..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/ohosTest.md b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/ohosTest.md deleted file mode 100644 index 519de1061cdf567c9a47035833c781802f105b5a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 性能分析工具测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------ | ------------ | ---------------------- | ------------ | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 否 | Pass | -| 主页按钮点击 | 位于主页 | 按readme的使用说明操作 | 输出预期日志 | 否 | Pass | diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/screenshots/Snipaste_2025-10-17_14-47-32.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/screenshots/Snipaste_2025-10-17_14-47-32.png deleted file mode 100644 index e1eadfca86e5990aa1c4787d69c3a805a22a9da3..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_ArkTS/screenshots/Snipaste_2025-10-17_14-47-32.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/app.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/app.json5 deleted file mode 100644 index dd0fdf641f3d282c8309c2e06134647973c8b58f..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.hitracemeter_ndk", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/element/string.json deleted file mode 100644 index 2b9420b8bcf0521a4e4def618ee3bb74014688b5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "HitraceMeter_NDK" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/README_zh.md b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/README_zh.md deleted file mode 100644 index 1a81eab972ee9c660d12b44d27a694c3e5f29c90..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/README_zh.md +++ /dev/null @@ -1,103 +0,0 @@ -# HiTraceMeter NDK接口使用样例 - -### 介绍 - -本示例主要展示了使用HiTraceMeter提供系统性能打点接口。开发者通过在关键代码位置调用HiTraceMeter接口提供的API接口,能够有效跟踪进程轨迹、查看系统性能。 - -该工程中的展示的代码详细描述可查如下链接: - -- [使用HiTraceMeter跟踪性能(C/C++)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/dfx/hitracemeter-guidelines-ndk.md) - -### 效果预览 - -| 主页 | -| :----------------------------------------------------------------------------------: | -| `z` | - -#### 使用说明 - -1.在主界面点击Hello World文本;DevEco Studio Terminal 中执行如下命令: - -``` -PS D:\xxx\xxx> hdc shell -$ hitrace --trace_begin app -``` - -2.执行抓取trace命令后,先在设备中点击几次HiTraceMeter ArkTS按钮,继续在Terminal窗口执行命令: - -``` -$ hitrace --trace_dump | grep myTest -``` - -3.成功输出如下数据即为成功: - -``` -<...>-49837 (-------) [002] .... 349137.708093: tracing_mark_write: S|49837|H:myTestAsyncTrace|1001|M62|categoryTest|key=value -<...>-49837 (-------) [002] .... 349137.708103: tracing_mark_write: C|49837|H:myTestCountTrace|1|M62 -<...>-49837 (-------) [002] .... 349137.708201: tracing_mark_write: S|49837|H:myTestAsyncTrace|1002|M62|categoryTest|key=value -<...>-49837 (-------) [002] .... 349137.708209: tracing_mark_write: C|49837|H:myTestCountTrace|2|M62 -<...>-49837 (-------) [002] .... 349137.708239: tracing_mark_write: F|49837|H:myTestAsyncTrace|1001|M62 -<...>-49837 (-------) [002] .... 349137.708246: tracing_mark_write: F|49837|H:myTestAsyncTrace|1002|M62 -<...>-49837 (-------) [002] .... 349137.708252: tracing_mark_write: B|49837|H:myTestSyncTrace|M62|key=value -<...>-49837 (-------) [002] .... 349137.708301: tracing_mark_write: S|49837|H:myTestAsyncTrace|1003|M62|categoryTest|key0=value0,key1=value1,key2=value2,key3=value3,key4=value4,key5=value5,key6=value6,key7=value7,key8=value8,key9=value9 -<...>-49837 (-------) [002] .... 349137.708323: tracing_mark_write: F|49837|H:myTestAsyncTrace|1003|M62 -``` - -4. 停止采集trace - -``` -$ hitrace --trace_finish -``` - -### 工程目录 - -``` -└── entry - └── src - └── main - ├── cpp - │ ├── CMakeLists.txt - │ ├── napi_init.cpp - │ └── types - │ └── libentry - │ ├── Index.d.ts - │ └── oh-package.json5 - └── ets - ├── entryability - │ └── EntryAbility.ets - ├── entrybackupability - │ └── EntryBackupAbility.ets - └── pages - └── Index.ets -``` - -### 具体实现 - -1. ArkTS项目可以在"@kit.PerformanceAnalysisKit"中导入对应模块即可在各种场景下调用对应函数,如在index.ets中直接调用,或者在EntryAbility.ets函数中在应用的各个生命周期内添加功能函数以实现应用自动在“启动”或“结束”时进行性能分析。 -2. C++项目可以在CMakeLists.txt里的target_link_libraries中添加对应功能的包,在napi_init.cpp中添加注册自定义C++功能函数(还需在index.d.ts中声明)后,即可在各种场景下通过"libentry.so"库自定义一个对象来调用注册声明的测试函数即可。 - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机; -2. 本示例已适配API20版本SDK,版本号:6.0.0.47; -3. 本示例需要使用DevEco Studio(6.0.0.858)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/ > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/build-profile.json5 deleted file mode 100644 index f9f311acef30dae790bd712ea67cad948ca1d509..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0(20)", - "compileSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS" - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/.gitignore b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/build-profile.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/build-profile.json5 deleted file mode 100644 index f3d112306bd8c6ec733f59e86a9dd7450a60a8a8..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - }, - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/obfuscation-rules.txt b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/oh-package.json5 deleted file mode 100644 index 5d993e5251fd56950970aa593aefef1b8d71e976..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/CMakeLists.txt b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index b4a9f97420d22d618e19f4d0e50b1a5e42d97d7d..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# [Start hitracemeter_ndk_cmake_code] -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(HiTraceChainTest03) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libhitrace_ndk.z.so libhilog_ndk.z.so) -# [End hitracemeter_ndk_cmake_code] \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/napi_init.cpp b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 0629edeb9c7a42b66b42436a8137a4497af8e184..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start hitracemeter_ndk_native_code] -#include -#include - -#include "hilog/log.h" -#include "hitrace/trace.h" -#include "napi/native_api.h" - -#undef LOG_TAG -#define LOG_TAG "traceTest" - -static napi_value Add(napi_env env, napi_callback_info info) -{ - // 第一个异步跟踪任务开始 - HiTrace_Output_Level level = HITRACE_LEVEL_COMMERCIAL; - constexpr int64_t taskIdOne = 1001; - OH_HiTrace_StartAsyncTraceEx(level, "myTestAsyncTrace", taskIdOne, "categoryTest", "key=value"); - // 开始计数任务 - int64_t traceCount = 0; - traceCount++; - OH_HiTrace_CountTraceEx(level, "myTestCountTrace", traceCount); - // 业务流程 - OH_LOG_INFO(LogType::LOG_APP, "myTraceTest running, taskId: 1001"); - // 第二个异步跟踪任务开始,同时第一个跟踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同 - constexpr int64_t taskIdTwo = 1002; - OH_HiTrace_StartAsyncTraceEx(level, "myTestAsyncTrace", taskIdTwo, "categoryTest", "key=value"); - // 开始计数任务 - traceCount++; - OH_HiTrace_CountTraceEx(level, "myTestCountTrace", traceCount); - // 业务流程 - OH_LOG_INFO(LogType::LOG_APP, "myTraceTest running, taskId: 1002"); - - // 结束taskId为1001的异步跟踪任务 - OH_HiTrace_FinishAsyncTraceEx(level, "myTestAsyncTrace", taskIdOne); - // 结束taskId为1002的异步跟踪任务 - OH_HiTrace_FinishAsyncTraceEx(level, "myTestAsyncTrace", taskIdTwo); - - // 开始同步跟踪任务 - OH_HiTrace_StartTraceEx(level, "myTestSyncTrace", "key=value"); - // 业务流程 - OH_LOG_INFO(LogType::LOG_APP, "myTraceTest running, synchronizing trace"); - // 结束同步跟踪任务 - OH_HiTrace_FinishTraceEx(level); - - // 若通过HiTraceMeter性能打点接口传递的参数的生成过程比较复杂,此时可以通过isTraceEnabled判断当前是否开启应用trace捕获, - // 在未开启应用trace捕获时,避免该部分性能损耗 - constexpr int64_t taskIdThree = 1003; - constexpr int loopTime = 10; - if (OH_HiTrace_IsTraceEnabled()) { - char customArgs[128] = "key0=value0"; - for (int index = 1; index < loopTime; index++) { - char buffer[16]; - snprintf(buffer, sizeof(buffer), ",key%d=value%d", index, index); - strncat(customArgs, buffer, sizeof(customArgs) - strlen(customArgs) - 1); - } - OH_HiTrace_StartAsyncTraceEx(level, "myTestAsyncTrace", taskIdThree, "categoryTest", customArgs); - OH_LOG_INFO(LogType::LOG_APP, "myTraceTest running, taskId: 1003"); - OH_HiTrace_FinishAsyncTraceEx(level, "myTestAsyncTrace", taskIdThree); - } else { - OH_LOG_INFO(LogType::LOG_APP, "myTraceTest running, trace is not enabled"); - } - - size_t requireArgc = 2; - size_t argc = 2; - napi_value args[2] = {nullptr}; - - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - napi_valuetype valuetype0; - napi_typeof(env, args[0], &valuetype0); - - napi_valuetype valuetype1; - napi_typeof(env, args[1], &valuetype1); - - double value0; - napi_get_value_double(env, args[0], &value0); - - double value1; - napi_get_value_double(env, args[1], &value1); - - napi_value sum; - napi_create_double(env, value0 + value1, &sum); - - return sum; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "add", nullptr, Add, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} -// [End hitracemeter_ndk_native_code] \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/types/libentry/Index.d.ts b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 5c14affc63e0dc8a96335ff0c4f6256d392724e2..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const add: (a: number, b: number) => number; \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/types/libentry/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 846e4c7e13ead48abe6019bd40f3a13bf8f9c083..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/ets/entryability/EntryAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6a95f638674014a6d6088fb8a25f00854a309e53..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 1fca37ecc34e1079aaf6557f1272cd694aa0068c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/ets/pages/Index.ets b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 60dcb7ae52242195af7b5083378e9525b8766785..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'libentry.so'; - -const DOMAIN = 0x0000; - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - hilog.info(DOMAIN, 'testTag', 'Test NAPI 2 + 3 = %{public}d', testNapi.add(2, 3)); - }) - } - .width('100%') - } - .height('100%') - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/module.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/module.json5 deleted file mode 100644 index d700a40c54cefb5c84bb352cf7a89b37acd0f342..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "ohos.want.action.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/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/element/float.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/element/string.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/background.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/foreground.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/layered_image.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/startIcon.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/profile/backup_config.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/profile/main_pages.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/dark/element/color.json b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/mock/Libentry.mock.ets b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index eebf1ed910f6a8f2a9e7e565aa71b179b7b8b537..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/mock/mock-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/hvigor/hvigor-config.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/hvigor/hvigor-config.json5 deleted file mode 100644 index e0c92fdad58a7851692e144df9a4b1f4953ec26c..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/hvigorfile.ts b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/oh-package.json5 b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/oh-package.json5 deleted file mode 100644 index 34a126da756d306c9412997bcd7d57a34b6da0a2..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/ohosTest.md b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/ohosTest.md deleted file mode 100644 index 519de1061cdf567c9a47035833c781802f105b5a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 性能分析工具测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------ | ------------ | ---------------------- | ------------ | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 否 | Pass | -| 主页按钮点击 | 位于主页 | 按readme的使用说明操作 | 输出预期日志 | 否 | Pass | diff --git a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/screenshots/Snipaste_2025-10-17_14-47-32.png b/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/screenshots/Snipaste_2025-10-17_14-47-32.png deleted file mode 100644 index e1eadfca86e5990aa1c4787d69c3a805a22a9da3..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/HiTrace/HitraceMeter_NDK/screenshots/Snipaste_2025-10-17_14-47-32.png and /dev/null differ diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/.gitignore b/PerformanceAnalysisKit/PerformanceAnalysisTool/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/PerformanceAnalysisKit/PerformanceAnalysisTool/AppScope/app.json5 b/PerformanceAnalysisKit/PerformanceAnalysisTool/AppScope/app.json5 deleted file mode 100644 index b7c5ff9405cabf3ae674f418453df6325d1c78fc..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.performanceanalysistool", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/AppScope/resources/base/element/string.json b/PerformanceAnalysisKit/PerformanceAnalysisTool/AppScope/resources/base/element/string.json deleted file mode 100644 index d3d3d59b4a9553a2d1d4ee049eb97d05178641ca..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "PerformanceAnalysisTool" - } - ] -} diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/AppScope/resources/base/media/app_icon.png b/PerformanceAnalysisKit/PerformanceAnalysisTool/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/PerformanceAnalysisTool/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/README_zh.md b/PerformanceAnalysisKit/PerformanceAnalysisTool/README_zh.md deleted file mode 100644 index 241258e036ae4f266dced077293045312c953c1f..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/README_zh.md +++ /dev/null @@ -1,211 +0,0 @@ -# 性能分析工具 - -### 介绍 - -本示例主要展示了使用性能分析的各个工具接口: - -HiTraceMeter提供系统性能打点接口。开发者通过在关键代码位置调用HiTraceMeter接口提供的API接口,能够有效跟踪进程轨迹、查看系统性能。 - -HiTraceChain是基于云计算分布式跟踪调用链思想,在端侧业务流程(涉及跨线程、跨进程、跨设备)中的一种轻量级实现。hiTraceChain在业务控制面流程中,生成和传递唯一跟踪标识,在业务流程中输出的各类信息中(包括应用事件、系统时间、日志等)记录该跟踪标识。在调试、问题定位过程中,开发者可以通过该唯一跟踪标识将本次业务流程端到端的各类信息快速关联起来。 - -HiChecker可以作为应用开发阶段使用的检测工具,用于检测代码运行过程中部分易忽略的问题,如应用线程出现耗时调用、应用进程中元能力资源泄露等问题。开发者可以通过日志记录或进程crash等形式查看具体问题并进行修改,提升应用的使用体验。 - -HiDebug对外提供系统调试相关功能的接口,包括应用进程的静态堆内存(native heap)信息、应用进程内存占用PSS(Proportional Set Size)信息的获取等,也可完成虚拟机内存切片导出,虚拟机CPU Profiling采集等操作。 - -HiCollie模块对外提供检测业务线程卡死、卡顿,以及上报卡死事件的能力。 - -该工程中的展示的代码详细描述可查如下链接: - -- [使用HiTraceMeter跟踪性能(ArkTS/JS)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hitracemeter-guidelines-arkts.md) - -- [使用HiTraceMeter跟踪性能(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hitracemeter-guidelines-ndk.md) - -- [使用HiTraceChain打点(ArkTS/JS)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hitracechain-guidelines-arkts.md) - -- [使用HiTraceChain打点(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hitracechain-guidelines-ndk.md) - -- [使用HiChecker检测问题(ArkTS)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hichecker-guidelines-arkts.md) - -- [使用HiDebug获取调试信息(ArkTS)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hidebug-guidelines-arkts.md) - -- [使用HiDebug获取调试信息(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hidebug-guidelines-ndk.md) - -- [使用HiCollie检测业务线程卡死卡顿问题(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/dfx/hicollie-guidelines-ndk.md) - -### 效果预览 - -| 主页 | -| :----------------------------------------------------------: | -| z | - -#### 使用说明 - -##### 1.HiTraceMeter(ArkTS)使用说明 - -1.在主界面点击按钮;DevEco Studio Terminal 中执行如下命令: - -``` -PS D:\xxx\xxx> hdc shell -$ hitrace --trace_begin app -``` - -2.执行抓取trace命令后,先在设备中点击几次HiTraceMeter ArkTS按钮,继续在Terminal窗口执行命令: - -``` -$ hitrace --trace_dump | grep tracing_mark_write -$ hitrace --trace_finish -``` - -3.成功输出如下数据即为成功: - -``` -<...>-3310 (-------) [005] .... 351382.921936: tracing_mark_write: S|3310|H:myTraceTest 1001 -<...>-3310 (-------) [005] .... 351382.922233: tracing_mark_write: C|3310|H:myTestCount 1 -<...>-3310 (-------) [005] .... 351382.922138: tracing_mark_write: S|3310|H:myTraceTest 1002 -<...>-3310 (-------) [005] .... 351382.922233: tracing_mark_write: C|3310|H:myTestCount 2 -<...>-3310 (-------) [005] .... 351382.922165: tracing_mark_write: F|3310|H:myTestCount 1001 -<...>-3310 (-------) [005] .... 351382.922175: tracing_mark_write: F|3310|H:myTestCount 1002 -``` - -##### 2.HiTraceMeter(C++)使用说明 - -1.将编译好的hap包推送到设备上安装,在DevEco Studio Terminal中执行命令: - -``` -PS D:\xxx\xxx> hdc shell -$ hitrace --trace_begin app -``` - -2.执行抓取trace命令后,先在设备中点击几次HiTraceMeter C++按钮,然后在Terminal窗口执行命令: - -``` -$ hitrace --trace_dump | grep tracing_mark_write -``` - -3.成功输出如下数据即为成功: - -``` -<...>-2477 (-------) [001] .... 396.427165: tracing_mark_write: S|2477|H:hitraceTest 123 -<...>-2477 (-------) [001] .... 396.427196: tracing_mark_write: F|2477|H:hitraceTest 123 -``` - -##### 3.HiTraceChain(ArkTS)使用说明 - -1.在主界面点击HiTraceChain ArkTS按钮,然后切换到"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 -``` - -##### 4.HiTraceChain(C++)使用说明 - -1.在主界面点击HiTraceChain C++按钮,切换到"Log"窗口,日志过滤选择"No filters",搜索内容设置为"hitraceTest"。成功输出如下数据即为成功: - -``` -HiTraceBegin name:hitraceTest flags:0x00. -``` - -##### 5.HiChecker(ArkTS)使用说明 - -1.先在DevEco Studio Terminal 中执行如下命令: - -``` -PS D:\xxx\xxx> hdc shell -$ hilog|grep -i hichecker -``` - -2.hichecker功能调用写在应用启动时,启动应用时(注意要先执行上一步,如已经启动可以重新启动应用),Log窗口有如下调用栈信息说明检测成功,成功的数据如下所示: - -``` -01-05 19:40:22.837 7782 7782 I C02d0b/HICHECKER: HiChecker caution with RULE_CAUTION_PRINT_LOG. -01-05 19:40:22.837 7782 7782 I C02d0b/HICHECKER: CautionMsg:trigger:RULE_THREAD_CHECK_SLOW_PROCESS,Trigger: pid = 7782, tid = 7782 -01-05 19:40:22.837 7782 7782 I C02d0b/HICHECKER: StackTrace: -01-05 19:40:22.837 7782 7782 I C02d0b/HICHECKER: Tid:7782, Name:m.example.arkts -01-05 19:40:22.837 7782 7782 I C02d0b/HICHECKER: #00 pc 00002bad /system/lib/platformsdk/libhichecker.so(OHOS::HiviewDFX::HiChecker::NotifySlowProcess(std::__h::basic_string, std::__h::allocator> const&)+48)(d13fb7fce5b5364c7a3994c95f66c6c2) -01-05 19:40:22.837 7782 7782 I C02d0b/HICHECKER: #01 pc 000707cf /system/lib/platformsdk/libimage_napi.z.so(fd73ffee97d631ca6aebf63145d4abf5) -01-05 19:40:22.837 7782 7782 I C02d0b/HICHECKER: #02 pc 00073b4b /system/lib/platformsdk/libimage_napi.z.so(fd73ffee97d631ca6aebf63145d4abf5) -...... -``` - -##### 6.HiDebug(ArkTS)使用说明 - -1.在主界面,点击HiDebug ArkTS按钮;切换到"Log"窗口,日志过滤选择"No filters",搜索内容设置为"testTag"。成功输出如下数据即为成功: - -``` -GetSystemCpuUsage: 0.069260 -``` - -##### 7.HiDebug(C++)使用说明 - -1.在主界面,点击HiDebug C++按钮;切换到"Log"窗口,日志过滤选择"No filters",搜索内容设置为"testTag"。成功输出如下数据即为成功: - -``` -GetSystemCpuUsage: 0.078654 -``` - -##### 8.HiCollie(C++)使用说明 - -1.应用刚启动10s内,不进行卡顿检测,等待10s,再在主界面依次点击"testHiCollieJankNDK"按钮和"testHiCollieStuckNDK",切换到"Log"窗口,日志过滤选择"No filters",搜索内容设置为"testTag"。成功输出如下数据即为成功: - -``` -OH_HiCollie_Init_JankDetection: 0 -OH_HiCollie_Init_StuckDetection: 0 -``` - -生成栈文件目录地址:/data/app/el2/100/log/应用bundle name/watchdog/BUSSINESS_THREAD_JANK_XXX.txt。 - -### 工程目录 - -``` -entry/src/main -├─cpp -│ ├─CMakeLists.txt //导入so链接 -│ └─napi_init.cpp //C++功能函数 -└─ets - └─entryability - │ └─EntryAbility.ets //生命周期 - └─pages - └─Index.ets //主页 -``` - -### 具体实现 - -1. ArkTS项目可以在"@kit.PerformanceAnalysisKit"中导入对应模块即可在各种场景下调用对应函数,如在index.ets中直接调用,或者在EntryAbility.ets函数中在应用的各个生命周期内添加功能函数以实现应用自动在“启动”或“结束”时进行性能分析。 -1. C++项目可以在CMakeLists.txt里的target_link_libraries中添加对应功能的包,在napi_init.cpp中添加注册自定义C++功能函数(还需在index.d.ts中声明)后,即可在各种场景下通过"libentry.so"库自定义一个对象来调用注册声明的测试函数即可。 - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568; -2. 本示例已适配API14版本SDK,版本号: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/PerformanceAnalysisTool/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` - diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/build-profile.json5 b/PerformanceAnalysisKit/PerformanceAnalysisTool/build-profile.json5 deleted file mode 100644 index 5f84e07910e435c25299194dc4abd35d815ff629..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/.gitignore b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/build-profile.json5 b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/build-profile.json5 deleted file mode 100644 index 54378f896f400c96d4c56aea9c74f7646cd2976e..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/build-profile.json5 +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64","armeabi-v7a"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": true, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/hvigorfile.ts b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/obfuscation-rules.txt b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/obfuscation-rules.txt deleted file mode 100644 index fdbb5b9852d7dd5f39bddaeb21ab5ee1f3346749..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/obfuscation-rules.txt +++ /dev/null @@ -1,22 +0,0 @@ -# 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/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/oh-package.json5 b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/CMakeLists.txt b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index caf71c703b92402613471f35e7b162e0978dd7e8..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(CPP2) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libohhidebug.so libhitrace_ndk.z.so libhilog_ndk.z.so - libohhicollie.so) \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/napi_init.cpp b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 4cb7ea50efdad4aee8a7cda211a3a0a5f00152c2..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start napi_Header] -#include "napi/native_api.h" -#include "hitrace/trace.h" -#include "hilog/log.h" -#include "hidebug/hidebug.h" -#include "hicollie/hicollie.h" -#include -#include -#include -#include - -#undef LOG_TAG -#define LOG_TAG "testTag" -// [End napi_Header] -// [Start HiCollie] -static OH_HiCollie_BeginFunc beginFunc_; // 定义回调函数对象 -static OH_HiCollie_EndFunc endFunc_; // 定义回调函数对象 -HiCollie_DetectionParam param{.sampleStackTriggerTime = 150, .reserved = 0}; // 定义结构体 -int64_t g_lastWatchTime = 0; // 记录上次卡死检测时间 -const int64_t CHECK_INTERNAL_TIME = 3000; // 设置卡死检测间隔 -std::shared_ptr> isReport = std::make_shared>(false); // 设置上报卡死事件标志位 -int g_count = 0; // 记录第一次初始化 -bool g_needReport = false; // 根据实际场景,设置是否上报标志 - -// 定义回调函数 -void InitBeginFunc(const char *eventName) -{ - std::string str(eventName); - OH_LOG_INFO(LogType::LOG_APP, "InitBeginFunc eventName: %{public}s", str.c_str()); -} -void InitEndFunc(const char *eventName) -{ - std::string str(eventName); - OH_LOG_INFO(LogType::LOG_APP, "OH_HiCollie_EndFunc eventName: %{public}s", str.c_str()); -} -// 定义子线程回调函数 -void TestJankDetection() -{ - beginFunc_ = InitBeginFunc; // 初始化回调函数 - endFunc_ = InitEndFunc; - int initResult = OH_HiCollie_Init_JankDetection(&beginFunc_, &endFunc_, param); // 初始化线程卡顿监控函数 - OH_LOG_INFO(LogType::LOG_APP, "OH_HiCollie_Init_JankDetection: %{public}d", initResult); // 成功结果:0 - int countOuter = 0; - const int loopLimit = 2; //循环次数限制 - const int sleepTime = 350 * 1000; //睡眠时间350ms,模拟任务线程处理事件卡顿场景 - while (countOuter < loopLimit) { - beginFunc_("TestBegin"); // 设置处理开始回调函数,监控线程任务执行开始时长 - usleep(sleepTime); - endFunc_("TestEnd"); // 设置处理结束回调函数,监控线程任务执行结束时长 - countOuter++; - } -} - -static napi_value TestHiCollieJankNdk(napi_env env, napi_callback_info info) -{ - std::thread threadObj(TestJankDetection); // 创建子线程 - threadObj.join(); // 执行回调函数 - return 0; -} - -int64_t GetCurrentTime() -{ - return std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()) - .count(); -} - -bool ReportEvent() -{ - if ((GetCurrentTime() - g_lastWatchTime) > CHECK_INTERNAL_TIME) { - return true; - } - return false; -} - -void TestTask() -{ - if (g_needReport && ReportEvent()) { - bool temp = isReport->load(); - int reportResult = OH_HiCollie_Report(&temp); - OH_LOG_INFO(LogType::LOG_APP, "OH_HiCollie_Report: %{public}d", reportResult); // 成功结果:0 - OH_LOG_INFO(LogType::LOG_APP, "OH_HiCollie_Report isReport: %{public}d", temp); - g_needReport = false; - } - int64_t now = GetCurrentTime(); - int64_t halfCheckInterval = CHECK_INTERNAL_TIME / 2; - if ((now - g_lastWatchTime) >= (halfCheckInterval)) { - g_lastWatchTime = now; - } -} - -// 定义子线程回调函数 -void TestStuckDetection() -{ - int initResult = -1; - if (g_count == 0) { - initResult = OH_HiCollie_Init_StuckDetection(TestTask); // 初始化线程卡死监控函数 - OH_LOG_INFO(LogType::LOG_APP, "OH_HiCollie_Init_StuckDetection: %{public}d", initResult); // 成功结果:0 - g_count++; - } -} -static napi_value TestHiCollieStuckNdk(napi_env env, napi_callback_info info) -{ - std::thread threadObj(TestStuckDetection); // 创建子线程 - threadObj.join(); // 执行回调函数 - return 0; -} -// [End HiCollie] -// [Start HiTraceMeterNDK] -static napi_value TestHiTraceMeterNDK(napi_env env, napi_callback_info info) -{ - // 测试标记数 - int testNum = 123; - // 需要开启异步时间片跟踪的地方 - OH_HiTrace_StartAsyncTrace("hitraceTest", testNum); - // 需要结束异步时间片跟踪的地方(此处为示例,开启点和结束点按实际需求放在需要的地方) - OH_HiTrace_FinishAsyncTrace("hitraceTest", testNum); - return 0; -} -// [End HiTraceMeterNDK] -// [Start HiTraceChainNDK] -static napi_value TestHiTraceChainNDK(napi_env env, napi_callback_info info) -{ - // 需要开启分布式跟踪的地方 - OH_HiTrace_BeginChain("hitraceTest", HITRACE_FLAG_DEFAULT); - // 需要结束分布式跟踪的地方(此处为示例,开启点和结束点按实际需求放在需要的地方) - OH_HiTrace_EndChain(); - return 0; -} -// [End HiTraceChainNDK] -// [Start TestHidebugNdk] -static napi_value TestHidebugNdk(napi_env env, napi_callback_info info) -{ - double cpuUsage = OH_HiDebug_GetSystemCpuUsage(); - OH_LOG_INFO(LogType::LOG_APP, "GetSystemCpuUsage: %{public}f", cpuUsage); - return 0; -} -// [End TestHidebugNdk] -EXTERN_C_START -// [Start Init_All] -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "testHidebugNdk", nullptr, TestHidebugNdk, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "testHiTraceMeterNDK", nullptr, TestHiTraceMeterNDK, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "testHiTraceChainNDK", nullptr, TestHiTraceChainNDK, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "testHiCollieJankNdk", nullptr, TestHiCollieJankNdk, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "testHiCollieStuckNdk", nullptr, TestHiCollieStuckNdk, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -// [End Init_All] -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/types/libentry/Index.d.ts b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 80cf8933153351d6b66fd5cf60931e88765dde21..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start Project_Index.d.ts] -export const testHiCollieJankNdk: () => void; -export const testHiCollieStuckNdk: () => void; -export const testHiTraceMeterNDK: () => void; -export const testHiTraceChainNDK: () => void; -export const testHidebugNdk: () => void; -// [End Project_Index.d.ts] \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/types/libentry/oh-package.json5 b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/ets/entryability/EntryAbility.ets b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index bc49539458b021f759d9440c4d3edc25dd93ffa9..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start HiChecker] -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hichecker, hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; -import { image } from '@kit.ImageKit'; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - // 添加检测规则,规则意义见检测模式API参考 - hichecker.addCheckRule(hichecker.RULE_CAUTION_PRINT_LOG|hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); - let filePath: string = this.context.cacheDir + '/test.JPG'; - const imageSourceApi: image.ImageSource = image.createImageSource(filePath); - const imagePackerApi = image.createImagePacker(); - let packOpts: image.PackingOption = { format:"image/jpeg", quality:98 }; - imagePackerApi.packing(imageSourceApi, packOpts); - // 以上5行通过image子系统触发检测规则 - 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'); - } -}; -// [End HiChecker] \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/ets/pages/Index.ets b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index c51910f37d7543e18ff3510fc7b22f111f276b59..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start Project_Header] -import { hilog, hiTraceMeter, hiTraceChain, hidebug, hiAppEvent } from '@kit.PerformanceAnalysisKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import testNapi from 'libentry.so'; -// [End Project_Header] -// [Start testHidebug] -function testHidebug(event?: ClickEvent) { - try { - hilog.info(0x0000, 'testTag', `getSystemCpuUsage ${hidebug.getSystemCpuUsage()}`); - } catch (err) { - hilog.error(0x0000, 'testTag', `error message is ${(err as BusinessError).message}`); - } -} -// [End testHidebug] -@Entry -@Component -struct Index { - build() { - Row() { - Column() { - // [Start HiTraceMeterArkTS_Button] - Button($r('app.string.HiTraceMeterArkTS_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('60%') - .height('5%') - .onClick(() => { - let traceCount = 0; - // 第一个跟踪任务开始 - hiTraceMeter.startTrace("myTraceTest", 1001); - // 开始计数任务 - traceCount++; - hiTraceMeter.traceByValue("myTestCount", traceCount); - // 业务流程 - console.log(`myTraceTest running, taskid: 1001`); - // 第二个跟踪任务开始,同时第一个跟踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同。 - hiTraceMeter.startTrace("myTraceTest", 1002); - // 开始计数任务 - traceCount++; - hiTraceMeter.traceByValue("myTestCount", traceCount); - // 业务流程 - console.log(`myTraceTest running, taskid: 1002`); - // 结束taskId为1001的跟踪任务 - hiTraceMeter.finishTrace("myTraceTest", 1001); - // 结束taskId为1002的跟踪任务 - hiTraceMeter.finishTrace("myTraceTest", 1002); - }) - // [End HiTraceMeterArkTS_Button] - // [Start HiTraceChainArkTS_Button] - Button($r('app.string.HiTraceChainArkTS_Button')) - .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}`); - } - }) - // [End HiTraceChainArkTS_Button] - // [Start HiDebugArkTS_Button] - Button($r('app.string.HiDebugArkTS_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('60%') - .height('5%') - // 添加点击事件 - .onClick(testHidebug); - // [End HiDebugArkTS_Button] - Button($r('app.string.HiCheckerArkTS_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('60%') - .height('5%') - } - .width('50%') - - Column() { - Button($r('app.string.HiTraceMeterCPP_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('60%') - .height('5%') - .onClick(() => { - hilog.info(0x0000, 'testTag', 'HiTraceMeter C++', testNapi.testHiTraceMeterNDK()); - }) - // [Start HiTraceChainCPP_Button] - Button($r('app.string.HiTraceChainCPP_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('60%') - .height('5%') - .onClick(() => { - hilog.info(0x0000, 'testTag', 'HiTraceChain C++', testNapi.testHiTraceChainNDK()); - }) - // [End HiTraceChainCPP_Button] - // [Start HiDebugCPP_Button] - Button($r('app.string.HiDebugCPP_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('60%') - .height('5%') - // 添加点击事件,触发testHidebugNdk方法。 - .onClick(testNapi.testHidebugNdk); - // [End HiDebugCPP_Button] - // [Start HiCollie_Buttons] - Button($r('app.string.TestHiCollieJankNdk_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('60%') - .height('5%') - // 添加点击事件,触发testHiCollieJankNdk方法 - .onClick(testNapi.testHiCollieJankNdk); - - Button($r('app.string.TestHiCollieStuckNdk_Button')) - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('60%') - .height('5%') - // 添加点击事件,触发testHiCollieStuckNdk方法 - .onClick(testNapi.testHiCollieStuckNdk); - // [End HiCollie_Buttons] - } - .width('50%') - } - .height('100%') - } -} diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/module.json5 b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/module.json5 deleted file mode 100644 index 4144486d1af4c03b0d767cce1cda86fc0d697f91..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/element/color.json b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/element/string.json b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 4596ea75d36df620d81e1edd6cd22e6a475579fe..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "PerformanceAnalysis" - }, - { - "name": "HiTraceMeterArkTS_Button", - "value": "HiTraceMeter ArkTS" - }, - { - "name": "HiCheckerArkTS_Button", - "value": "HiChecker ArkTS" - }, - { - "name": "HiTraceMeterCPP_Button", - "value": "HiTraceMeter C++" - }, - { - "name": "HiDebugArkTS_Button", - "value": "HiDebug ArkTS" - }, - { - "name": "HiTraceChainArkTS_Button", - "value": "HiTraceChain ArkTS" - }, - { - "name": "HiTraceChainCPP_Button", - "value": "HiTraceChain C++" - }, - { - "name": "HiDebugCPP_Button", - "value": "HiDebug C++" - }, - { - "name": "TestHiCollieJankNdk_Button", - "value": "testHiCollieJankNdk" - }, - { - "name": "TestHiCollieStuckNdk_Button", - "value": "testHiCollieStuckNdk" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/background.png b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/foreground.png b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/layered_image.json b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/startIcon.png b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/profile/backup_config.json b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/profile/main_pages.json b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/en_US/element/string.json b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 81ad948420a1099cf45347304b9cfa78259a3d2a..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "PerformanceAnalysis" - }, - { - "name": "HiTraceMeterArkTS_Button", - "value": "HiTraceMeter ArkTS" - }, - { - "name": "HiTraceChainArkTS_Button", - "value": "HiTraceChain ArkTS" - }, - { - "name": "HiDebugArkTS_Button", - "value": "HiDebug ArkTS" - }, - { - "name": "HiCheckerArkTS_Button", - "value": "HiChecker ArkTS" - }, - { - "name": "HiTraceMeterCPP_Button", - "value": "HiTraceMeter C++" - }, - { - "name": "HiTraceChainCPP_Button", - "value": "HiTraceChain C++" - }, - { - "name": "HiDebugCPP_Button", - "value": "HiDebug C++" - }, - { - "name": "TestHiCollieJankNdk_Button", - "value": "testHiCollieJankNdk" - }, - { - "name": "TestHiCollieStuckNdk_Button", - "value": "testHiCollieStuckNdk" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/zh_CN/element/string.json b/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index b6d9094a1dec50d45253440d187ba073e440a313..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "性能分析" - }, - { - "name": "HiTraceMeterArkTS_Button", - "value": "HiTraceMeter ArkTS" - }, - { - "name": "HiTraceChainArkTS_Button", - "value": "HiTraceChain ArkTS" - }, - { - "name": "HiDebugArkTS_Button", - "value": "HiDebug ArkTS" - }, - { - "name": "HiCheckerArkTS_Button", - "value": "HiChecker ArkTS" - }, - { - "name": "HiTraceMeterCPP_Button", - "value": "HiTraceMeter C++" - }, - { - "name": "HiTraceChainCPP_Button", - "value": "HiTraceChain C++" - }, - { - "name": "HiDebugCPP_Button", - "value": "HiDebug C++" - }, - { - "name": "TestHiCollieJankNdk_Button", - "value": "testHiCollieJankNdk" - }, - { - "name": "TestHiCollieStuckNdk_Button", - "value": "testHiCollieStuckNdk" - } - ] -} \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/hvigor/hvigor-config.json5 b/PerformanceAnalysisKit/PerformanceAnalysisTool/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/PerformanceAnalysisTool/hvigorfile.ts b/PerformanceAnalysisKit/PerformanceAnalysisTool/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/PerformanceAnalysisTool/oh-package.json5 b/PerformanceAnalysisKit/PerformanceAnalysisTool/oh-package.json5 deleted file mode 100644 index 952ab183532e81c9c50e5de1e64393704e1e48fe..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/PerformanceAnalysisKit/PerformanceAnalysisTool/ohosTest.md b/PerformanceAnalysisKit/PerformanceAnalysisTool/ohosTest.md deleted file mode 100644 index ceb8bc593156530ee1566d31ac1b16c3b1e68cf0..0000000000000000000000000000000000000000 --- a/PerformanceAnalysisKit/PerformanceAnalysisTool/ohosTest.md +++ /dev/null @@ -1,8 +0,0 @@ -# 性能分析工具测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------ | ------------ | ------------------------------ | ------------ | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 否 | Pass | -| 主页按钮点击 | 位于主页 | 按readme的使用说明依次点击按钮 | 输出预期日志 | 否 | Pass | \ No newline at end of file diff --git a/PerformanceAnalysisKit/PerformanceAnalysisTool/screenshots/Screenshot_20241217162307411.jpeg b/PerformanceAnalysisKit/PerformanceAnalysisTool/screenshots/Screenshot_20241217162307411.jpeg deleted file mode 100644 index d56ad50fa9534d3e4e1b079fd941e3ab741358d0..0000000000000000000000000000000000000000 Binary files a/PerformanceAnalysisKit/PerformanceAnalysisTool/screenshots/Screenshot_20241217162307411.jpeg and /dev/null differ diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 89faa584f4f791b1429f4556d27624aeaa95bcf8..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# HarmonyOSGuideSnippets - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 1103f03de77b1970fdd2b458d605706d82908a9b..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# HarmonyOSGuideSnippets - -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/Security/AssetStoreKit/AssetStoreArkTS/AppScope/app.json5 b/Security/AssetStoreKit/AssetStoreArkTS/AppScope/app.json5 deleted file mode 100644 index 99212d17bf66b240dfdae3e43e6bb37315d8cfb2..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/AppScope/app.json5 +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.assetstoreproject", - "assetAccessGroups": [ - "demo_group_id", - ], - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/Security/AssetStoreKit/AssetStoreArkTS/AppScope/resources/base/element/string.json b/Security/AssetStoreKit/AssetStoreArkTS/AppScope/resources/base/element/string.json deleted file mode 100644 index f5ec105027da1aaaf7d29c0eb99bca11e436cf06..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AssetStoreProject" - } - ] -} diff --git a/Security/AssetStoreKit/AssetStoreArkTS/AppScope/resources/base/media/app_icon.png b/Security/AssetStoreKit/AssetStoreArkTS/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreArkTS/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreArkTS/LICENSE b/Security/AssetStoreKit/AssetStoreArkTS/LICENSE deleted file mode 100644 index 18795a48d6b12fcdc1aa7bac9a9cb99f83815267..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/LICENSE +++ /dev/null @@ -1,78 +0,0 @@ - Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved. - - 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. - -Apache License, Version 2.0 -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: -1.You must give any other recipients of the Work or Derivative Works a copy of this License; and -2.You must cause any modified files to carry prominent notices stating that You changed the files; and -3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and -4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - -You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/README.en.md b/Security/AssetStoreKit/AssetStoreArkTS/README.en.md deleted file mode 100644 index 5d79fff290f148f867d9576f50c37674f9c889ed..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/README.en.md +++ /dev/null @@ -1,76 +0,0 @@ -# Asset Store Kit Development (ArkTS) - -### Introduction - -Asset Store Kit (ASSET for short) provides a series of open APIs to securely store and manage short sensitive data, including but not limited to passwords (accounts/passwords), tokens (application credentials), and important plaintext (such as bank card numbers). - -This sample primarily demonstrates scenarios from the Asset Store Kit Development (ArkTS), including adding, deleting, updating, and querying assets. The detailed description of the code demonstrated in this project can be found via the following links. - -- [Adding an Asset (ArkTS)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-js-add.md) -- [Removing Assets (ArkTS)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-js-remove.md) -- [Updating an Asset (ArkTS)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-js-update.md) -- [Querying Assets (ArkTS)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-js-query.md) -- [Querying an Asset with User Authentication (ArkTS)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-js-query-auth.md) -- [Managing Assets in a Group (ArkTS)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-js-group-access-control.md) -- [Syncing Assets (Backup and Restore) (ArkTS)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-js-sync.md) - -### Preview - -| Home Page | Execution Result | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| | | - -### How to Use - -1. Run the app. -2. The page will display the effect shown in the Home Page above. Click the buttons to manage assets correspondingly. Note that the 'Query User-Auth Asset' button requires a lock screen password to be set for a successful query. - -### Project Directory - -``` -entry/src/ - ├── main - ├── ets - │ ├── entryability - │ ├── entrybackupability - │ ├── operations // Asset Store Kit Development (ArkTS) Sample Code - │ ├── add.ets - │ ├── add_auth.ets - │ ├── add_group.ets - │ ├── add_sync.ets - │ ├── index.ets - │ ├── query_attr.ets - │ ├── query_auth.ets - │ ├── query_batch_attrs.ets - │ ├── query_group_attr.ets - │ ├── query_group_plaintext.ets - │ ├── query_plaintext.ets - │ ├── query_sync_result.ets - │ ├── remove.ets - │ ├── remove_auth.ets - │ ├── remove_group.ets - │ ├── update.ets - │ ├── update_group.ets - │ ├── pages - │ ├── Index.ets - ├── module.json5 - └── resources -``` - -### Required Permissions - -ohos.permission.ACCESS_BIOMETRIC - -### Dependencies - -N/A - -### Constraints and Limitations - -1.The sample app is supported only on Huawei phones running the standard system. - -2.The HarmonyOS version must be HarmonyOS 6.0.0 or later. - -3.The DevEco Studio version must be DevEco Studio 6.0.0 Release or later. - -4.The HarmonyOS SDK version must be HarmonyOS 6.0.0 Release or later. \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/README.md b/Security/AssetStoreKit/AssetStoreArkTS/README.md deleted file mode 100644 index 4907def318ed3bf49390e2af2629d137056fe54f..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# Asset Store Kit开发指导(ArkTS) - -### 介绍 - -Asset Store Kit(关键资产存储开发套件)包含了关键资产存储服务(ASSET)开放的接口能力集合,提供了用户短敏感数据的安全存储及管理能力。其中,短敏感数据可以是密码类(账号/密码)、Token类(应用凭据)、关键明文(如银行卡号)等长度较短的用户敏感数据。 - -本示例主要展示了Asset Store Kit开发指导(ArkTS)中新增关键资产、删除关键资产、更新关键资产、查询关键资产等场景。该工程中展示的代码详细描述可查如下链接中业务扩展场景介绍部分。 - -- [新增关键资产(ArkTS)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-js-add.md) -- [删除关键资产(ArkTS)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-js-remove.md) -- [更新关键资产(ArkTS)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-js-update.md) -- [查询关键资产(ArkTS)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-js-query.md) -- [查询需要用户的关键资产(ArkTS)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-js-query-auth.md) -- [管理群组关键资产(ArkTS)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-js-group-access-control.md) -- [同步(备份恢复)关键资产(ArkTS)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-js-sync.md) - -### 效果预览 - -| 首页效果图 | 执行结果图 | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| | | - -### 使用说明 - -1. 运行Index主界面。 -2. 页面呈现为上述首页效果图,点击对应文本的按钮可以管理关键资产,其中'Query User-Auth Asset'按钮需要设置锁屏密码才能查询成功。 - -### 工程目录 - -``` -entry/src/ - ├── main - ├── ets - │ ├── entryability - │ ├── entrybackupability - │ ├── operations // Asset Store Kit开发指导(ArkTS)示例代码 - │ ├── add.ets - │ ├── add_auth.ets - │ ├── add_group.ets - │ ├── add_sync.ets - │ ├── index.ets - │ ├── query_attr.ets - │ ├── query_auth.ets - │ ├── query_batch_attrs.ets - │ ├── query_group_attr.ets - │ ├── query_group_plaintext.ets - │ ├── query_plaintext.ets - │ ├── query_sync_result.ets - │ ├── remove.ets - │ ├── remove_auth.ets - │ ├── remove_group.ets - │ ├── update.ets - │ ├── update_group.ets - │ ├── pages - │ ├── Index.ets - ├── module.json5 - └── resources -``` - -### 相关权限 - -ohos.permission.ACCESS_BIOMETRIC - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:华为手机。 - -2.HarmonyOS系统:HarmonyOS 6.0.0及以上。 - -3.DevEco Studio版本:DevEco Studio 6.0.0 Release及以上。 - -4.HarmonyOS SDK版本:HarmonyOS 6.0.0 Release SDK及以上。 \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/build-profile.json5 b/Security/AssetStoreKit/AssetStoreArkTS/build-profile.json5 deleted file mode 100644 index ae905ecf15e4456dfe32b6a9315813dc24a64f40..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/build-profile.json5 b/Security/AssetStoreKit/AssetStoreArkTS/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/hvigorfile.ts b/Security/AssetStoreKit/AssetStoreArkTS/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/AssetStoreKit/AssetStoreArkTS/entry/oh-package.json5 b/Security/AssetStoreKit/AssetStoreArkTS/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/entryability/EntryAbility.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index edc2839f203ba057c186e19b0cbbbf80c8faa8b3..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add.ets deleted file mode 100644 index a119cb397f636fa635f64234871fe6102b06c2e0..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start add_asset] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function addAsset(): Promise { - let result: string = ''; - let attr: asset.AssetMap = new Map(); - attr.set(asset.Tag.SECRET, stringToArray('demo_pwd')); - attr.set(asset.Tag.ALIAS, stringToArray('demo_alias')); - attr.set(asset.Tag.ACCESSIBILITY, asset.Accessibility.DEVICE_FIRST_UNLOCKED); - attr.set(asset.Tag.DATA_LABEL_NORMAL_1, stringToArray('demo_label')); - try { - await asset.add(attr).then(() => { - console.info(`Succeeded in adding Asset.`); - result = 'Succeeded in adding Asset'; - }).catch((err: BusinessError) => { - console.error(`Failed to add Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to add Asset'; - }) - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to add Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to add Asset'; - } - return result; -} -// [End add_asset] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add_auth.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add_auth.ets deleted file mode 100644 index 9a4bf5aa1199541d1f0cd4d05c125753092d9623..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add_auth.ets +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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 { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function addUserAuthAsset(): Promise { - let result: string = ''; - let attr: asset.AssetMap = new Map(); - attr.set(asset.Tag.SECRET, stringToArray('demo_pwd')); - attr.set(asset.Tag.ALIAS, stringToArray('user_auth_asset')); - attr.set(asset.Tag.ACCESSIBILITY, asset.Accessibility.DEVICE_FIRST_UNLOCKED); - attr.set(asset.Tag.DATA_LABEL_NORMAL_1, stringToArray('demo_label')); - attr.set(asset.Tag.AUTH_TYPE, asset.AuthType.ANY); - try { - await asset.add(attr).then(() => { - console.info(`Succeeded in adding Asset.`); - result = 'Succeeded in adding user-auth Asset'; - }).catch((err: BusinessError) => { - console.error(`Failed to add Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to add Asset'; - }) - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to add Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to add Asset'; - } - return result; -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add_group.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add_group.ets deleted file mode 100644 index aacd0dbaf639e22fc3ac003ad1de8b05a7ce5be6..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add_group.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start add_group_asset] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function addGroupAsset(): Promise { - let result: string = ''; - let attr: asset.AssetMap = new Map(); - attr.set(asset.Tag.SECRET, stringToArray('demo_pwd')); - attr.set(asset.Tag.ALIAS, stringToArray('demo_alias')); - attr.set(asset.Tag.DATA_LABEL_NORMAL_1, stringToArray('demo_label')); - attr.set(asset.Tag.GROUP_ID, stringToArray('demo_group_id')); - try { - await asset.add(attr).then(() => { - console.info(`Succeeded in adding Asset to the group.`); - result = 'Succeeded in adding Asset to the group'; - }).catch((err: BusinessError) => { - console.error(`Failed to add Asset to the group. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to add Asset to the group'; - }) - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to add Asset to the group. Code is ${err?.code}, message is ${err?.message}`); - result = 'Failed to add Asset to the group'; - } - return result; -} -// [End add_group_asset] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add_sync.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add_sync.ets deleted file mode 100644 index 851195d2ab9baa049a14e43f8423d8e38e3f5dbe..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/add_sync.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start add_sync_asset] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function addSyncAsset(): Promise { - let result: string = ''; - let attr: asset.AssetMap = new Map(); - attr.set(asset.Tag.SECRET, stringToArray('demo_pwd')); - attr.set(asset.Tag.ALIAS, stringToArray('demo_alias')); - attr.set(asset.Tag.DATA_LABEL_NORMAL_1, stringToArray('demo_label')); - attr.set(asset.Tag.SYNC_TYPE, asset.SyncType.TRUSTED_DEVICE); // 需指定在可信设备间同步(如新旧设备间克隆)。 - - try { - await asset.add(attr).then(() => { - console.info(`Succeeded in adding Asset with sync.`); - result = 'Succeeded in adding Asset with sync'; - }).catch((err: BusinessError) => { - console.error(`Failed to add Asset with sync. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to add Asset with sync'; - }) - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to add Asset with sync. Code is ${err?.code}, message is ${err?.message}`); - result = 'Failed to add Asset with sync'; - } - return result; -} -// [End add_sync_asset] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/index.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/index.ets deleted file mode 100644 index ab659b1076677a7d3d1955b488ca815ce03ed3b1..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/index.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export { addAsset } from './add'; -export { removeAsset } from './remove'; -export { updateAsset } from './update'; -export { queryAssetPlaintext } from './query_plaintext'; -export { queryAssetAttribute } from './query_attr'; -export { queryBatchAssetAttributes } from './query_batch_attrs'; -export { addUserAuthAsset } from './add_auth'; -export { removeUserAuthAsset } from './remove_auth'; -export { queryUserAuthAsset } from './query_auth'; -export { addGroupAsset } from './add_group'; -export { removeGroupAsset } from './remove_group'; -export { updateGroupAsset } from './update_group'; -export { queryGroupAssetPlaintext } from './query_group_plaintext'; -export { queryGroupAssetAttribute } from './query_group_attr' -export { addSyncAsset } from './add_sync'; -export { querySyncResult } from './query_sync_result'; \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_attr.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_attr.ets deleted file mode 100644 index 6382d613a8509a4d1a42bda584e06d545b8d2823..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_attr.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start query_single_attribute] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function queryAssetAttribute(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); // 指定了关键资产别名,最多查询到一条满足条件的关键资产 - query.set(asset.Tag.RETURN_TYPE, asset.ReturnType.ATTRIBUTES); // 此处表示仅返回关键资产属性,不包含关键资产明文 - try { - await asset.query(query).then((res: Array) => { - for (let i = 0; i < res.length; i++) { - // 解析属性。 - let accessibility: number = res[i].get(asset.Tag.ACCESSIBILITY) as number; - console.info(`Succeeded in getting accessibility, which is: ${accessibility}.`); - } - result = 'Succeeded in querying Asset attribute'; - }).catch((err: BusinessError) => { - console.error(`Failed to query Asset attribute. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query Asset attribute'; - }); - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to query Asset attribute. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query Asset attribute'; - } - return result; -} -// [End query_single_attribute] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_auth.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_auth.ets deleted file mode 100644 index 4b997a74b65b8beb7fe79fec120336579ecc3d42..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_auth.ets +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start query_user_auth_asset] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { userAuth } from '@kit.UserAuthenticationKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -function arrayToString(arr: Uint8Array): string { - let textDecoder = util.TextDecoder.create('utf-8', { ignoreBOM: true }); - let str = textDecoder.decodeToString(arr, { stream: false }); - return str; -} - -export async function userAuthenticate(challenge: Uint8Array): Promise { - return new Promise((resolve, reject) => { - const authParam: userAuth.AuthParam = { - challenge: challenge, - authType: [userAuth.UserAuthType.PIN], - authTrustLevel: userAuth.AuthTrustLevel.ATL1, - }; - const widgetParam: userAuth.WidgetParam = { title: '请输入锁屏密码' }; - try { - let userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - userAuthInstance.on('result', { - onResult(result) { - if (result.result == userAuth.UserAuthResultCode.SUCCESS) { - console.info(`User identity authentication succeeded.`); - resolve(result.token); - } else { - console.error(`User identity authentication failed.`); - reject(); - } - } - }); - userAuthInstance.start(); - } catch (error) { - let err = error as BusinessError; - console.error(`User identity authentication failed. Code is ${err.code}, message is ${err.message}`); - reject(); - } - }) -} - -function preQueryAsset(): Promise { - return new Promise((resolve, reject) => { - try { - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('user_auth_asset')); - asset.preQuery(query).then((challenge: Uint8Array) => { - resolve(challenge); - }).catch(() => { - reject(); - }) - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to pre-query Asset. Code is ${err.code}, message is ${err.message}`); - reject(); - } - }); -} - -async function postQueryAsset(challenge: Uint8Array) { - let handle: asset.AssetMap = new Map(); - handle.set(asset.Tag.AUTH_CHALLENGE, challenge); - try { - await asset.postQuery(handle); - console.info(`Succeeded in post-querying Asset.`); - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to post-query Asset. Code is ${err.code}, message is ${err.message}`); - } -} - -export async function queryUserAuthAsset(): Promise { - let result: string = ''; - // step1. 调用asset.preQuery获取挑战值。 - await preQueryAsset().then(async (challenge: Uint8Array) => { - try { - // step2. 传入挑战值,拉起用户认证框。 - let authToken: Uint8Array = await userAuthenticate(challenge); - // step3 用户认证通过后,传入挑战值和授权令牌,查询关键资产明文。 - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('user_auth_asset')); - query.set(asset.Tag.RETURN_TYPE, asset.ReturnType.ALL); - query.set(asset.Tag.AUTH_CHALLENGE, challenge); - query.set(asset.Tag.AUTH_TOKEN, authToken); - let res: asset.AssetMap[] = await asset.query(query); - for (let i = 0; i < res.length; i++) { - // 解析secret。 - let secret: Uint8Array = res[i].get(asset.Tag.SECRET) as Uint8Array; - // 将Uint8Array转换为string类型。 - let secretStr: string = arrayToString(secret); - } - // step4. 关键资产明文查询成功后,需要调用asset.postQuery进行查询的后置处理。 - postQueryAsset(challenge); - result = 'Succeeded in querying user-auth Asset'; - } catch (error) { - // step5. preQuery成功,后续操作失败,也需要调用asset.postQuery进行查询的后置处理。 - postQueryAsset(challenge); - result = 'Failed to query user-auth Asset'; - } - }).catch((err: BusinessError) => { - console.error(`Failed to pre-query Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query user-auth Asset'; - }) - return result; -} -// [End query_user_auth_asset] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_batch_attrs.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_batch_attrs.ets deleted file mode 100644 index bdaef111d0f58cfaac4a3d6d08abb747614293b6..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_batch_attrs.ets +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start query_batch_attributes] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function queryBatchAssetAttributes(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.RETURN_TYPE, asset.ReturnType.ATTRIBUTES); // 此处表示仅返回关键资产属性,不包含关键资产明文。 - query.set(asset.Tag.DATA_LABEL_NORMAL_1, stringToArray('demo_label')); - query.set(asset.Tag.RETURN_LIMIT, 10); // 此处表示查询10条满足条件的关键资产。 - query.set(asset.Tag.RETURN_ORDERED_BY, asset.Tag.DATA_LABEL_NORMAL_1); // 此处查询结果以DATA_LABEL_NORMAL_1属性内容排序。 - try { - await asset.query(query).then((res: Array) => { - for (let i = 0; i < res.length; i++) { - // 解析属性。 - let accessibility: number = res[i].get(asset.Tag.ACCESSIBILITY) as number; - console.info(`Succeeded in getting accessibility, which is: ${accessibility}.`); - } - result = 'Succeeded in querying batch Asset attributes'; - }).catch((err: BusinessError) => { - console.error(`Failed to query batch Asset attributes. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query batch Asset attributes'; - }); - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to query batch Asset attributes. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query batch Asset attributes'; - } - return result; -} -// [End query_batch_attributes] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_group_attr.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_group_attr.ets deleted file mode 100644 index 4397342b98f76fadfcae77f1c4849c3c6c73bb60..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_group_attr.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start query_group_asset_attribute] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function queryGroupAssetAttribute(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); // 指定了群组关键资产别名,最多查询到一条满足条件的群组关键资产。 - query.set(asset.Tag.RETURN_TYPE, asset.ReturnType.ATTRIBUTES); // 此处表示仅返回群组关键资产属性,不包含群组关键资产明文。 - query.set(asset.Tag.GROUP_ID, stringToArray('demo_group_id')); - try { - await asset.query(query).then((res: Array) => { - for (let i = 0; i < res.length; i++) { - // 解析属性。 - let accessibility: number = res[i].get(asset.Tag.ACCESSIBILITY) as number; - console.info(`Succeeded in getting accessibility, which is: ${accessibility}.`); - } - result = 'Succeeded in querying group Asset attribute'; - }).catch((err: BusinessError) => { - console.error(`Failed to query Asset attribute from the group. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query Asset attribute from the group'; - }); - } catch (err) { - console.error(`Failed to query Asset attribute from the group. Code is ${err?.code}, message is ${err?.message}`); - result = 'Failed to query Asset attribute from the group'; - } - return result; -} -// [End query_group_asset_attribute] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_group_plaintext.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_group_plaintext.ets deleted file mode 100644 index d8f2fd339b58a854d8c99835ce7f9798835222e0..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_group_plaintext.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start query_group_asset_plaintext] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -function arrayToString(arr: Uint8Array): string { - let textDecoder = util.TextDecoder.create('utf-8', { ignoreBOM: true }); - let str = textDecoder.decodeToString(arr, { stream: false }); - return str; -} - -export async function queryGroupAssetPlaintext(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); // 指定了群组关键资产别名,最多查询到一条满足条件的群组关键资产。 - query.set(asset.Tag.RETURN_TYPE, asset.ReturnType.ALL); // 此处表示需要返回群组关键资产的所有信息,即属性+明文。 - query.set(asset.Tag.GROUP_ID, stringToArray('demo_group_id')); - try { - await asset.query(query).then((res: Array) => { - for (let i = 0; i < res.length; i++) { - // 解析secret。 - let secret: Uint8Array = res[i].get(asset.Tag.SECRET) as Uint8Array; - // 将Uint8Array转换为string类型。 - let secretStr: string = arrayToString(secret); - } - result = 'Succeeded in querying group Asset plaintext'; - }).catch((err: BusinessError) => { - console.error(`Failed to query Asset plaintext from the group. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query Asset plaintext from the group'; - }); - } catch (err) { - console.error(`Failed to query Asset plaintext from the group. Code is ${err?.code}, message is ${err?.message}`); - result = 'Failed to query Asset plaintext from the group'; - } - return result; -} -// [End query_group_asset_plaintext] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_plaintext.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_plaintext.ets deleted file mode 100644 index f4838a436181c631ffe0943e993b006122cb9ad4..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_plaintext.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start query_single_plaintext] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -function arrayToString(arr: Uint8Array): string { - let textDecoder = util.TextDecoder.create('utf-8', { ignoreBOM: true }); - let str = textDecoder.decodeToString(arr, { stream: false }); - return str; -} - -export async function queryAssetPlaintext(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); // 指定了关键资产别名,最多查询到一条满足条件的关键资产。 - query.set(asset.Tag.RETURN_TYPE, asset.ReturnType.ALL); // 此处表示需要返回关键资产的所有信息,即属性+明文。返回明文需要解密,查询时间较长。 - try { - await asset.query(query).then((res: Array) => { - for (let i = 0; i < res.length; i++) { - // 解析secret。 - let secret: Uint8Array = res[i].get(asset.Tag.SECRET) as Uint8Array; - // 将Uint8Array转为string类型。 - let secretStr: string = arrayToString(secret); - } - result = 'Succeeded in querying Asset plaintext'; - }).catch((err: BusinessError) => { - console.error(`Failed to query Asset plaintext. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query Asset plaintext'; - }); - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to query Asset plaintext. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query Asset plaintext'; - } - return result; -} -// [End query_single_plaintext] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_sync_result.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_sync_result.ets deleted file mode 100644 index 70febbfbf741769c35163093d0b41487dbb7ab1a..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/query_sync_result.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start query_sync_result] -import { asset } from '@kit.AssetStoreKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -export async function querySyncResult(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - await asset.querySyncResult(query).then((res: asset.SyncResult) => { - console.info(`Succeeded in querying sync result: ${JSON.stringify(res)}`); - result = 'Succeeded in querying sync result'; - }).catch((err: BusinessError) => { - console.error(`Failed to query sync result of Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to query sync result of Asset'; - }); - return result; -} -// [End query_sync_result] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/remove.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/remove.ets deleted file mode 100644 index 063e79cd7ead351b6590a7f836280dfb316d3735..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/remove.ets +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start remove_asset] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function removeAsset(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); // 此处指定别名删除单条关键资产,也可不指定别名删除多条关键资产。 - try { - await asset.remove(query).then(() => { - console.info(`Succeeded in removing Asset.`); - result = 'Succeeded in removing Asset'; - }).catch((err: BusinessError) => { - console.error(`Failed to remove Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to remove Asset'; - }); - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to remove Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to remove Asset'; - } - return result; -} -// [End remove_asset] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/remove_auth.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/remove_auth.ets deleted file mode 100644 index f580fa42838571f4a127cb4816b806bd86134b43..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/remove_auth.ets +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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 { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function removeUserAuthAsset(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('user_auth_asset')); // 此处指定别名删除单条关键资产,也可不指定别名删除多条关键资产。 - try { - await asset.remove(query).then(() => { - console.info(`Succeeded in removing Asset.`); - result = 'Succeeded in removing user-auth Asset'; - }).catch((err: BusinessError) => { - console.error(`Failed to remove Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to remove Asset'; - }); - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to remove Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to remove Asset'; - } - return result; -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/remove_group.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/remove_group.ets deleted file mode 100644 index 238a905d409e9c3e6310f714ebc3bc9a298fe758..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/remove_group.ets +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start remove_group_asset] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function removeGroupAsset(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); // 此处指定别名删除单条群组关键资产,也可不指定别名删除多条群组关键资产。 - query.set(asset.Tag.GROUP_ID, stringToArray('demo_group_id')); - try { - await asset.remove(query).then(() => { - console.info(`Succeeded in removing Asset from the group.`); - result = 'Succeeded in removing Asset from the group'; - }).catch((err: BusinessError) => { - console.error(`Failed to remove Asset from the group. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to remove Asset from the group'; - }); - } catch (err) { - console.error(`Failed to remove Asset from the group. Code is ${err?.code}, message is ${err?.message}`); - result = 'Failed to remove Asset from the group'; - } - return result; -} -// [End remove_group_asset] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/update.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/update.ets deleted file mode 100644 index 9bd926c297b4e89f3ef9b0cb9712c01da6724e6e..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/update.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start update_asset] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function updateAsset(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); - let attrsToUpdate: asset.AssetMap = new Map(); - attrsToUpdate.set(asset.Tag.SECRET, stringToArray('demo_pwd_new')); - attrsToUpdate.set(asset.Tag.DATA_LABEL_NORMAL_1, stringToArray('demo_label_new')); - try { - await asset.update(query, attrsToUpdate).then(() => { - console.info(`Succeeded in updating Asset.`); - result = 'Succeeded in updating Asset'; - }).catch((err: BusinessError) => { - console.error(`Failed to update Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to update Asset'; - }); - } catch (error) { - let err = error as BusinessError; - console.error(`Failed to update Asset. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to update Asset'; - } - return result; -} -// [End update_asset] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/update_group.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/update_group.ets deleted file mode 100644 index 015245a36dbff9555722d7d97bea785f741ebcdc..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/operations/update_group.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start update_group_asset] -import { asset } from '@kit.AssetStoreKit'; -import { util } from '@kit.ArkTS'; -import { BusinessError } from '@kit.BasicServicesKit'; - -function stringToArray(str: string): Uint8Array { - let textEncoder = new util.TextEncoder(); - return textEncoder.encodeInto(str); -} - -export async function updateGroupAsset(): Promise { - let result: string = ''; - let query: asset.AssetMap = new Map(); - query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); - query.set(asset.Tag.GROUP_ID, stringToArray('demo_group_id')); - let attrsToUpdate: asset.AssetMap = new Map(); - attrsToUpdate.set(asset.Tag.SECRET, stringToArray('demo_pwd_new')); - attrsToUpdate.set(asset.Tag.DATA_LABEL_NORMAL_1, stringToArray('demo_label_new')); - try { - await asset.update(query, attrsToUpdate).then(() => { - console.info(`Succeeded in updating Asset in the group.`); - result = 'Succeeded in updating Asset in the group'; - }).catch((err: BusinessError) => { - console.error(`Failed to update Asset in the group. Code is ${err.code}, message is ${err.message}`); - result = 'Failed to update Asset in the group'; - }); - } catch (err) { - console.error(`Failed to update Asset in the group. Code is ${err?.code}, message is ${err?.message}`); - result = 'Failed to update Asset in the group'; - } - return result; -} -// [End update_group_asset] \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/pages/Index.ets b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index f537dce8e8ffeaafe62411450d534570949fdf7a..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2025 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 { - addAsset, removeAsset, updateAsset, queryAssetPlaintext, queryAssetAttribute, queryBatchAssetAttributes, - addUserAuthAsset, removeUserAuthAsset, queryUserAuthAsset, - addGroupAsset, removeGroupAsset, updateGroupAsset, queryGroupAssetPlaintext, queryGroupAssetAttribute, - addSyncAsset, querySyncResult -} from '../operations'; - -@Entry -@Component -struct Index { - @State message1: string = 'Add Asset'; - @State message2: string = 'Query Asset Plaintext'; - @State message3: string = 'Query Asset Attribute'; - @State message4: string = 'Query Batch Asset Attributes'; - @State message5: string = 'Update Asset'; - @State message6: string = 'Remove Asset'; - - @State message7: string = 'Add User-Auth Asset'; - @State message8: string = 'Query User-Auth Asset'; - @State message9: string = 'Remove User-Auth Asset'; - - @State message10: string = 'Add Group Asset'; - @State message11: string = 'Query Group Asset Plaintext'; - @State message12: string = 'Query Group Asset Attribute'; - @State message13: string = 'Update Group Asset'; - @State message14: string = 'Remove Group Asset'; - - @State message15: string = 'Add Sync Asset'; - @State message16: string = 'Query Sync Result'; - - build() { - Column() { - Button(this.message1).width('70%').margin(3) - .onClick(async () => { - addAsset().then(str => this.message1 = str); - }) - Button(this.message2).width('70%').margin(3) - .onClick(async () => { - queryAssetPlaintext().then(str => this.message2 = str); - }) - Button(this.message3).width('70%').margin(3) - .onClick(async () => { - queryAssetAttribute().then(str => this.message3 = str); - }) - Button(this.message4).width('70%').margin(3) - .onClick(async () => { - queryBatchAssetAttributes().then(str => this.message4 = str); - }) - Button(this.message5).width('70%').margin(3) - .onClick(async () => { - updateAsset().then(str => this.message5 = str); - }) - Button(this.message6).width('70%').margin(3) - .onClick(async () => { - removeAsset().then(str => this.message6 = str); - }) - Button(this.message7).width('70%').margin(3) - .onClick(async () => { - addUserAuthAsset().then(str => this.message7 = str); - }) - Button(this.message8).width('70%').margin(3) - .onClick(async () => { - queryUserAuthAsset().then(str => this.message8 = str); - }) - Button(this.message9).width('70%').margin(3) - .onClick(async () => { - removeUserAuthAsset().then(str => this.message9 = str); // 需设置设备锁屏密码。 - }) - Button(this.message10).width('70%').margin(3) - .onClick(async () => { - addGroupAsset().then(str => this.message10 = str); - }) - Button(this.message11).width('70%').margin(3) - .onClick(async () => { - queryGroupAssetPlaintext().then(str => this.message11 = str); - }) - Button(this.message12).width('70%').margin(3) - .onClick(async () => { - queryGroupAssetAttribute().then(str => this.message12 = str); - }) - Button(this.message13).width('70%').margin(3) - .onClick(async () => { - updateGroupAsset().then(str => this.message13 = str); - }) - Button(this.message14).width('70%').margin(3) - .onClick(async () => { - removeGroupAsset().then(str => this.message14 = str); - }) - Button(this.message15).width('70%').margin(3) - .onClick(async () => { - addSyncAsset().then(str => this.message15 = str); - }) - Button(this.message16).width('70%').margin(3) - .onClick(async () => { - querySyncResult().then(str => this.message16 = str); - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/module.json5 b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/module.json5 deleted file mode 100644 index e9819632b5c13bf1a171be3e9049eedb6425a5a5..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/module.json5 +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2025 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" - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.ACCESS_BIOMETRIC", - "reason": "$string:reason", - "usedScene": { - "when": "always" - } - } - ] - } -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/element/color.json b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/element/string.json b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f0713eec10e3619e1560eb3b05f4994127190112..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AssetStoreProject" - }, - { - "name": "reason", - "value": "用于验证用户权限" - }, - { - "name": "pass_word", - "value": "请输入锁屏密码" - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/background.png b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/foreground.png b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/layered_image.json b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/startIcon.png b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/profile/backup_config.json b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/profile/main_pages.json b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/dark/element/color.json b/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreArkTS/hvigor/hvigor-config.json5 b/Security/AssetStoreKit/AssetStoreArkTS/hvigor/hvigor-config.json5 deleted file mode 100644 index d584c19c247db9a7caee4b606bb931aa9279c637..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/Security/AssetStoreKit/AssetStoreArkTS/hvigorfile.ts b/Security/AssetStoreKit/AssetStoreArkTS/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/AssetStoreKit/AssetStoreArkTS/oh-package.json5 b/Security/AssetStoreKit/AssetStoreArkTS/oh-package.json5 deleted file mode 100644 index e41bae026aab3b50d0abb42fece08ba43b4a772b..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreArkTS/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Security/AssetStoreKit/AssetStoreArkTS/screenshots/AssetStoreArkTS1.png b/Security/AssetStoreKit/AssetStoreArkTS/screenshots/AssetStoreArkTS1.png deleted file mode 100644 index 6f78a6b099de8b5ca15c3de2a2f222c6e3a531b4..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreArkTS/screenshots/AssetStoreArkTS1.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreArkTS/screenshots/AssetStoreArkTS2.png b/Security/AssetStoreKit/AssetStoreArkTS/screenshots/AssetStoreArkTS2.png deleted file mode 100644 index 65a432bdedff345f26e0077e50a0b8ce523b5787..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreArkTS/screenshots/AssetStoreArkTS2.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreNdk/AppScope/app.json5 b/Security/AssetStoreKit/AssetStoreNdk/AppScope/app.json5 deleted file mode 100644 index dcc131b3ba35a25524de4462ba22f03c83e8f4d5..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/AppScope/app.json5 +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.assetstorendk", - "assetAccessGroups": [ - "demo_group_id", - ], - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/Security/AssetStoreKit/AssetStoreNdk/AppScope/resources/base/element/string.json b/Security/AssetStoreKit/AssetStoreNdk/AppScope/resources/base/element/string.json deleted file mode 100644 index 7122455547eac86f79b9f6d3dbfd73d76356d412..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AssetStoreNdk" - } - ] -} diff --git a/Security/AssetStoreKit/AssetStoreNdk/AppScope/resources/base/media/app_icon.png b/Security/AssetStoreKit/AssetStoreNdk/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreNdk/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreNdk/LICENSE b/Security/AssetStoreKit/AssetStoreNdk/LICENSE deleted file mode 100644 index 18795a48d6b12fcdc1aa7bac9a9cb99f83815267..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/LICENSE +++ /dev/null @@ -1,78 +0,0 @@ - Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved. - - 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. - -Apache License, Version 2.0 -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: -1.You must give any other recipients of the Work or Derivative Works a copy of this License; and -2.You must cause any modified files to carry prominent notices stating that You changed the files; and -3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and -4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - -You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/README.en.md b/Security/AssetStoreKit/AssetStoreNdk/README.en.md deleted file mode 100644 index 46c7b4180dc1dfd16a11ef428e14f11934ee6d5c..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/README.en.md +++ /dev/null @@ -1,63 +0,0 @@ -# Asset Store Kit Development (C/C++) - -### Introduction - -Asset Store Kit (ASSET for short) provides a series of open APIs to securely store and manage short sensitive data, including but not limited to passwords (accounts/passwords), tokens (application credentials), and important plaintext (such as bank card numbers). - -This sample primarily demonstrates scenarios from the Asset Store Kit Development (C/C++), including adding, deleting, updating, and querying assets. The detailed description of the code demonstrated in this project can be found via the following links. - -- [Adding an Asset (C/C++)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-native-add.md) -- [Removing Assets (C/C++)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-native-remove.md) -- [Updating an Asset (C/C++)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-native-update.md) -- [Querying Assets (C/C++)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-native-query.md) -- [Managing Assets in a Group (C/C++)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-native-group-access-control.md) -- [Syncing Assets (Backup and Restore) (C/C++)](https://docs.openharmony.cn/pages/v6.0/en/application-dev/security/AssetStoreKit/asset-native-sync.md) - -### Preview - -| Home Page | Execution Result | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| | | - -### How to Use - -1. Run the app. -2. The page will display the effect shown in the Home Page above. Click the buttons to manage assets correspondingly. - -### Project Directory - -``` -entry/src/ - ├── main - ├── cpp - │ ├── types - │ ├── libentry - │ | ├── index.d.ts - │ ├── CMakeLists.txt - │ ├── napi_init.cpp // Asset Store Kit Development (C/C++) Sample Code - ├── ets - │ ├── entryability - │ ├── entrybackupability - │ ├── pages - │ ├── Index.ets - ├── module.json5 - └── resources -``` - -### Required Permissions - -N/A - -### Dependencies - -N/A - -### Constraints and Limitations - -1.The sample app is supported only on Huawei phones running the standard system. - -2.The HarmonyOS version must be HarmonyOS 6.0.0 or later. - -3.The DevEco Studio version must be DevEco Studio 6.0.0 Release or later. - -4.The HarmonyOS SDK version must be HarmonyOS 6.0.0 Release or later. \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/README.md b/Security/AssetStoreKit/AssetStoreNdk/README.md deleted file mode 100644 index 5a343f18f937bfc1f786208ef8d69cc84b950d31..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Asset Store Kit开发指导(C/C++) - -### 介绍 - -Asset Store Kit(关键资产存储开发套件)包含了关键资产存储服务(ASSET)开放的接口能力集合,提供了用户短敏感数据的安全存储及管理能力。其中,短敏感数据可以是密码类(账号/密码)、Token类(应用凭据)、关键明文(如银行卡号)等长度较短的用户敏感数据。 - -本示例主要展示了Asset Store Kit开发指导(C/C++)中新增关键资产、删除关键资产、更新关键资产、查询关键资产等场景。该工程中展示的代码详细描述可查如下链接中业务扩展场景介绍部分。 - -- [新增关键资产(C/C++)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-native-add.md) -- [删除关键资产(C/C++)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-native-remove.md) -- [更新关键资产(C/C++)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-native-update.md) -- [查询关键资产(C/C++)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-native-query.md) -- [管理群组关键资产(C/C++)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-native-group-access-control.md) -- [同步(备份恢复)关键资产(C/C++)](https://docs.openharmony.cn/pages/v6.0/zh-cn/application-dev/security/AssetStoreKit/asset-native-sync.md) - -### 效果预览 - -| 首页效果图 | 执行结果图 | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| | | - -### 使用说明 - -1. 运行Index主界面。 -2. 页面呈现为上述首页效果图,点击对应文本的按钮可以管理关键资产。 - -### 工程目录 - -``` -entry/src/ - ├── main - ├── cpp - │ ├── types - │ ├── libentry - │ | ├── index.d.ts - │ ├── CMakeLists.txt - │ ├── napi_init.cpp // Asset Store Kit开发指导(C/C++)示例代码 - ├── ets - │ ├── entryability - │ ├── entrybackupability - │ ├── pages - │ ├── Index.ets - ├── module.json5 - └── resources -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:华为手机。 - -2.HarmonyOS系统:HarmonyOS 6.0.0及以上。 - -3.DevEco Studio版本:DevEco Studio 6.0.0 Release及以上。 - -4.HarmonyOS SDK版本:HarmonyOS 6.0.0 Release SDK及以上。 \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/build-profile.json5 b/Security/AssetStoreKit/AssetStoreNdk/build-profile.json5 deleted file mode 100644 index ae905ecf15e4456dfe32b6a9315813dc24a64f40..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/build-profile.json5 b/Security/AssetStoreKit/AssetStoreNdk/entry/build-profile.json5 deleted file mode 100644 index 19af2081bc2bf145fe9979b8817a5720f2eb145d..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": [ - "arm64-v8a", - "x86_64", - ] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/hvigorfile.ts b/Security/AssetStoreKit/AssetStoreNdk/entry/hvigorfile.ts deleted file mode 100644 index e4f43d54667f8327c367c8096bd08bb8c75aff54..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/AssetStoreKit/AssetStoreNdk/entry/oh-package.json5 b/Security/AssetStoreKit/AssetStoreNdk/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/CMakeLists.txt b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 5995f4dc00f5ec592db1b5e7d68b5e94e85e76d3..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(AssetStoreNdk) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so libasset_ndk.z.so) \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/napi_init.cpp b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 3b1c042fb31f30af286781a5f1b3e7930a5c7ce7..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start include] -#include "napi/native_api.h" -#include -#include "asset/asset_api.h" -// [End include] - -// [Start add_asset] -static napi_value AddAsset(napi_env env, napi_callback_info info) -{ - const char *secretStr = "demo_pwd"; - const char *aliasStr = "demo_alias"; - const char *labelStr = "demo_label"; - - Asset_Blob secret = {(uint32_t)(strlen(secretStr)), (uint8_t *)secretStr}; - Asset_Blob alias = {(uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr}; - Asset_Blob label = {(uint32_t)(strlen(labelStr)), (uint8_t *)labelStr}; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_ACCESSIBILITY, .value.u32 = ASSET_ACCESSIBILITY_DEVICE_FIRST_UNLOCKED}, - {.tag = ASSET_TAG_SECRET, .value.blob = secret}, - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, - {.tag = ASSET_TAG_DATA_LABEL_NORMAL_1, .value.blob = label}, - }; - - int32_t addResult = OH_Asset_Add(attr, sizeof(attr) / sizeof(attr[0])); - napi_value ret; - napi_create_int32(env, addResult, &ret); - return ret; -} -// [End add_asset] - -// [Start remove_asset] -static napi_value RemoveAsset(napi_env env, napi_callback_info info) -{ - const char *aliasStr = "demo_alias"; - - Asset_Blob alias = {(uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr}; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, // 此处指定别名删除单条关键资产,也可不指定别名删除多条关键资产。 - }; - - int32_t removeResult = OH_Asset_Remove(attr, sizeof(attr) / sizeof(attr[0])); - napi_value ret; - napi_create_int32(env, removeResult, &ret); - return ret; -} -// [End remove_asset] - -// [Start update_asset] -static napi_value UpdateAsset(napi_env env, napi_callback_info info) -{ - const char *aliasStr = "demo_alias"; - const char *secretStr = "demo_pwd_new"; - const char *labelStr = "demo_label_new"; - - Asset_Blob alias = {(uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr}; - Asset_Blob new_secret = {(uint32_t)(strlen(secretStr)), (uint8_t *)secretStr}; - Asset_Blob new_label = {(uint32_t)(strlen(labelStr)), (uint8_t *)labelStr}; - Asset_Attr query[] = {{.tag = ASSET_TAG_ALIAS, .value.blob = alias }}; - Asset_Attr attributesToUpdate[] = { - {.tag = ASSET_TAG_SECRET, .value.blob = new_secret}, - {.tag = ASSET_TAG_DATA_LABEL_NORMAL_1, .value.blob = new_label}, - }; - - int32_t updateResult = OH_Asset_Update(query, sizeof(query) / sizeof(query[0]), attributesToUpdate, - sizeof(attributesToUpdate) / sizeof(attributesToUpdate[0])); - napi_value ret; - napi_create_int32(env, updateResult, &ret); - return ret; -} -// [End update_asset] - -// [Start query_single_plaintext] -static napi_value QueryAssetPlaintext(napi_env env, napi_callback_info info) -{ - const char *aliasStr = "demo_alias"; - - Asset_Blob alias = {(uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr}; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, // 指定了关键资产别名,最多查询到一条满足条件的关键资产。 - {.tag = ASSET_TAG_RETURN_TYPE, .value.u32 = ASSET_RETURN_ALL}, // 此处表示需要返回关键资产的所有信息,即属性+明文。返回明文需要解密,查询时间较长。 - }; - - Asset_ResultSet resultSet = {0}; - int32_t queryResult = OH_Asset_Query(attr, sizeof(attr) / sizeof(attr[0]), &resultSet); - if (queryResult == ASSET_SUCCESS) { - // 解析resultSet。 - for (uint32_t i = 0; i < resultSet.count; i++) { - // 解析secret属性:其中data数据对应是secret->blob.data,长度对应是secret->blob.size。 - Asset_Attr *secret = OH_Asset_ParseAttr(resultSet.results + i, ASSET_TAG_SECRET); - } - } - OH_Asset_FreeResultSet(&resultSet); - - napi_value ret; - napi_create_int32(env, queryResult, &ret); - return ret; -} -// [End query_single_plaintext] - -// [Start query_single_attribute] -static napi_value QueryAssetAttribute(napi_env env, napi_callback_info info) -{ - const char *aliasStr = "demo_alias"; - - Asset_Blob alias = { (uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr }; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, // 指定了关键资产别名,最多查询到一条满足条件的关键资产。 - {.tag = ASSET_TAG_RETURN_TYPE, .value.u32 = ASSET_RETURN_ATTRIBUTES}, // 此处表示仅返回关键资产属性。返回属性不需解密,查询时间较短。 - }; - - Asset_ResultSet resultSet = {0}; - int32_t queryResult = OH_Asset_Query(attr, sizeof(attr) / sizeof(attr[0]), &resultSet); - if (queryResult == ASSET_SUCCESS) { - // 解析结果。 - for (uint32_t i = 0; i < resultSet.count; i++) { - // 解析数据标签:其中数据是label->blob.data,长度对应是label->blob.size。 - Asset_Attr *label = OH_Asset_ParseAttr(resultSet.results + i, ASSET_TAG_DATA_LABEL_NORMAL_1); - } - } - OH_Asset_FreeResultSet(&resultSet); - - napi_value ret; - napi_create_int32(env, queryResult, &ret); - return ret; -} -// [End query_single_attribute] - -// [Start query_batch_attributes] -static napi_value QueryBatchAssetAttributes(napi_env env, napi_callback_info info) -{ - const char *labelStr = "demo_label"; - - Asset_Blob label = {(uint32_t)(strlen(labelStr)), (uint8_t *)labelStr}; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_RETURN_TYPE, .value.u32 = ASSET_RETURN_ATTRIBUTES}, - {.tag = ASSET_TAG_DATA_LABEL_NORMAL_1, .value.blob = label}, - {.tag = ASSET_TAG_RETURN_LIMIT, .value.u32 = 10}, - {.tag = ASSET_TAG_RETURN_ORDERED_BY, .value.u32 = ASSET_TAG_DATA_LABEL_NORMAL_1}, - }; - - Asset_ResultSet resultSet = { 0 }; - int32_t queryResult = OH_Asset_Query(attr, sizeof(attr) / sizeof(attr[0]), &resultSet); - if (queryResult == ASSET_SUCCESS) { - // 解析结果。 - for (uint32_t i = 0; i < resultSet.count; i++) { - // 解析数据别名:其中别名是label->blob.data,长度对应是label->blob.size。 - Asset_Attr *alias = OH_Asset_ParseAttr(resultSet.results + i, ASSET_TAG_ALIAS); - } - } - OH_Asset_FreeResultSet(&resultSet); - - napi_value ret; - napi_create_int32(env, queryResult, &ret); - return ret; -} -// [End query_batch_attributes] - -// [Start add_group_asset] -static napi_value AddGroupAsset(napi_env env, napi_callback_info info) -{ - const char *secretStr = "demo_pwd"; - const char *aliasStr = "demo_alias"; - const char *labelStr = "demo_label"; - const char *groupIdStr = "demo_group_id"; - - Asset_Blob secret = {(uint32_t)(strlen(secretStr)), (uint8_t *)secretStr}; - Asset_Blob alias = {(uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr}; - Asset_Blob label = {(uint32_t)(strlen(labelStr)), (uint8_t *)labelStr}; - Asset_Blob group_id = { (uint32_t)(strlen(groupIdStr)), (uint8_t *)groupIdStr}; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_SECRET, .value.blob = secret}, - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, - {.tag = ASSET_TAG_DATA_LABEL_NORMAL_1, .value.blob = label}, - {.tag = ASSET_TAG_GROUP_ID, .value.blob = group_id}, - }; - - int32_t addResult = OH_Asset_Add(attr, sizeof(attr) / sizeof(attr[0])); - napi_value ret; - napi_create_int32(env, addResult, &ret); - return ret; -} -// [End add_group_asset] - -// [Start remove_group_asset] -static napi_value RemoveGroupAsset(napi_env env, napi_callback_info info) -{ - const char *aliasStr = "demo_alias"; - const char *groupIdStr = "demo_group_id"; - - Asset_Blob alias = {(uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr}; - Asset_Blob group_id = {(uint32_t)(strlen(groupIdStr)), (uint8_t *)groupIdStr}; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, // 此处指定别名删除单条群组关键资产,也可不指定别名删除多条群组关键资产。 - {.tag = ASSET_TAG_GROUP_ID, .value.blob = group_id}, - }; - - int32_t removeResult = OH_Asset_Remove(attr, sizeof(attr) / sizeof(attr[0])); - napi_value ret; - napi_create_int32(env, removeResult, &ret); - return ret; -} -// [End remove_group_asset] - -// [Start update_group_asset] -static napi_value UpdateGroupAsset(napi_env env, napi_callback_info info) -{ - const char *aliasStr = "demo_alias"; - const char *secretStr = "demo_pwd_new"; - const char *labelStr = "demo_label_new"; - const char *groupIdStr = "demo_group_id"; - - Asset_Blob alias = {(uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr}; - Asset_Blob new_secret = {(uint32_t)(strlen(secretStr)), (uint8_t *)secretStr}; - Asset_Blob new_label = {(uint32_t)(strlen(labelStr)), (uint8_t *)labelStr}; - Asset_Blob group_id = {(uint32_t)(strlen(groupIdStr)), (uint8_t *)groupIdStr}; - Asset_Attr query[] = { - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, - {.tag = ASSET_TAG_GROUP_ID, .value.blob = group_id}, - }; - Asset_Attr attributesToUpdate[] = { - {.tag = ASSET_TAG_SECRET, .value.blob = new_secret}, - {.tag = ASSET_TAG_DATA_LABEL_NORMAL_1, .value.blob = new_label}, - }; - - int32_t updateResult = OH_Asset_Update(query, sizeof(query) / sizeof(query[0]), attributesToUpdate, - sizeof(attributesToUpdate) / sizeof(attributesToUpdate[0])); - napi_value ret; - napi_create_int32(env, updateResult, &ret); - return ret; -} -// [End update_group_asset] - -// [Start query_group_single_plaintext] -static napi_value QueryGroupAssetPlaintext(napi_env env, napi_callback_info info) -{ - const char *aliasStr = "demo_alias"; - const char *groupIdStr = "demo_group_id"; - - Asset_Blob alias = { (uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr }; - Asset_Blob group_id = { (uint32_t)(strlen(groupIdStr)), (uint8_t *)groupIdStr }; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, // 指定了群组关键资产别名,最多查询到一条满足条件的群组关键资产。 - {.tag = ASSET_TAG_RETURN_TYPE, .value.u32 = ASSET_RETURN_ALL}, // 此处表示需要返回群组关键资产的所有信息,即属性+明文。 - {.tag = ASSET_TAG_GROUP_ID, .value.blob = group_id}, - }; - - Asset_ResultSet resultSet = {0}; - int32_t queryResult = OH_Asset_Query(attr, sizeof(attr) / sizeof(attr[0]), &resultSet); - if (queryResult == ASSET_SUCCESS) { - // 解析resultSet。 - for (uint32_t i = 0; i < resultSet.count; i++) { - // 解析secret属性:其中data数据对应是secret->blob.data,长度对应是secret->blob.size。 - Asset_Attr *secret = OH_Asset_ParseAttr(resultSet.results + i, ASSET_TAG_SECRET); - } - } - OH_Asset_FreeResultSet(&resultSet); - - napi_value ret; - napi_create_int32(env, queryResult, &ret); - return ret; -} -// [End query_group_single_plaintext] - -// [Start query_group_single_attribute] -static napi_value QueryGroupAssetAttribute(napi_env env, napi_callback_info info) -{ - const char *aliasStr = "demo_alias"; - const char *groupIdStr = "demo_group_id"; - - Asset_Blob alias = {(uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr}; - Asset_Blob group_id = {(uint32_t)(strlen(groupIdStr)), (uint8_t *)groupIdStr}; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, // 指定了群组关键资产别名,最多查询到一条满足条件的群组关键资产。 - {.tag = ASSET_TAG_RETURN_TYPE, .value.u32 = ASSET_RETURN_ATTRIBUTES}, // 此处表示仅返回群组关键资产属性,不包含群组关键资产明文。 - {.tag = ASSET_TAG_GROUP_ID, .value.blob = group_id}, - }; - - Asset_ResultSet resultSet = {0}; - int32_t queryResult = OH_Asset_Query(attr, sizeof(attr) / sizeof(attr[0]), &resultSet); - if (queryResult == ASSET_SUCCESS) { - // 解析结果。 - for (uint32_t i = 0; i < resultSet.count; i++) { - // 解析数据标签:其中数据是label->blob.data,长度对应是label->blob.size。 - Asset_Attr *label = OH_Asset_ParseAttr(resultSet.results + i, ASSET_TAG_DATA_LABEL_NORMAL_1); - } - } - OH_Asset_FreeResultSet(&resultSet); - - napi_value ret; - napi_create_int32(env, queryResult, &ret); - return ret; -} -// [End query_group_single_attribute] - -// [Start add_sync_asset] -static napi_value AddSyncAsset(napi_env env, napi_callback_info info) -{ - char *secretStr = "demo_pwd"; - char *aliasStr = "demo_alias"; - char *labelStr = "demo_label"; - - Asset_Blob secret = {(uint32_t)(strlen(secretStr)), (uint8_t *)secretStr}; - Asset_Blob alias = {(uint32_t)(strlen(aliasStr)), (uint8_t *)aliasStr}; - Asset_Blob label = {(uint32_t)(strlen(labelStr)), (uint8_t *)labelStr}; - Asset_Attr attr[] = { - {.tag = ASSET_TAG_SECRET, .value.blob = secret}, - {.tag = ASSET_TAG_ALIAS, .value.blob = alias}, - {.tag = ASSET_TAG_DATA_LABEL_NORMAL_1, .value.blob = label}, - {.tag = ASSET_TAG_SYNC_TYPE, .value.u32 = ASSET_SYNC_TYPE_TRUSTED_DEVICE}, // 需指定在可信设备间同步(如新旧设备间克隆)。 - }; - - int32_t addResult = OH_Asset_Add(attr, sizeof(attr) / sizeof(attr[0])); - napi_value ret; - napi_create_int32(env, addResult, &ret); - return ret; -} -// [End add_sync_asset] - -// [Start query_sync_result] -static napi_value QuerySyncResult(napi_env env, napi_callback_info info) -{ - Asset_SyncResult syncResult = {0}; - int32_t queryResult = OH_Asset_QuerySyncResult(NULL, 0, &syncResult); - napi_value ret; - napi_create_int32(env, queryResult, &ret); - return ret; -} -// [End query_sync_result] - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - {"AddAsset", nullptr, AddAsset, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"RemoveAsset", nullptr, RemoveAsset, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"UpdateAsset", nullptr, UpdateAsset, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"QueryAssetPlaintext", nullptr, QueryAssetPlaintext, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"QueryAssetAttribute", nullptr, QueryAssetAttribute, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"BatchQuery", nullptr, QueryBatchAssetAttributes, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"AddGroupAsset", nullptr, AddGroupAsset, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"RemoveGroupAsset", nullptr, RemoveGroupAsset, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"UpdateGroupAsset", nullptr, UpdateGroupAsset, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"QueryGroupPlaintext", nullptr, QueryGroupAssetPlaintext, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"QueryGroupAttribute", nullptr, QueryGroupAssetAttribute, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"AddSyncAsset", nullptr, AddSyncAsset, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"QuerySyncResult", nullptr, QuerySyncResult, nullptr, nullptr, nullptr, napi_default, nullptr}, - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/types/libentry/Index.d.ts b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 74d3cb421fa3311de2566a9ae9b014cef2d909be..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const AddAsset: () => number; - -export const RemoveAsset: () => number; - -export const UpdateAsset: () => number; - -export const QueryAssetPlaintext: () => number; - -export const QueryAssetAttribute: () => number; - -export const BatchQuery: () => number; - -export const AddGroupAsset: () => number; - -export const RemoveGroupAsset: () => number; - -export const UpdateGroupAsset: () => number; - -export const QueryGroupPlaintext: () => number; - -export const QueryGroupAttribute: () => number; - -export const AddSyncAsset: () => number; - -export const QuerySyncResult: () => number; \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/types/libentry/oh-package.json5 b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/ets/entryability/EntryAbility.ets b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 965554bb3a331e2418180b86da1993baf5e8d536..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -}; \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/ets/pages/Index.ets b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index de637058255b0b53d4123bbdc484a7382c0d6d01..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'libentry.so'; - -const ASSET_SUCCESS: number = 0; - -@Entry -@Component -struct Index { - @State message: string = 'AssetStoreNdk'; - - build() { - Column({ space: 5 }) { - Text(this.message) - .fontSize(20) - .fontWeight(FontWeight.Bold) - .textAlign(TextAlign.Center) - Button('AddAsset') - .width('70%') - .onClick(() => { - let ret = testNapi.AddAsset(); - hilog.info(0x0000, 'testTag', 'AddAsset %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'AddAsset success'; - } else { - this.message = 'AddAsset failed'; - } - }) - Button('QueryAssetPlaintext') - .width('70%') - .onClick(() => { - let ret = testNapi.QueryAssetPlaintext(); - hilog.info(0x0000, 'testTag', 'QueryAssetPlaintext %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'QueryAssetPlaintext success'; - } else { - this.message = 'QueryAssetPlaintext failed'; - } - }) - Button('QueryAssetAttribute') - .width('70%') - .onClick(() => { - let ret = testNapi.QueryAssetAttribute(); - hilog.info(0x0000, 'testTag', 'QueryAssetAttribute %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'QueryAssetAttribute success'; - } else { - this.message = 'QueryAssetAttribute failed'; - } - }) - Button('QueryBatchAssetAttributes') - .width('70%') - .onClick(() => { - let ret = testNapi.BatchQuery(); - hilog.info(0x0000, 'testTag', 'QueryBatchAssetAttributes %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'QueryBatchAssetAttributes success'; - } else { - this.message = 'QueryBatchAssetAttributes failed'; - } - }) - Button('UpdateAsset') - .width('70%') - .onClick(() => { - let ret = testNapi.UpdateAsset(); - hilog.info(0x0000, 'testTag', 'UpdateAsset %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'UpdateAsset success'; - } else { - this.message = 'UpdateAsset failed'; - } - }) - Button('RemoveAsset') - .width('70%') - .onClick(() => { - let ret = testNapi.RemoveAsset(); - hilog.info(0x0000, 'testTag', 'RemoveAsset %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'RemoveAsset success'; - } else { - this.message = 'RemoveAsset failed'; - } - }) - Button('AddGroupAsset') - .width('70%') - .onClick(() => { - let ret = testNapi.AddGroupAsset(); - hilog.info(0x0000, 'testTag', 'AddGroupAsset %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'AddGroupAsset success'; - } else { - this.message = 'AddGroupAsset failed'; - } - }) - Button('QueryGroupAssetPlaintext') - .width('70%') - .onClick(() => { - let ret = testNapi.QueryGroupPlaintext(); - hilog.info(0x0000, 'testTag', 'QueryGroupAssetPlaintext %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'QueryGroupAssetPlaintext success'; - } else { - this.message = 'QueryGroupAssetPlaintext failed'; - } - }) - Button('QueryGroupAssetAttribute') - .width('70%') - .onClick(() => { - let ret = testNapi.QueryGroupAttribute(); - hilog.info(0x0000, 'testTag', 'QueryGroupAssetAttribute %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'QueryGroupAssetAttribute success'; - } else { - this.message = 'QueryGroupAssetAttribute failed'; - } - }) - Button('UpdateGroupAsset') - .width('70%') - .onClick(() => { - let ret = testNapi.UpdateGroupAsset(); - hilog.info(0x0000, 'testTag', 'UpdateGroupAsset %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'UpdateGroupAsset success'; - } else { - this.message = 'UpdateGroupAsset failed'; - } - }) - Button('RemoveGroupAsset') - .width('70%') - .onClick(() => { - let ret = testNapi.RemoveGroupAsset(); - hilog.info(0x0000, 'testTag', 'RemoveGroupAsset %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'RemoveGroupAsset success'; - } else { - this.message = 'RemoveGroupAsset failed'; - } - }) - Button('AddSyncAsset') - .width('70%') - .onClick(() => { - let ret = testNapi.AddSyncAsset(); - hilog.info(0x0000, 'testTag', 'AddSyncAsset %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'AddSyncAsset success'; - } else { - this.message = 'AddSyncAsset failed'; - } - }) - Button('QuerySyncResult') - .width('70%') - .onClick(() => { - let ret = testNapi.QuerySyncResult(); - hilog.info(0x0000, 'testTag', 'QuerySyncResult %{public}s', ret); - if (ret === ASSET_SUCCESS) { - this.message = 'QuerySyncResult success'; - } else { - this.message = 'QuerySyncResult failed'; - } - }) - } - .height('100%') - .width('100%') - .alignItems(HorizontalAlign.Center) - .justifyContent(FlexAlign.Center) - } -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/module.json5 b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/module.json5 deleted file mode 100644 index 4144486d1af4c03b0d767cce1cda86fc0d697f91..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/element/color.json b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/element/string.json b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 3e9c0e3317c3684f264438833e0409872ed88005..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "AssetStoreNdk" - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/background.png b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/foreground.png b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/layered_image.json b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/startIcon.png b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/profile/backup_config.json b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/profile/main_pages.json b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/dark/element/color.json b/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/Security/AssetStoreKit/AssetStoreNdk/hvigor/hvigor-config.json5 b/Security/AssetStoreKit/AssetStoreNdk/hvigor/hvigor-config.json5 deleted file mode 100644 index d584c19c247db9a7caee4b606bb931aa9279c637..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "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/Security/AssetStoreKit/AssetStoreNdk/hvigorfile.ts b/Security/AssetStoreKit/AssetStoreNdk/hvigorfile.ts deleted file mode 100644 index 2a5e543f190732c159beb574dfc9fa37bc94e156..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/AssetStoreKit/AssetStoreNdk/oh-package.json5 b/Security/AssetStoreKit/AssetStoreNdk/oh-package.json5 deleted file mode 100644 index e41bae026aab3b50d0abb42fece08ba43b4a772b..0000000000000000000000000000000000000000 --- a/Security/AssetStoreKit/AssetStoreNdk/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.1", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Security/AssetStoreKit/AssetStoreNdk/screenshots/AssetStoreNdk1.png b/Security/AssetStoreKit/AssetStoreNdk/screenshots/AssetStoreNdk1.png deleted file mode 100644 index b6eff7a78c775e6d2766bd323aa3b7e9773db991..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreNdk/screenshots/AssetStoreNdk1.png and /dev/null differ diff --git a/Security/AssetStoreKit/AssetStoreNdk/screenshots/AssetStoreNdk2.png b/Security/AssetStoreKit/AssetStoreNdk/screenshots/AssetStoreNdk2.png deleted file mode 100644 index 97f0b47785fddc7147f968748d3c0f4582596334..0000000000000000000000000000000000000000 Binary files a/Security/AssetStoreKit/AssetStoreNdk/screenshots/AssetStoreNdk2.png and /dev/null differ diff --git a/Security/DeviceCertificateKit/CertificateManagement/.gitignore b/Security/DeviceCertificateKit/CertificateManagement/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/Security/DeviceCertificateKit/CertificateManagement/AppScope/app.json5 b/Security/DeviceCertificateKit/CertificateManagement/AppScope/app.json5 deleted file mode 100644 index 8395cc27234909907a0d245bd7f6b7e11f005844..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.example.certificatemanager_sample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/element/string.json b/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/element/string.json deleted file mode 100644 index a25b8dabe83794ddc0d68ec8a8cec7fc079e94f1..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "certificatemanager_sample" - } - ] -} diff --git a/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/media/background.png b/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/media/foreground.png b/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/media/layered_image.json b/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/README.md b/Security/DeviceCertificateKit/CertificateManagement/README.md deleted file mode 100644 index 33eb0cc35131b2fd355e79f69e45514d631625a2..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/README.md +++ /dev/null @@ -1,72 +0,0 @@ -# 证书管理 - -### 介绍 - -证书管理主要提供系统级的证书管理能力,实现证书全生命周期(安装、存储、使用和销毁)的管理和安全使用。 - -本示例主要展示了证书管理中证书管理与证书管理对话框的使用场景。该工程中展示的代码详细描述可查如下链接中介绍。 - -- [证书管理开发指导](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/DeviceCertificateKit/certManager-guidelines.md) -- [证书管理对话框开发指导](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/DeviceCertificateKit/certManagerDialog-guidelines.md) - -### 效果预览 - -| 首页效果图 | 执行结果图 | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| | | - -### 使用说明 - -1. 运行Index主界面。 -2. 页面呈现上述执行结果图效果,点击不同按钮可以跳转到不同功能页面,点击跳转页面中按钮可以执行对应操作,并更新文本内容。 -3. 运行测试用例CertificateManagement.test.ets文件对页面代码进行测试可以全部通过。 - -### 工程目录 - -``` -entry/src/ - ├── main - │ ├── ets - │ │ ├── entryability - │ │ ├── entrybackupability - │ │ ├── pages - │ │ ├── Index.ets // 证书管理示例代码 - │ │ ├── CertManagerGuidelines.ets - │ │ ├── CertManagerDialogGuidelines.ets - │ ├── module.json5 - │ └── resources - ├── ohosTest - │ ├── ets - │ │ └── test - │ │ ├── Ability.test.ets - │ │ ├── CertificateManagement.test.ets // 自动化测试代码 - │ │ └── List.test.ets -``` - -### 相关权限 - -[ohos.permission.ACCESS_CERT_MANAGER](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionaccesscertmanager) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API14版本SDK,版本号:5.0.2.57,镜像版本号:OpenHarmony_5.0.2.58。 - -3.本示例需要使用DevEco Studio 5.0.1 Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/Security/DeviceCertificateKit/CertificateManagement > .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/Security/DeviceCertificateKit/CertificateManagement/build-profile.json5 b/Security/DeviceCertificateKit/CertificateManagement/build-profile.json5 deleted file mode 100644 index c4e8cef12735e3a7929c1740117603c46528ebe4..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/code-linter.json5 b/Security/DeviceCertificateKit/CertificateManagement/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/.gitignore b/Security/DeviceCertificateKit/CertificateManagement/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/build-profile.json5 b/Security/DeviceCertificateKit/CertificateManagement/entry/build-profile.json5 deleted file mode 100644 index 6bd6457a2fed846cc10698666fa1268219f1bee1..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/build-profile.json5 +++ /dev/null @@ -1,33 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/hvigorfile.ts b/Security/DeviceCertificateKit/CertificateManagement/entry/hvigorfile.ts deleted file mode 100644 index b0e3a1ab98a91bc918d6404b2413111a5011f14a..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/obfuscation-rules.txt b/Security/DeviceCertificateKit/CertificateManagement/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/Security/DeviceCertificateKit/CertificateManagement/entry/oh-package.json5 b/Security/DeviceCertificateKit/CertificateManagement/entry/oh-package.json5 deleted file mode 100644 index 248c3b7541a589682a250f86a6d3ecf7414d2d6a..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/entryability/EntryAbility.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index edc2839f203ba057c186e19b0cbbbf80c8faa8b3..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, 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 { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - 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'); - } -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/CertManagerCACertsGuidelines.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/CertManagerCACertsGuidelines.ets deleted file mode 100644 index 6485493af6c5453a1ce23d49202caea94650afbd..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/CertManagerCACertsGuidelines.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 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 { userCASample } from '../samples/CertManagerUserCASample'; -import { getUserCaPathSample } from '../samples/CertManagerGetCAPathSample'; - -@Entry -@Component -struct Index { - @State message: string = 'CertManagerDialogGuidelines'; - - build() { - Column({ space: 5 }) { - Text(this.message) - .fontWeight(FontWeight.Bold) - .fontSize(25) - Button($r('app.string.call_userCASample')) - .width('70%') - .onClick(() => { - userCASample(); - this.message = 'userCASample Success'; - }) - Button($r('app.string.call_getUserCAPathSample')) - .width('70%') - .onClick(() => { - getUserCaPathSample(); - this.message = 'getUserCaPathSample Success'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/CertManagerDialogGuidelines.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/CertManagerDialogGuidelines.ets deleted file mode 100644 index c686881a41c1af71477089ef6473f8b694b41a04..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/CertManagerDialogGuidelines.ets +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2025 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 { - installUserCADialogSample, - uninstallUserCADialogSample, - certDetailDialogSample -} from '../samples/CertManagerCaDialogSample'; -import { certificateManagerDialogSample } from '../samples/CertManagerDialogSample'; - -@Entry -@Component -struct Index { - @State message: string = 'CertManagerDialogGuidelines'; - - build() { - Column({ space: 5 }) { - Text(this.message) - .fontWeight(FontWeight.Bold) - .fontSize(25) - Button($r('app.string.call_certManagerDialogGuidelines')) - .width('70%') - .onClick(() => { - certificateManagerDialogSample(); - this.message = 'CertManagerDialogGuidelines Success'; - }) - Button($r('app.string.call_installUserCADialog')) - .width('70%') - .onClick(() => { - installUserCADialogSample(); - this.message = 'installUserCADialogSample Success'; - }) - Button($r('app.string.call_uninstallUserCADialog')) - .width('70%') - .onClick(() => { - uninstallUserCADialogSample(); - this.message = 'uninstallUserCADialogSample Success'; - }) - Button($r('app.string.call_certDetailDialog')) - .width('70%') - .onClick(() => { - certDetailDialogSample(); - this.message = 'certDetailDialogSample Success'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/CertManagerGuidelines.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/CertManagerGuidelines.ets deleted file mode 100644 index 06cd497a09386e999ae538e4167ea506bfd83d9d..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/CertManagerGuidelines.ets +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start certificate_management_development_guidance] -import { certificateManager } from '@kit.DeviceCertificateKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { util } from '@kit.ArkTS'; - -async function privateCredSample() { - /* 安装的凭据数据需要业务赋值,本例数据非凭据数据。 */ - let keystoreBase64Str = 'MIIMJgIBAzCCC+AGCSqGSIb3DQEHAaCCC9EEggvNMIILyTCCBW4GCSqGSIb3DQEH' + - // [StartExclude certificate_management_development_guidance] - 'AaCCBV8EggVbMIIFVzCCBVMGCyqGSIb3DQEMCgECoIIE+jCCBPYwKAYKKoZIhvcN' + - 'AQwBAzAaBBS2gH25w0SEH0TmlWqYocuX+yvMWgICBAAEggTIeKcWRUDw7Kw+NBfX' + - 'i1zKhSkLCO+i8G1V196WpUltnabmANcsZfbC0ehw+7XZxn3UKEUXT0/Zm6vi3Oci' + - 'bB681vA4C9fZ/Ke0h5WWw5PAtTf0ZP7lB6xBLfXr44vCdHMTO18XVC0xIGkcq2a6' + - 'BkMDo2lUcnBfeNLs3VC4JQPU7C2Slp/MpkpQNBz848JrZeyzHMjy0HnwKGGa/up/' + - 'Fjjh9H+G/nNnyWBz2O8sa96IN8XXGGB0lweFcHQwZo8RSrkY7fzH22NYe1cN+kOB' + - 'vTT8F9MqqXSgLBviqj3ShBiqKg6ozCrEOWAptQOv6pbPpWdMp1l26opg1tjDng6t' + - '1qBaAHym6GKkClPMSPBNbdqzqYI3df8gqehuyEqKgYR6HQJA2XbuiWLVVxnImmoi' + - 'jQGPyRRy+ZCjD18jMsTVeVMfvDr0GX+Tt4sLuesfolyTDl8ph+pnTV0rXimBvT38' + - '35JQGcJQTQd2CPy+0XNktyJvt4mTwbFEQif1YQYy0cDbklEb01yVhQ5mxen1f0RS' + - 'SfsKgwJuaWzxb+WhoF2K00+dCggbMnDj8/Bj2jeQlj+s9z3V6wjBUZF1LA/xWznO' + - 'BQZlHOg2sIZuvrkl1t9cUFaZaY6SvqEDGNY0pphTOreWy6gdyZ6SFfSZfliBmYSg' + - 'Z6V3Hqmsws/YemjvNZ62t3hrQxJTk3tQlDdIdZgnD3Maty8ZfkIIAgVCcdYmZAQl' + - 'h9kCBR95a5sO+hB785Y/UwKdgBPXMAMkliEF2y3pyFEwQm2p6DmwqVm5ISKYQQ4z' + - 'DX96aUUL8az9qqpFf3gk+FaFO0uVeEDHL/y2t1+i+emATEq/T8u5UXwYt7dw8UyW' + - '0kpEuaYiyZX1mb2M8kWI+y/gOELI5Q1VBQ+5kX2vJ5GzxINGSRrOOv8bWMmkIoJX' + - 'f9pfruqulpHv3k4lZrvps6e8EsRf7sYTnNm8FO89e6SRSnf9GJzHOK8kP2yPj24s' + - 'OHykusdwkG1eUTzgPcWoRLD0C7rgDotl6wT9GouUv/7wZKT6tOER1JUT7s72FPcc' + - 'vPVkkIhpsv0mJoOnTD0nrjxotcyfRsKalZqni0oU94CfBPk5O1WetRx5fS2bKbl8' + - 'YQH1Jh6gyxivxm0vQrellJGlwBXZGE62w3eeWW5hSDLPXgk6F0hZaJpsf9Nx2CzO' + - 'WGgzeea28LWssKTAEA+tAhlYU1qaXYSmjjzIqSK1Kjk/+HZT6nsjgSvhHWOzg3bI' + - '0166l3mb+/MeEKzYLqBkugIhGAXRMN0zMpg9DSK02o2gmjqXD6Xh8VYX2L0V09bg' + - 'IJV7amNZgO7NYLGwuo1qTD1crBqHHQf+aYGPXbpkP+rfNrMHbLxb6MBcmtEW4y6l' + - 'klu6iVVlXRTSNp79bc+daBB/tt9rmpvUazf9d945We3j22XopBVKbbStuDbhOvhq' + - '/m4fAhUJNkS3Ult5PI77IGLbe7axQ+op/xDvJJxNwqiYqilZhQbD28/Ccfqte9X3' + - 'UFPFdZcVQpCP8e1qmINZFSOn6untIuwKQUzCNVTZ7Eu4P9Bo7aeDTkIpXE2jeT5Z' + - 'hgRiJJ17s2npglfbv+uYT1l+jY9pVtw/6wHPggUe523/smfYNGj30O5txiJMTTbR' + - '9Vqru0FDTe8sYmQoMUYwHwYJKoZIhvcNAQkUMRIeEABsAGQAcQAgAHQAZQBzAHQw' + - 'IwYJKoZIhvcNAQkVMRYEFEQ3dY/NlJAHPjggtxs/DT1AhTJqMIIGUwYJKoZIhvcN' + - 'AQcGoIIGRDCCBkACAQAwggY5BgkqhkiG9w0BBwEwKAYKKoZIhvcNAQwBBjAaBBTI' + - '4khphQazNFXx/pyVkr1zzVD0iAICBACAggYAtmYGGoSxt/jKdOF8I5Rfs3PagVEO' + - 'TQfNimjVFZhXwbmUMMeXQDukwNX+05+S6WrrUhzYiSb0G0np70ULMzZzG5Erdf+b' + - 'EkHHgLFKEq8CjUvqzQ7GAxRMee+mwvaG0xn95oX6Ow07spjS/6D+ZWPJwqf0DZhX' + - 'q9V7WIdiWHRAdQaPSpP/drvTGU34BImkxeO+3mAEf1JYEVFvqfkGbQODzacB+C2g' + - '5kVjhUZ8m1WG/enD1OvrPisOM4qfQOOdUuP4bxpNX694ElZWqz29No7ZqcT80yFr' + - 'p6CjxlBBQ9vQ9xYIBg3tFZDcMesNS3scpjLKUqo6ccK3zkLUkL5lC1VUeWu/vPcd' + - 'XxRKAkxjFm2FrbMfEUM/0007/JZ5yqWewd+8lC1G4ucak/zFCRaNkUHAWU+cdpSG' + - '8lldyqkgkxDWRTswVd+Wn2AGfJq5JB7grmXVS0riVccJtVFAB37h7zRjezqpmC8J' + - '4f16syl5/PW9PDwFAtXFhq+a0xB+wxv3c2TWJwQI7ntJLSEu2LwpOoCCLe3yrwhV' + - 'zoCc8utgOBInMaAvZL8hjGOIkO6ewF+46qXzJgFl45e2F29qSHfAJgBlGcjoxpRd' + - 'A8vFqV3FS4/PM+sqmlp15Ox9WavRmrdzVCrjPWNiz6BftfQSYaa72fY/yQyWn/ii' + - 'OCy13yYHDcVDM+NpMVZ6TDzHRKSfYqRfm93kJCgb5nLIjedAToHmjjy1U+MLQ2mv' + - 'fbj88rUqrZXht73fOxase5+tj2Z9cj702/XdkQl6K/g9pibsIgDM5qsD5r57cAkH' + - 'cvwy8UbafgqXz0KvLXBWNM7Je8q21cjU45ZiAlRmZYj35bZoDWGNcaQ50OX3OCcA' + - 'ZVPUGwqUY6gZwypbKmq5GfoEPsUKxlzAP7s/GJsn3NX3K1QwaEdFrhLk3HGlvUtu' + - '1rpulqZzd8UrSG1+u0Rv1V0Xy9aWuNEG4eovpoYbgZe+oPuaIG31M+tk04lojIup' + - 'TxlRtY2JdFEskDgODRhThzFiPVQedMCawzfdNgBcybQdVwuyQyUrtu6D2v2tQZ30' + - '32D+odAceD42FzhKskIVrKZeiOMRdkjJzYa7K3qrqf52D7W0bhr9X6QgMrK1TSWk' + - 'NNMG9MZug8teh+Al7hdYLqo8VPG1M82nN3gQJSOQioA/u0vficLuXHgzGnY++UZJ' + - 'UAw5ODNrvq7s7Pn1HEChpykOAnrXuQsub58zl2OH4Lf2nqBDpr4EPz+KzI3TvBUO' + - 'm7eZwT/6r4rEZw022qv16XephAv5IkkVnXJicyGQFG5LLVCAAl55Zn2MW/gqDC5i' + - 'FYV4zqe2M4+65LGlnupmnpyYfZB1b9TA1UJdXtSr7R7gd0ivE6yJjCoqa7FFyq6G' + - '/NgVTq7OAGNxpu9D3Rx3IYWo0kZh8P3LQzFBNdovqciwX9bJe0OXKPou5weOMtX1' + - 'MC92UUshz73COl6FYCtCxVZw8fvO1e5PMDMI6junMVRnwgctfC9DvjQ01BFcj5Rq' + - 'd8sDd0gzrHd4QmxvCJMjXLhurqzQM4UaVdWFpwDw+QFYrDkQBUU+sKmGEnjnrbDu' + - 'T8c09AmccHenQbNUw8Sg8nJQdJztFkWSFahChpNOKHkegHoTrk03Veu9gzXsIKGD' + - 'GVAwAmxIeDupbxhXaTpb29Z3f1wN49HQJx8/0vtrqzZEWG/0okUyyQVn2Rqcm2Mx' + - 'elS9oGN6AXO8zNLiRBfS17h2frdaBPy52e3SdjghcfyDVYkwbvgNwOe2jhpE9o3b' + - 'KgH2VW9DvmY51+t8Wriyrpzwe7i9TjvwZxVHx2Js5emWuJcQOh3yIvQQkkawCdqY' + - '/++pH+gjUvowm0vx4bYT1NcsNx1xkQ8KIp0xKl5woeJ96z0GxvvnlpZDzNwpofq7' + - 'RRZMvqGtzg6LlVCsfo1oCNTipmNwtB4agMttpvX1zOjrwkkIcvOtSrkK7Pc1l29y' + - 'DEjGqFTHk9T3cFrpFgi1/PmytuTC1P0x6eY8OmfMNfX9gbYU/7j7Tw/CLdBX36Rf' + - 'Hk0BQU/+dlBmg3WQBr8t8SdGfjLExS/0Jn9GMD0wITAJBgUrDgMCGgUABBQze1zR' + - // [EndExclude certificate_management_development_guidance] - 'G615kxCjeS6uixCHuij3pgQUhHiChcSeohRPrVkVPSPmYr9tjAYCAgQA'; - /* 凭据数据转换为Uint8Array,凭据数据为der格式 */ - let keystore: Uint8Array = new util.Base64Helper().decodeSync(keystoreBase64Str); - - /* 安装凭据对应的密码,业务赋值。 */ - let keystorePwd: string = 'huawei'; - let appKeyUri: string = ''; - try { - /* 安装应用证书凭据。 */ - const res: certificateManager.CMResult = await certificateManager.installPrivateCertificate(keystore, keystorePwd, 'testPriCredential'); - appKeyUri = (res.uri != undefined) ? res.uri : ''; - console.error(`installPrivateCertificate appKeyUri: ${appKeyUri}`); - } catch (err) { - let e: BusinessError = err as BusinessError; - console.error(`Failed to install private certificate. Code: ${e.code}, message: ${e.message}`); - } - - try { - /* 获取应用证书凭据。 */ - let res: certificateManager.CMResult = await certificateManager.getPrivateCertificate(appKeyUri); - if (res === undefined || res.credential == undefined) { - console.error('The result of getting private certificate is undefined.'); - } else { - let credential = res.credential; - console.info('Succeeded in getting private certificate.'); - } - } catch (err) { - console.error(`Failed to get private certificate. Code: ${err.code}, message: ${err.message}`); - } - - try { - /* srcData为待签名、验签的数据,业务自行赋值。 */ - let srcData: Uint8Array = new Uint8Array([ - 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, - ]); - - /* 构造签名的属性参数。 */ - const signSpec: certificateManager.CMSignatureSpec = { - purpose: certificateManager.CmKeyPurpose.CM_KEY_PURPOSE_SIGN, - padding: certificateManager.CmKeyPadding.CM_PADDING_PSS, - digest: certificateManager.CmKeyDigest.CM_DIGEST_SHA256 - }; - - /* 签名。 */ - const signHandle: certificateManager.CMHandle = await certificateManager.init(appKeyUri, signSpec); - await certificateManager.update(signHandle.handle, srcData); - const signResult: certificateManager.CMResult = await certificateManager.finish(signHandle.handle); - - /* 构造验签的属性参数。 */ - const verifySpec: certificateManager.CMSignatureSpec = { - purpose: certificateManager.CmKeyPurpose.CM_KEY_PURPOSE_VERIFY, - padding: certificateManager.CmKeyPadding.CM_PADDING_PSS, - digest: certificateManager.CmKeyDigest.CM_DIGEST_SHA256 - }; - - /* 验签。 */ - const verifyHandle: certificateManager.CMHandle = await certificateManager.init(appKeyUri, verifySpec); - await certificateManager.update(verifyHandle.handle, srcData); - const verifyResult = await certificateManager.finish(verifyHandle.handle, signResult.outData); - console.info('Succeeded in signing and verifying.'); - } catch (err) { - let e: BusinessError = err as BusinessError; - console.error(`Failed to sign or verify. Code: ${e.code}, message: ${e.message}`); - } - - try { - /* 删除应用证书凭据。 */ - await certificateManager.uninstallPrivateCertificate(appKeyUri); - } catch (err) { - let e: BusinessError = err as BusinessError; - console.error(`Failed to uninstall private certificate. Code: ${e.code}, message: ${e.message}`); - } -} -// [End certificate_management_development_guidance] - -@Entry -@Component -struct Index { - @State message: string = 'CertManagerGuidelines'; - - build() { - Column({space: 5}) { - Text(this.message) - .fontSize(25) - .fontWeight(FontWeight.Bold) - Button($r('app.string.call_certManagerGuidelines')) - .width('70%') - .onClick(()=>{ - privateCredSample(); - this.message = 'CertManagerGuidelines Success'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/Index.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index b7d0cb1731276c6e53b888c6f6822f00cbcfdf9a..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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 { router } from '@kit.ArkUI'; - -@Entry -@Component -struct Index { - @State message: string = 'CertificateManagement'; - goToSample(url: string): void { - router.pushUrl({ - url: url, - }, router.RouterMode.Single, (err) => { - if (err) { - console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`); - return; - } - console.info('pushUrl success'); - }) - } - - build() { - Column({ space: 5 }) { - Text(this.message) - .fontSize(25) - .fontWeight(FontWeight.Bold) - Button($r('app.string.certManagerGuidelines')) - .width('70%') - .onClick(() => { - this.goToSample('pages/CertManagerGuidelines') - }) - Button($r('app.string.certManagerDialogGuidelines')) - .width('70%') - .onClick(() => { - this.goToSample('pages/CertManagerDialogGuidelines') - }) - Button($r('app.string.certManagerCACertsGuidelines')) - .width('70%') - .onClick(() => { - this.goToSample('pages/CertManagerCACertsGuidelines') - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerCaDialogSample.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerCaDialogSample.ets deleted file mode 100644 index 19e45340ee3400bbce0aa30f7f8cbd0d424f3676..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerCaDialogSample.ets +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start certificate_management_ca_dialog_development_guide] -import { certificateManagerDialog } from '@kit.DeviceCertificateKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { common } from '@kit.AbilityKit'; -import { UIContext } from '@kit.ArkUI'; -import { util } from '@kit.ArkTS'; - -let certType = certificateManagerDialog.CertificateType.CA_CERT; -let certUri: string = ''; -/* 用户CA证书数据需要业务赋值。 */ -let cert: Uint8Array = new util.TextEncoder().encodeInto(`-----BEGIN CERTIFICATE----- -MIIDSTCCAjECFFRZKkiBuiZ+zqfjJOg05yeTePM9MA0GCSqGSIb3DQEBCwUAMGEx -CzAJBgNVBAYTAmNuMQ0wCwYDVQQIDARvaG9zMQswCQYDVQQHDAJjbTEhMB8GA1UE -CgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRMwEQYDVQQDDApUZXN0Um9vdENB -MB4XDTI1MTAxNTA3MzE0MloXDTI2MTAxNTA3MzE0MlowYTELMAkGA1UEBhMCY24x -DTALBgNVBAgMBG9ob3MxCzAJBgNVBAcMAmNtMSEwHwYDVQQKDBhJbnRlcm5ldCBX -aWRnaXRzIFB0eSBMdGQxEzARBgNVBAMMClRlc3RSb290Q0EwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQC5p4eoQJyTBvn01M8SwEi8dguTIPGmD3a8SGIj -KXaB6ltv742H5EBjgk+zC8+Gis0ehEqwk3pVnnmByeYvrERxsUqDt69/FndlfTxI -C2/2MxWVk97g/6TpJ5Lt2mTrH+rSOgUDyU27aPn12ZnDF1mLsT+U+CBmfj4+J4tW -yzdFNj7kcKMQQok+L1dtFlDNMNpMA1UqADzoC3XgFl49CpDtoFId9DVsgUPkPfX1 -89cCunomgJe1b17FzxfNu2yhbl5cnUEjeHGbmBgBIB7uG8tjGstnDPx7fl3Xrj+Q -fRrwCpVKD9RxoyUBFbHttixxY5bHFUdvHRB251sxD+JfxxxLAgMBAAEwDQYJKoZI -hvcNAQELBQADggEBAEGbNqcMU7C/lrIytI/OTtzYbkWDsfnRSPxlCUoZ2Xh3S83A -SNQ9Ze5tDwWdW9Hlde9May6hzvuQSYeMLLnyM8WGResXCs7UbnSQe7fGfUu+xDGb -h4tamnRFtZydxCCgDT9lIdHeutlPwOuxlR4HXpeowGeGJX0iFrdo6D0iXAY34hic -yLQzuBqE/1s3PLA83Fi4EOOOV7P/ahmOLtBFlHbySHV68i9PNeNr9SDykH9/RgI9 -5G8ZTZj8oSmbTGGtfNuVXybMyJMRlz6BkxG++kYcg7STRBqHGX7RrWHiupguNreO -4sJBdSpWBq172ZEyOvTqC4xX9lLYqwwBQ++TFoo= ------END CERTIFICATE-----`); - -async function installUserCADialogSample() { - /* context为应用的上下文信息,由调用方自行获取,此处仅为示例。 */ - let context: common.Context = new UIContext().getHostContext() as common.Context; - let certScope = certificateManagerDialog.CertificateScope.CURRENT_USER; /* 安装在当前用户下。 */ - try { - /* 安装证书。 */ - certificateManagerDialog.openInstallCertificateDialog(context, certType, certScope, cert).then((result) => { - console.info('Succeeded in opening install ca dialog.'); - certUri = result; - }).catch((err: BusinessError) => { - console.error(`Failed to open install ca dialog. Code: ${err.code}, message: ${err.message}`); - }) - } catch (error) { - console.error(`Failed to open install ca dialog. Code: ${error.code}, message: ${error.message}`); - } -} - -async function uninstallUserCADialogSample() { - /* context为应用的上下文信息,由调用方自行获取,此处仅为示例。 */ - let context: common.Context = new UIContext().getHostContext() as common.Context; - try { - /* 删除证书。 */ - certificateManagerDialog.openUninstallCertificateDialog(context, certType, certUri).then(() => { - console.info('Succeeded in opening uninstall ca dialog.'); - }).catch((err: BusinessError) => { - console.error(`Failed to open uninstall ca dialog. Code: ${err.code}, message: ${err.message}`); - }) - } catch (error) { - console.error(`Failed to open uninstall ca dialog. Code: ${error.code}, message: ${error.message}`); - } -} - -async function certDetailDialogSample() { - /* context为应用的上下文信息,由调用方自行获取,此处仅为示例。 */ - let context: common.Context = new UIContext().getHostContext() as common.Context; - try { - let property: certificateManagerDialog.CertificateDialogProperty = { - showInstallButton: false /* 不显示安装按钮。 */ - }; - /* 显示证书详情。 */ - certificateManagerDialog.openCertificateDetailDialog(context, cert, property).then(() => { - console.info('Succeeded in opening show ca detail dialog.'); - }).catch((err: BusinessError) => { - console.error(`Failed to open show ca detail dialog. Code: ${err.code}, message: ${err.message}`); - }) - } catch (error) { - console.error(`Failed to open show ca detail dialog. Code: ${error.code}, message: ${error.message}`); - } -} -// [End certificate_management_ca_dialog_development_guide] - -export { installUserCADialogSample, uninstallUserCADialogSample, certDetailDialogSample }; \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerDialogSample.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerDialogSample.ets deleted file mode 100644 index 65738bfd7a8e661fa736119745a2af6459e91bb1..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerDialogSample.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start certificate_management_dialog_box_development_guide] -import { certificateManagerDialog } from '@kit.DeviceCertificateKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { common } from '@kit.AbilityKit'; - -async function certificateManagerDialogSample() { - /* context为应用的上下文信息,由调用方自行获取,此处仅为示例 */ - let context: common.Context = getContext(); - /* pageType为页面类型,此处赋值PAGE_MAIN,即拉起证书管理主界面 */ - let pageType: certificateManagerDialog.CertificateDialogPageType = - certificateManagerDialog.CertificateDialogPageType.PAGE_MAIN; - try { - certificateManagerDialog.openCertificateManagerDialog(context, pageType).then(() => { - console.info('Succeeded in opening certificate manager dialog.'); - }).catch((err: BusinessError) => { - console.error(`Failed to open certificate manager dialog. Code: ${err.code}, message: ${err.message}`); - }) - } catch (error) { - console.error(`Failed to open certificate manager dialog. Code: ${error.code}, message: ${error.message}`); - } -} -// [End certificate_management_dialog_box_development_guide] - -export { certificateManagerDialogSample }; \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerGetCAPathSample.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerGetCAPathSample.ets deleted file mode 100644 index 271e06038113bba34e398da81a2b03ebe2149507..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerGetCAPathSample.ets +++ /dev/null @@ -1,49 +0,0 @@ - -/* - * Copyright (c) 2025 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. - */ -// [Start certificate_management_get_ca_path] -import { certificateManager } from '@kit.DeviceCertificateKit'; - -function getUserCaPathSample() { - try { - /* 获取系统CA的存储位置。 */ - let property1: certificateManager.CertStoreProperty = { - certType: certificateManager.CertType.CA_CERT_SYSTEM, - } - let systemCAPath = certificateManager.getCertificateStorePath(property1); - console.info(`Success to get system ca path: ${systemCAPath}`); - - /* 获取当前用户的用户CA存储位置。 */ - let property2: certificateManager.CertStoreProperty = { - certType: certificateManager.CertType.CA_CERT_USER, - certScope: certificateManager.CertScope.CURRENT_USER, - } - let userCACurrentPath = certificateManager.getCertificateStorePath(property2); - console.info(`Success to get current user's user ca path: ${userCACurrentPath}`); - - /* 获取设备公共的用户CA存储位置。 */ - let property3: certificateManager.CertStoreProperty = { - certType: certificateManager.CertType.CA_CERT_USER, - certScope: certificateManager.CertScope.GLOBAL_USER, - } - let globalCACurrentPath = certificateManager.getCertificateStorePath(property3); - console.info(`Success to get global user's user ca path: ${globalCACurrentPath}`); - } catch (error) { - console.error(`Failed to get store path. Code: ${error.code}, message: ${error.message}`); - } -} -// [End certificate_management_get_ca_path] - -export { getUserCaPathSample }; \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerUserCASample.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerUserCASample.ets deleted file mode 100644 index 8dce1b5d0a05ec3179edf519df5619738cfbfcbb..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/ets/samples/CertManagerUserCASample.ets +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// [Start certificate_management_user_ca] -import { certificateManager } from '@kit.DeviceCertificateKit'; -import { util } from '@kit.ArkTS'; - -async function userCASample() { - /* 安装的用户CA证书数据需要业务赋值。 */ - let userCAData: Uint8Array = new util.TextEncoder().encodeInto('-----BEGIN CERTIFICATE-----\n' + - 'MIIDSTCCAjECFFRZKkiBuiZ+zqfjJOg05yeTePM9MA0GCSqGSIb3DQEBCwUAMGEx\n' + - 'CzAJBgNVBAYTAmNuMQ0wCwYDVQQIDARvaG9zMQswCQYDVQQHDAJjbTEhMB8GA1UE\n' + - 'CgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRMwEQYDVQQDDApUZXN0Um9vdENB\n' + - 'MB4XDTI1MTAxNTA3MzE0MloXDTI2MTAxNTA3MzE0MlowYTELMAkGA1UEBhMCY24x\n' + - 'DTALBgNVBAgMBG9ob3MxCzAJBgNVBAcMAmNtMSEwHwYDVQQKDBhJbnRlcm5ldCBX\n' + - 'aWRnaXRzIFB0eSBMdGQxEzARBgNVBAMMClRlc3RSb290Q0EwggEiMA0GCSqGSIb3\n' + - 'DQEBAQUAA4IBDwAwggEKAoIBAQC5p4eoQJyTBvn01M8SwEi8dguTIPGmD3a8SGIj\n' + - 'KXaB6ltv742H5EBjgk+zC8+Gis0ehEqwk3pVnnmByeYvrERxsUqDt69/FndlfTxI\n' + - 'C2/2MxWVk97g/6TpJ5Lt2mTrH+rSOgUDyU27aPn12ZnDF1mLsT+U+CBmfj4+J4tW\n' + - 'yzdFNj7kcKMQQok+L1dtFlDNMNpMA1UqADzoC3XgFl49CpDtoFId9DVsgUPkPfX1\n' + - '89cCunomgJe1b17FzxfNu2yhbl5cnUEjeHGbmBgBIB7uG8tjGstnDPx7fl3Xrj+Q\n' + - 'fRrwCpVKD9RxoyUBFbHttixxY5bHFUdvHRB251sxD+JfxxxLAgMBAAEwDQYJKoZI\n' + - 'hvcNAQELBQADggEBAEGbNqcMU7C/lrIytI/OTtzYbkWDsfnRSPxlCUoZ2Xh3S83A\n' + - 'SNQ9Ze5tDwWdW9Hlde9May6hzvuQSYeMLLnyM8WGResXCs7UbnSQe7fGfUu+xDGb\n' + - 'h4tamnRFtZydxCCgDT9lIdHeutlPwOuxlR4HXpeowGeGJX0iFrdo6D0iXAY34hic\n' + - 'yLQzuBqE/1s3PLA83Fi4EOOOV7P/ahmOLtBFlHbySHV68i9PNeNr9SDykH9/RgI9\n' + - '5G8ZTZj8oSmbTGGtfNuVXybMyJMRlz6BkxG++kYcg7STRBqHGX7RrWHiupguNreO\n' + - '4sJBdSpWBq172ZEyOvTqC4xX9lLYqwwBQ++TFoo=\n' + - '-----END CERTIFICATE-----'); - - let certUri: string = ''; - let certScope = certificateManager.CertScope.CURRENT_USER; - try { - /* 在当前用户下,安装用户CA证书。 */ - let result = certificateManager.installUserTrustedCertificateSync(userCAData, certScope); - certUri = (result.uri != undefined) ? result.uri : ''; - console.info(`Succeeded in install user ca cert, certUri is ${certUri}`); - } catch (err) { - console.error(`Failed to install user ca cert. Code: ${err.code}, message: ${err.message}`); - } - - try { - /* 获取用户CA证书详情。 */ - let result = await certificateManager.getUserTrustedCertificate(certUri); - if (result === undefined || result.certInfo == undefined) { - console.error('The result of getting user ca cert is undefined.'); - } else { - let certInfo = result.certInfo; - console.info('Succeeded in getting user ca cert.'); - } - } catch (err) { - console.error(`Failed to get user ca certificate. Code: ${err.code}, message: ${err.message}`); - } - - try { - /* 获取当前用户下的用户CA证书列表。 */ - let result = await certificateManager.getAllUserTrustedCertificates(certScope); - if (result == undefined) { /* 用户根CA证书个数为0时,返回result为undefined。 */ - console.info('the count of the user trusted certificates is 0'); - } else if (result.certList == undefined) { - console.error('The result of getting current user trusted certificates is undefined.'); - } else { - let list = result.certList; - console.info('Succeeded in getting user ca cert list.'); - } - } catch (err) { - console.error(`Failed to get user ca certificate. Code: ${err.code}, message: ${err.message}`); - } - - try { - /* 删除安装的用户CA证书。 */ - certificateManager.uninstallUserTrustedCertificateSync(certUri); - } catch (err) { - console.error(`Failed to uninstall user ca certificate. Code: ${err.code}, message: ${err.message}`); - } -} -// [End certificate_management_user_ca] - -export { userCASample }; \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/module.json5 b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/module.json5 deleted file mode 100644 index 690c81622d33b00d0e97bfe2422a0ec3051b8bde..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/module.json5 +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2025 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" - ], - "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" - } - ] - } - ], - "requestPermissions": [ - // To use the installUserTrustedCertificateSync or uninstallUserTrustedCertificateSync interface, - // you need to apply for the following permission: ohos.permission.ACCESS_ENTERPRISE_USER_TRUSTED_CERT. - { - "name": "ohos.permission.ACCESS_CERT_MANAGER", - "reason": "$string:reason", - "usedScene": { - "abilities": [ - "FormAbility" - ], - "when": "always" - } - } - ] - } -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/element/color.json b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/element/string.json b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 6b11d65104559b193532f31fbaabfd6ea9232e12..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "CertificateManagement" - }, - { - "name": "reason", - "value": "CertificateManagement" - }, - { - "name": "dialog", - "value": "证书与凭据" - }, - { - "name": "certManagerGuidelines", - "value": "CertManagerGuidelines" - }, - { - "name": "certManagerDialogGuidelines", - "value": "CertManagerDialogGuidelines" - }, - { - "name": "certManagerCACertsGuidelines", - "value": "CertManagerCACertsGuidelines" - }, - { - "name": "call_certManagerGuidelines", - "value": "Call CertManagerGuidelines" - }, - { - "name": "call_certManagerDialogGuidelines", - "value": "Call CertManagerDialogGuidelines" - }, - { - "name": "call_installUserCADialog", - "value": "Call InstallUserCADialog" - }, - { - "name": "call_uninstallUserCADialog", - "value": "Call UninstallUserCADialog" - }, - { - "name": "call_certDetailDialog", - "value": "Call CertDetailDialog" - }, - { - "name": "call_userCASample", - "value": "Call UserCaSample" - }, - { - "name": "call_getUserCAPathSample", - "value": "Call GetUserCaPathSample" - } - ] -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/background.png b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/foreground.png b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/layered_image.json b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/startIcon.png b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/profile/backup_config.json b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/profile/main_pages.json b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 7ff1eaaa2d64b84ace3dec928a373448e52e5e9b..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/CertManagerDialogGuidelines", - "pages/CertManagerGuidelines", - "pages/CertManagerCACertsGuidelines" - ] -} diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/dark/element/color.json b/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/mock/mock-config.json5 b/Security/DeviceCertificateKit/CertificateManagement/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41bfdf76d6f793007240d80983a52f15f97..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/ohosTest/ets/test/Ability.test.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f67579d6e31b5f5aeea463e216b9b141048..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/ohosTest/ets/test/List.test.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/ohosTest/module.json5 b/Security/DeviceCertificateKit/CertificateManagement/entry/src/ohosTest/module.json5 deleted file mode 100644 index 55725a929993a8a18b3808d41ef037759440488b..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "phone", - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/test/List.test.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/entry/src/test/LocalUnit.test.ets b/Security/DeviceCertificateKit/CertificateManagement/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/hvigor/hvigor-config.json5 b/Security/DeviceCertificateKit/CertificateManagement/hvigor/hvigor-config.json5 deleted file mode 100644 index 7a7ab8914d8db6ab89758e185df5855dffe88d04..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/Security/DeviceCertificateKit/CertificateManagement/hvigorfile.ts b/Security/DeviceCertificateKit/CertificateManagement/hvigorfile.ts deleted file mode 100644 index 47113e2e36ecefde41c136272a0bd6ff745cffe4..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/oh-package.json5 b/Security/DeviceCertificateKit/CertificateManagement/oh-package.json5 deleted file mode 100644 index c72aa05d549507e5ea6ce0bc0a8080c450508c7d..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "modelVersion": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Security/DeviceCertificateKit/CertificateManagement/ohosTest.md b/Security/DeviceCertificateKit/CertificateManagement/ohosTest.md deleted file mode 100644 index 6301852ad71ebe1413bf61d336122af484a2e4c0..0000000000000000000000000000000000000000 --- a/Security/DeviceCertificateKit/CertificateManagement/ohosTest.md +++ /dev/null @@ -1,9 +0,0 @@ -# **证书管理**测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ---------------------------------------------------- | ------------ | ---- | ---------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 点击按钮安装,获取,应用私有凭据进行签名、验签,删除 | 成功拉起应用 | | 成功并输出日志 | 是 | Pass | -| 点击按钮拉起证书管理界面 | 成功拉起应用 | | 成功拉起弹窗并输出日志 | 是 | Pass | \ No newline at end of file diff --git a/Security/DeviceCertificateKit/CertificateManagement/screenshots/CertificateManagement1.png b/Security/DeviceCertificateKit/CertificateManagement/screenshots/CertificateManagement1.png deleted file mode 100644 index 2b44666b90a7f4cb6b308e49080d9461b434cbb1..0000000000000000000000000000000000000000 Binary files a/Security/DeviceCertificateKit/CertificateManagement/screenshots/CertificateManagement1.png and /dev/null differ diff --git a/Security/DeviceCertificateKit/CertificateManagement/screenshots/CertificateManagement2.png b/Security/DeviceCertificateKit/CertificateManagement/screenshots/CertificateManagement2.png deleted file mode 100644 index 48c54cfa91b9837069b7aaf035d24e5e0d983ea6..0000000000000000000000000000000000000000 Binary files a/Security/DeviceCertificateKit/CertificateManagement/screenshots/CertificateManagement2.png and /dev/null differ diff --git a/Security/RequestUserAuthorization/.gitignore b/Security/RequestUserAuthorization/.gitignore deleted file mode 100644 index 08d606210b3993e8f1f4535767bb3459b7b1d208..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -/oh-package-lock.json5 \ No newline at end of file diff --git a/Security/RequestUserAuthorization/AppScope/app.json5 b/Security/RequestUserAuthorization/AppScope/app.json5 deleted file mode 100644 index ac059f9d34f1cc2bd4b026c15c02f3b2cc95eb8c..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.requestuserauthorization", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/Security/RequestUserAuthorization/AppScope/resources/base/element/string.json b/Security/RequestUserAuthorization/AppScope/resources/base/element/string.json deleted file mode 100644 index 7a5157cd1da7dacd3a5ad9306e07882ab049f582..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "RequestUserAuthorization" - } - ] -} diff --git a/Security/RequestUserAuthorization/AppScope/resources/base/media/app_icon.png b/Security/RequestUserAuthorization/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/Security/RequestUserAuthorization/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/Security/RequestUserAuthorization/README.md b/Security/RequestUserAuthorization/README.md deleted file mode 100644 index 5286cabe4e55daecf69183bf5690fc030078fd11..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# 向用户申请权限 - -### 介绍 - -本示例使用@ohos.abilityAccessCtrl,展示了应用申请权限场景。 - -### 效果预览 - -| 主页 | 授权弹窗 | 二次授权弹窗 | 二次授权页面 | -| ------------------------------------ | ---------------------------------------- | ---------------------------------------------------- | :----------------------------------------------------- | -| ![main](screenshots/main.png) | ![dialog](screenshots/dialog.png) | ![seconddialog](screenshots/seconddialog.png) | ![secondability](screenshots/secondability.png) | - -使用说明 - -1. 打开应用,点击**检测权限**按钮,出现提示信息“权限未申请”。 - -2. 点击**在Page中申请权限**按钮,跳到Page页面,出现授权弹窗,点击**取消**按钮,返回主页点击**检测权限**按钮,出现提示信息“权限未申请”。 - -3. 点击**在UIAbility中申请权限**按钮,跳到**secondAbility**页面,出现授权弹窗,点击**取消**按钮,出现二次授权弹窗,选择**仅使用期间允许**选项,点击**导航到EntryAbility**按钮返回主页,点击**检测权限**按钮,出现提示信息“未申请精确定位权限”。 - -4. 再次点击**在UIAbility中申请权限** 按钮,跳到**secondAbility**页面,出现授权弹窗,点击**仅使用期间允许**按钮,点击**导航到EntryAbility**按钮返回主页,点击**检测权限**按钮,出现提示信息“权限已申请“。 - -### 工程目录 -``` -RequsetUserAuthorization -├──entry/src/main -│ ├──ets // ets代码区 -│ │ ├──entryability -│ │ │ └──EntryAbility.ets // 程序入口类 -| | ├──pages // 页面文件 -│ │ │ └──Index.ets // RequsetUserAuthorization主页 -│ │ ├──reqpermissioninui -│ │ │ └──pages -│ │ │ └──Index.ets // UI申请权限页面 -│ │ ├──secondability -│ │ │ └──SecondAbility.ets // SecondAbility入口 -| | ├──secondpages // SecondAbility页面文件 -│ │ │ └──Index.ets // 二次申请权限页面 -│ │ └──utils // 工具文件 -│ │ └──PermissionUtil.ets // 校验权限工具 -| ├──resources // 资源文件目录 -│ │ -``` -### 具体实现 - -* 本示例分为权限检测模块、向用户申请权限模块 - * 权限检测模块 - * 使用bundleManager接口中getBundleInfoForSelf方法获取应用程序的accessTokenID,根据accessTokenID使用abilityAccessCtrl接口中checkAccessToken方法检测权限是否被申请。 - * 接口参考:[@ohos.abilityAccessCtrl](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-abilityAccessCtrl.md),[@ohos.bundle.bundleManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-bundleManager.md) - * 向用户申请权限模块 - * 使用abilityAccessCtrl接口中requestPermissionsFromUser方法向用户申请权限,用户拒绝后使用requestPermissionOnSetting方法拉起二次授权功能。 - * 接口参考:[@ohos.abilityAccessCtrl](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-abilityAccessCtrl.md) - -### 相关权限 - -1. 允许应用获取设备位置信息权限:[ohos.permission.LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all-user.md#ohospermissionlocation) - -2. 允许应用获取设备模糊位置信息:[ohos.permission.APPROXIMATELY_LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all-user.md#ohospermissionapproximately_location) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持在标准系统上运行,支持设备:RK3568。 - -2. 本示例为Stage模型,支持API14版本SDK,版本号:(5.0.2.58)。 - -3. 本示例已支持使DevEco Studio 5.0.1 Release (构建版本:5.0.5.306,构建 2024年12月6日)编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/Security/RequsetUserAuthorization/ > .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/Security/RequestUserAuthorization/build-profile.json5 b/Security/RequestUserAuthorization/build-profile.json5 deleted file mode 100644 index 5df1a662714175c2ccf9433cbcfde118fce7021b..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": 14, - "compatibleSdkVersion": 14, - "runtimeOS": "OpenHarmony", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/code-linter.json5 b/Security/RequestUserAuthorization/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/.gitignore b/Security/RequestUserAuthorization/entry/.gitignore deleted file mode 100644 index eadab4e1522296628f32a70228b2c758ecab4759..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test -/oh-package-lock.json5 \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/build-profile.json5 b/Security/RequestUserAuthorization/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/hvigorfile.ts b/Security/RequestUserAuthorization/entry/hvigorfile.ts deleted file mode 100644 index a3d28cb60475cede46d0aa36973096d5544dbcd1..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/RequestUserAuthorization/entry/obfuscation-rules.txt b/Security/RequestUserAuthorization/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/Security/RequestUserAuthorization/entry/oh-package.json5 b/Security/RequestUserAuthorization/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/RequestUserAuthorization/entry/src/main/ets/entryability/EntryAbility.ets b/Security/RequestUserAuthorization/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6414ace7d908f49792a1f028d57b6af68e398604..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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 { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -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/Security/RequestUserAuthorization/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Security/RequestUserAuthorization/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/RequestUserAuthorization/entry/src/main/ets/pages/Index.ets b/Security/RequestUserAuthorization/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 00dd1a5f560bdd38907f6d098a72d753387b17c7..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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 { common, Want } from '@kit.AbilityKit'; -import { checkPermissions } from '../utils/PermissionUtil'; -import router from '@ohos.router'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -@Entry -@Component -struct Index { - toSecondAbilityIndex() { - let context = getContext(this) as common.UIAbilityContext; - let want: Want = { - 'deviceId': '', - 'bundleName': 'com.samples.requestuserauthorization', - 'abilityName': 'SecondAbility', - 'moduleName': 'entry', - }; - context.startAbility(want).then(() => { - console.info(`start second ability index page succeed with ${JSON.stringify(want)}`); - }).catch((error: Error) => { - console.error(`start second ability index page failedwith ${error}`); - }); - } - - build() { - Column() { - Button($r('app.string.req_permission_page')) - .onClick(() => { - router.pushUrl({ url: 'reqpermissioninui/pages/Index' }); - }) - Button($r('app.string.req_permission_ability')) - .onClick(() => { - this.toSecondAbilityIndex(); - }) - Button($r('app.string.check_permission')) - .onClick(() => { - checkPermissions(); - }) - .type(ButtonType.Circle) - .backgroundColor(Color.Gray) - .height(100) - .width(100) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.SpaceEvenly) - } -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/ets/reqpermissioninui/pages/Index.ets b/Security/RequestUserAuthorization/entry/src/main/ets/reqpermissioninui/pages/Index.ets deleted file mode 100644 index d647a3afdb7125ce00d641573a71b325dbe7ba26..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/ets/reqpermissioninui/pages/Index.ets +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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 { router } from '@kit.ArkUI'; -// [Start request_permission_in_UI] -import { abilityAccessCtrl, common, Permissions } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -const permissions: Permissions[] = ['ohos.permission.LOCATION', 'ohos.permission.APPROXIMATELY_LOCATION']; -// 使用UIExtensionAbility:将common.UIAbilityContext 替换为common.UIExtensionContext -function reqPermissionsFromUser(permissions: Array, context: common.UIAbilityContext): void { - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗 - atManager.requestPermissionsFromUser(context, permissions).then((data) => { - let grantStatus: number[] = data.authResults; - let length: number = grantStatus.length; - for (let i = 0; i < length; i++) { - if (grantStatus[i] === 0) { - // 用户授权,可以继续访问目标操作 - } else { - // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限 - return; - } - } - // 授权成功 - }).catch((err: BusinessError) => { - console.error(`Failed to request permissions from user, code: ${err.code}, message: ${err.message}`); - }) -} - -@Entry -@Component -struct Index { - aboutToAppear() { - // 使用UIExtensionAbility:将common.UIAbilityContext 替换为common.UIExtensionContext - const context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; - reqPermissionsFromUser(permissions, context); - } - - build() { - // [StartExclude request_permission_in_UI] - Column() { - Button($r('app.string.return_main')) - .onClick(() => { - router.back(); - }) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.SpaceEvenly) - // [EndExclude request_permission_in_UI] - } -} -// [End request_permission_in_UI] \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/ets/secondability/SecondAbility.ets b/Security/RequestUserAuthorization/entry/src/main/ets/secondability/SecondAbility.ets deleted file mode 100644 index aa748430322422814e06579ad4452d9d15737426..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/ets/secondability/SecondAbility.ets +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2025 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 { AbilityConstant, Want } from '@kit.AbilityKit'; -// [Start request_permission_in_UIAbility] -// 使用UIExtensionAbility:将 UIAbility 替换为 UIExtensionAbility; -import { abilityAccessCtrl, common, Permissions, UIAbility } from '@kit.AbilityKit'; -import { window } from '@kit.ArkUI'; -import { BusinessError } from '@kit.BasicServicesKit'; - -const permissions: Permissions[] = ['ohos.permission.LOCATION', 'ohos.permission.APPROXIMATELY_LOCATION']; -// 使用UIExtensionAbility:将common.UIAbilityContext 替换为common.UIExtensionContext。 -function reqPermissionsFromUser(permissions: Array, context: common.UIAbilityContext): void { - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗。 - atManager.requestPermissionsFromUser(context, permissions).then((data) => { - let grantStatus: number[] = data.authResults; - let length: number = grantStatus.length; - for (let i = 0; i < length; i++) { - if (grantStatus[i] === 0) { - // 用户授权,可以继续访问目标操作。 - } else { - // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限。 - return; - } - } - // 授权成功。 - }).catch((err: BusinessError) => { - console.error(`Failed to request permissions from user, code: ${err.code}, message: ${err.message}`); - }) -} -// 使用UIExtensionAbility:将 UIAbility 替换为UIExtensionAbility -export default class SecondAbility extends UIAbility { - // [StartExclude request_permission_in_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'); - } - // [EndExclude request_permission_in_UIAbility] - onWindowStageCreate(windowStage: window.WindowStage): void { - // [StartExclude request_permission_in_UIAbility] - // Main window is created, set main page for this ability - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - // [EndExclude request_permission_in_UIAbility] - windowStage.loadContent('secondpages/Index', (err) => { - reqPermissionsFromUser(permissions, this.context); - // [StartExclude request_permission_in_UIAbility] - 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.'); - // [EndExclude request_permission_in_UIAbility] - }); - } - // [StartExclude request_permission_in_UIAbility] - 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 { - try { - this.context.terminateSelf((err: BusinessError) => { - if (err.code) { - // 处理业务逻辑错误 - hilog.error(0x0000, 'testTag', '%{public}s', - `terminateSelf failed, code is ${err.code}, message is ${err.message}`); - return; - } - // 执行正常业务 - hilog.info(0x0000, 'testTag', '%{public}s', 'terminateSelf succeed'); - }); - } catch (err) { - // 捕获同步的参数错误 - let code = (err as BusinessError).code; - let message = (err as BusinessError).message; - hilog.error(0x0000, 'testTag', '%{public}s', `terminateSelf failed, code is ${code}, message is ${message}`); - } - // Ability has back to background - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - - } - // [EndExclude request_permission_in_UIAbility] -} -// [End request_permission_in_UIAbility] diff --git a/Security/RequestUserAuthorization/entry/src/main/ets/secondpages/Index.ets b/Security/RequestUserAuthorization/entry/src/main/ets/secondpages/Index.ets deleted file mode 100644 index b28aac0db67a347574001afcfb5eceefe861c255..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/ets/secondpages/Index.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 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 { Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -// [Start second_request_permission] -import { abilityAccessCtrl, Context, common } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -// [StartExclude second_request_permission] -@Entry -@Component -struct Index { - build() { - Column() { - Button('再次授权') - .margin(20) - .onClick(() => { - // [EndExclude second_request_permission] - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - let context: Context = this.getUIContext().getHostContext() as common.UIAbilityContext; - atManager.requestPermissionOnSetting(context, ['ohos.permission.APPROXIMATELY_LOCATION']).then((data: Array) => { - console.info(`requestPermissionOnSetting success, result: ${data}`); - }).catch((err: BusinessError) => { - console.error(`requestPermissionOnSetting fail, code: ${err.code}, message: ${err.message}`); - }); - // [End second_request_permission] - }) - - Button($r('app.string.return_entryability')) - .onClick(() => { - let context = getContext(this) as common.UIAbilityContext; - let want: Want = { - 'deviceId': '', - 'bundleName': 'com.samples.requestuserauthorization', - 'abilityName': 'EntryAbility', - 'moduleName': 'entry', - }; - context.startAbility(want).then(() => { - console.info(`start entry ability index page succeed with ${JSON.stringify(want)}`); - }).catch((error: Error) => { - console.error(`start entry ability index page failedwith ${error}`); - }); - }) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Center) - } -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/ets/utils/PermissionUtil.ets b/Security/RequestUserAuthorization/entry/src/main/ets/utils/PermissionUtil.ets deleted file mode 100644 index 4b3d66ed7a53a274ac29b62cf7c751f3b119634e..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/ets/utils/PermissionUtil.ets +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2025 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 { promptAction } from '@kit.ArkUI'; -// [Start check_permission_func] -import { abilityAccessCtrl, bundleManager, Permissions } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; - -async function checkPermissionGrant(permission: Permissions): Promise { - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - let grantStatus: abilityAccessCtrl.GrantStatus = abilityAccessCtrl.GrantStatus.PERMISSION_DENIED; - - // 获取应用程序的accessTokenID。 - let tokenId: number = 0; - try { - let bundleInfo: bundleManager.BundleInfo = - await bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION); - let appInfo: bundleManager.ApplicationInfo = bundleInfo.appInfo; - tokenId = appInfo.accessTokenId; - } catch (error) { - const err: BusinessError = error as BusinessError; - console.error(`Failed to get bundle info for self, code: ${err.code}, message: ${err.message}`); - } - - // 校验应用是否被授予权限。 - try { - grantStatus = await atManager.checkAccessToken(tokenId, permission); - } catch (error) { - const err: BusinessError = error as BusinessError; - console.error(`Failed to check access token, code: ${err.code}, message: ${err.message}`); - } - - return grantStatus; -} - -async function checkPermissions(): Promise { - let grantStatus1: boolean = await checkPermissionGrant('ohos.permission.LOCATION') === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED;// 获取精确定位权限状态。 - let grantStatus2: boolean = await checkPermissionGrant('ohos.permission.APPROXIMATELY_LOCATION') === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED;// 获取模糊定位权限状态。 - // 精确定位权限只能跟模糊定位权限一起申请,或者已经有模糊定位权限才能申请精确定位权限。 - if (grantStatus2 && !grantStatus1) { - // 申请精确定位权限。 - // [StartExclude check_permission_func] - promptAction.showToast({ message: $r('app.string.location_not_apply') }); - // [EndExclude check_permission_func] - } else if (!grantStatus1 && !grantStatus2) { - // 申请模糊定位权限与精确定位权限或单独申请模糊定位权限。 - // [StartExclude check_permission_func] - promptAction.showToast({ message: $r('app.string.permission_not_apply') }); - // [EndExclude check_permission_func] - } else { - // 已经授权,可以继续访问目标操作。 - // [StartExclude check_permission_func] - promptAction.showToast({ message: $r('app.string.permission_apply') }); - // [EndExclude check_permission_func] - } -} -// [End check_permission_func] -export { - checkPermissionGrant, checkPermissions -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/module.json5 b/Security/RequestUserAuthorization/entry/src/main/module.json5 deleted file mode 100644 index 4559bfdffd18d0f58d96469a33be0267ff705f9e..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/module.json5 +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start request_permission_json] -{ - "module": { - // [StartExclude request_permission_json] - "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" - ] - } - ] - }, - { - "name": "SecondAbility", - "srcEntry": "./ets/secondability/SecondAbility.ets", - "description": "$string:SecondAbility_desc", - "icon": "$media:layered_image", - "label": "$string:SecondAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background" - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ] - } - ], - // [EndExclude request_permission_json] - "requestPermissions": [ - { - "name": "ohos.permission.APPROXIMATELY_LOCATION", - "reason": "$string:approximately_location_permission_reason", - "usedScene": { - "abilities": [ - "FormAbility" - ], - "when": "inuse" - } - }, - { - "name": "ohos.permission.LOCATION", - "reason": "$string:location_permission_reason", - "usedScene": { - "abilities": [ - "FormAbility" - ], - "when": "inuse" - }, - } - ] - } -} -// [End request_permission_json] \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/base/element/color.json b/Security/RequestUserAuthorization/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/base/element/string.json b/Security/RequestUserAuthorization/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 7238dc9ff876196aea9d5e414799ad75f77a9c2e..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "用户权限请求" - }, - { - "name": "approximately_location_permission_reason", - "value": "用于模糊定位" - }, - { - "name": "location_permission_reason", - "value": "用于获取定位" - }, - { - "name": "SecondAbility_desc", - "value": "description" - }, - { - "name": "SecondAbility_label", - "value": "label" - }, - { - "name": "check_permission", - "value": "检测权限" - }, - { - "name": "req_permission_ability", - "value": "在UIAbility中申请权限" - }, - { - "name": "req_permission_page", - "value": "在Page中申请权限" - }, - { - "name": "return_entryability", - "value": "导航到EntryAbility" - }, - { - "name": "return_main", - "value": "返回主页" - }, - { - "name": "location_not_apply", - "value": "未申请精确定位权限" - }, - { - "name": "permission_not_apply", - "value": "权限未申请" - }, - { - "name": "permission_apply", - "value": "权限已申请" - } - ] -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/base/media/background.png b/Security/RequestUserAuthorization/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Security/RequestUserAuthorization/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/base/media/foreground.png b/Security/RequestUserAuthorization/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Security/RequestUserAuthorization/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/base/media/layered_image.json b/Security/RequestUserAuthorization/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/base/media/startIcon.png b/Security/RequestUserAuthorization/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Security/RequestUserAuthorization/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/base/profile/backup_config.json b/Security/RequestUserAuthorization/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/base/profile/main_pages.json b/Security/RequestUserAuthorization/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 09fcbc83ac3a8443883f2b2633559260379142a1..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "src": [ - "pages/Index", - "reqpermissioninui/pages/Index", - "secondpages/Index" - ] -} diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/en_US/element/string.json b/Security/RequestUserAuthorization/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 9e0626770a741071470d898b2ede59fd09d89f5d..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "requestUserAuthorization" - }, - { - "name": "SecondAbility_desc", - "value": "description" - }, - { - "name": "SecondAbility_label", - "value": "secondAbility" - } - ] -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/main/resources/zh_CN/element/string.json b/Security/RequestUserAuthorization/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 3e22296527cba995052f4b8aba2586b1144aeb57..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "用户权限请求" - }, - { - "name": "SecondAbility_desc", - "value": "description" - }, - { - "name": "SecondAbility_label", - "value": "二次授权应用" - } - ] -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/mock/mock-config.json5 b/Security/RequestUserAuthorization/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/RequestUserAuthorization/entry/src/ohosTest/ets/test/Ability.test.ets b/Security/RequestUserAuthorization/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index dd71165a0139416af26f6b679c9bf61e407bdf6d..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2025 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { describe, it, expect } from '@ohos/hypium'; -import { Driver, ON } from '@kit.TestKit'; -import Logger from '../utils/Logger'; - -const BUNDLE = 'RequestUserAuthorization_'; -const DELAY_TIME = 1000; -let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -let manage = abilityDelegator.getAppContext().resourceManager; - -async function getResourceString(resource: Resource): Promise { - let text = await manage.getStringValue(resource); - return text; -} - -export default function abilityTest() { - let driver = Driver.create(); - describe('RequestUserAuthorizationTest', () => { - /** - * 拉起应用 - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - Logger.info(BUNDLE + 'StartAbility_001 begin'); - try { - await abilityDelegator.startAbility({ - bundleName: 'com.samples.requestuserauthorization', - abilityName: 'EntryAbility' - }) - done(); - } catch (err) { - Logger.info(BUNDLE + 'StartAbility_001,err.code:' + err.code); - expect(0).assertEqual(err.code) - done(); - } - Logger.info(BUNDLE + 'StartAbility_001 end'); - }) - /** - * 检测当前应用权限 - */ - it(BUNDLE + 'CheckPermissionFunction_001', 0, async (done: Function) => { - Logger.info(BUNDLE + 'CheckPermissionFunction_001 begin'); - await driver.delayMs(DELAY_TIME); - // 点击检测权限 - let str = await getResourceString($r('app.string.check_permission')); - await driver.assertComponentExist(ON.text(str)); - let checkBtn = await driver.findComponent(ON.text(str)); - await checkBtn.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'CheckPermissionFunction_001 end'); - done(); - }) - /** - * 在Page中申请权限并取消 - */ - it(BUNDLE + 'CancelPermissionInPageFunction_001', 0, async (done: Function) => { - Logger.info(BUNDLE + 'CancelPermissionInPageFunction_001 begin'); - await driver.delayMs(DELAY_TIME); - // 点击在Page中申请权限 - let str = await getResourceString($r('app.string.req_permission_page')); - await driver.assertComponentExist(ON.text(str)); - let reqPermissionInUI = await driver.findComponent(ON.text(str)); - await reqPermissionInUI.click(); - await driver.delayMs(DELAY_TIME); - // 点击取消授权 - str = await getResourceString($r('app.string.cancel')); - await driver.assertComponentExist(ON.text(str)); - let cancelBtn = await driver.findComponent(ON.text(str)); - await cancelBtn.click(); - await driver.delayMs(DELAY_TIME); - // 返回主页 - str = await getResourceString($r('app.string.return_main')); - await driver.assertComponentExist(ON.text(str)); - let backBtn = await driver.findComponent(ON.text(str)); - await backBtn.click(); - await driver.delayMs(DELAY_TIME); - // 点击检测权限 - str = await getResourceString($r('app.string.check_permission')); - await driver.assertComponentExist(ON.text(str)); - let checkPermissionBtn = await driver.findComponent(ON.text(str)); - await checkPermissionBtn.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'CancelPermissionInPageFunction_001 end'); - done(); - }) - /** - * 在UIAbility中取消申请权限并拉起二次授权 - */ - it(BUNDLE + 'CancelPermissionInUIAbilityFunction_001', 0, async (done: Function) => { - Logger.info(BUNDLE + 'CancelPermissionInUIAbilityFunction_001 begin'); - await driver.delayMs(DELAY_TIME); - // 点击在UIAbility中申请权限 - let str = await getResourceString($r('app.string.req_permission_ability')); - await driver.assertComponentExist(ON.text(str)); - let reqPermissionInAbility = await driver.findComponent(ON.text(str)); - await reqPermissionInAbility.click(); - await driver.delayMs(DELAY_TIME); - // 点击取消 - str = await getResourceString($r('app.string.cancel')); - await driver.assertComponentExist(ON.text(str)); - let cancelBtn = await driver.findComponent(ON.text(str)); - await cancelBtn.click(); - await driver.delayMs(DELAY_TIME); - // 点击仅使用期间允许 - str = await getResourceString($r('app.string.allowed_only_during_use')); - await driver.assertComponentExist(ON.text(str)); - let agreeBtn = await driver.findComponent(ON.text(str)); - await agreeBtn.click(); - await driver.delayMs(DELAY_TIME); - // 点击导航到EntryAbility - str = await getResourceString($r('app.string.return_entryability')); - await driver.assertComponentExist(ON.text(str)); - let backBtn = await driver.findComponent(ON.text(str)); - await backBtn.click(); - await driver.delayMs(DELAY_TIME); - // 点击检测权限 - str = await getResourceString($r('app.string.check_permission')); - await driver.assertComponentExist(ON.text(str)); - let checkPermissionBtn = await driver.findComponent(ON.text(str)); - await checkPermissionBtn.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'CancelPermissionInUIAbilityFunction_001 end'); - done(); - }) - - /** - * 在UIAbility中同意授权 - */ - it(BUNDLE + 'AllowPermissionInUIAbilityFunction_001', 0, async (done: Function) => { - Logger.info(BUNDLE + 'AllowPermissionInUIAbilityFunction_001 begin'); - await driver.delayMs(DELAY_TIME); - // 点击在UIAbility中申请权限 - let str = await getResourceString($r('app.string.req_permission_ability')); - await driver.assertComponentExist(ON.text(str)); - let reqPermissionInAbility = await driver.findComponent(ON.text(str)); - await reqPermissionInAbility.click(); - await driver.delayMs(DELAY_TIME); - // 点击仅使用期间允许 - str = await getResourceString($r('app.string.allowed_only_during_use')); - await driver.assertComponentExist(ON.text(str)); - let agreeBtn = await driver.findComponent(ON.text(str)); - await agreeBtn.click(); - await driver.delayMs(DELAY_TIME); - // 点击导航到EntryAbility - str = await getResourceString($r('app.string.return_entryability')); - await driver.assertComponentExist(ON.text(str)); - let backBtn = await driver.findComponent(ON.text(str)); - await backBtn.click(); - await driver.delayMs(DELAY_TIME); - // 点击检测权限 - str = await getResourceString($r('app.string.check_permission')); - await driver.assertComponentExist(ON.text(str)); - let checkPermissionBtn = await driver.findComponent(ON.text(str)); - await checkPermissionBtn.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'AllowPermissionInUIAbilityFunction_001 end'); - done(); - }) - }) -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/ohosTest/ets/test/List.test.ets b/Security/RequestUserAuthorization/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/ohosTest/ets/utils/Logger.ts b/Security/RequestUserAuthorization/entry/src/ohosTest/ets/utils/Logger.ts deleted file mode 100644 index 3a2078642ad8bf64b5900fdf62aabc678d9e2592..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/ohosTest/ets/utils/Logger.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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 '@ohos.hilog'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('[Sample_RequestUserAuthorization]'); \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/ohosTest/module.json5 b/Security/RequestUserAuthorization/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/Security/RequestUserAuthorization/entry/src/ohosTest/resources/base/element/string.json b/Security/RequestUserAuthorization/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 219973d467ba1f6fb6e93f3e7513a54f04f76b03..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "check_permission", - "value": "检测权限" - }, - { - "name": "req_permission_ability", - "value": "在UIAbility中申请权限" - }, - { - "name": "req_permission_page", - "value": "在Page中申请权限" - }, - { - "name": "return_entryability", - "value": "导航到EntryAbility" - }, - { - "name": "return_main", - "value": "返回主页" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "allowed_only_during_use", - "value": "仅使用期间允许" - } - ] -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/test/List.test.ets b/Security/RequestUserAuthorization/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/entry/src/test/LocalUnit.test.ets b/Security/RequestUserAuthorization/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/Security/RequestUserAuthorization/hvigor/hvigor-config.json5 b/Security/RequestUserAuthorization/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/RequestUserAuthorization/hvigorfile.ts b/Security/RequestUserAuthorization/hvigorfile.ts deleted file mode 100644 index 4beb74fe5b573059b972acf9312d33ea1703c016..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/RequestUserAuthorization/oh-package.json5 b/Security/RequestUserAuthorization/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Security/RequestUserAuthorization/ohosTest.md b/Security/RequestUserAuthorization/ohosTest.md deleted file mode 100644 index ca24e628b57b9ef3665f253df36bb316c62f8174..0000000000000000000000000000000000000000 --- a/Security/RequestUserAuthorization/ohosTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# 向用户申请权限测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------ | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 检测权限 | 成功拉起应用 | 点击“检测权限”按钮 | 提示框显示“权限未授予” | 是 | Pass | -| 在Page中申请权限 | 成功拉起应用,点击”在Page中申请权限“按钮后,成功进入“在Page中申请权限”界面,弹出申请权限弹窗 | 点击“取消”按钮->点击“返回主页”按钮->点击“检测权限”按钮 | 提示框显示“权限未授予” | 是 | Pass | -| 在Ability中申请权限 | 成功拉起应用,点击”在Ability中申请权限“按钮后,成功进入“在Page中申请权限”界面,弹出申请权限弹窗 | 点击“取消”按钮 | 出现二次申请权限弹窗 | 是 | Pass | -| 进行二次授权 | 成功拉起应用,点击”在Ability中申请权限“按钮后,成功进入“在Page中申请权限”界面,弹出申请权限弹窗,点击“取消按钮”,出现二次申请权限弹窗 | 点击“仅使用期间允许”按钮->点击“导航到EntryAbility”按钮->点击"检测权限按钮" | 提示框显示“未申请精确定位权限” | 是 | Pass | -| 授予所有权限 | 成功拉起应用,点击”在Ability中申请权限“按钮后,成功进入“在Page中申请权限”界面,弹出申请权限弹窗 | 点击“仅使用期间允许”按钮->点击“导航到EntryAbility”按钮->点击"检测权限按钮" | 提示框显示“权限已授予” | 是 | Pass | - diff --git a/Security/RequestUserAuthorization/screenshots/dialog.png b/Security/RequestUserAuthorization/screenshots/dialog.png deleted file mode 100644 index 4c4a47b6e41984f9db484c20b25299c1a054a4f8..0000000000000000000000000000000000000000 Binary files a/Security/RequestUserAuthorization/screenshots/dialog.png and /dev/null differ diff --git a/Security/RequestUserAuthorization/screenshots/main.png b/Security/RequestUserAuthorization/screenshots/main.png deleted file mode 100644 index 330cd470e2e7316a57b726679d3d2a8b52ade8b3..0000000000000000000000000000000000000000 Binary files a/Security/RequestUserAuthorization/screenshots/main.png and /dev/null differ diff --git a/Security/RequestUserAuthorization/screenshots/secondability.png b/Security/RequestUserAuthorization/screenshots/secondability.png deleted file mode 100644 index 8f2ebef023e0b32edbef10c6691860ae56456c59..0000000000000000000000000000000000000000 Binary files a/Security/RequestUserAuthorization/screenshots/secondability.png and /dev/null differ diff --git a/Security/RequestUserAuthorization/screenshots/seconddialog.png b/Security/RequestUserAuthorization/screenshots/seconddialog.png deleted file mode 100644 index 12ffdc8a8026bbf011578aa5804573d3389eb3f4..0000000000000000000000000000000000000000 Binary files a/Security/RequestUserAuthorization/screenshots/seconddialog.png and /dev/null differ diff --git a/Security/SecurityComponent/.gitignore b/Security/SecurityComponent/.gitignore deleted file mode 100644 index 08d606210b3993e8f1f4535767bb3459b7b1d208..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer -/oh-package-lock.json5 \ No newline at end of file diff --git a/Security/SecurityComponent/AppScope/app.json5 b/Security/SecurityComponent/AppScope/app.json5 deleted file mode 100644 index 3a606bfd52a238e3778f0a65e66793e19a576726..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.samples.securitycomponent", - "vendor": "samples", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/Security/SecurityComponent/AppScope/resources/base/element/string.json b/Security/SecurityComponent/AppScope/resources/base/element/string.json deleted file mode 100644 index 4745dc6c76c61623aff481b7cdf86a1772c4b95b..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "SecurityComponent" - } - ] -} diff --git a/Security/SecurityComponent/AppScope/resources/base/media/app_icon.png b/Security/SecurityComponent/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/Security/SecurityComponent/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/Security/SecurityComponent/README.md b/Security/SecurityComponent/README.md deleted file mode 100644 index b3740757200fdbf3dec7b907f05e9ea91af4eb88..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# 安全控件类型的UI控件(仅对系统应用开放) - -### 介绍 - -本示例提供了安全控件类型的UI控件,支撑应用开发者集成安全控件做临时授权场景,当用户实际点击了某种类型的安全控件时,会对应用进行相应的临时授权,减少权限弹窗对用户的干扰,同时提供更小的授权范围。 - -### 效果预览 - -| 主页 | Location | Paste | **Save** | -|:-----------------------------------:| :--------------------------------------------: |:---------------------------------------:| :------------------------------------: | -| ![main](screenshots/main.jpeg) | ![location](screenshots/location.jpeg) | ![paste](screenshots/paste.jpeg) | ![save](screenshots/save.jpeg) | - -使用说明 -1. 在主界面,点击“Location”按钮,进入“Location”界面,点击“当前位置”按钮,成功获取当前定位信息,并通过提示框显示。 - -2. 在主界面,点击“Paste”按钮,进入“Paste”界面,在文本输入框输入文字,全选剪切文字,点击“粘贴”按钮,获取剪贴板内容并显示在输入框中。 - -3. 在主界面,点击“Save”按钮,进入“Save”界面,点击“下载”按钮,将当前页面中的图片保存到本地的图库中。 - -### 工程目录 - -``` -SecurityComponent -├──entry/src/main -│ ├──ets -│ │ ├──entryability -│ │ │ └──EntryAbility.ets // 程序入口类 -| | ├──pages // 页面文件 -│ │ │ └──Index.ets // 首页 -│ │ └──securitycomponent // 组件文件 -│ │ └──page -│ │ ├──Location.ets // 位置服务安全控件界面 -│ │ ├──Paste.ets // 剪贴板安全控件界面 -│ │ └──Save.ets // 媒体库安全控件界面 -| ├──resources // 资源文件目录 -│ │ - -``` - -### 具体实现 - -* 本示例分为Location安全控件模块,剪贴板安全控件模块,媒体库安全控件模块。 - - * Location安全控件模块 - - * 使用LocationButton组件开发获取定位信息功能,在其点击回调onclick事件中调用geoLocationManager.getCurrentLocation()得到当前定位信息经纬度。 - * 接口参考:[@ohos.geoLocationManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-location-kit/js-apis-geoLocationManager.md#geolocationmanagergetcurrentlocation) - * 剪贴板安全控件模块 - - * 使用PasteButton组件开发获取剪贴板信息功能,在其点击回调onclick事件中调用pasteboard.getSystemPasteboard().getData()将文本复制到剪贴板中,使用pasteData.getPrimaryText()得到剪贴板内容。 - * 接口参考:[@ohos.pasteboard](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-pasteboard.md) - * 媒体库安全控件模块 - - * 使用SaveButton组件开发保存图片到媒体库功能,在其点击回调onclick事件中调用photoAccessHelper.getPhotoAccessHelper()得到媒体库图片管理器helper, helper.createAsset()得到保存到媒体库图片的uri,使用resourceManager.getMediaContent()得到存放在Resources/base/media文件下的test.jpg图片内容,调用fs.open()和fs.write()将图片内容通过得到的uri写到媒体库中,最后fs.close()关闭文件。 - * 接口参考:[@ohos.file.photoAccessHelper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.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) - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:RK3568,GPS定位功能仅支持部分机型。 -2. 本示例为Stage模型,支持API14版本SDK,版本号:(5.0.2.58)。 -4. 本示例已支持使DevEco Studio 5.0.1 Release (构建版本:5.0.5.306,构建 2024年12月6日)编译运行。 -5. 本示例需要使用系统权限的系统接口,需要使用Full SDK编译。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](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)。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/Security/SecurityComponent/ > .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/Security/SecurityComponent/build-profile.json5 b/Security/SecurityComponent/build-profile.json5 deleted file mode 100644 index 5df1a662714175c2ccf9433cbcfde118fce7021b..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025 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", - "compileSdkVersion": 14, - "compatibleSdkVersion": 14, - "runtimeOS": "OpenHarmony", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Security/SecurityComponent/code-linter.json5 b/Security/SecurityComponent/code-linter.json5 deleted file mode 100644 index 28586467ee7a761c737d8654a73aed6fddbc3c71..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/code-linter.json5 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/.gitignore b/Security/SecurityComponent/entry/.gitignore deleted file mode 100644 index eadab4e1522296628f32a70228b2c758ecab4759..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test -/oh-package-lock.json5 \ No newline at end of file diff --git a/Security/SecurityComponent/entry/build-profile.json5 b/Security/SecurityComponent/entry/build-profile.json5 deleted file mode 100644 index e7569e3056e27af38e9991b7ea73ec10f3ba8a05..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/hvigorfile.ts b/Security/SecurityComponent/entry/hvigorfile.ts deleted file mode 100644 index a3d28cb60475cede46d0aa36973096d5544dbcd1..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/SecurityComponent/entry/obfuscation-rules.txt b/Security/SecurityComponent/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/Security/SecurityComponent/entry/oh-package.json5 b/Security/SecurityComponent/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/SecurityComponent/entry/src/main/ets/entryability/EntryAbility.ets b/Security/SecurityComponent/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 0f2f8b94aa24b0a50e272270e4e18b6df93ac5fd..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/SecurityComponent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/Security/SecurityComponent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b1e212947256c5533c7b06285a597c94f840a6e3..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/SecurityComponent/entry/src/main/ets/pages/Index.ets b/Security/SecurityComponent/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 4c49d15c873fc6762290ac20f0f77c347c6b5a38..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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 router from '@ohos.router'; - -@Entry -@Component -struct Index { - private pageName: string [] = ['Paste', 'Save']; - @State text: string = ''; - - openPage(pageName: string) { - router.pushUrl({ - url: 'securitycomponent/pages/' + pageName, - }); - } - - build() { - Column() { - ForEach(this.pageName, (item: string) => { - Button() { - Text(item + this.text) - .fontSize(19) - .fontColor(Color.White) - .fontWeight(FontWeight.Bold) - .padding({ left: 10, right: 10 }) - .width('80%') - .textAlign(TextAlign.Center) - } - .id(item) - .height(40) - .type(ButtonType.Capsule) - .backgroundColor('#0D9FFB') - .margin({ top: 20 }) - .onClick(() => { - this.openPage(item); - }) - }, (item: string) => JSON.stringify(item)) - } - .justifyContent(FlexAlign.Center) - .alignItems(HorizontalAlign.Center) - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/main/ets/securitycomponent/pages/Paste.ets b/Security/SecurityComponent/entry/src/main/ets/securitycomponent/pages/Paste.ets deleted file mode 100644 index cf4cc106b455a939be998cb4180a4c3b5b036a96..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/ets/securitycomponent/pages/Paste.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start use_paste_button] -import { pasteboard, BusinessError } from '@kit.BasicServicesKit'; - -@Entry -@Component -struct Index { - @State message: string = ''; - - build() { - Row() { - Column({ space: 10 }) { - TextInput({ placeholder: '请输入验证码', text: this.message }) - PasteButton() - .padding({top: 12, bottom: 12, left: 24, right: 24}) - .onClick((event: ClickEvent, result: PasteButtonOnClickResult) => { - if (PasteButtonOnClickResult.SUCCESS === result) { - pasteboard.getSystemPasteboard().getData((err: BusinessError, pasteData: pasteboard.PasteData) => { - if (err) { - console.error(`Failed to get paste data. Code is ${err.code}, message is ${err.message}`); - return; - } - // 剪贴板内容为 '123456'。 - this.message = pasteData.getPrimaryText(); - }); - } - }) - } - .width('100%') - } - .height('100%') - } -} -// [End use_paste_button] \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/main/ets/securitycomponent/pages/Save.ets b/Security/SecurityComponent/entry/src/main/ets/securitycomponent/pages/Save.ets deleted file mode 100644 index 3b2ae887646abb0c571689618170fd1744ea422d..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/ets/securitycomponent/pages/Save.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start use_save_button] -import { photoAccessHelper } from '@kit.MediaLibraryKit'; -import { fileIo } from '@kit.CoreFileKit'; -import { common } from '@kit.AbilityKit'; -import { promptAction } from '@kit.ArkUI'; -import { BusinessError } from '@kit.BasicServicesKit'; - -async function savePhotoToGallery(context: common.UIAbilityContext) { - let helper = photoAccessHelper.getPhotoAccessHelper(context); - try { - // onClick触发后一分钟内通过createAsset接口创建图片文件,一分钟后createAsset权限收回。 - let uri = await helper.createAsset(photoAccessHelper.PhotoType.IMAGE, 'jpg'); - // 使用uri打开文件,可以持续写入内容,写入过程不受时间限制。 - let file = await fileIo.open(uri, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); - // $r('app.media.startIcon')需要替换为开发者所需的图像资源文件。 - context.resourceManager.getMediaContent($r('app.media.startIcon').id, 0) - .then(async value => { - let media = value.buffer; - // 写到媒体库文件中。 - await fileIo.write(file.fd, media); - await fileIo.close(file.fd); - promptAction.openToast({ message: '已保存至相册!' }); - }); - } catch (error) { - const err: BusinessError = error as BusinessError; - console.error(`Failed to save photo. Code is ${err.code}, message is ${err.message}`); - } -} - -@Entry -@Component -struct Index { - build() { - Row() { - Column({ space: 10 }) { - // $r('app.media.startIcon')需要替换为开发者所需的图像资源文件。 - Image($r('app.media.startIcon')) - .height(50) - .width(50) - - SaveButton() - .padding({top: 12, bottom: 12, left: 24, right: 24}) - .onClick((event: ClickEvent, result: SaveButtonOnClickResult) => { - if (result === SaveButtonOnClickResult.SUCCESS) { - const context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; - // 免去权限申请和权限请求等环节,获得临时授权,保存对应图片。 - savePhotoToGallery(context); - } else { - promptAction.openToast({ message: '设置权限失败!' }); - } - }) - } - .width('100%') - } - .height('100%') - .backgroundColor(0xf1f3f5) - } -} -// [End use_save_button] \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/main/module.json5 b/Security/SecurityComponent/entry/src/main/module.json5 deleted file mode 100644 index 4144486d1af4c03b0d767cce1cda86fc0d697f91..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/module.json5 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/SecurityComponent/entry/src/main/resources/base/element/color.json b/Security/SecurityComponent/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/main/resources/base/element/string.json b/Security/SecurityComponent/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 160359841be7cabf65747992508b79d76ef84e9d..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "SecurityComponent" - }, - { - "name": "get_location_failed", - "value": "获取位置信息失败!" - }, - { - "name": "input_verify_code", - "value": "请输入验证码" - }, - { - "name": "saved_in_photo", - "value": "已保存至相册!" - }, - { - "name": "set_permission_failed", - "value": "设置权限失败!" - } - ] -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/main/resources/base/media/background.png b/Security/SecurityComponent/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/Security/SecurityComponent/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Security/SecurityComponent/entry/src/main/resources/base/media/foreground.png b/Security/SecurityComponent/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/Security/SecurityComponent/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Security/SecurityComponent/entry/src/main/resources/base/media/layered_image.json b/Security/SecurityComponent/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/main/resources/base/media/startIcon.png b/Security/SecurityComponent/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Security/SecurityComponent/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Security/SecurityComponent/entry/src/main/resources/base/media/test.jpg b/Security/SecurityComponent/entry/src/main/resources/base/media/test.jpg deleted file mode 100644 index e1831c7f9c88afb039d71bfdee61af67c41b1767..0000000000000000000000000000000000000000 Binary files a/Security/SecurityComponent/entry/src/main/resources/base/media/test.jpg and /dev/null differ diff --git a/Security/SecurityComponent/entry/src/main/resources/base/profile/backup_config.json b/Security/SecurityComponent/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/main/resources/base/profile/main_pages.json b/Security/SecurityComponent/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index a6a4a701adcd6377a4619b38f43f4c2461393a59..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "src": [ - "pages/Index", - "securitycomponent/pages/Paste", - "securitycomponent/pages/Save" - ] -} diff --git a/Security/SecurityComponent/entry/src/main/resources/en_US/element/string.json b/Security/SecurityComponent/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f247beb3ef35791f6a203ccd3886b86627c4f025..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "securityComponent" - } - ] -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/main/resources/zh_CN/element/string.json b/Security/SecurityComponent/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 4aa85070675744fee81dfbd936f1cf9171116457..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "安全组件" - } - ] -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/mock/mock-config.json5 b/Security/SecurityComponent/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/SecurityComponent/entry/src/ohosTest/ets/test/Ability.test.ets b/Security/SecurityComponent/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index b7e9f1b20ef9385d3b2dee79c239df97236ca669..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2025 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 AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { describe, it, expect } from '@ohos/hypium'; -import { Driver, ON } from '@ohos.UiTest'; -import Logger from '../utils/Logger'; - -const BUNDLE = 'SecurityComponent_'; -const DELAY_TIME = 1000; -let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -let manage = abilityDelegator.getAppContext().resourceManager; - -async function getResourceString(resource: Resource): Promise { - let text = await manage.getStringValue(resource); - return text; -} - -export default function abilityTest() { - let driver = Driver.create(); - describe('SecurityComponentTest', (done: Function) => { - /** - * 拉起应用 - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - Logger.info(BUNDLE + 'StartAbility_001 begin'); - try { - await abilityDelegator.startAbility({ - bundleName: 'com.samples.securitycomponent', - abilityName: 'EntryAbility' - }) - done(); - } catch (exception) { - Logger.info(`StartAbility_001 exception = ${JSON.stringify(exception)}`); - expect().assertFail(); - done(); - } - Logger.info(BUNDLE + 'StartAbility_001 end'); - }) - /** - * 获取定位信息 - */ - it(BUNDLE + 'GetLocation_001', 0, async (done: Function) => { - Logger.info(BUNDLE + 'GetLocation_001 begin'); - await driver.delayMs(DELAY_TIME); - // 点击Location - await driver.assertComponentExist(ON.id('Location')); - let location = await driver.findComponent(ON.id('Location')); - await location.click(); - await driver.delayMs(DELAY_TIME); - // 点击LocationButton获取定位信息 - await driver.assertComponentExist(ON.type('LocationButton')); - let locationButton = await driver.findComponent(ON.type('LocationButton')); - await locationButton.click(); - await driver.delayMs(DELAY_TIME); - // 点击允许 - let str = await getResourceString($r('app.string.admit')); - await driver.assertComponentExist(ON.text(str)); - let button = await driver.findComponent(ON.text(str)); - await button.click(); - await driver.delayMs(DELAY_TIME * 5); - // 返回 - await driver.pressBack(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'GetLocation_001 end'); - done(); - }) - - /** - * 获取剪贴板内容 - */ - it(BUNDLE + 'GetPasteContent_001', 0, async (done: Function) => { - Logger.info(BUNDLE + 'GetPasteContent_001 begin'); - await driver.delayMs(DELAY_TIME); - // 点击Paste - await driver.assertComponentExist(ON.id('Paste')); - let paste = await driver.findComponent(ON.id('Paste')); - await paste.click(); - await driver.delayMs(DELAY_TIME); - // 点击TextInput输入'123456'文本 - await driver.assertComponentExist(ON.type('TextInput')); - let textInput = await driver.findComponent(ON.type('TextInput')); - await textInput.inputText('123456'); - await textInput.longClick(); - await driver.delayMs(DELAY_TIME); - // 点击全选按钮 - let str = await getResourceString($r('app.string.select_all')); - await driver.assertComponentExist(ON.text(str)); - let selectButton = await driver.findComponent(ON.text(str)); - await selectButton.click(); - await driver.delayMs(DELAY_TIME); - // 点击剪切选项 - str = await getResourceString($r('app.string.cut')); - await driver.assertComponentExist(ON.text(str)); - let cutButton = await driver.findComponent(ON.text(str)); - await cutButton.click(); - await driver.delayMs(DELAY_TIME); - // 隐藏输入法 - await driver.pressBack(); - await driver.delayMs(DELAY_TIME); - // 点击pasteButton 粘贴'123456'文本 - await driver.assertComponentExist(ON.type('PasteButton')); - let copyButton = await driver.findComponent(ON.type('PasteButton')); - await copyButton.click(); - await driver.delayMs(DELAY_TIME); - // 返回主页 - await driver.pressBack(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'GetPasteContent_001 end'); - done(); - }) - - /** - * 保存图片到媒体库 - */ - it(BUNDLE + 'Save_001', 0, async (done: Function) => { - Logger.info(BUNDLE + 'Save_001 begin'); - await driver.delayMs(DELAY_TIME); - // 点击Save - await driver.assertComponentExist(ON.id('Save')); - let save = await driver.findComponent(ON.id('Save')); - await save.click(); - await driver.delayMs(DELAY_TIME); - // 点击LocationButton获取定位信息 - await driver.assertComponentExist(ON.type('SaveButton')); - let saveButton = await driver.findComponent(ON.type('SaveButton')); - await saveButton.click(); - await driver.delayMs(DELAY_TIME); - // 点击允许 - let str = await getResourceString($r('app.string.admit')); - await driver.assertComponentExist(ON.text(str)); - let Button = await driver.findComponent(ON.text(str)); - await Button.click(); - await driver.delayMs(DELAY_TIME); - // 返回 - await driver.pressBack(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + 'Save_001 end'); - done(); - }) - }) -} - diff --git a/Security/SecurityComponent/entry/src/ohosTest/ets/test/List.test.ets b/Security/SecurityComponent/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/ohosTest/ets/utils/Logger.ts b/Security/SecurityComponent/entry/src/ohosTest/ets/utils/Logger.ts deleted file mode 100644 index c0672b968e8e940b62d5b943f31f9a9aa7e0fbc1..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/ohosTest/ets/utils/Logger.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 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 '@ohos.hilog'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xF811; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('[Sample_SecurityComponent]'); \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/ohosTest/module.json5 b/Security/SecurityComponent/entry/src/ohosTest/module.json5 deleted file mode 100644 index 924e61edf7b81c0583debc543425a2cb893c913b..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - } -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/ohosTest/resources/base/element/string.json b/Security/SecurityComponent/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 078f1487cf82614f4df507fcafd7c941ea7a5d3b..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "admit", - "value": "允许" - }, - { - "name": "select_all", - "value": "全选" - }, - { - "name": "cut", - "value": "剪切" - } - ] -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/test/List.test.ets b/Security/SecurityComponent/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/Security/SecurityComponent/entry/src/test/LocalUnit.test.ets b/Security/SecurityComponent/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/Security/SecurityComponent/hvigor/hvigor-config.json5 b/Security/SecurityComponent/hvigor/hvigor-config.json5 deleted file mode 100644 index 43beb743cbd25c3507b1cf8a744bf8197b3bf2fb..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/SecurityComponent/hvigorfile.ts b/Security/SecurityComponent/hvigorfile.ts deleted file mode 100644 index 4beb74fe5b573059b972acf9312d33ea1703c016..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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/Security/SecurityComponent/oh-package.json5 b/Security/SecurityComponent/oh-package.json5 deleted file mode 100644 index 93f097993a458e967d6d5239ea0580e79b5d6998..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.19", - "@ohos/hamock": "1.0.0" - } -} diff --git a/Security/SecurityComponent/ohosTest.md b/Security/SecurityComponent/ohosTest.md deleted file mode 100644 index f1dd06475c698ea844712e308d4a349edcb0cf42..0000000000000000000000000000000000000000 --- a/Security/SecurityComponent/ohosTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# 安全控件测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| -------------- | ------------------------------------------------------------ | ------------------ | ---------------------------- | -------- | -------- | -| 拉起应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 获取定位信息 | 成功拉起应用,点击”Location“按钮后,成功进入“Location”界面 | 点击“当前位置”按钮 | 提示框显示获取位置信息失败 | 是 | Pass | -| 剪切输入框内容 | 成功拉起应用,点击”Paste“按钮后,成功进入“Paste”界面,拉起输入法,输入文本后长按输入框,点击“全选”按钮 | 点击“剪切”按钮 | 文本被剪切,输入框清除文本 | 是 | Pass | -| 获取剪贴板内容 | 成功拉起应用,点击”Paste“按钮后,成功进入“Paste”界面,成功得到输入文本 | 点击“粘贴”按钮 | 剪切的文本信息出现在文本框中 | 是 | Pass | -| 保存图片 | 成功拉起应用,点击”SaveButton“按钮后,成功进入“SaveButton”界面 | 点击“下载”按钮 | 弹出提示框,文件保存成功 | 是 | Pass | \ No newline at end of file diff --git a/Security/SecurityComponent/screenshots/location.jpeg b/Security/SecurityComponent/screenshots/location.jpeg deleted file mode 100644 index 914eaa22f8a651b13f44ba47e9b12fd7eacbc490..0000000000000000000000000000000000000000 Binary files a/Security/SecurityComponent/screenshots/location.jpeg and /dev/null differ diff --git a/Security/SecurityComponent/screenshots/main.jpeg b/Security/SecurityComponent/screenshots/main.jpeg deleted file mode 100644 index ba804573ab5b80fa80ab6f8cfe4b988b8f33f397..0000000000000000000000000000000000000000 Binary files a/Security/SecurityComponent/screenshots/main.jpeg and /dev/null differ diff --git a/Security/SecurityComponent/screenshots/paste.jpeg b/Security/SecurityComponent/screenshots/paste.jpeg deleted file mode 100644 index 470b8f250c98f64050721924458a3eb0f9b77cfe..0000000000000000000000000000000000000000 Binary files a/Security/SecurityComponent/screenshots/paste.jpeg and /dev/null differ diff --git a/Security/SecurityComponent/screenshots/save.jpeg b/Security/SecurityComponent/screenshots/save.jpeg deleted file mode 100644 index 6fcc8a8d531a2ad1b563b22f100a77a6d93462c7..0000000000000000000000000000000000000000 Binary files a/Security/SecurityComponent/screenshots/save.jpeg and /dev/null differ diff --git a/USB/USBManagerSample/.gitignore b/USB/USBManagerSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/USB/USBManagerSample/AppScope/app.json5 b/USB/USBManagerSample/AppScope/app.json5 deleted file mode 100644 index b3c9ad05398730528d0c1e3394156b5404447848..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (C) 2025 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.samples.usbmanagersample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/USB/USBManagerSample/AppScope/resources/base/element/string.json b/USB/USBManagerSample/AppScope/resources/base/element/string.json deleted file mode 100644 index c406455798d24cbdaaf269a957c2043d1c8000c6..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "USBManagerSample" - } - ] -} diff --git a/USB/USBManagerSample/AppScope/resources/base/media/background.png b/USB/USBManagerSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/USB/USBManagerSample/AppScope/resources/base/media/foreground.png b/USB/USBManagerSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/USB/USBManagerSample/AppScope/resources/base/media/layered_image.json b/USB/USBManagerSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/USB/USBManagerSample/README.md b/USB/USBManagerSample/README.md deleted file mode 100644 index 363f940d4f962a9698652af09c9fe05e63ad5378..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/README.md +++ /dev/null @@ -1,72 +0,0 @@ -# USBManagerSample - -### 介绍 - -本示例主要展示了USB设备管理以及四种基本传输方式:
-1. [USB设备管理](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/usb/usbManager/usbHost/deviceManager.md)。
-2. [批量传输](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/usb/usbManager/usbHost/bulkTransfer.md)。
-3. [控制传输](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/usb/usbManager/usbHost/controlTransfer.md)。
-4. [中断传输](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/usb/usbManager/usbHost/interruptTransfer.md)。
-5. [实时传输](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/usb/usbManager/usbHost/isochronousTransfer.md)。 - -### 效果预览 -![Index](screenshots/usb.jpeg) - -使用说明 - -1. 连接一个usb外设 -2. 点击“获取设备列表”,获取当前设备 -3. 点击“获取设备操作权限”,弹窗询问是否授权操作权限,点击允许 -4. 点击“打开设备”,打开当前设备 -5. 分别点击四种传输方式 -6. 点击“关闭设备” - -### 工程目录 - -``` -entry/src/ -|---main -| |---ets -| | |---pages -| | | |---Index.ets // 首页 -|---ohosTest -| |---ets -| | |---tests -| | | |---Ability.test.ets // 自动化测试用例 -``` - -### 具体实现 -* 导入相关模块import { usbManager } from '@kit.BasicServicesKit'。 -* 获取设备列表:调用usbManager.getDevices()获取当前连接的所有外设。 -* 获取设备权限:调用usbManager.requestRight()获取设备权限。 -* 打开设备:调用usbManager.connectDevice()打开设备,获取数据传输通道,调用usbManager.claimInterface()占用一个设备接口。 -* 批量传输:调用usbManager.bulkTransfer(),endpoint.direction == 0x80为读数据,endpoint.direction == 0为写数据。 -* 控制传输:调用usbManager.usbControlTransfer()传输控制数据。 -* 中断传输和实时传输:调用usbManager.usbSubmitTransfer(),入参的UsbDataTransferParams.type == usbManager.UsbEndpointTransferType.TRANSFER_TYPE_INTERRUPT为中断传输,UsbDataTransferParams.type == usbManager.UsbEndpointTransferType.TRANSFER_TYPE_ISOCHRONOUS为实时传输。 -* 关闭设备:调用usbManager.releaseInterface()释放设备接口,调用usbManager.closePipe()关闭设备管道。 - -### 相关权限 - -无相关权限。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:rk3568; -2. 本示例仅支持API20版本SDK,镜像版本号:OpenHarmony 6.0.0.x及之后的版本; -3. 本示例需要使用DevEco Studio 6.0.0 release (Build Version: 6.0.0.858)才可编译运行; - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/USB/USBManagerSample/ > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin ***(分支名) -``` \ No newline at end of file diff --git a/USB/USBManagerSample/build-profile.json5 b/USB/USBManagerSample/build-profile.json5 deleted file mode 100644 index 4d771ed495345faf545f97069fb16184db5162c4..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* -* Copyright (C) 2025 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", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "compileSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSample/code-linter.json5 b/USB/USBManagerSample/code-linter.json5 deleted file mode 100644 index 7f67b9ad794978e0469d9de745934605b23a7cd9..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* -* Copyright (C) 2025 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. -*/ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/.gitignore b/USB/USBManagerSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/USB/USBManagerSample/entry/build-profile.json5 b/USB/USBManagerSample/entry/build-profile.json5 deleted file mode 100644 index 0b909ac2282b56ed9aeaf4e7e94c1b26be8bef2e..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* -* Copyright (C) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/hvigorfile.ts b/USB/USBManagerSample/entry/hvigorfile.ts deleted file mode 100644 index 6ef2fb28f052cfaed070b056bd400c6fd48d4814..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (C) 2025 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. */ -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/obfuscation-rules.txt b/USB/USBManagerSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/USB/USBManagerSample/entry/oh-package.json5 b/USB/USBManagerSample/entry/oh-package.json5 deleted file mode 100644 index 9af72e516303671645917d878d21c47bd146000d..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (C) 2025 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/USB/USBManagerSample/entry/src/main/ets/entryability/EntryAbility.ets b/USB/USBManagerSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 0b00c6d11cf1f32c6f56dd5672381ffcfa8b4e1d..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* -* Copyright (C) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/USB/USBManagerSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index edfaf36fd625d214735266b6458514d4cf4f3730..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* -* Copyright (C) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/main/ets/pages/Index.ets b/USB/USBManagerSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 80dee70e4f0da844698da2f9583ad5b0cca834d4..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,533 +0,0 @@ -/* -* Copyright (C) 2025 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. -*/ - -// [Start head] -// 导入usbManager模块 -import { usbManager } from '@kit.BasicServicesKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { JSON } from '@kit.ArkTS'; - -// [End head] -@Entry -@Component -struct Index { - @State logInfo_: string = ''; - @State deviceList_: usbManager.USBDevice[] = []; - @State pipe_: usbManager.USBDevicePipe | undefined = undefined; - @State interface_: usbManager.USBInterface | undefined = undefined; - - private getDevices() { - // [Start getDevices] - // 获取设备列表。 - let deviceList: usbManager.USBDevice[] = usbManager.getDevices(); - console.info(`deviceList: ${deviceList}`); - this.logInfo_ += '\n[INFO] deviceList: ' + JSON.stringify(deviceList); - if (deviceList === undefined || deviceList.length === 0) { - console.error('deviceList is empty'); - this.logInfo_ += '\n[ERROR] deviceList is empty'; - return; - } - /* - deviceList结构示例 - [ - { - name: '1-1', - serial: '', - manufacturerName: '', - productName: '', - version: '', - vendorId: 7531, - productId: 2, - clazz: 9, - subClass: 0, - protocol: 1, - devAddress: 1, - busNum: 1, - configs: [ - { - id: 1, - attributes: 224, - isRemoteWakeup: true, - isSelfPowered: true, - maxPower: 0, - name: '1-1', - interfaces: [ - { - id: 0, - protocol: 0, - clazz: 9, - subClass: 0, - alternateSetting: 0, - name: '1-1', - endpoints: [ - { - address: 129, - attributes: 3, - interval: 12, - maxPacketSize: 4, - direction: 128, - number: 1, - type: 3, - interfaceId: 0, - } - ] - } - ] - } - ] - } - ] - */ - this.deviceList_ = deviceList; - // [End getDevices] - } - - private requestRight() { - // [Start requestRight] - if (this.deviceList_ === undefined || this.deviceList_.length === 0) { - console.error('deviceList is empty'); - this.logInfo_ += '\n[ERROR] deviceList is empty'; - return; - } - let deviceList: usbManager.USBDevice[] = this.deviceList_; - let deviceName: string = deviceList[0].name; - // 申请操作指定的device的操作权限。 - usbManager.requestRight(deviceName).then((hasRight: boolean) => { - console.info('usb device request right result: ' + hasRight); - this.logInfo_ += '\n[INFO] usb device request right result: ' + JSON.stringify(hasRight); - }).catch((error: BusinessError) => { - console.error(`usb device request right failed : ${error}`); - this.logInfo_ += '\n[ERROR] usb device request right failed: ' + JSON.stringify(error); - }); - // [End requestRight] - } - - private connectDevice() { - // [Start connectDevice] - if (this.deviceList_ === undefined || this.deviceList_.length === 0) { - console.error('deviceList_ is empty'); - this.logInfo_ += '\n[ERROR] deviceList is empty'; - return; - } - let deviceList: usbManager.USBDevice[] = this.deviceList_; - if (!usbManager.hasRight(deviceList[0].name)) { - console.error('permission denied'); - this.logInfo_ += '\n[ERROR] permission denied'; - return; - } - // 打开设备,获取数据传输通道。 - let pipe: usbManager.USBDevicePipe = usbManager.connectDevice(deviceList[0]); - if (!deviceList?.[0]?.configs?.[0]?.interfaces?.[0]) { - console.error('invalid interface'); - this.logInfo_ += '\n[ERROR] invalid interface'; - return; - } - let interface1: usbManager.USBInterface = deviceList[0].configs[0].interfaces[0]; - /* - 打开对应接口,在设备信息(deviceList)中选取对应的interface。 - interface1为设备配置中的一个接口。 - */ - usbManager.claimInterface(pipe, interface1, true); - this.pipe_ = pipe; - this.interface_ = interface1; - console.info('open device success'); - this.logInfo_ += '\n[INFO] open device success'; - // [End connectDevice] - } - - private bulkTransfer() { - // [Start bulkTransfer] - if (this.pipe_ === undefined || this.interface_ === undefined) { - console.error('pipe_ or interface_ is null'); - this.logInfo_ += '\n[ERROR] pipe_ or interface_ is null'; - return; - } - let pipe: usbManager.USBDevicePipe = this.pipe_; - let interface1: usbManager.USBInterface = this.interface_; - /* - 读取数据,在device信息中选取对应数据接收的endpoint来做数据传输 - (endpoint.direction == 0x80);dataUint8Array是要读取的数据,类型为Uint8Array。 - */ - let inEndpoint: usbManager.USBEndpoint = interface1.endpoints[1]; - let outEndpoint: usbManager.USBEndpoint = interface1.endpoints[0]; - let dataUint8Array: Uint8Array = new Uint8Array(1024); - if (inEndpoint !== undefined && inEndpoint.direction === 0x80) { - usbManager.bulkTransfer(pipe, inEndpoint, dataUint8Array, 15000).then((dataLength: number) => { - if (dataLength >= 0) { - console.info(`usb readData result Length : ${dataLength}`); - this.logInfo_ += '\n[INFO] usb readData result Length: ' + JSON.stringify(dataLength); - } else { - console.error('usb readData failed'); - this.logInfo_ += '\n[ERROR] usb readData failed'; - } - }).catch((error: BusinessError) => { - console.error(`usb readData error : ${error}`); - this.logInfo_ += '\n[ERROR] usb readData error: ' + JSON.stringify(error); - }); - } - - // 发送数据,在device信息中选取对应数据发送的endpoint来做数据传输。(endpoint.direction == 0) - if (outEndpoint !== undefined && outEndpoint.direction === 0) { - usbManager.bulkTransfer(pipe, outEndpoint, dataUint8Array, 15000).then((dataLength: number) => { - if (dataLength >= 0) { - console.info(`usb writeData result write length : ${dataLength}`); - this.logInfo_ += '\n[INFO] usb writeData result write length: ' + JSON.stringify(dataLength); - } else { - console.error('usb writeData failed'); - this.logInfo_ += '\n[ERROR] usb writeData failed'; - } - }).catch((error: BusinessError) => { - console.error(`usb writeData error : ${error}`); - this.logInfo_ += '\n[ERROR] usb writeData error: ' + JSON.stringify(error); - }); - } - // [End bulkTransfer] - } - - private controlTransfer() { - // [Start controlTransfer] - if (this.pipe_ === undefined) { - console.error('pipe_ is null'); - this.logInfo_ += '\n[ERROR] pipe_ is null'; - return; - } - let pipe: usbManager.USBDevicePipe = this.pipe_; - /* - 构造控制传输参数 - */ - let param: usbManager.USBDeviceRequestParams = { - bmRequestType: 0x80, //0x80指一次由设备到主机的标准请求命令 - bRequest: 0x06, //0x06指获取描述符 - wValue: 0x01 << 8 | 0, //该值为2个字节,高字节指描述符类型,此处0x01指设备描述符;低字节指描述符索引,设备描述符不涉及,填0 - wIndex: 0, //索引值,可填0 - wLength: 18, //描述符的长度,此处18表示设备描述符长度,最大支持1024 - data: new Uint8Array(18) - }; - - usbManager.usbControlTransfer(pipe, param).then((ret: number) => { - console.info(`usbControlTransfer = ${ret}`); - this.logInfo_ += '\n[INFO] usbControlTransfer = ' + JSON.stringify(ret); - }) - // [End controlTransfer] - } - - private interruptTransfer() { - // [Start interruptTransfer_getEndpoint] - if (this.deviceList_ === undefined || this.deviceList_.length === 0) { - console.error('deviceList_ is empty'); - this.logInfo_ += '\n[ERROR] deviceList_ is empty'; - return; - } - let usbDevice: usbManager.USBDevice = this.deviceList_[0]; - if (!usbManager.hasRight(usbDevice.name)) { - console.error('permission denied'); - this.logInfo_ += '\n[ERROR] permission denied'; - return; - } - let devicePipe: usbManager.USBDevicePipe = usbManager.connectDevice(usbDevice); - let usbConfigs: usbManager.USBConfiguration[] = usbDevice.configs; - let usbInterfaces: usbManager.USBInterface[] = []; - let usbInterface: usbManager.USBInterface | undefined = undefined; - let usbEndpoints: usbManager.USBEndpoint[] = []; - let usbEndpoint: usbManager.USBEndpoint | undefined = undefined; - for (let i = 0; i < usbConfigs.length; i++) { - usbInterfaces = usbConfigs[i].interfaces; - for (let j = 0; j < usbInterfaces.length; j++) { - usbEndpoints = usbInterfaces[j].endpoints; - usbEndpoint = usbEndpoints.find((value) => { - return value.direction === 128 && value.type === usbManager.UsbEndpointTransferType.TRANSFER_TYPE_INTERRUPT; - }) - if (usbEndpoint !== undefined) { - usbInterface = usbInterfaces[j]; - break; - } - } - } - if (usbEndpoint === undefined) { - console.error(`get usbEndpoint error`) - this.logInfo_ += '\n[ERROR] get usbEndpoint error'; - return; - } - // [End interruptTransfer_getEndpoint] - // [Start interruptTransfer_claimInterface] - // 注册通信接口,注册成功返回0,注册失败返回其他错误码。 - let claimInterfaceResult: number = usbManager.claimInterface(devicePipe, usbInterface, true); - if (claimInterfaceResult !== 0) { - console.error(`claimInterface error = ${claimInterfaceResult}`) - this.logInfo_ += '\n[ERROR] claimInterface error = ' + JSON.stringify(claimInterfaceResult); - return; - } - // [End interruptTransfer_claimInterface] - // [Start interruptTransfer_interruptTransfer] - let transferParams: usbManager.UsbDataTransferParams | undefined = undefined; - try { - // 通信接口注册成功,传输数据 - transferParams = { - devPipe: devicePipe, - flags: usbManager.UsbTransferFlags.USB_TRANSFER_SHORT_NOT_OK, - endpoint: usbEndpoint.address, - type: usbManager.UsbEndpointTransferType.TRANSFER_TYPE_INTERRUPT, - timeout: 2000, - length: 10, - callback: () => { - }, - userData: new Uint8Array(10), - buffer: new Uint8Array(10), - isoPacketCount: 2, - }; - - transferParams.callback = (err: Error, callBackData: usbManager.SubmitTransferCallback) => { - console.info(`callBackData = ${callBackData}`); - this.logInfo_ += '\n[INFO] callBackData = ' + JSON.stringify(callBackData); - console.info(`transfer success,result = ${transferParams?.buffer}`); - this.logInfo_ += '\n[INFO] transfer success,result = ' + JSON.stringify(transferParams?.buffer); - } - usbManager.usbSubmitTransfer(transferParams); - console.info('USB transfer request submitted.'); - this.logInfo_ += '\n[INFO] USB transfer request submitted.'; - } catch (error) { - console.error(`USB transfer failed: ${error}`); - this.logInfo_ += '\n[ERROR] USB transfer failed: ' + JSON.stringify(error); - } - // [End interruptTransfer_interruptTransfer] - // [Start interruptTransfer_release] - try { - usbManager.usbCancelTransfer(transferParams); - usbManager.releaseInterface(devicePipe, usbInterface); - usbManager.closePipe(devicePipe); - } catch (error) { - console.error(`release failed: ${error}`); - this.logInfo_ += '\n[ERROR] release failed: ' + JSON.stringify(error); - } - // [End interruptTransfer_release] - } - - private isochronousTransfer() { - // [Start isochronousTransfer_getEndpoint] - if (this.deviceList_ === undefined || this.deviceList_.length === 0) { - console.error('deviceList_ is empty'); - this.logInfo_ += '\n[ERROR] deviceList_ is empty'; - return; - } - let usbDevice: usbManager.USBDevice = this.deviceList_[0]; - if (!usbManager.hasRight(usbDevice.name)) { - console.error('permission denied'); - this.logInfo_ += '\n[ERROR] permission denied'; - return; - } - let devicePipe: usbManager.USBDevicePipe = usbManager.connectDevice(usbDevice); - let usbConfigs: usbManager.USBConfiguration[] = usbDevice.configs; - let usbInterfaces: usbManager.USBInterface[] = []; - let usbInterface: usbManager.USBInterface | undefined = undefined; - let usbEndpoints: usbManager.USBEndpoint[] = []; - let usbEndpoint: usbManager.USBEndpoint | undefined = undefined; - for (let i = 0; i < usbConfigs.length; i++) { - usbInterfaces = usbConfigs[i].interfaces; - for (let j = 0; j < usbInterfaces.length; j++) { - usbEndpoints = usbInterfaces[j].endpoints; - usbEndpoint = usbEndpoints.find((value) => { - // direction为请求方向,0表示写入数据,128表示读取数据 - return value.direction === 128 && value.type === usbManager.UsbEndpointTransferType.TRANSFER_TYPE_ISOCHRONOUS; - }) - if (usbEndpoint !== undefined) { - usbInterface = usbInterfaces[j]; - break; - } - } - } - if (usbEndpoint === undefined) { - console.error(`get usbEndpoint error`); - this.logInfo_ += '\n[ERROR] get usbEndpoint error'; - return; - } - // [End isochronousTransfer_getEndpoint] - // [Start isochronousTransfer_claimInterface] - // 注册通信接口,注册成功返回0,注册失败返回其他错误码。 - let claimInterfaceResult: number = usbManager.claimInterface(devicePipe, usbInterface, true); - if (claimInterfaceResult !== 0) { - console.error(`claimInterface error = ${claimInterfaceResult}`) - this.logInfo_ += '\n[ERROR] claimInterface error = ' + JSON.stringify(claimInterfaceResult); - return; - } - - // 传输类型为“实时传输”时,需设置设备接口。设置成功返回0,注册失败返回其他错误码。 - if (usbEndpoint.type === usbManager.UsbEndpointTransferType.TRANSFER_TYPE_ISOCHRONOUS) { - let setInterfaceResult = usbManager.setInterface(devicePipe, usbInterface); - if (setInterfaceResult !== 0) { - console.error(`setInterfaceResult error = ${setInterfaceResult}`) - this.logInfo_ += '\n[ERROR] setInterfaceResult error = ' + JSON.stringify(setInterfaceResult); - return; - } - } - // [End isochronousTransfer_claimInterface] - // [Start isochronousTransfer_isochronousTransfer] - let transferParams: usbManager.UsbDataTransferParams | undefined = undefined; - try { - // 通信接口注册成功,传输数据 - transferParams = { - devPipe: devicePipe, - flags: usbManager.UsbTransferFlags.USB_TRANSFER_SHORT_NOT_OK, - endpoint: usbEndpoint.address, - type: usbManager.UsbEndpointTransferType.TRANSFER_TYPE_ISOCHRONOUS, - timeout: 2000, - length: 10, - callback: () => { - }, - userData: new Uint8Array(10), - buffer: new Uint8Array(10), - isoPacketCount: 2, - }; - - transferParams.callback = (err: Error, callBackData: usbManager.SubmitTransferCallback) => { - console.info(`callBackData = ${callBackData}`); - this.logInfo_ += '\n[INFO] callBackData = ' + JSON.stringify(callBackData); - console.info('transfer success,result = ' + transferParams?.buffer.toString()); - this.logInfo_ += '\n[INFO] transfer success,result = ' + transferParams?.buffer.toString(); - } - usbManager.usbSubmitTransfer(transferParams); - console.info('USB transfer request submitted.'); - this.logInfo_ += '\n[INFO] USB transfer request submitted.'; - } catch (error) { - console.error(`USB transfer failed: ${error}`); - this.logInfo_ += '\n[ERROR] USB transfer failed: ' + JSON.stringify(error); - } - // [End isochronousTransfer_isochronousTransfer] - // [Start isochronousTransfer_release] - try { - usbManager.usbCancelTransfer(transferParams); - usbManager.releaseInterface(devicePipe, usbInterface); - usbManager.closePipe(devicePipe); - } catch (error) { - console.error(`release failed: ${error}`); - this.logInfo_ += '\n[ERROR] release failed: ' + JSON.stringify(error); - } - // [End isochronousTransfer_release] - } - - private closePipe() { - // [Start closePipe] - if (this.pipe_ === undefined || this.interface_ === undefined) { - console.error('pipe_ or interface_ is null'); - this.logInfo_ += '\n[ERROR] pipe_ or interface_ is null'; - return; - } - let pipe: usbManager.USBDevicePipe = this.pipe_; - let interface1: usbManager.USBInterface = this.interface_; - usbManager.releaseInterface(pipe, interface1); - usbManager.closePipe(pipe); - this.pipe_ = undefined; - this.interface_ = undefined; - console.info('close device success'); - this.logInfo_ += '\n[INFO] close device success'; - // [End closePipe] - } - - build() { - Column() { - Row() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) { - TextArea({ text: this.logInfo_ }) - .height('100%') - .width('100%') - .fontSize(12) - .onChange((value: string) => { - this.logInfo_ = value; - }) - }.height('100%').width('100%') - }.height('45%') - - Row() { - Button('获取设备列表', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - - this.getDevices(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('获取设备操作权限', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.requestRight(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('打开设备', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.connectDevice(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('批量传输', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.bulkTransfer(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('控制传输', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.controlTransfer(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('中断传输', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.interruptTransfer(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('实时传输', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.isochronousTransfer(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('关闭设备', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.closePipe(); - }) - .width('100%') - }.padding({ top: 10 }) - }.height('100%').width('100%').padding({ left: 10, right: 10 }) - } -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/main/module.json5 b/USB/USBManagerSample/entry/src/main/module.json5 deleted file mode 100644 index c057ca1f4f374bedf1c445da1fdd2561fd634481..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* -* Copyright (C) 2025 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" - ], - "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": [ - "ohos.want.action.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/USB/USBManagerSample/entry/src/main/resources/base/element/color.json b/USB/USBManagerSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/main/resources/base/element/float.json b/USB/USBManagerSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/USB/USBManagerSample/entry/src/main/resources/base/element/string.json b/USB/USBManagerSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/main/resources/base/media/background.png b/USB/USBManagerSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/USB/USBManagerSample/entry/src/main/resources/base/media/foreground.png b/USB/USBManagerSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/USB/USBManagerSample/entry/src/main/resources/base/media/layered_image.json b/USB/USBManagerSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/main/resources/base/media/startIcon.png b/USB/USBManagerSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/USB/USBManagerSample/entry/src/main/resources/base/profile/backup_config.json b/USB/USBManagerSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/main/resources/base/profile/main_pages.json b/USB/USBManagerSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/USB/USBManagerSample/entry/src/main/resources/dark/element/color.json b/USB/USBManagerSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/mock/mock-config.json5 b/USB/USBManagerSample/entry/src/mock/mock-config.json5 deleted file mode 100644 index d76be296f7f7212ba32b65f80a6d2d2ffec8ecce..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (C) 2025 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/USB/USBManagerSample/entry/src/ohosTest/ets/test/Ability.test.ets b/USB/USBManagerSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 56e7d7b95791be6337937858077d2cffe941380d..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,137 +0,0 @@ -/* -* Copyright (C) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; -import { Driver, ON, MatchPattern } from '@ohos.UiTest'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import resourceManager from '@ohos.resourceManager'; -import deviceInfo from '@ohos.deviceInfo'; - -const TAG = '[Sample_USBManagerSample]'; -const DOMAIN = 0xF811; -const BUNDLE = 'USBManagerSample'; -let abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -let manager: resourceManager.ResourceManager; -const driver = Driver.create(); - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - abilityDelegator.startAbility({ - bundleName: 'com.samples.usbmanagersample', - abilityName: 'EntryAbility' - }); - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('USBManagerSample_GetDevices_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `GetDevices_001, begin`); - let btnAccept = await driver.findComponent(ON.text('获取设备列表')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `GetDevices_001, end`); - }) - it('USBManagerSample_RequestRight_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `RequestRight_001, begin`); - let btnAccept = await driver.findComponent(ON.text('获取设备操作权限')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - try { - let btnAllow = await driver.findComponent(ON.text('允许')) - if (btnAllow !== undefined) { - await btnAllow.click(); - await driver.delayMs(3000); - } - } catch (e) { - hilog.info(DOMAIN, TAG, BUNDLE + `already request right`); - } - hilog.info(DOMAIN, TAG, BUNDLE + `RequestRight_001, end`); - }) - it('USBManagerSample_ConnectDevice_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `ConnectDevice_001, begin`); - let btnAccept = await driver.findComponent(ON.text('打开设备')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `ConnectDevice_001, end`); - }) - it('USBManagerSample_BulkTransfer_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `BulkTransfer_001, begin`); - let btnAccept = await driver.findComponent(ON.text('批量传输')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `BulkTransfer_001, end`); - }) - it('USBManagerSample_ControlTransfer_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `ControlTransfer_001, begin`); - let btnAccept = await driver.findComponent(ON.text('控制传输')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `ControlTransfer_001, end`); - }) - it('USBManagerSample_InterruptTransfer_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `InterruptTransfer_001, begin`); - let btnAccept = await driver.findComponent(ON.text('中断传输')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `InterruptTransfer_001, end`); - }) - it('USBManagerSample_IsochronousTransfer_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `IsochronousTransfer_001, begin`); - let btnAccept = await driver.findComponent(ON.text('实时传输')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `IsochronousTransfer_001, end`); - }) - it('USBManagerSample_ClosePipe_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `ClosePipe_001, begin`); - let btnAccept = await driver.findComponent(ON.text('关闭设备')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `ClosePipe_001, end`); - }) - }) -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/ohosTest/ets/test/List.test.ets b/USB/USBManagerSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 2a94e90b4f475cb3ce1237e0c6c637a10af51235..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (C) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/ohosTest/module.json5 b/USB/USBManagerSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 6710fd5a1439eff20cce9dcabb11f324243b254a..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright (C) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/USB/USBManagerSample/entry/src/test/List.test.ets b/USB/USBManagerSample/entry/src/test/List.test.ets deleted file mode 100644 index 3728d4693480fa0b0853121dc892d318a8dd08cf..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (C) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/USB/USBManagerSample/entry/src/test/LocalUnit.test.ets b/USB/USBManagerSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 09b5e0b944288ffa51b13b489085e8b2d4455999..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* -* Copyright (C) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/USB/USBManagerSample/hvigor/hvigor-config.json5 b/USB/USBManagerSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 3267144051f0648afd71c5b7f0a0dfa39c888fe9..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (C) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/USB/USBManagerSample/hvigorfile.ts b/USB/USBManagerSample/hvigorfile.ts deleted file mode 100644 index 4540d29e68aa7e2ee83d7d735dbd11606ae172ca..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (C) 2025 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. */ -} \ No newline at end of file diff --git a/USB/USBManagerSample/oh-package-lock.json5 b/USB/USBManagerSample/oh-package-lock.json5 deleted file mode 100644 index 35c2f794fa82ed16509f524396bed85575f8fb63..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.24": "@ohos/hypium@1.0.24" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.24": { - "name": "", - "version": "1.0.24", - "integrity": "sha512-3dCqc+BAR5LqEGG2Vtzi8O3r7ci/3fYU+FWjwvUobbfko7DUnXGOccaror0yYuUhJfXzFK0aZNMGSnXaTwEnbw==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.24.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/USB/USBManagerSample/oh-package.json5 b/USB/USBManagerSample/oh-package.json5 deleted file mode 100644 index 4a697b2ed61760e7a5ceea9d18a625120bf0645b..0000000000000000000000000000000000000000 --- a/USB/USBManagerSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (C) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/USB/USBManagerSample/screenshots/usb.jpeg b/USB/USBManagerSample/screenshots/usb.jpeg deleted file mode 100644 index a37e5c236fba7800353d6c608c34c6f63163c1eb..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSample/screenshots/usb.jpeg and /dev/null differ diff --git a/USB/USBManagerSerialSample/.gitignore b/USB/USBManagerSerialSample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/USB/USBManagerSerialSample/AppScope/app.json5 b/USB/USBManagerSerialSample/AppScope/app.json5 deleted file mode 100644 index 027f04932100510a8f579dbe06344336bdc41b28..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (C) 2025 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.samples.usbmanagerserialsample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/USB/USBManagerSerialSample/AppScope/resources/base/element/string.json b/USB/USBManagerSerialSample/AppScope/resources/base/element/string.json deleted file mode 100644 index 69efa2a0cd5092c114be9a5df0a534efc071532f..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "USBManagerSerialSample" - } - ] -} diff --git a/USB/USBManagerSerialSample/AppScope/resources/base/media/background.png b/USB/USBManagerSerialSample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSerialSample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/USB/USBManagerSerialSample/AppScope/resources/base/media/foreground.png b/USB/USBManagerSerialSample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSerialSample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/USB/USBManagerSerialSample/AppScope/resources/base/media/layered_image.json b/USB/USBManagerSerialSample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/README.md b/USB/USBManagerSerialSample/README.md deleted file mode 100644 index 7ee9efc396e6906bbef90a2bbf47b927a2590963..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/README.md +++ /dev/null @@ -1,72 +0,0 @@ -# USBManagerSerialSample - -### 介绍 - -本示例主要展示了USB串口通信管理以及串口配置管理:
-1. [USB串口通信管理](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/usb/usbSerial/usbSerial-communication.md)。
-2. [USB串口配置管理](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/usb/usbSerial/usbSerial-configuration.md)。 - -### 效果预览 -![Index](screenshots/serial.jpeg) - -使用说明 - -1. 连接一个usb串口外设 -2. 点击“获取设备列表”,获取当前串口设备 -3. 点击“获取设备操作权限”,弹窗询问是否授权操作权限,点击允许 -4. 点击“打开串口设备”,打开当前设备 -5. 点击“读取数据”,从串口读数据,需要先从串口发数据。 -6. 点击“写入数据”,写数据到串口,写入的数据是Sample示例代码中写死的数据"Hello World"。 -7. 点击“获取串口配置”,获取串口配置信息。 -8. 点击“修改串口配置”,修改串口配置,串口配置已在Sample示例代码中写死。 -9. 点击“关闭串口设备”,关闭当前设备。 - -### 工程目录 - -``` -entry/src/ -|---main -| |---ets -| | |---pages -| | | |---Index.ets // 首页 -|---ohosTest -| |---ets -| | |---tests -| | | |---Ability.test.ets // 自动化测试用例 -``` - -### 具体实现 -* 导入相关模块import { serialManager } from '@kit.BasicServicesKit'。 -* 获取设备列表:调用serialManager.getPortList()获取当前连接的所有串口设备。 -* 获取设备权限:调用serialManager.requestSerialRight()获取设备权限。 -* 打开设备:调用serialManager.open()打开设备。 -* 读取数据:异步读取调用serialManager.read(),同步读取调用serialManager.readSync()。 -* 读取数据:异步写入调用serialManager.write(),同步读取调用serialManager.writeSync()。 -* 串口配置:调用serialManager.getAttribute()获取串口配置,调用serialManager.setAttribute()设置串口配置。 -* 关闭设备:调用serialManager.close()关闭设备。 - -### 相关权限 - -无相关权限。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:rk3568; -2. 本示例仅支持API20版本SDK,镜像版本号:OpenHarmony 6.0.0.x及之后的版本; -3. 本示例需要使用DevEco Studio 6.0.0 release (Build Version: 6.0.0.858)才可编译运行; - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/USB/USBManagerSerialSample/ > .git/info/sparse-checkout -git remote add origin https://gitcode.com/openharmony/applications_app_samples.git -git pull origin ***(分支名) -``` \ No newline at end of file diff --git a/USB/USBManagerSerialSample/build-profile.json5 b/USB/USBManagerSerialSample/build-profile.json5 deleted file mode 100644 index 4d771ed495345faf545f97069fb16184db5162c4..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/build-profile.json5 +++ /dev/null @@ -1,58 +0,0 @@ -/* -* Copyright (C) 2025 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", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "compileSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/code-linter.json5 b/USB/USBManagerSerialSample/code-linter.json5 deleted file mode 100644 index 7f67b9ad794978e0469d9de745934605b23a7cd9..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* -* Copyright (C) 2025 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. -*/ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/.gitignore b/USB/USBManagerSerialSample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/build-profile.json5 b/USB/USBManagerSerialSample/entry/build-profile.json5 deleted file mode 100644 index 0b909ac2282b56ed9aeaf4e7e94c1b26be8bef2e..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* -* Copyright (C) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/hvigorfile.ts b/USB/USBManagerSerialSample/entry/hvigorfile.ts deleted file mode 100644 index 6ef2fb28f052cfaed070b056bd400c6fd48d4814..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (C) 2025 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. */ -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/obfuscation-rules.txt b/USB/USBManagerSerialSample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/USB/USBManagerSerialSample/entry/oh-package.json5 b/USB/USBManagerSerialSample/entry/oh-package.json5 deleted file mode 100644 index 9af72e516303671645917d878d21c47bd146000d..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (C) 2025 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/USB/USBManagerSerialSample/entry/src/main/ets/entryability/EntryAbility.ets b/USB/USBManagerSerialSample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 0b00c6d11cf1f32c6f56dd5672381ffcfa8b4e1d..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* -* Copyright (C) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/USB/USBManagerSerialSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index edfaf36fd625d214735266b6458514d4cf4f3730..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* -* Copyright (C) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/main/ets/pages/Index.ets b/USB/USBManagerSerialSample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index ffcae84cb2c58e47ee16056f798bcc82f7746d66..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,290 +0,0 @@ -/* -* Copyright (C) 2025 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. -*/ - -// [Start head] -// 导入usbManager模块 -import { serialManager } from '@kit.BasicServicesKit'; -import { BusinessError } from '@kit.BasicServicesKit' -import { buffer } from '@kit.ArkTS'; -import { JSON } from '@kit.ArkTS'; - -// [End head] -@Entry -@Component -struct Index { - @State logInfo_: string = ''; - @State portList_: serialManager.SerialPort[] = []; - @State portId_: number = 0; - - private getPortList() { - // [Start getPortList] - // 获取连接主设备的USB设备列表 - let portList: serialManager.SerialPort[] = serialManager.getPortList(); - console.info(`usbSerial portList: ${portList}`); - this.logInfo_ += '\n[INFO] usbSerial portList: ' + JSON.stringify(portList); - if (portList === undefined || portList.length === 0) { - console.error('usbSerial portList is empty'); - this.logInfo_ += '\n[ERROR] usbSerial portList is empty'; - return; - } - this.portList_ = portList; - // [End getPortList] - } - - private requestSerialRight() { - // [Start requestSerialRight] - console.error('xxh this.portList_:' + JSON.stringify(this.portList_.length)); - if (this.portList_ === undefined || this.portList_.length === 0) { - console.error('usbSerial portList is empty'); - this.logInfo_ += '\n[ERROR] usbSerial portList is empty'; - return; - } - console.error('xxh 1'); - let portList: serialManager.SerialPort[] = this.portList_; - let portId: number = portList[0].portId; - if (!serialManager.hasSerialRight(portId)) { - serialManager.requestSerialRight(portId).then((result: boolean) => { - console.info('serial device request right result: ' + result); - this.logInfo_ += '\n[INFO] serial device request right result: ' + JSON.stringify(result); - }).catch((error: BusinessError) => { - console.error(`usb device request right failed : ${error}`); - this.logInfo_ += '\n[ERROR] usb device request right failed: ' + JSON.stringify(error); - }); - } else { - console.info('serial device already request right'); - this.logInfo_ += '\n[INFO] serial device already request right'; - } - this.portId_ = portId; - // [End requestSerialRight] - } - - private openSerialDevice() { - // [Start openSerialDevice] - let portId: number = this.portId_; - try { - serialManager.open(portId) - console.info(`open usbSerial success, portId: ${portId}`); - this.logInfo_ += '\n[INFO] open usbSerial success, portId: ' + JSON.stringify(portId); - } catch (error) { - console.error(`open usbSerial error: ${error}`); - this.logInfo_ += '\n[ERROR] open usbSerial error: ' + JSON.stringify(error); - } - // [End openSerialDevice] - } - - private serialRead() { - // [Start serialRead] - let portId: number = this.portId_; - // 异步读取 - let readBuffer: Uint8Array = new Uint8Array(64); - serialManager.read(portId, readBuffer, 2000).then((size: number) => { - console.info(`readAsync usbSerial success, readAsyncBuffer: ${readBuffer}`); - this.logInfo_ += '\n[INFO] readAsync usbSerial success, readAsyncBuffer: ' + JSON.stringify(readBuffer); - }).catch((error: Error) => { - console.error(`readAsync usbSerial error: ${error}`); - this.logInfo_ += '\n[ERROR] readAsync usbSerial error: ' + JSON.stringify(error); - }) - - // 同步读取 - let readSyncBuffer: Uint8Array = new Uint8Array(64); - try { - serialManager.readSync(portId, readSyncBuffer, 2000); - console.info(`readSync usbSerial success, readSyncBuffer: ${readSyncBuffer}`); - this.logInfo_ += '\n[INFO] readSync usbSerial success, readSyncBuffer: ' + JSON.stringify(readSyncBuffer); - } catch (error) { - console.error(`readSync usbSerial error: ${error}`); - this.logInfo_ += '\n[ERROR] readSync usbSerial error: ' + JSON.stringify(error); - } - // [End serialRead] - } - - private serialWrite() { - // [Start serialWrite] - let portId: number = this.portId_; - // 异步写入 - let writeBuffer: Uint8Array = new Uint8Array(buffer.from('Hello World', 'utf-8').buffer) - serialManager.write(portId, writeBuffer, 2000).then((size: number) => { - console.info(`writeAsync usbSerial success, writeAsyncBuffer: ${writeBuffer}`); - this.logInfo_ += '\n[INFO] writeAsync usbSerial success, writeAsyncBuffer: ' + JSON.stringify(writeBuffer); - }).catch((error: Error) => { - console.error(`writeAsync usbSerial error: ${error}`); - this.logInfo_ += '\n[ERROR] writeAsync usbSerial error: ' + JSON.stringify(error); - }) - - // 同步写入 - let writeSyncBuffer: Uint8Array = new Uint8Array(buffer.from('Hello World', 'utf-8').buffer) - try { - serialManager.writeSync(portId, writeSyncBuffer, 2000); - console.info(`writeSync usbSerial success, writeSyncBuffer: ${writeSyncBuffer}`); - this.logInfo_ += '\n[INFO] writeSync usbSerial success, writeSyncBuffer: ' + JSON.stringify(writeSyncBuffer); - } catch (error) { - console.error(`writeSync usbSerial error: ${error}`); - this.logInfo_ += '\n[ERROR] writeSync usbSerial error: ' + JSON.stringify(error); - } - // [End serialWrite] - } - - private getSerialConfig() { - // [Start getSerialConfig] - let portId: number = this.portId_; - // 获取串口配置 - try { - let attribute: serialManager.SerialAttribute = serialManager.getAttribute(portId); - if (attribute === undefined) { - console.error('getAttribute usbSerial error, attribute is undefined'); - this.logInfo_ += '\n[ERROR] getAttribute usbSerial error, attribute is undefined'; - } else { - console.info(`getAttribute usbSerial success, attribute: ${attribute}`); - this.logInfo_ += '\n[INFO] getAttribute usbSerial success, attribute: ' + JSON.stringify(attribute); - } - } catch (error) { - console.error(`getAttribute usbSerial error: ${error}`); - this.logInfo_ += '\n[ERROR] getAttribute usbSerial error: ' + JSON.stringify(error); - } - // [End getSerialConfig] - } - - private setSerialConfig() { - // [Start setSerialConfig] - let portId: number = this.portId_; - // 设置串口配置 - try { - let attribute: serialManager.SerialAttribute = { - baudRate: serialManager.BaudRates.BAUDRATE_9600, - dataBits: serialManager.DataBits.DATABIT_8, - parity: serialManager.Parity.PARITY_NONE, - stopBits: serialManager.StopBits.STOPBIT_1 - } - serialManager.setAttribute(portId, attribute); - console.info(`setAttribute usbSerial success, attribute: ${attribute}`); - this.logInfo_ += '\n[INFO] setAttribute usbSerial success, attribute: ' + JSON.stringify(attribute); - } catch (error) { - console.error(`setAttribute usbSerial error: ${error}`); - this.logInfo_ += '\n[ERROR] setAttribute usbSerial error: ' + JSON.stringify(error); - } - // [End setSerialConfig] - } - - private closeSerialDevice() { - // [Start closeSerialDevice] - let portId: number = this.portId_; - try { - serialManager.close(portId); - console.info(`close usbSerial success, portId: ${portId}`); - this.logInfo_ += '\n[INFO] close usbSerial success, portId: ' + JSON.stringify(portId); - } catch (error) { - console.error(`close usbSerial error: ${error}`); - this.logInfo_ += '\n[ERROR] close usbSerial error: ' + JSON.stringify(error); - } - // [End closeSerialDevice] - } - - build() { - Column() { - Row() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) { - TextArea({ text: this.logInfo_ }) - .height('100%') - .width('100%') - .fontSize(12) - .onChange((value: string) => { - this.logInfo_ = value; - }) - }.height('100%').width('100%') - }.height('40%') - - Row() { - Button('获取设备列表', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - - this.getPortList(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('获取设备操作权限', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.requestSerialRight(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('打开串口设备', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.openSerialDevice(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('读取数据', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.serialRead(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('写入数据', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.serialWrite(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('获取串口配置', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.getSerialConfig(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('修改串口配置', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.setSerialConfig(); - }) - .width('100%') - }.padding({ top: 10 }) - - Row() { - Button('关闭串口设备', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .onClick(() => { - this.closeSerialDevice(); - }) - .width('100%') - }.padding({ top: 10 }) - }.height('100%').width('100%').padding({ left: 10, right: 10 }) - } -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/main/module.json5 b/USB/USBManagerSerialSample/entry/src/main/module.json5 deleted file mode 100644 index c057ca1f4f374bedf1c445da1fdd2561fd634481..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/module.json5 +++ /dev/null @@ -1,65 +0,0 @@ -/* -* Copyright (C) 2025 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" - ], - "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": [ - "ohos.want.action.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/USB/USBManagerSerialSample/entry/src/main/resources/base/element/color.json b/USB/USBManagerSerialSample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/main/resources/base/element/float.json b/USB/USBManagerSerialSample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index a8a5d404dcd8b0466194afc3aa25d90a8a327470..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/USB/USBManagerSerialSample/entry/src/main/resources/base/element/string.json b/USB/USBManagerSerialSample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/main/resources/base/media/background.png b/USB/USBManagerSerialSample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSerialSample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/USB/USBManagerSerialSample/entry/src/main/resources/base/media/foreground.png b/USB/USBManagerSerialSample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSerialSample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/USB/USBManagerSerialSample/entry/src/main/resources/base/media/layered_image.json b/USB/USBManagerSerialSample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/main/resources/base/media/startIcon.png b/USB/USBManagerSerialSample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSerialSample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/USB/USBManagerSerialSample/entry/src/main/resources/base/profile/backup_config.json b/USB/USBManagerSerialSample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index d742c2f96e7dd0f406f499941f3147345e998f95..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/main/resources/base/profile/main_pages.json b/USB/USBManagerSerialSample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/USB/USBManagerSerialSample/entry/src/main/resources/dark/element/color.json b/USB/USBManagerSerialSample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 438d5bc43bb23c59c210d586b96635a72da5b64a..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/mock/mock-config.json5 b/USB/USBManagerSerialSample/entry/src/mock/mock-config.json5 deleted file mode 100644 index d76be296f7f7212ba32b65f80a6d2d2ffec8ecce..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (C) 2025 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/USB/USBManagerSerialSample/entry/src/ohosTest/ets/test/Ability.test.ets b/USB/USBManagerSerialSample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index c50d82446f4358307f9802862f733d1b527c1043..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,137 +0,0 @@ -/* -* Copyright (C) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; -import { Driver, ON, MatchPattern } from '@ohos.UiTest'; -import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import resourceManager from '@ohos.resourceManager'; -import deviceInfo from '@ohos.deviceInfo'; - -const TAG = '[Sample_USBManagerSerialSample]'; -const DOMAIN = 0xF811; -const BUNDLE = 'USBManagerSerialSample'; -let abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); -let manager: resourceManager.ResourceManager; -const driver = Driver.create(); - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - abilityDelegator.startAbility({ - bundleName: 'com.samples.usbmanagerserialsample', - abilityName: 'EntryAbility' - }); - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('USBManagerSerialSample_GetPortList_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `GetPortList_001, begin`); - let btnAccept = await driver.findComponent(ON.text('获取设备列表')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `GetPortList_001, end`); - }) - it('USBManagerSerialSample_RequestSerialRight_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `RequestSerialRight_001, begin`); - let btnAccept = await driver.findComponent(ON.text('获取设备操作权限')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - try { - let btnAllow = await driver.findComponent(ON.text('允许')) - if (btnAllow !== undefined) { - await btnAllow.click(); - await driver.delayMs(3000); - } - } catch (e) { - hilog.info(DOMAIN, TAG, BUNDLE + `already request right`); - } - hilog.info(DOMAIN, TAG, BUNDLE + `RequestSerialRight_001, end`); - }) - it('USBManagerSerialSample_OpenSerialDevice_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `OpenSerialDevice_001, begin`); - let btnAccept = await driver.findComponent(ON.text('打开串口设备')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `OpenSerialDevice_001, end`); - }) - it('USBManagerSerialSample_SerialRead_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `SerialRead_001, begin`); - let btnAccept = await driver.findComponent(ON.text('读取数据')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `SerialRead_001, end`); - }) - it('USBManagerSerialSample_SerialWrite_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `SerialWrite_001, begin`); - let btnAccept = await driver.findComponent(ON.text('写入数据')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `SerialWrite_001, end`); - }) - it('USBManagerSerialSample_GetSerialConfig_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `GetSerialConfig_001, begin`); - let btnAccept = await driver.findComponent(ON.text('获取串口配置')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `GetSerialConfig_001, end`); - }) - it('USBManagerSerialSample_SetSerialConfig_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `SetSerialConfig_001, begin`); - let btnAccept = await driver.findComponent(ON.text('修改串口配置')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `SetSerialConfig_001, end`); - }) - it('USBManagerSerialSample_CloseSerialDevice_001', 0, async () => { - hilog.info(DOMAIN, TAG, BUNDLE + `CloseSerialDevice_001, begin`); - let btnAccept = await driver.findComponent(ON.text('关闭串口设备')) - if (btnAccept !== undefined) { - await btnAccept.click(); - await driver.delayMs(500); - } - hilog.info(DOMAIN, TAG, BUNDLE + `CloseSerialDevice_001, end`); - }) - }) -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/ohosTest/ets/test/List.test.ets b/USB/USBManagerSerialSample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 2a94e90b4f475cb3ce1237e0c6c637a10af51235..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (C) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/ohosTest/module.json5 b/USB/USBManagerSerialSample/entry/src/ohosTest/module.json5 deleted file mode 100644 index 6710fd5a1439eff20cce9dcabb11f324243b254a..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright (C) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/USB/USBManagerSerialSample/entry/src/test/List.test.ets b/USB/USBManagerSerialSample/entry/src/test/List.test.ets deleted file mode 100644 index 3728d4693480fa0b0853121dc892d318a8dd08cf..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (C) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/entry/src/test/LocalUnit.test.ets b/USB/USBManagerSerialSample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 09b5e0b944288ffa51b13b489085e8b2d4455999..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* -* Copyright (C) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/hvigor/hvigor-config.json5 b/USB/USBManagerSerialSample/hvigor/hvigor-config.json5 deleted file mode 100644 index 3267144051f0648afd71c5b7f0a0dfa39c888fe9..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (C) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/USB/USBManagerSerialSample/hvigorfile.ts b/USB/USBManagerSerialSample/hvigorfile.ts deleted file mode 100644 index 4540d29e68aa7e2ee83d7d735dbd11606ae172ca..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (C) 2025 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. */ -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/oh-package-lock.json5 b/USB/USBManagerSerialSample/oh-package-lock.json5 deleted file mode 100644 index 35c2f794fa82ed16509f524396bed85575f8fb63..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.24": "@ohos/hypium@1.0.24" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.24": { - "name": "", - "version": "1.0.24", - "integrity": "sha512-3dCqc+BAR5LqEGG2Vtzi8O3r7ci/3fYU+FWjwvUobbfko7DUnXGOccaror0yYuUhJfXzFK0aZNMGSnXaTwEnbw==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.24.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/USB/USBManagerSerialSample/oh-package.json5 b/USB/USBManagerSerialSample/oh-package.json5 deleted file mode 100644 index 4a697b2ed61760e7a5ceea9d18a625120bf0645b..0000000000000000000000000000000000000000 --- a/USB/USBManagerSerialSample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (C) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/USB/USBManagerSerialSample/screenshots/serial.jpeg b/USB/USBManagerSerialSample/screenshots/serial.jpeg deleted file mode 100644 index 6a04874b9bccfaa7d473737490c852667970c1da..0000000000000000000000000000000000000000 Binary files a/USB/USBManagerSerialSample/screenshots/serial.jpeg and /dev/null differ diff --git a/UserAuthentication/.gitignore b/UserAuthentication/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/UserAuthentication/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/UserAuthentication/AppScope/app.json5 b/UserAuthentication/AppScope/app.json5 deleted file mode 100644 index c79cddcb5762a72797c66c3233a2ab19b95f1e41..0000000000000000000000000000000000000000 --- a/UserAuthentication/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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.samples.userauthentication", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/UserAuthentication/README.md b/UserAuthentication/README.md deleted file mode 100644 index b995722a700d0678b4ec1428e81f3b5e886c9204..0000000000000000000000000000000000000000 --- a/UserAuthentication/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# 用户认证服务 - -### 介绍 - -此示例演示了用户认证服务的部分功能,包括查询用户认证功能和凭证,调用用户认证界面等。 - -### 效果预览 - -| 首页 | 实例1 | 用户验证窗口 | -| -------------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------ | -| | | | - -使用说明: - -1. 在使用前先在“设置-安全与隐私”中设置PIN码以及人脸或指纹验证。 -2. 完成设置后在查询能力页面点击查询按钮,如果按钮下方文本显示“Pass”则表示设置成功可以进行接下来的操作。 -3. 通过点击上方的其他标签来切换不同的页面,点击按钮可触发验证页面。 - -### 工程目录 - -``` -\entry\src\main - │ module.json5 // 配置文件,用于配置权限等信息 - ├─ets - │ ├─common - │ │ Logger.ts // 打印工具类 - │ ├─entryability - │ ├─entrybackupability - │ └─pages - │ Index.ets // 主页面,代码参考页面 - │ testPage.ets // 测试用页面具体使用方式见'约束与限制' - └─resources - ├─base // 资源文件,内容为英文 - │ ├─element - │ ├─media - │ └─profile - └─zh_CN - └─element // 资源文件,内容为中文 - -``` - -### 具体实现 - -- 在开发板的设置中配置用户认证方式,然后在`\entry\src\main\module5`文件中添加用户认证权限`ohos.permission.ACCESS_BIOMETRIC`。 -- 将示例代码中的内容封装成函数。 -- 设置多个`TabContent`组件来区分不同功能,将不同的函数功能绑定到 各个`TabContent `页面的各个`Button`上。 -- 在每个按钮的上方设置一个 `Text` 文本,用于说明按钮的功能。 -- 在按钮的下方设置另一个 `Text` 文本,在点击按钮后显示功能是否正常。 - -### 相关权限 - -[ohos.permission.ACCESS_BIOMETRIC](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.0-Release/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionaccess_biometric) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行,支持设备:华为手机。 - -2.HarmonyOS系统:HarmonyOS 5.1.0 Release及以上。 - -3.HarmonyOS SDK版本:HarmonyOS 5.1.0 Release及以上。 - -4.本示例为Stage模型,支持API18版本SDK。 - -5.本示例需要使用DevEco Studio Release(5.0.5.306)及以上版本才可编译运行。 - -6.HH-SCDAYU200开发套件不支持生物特征识别,建议将认证方式更改为个人识别码(PIN),并确保在切换自定义功能时采用至少两种身份验证方法。 - -7.自动化测试中非自动化的相关测试点需要手动输入密码或手动录入人脸或指纹。 - -8.在运行测试前需要修改启动页面为`testPage`,具体修改方式为:将`src/main/ets/entryability/EntryAbility.ets`中的`windowStage.loadContent('pages/Index', ...)`修改为`windowStage.loadContent('pages/testPage', ...)` 。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo UserAuthentication > .git/info/sparse-checkout -git remote add origin https://gitee.com/harmonyos_samples/guide-snippets.git -git pull origin master -``` - diff --git a/UserAuthentication/build-profile.json5 b/UserAuthentication/build-profile.json5 deleted file mode 100644 index e395c7252dcbc4351e7b2251d9db371c55567d76..0000000000000000000000000000000000000000 --- a/UserAuthentication/build-profile.json5 +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compatibleSdkVersion": "6.0.0(20)", - "targetSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS" - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/UserAuthentication/entry/.gitignore b/UserAuthentication/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/UserAuthentication/entry/build-profile.json5 b/UserAuthentication/entry/build-profile.json5 deleted file mode 100644 index eed6635f664fa08b992d84590bf62be7e0bb5381..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 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/UserAuthentication/entry/hvigorfile.ts b/UserAuthentication/entry/hvigorfile.ts deleted file mode 100644 index 98d52319cb1dee60511b5716dba03b76e68a6d8b..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2025 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/UserAuthentication/entry/obfuscation-rules.txt b/UserAuthentication/entry/obfuscation-rules.txt deleted file mode 100644 index fdbb5b9852d7dd5f39bddaeb21ab5ee1f3346749..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/obfuscation-rules.txt +++ /dev/null @@ -1,22 +0,0 @@ -# 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/UserAuthentication/entry/oh-package.json5 b/UserAuthentication/entry/oh-package.json5 deleted file mode 100644 index 8492e57daac4f46472628635499c31b3799c3468..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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/UserAuthentication/entry/src/main/ets/common/Logger.ts b/UserAuthentication/entry/src/main/ets/common/Logger.ts deleted file mode 100644 index fc4abffaa1348add20acba4eade3dd05c3e0a203..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/ets/common/Logger.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN: number = 0x0000; // 此处使用自行申请的应用代码号 -const PREFIX: string = '[Sample_UserAuthentication]'; // 应用log标签 - -export class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s'; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = DOMAIN; - } - - getDomain() { - return this.domain; - } - - getPrefix() { - return this.prefix; - } - - getFormat() { - return this.format; - } - - debug(...args: string[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } - - fatal(...args: string[]) { - hilog.fatal(this.domain, this.prefix, this.format, args); - } - - isLoggable(level: number) { - hilog.isLoggable(this.domain, this.prefix, level); - } -} - -export default new Logger(PREFIX); diff --git a/UserAuthentication/entry/src/main/ets/entryability/EntryAbility.ets b/UserAuthentication/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 6395759585f97da6c54a88d0ca58245d80838854..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2025 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 { JSON } from '@kit.ArkTS'; -import { window } from '@kit.ArkUI'; -import Logger from '../common/Logger'; -import { BusinessError } from '@kit.BasicServicesKit'; - -const DOMAIN: number = Logger.getDomain(); -const PREFIX: string = Logger.getPrefix(); -const FORMAT: string = Logger.getFormat(); - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(DOMAIN, PREFIX, FORMAT, 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, PREFIX, FORMAT, 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, PREFIX, FORMAT, 'Ability onWindowStageCreate'); - AppStorage.setOrCreate('pageContext', this.context); - windowStage.getMainWindow((err: BusinessError, data) => { - try { - if (err.code) { - hilog.error(DOMAIN, PREFIX, `Failed to obtain the main window. Cause: ${FORMAT}`, - JSON.stringify(err.message) ?? ''); - return; - } - AppStorage.setOrCreate('UIContext', data.getUIContext()); - } catch (error) { - hilog.error(DOMAIN, PREFIX, `Failed to get UIContext. Cause: ${FORMAT}`, - JSON.stringify(error.message) ?? ''); - } - }) - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, PREFIX, `Failed to load the content. Cause: ${FORMAT}`, - JSON.stringify(err.message) ?? ''); - return; - } - hilog.info(DOMAIN, PREFIX, FORMAT, 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, PREFIX, FORMAT, 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, PREFIX, FORMAT, 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, PREFIX, FORMAT, 'Ability onBackground'); - } -} diff --git a/UserAuthentication/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/UserAuthentication/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index b503d146ec83987789d0f0e40abf88dc85cbdf61..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2025 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'; -import Logger from '../common/Logger'; - -const DOMAIN: number = Logger.getDomain(); -const PREFIX: string = Logger.getPrefix(); -const FORMAT: string = Logger.getFormat(); - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, PREFIX, FORMAT, 'onBackup ok'); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, PREFIX, `onRestore ok ${FORMAT}`, JSON.stringify(bundleVersion)); - } -} \ No newline at end of file diff --git a/UserAuthentication/entry/src/main/ets/pages/Index.ets b/UserAuthentication/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 181eaeaf1897654bd2af98167c4be6a72a8cd83e..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,822 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// 本页代码为标准实例,没有使用同步语法,不涉及测试,更多关于测试信息,详见readme。 -import { BusinessError } from '@kit.BasicServicesKit'; -import { cryptoFramework } from '@kit.CryptoArchitectureKit'; -import { JSON } from '@kit.ArkTS'; -import { promptAction } from '@kit.ArkUI'; -import { userAuth } from '@kit.UserAuthenticationKit'; -import Logger from '../common/Logger'; - -// 用于获取资源字符串 -function resourceToString(resource: Resource): string { - let result: string = ''; - try { - result = (AppStorage.get('pageContext') as Context)?.resourceManager.getStringSync(resource.id); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`catch error, code is ${err?.code}, message is ${err?.message}`); - } - if (result === '' || result === undefined) { - return 'undefined'; - } else { - return result; - } -} - -// 用于异步等待 -async function waiting(times: number): Promise { - // 返回一个 Promise,表示等待 times 毫秒 - return new Promise(resolve => setTimeout(resolve, times)); -} - -function getRandData(): Uint8Array | null { - const rand = cryptoFramework.createRandom(); - const len: number = 16; - let randData: Uint8Array | null = null; - let retryCount = 0; - while (retryCount < 3) { - randData = rand?.generateRandomSync(len)?.data; - if (randData) { - break; - } - retryCount++; - } - return randData; -} - -enum PageIndex { - QUERY_CAPABILITY = 0, // 能力查询页面的索引值 - EXAMPLE_TAB_1 = 1, // 实例1、2页面的索引值 - EXAMPLE_TAB_2 = 2, // 实例3、4页面的索引值 - EXAMPLE_TAB_3 = 3, // 取消页面的索引值 - PERCEIVE_ADJUST = 4, // 感知和调整认证过程页面的索引值 - EXAMPLE_TAB_4 = 5, // 自定义页面的索引值 - CREDENTIAL_QUERIES = 6, // 查询凭据页面的索引值 - SIMULATION_VALIDATION = 7, // 模拟认证页面的索引值 - -}; - -enum ResultIndex { - WHETHER_SUPPORTED = 0, // 能力查询结果的索引值 - EXAMPLE_1 = 1, // 实例1结果的索引值 - EXAMPLE_2 = 2, // 实例2结果的索引值 - EXAMPLE_3 = 3, // 实例3结果的索引值 - EXAMPLE_4 = 4, // 实例4结果的索引值 - CANCEL = 5, // 实例5结果的索引值 - CUSTOMIZE = 6, // 实例6结果的索引值 - QUERY_CREDENTIALS = 7, // 能力查询结果的索引值 - PERCEIVE_ADJUST = 8 // 感知和调整认证过程的索引值 -}; - -@Entry -@Component -struct Index { - @State currentIndex: number = 0; // 最开始索引页面为第一页 - @State result: string[] = new Array(8).fill('wait'); - @State credentialDigest: string = ''; - @State whetherSupport: Resource = $r('app.string.waitQuery'); - @State credentialValue: string = ''; - SPACE_GAP: number = 5; // Row组件间隙 - - /* - * obtain-supported-authentication-capabilities.md - * 以查询设备是否支持认证可信等级≥ATL1的PIN认证功能为例 - */ - // [Start obtain_supported_capabilities] - obtainingSupported() { - try { - // 查询认证能力是否支持 - userAuth.getAvailableStatus(userAuth.UserAuthType.PIN, userAuth.AuthTrustLevel.ATL1); - Logger.info('current auth trust level is supported'); - return true; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`current auth trust level is not supported, code is ${err?.code}, message is ${err?.message}`); - return false; - } - } - - // [End obtain_supported_capabilities] - - /* - * start-authentication.md - * 示例1: - * 发起用户认证,采用认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证,获取认证结果 - * */ - // [Start authentication_example1] - initiatingUserAuthentication1() { - try { - const randData = getRandData(); - if (!randData) { - return; - } - // 设置认证参数 - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - userAuthInstance.on('result', { - onResult: (result: userAuth.UserAuthResult) => { - try { - Logger.info(`userAuthInstance callback result: ${JSON.stringify(result)}`); - this.result[ResultIndex.EXAMPLE_1] = (`${result.result}`); - // 可在认证结束或其他业务需要场景,取消订阅认证结果。 - userAuthInstance.off('result'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - } - } - }); - // 启动认证 - userAuthInstance.start(); - Logger.info('auth start success'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error, code is ${err?.code}, message is ${err?.message}`); - } - } - - // [End authentication_example1] - - /* - * start-authentication.md - * 示例2: - * 发起用户认证,采用认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证 + 认证类型相关 + 复用设备解锁最大有效时长认证,获取认证结果 - * */ - // [Start authentication_example2] - initiatingUserAuthentication2() { - // 设置认证参数 - let reuseUnlockResult: userAuth.ReuseUnlockResult = { - reuseMode: userAuth.ReuseMode.AUTH_TYPE_RELEVANT, - reuseDuration: userAuth.MAX_ALLOWABLE_REUSE_DURATION, - }; - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - reuseUnlockResult: reuseUnlockResult, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - userAuthInstance.on('result', { - onResult: (result: userAuth.UserAuthResult) => { - try { - Logger.info(`userAuthInstance callback result: ${JSON.stringify(result)}`); - this.result[ResultIndex.EXAMPLE_2] = (`${result.result}`); - // 可在认证结束或其他业务需要场景,取消订阅认证结果。 - userAuthInstance.off('result'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - } - } - }); - // 启动认证 - userAuthInstance.start(); - Logger.info('auth start success'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error, code is ${err?.code}, message is ${err?.message}`); - } - } - - // [End authentication_example2] - - /* - * start-authentication.md - * 示例3: - * 发起用户认证,采用认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证 + 任意应用认证类型相关 + 复用任意应用最大有效时长认证,获取认证结果: - * */ - // [Start authentication_example3] - initiatingUserAuthentication3() { - // 设置认证参数 - let reuseUnlockResult: userAuth.ReuseUnlockResult = { - reuseMode: userAuth.ReuseMode.CALLER_IRRELEVANT_AUTH_TYPE_RELEVANT, - reuseDuration: userAuth.MAX_ALLOWABLE_REUSE_DURATION, - }; - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - reuseUnlockResult: reuseUnlockResult, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - userAuthInstance.on('result', { - onResult: (result: userAuth.UserAuthResult) => { - try { - Logger.info(`userAuthInstance callback result: ${JSON.stringify(result)}`); - this.result[ResultIndex.EXAMPLE_3] = (`${result.result}`); - // 可在认证结束或其他业务需要场景,取消订阅认证结果。 - userAuthInstance.off('result'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - } - } - }); - // 启动认证 - userAuthInstance.start(); - Logger.info('auth start success'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error, code is ${err?.code}, message is ${err?.message}`); - } - } - - // [End authentication_example3] - - /* - * start-authentication.md - * 示例4: - * 以模应用方式进行用户身份认证 - * */ - // [Start authentication_example4] - initiatingUserAuthentication4() { - // 设置认证参数 - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - uiContext: this.getUIContext().getHostContext() - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - userAuthInstance.on('result', { - onResult: (result: userAuth.UserAuthResult) => { - try { - Logger.info(`userAuthInstance callback result: ${JSON.stringify(result)}`); - this.result[ResultIndex.EXAMPLE_4] = (`${result.result}`); - // 可在认证结束或其他业务需要场景,取消订阅认证结果。 - userAuthInstance.off('result'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - } - } - }); - // 启动认证 - userAuthInstance.start(); - Logger.info('auth start success'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error, code is ${err?.code}, message is ${err?.message}`); - } - } - - // [End authentication_example4] - - // [Start cancel_authentication] - handleAuthResultAndCanceling(userAuthInstance: userAuth.UserAuthInstance, exampleNumber: number) { - // [StartExclude cancel_authentication] - try { - // userAuthInstance.on异常抛出层 - userAuthInstance.on('result', { - onResult: (result: userAuth.UserAuthResult) => { - try { - Logger.info(`userAuthInstance callback result: ${JSON.stringify(result)}`); - this.result[exampleNumber] = (`${result.result}`); - // 认证完成后取消订阅 - userAuthInstance.off('result'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - } - } - }); - // [EndExclude cancel_authentication] - // 启动认证 - userAuthInstance.start(); - Logger.info('auth start success'); - // [StartExclude cancel_authentication] - // 使用等待函数模拟等待用户认证 - let DELAY_TIME: number = 3000; // 停止3秒 - waiting(DELAY_TIME).then(() => { - // [EndExclude cancel_authentication] - // 取消认证 - userAuthInstance.cancel(); - Logger.info('auth cancel success'); - // [StartExclude cancel_authentication] - }); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`userAuthInstance.on catch error. Code: ${err?.code}, Message: ${err?.message}`); - } - // [EndExclude cancel_authentication] - } - - /* - * cancel-authentication.md - * 发起认证可信等级≥ATL3的人脸+锁屏密码认证后,取消认证请求 - * */ - cancelingUserAuthentication() { - try { - const randData = getRandData(); - if (!randData) { - return; - } - // 设置认证参数 - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - this.handleAuthResultAndCanceling(userAuthInstance, ResultIndex.CANCEL); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error, code is ${err?.code as number}, message is ${err?.message}`); - } - } - - // [End cancel_authentication] - - /* - * perceive-adjust-authentication-process.md - * 感知和调整认证过程 - * */ - // [Start perceive-adjust-authentication-process] - perceiveAndAdjustAuthentication() { - try { - const randData = getRandData(); - if (!randData) { - return; - } - // 设置认证参数 - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - skipLockedBiometricAuth: true - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证过程中的提示信息。 - userAuthInstance.on('authTip', (authTipInfo: userAuth.AuthTipInfo) => { - try { - Logger.info(`userAuthInstance callback authTipInfo = ${JSON.stringify(authTipInfo)}`); - this.result[ResultIndex.PERCEIVE_ADJUST] = (`${authTipInfo.tipType}`); - // 认证完成后取消订阅 - userAuthInstance.off('result'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - } - }); - // 开始认证 - userAuthInstance.start(); - // [StartExclude perceive-adjust-authentication-process] - let DELAY_TIME: number = 3000; // 停止3秒 - waiting(DELAY_TIME).then(() => { - // [EndExclude perceive-adjust-authentication-process] - // 取消订阅认证过程中的提示信息。 - userAuthInstance.off('authTip'); - Logger.info('off authTip success'); - // 取消认证 - userAuthInstance.cancel(); - Logger.info('auth cancel success'); - // [StartExclude perceive-adjust-authentication-process] - }); - // [EndExclude perceive-adjust-authentication-process] - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error, code is ${err?.code as number}, message is ${err?.message}`); - } - } - - // [End perceive-adjust-authentication-process] - - // [Start custom_authentication] - handleCustomAuthResult(userAuthInstance: userAuth.UserAuthInstance, exampleNumber: number) { - // [StartExclude custom_authentication] - try { - // [EndExclude custom_authentication] - userAuthInstance.on('result', { - onResult: (result: userAuth.UserAuthResult) => { - // [StartExclude custom_authentication] - this.result[exampleNumber] = (`${result.result}`); - try { - // onResult异常抛出层 - try { - // JSON.stringify异常抛出层 - // [EndExclude custom_authentication] - Logger.info(`userAuthInstance callback result: ${JSON.stringify(result)}`); - // [StartExclude custom_authentication] - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`JSON stringify catch error, code is ${err?.code}, message is ${err?.message}`); - } - userAuthInstance.off('result'); // 认证完成后取消订阅 - // [EndExclude custom_authentication] - if (result.result == userAuth.UserAuthResultCode.CANCELED_FROM_WIDGET || - result.result == userAuth.UserAuthResultCode.NOT_ENROLLED) { - // 请开发者自行完成拉起自定义认证界面的实现 - // [StartExclude custom_authentication] - (AppStorage.get('UIContext') as UIContext)?.getPromptAction().showToast({ - message: resourceToString($r('app.string.dialogOfCustom')), // 显示文本 - duration: 3000, // 显示时长3000ms - bottom: 300 // 距离底部的距离300vp - }); - // [EndExclude custom_authentication] - } - // [StartExclude custom_authentication] - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - } - // [EndExclude custom_authentication] - } - }); - // 启动认证 - userAuthInstance.start(); - Logger.info('auth start success'); - // [StartExclude custom_authentication] - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`userAuthInstance.on catch error. Code: ${err?.code}, Message: ${err?.message}`); - } - // [EndExclude custom_authentication] - } - - /* - * apply-custom-authentication.md - * 当前示例仅展示如何配置界面、选择切换到自定义认证界面,具体拉起的页面及对应页面的实现,请开发者自行实现 - * */ - applyingCustomAuthentication() { - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.FACE], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - }; - // 配置自定义认证,需设置导航键文本 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - navigationButtonText: resourceToString($r('app.string.navigationButtonText')) - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - this.handleCustomAuthResult(userAuthInstance, ResultIndex.CUSTOMIZE); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error, code is ${err?.code}, message is ${err?.message}`); - } - } - - // [End custom_authentication] - - /* - * obtain-enrolled-state-capabilities.md - * 以查询用户人脸注册凭据的状态为例 - * */ - // [Start obtain_enrolled_capabilities] - obtainingEnrolledCredentialInformation() { - try { - let enrolledState = userAuth.getEnrolledState(userAuth.UserAuthType.PIN); - Logger.info(`get current enrolled state success, enrolledState: ${JSON.stringify(enrolledState)}`); - return enrolledState.credentialDigest; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`get current enrolled state failed, Code is ${err?.code}, message is ${err?.message}`); - return false; - } - } - - // [End obtain_enrolled_capabilities] - comprehensiveFeatures() { - let reuseUnlockResult: userAuth.ReuseUnlockResult = { - reuseMode: userAuth.ReuseMode.AUTH_TYPE_RELEVANT, - reuseDuration: userAuth.MAX_ALLOWABLE_REUSE_DURATION, - }; - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.FACE], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - reuseUnlockResult: reuseUnlockResult - }; - // 配置自定义认证,需设置导航键文本 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - navigationButtonText: resourceToString($r('app.string.navigationButtonText')), - // 该参数仅在单指纹、单人脸场景下支持,该密码并非系统密码,而是应用自己设置的密码 - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - this.handleCustomAuthResult(userAuthInstance, ResultIndex.CUSTOMIZE); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error, code is ${err?.code}, message is ${err?.message}`); - } - } - - @Builder - tabBuilder(title: Resource, targetIndex: number, tabId: string) { - Column() { - Text(title) - .fontColor(this.currentIndex === targetIndex ? $r('app.color.tab_selected_color') : - $r('app.color.tab_not_selected_color')) - .fontSize($r('app.float.size_13')) - } - .width('100%') - .height($r('app.float.size_50')) - .justifyContent(FlexAlign.Center) - .id(tabId) - } - - build() { - Column() { - Tabs() { - TabContent() { - Column() { - Text($r('app.string.whetherSupported')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.query')) - .onClick(() => { - if (this.obtainingSupported()) { - this.result[ResultIndex.WHETHER_SUPPORTED] = 'Support'; - } else { - this.result[ResultIndex.WHETHER_SUPPORTED] = 'Not Support'; - } - }) - Text(this.result[ResultIndex.WHETHER_SUPPORTED]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - } - }.tabBar(this.tabBuilder($r('app.string.queryCapability'), PageIndex.QUERY_CAPABILITY, 'queryCapability')) - - TabContent() { - Column() { - Text($r('app.string.descriptionContent1')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example1')) - .onClick(async () => { - this.initiatingUserAuthentication1(); - }) - Text(this.result[ResultIndex.EXAMPLE_1]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - Blank() - .height('5%') - Text($r('app.string.descriptionContent2')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example2')) - .onClick(async () => { - this.initiatingUserAuthentication2(); - }) - Text(this.result[ResultIndex.EXAMPLE_2]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - } - }.tabBar(this.tabBuilder($r('app.string.exampleTab1'), PageIndex.EXAMPLE_TAB_1, 'exampleTab1')) - - TabContent() { - Column() { - Text($r('app.string.descriptionContent3')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example3')) - .onClick(() => { - this.initiatingUserAuthentication3(); - }) - Text(this.result[ResultIndex.EXAMPLE_3]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - Blank() - .height('5%') - Text($r('app.string.descriptionContent4')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example4')) - .onClick(() => { - this.initiatingUserAuthentication4(); - }) - Text(this.result[ResultIndex.EXAMPLE_4]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - } - }.tabBar(this.tabBuilder($r('app.string.exampleTab2'), PageIndex.EXAMPLE_TAB_2, 'exampleTab2')) - - TabContent() { - Column() { - Text($r('app.string.descriptionContent5')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example5')) - .onClick(async () => { - this.cancelingUserAuthentication(); - }) - Text(this.result[ResultIndex.CANCEL]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - } - }.tabBar(this.tabBuilder($r('app.string.exampleTab3'), PageIndex.EXAMPLE_TAB_3, 'exampleTab3')) - - TabContent() { - Column() { - Text($r('app.string.descriptionContent7')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example6')) - .onClick(async () => { - this.perceiveAndAdjustAuthentication(); - }) - Text(this.result[ResultIndex.PERCEIVE_ADJUST]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - } - }.tabBar(this.tabBuilder($r('app.string.exampleTab5'), PageIndex.PERCEIVE_ADJUST, 'exampleTab5')) - - TabContent() { - Column() { - Text($r('app.string.descriptionContent6')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example6')) - .onClick(() => { - this.applyingCustomAuthentication(); - }) - Text(this.result[ResultIndex.CUSTOMIZE]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - } - }.tabBar(this.tabBuilder($r('app.string.exampleTab4'), PageIndex.EXAMPLE_TAB_4, 'exampleTab4')) - - TabContent() { - Column() { - Text($r('app.string.queryCredentials')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.query')) - .onClick(() => { - if (this.obtainingEnrolledCredentialInformation()) { - this.credentialDigest = 'credentialDigest is ' + this.obtainingEnrolledCredentialInformation(); - } else { - this.credentialDigest = 'Error'; - } - }) - Text(this.credentialDigest) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - } - }.tabBar(this.tabBuilder($r('app.string.credentialQueries'), PageIndex.CREDENTIAL_QUERIES, 'credentialQueries')) - - TabContent() { - Column() { - Button($r('app.string.refreshSupported')) - .onClick(() => { - if (this.obtainingSupported()) { - this.whetherSupport = $r('app.string.queryPass'); - } else { - this.whetherSupport = $r('app.string.queryError'); - } - }) - .margin($r('app.float.size_10')) - Text(this.whetherSupport) - .fontSize($r('app.float.size_20')) - .textAlign(TextAlign.Center) - Blank() - .height('10%') - Row({ space: this.SPACE_GAP }) { - Button($r('app.string.customLogin')) - .onClick(() => { - this.comprehensiveFeatures(); - }) - Button($r('app.string.simpleLogin')) - .onClick(() => { - this.initiatingUserAuthentication2(); - }) - } - .margin($r('app.float.size_10')) - - Blank() - .height('10%') - Text($r('app.string.credentialDescription')) - .width('80%') - .fontSize($r('app.float.size_20')) - .textAlign(TextAlign.Center) - Button($r('app.string.refreshTheCredentials')) - .onClick(() => { - try { - let enrolledState = userAuth.getEnrolledState(userAuth.UserAuthType.PIN); - Logger.info(`get current enrolled state success, enrolledState: ${JSON.stringify(enrolledState)}`); - this.credentialValue = enrolledState.credentialDigest + ''; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`get current enrolled state failed, Code is ${err?.code}, message is ${err?.message}`); - } - }) - .margin($r('app.float.size_10')) - Text(this.credentialValue) - .fontSize($r('app.float.size_20')) - .textAlign(TextAlign.Center) - } - } - .tabBar(this.tabBuilder($r('app.string.simulationValidation'), PageIndex.SIMULATION_VALIDATION, - 'simulationValidation')) - } - .vertical(false) - .barMode(BarMode.Fixed) - .barWidth('90%') - .barHeight('10%') - .onChange((index: number) => { - this.currentIndex = index; - }) - .width('100%') - .height('100%') - .scrollable(true) - }.height('100%') - } -} diff --git a/UserAuthentication/entry/src/main/ets/pages/testPage.ets b/UserAuthentication/entry/src/main/ets/pages/testPage.ets deleted file mode 100644 index 121b3a584a712d84e404cde04311d5d61f158734..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/ets/pages/testPage.ets +++ /dev/null @@ -1,769 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -/* 此页面仅用于测试,使用了同步语法,但实际不建议使用同步语法, - * 请在运行测试时将src/main/ets/entryability/EntryAbility.ets中的 - * windowStage.loadContent('pages/Index', ...) - * 修改为windowStage.loadContent('pages/testPage', ...) - */ - -import { BusinessError } from '@kit.BasicServicesKit'; -import { cryptoFramework } from '@kit.CryptoArchitectureKit'; -import { JSON } from '@kit.ArkTS'; -import { userAuth } from '@kit.UserAuthenticationKit'; -import Logger from '../common/Logger'; - -// 用于获取资源字符串 -function resourceToString(resource: Resource): string { - let result: string = ''; - try { - result = (AppStorage.get('pageContext') as Context)?.resourceManager.getStringSync(resource.id); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`catch error. Code is ${err?.code}, message is ${err?.message}`); - } - if (result === '' || result === undefined) { - return 'undefined'; - } else { - return result; - } -} - -// 用于异步等待 -async function waiting(times: number): Promise { - // 返回一个 Promise,表示等待 times 毫秒 - return new Promise(resolve => setTimeout(resolve, times)); -} - -function getRandData(): Uint8Array | null { - const rand = cryptoFramework.createRandom(); - const len: number = 16; - let randData: Uint8Array | null = null; - let retryCount = 0; - while (retryCount < 3) { - randData = rand?.generateRandomSync(len)?.data; - if (randData) { - break; - } - retryCount++; - } - return randData; -} - -/* - * obtain-supported-authentication-capabilities.md - * 以查询设备是否支持认证可信等级≥ATL1的PIN认证功能为例 - */ -export function obtainingSupported() { - try { - // 查询认证能力是否支持 - userAuth.getAvailableStatus(userAuth.UserAuthType.PIN, userAuth.AuthTrustLevel.ATL1); - Logger.info('current auth trust level is supported'); - return true; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`current auth trust level is not supported. Code is ${err?.code}, message is ${err?.message}`); - return false; - } -} - -// 用于处理示例1,示例2,示例3和示例4的部分操作 -function handleAuthResult(userAuthInstance: userAuth.UserAuthInstance): Promise { - return new Promise((resolve, reject) => { - try { - // userAuthInstance.on异常抛出层 - userAuthInstance.on('result', { - onResult(result) { - try { - // onResult异常抛出层 - try { - // JSON.stringify异常抛出层 - Logger.info(`userAuthInstance callback result: ${JSON.stringify(result)}`); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`JSON stringify catch error. Code is ${err?.code}, message is ${err?.message}`); - reject(err); - } - userAuthInstance.off('result'); // 认证完成后取消订阅 - resolve(result.result); // 返回认证结果 - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - reject(err); - } - } - }); - // 启动认证 - userAuthInstance.start(); - Logger.info('auth start success'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`userAuthInstance.on catch error. Code: ${err?.code}, Message: ${err?.message}`); - reject(err); - } - }); -} - -/* - * start-authentication.md - * 示例1: - * 发起用户认证,采用认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证,获取认证结果 - * */ -export async function initiatingUserAuthentication1() { - try { - const randData = getRandData(); - if (!randData) { - return; - } - // 设置认证参数 - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - const result = await handleAuthResult(userAuthInstance); - return result; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error. Code is ${err?.code}, message is ${err?.message}`); - return err.code; - } -} - -/* - * start-authentication.md - * 示例2: - * 发起用户认证,采用认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证 + 认证类型相关 + 复用设备解锁最大有效时长认证,获取认证结果 - * */ -export async function initiatingUserAuthentication2() { - // 设置认证参数 - let reuseUnlockResult: userAuth.ReuseUnlockResult = { - reuseMode: userAuth.ReuseMode.AUTH_TYPE_RELEVANT, - reuseDuration: userAuth.MAX_ALLOWABLE_REUSE_DURATION, - }; - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - reuseUnlockResult: reuseUnlockResult, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - const result = await handleAuthResult(userAuthInstance); - return result; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error. Code is ${err?.code}, message is ${err?.message}`); - return err.code; - } -} - -/* - * start-authentication.md - * 示例3: - * 发起用户认证,采用认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证 + 任意应用认证类型相关 + 复用任意应用最大有效时长认证,获取认证结果: - * */ -export async function initiatingUserAuthentication3() { - // 设置认证参数 - let reuseUnlockResult: userAuth.ReuseUnlockResult = { - reuseMode: userAuth.ReuseMode.CALLER_IRRELEVANT_AUTH_TYPE_RELEVANT, - reuseDuration: userAuth.MAX_ALLOWABLE_REUSE_DURATION, - } - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - reuseUnlockResult: reuseUnlockResult, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - const result = await handleAuthResult(userAuthInstance); - return result; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error. Code is ${err?.code}, message is ${err?.message}`); - return err.code; - } -} - -/* - * start-authentication.md - * 示例4: - * 以模应用方式进行用户身份认证 - * */ -export async function initiatingUserAuthentication4() { - // 设置认证参数 - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - uiContext: (AppStorage.get('UIContext') as UIContext)?.getHostContext() - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - const result = await handleAuthResult(userAuthInstance); - return result; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error. Code is ${err?.code}, message is ${err?.message}`); - return err.code; - } -} - -function handleAuthResultAndCanceling(userAuthInstance: userAuth.UserAuthInstance): Promise { - return new Promise((resolve, reject) => { - try { - // userAuthInstance.on异常抛出层 - userAuthInstance.on('result', { - onResult(result) { - try { - // onResult异常抛出层 - try { - // JSON.stringify异常抛出层 - Logger.info(`userAuthInstance callback result: ${JSON.stringify(result)}`); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`JSON stringify catch error. Code is ${err?.code}, message is ${err?.message}`); - reject(err); - } - userAuthInstance.off('result'); // 认证完成后取消订阅 - resolve(result.result); // 返回认证结果 - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - reject(err); - } - } - }); - // 启动认证 - userAuthInstance.start(); - Logger.info('auth start success'); - // 使用等待函数模拟等待用户认证 - let DELAY_TIME: number = 3000; // 停止3秒 - waiting(DELAY_TIME).then(() => { - // 延迟后取消认证 - userAuthInstance.cancel(); - Logger.info('auth cancel success'); - }); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`userAuthInstance.on catch error. Code: ${err?.code}, Message: ${err?.message}`); - reject(err); - } - }); -} - -/* - * cancel-authentication.md - * 发起认证可信等级≥ATL3的人脸+锁屏密码认证后,取消认证请求 - * */ -export async function cancelingUserAuthentication() { - try { - const randData = getRandData(); - if (!randData) { - return; - } - // 设置认证参数 - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FACE, userAuth.UserAuthType.FINGERPRINT], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - }; - // 配置认证界面 - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 使用 Promise 来监听认证结果 - const result = await handleAuthResultAndCanceling(userAuthInstance); - return result; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error. Code is ${err?.code as number}, message is ${err?.message}`); - if (err?.message === 'Authentication cancelled after waiting') { - err.code = userAuth.UserAuthResultCode.CANCELED; - } - return err.code; - } -} - -function handleCustomAuthResult(userAuthInstance: userAuth.UserAuthInstance): Promise { - return new Promise((resolve, reject) => { - try { - // userAuthInstance.on异常抛出层 - userAuthInstance.on('result', { - onResult(result) { - try { - // onResult异常抛出层 - try { - // JSON.stringify异常抛出层 - Logger.info(`userAuthInstance callback result: ${JSON.stringify(result)}`); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`JSON stringify catch error. Code is ${err?.code}, message is ${err?.message}`); - reject(err); - } - userAuthInstance.off('result'); // 认证完成后取消订阅 - if (result.result == userAuth.UserAuthResultCode.CANCELED_FROM_WIDGET || - result.result == userAuth.UserAuthResultCode.NOT_ENROLLED) { - // 请开发者自行完成拉起自定义认证界面的实现 - // 此处拉起类似于支付宝输入密码支付的界面 - (AppStorage.get('UIContext') as UIContext)?.getPromptAction().showToast({ - message: resourceToString($r('app.string.dialogOfCustom')), // 显示文本 - duration: 3000, // 显示时长 - bottom: 300 // 距离底部的距离 - }); - } - resolve(result.result); // 返回认证结果 - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`onResult catch error. Code: ${err?.code}, Message: ${err?.message}`); - reject(err); - } - } - }); - // 启动认证 - userAuthInstance.start(); - Logger.info('auth start success'); - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`userAuthInstance.on catch error. Code: ${err?.code}, Message: ${err?.message}`); - reject(err); - } - }); -} - -/* - * apply-custom-authentication.md - * 当前示例仅展示如何配置界面、选择切换到自定义认证界面,具体拉起的页面及对应页面的实现,请开发者自行实现 - * */ -async function applyingCustomAuthentication() { - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.FACE], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - }; // 配置认证界面需设置navigationButtonText - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - navigationButtonText: resourceToString($r('app.string.navigationButtonText')), - // 该参数仅在单指纹、单人脸场景下支持,该密码并非系统密码,而是应用自己设置的密码 - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - const result = await handleCustomAuthResult(userAuthInstance); - return result; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error. Code is ${err?.code}, message is ${err?.message}`); - return err.code; - } -} - -/* - * obtain-enrolled-state-capabilities.md - * 以查询用户人脸注册凭据的状态为例 - * */ -function obtainingEnrolledCredentialInformation() { - try { - let enrolledState = userAuth.getEnrolledState(userAuth.UserAuthType.PIN); - Logger.info(`get current enrolled state success, enrolledState: ${JSON.stringify(enrolledState)}`); - return enrolledState.credentialDigest; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`get current enrolled state failed, Code is ${err?.code}, message is ${err?.message}`); - return false; - } -} - -async function comprehensiveFeatures() { - let reuseUnlockResult: userAuth.ReuseUnlockResult = { - reuseMode: userAuth.ReuseMode.AUTH_TYPE_RELEVANT, - reuseDuration: userAuth.MAX_ALLOWABLE_REUSE_DURATION, - }; - try { - const randData = getRandData(); - if (!randData) { - return; - } - const authParam: userAuth.AuthParam = { - challenge: randData, - authType: [userAuth.UserAuthType.FACE], - authTrustLevel: userAuth.AuthTrustLevel.ATL3, - reuseUnlockResult: reuseUnlockResult - }; // 配置认证界面需设置navigationButtonText - const widgetParam: userAuth.WidgetParam = { - title: resourceToString($r('app.string.title')), - navigationButtonText: resourceToString($r('app.string.navigationButtonText')), - // 该参数仅在单指纹、单人脸场景下支持,该密码并非系统密码,而是应用自己设置的密码 - }; - // 获取认证对象 - const userAuthInstance = userAuth.getUserAuthInstance(authParam, widgetParam); - Logger.info('get userAuth instance success'); - // 订阅认证结果 - const result = await handleCustomAuthResult(userAuthInstance); - return result; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`auth catch error. Code is ${err?.code}, message is ${err?.message}`); - return err.code; - } -} - -enum PageIndex { - QUERY_CAPABILITY = 0, // 能力查询页面的索引值 - EXAMPLE_TAB_1 = 1, // 实例1页面的索引值 - EXAMPLE_TAB_2 = 2, // 实例2页面的索引值 - EXAMPLE_TAB_3 = 3, // 实例3页面的索引值 - EXAMPLE_TAB_4 = 4, // 实例4页面的索引值 - CREDENTIAL_QUERIES = 5, // 能力查询页面的索引值 - SIMULATION_VALIDATION = 6 // 模拟认证页面的索引值 -} - -enum TextIdIndex { - WHETHER_SUPPORTED = 0, // 能力查询结果的索引值 - EXAMPLE_1 = 1, // 实例1结果的索引值 - EXAMPLE_2 = 2, // 实例2结果的索引值 - EXAMPLE_3 = 3, // 实例3结果的索引值 - EXAMPLE_4 = 4, // 实例4结果的索引值 - CANCEL = 5, // 实例5结果的索引值 - CUSTOMIZE = 6, // 实例6结果的索引值 - QUERY_CREDENTIALS = 7 // 能力查询结果的索引值 -}; - -@Entry -@Component -struct Index { - @State currentIndex: number = 0; // 最开始索引页面为第一页 - @State test: string[] = new Array(8).fill('wait'); // 一共9个后续测试需要判断的值所以设置数组大小为9 - @State credentialDigest: string = ''; - @State whetherSupport: Resource = $r('app.string.waitQuery'); - @State credentialValue: string = ''; - SPACE_GAP: number = 5; - - @Builder - tabBuilder(title: Resource, targetIndex: number, tabId: string) { - Column() { - Text(title) - .fontColor(this.currentIndex === targetIndex ? $r('app.color.tab_selected_color') : - $r('app.color.tab_not_selected_color')) - .fontSize($r('app.float.size_13')) - } - .width('100%') - .height($r('app.float.size_50')) - .justifyContent(FlexAlign.Center) - .id(tabId) - } - - build() { - Column() { - Tabs() { - TabContent() { - Column() { - Text($r('app.string.whetherSupported')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.query')) - .onClick(() => { - if (obtainingSupported()) { - this.test[TextIdIndex.WHETHER_SUPPORTED] = 'Pass'; - } else { - this.test[TextIdIndex.WHETHER_SUPPORTED] = 'Error'; - } - }) - Text(this.test[TextIdIndex.WHETHER_SUPPORTED]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - .id('text' + TextIdIndex.WHETHER_SUPPORTED) - } - }.tabBar(this.tabBuilder($r('app.string.queryCapability'), PageIndex.QUERY_CAPABILITY, 'queryCapability')) - - TabContent() { - Column() { - Text($r('app.string.descriptionContent1')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example1')) - .onClick(async () => { - let msg = initiatingUserAuthentication1(); - if (await msg === userAuth.UserAuthResultCode.SUCCESS) { - this.test[TextIdIndex.EXAMPLE_1] = 'Pass'; - } else { - this.test[TextIdIndex.EXAMPLE_1] = 'Error'; - } - }) - .id('button1') - Text(this.test[TextIdIndex.EXAMPLE_1]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - .id('text' + TextIdIndex.EXAMPLE_1) - Blank() - .height('5%') - Text($r('app.string.descriptionContent2')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example2')) - .onClick(async () => { - let msg = await initiatingUserAuthentication2(); - if (msg === userAuth.UserAuthResultCode.SUCCESS) { - this.test[TextIdIndex.EXAMPLE_2] = 'Pass'; - } else { - this.test[TextIdIndex.EXAMPLE_2] = 'Error'; - } - }) - .id('button2') - Text(this.test[TextIdIndex.EXAMPLE_2]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - .id('text' + TextIdIndex.EXAMPLE_2) - } - }.tabBar(this.tabBuilder($r('app.string.exampleTab1'), PageIndex.EXAMPLE_TAB_1, 'exampleTab1')) - - TabContent() { - Column() { - Text($r('app.string.descriptionContent3')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example3')) - .onClick(async () => { - let msg = initiatingUserAuthentication3(); - if (await msg === userAuth.UserAuthResultCode.SUCCESS) { - this.test[TextIdIndex.EXAMPLE_3] = 'Pass'; - } else { - this.test[TextIdIndex.EXAMPLE_3] = 'Error'; - } - }) - .id('button3') - Text(this.test[TextIdIndex.EXAMPLE_3]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - .id('text' + TextIdIndex.EXAMPLE_3) - Blank() - .height('5%') - Text($r('app.string.descriptionContent4')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example4')) - .onClick(async () => { - let msg = await initiatingUserAuthentication4(); - if (msg === userAuth.UserAuthResultCode.SUCCESS) { - this.test[TextIdIndex.EXAMPLE_4] = 'Pass'; - } else { - this.test[TextIdIndex.EXAMPLE_4] = 'Error'; - } - }) - .id('button4') - Text(this.test[TextIdIndex.EXAMPLE_4]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - .id('text' + TextIdIndex.EXAMPLE_4) - } - }.tabBar(this.tabBuilder($r('app.string.exampleTab2'), PageIndex.EXAMPLE_TAB_2, 'exampleTab2')) - - TabContent() { - Column() { - Text($r('app.string.descriptionContent5')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example5')) - .onClick(async () => { - let msg = cancelingUserAuthentication(); - if (await msg === userAuth.UserAuthResultCode.CANCELED) { - this.test[TextIdIndex.CANCEL] = 'Pass'; - } else { - this.test[TextIdIndex.CANCEL] = 'Error'; - } - }) - Text(this.test[TextIdIndex.CANCEL]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - .id('text' + TextIdIndex.CANCEL) - } - }.tabBar(this.tabBuilder($r('app.string.exampleTab3'), PageIndex.EXAMPLE_TAB_3, 'exampleTab3')) - - TabContent() { - Column() { - Text($r('app.string.descriptionContent6')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.example6')) - .onClick(async () => { - let msg = await applyingCustomAuthentication(); - if (msg == userAuth.UserAuthResultCode.CANCELED_FROM_WIDGET || - msg == userAuth.UserAuthResultCode.NOT_ENROLLED) { - this.test[TextIdIndex.CUSTOMIZE] = 'Pass'; - } else { - this.test[TextIdIndex.CUSTOMIZE] = 'Error'; - } - }) - Text(this.test[TextIdIndex.CUSTOMIZE]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - .id('text' + TextIdIndex.CUSTOMIZE) - } - }.tabBar(this.tabBuilder($r('app.string.exampleTab4'), PageIndex.EXAMPLE_TAB_4, 'exampleTab4')) - - TabContent() { - Column() { - Text($r('app.string.queryCredentials')) - .width('70%') - .textAlign(TextAlign.Center) - .fontSize($r('app.float.size_20')) - Button($r('app.string.query')) - .onClick(() => { - if (obtainingEnrolledCredentialInformation()) { - this.test[TextIdIndex.QUERY_CREDENTIALS] = 'Pass'; - this.credentialDigest = 'credentialDigest is ' + obtainingEnrolledCredentialInformation(); - } else { - this.test[TextIdIndex.QUERY_CREDENTIALS] = 'Error'; - } - }) - Text(this.test[TextIdIndex.QUERY_CREDENTIALS]) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - .id('text' + TextIdIndex.QUERY_CREDENTIALS) - Text(this.credentialDigest) - .fontSize($r('app.float.size_40')) - .textAlign(TextAlign.Center) - } - }.tabBar(this.tabBuilder($r('app.string.credentialQueries'), PageIndex.CREDENTIAL_QUERIES, 'credentialQueries')) - - TabContent() { - Column() { - Button($r('app.string.refreshSupported')) - .onClick(() => { - if (obtainingSupported()) { - this.whetherSupport = $r('app.string.queryPass'); - } else { - this.whetherSupport = $r('app.string.queryError'); - } - }) - .id('button1') - .margin($r('app.float.size_10')) - Text(this.whetherSupport) - .fontSize($r('app.float.size_20')) - .textAlign(TextAlign.Center) - Blank() - .height('10%') - Row({ space: this.SPACE_GAP }) { - Button($r('app.string.customLogin')) - .onClick(() => { - comprehensiveFeatures(); - }) - .id('button2') - Button($r('app.string.simpleLogin')) - .onClick(() => { - initiatingUserAuthentication2(); - }) - .id('button3') - } - .margin($r('app.float.size_10')) - - Blank() - .height('10%') - Text($r('app.string.credentialDescription')) - .width('80%') - .fontSize($r('app.float.size_20')) - .textAlign(TextAlign.Center) - Button($r('app.string.refreshTheCredentials')) - .onClick(() => { - try { - let enrolledState = userAuth.getEnrolledState(userAuth.UserAuthType.PIN); - Logger.info(`get current enrolled state success, enrolledState: ${JSON.stringify(enrolledState)}`); - this.credentialValue = enrolledState.credentialDigest + ''; - } catch (error) { - const err: BusinessError = error as BusinessError; - Logger.error(`get current enrolled state failed, Code is ${err?.code}, message is ${err?.message}`); - } - }) - .id('button4') - .margin($r('app.float.size_10')) - Text(this.credentialValue) - .fontSize($r('app.float.size_20')) - .textAlign(TextAlign.Center) - } - } - .tabBar(this.tabBuilder($r('app.string.simulationValidation'), PageIndex.SIMULATION_VALIDATION, - 'simulationValidation')) - } - .vertical(false) - .barMode(BarMode.Fixed) - .barWidth('90%') - .barHeight('5%') - .onChange((index: number) => { - this.currentIndex = index; - }) - .width('100%') - .height('100%') - .scrollable(true) - }.height('100%') - } -} diff --git a/UserAuthentication/entry/src/main/module.json5 b/UserAuthentication/entry/src/main/module.json5 deleted file mode 100644 index 2f0beaf027106d0be03eab937781b86293cbc576..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/module.json5 +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2025 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", - "definePermissions": [ - { - "name": "ohos.access.permission.SECURITY_RESTRICTIONS", - "grantMode": "system_grant", - "availableLevel": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:EntryAbility_label" - } - ], - "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" - ], - "permissions": [ - "ohos.access.permission.SECURITY_RESTRICTIONS" - ] - } - ], - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.ACCESS_BIOMETRIC", - "reason": "$string:reason", - "usedScene": { - "when": "always" - } - }, - { - "name": "ohos.access.permission.SECURITY_RESTRICTIONS" - } - ] - } -} \ No newline at end of file diff --git a/UserAuthentication/entry/src/main/resources/base/element/color.json b/UserAuthentication/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3a54e33c8f20710c81384aa0de054afa2377f49d..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "tab_selected_color", - "value": "#1698CE" - }, - { - "name": "tab_not_selected_color", - "value": "#6B6B6B" - } - ] -} \ No newline at end of file diff --git a/UserAuthentication/entry/src/main/resources/base/element/float.json b/UserAuthentication/entry/src/main/resources/base/element/float.json deleted file mode 100644 index f10bacdc37bbae4ebe5ba9f7b0f12d500d920a30..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "float": [ - { - "name": "size_5", - "value": "10" - }, - { - "name": "size_10", - "value": "10" - }, - { - "name": "size_13", - "value": "13" - }, - { - "name": "size_20", - "value": "20" - }, - { - "name": "size_40", - "value": "40" - }, - { - "name": "size_50", - "value": "50" - } - ] -} \ No newline at end of file diff --git a/UserAuthentication/entry/src/main/resources/base/element/string.json b/UserAuthentication/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 8b63d0ea9fe9d01224ffe2b56a2c6313f3faec8c..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "User Authentication" - }, - { - "name": "module_desc", - "value": "User Authentication" - }, - { - "name": "EntryAbility_desc", - "value": "User Authentication" - }, - { - "name": "EntryAbility_label", - "value": "User Authentication" - }, - { - "name": "reason", - "value": "Used to verify user permissions" - }, - { - "name": "whetherSupported", - "value": "Whether the certification capability is supported" - }, - { - "name": "query", - "value": "query" - }, - { - "name": "descriptionContent1", - "value": "Use the authentication credibility level ≥ATL3 face + lock screen password + fingerprint authentication to obtain the authentication result" - }, - { - "name": "example1", - "value": "Example 1 of initiating user authentication" - }, - { - "name": "descriptionContent2", - "value": "Use the authentication level ≥ATL3 face + lock screen password + fingerprint authentication + authentication type + multiplexing device unlocking maximum validity period authentication to obtain the authentication result" - }, - { - "name": "example2", - "value": "Example 2 for initiating user authentication" - }, - { - "name": "descriptionContent4", - "value": "Perform user identity authentication in the form of a modular application" - }, - { - "name": "example3", - "value": "Example 3 for initiating user authentication" - }, - { - "name": "descriptionContent3", - "value": "Initiate user authentication and use the authentication credibility level ≥ATL3 face + lock screen password + fingerprint authentication + any application authentication type + reuse the maximum validity duration authentication of any application to obtain the authentication result" - }, - { - "name": "example4", - "value": "Example 3 for initiating user authentication" - }, - { - "name": "queryCredentials", - "value": "Query the status of the user's registration credentials, and when the authentication method is disabled and then enabled, the query credentials will change again" - }, - { - "name": "customLogin", - "value": "Impersonate a custom login" - }, - { - "name": "simpleLogin", - "value": "User authentication login" - }, - { - "name": "refreshTheCredentials", - "value": "Refresh the credentials" - }, - { - "name": "credentialDescription", - "value": "After the authentication method is disabled and then enabled, click \"Refresh Credential Information\" to change the credential code" - }, - { - "name": "refreshSupported", - "value": "Refreshes the support status of the certification competency" - }, - { - "name": "queryCapability", - "value": "Query capability" - }, - { - "name": "exampleTab1", - "value": "Example 1、2" - }, - { - "name": "exampleTab2", - "value": "Example 3、4" - }, - { - "name": "exampleTab3", - "value": "Cancel" - }, - { - "name": "exampleTab4", - "value": "Customize" - }, - { - "name": "exampleTab5", - "value": "Perceive and adjust" - }, - { - "name": "credentialQueries", - "value": "Query credentials" - }, - { - "name": "waitQuery", - "value": "Wait for the query" - }, - { - "name": "queryPass", - "value": "Support authentication capabilities" - }, - { - "name": "queryError", - "value": "No, please go to Settings -> Biometrics & Passwords to set the authentication capability" - }, - { - "name": "simulationValidation", - "value": "Simulation validation" - }, - { - "name": "title", - "value": "Please verify your identity" - }, - { - "name": "navigationButtonText", - "value": "Use app passwords" - }, - { - "name": "dialogOfCustom", - "value": "Here pull up the application password entry interface" - }, - { - "name": "descriptionContent5", - "value": "After initiating the authentication of the face + lock screen password + fingerprint authentication with the authentication level ≥ATL3), cancel the authentication request" - }, - { - "name": "example5", - "value": "Cancellation of certification during the certification process" - }, - { - "name": "descriptionContent6", - "value": "Toggle custom authentication" - }, - { - "name": "descriptionContent7", - "value": "Adjust the authentication process, obtain the prompts for pulling up and exiting the control during the authentication process, as well as every failed authentication attempt made by the user during the authentication process." - }, - { - "name": "example6", - "value": "Pull up the certification" - } - ] -} \ No newline at end of file diff --git a/UserAuthentication/entry/src/main/resources/base/media/app_icon.png b/UserAuthentication/entry/src/main/resources/base/media/app_icon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/UserAuthentication/entry/src/main/resources/base/media/app_icon.png and /dev/null differ diff --git a/UserAuthentication/entry/src/main/resources/base/media/background.png b/UserAuthentication/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/UserAuthentication/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/UserAuthentication/entry/src/main/resources/base/media/foreground.png b/UserAuthentication/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/UserAuthentication/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/UserAuthentication/entry/src/main/resources/base/media/layered_image.json b/UserAuthentication/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/UserAuthentication/entry/src/main/resources/base/media/startIcon.png b/UserAuthentication/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/UserAuthentication/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/UserAuthentication/entry/src/main/resources/base/profile/backup_config.json b/UserAuthentication/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/UserAuthentication/entry/src/main/resources/base/profile/main_pages.json b/UserAuthentication/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 5182871ad89025863b21914fd92762e44c56a4f6..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/testPage", - "pages/Index" - ] -} diff --git a/UserAuthentication/entry/src/main/resources/zh_CN/element/string.json b/UserAuthentication/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 3cf58f08a4ced6545b498eb7c7cd68d85976436f..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "User Authentication" - }, - { - "name": "module_desc", - "value": "UserAuthentication工程化示例代码" - }, - { - "name": "EntryAbility_desc", - "value": "UserAuthentication工程化示例代码" - }, - { - "name": "EntryAbility_label", - "value": "User Authentication" - }, - { - "name": "reason", - "value": "用于验证用户权限" - }, - { - "name": "whetherSupported", - "value": "认证能力是否支持" - }, - { - "name": "query", - "value": "查询" - }, - { - "name": "descriptionContent1", - "value": "采用认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证,获取认证结果" - }, - { - "name": "example1", - "value": "发起用户认证示例1" - }, - { - "name": "descriptionContent2", - "value": "采用认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证 + 认证类型相关 + 复用设备解锁最大有效时长认证,获取认证结果" - }, - { - "name": "example2", - "value": "发起用户认证示例2" - }, - { - "name": "descriptionContent3", - "value": "发起用户认证,采用认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证 + 任意应用认证类型相关 + 复用任意应用最大有效时长认证,获取认证结果" - }, - { - "name": "example3", - "value": "发起用户认证示例3" - }, - { - "name": "descriptionContent4", - "value": "以模应用方式进行用户身份认证" - }, - { - "name": "example4", - "value": "发起用户认证示例4" - }, - { - "name": "queryCredentials", - "value": "查询用户注册凭据的状态,当认证方式被关闭再开启后,再次查询凭据会变化" - }, - { - "name": "customLogin", - "value": "模拟自定义登录" - }, - { - "name": "simpleLogin", - "value": "用户验证登录" - }, - { - "name": "refreshTheCredentials", - "value": "刷新凭证信息" - }, - { - "name": "credentialDescription", - "value": "当认证方式被关闭再开启后,点击“刷新凭证信息”下方凭据码会发生变化" - }, - { - "name": "refreshSupported", - "value": "刷新认证能力支持状态" - }, - { - "name": "queryCapability", - "value": "查询能力" - }, - { - "name": "exampleTab1", - "value": "实例1、2" - }, - { - "name": "exampleTab2", - "value": "实例3、4" - }, - { - "name": "exampleTab3", - "value": "取消实例" - }, - { - "name": "exampleTab4", - "value": "自定义" - }, - { - "name": "exampleTab5", - "value": "调整和控制" - }, - { - "name": "credentialQueries", - "value": "查询凭据" - }, - { - "name": "waitQuery", - "value": "等待查询" - }, - { - "name": "queryPass", - "value": "支持认证能力" - }, - { - "name": "queryError", - "value": "不支持,请前往 设置->生物识别和密码 设置认证能力" - }, - { - "name": "simulationValidation", - "value": "模拟验证" - }, - { - "name": "title", - "value": "请进行身份认证" - }, - { - "name": "navigationButtonText", - "value": "使用应用密码" - }, - { - "name": "dialogOfCustom", - "value": "此处拉起应用密码输入界面" - }, - { - "name": "descriptionContent5", - "value": "发起认证可信等级≥ATL3的人脸 + 锁屏密码 + 指纹认证认证后,取消认证请求" - }, - { - "name": "example5", - "value": "认证过程中取消认证" - }, - { - "name": "descriptionContent6", - "value": "切换自定义认证" - }, - { - "name": "descriptionContent7", - "value": "通过skipLockedBiometricAuth参数调整认证过程,通过on(type: 'authTip', callback: AuthTipCallback)获取认证过程中控件的拉起和退出提示,以及认证过程中用户的每一次认证失败尝试。" - }, - { - "name": "example6", - "value": "拉起认证" - } - ] -} \ No newline at end of file diff --git a/UserAuthentication/entry/src/ohosTest/ets/test/Index.test.ets b/UserAuthentication/entry/src/ohosTest/ets/test/Index.test.ets deleted file mode 100644 index 9f609ca1a8789e51a1f1aa0404c9759c9541d6a9..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/ohosTest/ets/test/Index.test.ets +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, expect, it } from '@ohos/hypium'; -import { abilityDelegatorRegistry, Component, Driver, ON } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - -const TAG = '[Sample_UserAuthentication]'; -const DOMAIN = 0xF811; -const BUNDLE = 'UserAuthentication_'; -const DELAY_TIME_500MS = 500; -const DELAY_TIME_1S = 1000; -const DELAY_TIME_5S = 5000; -const DELAY_TIME_10S = 10000; -const delegator = abilityDelegatorRegistry.getAbilityDelegator(); -const bundleName = abilityDelegatorRegistry.getArguments().bundleName; - -export default function IndexTest() { - describe('IndexTest', () => { - /** - * @tc.number IAM_StartAbility_001 - * @tc.name IAM_StartAbility_001 - * @tc.desc 启动Ability - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,begin'); - //start tested ability - const want: Want = { - bundleName: bundleName, - abilityName: 'EntryAbility' - }; - await delegator.startAbility(want); - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME_500MS); - // check top display ability - const ability: UIAbility = await delegator.getCurrentTopAbility(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,get top ability'); - expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,end'); - }) - - /** - * @tc.number IAM_UiTest_001 - * @tc.name IAM_UiTest_001 - * @tc.desc 测试查询能力功能点 - */ - it(BUNDLE + 'UiTest_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_001,begin'); - let driver: Driver = Driver.create(); - let tabBar: Component = await driver.findComponent(ON.id('queryCapability')); - await tabBar.click(); - let button: Component = await driver.findComponent(ON.type('Button')); - await button.click(); - await driver.delayMs(DELAY_TIME_1S); - let textComponent: Component = await driver.findComponent(ON.id('text0')); - let text = await textComponent.getText(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_001,test:' + text); - expect('Pass').assertEqual(text); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_001,end'); - }) - - /** - * @tc.number IAM_UiTest_002 - * @tc.name IAM_UiTest_002 - * @tc.desc 测试实例1功能点 - */ - it(BUNDLE + 'UiTest_002', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_002,begin'); - let driver: Driver = Driver.create(); - let tabBar: Component = await driver.findComponent(ON.id('exampleTab1')); - await tabBar.click(); - await driver.delayMs(DELAY_TIME_500MS); - let button: Component = await driver.findComponent(ON.type('Button').id('button1')); - await button.click(); - await driver.delayMs(DELAY_TIME_10S); - let textComponent: Component = await driver.findComponent(ON.id('text1')); - let text = await textComponent.getText(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_002,test:' + text); - expect('Pass').assertEqual(text); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_002,end'); - }) - - /** - * @tc.number IAM_UiTest_003 - * @tc.name IAM_UiTest_003 - * @tc.desc 测试实例2功能点 - */ - it(BUNDLE + 'UiTest_003', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_003,begin'); - let driver: Driver = Driver.create(); - let button: Component = await driver.findComponent(ON.type('Button').id('button2')); - await button.click(); - await driver.delayMs(DELAY_TIME_10S); - let textComponent: Component = await driver.findComponent(ON.id('text2')); - let text = await textComponent.getText(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_003,test:' + text); - expect('Pass').assertEqual(text); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_003,end'); - }) - - /** - * @tc.number IAM_UiTest_004 - * @tc.name IAM_UiTest_004 - * @tc.desc 测试实例3功能点 - */ - it(BUNDLE + 'UiTest_004', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_003,begin'); - let driver: Driver = Driver.create(); - let tabBar: Component = await driver.findComponent(ON.id('exampleTab2')); - await tabBar.click(); - await driver.delayMs(DELAY_TIME_500MS); - let button: Component = await driver.findComponent(ON.type('Button').id('button3')); - await button.click(); - await driver.delayMs(DELAY_TIME_10S); - let textComponent: Component = await driver.findComponent(ON.id('text3')); - let text = await textComponent.getText(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_003,test:' + text); - expect('Pass').assertEqual(text); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_003,end'); - }) - /** - * @tc.number IAM_UiTest_005 - * @tc.name IAM_UiTest_005 - * @tc.desc 测试实例4功能点 - */ - it(BUNDLE + 'UiTest_005', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_003,begin'); - let driver: Driver = Driver.create(); - let button: Component = await driver.findComponent(ON.type('Button').id('button4')); - await button.click(); - await driver.delayMs(DELAY_TIME_10S); - let textComponent: Component = await driver.findComponent(ON.id('text4')); - let text = await textComponent.getText(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_003,test:' + text); - expect('Pass').assertEqual(text); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_003,end'); - }) - - /** - * @tc.number IAM_UiTest_006 - * @tc.name IAM_UiTest_006 - * @tc.desc 测试"自定义"功能点 - */ - it(BUNDLE + 'UiTest_006', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_004,begin'); - let driver: Driver = Driver.create(); - let tabBar: Component = await driver.findComponent(ON.id('exampleTab4')); - await tabBar.click(); - await driver.delayMs(DELAY_TIME_500MS); - let button: Component = await driver.findComponent(ON.type('Button')); - await button.click(); - await driver.delayMs(DELAY_TIME_10S); - let textComponent: Component = await driver.findComponent(ON.id('text6')); - let text = await textComponent.getText(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_004,test:' + text); - expect('Pass').assertEqual(text); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_004,end'); - }) - - /** - * @tc.number IAM_UiTest_007 - * @tc.name IAM_UiTest_007 - * @tc.desc 测试"取消实例"功能点 - */ - it(BUNDLE + 'UiTest_007', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_005,begin'); - let driver: Driver = Driver.create(); - let tabBar: Component = await driver.findComponent(ON.id('exampleTab3')); - await tabBar.click(); - await driver.delayMs(DELAY_TIME_500MS); - let button: Component = await driver.findComponent(ON.type('Button')); - await button.click(); - await driver.delayMs(DELAY_TIME_5S); - let textComponent: Component = await driver.findComponent(ON.id('text5')); - let text = await textComponent.getText(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_005,test:' + text); - expect('Pass').assertEqual(text); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_005,end'); - }) - - /** - * @tc.number IAM_UiTest_008 - * @tc.name IAM_UiTest_008 - * @tc.desc 测试查询凭据功能点 - */ - it(BUNDLE + 'UiTest_008', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_006,begin'); - let driver: Driver = Driver.create(); - let tabBar: Component = await driver.findComponent(ON.id('credentialQueries')); - await tabBar.click(); - await driver.delayMs(DELAY_TIME_500MS); - let button: Component = await driver.findComponent(ON.type('Button')); - await button.click(); - await driver.delayMs(DELAY_TIME_1S); - let textComponent: Component = await driver.findComponent(ON.id('text7')); - let text = await textComponent.getText(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_006,test:' + text); - expect('Pass').assertEqual(text); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_006,end'); - }) - /** - * @tc.number IAM_UiTest_009 - * @tc.name IAM_UiTest_009 - * @tc.desc 测试模拟验证按钮功能 - */ - it(BUNDLE + 'UiTest_009', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_007,begin'); - let driver: Driver = Driver.create(); - let tabBar: Component = await driver.findComponent(ON.id('simulationValidation')); - await tabBar.click(); - await driver.delayMs(DELAY_TIME_500MS); - let button1: Component = await driver.findComponent(ON.id('button1')); - await button1.click(); - await driver.delayMs(DELAY_TIME_1S); - let button2: Component = await driver.findComponent(ON.id('button2')); - await button2.click(); - await driver.delayMs(DELAY_TIME_5S); - let button3: Component = await driver.findComponent(ON.id('button3')); - await button3.click(); - await driver.delayMs(DELAY_TIME_5S); - let button4: Component = await driver.findComponent(ON.id('button4')); - await button4.click(); - await driver.delayMs(DELAY_TIME_1S); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'UiTest_007,end'); - }) - }) -} diff --git a/UserAuthentication/entry/src/ohosTest/ets/test/List.test.ets b/UserAuthentication/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 86a02e4b0ded5515d6c50a4639184852f0abed07..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 IndexTest from './Index.test'; - -export default function testsuite() { - IndexTest(); -} \ No newline at end of file diff --git a/UserAuthentication/entry/src/ohosTest/module.json5 b/UserAuthentication/entry/src/ohosTest/module.json5 deleted file mode 100644 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0000000000000000000000000000000000000000 --- a/UserAuthentication/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/UserAuthentication/hvigor/hvigor-config.json5 b/UserAuthentication/hvigor/hvigor-config.json5 deleted file mode 100644 index 8fe2d29d5ae9a871a25cc0948fcb01235c927a26..0000000000000000000000000000000000000000 --- a/UserAuthentication/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2025 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/UserAuthentication/hvigorfile.ts b/UserAuthentication/hvigorfile.ts deleted file mode 100644 index 1307c03303328d961439d1f6983b09e728b5e8ce..0000000000000000000000000000000000000000 --- a/UserAuthentication/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2025 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/UserAuthentication/oh-package.json5 b/UserAuthentication/oh-package.json5 deleted file mode 100644 index b2df9895b2dd058847cf588052f3268db9c2ecba..0000000000000000000000000000000000000000 --- a/UserAuthentication/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 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/UserAuthentication/ohosTest.md b/UserAuthentication/ohosTest.md deleted file mode 100644 index 6845d66f50a3b41a4d95eb4ac4f464964e84e00a..0000000000000000000000000000000000000000 --- a/UserAuthentication/ohosTest.md +++ /dev/null @@ -1,16 +0,0 @@ -# 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期显示 | 是否自动 | 测试结果 | -| ---------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | -------- | -| 启动应用 | 设备正常运行 | 1.开启开发板
2.在运行测试前需要修改启动页面为`testPage`,具体修改方式为:将`src/main/ets/entryability/EntryAbility.ets`中的`windowStage.loadContent('pages/Index', ...)`修改为`windowStage.loadContent('pages/testPage', ...)`
3.编译hap包并将hap包及环境烧录进开发板,运行测试用例
| 成功拉起应用。 | 是 | 验证通过 | -| 查询认证能力 | 开发板需提前设置用户认证信息,即密码认证,人脸认证或指纹认证 | | 1.按钮下方文本从Wait变为Pass | 是 | 验证通过 | -| 测试实例1 | 开发板需提前设置用户认证信息,即密码认证,人脸认证或指纹认证 | 1.输入用户认证信息 | 1.上方tab切换到“实例1、2”
2.自动点击第一个按钮后拉起用户认证页面,在十秒内输入用户认证信息后,第一个按钮下方的文本从Wait变为Pass | 否 | 验证通过 | -| 测试实例2 | 开发板需提前设置用户认证信息,即密码认证,人脸认证或指纹认证 | 1.输入用户认证信息 | 1.自动点击第二个按钮后拉起用户认证页面,在十秒内输入用户认证信息后,第一个按钮下方的文本从Wait变为Pass | 否 | 验证通过 | -| 测试实例3 | 开发板需提前设置用户认证信息,即密码认证,人脸认证或指纹认证 | 1.输入用户认证信息 | 1.上方tab切换到“实例3、4”
2.自动点击第一个按钮后拉起用户认证页面,在十秒内输入用户认证信息后,第一个按钮下方的文本从Wait变为Pass | 否 | 验证通过 | -| 测试实例4 | 开发板需提前设置用户认证信息,即密码认证,人脸认证或指纹认证 | 1.输入用户认证信息 | 1.自动点击第二个按钮后拉起用户认证页面,在十秒内输入用户认证信息后,第一个按钮下方的文本从Wait变为Pass | 否 | 验证通过 | -| 切换自定义认证 | 开发板需提前设置用户认证信息,即密码认证,人脸认证或指纹认证 | 1.在用户认证界面点击“使用应用密码”按钮 | 1.上方tab切换到“自定义”
2.自动点击按钮后拉起用户认证页面,在用户认证界面点击“使用应用密码”按钮后,按钮下方的文本从Wait变为Pass
3.如果测试设备不支持人脸认证和指纹认证,那么自动点击按钮后下方Wait变为Pass | 否 | 验证通过 | -| 认证过程中取消认证 | 开发板需提前设置用户认证信息,即密码认证,人脸认证或指纹认证 | | 1.上方tab切换到“取消实例”
2.自动点击按钮后拉起用户认证页面,3秒后用户认证页面被关闭,按钮下方的文本从Wait变为Pass | 是 | 验证通过 | -| 查询用户注册凭据的状态 | 开发板需提前设置用户认证信息,即密码认证,人脸认证或指纹认证 | | 1.上方tab切换到“查询凭据”
2.自动点击按钮后按钮下方的文本从Wait变为Pass,并在Pass下方输出凭据号 | 是 | 验证通过 | -| 模拟场景 | 开发板需提前设置用户认证信息,即密码认证,人脸认证或指纹认证 | 1.输入用户认证信息
2.在用户认证界面点击“使用应用密码”按钮 | 1.上方tab切换到“模拟验证”
2.自动点击第一个按钮后按钮下方的文本输出“支持认证能力”
3.自动点击第二个按钮后拉起用户认证界面
4.自动点击第三个按钮,拉起用户认证界面
5.自动点击第四个按钮,在第四个按钮下方输出凭据号 | 否 | 验证通过 | \ No newline at end of file diff --git a/UserAuthentication/screenshots/example1.jpeg b/UserAuthentication/screenshots/example1.jpeg deleted file mode 100644 index 27155f76abedf3fbc505523ea7580c02791c3e25..0000000000000000000000000000000000000000 Binary files a/UserAuthentication/screenshots/example1.jpeg and /dev/null differ diff --git a/UserAuthentication/screenshots/mockLogin.jpeg b/UserAuthentication/screenshots/mockLogin.jpeg deleted file mode 100644 index baf5322b0977ce641e70962272eddc7cd2e562e1..0000000000000000000000000000000000000000 Binary files a/UserAuthentication/screenshots/mockLogin.jpeg and /dev/null differ diff --git a/UserAuthentication/screenshots/query.jpeg b/UserAuthentication/screenshots/query.jpeg deleted file mode 100644 index f804373a9ad7463e9315e0eb2f9004091517844b..0000000000000000000000000000000000000000 Binary files a/UserAuthentication/screenshots/query.jpeg and /dev/null differ diff --git a/VideoProcessing/.gitignore b/VideoProcessing/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/VideoProcessing/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/VideoProcessing/AppScope/app.json5 b/VideoProcessing/AppScope/app.json5 deleted file mode 100644 index fb36b23214264e8227af9f87a6ee14c815452ba8..0000000000000000000000000000000000000000 --- a/VideoProcessing/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.example.videoprocessing", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/VideoProcessing/AppScope/resources/base/element/string.json b/VideoProcessing/AppScope/resources/base/element/string.json deleted file mode 100644 index 4cbf24913750d97eddec0459ab2cf51758f8d83f..0000000000000000000000000000000000000000 --- a/VideoProcessing/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "VideoProcessing" - } - ] -} diff --git a/VideoProcessing/AppScope/resources/base/media/app_icon.png b/VideoProcessing/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index a39445dc87828b76fed6d2ec470dd455c45319e3..0000000000000000000000000000000000000000 Binary files a/VideoProcessing/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/VideoProcessing/LICENSE b/VideoProcessing/LICENSE deleted file mode 100644 index 0210352ae2ade0dd7b4c841cb6e8ba08b4780038..0000000000000000000000000000000000000000 --- a/VideoProcessing/LICENSE +++ /dev/null @@ -1,78 +0,0 @@ - Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. - - 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. - -Apache License, Version 2.0 -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: -1.You must give any other recipients of the Work or Derivative Works a copy of this License; and -2.You must cause any modified files to carry prominent notices stating that You changed the files; and -3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and -4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - -You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/VideoProcessing/README.md b/VideoProcessing/README.md deleted file mode 100644 index 4e2dfbdc84ead48b159c31551f6f57ea85e7e08f..0000000000000000000000000000000000000000 --- a/VideoProcessing/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# 使用VideoProcessing对视频处理 - -### 介绍 - -本场景解决方案主要面向视频编辑相关开发人员,指导开发者使用VideoProcessing对视频进行缩放增强,动态元数据生成,色彩空间转换的操作。 - -### 效果预览 - - - -### 使用说明 - -1. 点击选择视频,选择需要处理的视频。 -2. 点击视频缩放,弹出视频缩放增强等级弹窗,选择对应增强等级对视频进行增强。 -3. 点击元数据生成,弹出元数据生成弹窗,选择元数据格式,生成相应元数据信息的视频。 -4. 点击色彩空间转换,弹出色彩空间转换弹窗,根据色彩空间格式,生成相应色彩空间的视频。 -5. 点击播放视频按钮,播放视频,不处理。 -6. 如果视频不支持此处理,则点击处理时,提示“该视频不支持当前操作”。 - -### 工程目录 -```` -├──entry/src/main/ets/ -│ ├──common -│ │ ├──entryability -│ │ │ └──CommonConstants.ets // 公共常量类 -│ │ └──utils -│ │ ├──DateTimeUtil.ets // 日期工具类 -│ │ ├──Logger.ets // 日志工具类 -│ │ └──WindowUtil.ets // 窗口设置工具类 -│ ├──entryability -│ │ └──EntryAbility.ets // 程序入口类 -│ ├──page -│ │ └──VideoPage.ets // 视频处理页 -│ └──view -│ └──MultiStatusButton.ets // 自定义状态按钮 -├──entry/src/main/cpp/ -│ ├──CMakeLists.txt // 构建脚本 -│ ├──capbilities -│ │ ├──AudioDecoder.cpp // 音频解码实现类 -│ │ ├──Demuxer.cpp // 解封装实现类 -│ │ ├──VideoDecoder.cpp // 视频解码实现类 -│ │ └──include -│ │ ├──AudioDecoder.h // 音频解码头文件 -│ │ ├──Demuxer.h // 解封装头文件 -│ │ └──VideoDecoder.h // 视频解码头文件 -│ ├──common -│ │ ├──SampleCallback.cpp // 回调实现类 -│ │ ├──SampleCallback.h // 回调头文件 -│ │ ├──SampleInfo.h // 数据实体类 -│ │ └──dfx -│ │ ├──error -│ │ │ └──AVCodecSampleError.h // 错误码常量类 -│ │ └──log -│ │ └──AVCodecSampleLog.h // 日志工具类 -│ ├──render -│ │ ├──PluginManager.cpp // 插件管理实现类 -│ │ ├──PluginRender.cpp // 渲染插件实现类 -│ │ └──include -│ │ ├──PluginManager.h // 插件管理头文件 -│ │ └──PluginRender.h // 渲染插件头文件 -│ ├──sample -│ │ └──player -│ │ ├──Player.cpp // 播放实现类 -│ │ ├──Player.h // 播放头文件 -│ │ ├──PlayerNative.cpp // NAPI实现类 -│ │ └──PlayerNative.h // NAPI头文件 -│ └──types -│ └──player -│ ├──index.d.ts // NAPI接口 -│ └──oh-package.json5 // 播放器so与d.ts定义 -└──entry/src/main/resources // 应用静态资源目录 -```` - -### 相关权限 - -获取媒体文件访问权限:ohos.permission.READ_MEDIA - -### 约束与限制 - -1. 本示例仅支持标准系统上运行,支持设备:华为手机。 -2. HarmonyOS系统:HarmonyOS 5.0.4 Release及以上。 -3. DevEco Studio版本:DevEco Studio 5.0.4 Release及以上。 -4. HarmonyOS SDK版本:HarmonyOS 5.0.4 Release SDK及以上。 diff --git a/VideoProcessing/build-profile.json5 b/VideoProcessing/build-profile.json5 deleted file mode 100644 index 67df524f721dd67048f7aee59684ca31a64f4f06..0000000000000000000000000000000000000000 --- a/VideoProcessing/build-profile.json5 +++ /dev/null @@ -1,41 +0,0 @@ -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "compatibleSdkVersion": "5.0.4(16)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/VideoProcessing/code-linter.json5 b/VideoProcessing/code-linter.json5 deleted file mode 100644 index 77b31b517a3e5c2f34c3ae1bf44083c0c06cbd6d..0000000000000000000000000000000000000000 --- a/VideoProcessing/code-linter.json5 +++ /dev/null @@ -1,20 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - } -} \ No newline at end of file diff --git a/VideoProcessing/entry/.gitignore b/VideoProcessing/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/VideoProcessing/entry/build-profile.json5 b/VideoProcessing/entry/build-profile.json5 deleted file mode 100644 index 089c58c2a0e2b66c5dff533cea5b1ba1089a5370..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/build-profile.json5 +++ /dev/null @@ -1,40 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - "abiFilters": ["arm64-v8a"] - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": true, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/VideoProcessing/entry/hvigorfile.ts b/VideoProcessing/entry/hvigorfile.ts deleted file mode 100644 index c6edcd90486dd5a853cf7d34c8647f08414ca7a3..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/VideoProcessing/entry/obfuscation-rules.txt b/VideoProcessing/entry/obfuscation-rules.txt deleted file mode 100644 index 69c4d6a8a5531548e4886fa766090c5c157a87d9..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/obfuscation-rules.txt +++ /dev/null @@ -1,18 +0,0 @@ -# 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 \ No newline at end of file diff --git a/VideoProcessing/entry/oh-package.json5 b/VideoProcessing/entry/oh-package.json5 deleted file mode 100644 index 7b6cdeafd921921ce1fe50aa76936e9d762e2d99..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/oh-package.json5 +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "specifiers": { - "libplayer.so@src/main/cpp/types/libplayer": "libplayer.so@src/main/cpp/types/player" - }, - "packages": { - "libplayer.so@src/main/cpp/types/libplayer": { - "name": "libplayer.so", - "version": "1.0.0", - "resolved": "src/main/cpp/types/player", - "registryType": "local" - } - }, - "dependencies": { - "libplayer.so": "file:./src/main/cpp/types/player" - } -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/cpp/CMakeLists.txt b/VideoProcessing/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 86a3984c71824ff6cbcc9afbb63aa118231c290d..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -# -# 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. -# - -cmake_minimum_required(VERSION 3.4.1) -project(VideoProcessing) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -set(CMAKE_CXX_STANDARD 17) -add_definitions(-DOHOS_PLATFORM) - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/capbilities/include - ${NATIVERENDER_ROOT_PATH}/common - ${NATIVERENDER_ROOT_PATH}/common/dfx/err - ${NATIVERENDER_ROOT_PATH}/common/dfx/log - ${NATIVERENDER_ROOT_PATH}/render/include - ${NATIVERENDER_ROOT_PATH}/sample/player - ${NATIVERENDER_ROOT_PATH}/ -) - -set(VIDEO_BASE_LIBRARY - libpixelmap_ndk.z.so - libace_napi.z.so - libEGL.so - libGLESv3.so - libace_ndk.z.so - libuv.so - libhilog_ndk.z.so - libvideo_processing.so - libnative_media_codecbase.so - libnative_media_core.so - libnative_media_vdec.so - libnative_window.so - libnative_media_venc.so - libnative_media_acodec.so - libnative_media_avdemuxer.so - libnative_media_avsource.so - libnative_media_avmuxer.so - libnative_buffer.so - libnative_vsync.so - libnative_image.so - libohaudio.so - libpixelmap.so -) - -add_library(player SHARED sample/player/PlayerNative.cpp - sample/player/Player.cpp - capbilities/Demuxer.cpp - capbilities/VideoDecoder.cpp - capbilities/AudioDecoder.cpp - render/PluginRender.cpp - render/PluginManager.cpp - common/SampleCallback.cpp -) - - -target_link_libraries(player PUBLIC ${VIDEO_BASE_LIBRARY}) \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/cpp/capbilities/AudioDecoder.cpp b/VideoProcessing/entry/src/main/cpp/capbilities/AudioDecoder.cpp deleted file mode 100644 index 7ea770b472444ccf03ae8e76fa66ad2f002fb94f..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/capbilities/AudioDecoder.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* -* 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. -*/ - -#include "AudioDecoder.h" -#include "dfx/error/AVCodecSampleError.h" -#include "AVCodecSampleLog.h" -#undef LOG_TAG -#define LOG_TAG "AudioDecoder" - -AudioDecoder::~AudioDecoder() { Release(); } - -int32_t AudioDecoder::Create(const std::string &codecMime) { - decoder_ = OH_AudioCodec_CreateByMime(codecMime.c_str(), false); - CHECK_AND_RETURN_RET_LOG(decoder_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Create AudioDecoder failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t AudioDecoder::Config(const SampleInfo &sampleInfo, CodecUserData *codecUserData) { - int32_t ret = Configure(sampleInfo); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Configure failed"); - ret = SetCallback(codecUserData); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "SetCallback failed"); - { - ret = OH_AudioCodec_Prepare(decoder_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "AudioCodec_Prepare failed"); - } - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t AudioDecoder::Start() { - int ret = OH_AudioCodec_Start(decoder_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "AudioCodec_Start failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t AudioDecoder::PushInputBuffer(CodecBufferInfo &info) { - int32_t ret = OH_AVBuffer_GetBufferAttr(reinterpret_cast(info.buffer), &info.attr); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "GetBufferAttr failed"); - ret = OH_AudioCodec_PushInputBuffer(decoder_, info.bufferIndex); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "PushInputBuffer failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t AudioDecoder::FreeOutputBuffer(uint32_t bufferIndex, bool render) { - int32_t ret = OH_AudioCodec_FreeOutputBuffer(decoder_, bufferIndex); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "FreeOutputBuffer failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t AudioDecoder::Release() { - if (decoder_ != nullptr) { - OH_AudioCodec_Flush(decoder_); - OH_AudioCodec_Stop(decoder_); - OH_AudioCodec_Destroy(decoder_); - decoder_ = nullptr; - } - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t AudioDecoder::SetCallback(CodecUserData *codecUserData) { - int32_t ret = OH_AudioCodec_RegisterCallback(decoder_, - {SampleCallback::OnCodecError, SampleCallback::OnCodecFormatChange, - SampleCallback::OnNeedInputBuffer, SampleCallback::OnNewOutputBuffer}, - codecUserData); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Create SetCallback failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t AudioDecoder::Configure(const SampleInfo &sampleInfo) { - OH_AVFormat *format = OH_AVFormat_Create(); - CHECK_AND_RETURN_RET_LOG(format != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Create AVFormat failed"); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_AUDIO_SAMPLE_FORMAT, SAMPLE_S16LE); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_AUD_CHANNEL_COUNT, sampleInfo.audioChannelCount); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_AUD_SAMPLE_RATE, sampleInfo.audioSampleRate); - OH_AVFormat_SetLongValue(format, OH_MD_KEY_CHANNEL_LAYOUT, sampleInfo.audioChannelLayout); - int ret = OH_AudioCodec_Configure(decoder_, format); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "AudioCodec Configure failed"); - OH_AVFormat_Destroy(format); - format = nullptr; - return AVCODEC_SAMPLE_ERR_OK; -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/cpp/capbilities/Demuxer.cpp b/VideoProcessing/entry/src/main/cpp/capbilities/Demuxer.cpp deleted file mode 100644 index 665792938043a73c91d68e7771fff19c44265e29..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/capbilities/Demuxer.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* -* 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. -*/ - -#include "Demuxer.h" -#include "dfx/error/AVCodecSampleError.h" -#include "AVCodecSampleLog.h" -#include - -#undef LOG_TAG -#define LOG_TAG "Demuxer" - -Demuxer::~Demuxer() { Release(); } - -int32_t Demuxer::Create(SampleInfo &info) { - source_ = OH_AVSource_CreateWithFD(info.inputFd, info.inputFileOffset, info.inputFileSize); - CHECK_AND_RETURN_RET_LOG(source_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Create AVSource failed"); - demuxer_ = OH_AVDemuxer_CreateWithSource(source_); - CHECK_AND_RETURN_RET_LOG(demuxer_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Create AVDemuxer failed"); - auto sourceFormat = std::shared_ptr(OH_AVSource_GetSourceFormat(source_), OH_AVFormat_Destroy); - CHECK_AND_RETURN_RET_LOG(sourceFormat != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "GetSourceFormat failed"); - int32_t ret = GetTrackInfo(sourceFormat, info); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "GetTrackInfo failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Demuxer::ReadSample(int32_t trackId, OH_AVBuffer *buffer, OH_AVCodecBufferAttr &attr) { - int32_t ret = OH_AVDemuxer_ReadSampleBuffer(demuxer_, trackId, buffer); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "ReadSampleBuffer failed"); - ret = OH_AVBuffer_GetBufferAttr(buffer, &attr); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "GetBufferAttr failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Demuxer::Release() { - if (demuxer_ != nullptr) { - OH_AVDemuxer_Destroy(demuxer_); - demuxer_ = nullptr; - } - if (source_ != nullptr) { - OH_AVSource_Destroy(source_); - source_ = nullptr; - } - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Demuxer::GetVideoTrackId() { - return videoTrackId_; -} - -int32_t Demuxer::GetAudioTrackId() { - return audioTrackId_; -} - -int32_t Demuxer::GetTrackInfo(std::shared_ptr sourceFormat, SampleInfo &info) { - int32_t trackCount = 0; - OH_AVFormat_GetIntValue(sourceFormat.get(), OH_MD_KEY_TRACK_COUNT, &trackCount); - for(int32_t index = 0; index < trackCount; index++) { - int trackType = -1; - auto trackFormat = std::shared_ptr(OH_AVSource_GetTrackFormat(source_, index), OH_AVFormat_Destroy); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_TRACK_TYPE, &trackType); - if (trackType == MEDIA_TYPE_VID) { - OH_AVDemuxer_SelectTrackByID(demuxer_, index); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_WIDTH, &info.videoWidth); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_HEIGHT, &info.videoHeight); - OH_AVFormat_GetDoubleValue(trackFormat.get(), OH_MD_KEY_FRAME_RATE, &info.frameRate); - int32_t pixelFormat = 0; - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_PIXEL_FORMAT, &pixelFormat); - info.pixelFormat = ConvertPixelFormat(info.pixelFormat); - OH_AVFormat_GetLongValue(trackFormat.get(), OH_MD_KEY_BITRATE, &info.bitrate); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_ROTATION, &info.rotation); - - char *videoCodecMime; - OH_AVFormat_GetStringValue(trackFormat.get(), OH_MD_KEY_CODEC_MIME, const_cast(&videoCodecMime)); - info.videoCodecMime = videoCodecMime; - AVCODEC_SAMPLE_LOGI("Video Mime: %{public}s", videoCodecMime); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_PROFILE, &info.hevcProfile); - videoTrackId_ = index; - } else if (trackType == MEDIA_TYPE_AUD) { - OH_AVDemuxer_SelectTrackByID(demuxer_, index); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_AUDIO_SAMPLE_FORMAT, &info.audioSampleFormat); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_AUD_CHANNEL_COUNT, &info.audioChannelCount); - OH_AVFormat_GetLongValue(trackFormat.get(), OH_MD_KEY_CHANNEL_LAYOUT, &info.audioChannelLayout); - OH_AVFormat_GetIntValue(trackFormat.get(), OH_MD_KEY_AUD_CHANNEL_COUNT, &info.audioSampleRate); - char *audioCodecMime; - OH_AVFormat_GetStringValue(trackFormat.get(), OH_MD_KEY_CODEC_MIME, const_cast(&audioCodecMime)); - info.audioCodecMime = audioCodecMime; - AVCODEC_SAMPLE_LOGI("Audio Mime: %{public}s", audioCodecMime); - audioTrackId_ = index; - } - } - return AVCODEC_SAMPLE_ERR_OK; -} - -OH_AVPixelFormat Demuxer::ConvertPixelFormat(int32_t pixelFormat) { - switch (pixelFormat) { - case 1: - return AV_PIXEL_FORMAT_YUVI420; - case 2: - return AV_PIXEL_FORMAT_NV12; - case 3: - return AV_PIXEL_FORMAT_NV21; - case 4: - return AV_PIXEL_FORMAT_SURFACE_FORMAT; - case 5: - return AV_PIXEL_FORMAT_RGBA; - default: - return AV_PIXEL_FORMAT_NV12; - } -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/cpp/capbilities/VideoDecoder.cpp b/VideoProcessing/entry/src/main/cpp/capbilities/VideoDecoder.cpp deleted file mode 100644 index cf61a0865f5fda0766dc5c85163ac799fdd9ee97..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/capbilities/VideoDecoder.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* -* 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. -*/ - -#include "VideoDecoder.h" -#include "PluginManager.h" -#include -#include -#include "dfx/error/AVCodecSampleError.h" -#include "AVCodecSampleLog.h" - - -#undef LOG_TAG -#define LOG_TAG "VideoDecoder" - -namespace { -constexpr int LIMIT_LOGD_FREQUENCY = 50; -constexpr int ROTATION_ANGLE = 90; -} - -VideoDecoder::~VideoDecoder() { Release(); } - -int32_t VideoDecoder::Create(const std::string &videoCodecMime) { - decoder_ = OH_VideoDecoder_CreateByMime(videoCodecMime.c_str()); - CHECK_AND_RETURN_RET_LOG(decoder_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Create VideoDecoder failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t VideoDecoder::Config(SampleInfo &sampleInfo, CodecUserData *codecUserData) { - int32_t ret = Configure(sampleInfo); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Configure failed"); - if (sampleInfo.videoIndex == 0) { - ret = OH_VideoDecoder_SetSurface(decoder_, NativeXComponentSample::PluginManager::GetInstance()->renderWindow); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK && NativeXComponentSample::PluginManager::GetInstance()->renderWindow, - AVCODEC_SAMPLE_ERR_ERROR, "VideoDecoder SetSurface failed"); - } else if (sampleInfo.videoIndex == 1) { - if (sampleInfo.processType) { - NativeXComponentSample::PluginManager::GetInstance()->PrepareSurface(sampleInfo); - if (NativeXComponentSample::PluginManager::GetInstance()->pluginWindow_ != nullptr) { - ret = OH_VideoDecoder_SetSurface(decoder_, NativeXComponentSample::PluginManager::GetInstance()->pluginWindow_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK && NativeXComponentSample::PluginManager::GetInstance()->pluginWindow_, - AVCODEC_SAMPLE_ERR_ERROR, "VideoDecoder SetSurface failed"); - } - } else { - ret = OH_VideoDecoder_SetSurface(decoder_, NativeXComponentSample::PluginManager::GetInstance()->windowOut); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK && NativeXComponentSample::PluginManager::GetInstance()->windowOut, - AVCODEC_SAMPLE_ERR_ERROR, "VideoDecoder SetSurface failed"); - } - } - ret = SetCallback(codecUserData); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "VideoDecoder SetCallback failed"); - { - ret = OH_VideoDecoder_Prepare(decoder_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "VideoDecoder Prepare failed"); - } - if (sampleInfo.videoIndex == 1 && sampleInfo.processType) { - NativeXComponentSample::PluginManager::GetInstance()->InitProcessing(sampleInfo); - int32_t rotation = sampleInfo.rotation == 0 ? 0 : (360 - sampleInfo.rotation) / 90; - AVCODEC_SAMPLE_LOGI("Set Surface Rotation: %{public}d", rotation); - OH_NativeWindow_NativeWindowHandleOpt(NativeXComponentSample::PluginManager::GetInstance()->windowOut, SET_TRANSFORM, rotation); - OH_NativeWindow_NativeWindowHandleOpt(NativeXComponentSample::PluginManager::GetInstance()->pluginWindow_, SET_USAGE, NATIVEBUFFER_USAGE_CPU_READ); - } - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t VideoDecoder::PushInputBuffer(CodecBufferInfo &info) { - int32_t ret = OH_VideoDecoder_PushInputBuffer(decoder_, info.bufferIndex); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "VideoDecoder PushInputBuffer failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t VideoDecoder::FreeOutputBuffer(uint32_t bufferIndex, bool render) { - int32_t ret = AV_ERR_OK; - if (render) { - ret = OH_VideoDecoder_RenderOutputBuffer(decoder_, bufferIndex); - } else { - ret = OH_VideoDecoder_FreeOutputBuffer(decoder_, bufferIndex); - } - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "VideoDecoder FreeOutputBuffer failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t VideoDecoder::Start() { - CHECK_AND_RETURN_RET_LOG(decoder_ != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "decoder_ is null"); - int32_t ret = OH_VideoDecoder_Start(decoder_); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "VideoDecoder Start failed, ret: %{public}d", ret); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t VideoDecoder::Release() { - if (decoder_ != nullptr) { - OH_VideoDecoder_Flush(decoder_); - OH_VideoDecoder_Stop(decoder_); - OH_VideoDecoder_Destroy(decoder_); - decoder_ = nullptr; - } - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t VideoDecoder::SetCallback(CodecUserData *codecUserData){ - int32_t ret = OH_VideoDecoder_RegisterCallback(decoder_, - {SampleCallback::OnCodecError, SampleCallback::OnCodecFormatChange, - SampleCallback::OnNeedInputBuffer, SampleCallback::OnNewOutputBuffer}, - codecUserData); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "Create SetCallback failed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t VideoDecoder::Configure(const SampleInfo &sampleInfo) { - OH_AVFormat *format = OH_AVFormat_Create(); - CHECK_AND_RETURN_RET_LOG(format != nullptr, AVCODEC_SAMPLE_ERR_ERROR, "Create AVFormat failed"); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_WIDTH, sampleInfo.videoWidth); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_HEIGHT, sampleInfo.videoHeight); - OH_AVFormat_SetDoubleValue(format, OH_MD_KEY_FRAME_RATE, sampleInfo.frameRate); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_PIXEL_FORMAT, sampleInfo.pixelFormat); - OH_AVFormat_SetIntValue(format, OH_MD_KEY_ROTATION, sampleInfo.rotation); - int ret = OH_VideoDecoder_Configure(decoder_, format); - CHECK_AND_RETURN_RET_LOG(ret == AV_ERR_OK, AVCODEC_SAMPLE_ERR_ERROR, "VideoDecoder Configure failed"); - OH_AVFormat_Destroy(format); - format = nullptr; - return AVCODEC_SAMPLE_ERR_OK; -} diff --git a/VideoProcessing/entry/src/main/cpp/capbilities/include/AudioDecoder.h b/VideoProcessing/entry/src/main/cpp/capbilities/include/AudioDecoder.h deleted file mode 100644 index 1e9da11966adfe0f1fa140c2fc349ae9be6821b2..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/capbilities/include/AudioDecoder.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_AUDIODECODER_H -#define VIDEOPROCESSING_AUDIODECODER_H - -#include "multimedia/player_framework/native_avcodec_audiocodec.h" -#include "SampleCallback.h" - -class AudioDecoder { -public: - AudioDecoder() = default; - ~AudioDecoder(); - - int32_t Create(const std::string &codecMime); - int32_t Config(const SampleInfo &sampleInfo, CodecUserData *codecUserData); - int32_t Start(); - int32_t PushInputBuffer(CodecBufferInfo &info); - int32_t FreeOutputBuffer(uint32_t bufferIndex, bool render); - int32_t Release(); - -private: - int32_t SetCallback(CodecUserData *codecUserData); - int32_t Configure(const SampleInfo &sampleInfo); - bool isAVBufferMode_ = false; - OH_AVCodec *decoder_; -}; - - -#endif //VIDEOPROCESSING_AUDIODECODER_H diff --git a/VideoProcessing/entry/src/main/cpp/capbilities/include/Demuxer.h b/VideoProcessing/entry/src/main/cpp/capbilities/include/Demuxer.h deleted file mode 100644 index 3cfe58f8741948c4a8f3e2f9d3df69d0d73793aa..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/capbilities/include/Demuxer.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_DEMUXER_H -#define VIDEOPROCESSING_DEMUXER_H - -#include "multimedia/player_framework/native_avdemuxer.h" -#include "SampleInfo.h" - -class Demuxer { -public: - Demuxer() = default; - ~Demuxer(); - int32_t Create(SampleInfo &sampleInfo); - int32_t ReadSample(int32_t trackId, OH_AVBuffer *buffer, OH_AVCodecBufferAttr &attr); - int32_t Release(); - int32_t GetVideoTrackId(); - int32_t GetAudioTrackId(); - -private: - int32_t GetTrackInfo(std::shared_ptr sourceFormat, SampleInfo &info); - OH_AVPixelFormat ConvertPixelFormat(int32_t pixelFormat); - OH_AVSource *source_; - OH_AVDemuxer *demuxer_; - int32_t videoTrackId_; - int32_t audioTrackId_; -}; - -#endif //VIDEOPROCESSING_DEMUXER_H diff --git a/VideoProcessing/entry/src/main/cpp/capbilities/include/VideoDecoder.h b/VideoProcessing/entry/src/main/cpp/capbilities/include/VideoDecoder.h deleted file mode 100644 index 10533941d6fce0664b2aa129a39a3f06883470e3..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/capbilities/include/VideoDecoder.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_VIDEODECODER_H -#define VIDEOPROCESSING_VIDEODECODER_H - -#include "multimedia/player_framework/native_avcodec_videodecoder.h" -#include "SampleInfo.h" -#include "SampleCallback.h" - -class VideoDecoder { -public: - VideoDecoder() = default; - ~VideoDecoder(); - - int32_t Create(const std::string &videoCodecMime); - int32_t Config(SampleInfo &sampleInfo, CodecUserData *codecUserData); - int32_t PushInputBuffer(CodecBufferInfo &info); - int32_t FreeOutputBuffer(uint32_t bufferIndex, bool render); - int32_t Start(); - int32_t Release(); - -private: - int32_t SetCallback(CodecUserData *codecUserData); - int32_t Configure(const SampleInfo &sampleInfo); - bool isAVBufferMode_ = false; - OH_AVCodec *decoder_; -}; - -#endif //VIDEOPROCESSING_VIDEODECODER_H diff --git a/VideoProcessing/entry/src/main/cpp/common/SampleCallback.cpp b/VideoProcessing/entry/src/main/cpp/common/SampleCallback.cpp deleted file mode 100644 index d1a39e213763f541442984f8dfc0e6040a5cf7e4..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/common/SampleCallback.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* -* 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. -*/ - -#include "SampleCallback.h" -#include "AVCodecSampleLog.h" - -namespace { -constexpr int LIMIT_LOGD_FREQUENCY = 50; -} - - -int32_t SampleCallback::OnRenderWriteData(OH_AudioRenderer *render, void *userData, void *buffer, int32_t length) { - (void)render; - (void)length; - CodecUserData *codecUserData = static_cast(userData); - uint8_t *dest = (uint8_t *) buffer; - size_t index = 0; - std::unique_lock lock(codecUserData->outputMutex); - while (!codecUserData->renderQueue.empty() && index < length) { - dest[index++] = codecUserData->renderQueue.front(); - codecUserData->renderQueue.pop(); - } - AVCODEC_SAMPLE_LOGD("render BufferLength:%{public}d Out buffer count: %{public}u, renderQueue size: %{public}u " - "renderReadSize: %{public}u", length, - codecUserData->outputFrameCount, - (unsigned int)codecUserData->renderQueue.size(), - (unsigned int)index); - if (codecUserData->renderQueue.size() < length) { - codecUserData->renderCond.notify_all(); - } - return 0; -} - -int32_t SampleCallback::OnRenderStreamEvent(OH_AudioRenderer *render, void *userData, OH_AudioStream_Event event) { - (void)render; - (void)userData; - (void)event; - return 0; -} - -int32_t SampleCallback::OnRenderInterruptEvent(OH_AudioRenderer *render, void *userData, OH_AudioInterrupt_ForceType type, - OH_AudioInterrupt_Hint hint) { - (void)render; - (void)userData; - (void)type; - (void)hint; - return 0; -} - -int32_t SampleCallback::onRenderError(OH_AudioRenderer *render, void *userData, OH_AudioStream_Result error) { - (void)render; - (void)userData; - (void)error; - AVCODEC_SAMPLE_LOGE("OnRenderError"); - return 0; -} - -void SampleCallback::OnCodecError(OH_AVCodec *codec, int32_t errorCode, void *userData) { - (void)codec; - (void)errorCode; - (void)userData; - AVCODEC_SAMPLE_LOGI("On Codec Error, error code: %{public}d", errorCode); -} - -void SampleCallback::OnCodecFormatChange(OH_AVCodec *codec, OH_AVFormat *format, void *userData) { - AVCODEC_SAMPLE_LOGI("On Stream Change"); -} - -void SampleCallback::OnNeedInputBuffer(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData) { - AVCODEC_SAMPLE_LOGI("OnNeedInputBuffer: %{public}d", index); - if (userData == nullptr) { - return; - } - (void)codec; - CodecUserData *codecUserData = static_cast(userData); - std::unique_lock lock(codecUserData->inputMutex); - codecUserData->inputBufferInfoQueue.emplace(index, buffer); - codecUserData->inputCond.notify_all(); -} - -void SampleCallback::OnNewOutputBuffer(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData) { - AVCODEC_SAMPLE_LOGI("OnNewOutputBuffer: %{public}d", index); - if (userData == nullptr) { - return; - } - (void)codec; - CodecUserData *codecUserData = static_cast(userData); - std::unique_lock lock(codecUserData->outputMutex); - codecUserData->outputBufferInfoQueue.emplace(index, buffer); - codecUserData->outputCond.notify_all(); -} - diff --git a/VideoProcessing/entry/src/main/cpp/common/SampleCallback.h b/VideoProcessing/entry/src/main/cpp/common/SampleCallback.h deleted file mode 100644 index c3aef5359d0a0335374fd09d56629351a608684f..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/common/SampleCallback.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_SAMPLECALLBACK_H -#define VIDEOPROCESSING_SAMPLECALLBACK_H - -#include -#include -#include "SampleInfo.h" - -class SampleCallback { -public: - static int32_t OnRenderWriteData(OH_AudioRenderer *render, void *userData, void *buffer, int32_t length); - static int32_t OnRenderStreamEvent(OH_AudioRenderer *render, void *userData, OH_AudioStream_Event event); - static int32_t OnRenderInterruptEvent(OH_AudioRenderer *render, void *userData, OH_AudioInterrupt_ForceType type, - OH_AudioInterrupt_Hint hint); - static int32_t onRenderError(OH_AudioRenderer *render, void *userData, OH_AudioStream_Result error); - - static void OnCodecError(OH_AVCodec *codec, int32_t errorCode, void *userData); - static void OnCodecFormatChange(OH_AVCodec *codec, OH_AVFormat *format, void *userData); - static void OnNeedInputBuffer(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData); - static void OnNewOutputBuffer(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData); -}; - -#endif //VIDEOPROCESSING_SAMPLECALLBACK_H diff --git a/VideoProcessing/entry/src/main/cpp/common/SampleInfo.h b/VideoProcessing/entry/src/main/cpp/common/SampleInfo.h deleted file mode 100644 index a68fc02050e22ac0d0bdad1229424238feb1209e..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/common/SampleInfo.h +++ /dev/null @@ -1,123 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_SAMPLEINFO_H -#define VIDEOPROCESSING_SAMPLEINFO_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "napi/native_api.h" - -const std::string_view MIME_VIDEO_AVC = "video/avc"; -const std::string_view MIME_VIDEO_HEVC = "video/hevc"; -const std::string_view MIME_AUDIO_MPEG = "audio/mpeg"; - -constexpr int32_t BITRATE_10M = 10 * 1024 * 1024; //10Mbps -constexpr int32_t BITRATE_20M = 20 * 1024 * 1024; //20Mbps -constexpr int32_t BITRATE_30M = 30 * 1024 * 1024; //30Mbps - -struct CallbackContext { - napi_env env = nullptr; - napi_ref callbackRef = nullptr; - int8_t code = 0; -}; - -struct SampleInfo { - int32_t inputFd = -1; - int32_t outputFd = -1; - int64_t inputFileOffset = 0; - int64_t inputFileSize = 0; - std::string inputFilePath; - - std::string videoCodecMime = ""; - std::string audioCodecMime = ""; - int32_t videoWidth = 0; - int32_t videoHeight = 0; - double frameRate = 0.0; - int64_t bitrate = 10 * 1024 * 1024; // 10Mbps - int64_t frameInterval = 0; - OH_AVPixelFormat pixelFormat = AV_PIXEL_FORMAT_NV12; - uint32_t bitrateMode = CBR; - int32_t iFrameInterval = 100; - int32_t rangFlag = 1; - - int32_t audioSampleFormat = 0; - int32_t audioSampleRate = 0; - int32_t audioChannelCount = 0; - int64_t audioChannelLayout = 0; - - int32_t videoIndex = 0; - int8_t processType = 0; //0none,1scale,2meta,3color - - int32_t isHDRVivid = 0; - int32_t hevcProfile = HEVC_PROFILE_MAIN; - OH_ColorPrimary primary = COLOR_PRIMARY_BT2020; - OH_TransferCharacteristic transfer = TRANSFER_CHARACTERISTIC_PQ; - OH_MatrixCoefficient matrix = MATRIX_COEFFICIENT_BT2020_CL; - - int32_t rotation = 0; - OHNativeWindow *window = nullptr; - int8_t zoomLevel; - int8_t metaData = OH_VIDEO_NONE; - OH_NativeBuffer_ColorSpace colorSpace = OH_COLORSPACE_BT709_LIMIT; - OH_NativeBuffer_Format format = NATIVEBUFFER_PIXEL_FMT_YCBCR_P010; - - int8_t vpErrorCode = 0; - void (*playDoneCallback)(void *context) = nullptr; - void *playDoneCallbackData = nullptr; -}; - -struct CodecBufferInfo { - uint32_t bufferIndex = 0; - uintptr_t *buffer = nullptr; - uint8_t *bufferAddr = nullptr; - OH_AVCodecBufferAttr attr = {0, 0, 0, AVCODEC_BUFFER_FLAGS_NONE}; - - explicit CodecBufferInfo(uint8_t *addr): bufferAddr(addr){}; - CodecBufferInfo(uint8_t *addr, int32_t bufferSize) - : bufferAddr(addr), attr({0, bufferSize, 0, AVCODEC_BUFFER_FLAGS_NONE}){}; - CodecBufferInfo(int32_t argBufferIndex, OH_AVBuffer *argBuffer) - : bufferIndex(argBufferIndex), buffer(reinterpret_cast(argBuffer)) - { - OH_AVBuffer_GetBufferAttr(argBuffer, &attr); - }; -}; - -struct CodecUserData { -public: - SampleInfo *sampleInfo = nullptr; - uint32_t inputFrameCount = 0; - std::mutex inputMutex; - std::condition_variable inputCond; - std::queue inputBufferInfoQueue; - - uint32_t outputFrameCount = 0; - std::mutex outputMutex; - std::condition_variable outputCond; - std::mutex renderMutex; - std::condition_variable renderCond; - std::queue outputBufferInfoQueue; - - std::queue renderQueue; -}; - -#endif //VIDEOPROCESSING_SAMPLEINFO_H diff --git a/VideoProcessing/entry/src/main/cpp/common/dfx/error/AVCodecSampleError.h b/VideoProcessing/entry/src/main/cpp/common/dfx/error/AVCodecSampleError.h deleted file mode 100644 index c6b7abea47c0ca976745ad32a8b3dd1d5ddc5116..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/common/dfx/error/AVCodecSampleError.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_AVCODECSAMPLEERROR_H -#define VIDEOPROCESSING_AVCODECSAMPLEERROR_H - -enum AVCodecSampleError: int { - AVCODEC_SAMPLE_ERR_OK = 0, - AVCODEC_SAMPLE_ERR_ERROR = -1 -}; - -#endif //VIDEOPROCESSING_AVCODECSAMPLEERROR_H diff --git a/VideoProcessing/entry/src/main/cpp/common/dfx/log/AVCodecSampleLog.h b/VideoProcessing/entry/src/main/cpp/common/dfx/log/AVCodecSampleLog.h deleted file mode 100644 index c07cd5dc39d2928a8b43b96b325a3399fb64edfb..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/common/dfx/log/AVCodecSampleLog.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_AVCODECSAMPLELOG_H -#define VIDEOPROCESSING_AVCODECSAMPLELOG_H - -#include - -#undef LOG_DOMAIN -#define LOG_DOMAIN 0x0002B66 - -#define AVCODEC_SAMPLE_LOG_FREQ_LIMIT(frequency) \ - if (1) { \ - thread_local uint64_t currentTimes = 0; \ - if (currentTimes++ % ((uint64_t)(frequency)) != 0) { \ - break; \ - } \ - } - -#define AVCODEC_SAMPLE_LOG(func, fmt, args...) \ - do { \ - (void)func(LOG_APP, "{%{public}s():%{public}d}" fmt, __FUNCTION__, __LINE__, ##args); \ - } while (0) - -#define AVCODEC_SAMPLE_LOGF(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_FATAL, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGE(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_ERROR, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGW(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_WARN, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGI(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_INFO, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGD(fmt, ...) AVCODEC_SAMPLE_LOG(OH_LOG_DEBUG, fmt, ##__VA_ARGS__) -#define AVCODEC_SAMPLE_LOGD_LIMIT(frequency, fmt, ...) \ - do { \ - AVCODEC_SAMPLE_LOG_FREQ_LIMIT(frequency); \ - AVCODEC_SAMPLE_LOGD(fmt, ##__VA_ARGS__); \ - } while (0) - -#define CHECK_AND_RETURN_RET_LOG(cond, ret, fmt, ...) \ - do { \ - if (!(cond)) { \ - AVCODEC_SAMPLE_LOGE(fmt, ##__VA_ARGS__); \ - return ret; \ - } \ - } while (0) - -#define CHECK_AND_RETURN_LOG(cond, fmt, ...) \ - do { \ - if (!(cond)) { \ - AVCODEC_SAMPLE_LOGE(fmt, ##__VA_ARGS__); \ - return; \ - } \ - } while (0) - -#define CHECK_AND_BREAK_LOG(cond, fmt, ...) \ - if (1) { \ - if (!(cond)) { \ - AVCODEC_SAMPLE_LOGW(fmt, ##__VA_ARGS__); \ - break; \ - } \ - } else \ - void(0) - - -#define CHECK_AND_CONTINUE_LOG(cond, fmt, ...) \ - if (1) { \ - if (!(cond)) { \ - AVCODEC_SAMPLE_LOGW(fmt, ##__VA_ARGS__); \ - continue; \ - } \ - } else \ - void(0) - -#endif //VIDEOPROCESSING_AVCODECSAMPLELOG_H diff --git a/VideoProcessing/entry/src/main/cpp/render/PluginManager.cpp b/VideoProcessing/entry/src/main/cpp/render/PluginManager.cpp deleted file mode 100644 index f31c49bb5c4094e8507f64a1c43889d094bf1e9c..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/render/PluginManager.cpp +++ /dev/null @@ -1,367 +0,0 @@ -/* -* 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. -*/ - -#include "PluginManager.h" -#include "SampleInfo.h" -#include "multimedia/video_processing_engine/video_processing.h" -#include "multimedia/video_processing_engine/video_processing_types.h" -#include "AVCodecSampleLog.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#undef LOG_TAG -#define LOG_TAG "PluginManager" - -namespace NativeXComponentSample { -constexpr uint32_t LOG_PRINT_DOMAIN = 0xFF00; -PluginManager PluginManager::pluginManager_; -std::condition_variable g_SyncCond; -std::mutex g_SyncLock; -uint32_t g_FrameCount = 0; -uint32_t g_Index = -1; - -void OnError(OH_VideoProcessing *videoProcessor, VideoProcessing_ErrorCode error, void *userData) { - (void)videoProcessor; - (void)error; - (void)userData; - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "OnError: %{public}d", error); - if ((error == VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING) && (PluginManager::GetInstance()->sampleInfo_->vpErrorCode == 0)) { - PluginManager::GetInstance()->ResetVP(5, 1); - } -} - -void OnState(OH_VideoProcessing *videoProcessor, VideoProcessing_State state, void *userData) { - (void)videoProcessor; - (void)state; - (void)userData; -} - -void OnNewOutputBuffer(OH_VideoProcessing *videoProcessor, uint32_t index, void *userData) { - if(g_Index != index) { - g_Index = index; - g_FrameCount++; - } - OH_VideoProcessing_RenderOutputBuffer(videoProcessor, index); - (void) userData; -} - -PluginManager::~PluginManager() { - for(auto iter = nativeXComponentMap_.begin(); iter != nativeXComponentMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - nativeXComponentMap_.clear(); - - for(auto iter = pluginRenderMap_.begin(); iter != pluginRenderMap_.end(); ++iter) { - if (iter->second != nullptr) { - delete iter->second; - iter->second = nullptr; - } - } - pluginRenderMap_.clear(); -} - -void PluginManager::SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent) { - if (nativeXComponent == nullptr) { - return; - } - if (nativeXComponentMap_.find(id) == nativeXComponentMap_.end()) { - nativeXComponentMap_[id] = nativeXComponent; - return; - } - if (nativeXComponentMap_[id] != nativeXComponent) { - OH_NativeXComponent *tmp = nativeXComponentMap_[id]; - tmp = nullptr; - nativeXComponentMap_[id] = nativeXComponent; - } -} - -PluginRender* PluginManager::GetRender(std::string &id) { - if (pluginRenderMap_.find(id) == pluginRenderMap_.end()) { - PluginRender *instance = PluginRender::GetInstance(id); - pluginRenderMap_[id] = instance; - return instance; - } - return pluginRenderMap_[id]; -} - -void PluginManager::Export(napi_env env, napi_value exports) { - if ((env == nullptr) || (exports == nullptr)) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "Export: env or exports is null"); - return; - } - napi_value exportInstance = nullptr; - if (napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "Export: napi_get_named_property fail"); - return; - } - OH_NativeXComponent *nativeXComponent = nullptr; - if (napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "Export: napi_unwrap fail"); - return; - } - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "Export unable to get XComponent id"); - return; - } - std::string id(idStr); - auto context = PluginManager::GetInstance(); - if ((context != nullptr) && (nativeXComponent != nullptr)) { - context->SetNativeXComponent(id, nativeXComponent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "SetNativeXComponent: %{public}s", id.c_str()); - auto render = context->GetRender(id); - if (render != nullptr) { - render->RegisterCallback(nativeXComponent); - render->Export(env, exports); - } - } -} - -void PluginManager::InitProcessing(SampleInfo &sampleInfo) { - VideoProcessing_ErrorCode ret = VIDEO_PROCESSING_ERROR_INVALID_VALUE; - int32_t processType = sampleInfo.processType; - if (processType == 1) { - int8_t level = sampleInfo.zoomLevel; - OH_AVFormat *format = OH_AVFormat_Create(); - if (level == 0) { - OH_AVFormat_SetIntValue(format, VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL, VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_NONE); - } else if (level == 1) { - OH_AVFormat_SetIntValue(format, VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL, VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_LOW); - } else if (level == 2) { - OH_AVFormat_SetIntValue(format, VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL, VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM); - } else if (level == 3) { - OH_AVFormat_SetIntValue(format, VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL, VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH); - } - ret = OH_VideoProcessing_SetParameter(processor, format); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessing_SetParameter failed"); - } else { - int32_t err = 0; - if (sampleInfo.colorSpace == OH_COLORSPACE_BT709_LIMIT) { - err = OH_NativeWindow_NativeWindowHandleOpt(PluginManager::GetInstance()->windowOut, SET_FORMAT, NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SP); - int8_t metaData = OH_VIDEO_NONE; - err = OH_NativeWindow_SetMetadataValue(PluginManager::GetInstance()->windowOut, OH_HDR_METADATA_TYPE, sizeof(uint8_t), (uint8_t *)&metaData); - CHECK_AND_RETURN_LOG(err == 0, "NativeWindowHandleOpt BT709_LIMIT failed"); - } else if (sampleInfo.colorSpace == OH_COLORSPACE_BT2020_HLG_LIMIT) { - err = OH_NativeWindow_SetMetadataValue(PluginManager::GetInstance()->windowOut, OH_HDR_METADATA_TYPE, sizeof(uint8_t), (uint8_t *)&sampleInfo.metaData); - CHECK_AND_RETURN_LOG(err == 0, "SetMetadataValue BT2020_HLG_LIMIT failed"); - err = OH_NativeWindow_NativeWindowHandleOpt(PluginManager::GetInstance()->windowOut, SET_FORMAT, NATIVEBUFFER_PIXEL_FMT_RGBA_1010102); - CHECK_AND_RETURN_LOG(err == 0, "NativeWindowHandleOpt BT2020_HLG_LIMIT failed"); - } else if (sampleInfo.colorSpace == OH_COLORSPACE_BT2020_PQ_LIMIT) { - err = OH_NativeWindow_SetMetadataValue(PluginManager::GetInstance()->windowOut, OH_HDR_METADATA_TYPE, sizeof(uint8_t), (uint8_t *)&sampleInfo.metaData); - CHECK_AND_RETURN_LOG(err == 0, "SetMetadataValue BT2020_PQ_LIMIT failed"); - err = OH_NativeWindow_NativeWindowHandleOpt(PluginManager::GetInstance()->windowOut, SET_FORMAT, NATIVEBUFFER_PIXEL_FMT_RGBA_1010102); - CHECK_AND_RETURN_LOG(err == 0, "NativeWindowHandleOpt BT2020_PQ_LIMIT failed"); - } - err = OH_NativeWindow_SetColorSpace(PluginManager::GetInstance()->windowOut, sampleInfo.colorSpace); - CHECK_AND_RETURN_LOG(err == 0, "SetColorSpace failed"); - } - if (sampleInfo.window != nullptr) { - ret = OH_VideoProcessing_SetSurface(processor, sampleInfo.window); - } else { - ret = OH_VideoProcessing_SetSurface(processor, PluginManager::GetInstance()->windowOut); - } - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "SetSurface failed"); - - ret = OH_VideoProcessingCallback_Create(&callback); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessingCallback_Create failed"); - ret = OH_VideoProcessingCallback_BindOnError(callback, OnError); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessingCallback_BindOnError failed"); - ret = OH_VideoProcessingCallback_BindOnState(callback, OnState); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessingCallback_BindOnState failed"); - ret = OH_VideoProcessingCallback_BindOnNewOutputBuffer(callback, OnNewOutputBuffer); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessingCallback_BindOnNewOutputBuffer failed"); - ret = OH_VideoProcessing_RegisterCallback(processor, callback, nullptr); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessing_RegisterCallback failed"); - - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "InitProcessing succeed"); -} - -void PluginManager::PrepareSurface(SampleInfo &sampleInfo) { - VideoProcessing_ErrorCode ret = VIDEO_PROCESSING_ERROR_INVALID_VALUE; - if (!isEnvironmentInited) { - ret = OH_VideoProcessing_InitializeEnvironment(); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessing_InitializeEnvironment failed"); - isEnvironmentInited = true; - } - if (isVPRunning) { - StopProcessing(); - } - int32_t processType = sampleInfo.processType; - if (processType == 1) { - ret = OH_VideoProcessing_Create(&processor, VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER); - } else if (processType == 2) { - ret = OH_VideoProcessing_Create(&processor, VIDEO_PROCESSING_TYPE_METADATA_GENERATION); - } else if (processType == 3) { - ret = OH_VideoProcessing_Create(&processor, VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION); - } - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessing_Create failed"); - ret = OH_VideoProcessing_GetSurface(processor, &PluginManager::GetInstance()->pluginWindow_); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessing_GetSurface failed"); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "PrepareSurface succeed"); -} - -void PluginManager::StartProcessing() { - PluginManager::GetInstance()->sampleInfo_->vpErrorCode = 0; - VideoProcessing_ErrorCode ret = OH_VideoProcessing_Start(processor); - if (ret != VIDEO_PROCESSING_SUCCESS) { - ResetVP(5, 0); - } - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessing_Start failed, ret: %{public}d", ret); - isVPRunning = true; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing succeed"); -} - -void PluginManager::SetSampleInfo(SampleInfo *sampleInfo) { - sampleInfo_ = sampleInfo; -} - -void PluginManager::StopProcessing() { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing stop :%{public}d, %{public}d", g_FrameCount, PluginManager::GetInstance()->frameCount); - if (isVPRunning) { - VideoProcessing_ErrorCode ret = OH_VideoProcessing_Stop(processor); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessing_Stop failed"); - isVPRunning = false; - } - g_FrameCount = 0; - PluginManager::GetInstance()->frameCount = 0; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing Stop succeed"); - DestroyProcessing(); -} - -void PluginManager::DestroyProcessing() { - CHECK_AND_RETURN_LOG(processor != nullptr, "processor is nullptr"); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "start DestroyProcessing"); - VideoProcessing_ErrorCode ret = OH_VideoProcessing_Destroy(processor); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessing_Destroy failed"); - processor = nullptr; - CHECK_AND_RETURN_LOG(callback != nullptr, "callback is nullptr"); - ret = OH_VideoProcessingCallback_Destroy(callback); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessingCallback_Destroy failed"); - callback = nullptr; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "Destroy And Callback_Destroy succeed"); - - if (OnErrorThread_ && OnErrorThread_->joinable()) { - OnErrorThread_->detach(); - OnErrorThread_.reset(); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "Release OnError Thread succeed"); - } -} - -void PluginManager::Release() { - if (isVPRunning) { - StopProcessing(); - DestroyProcessing(); - } - if (isEnvironmentInited) { - VideoProcessing_ErrorCode ret = OH_VideoProcessing_DeinitializeEnvironment(); - CHECK_AND_RETURN_LOG(ret == VIDEO_PROCESSING_SUCCESS, "OH_VideoProcessing_DeinitializeEnvironment failed"); - isEnvironmentInited = false; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "DeinitializeEnvironment Succeed"); - } -} - -void PluginManager::ResetVP(int32_t ret, int8_t from) { - PluginManager::GetInstance()->sampleInfo_->vpErrorCode = ret; - CallbackContext *context = (CallbackContext *)PluginManager::GetInstance()->sampleInfo_->playDoneCallbackData; - context->code = ret; - PluginManager::GetInstance()->sampleInfo_->playDoneCallback(PluginManager::GetInstance()->sampleInfo_->playDoneCallbackData); - errorCode = ret; - if (from == 0) { - StopProcessing(); - } else { - OnErrorThread_ = std::make_unique(&PluginManager::VPOnErrorThread, this); - } -} - -void PluginManager::VPOnErrorThread() { - StopProcessing(); -} - -int32_t PluginManager::BlackLastFrame() { - int32_t format = 0; - int32_t ret = OH_NativeWindow_NativeWindowHandleOpt(windowOut, GET_FORMAT, &format); - if (ret != 0) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing succeed"); - } - if (format != NATIVEBUFFER_PIXEL_FMT_RGBA_8888) { - ret = OH_NativeWindow_NativeWindowHandleOpt(windowOut, SET_FORMAT, NATIVEBUFFER_PIXEL_FMT_RGBA_8888); - if (ret != 0) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing succeed"); - } - } - OHNativeWindowBuffer* buffer = nullptr; - int releaseFenceFd = -1; - ret = OH_NativeWindow_NativeWindowRequestBuffer(windowOut, &buffer, &releaseFenceFd); - if (ret != 0 || buffer == nullptr) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing succeed"); - return -1; - } - BufferHandle* bufferHandle = OH_NativeWindow_GetBufferHandleFromNative(buffer); - void* mappedAddr = mmap(bufferHandle->virAddr, bufferHandle->size, PROT_READ | PROT_WRITE, MAP_SHARED, bufferHandle->fd, 0); - if (mappedAddr == MAP_FAILED) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing succeed"); - return -1; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing succeed"); - int retCode = -1; - uint32_t timeout = 3000; - if (releaseFenceFd != -1) { - struct pollfd pollfds = {0}; - pollfds.fd = releaseFenceFd; - pollfds.events = POLL_IN; - do { - retCode = poll(&pollfds, 1, timeout); - } while (retCode == -1 && (errno == EINTR || errno == EAGAIN)); - close(releaseFenceFd); - } -// memset_s(mappedAddr, bufferHandle->stride * bufferHandle->height, 0, bufferHandle->stride * bufferHandle->height); - //使用mmap获取到的地址来访问内存 - static uint32_t value = 0x00; - value++; - uint32_t *pixel = static_cast(mappedAddr); - for(uint32_t x = 0; x < bufferHandle->width; x++) { - for(uint32_t y = 0; y < bufferHandle->height; y++) { - *pixel++ = value; - } - } - //设置刷新区域,如果Region中的Rect未nullptr,或者rectNumber为0,则认为OHNativeWindowBuffer全部由内容更改 - Region region{nullptr, 0}; - int acquireFenceFd = -1; - //通过OH_NativeWindow_NativeWindowFlushBuffer 提交给消费者使用,例如,在屏幕上显示 - ret = OH_NativeWindow_NativeWindowFlushBuffer(windowOut, buffer, acquireFenceFd, region); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing succeed"); - int result = munmap(mappedAddr, bufferHandle->size); - if (result == -1) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing succeed"); - return -1; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "StartProcessing succeed"); - return 0; -} -} diff --git a/VideoProcessing/entry/src/main/cpp/render/PluginRender.cpp b/VideoProcessing/entry/src/main/cpp/render/PluginRender.cpp deleted file mode 100644 index f4d206be158a66317450678de369c0d44c562a5f..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/render/PluginRender.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* -* 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. -*/ - -#include -#include -#include -#include -#include -#include "PluginManager.h" -#include "PluginRender.h" - -#undef LOG_TAG -#define LOG_TAG "PluginRender" - -namespace NativeXComponentSample { -namespace { - constexpr uint32_t LOG_PRINT_DOMAIN = 0xFF00; - -void OnSurfaceCreatedCB(OH_NativeXComponent *component, void *window) { - if (component == nullptr || window == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceCreatedCB component or window is null"); - return; - } - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceCreatedCB unable to get XComponent id"); - return; - } - std::string id(idStr); - uint64_t width; - uint64_t height; - int32_t xSize = OH_NativeXComponent_GetXComponentSize(component, window, &width, &height); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceCreatedCB id: %{public}s", id.c_str()); - if ((xSize == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) && (id == "srcPlayer")) { - auto context = PluginManager::GetInstance(); - context->renderWindow = (OHNativeWindow *)window; - OH_NativeWindow_NativeWindowHandleOpt(context->renderWindow, SET_BUFFER_GEOMETRY, width, height); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceCreatedCB create windowOut: w:%{public}ld h:%{public}ld", width, height); - } - if ((xSize == OH_NATIVEXCOMPONENT_RESULT_SUCCESS) && (id == "dstPlayer")) { - auto context = PluginManager::GetInstance(); - context->windowOut = (OHNativeWindow *)window; - OH_NativeWindow_NativeWindowHandleOpt(context->windowOut, SET_BUFFER_GEOMETRY, width, height); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceCreatedCB create windowOut: w:%{public}ld h:%{public}ld", width, height); - } -} - -void OnSurfaceChangedCB(OH_NativeXComponent *component, void *window) { - if (component == nullptr || window == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceChangedCB component or window is null"); - return; - } - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceChangedCB unable to get XComponent id"); - return; - } - std::string id(idStr); - auto render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnSurfaceChanged(component, window); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceChangedCB"); - } -} - -void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window) { - if (component == nullptr || window == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceDestroyedCB component or window is null"); - return; - } - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceDestroyedCB unable to get XComponent id"); - return; - } - std::string id(idStr); - PluginRender::Release(id); -} - -void DispatchTouchEventCB(OH_NativeXComponent *component, void *window) { - if (component == nullptr || window == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "DispatchTouchEventCB component or window is null"); - return; - } - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "DispatchTouchEventCB unable to get XComponent id"); - return; - } - std::string id(idStr); - PluginRender *render = PluginRender::GetInstance(id); - if (render != nullptr) { - render->OnTouchEvent(component, window); - } -} -} - -std::unordered_map PluginRender::instance_; -int32_t PluginRender::hasDraw_ = 0; -int32_t PluginRender::hasChangeColor_ = 0; - -PluginRender::PluginRender(std::string &id) { - this->id_ = id; -} - -PluginRender *PluginRender::GetInstance(std::string &id) { - if (instance_.find(id) == instance_.end()) { - PluginRender *instance = new PluginRender(id); - instance_[id] = instance; - return instance; - } else { - return instance_[id]; - } -} - -void PluginRender::Release(std::string &id) { - PluginRender *render = PluginRender::GetInstance(id); - if (render != nullptr) { - delete render; - render = nullptr; - instance_.erase(instance_.find(id)); - } -} - -void PluginRender::Export(napi_env env, napi_value exports) { - if (env == nullptr || exports == nullptr) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "Export env or exports is null"); - return; - } - napi_property_descriptor desc[] = {}; - if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "Export napi_define_properties failed"); - } -} - -void PluginRender::OnSurfaceChanged(OH_NativeXComponent *component, void *window) { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceChanged unable to get XComponent id"); - return; - } - std::string id(idStr); - PluginRender *render = PluginRender::GetInstance(id); - double offsetX; - double offsetY; - OH_NativeXComponent_GetXComponentOffset(component, window, &offsetX, &offsetY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "OnSurfaceChanged offsetX:%{public}lf, " - "offsetY:%{public}lf", offsetX, offsetY); -} - -void PluginRender::OnTouchEvent(OH_NativeXComponent *component, void *window) { - char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {'\0'}; - uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; - if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, LOG_TAG, "OnTouchEvent unable to get XComponent id"); - return; - } - OH_NativeXComponent_TouchEvent touchEvent; - OH_NativeXComponent_GetTouchEvent(component, window, &touchEvent); - float tiltX = 0.0f; - float tiltY = 0.0f; - OH_NativeXComponent_TouchPointToolType toolType = OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN; - OH_NativeXComponent_GetTouchPointToolType(component, 0, &toolType); - OH_NativeXComponent_GetTouchPointTiltX(component, 0, &tiltX); - OH_NativeXComponent_GetTouchPointTiltY(component, 0, &tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_TAG, "OnTouchEvent toolType:%{public}d, " - "tiltX:%{public}lf, tiltY:%{public}lf", toolType, tiltX, tiltY); -} - -void PluginRender::RegisterCallback(OH_NativeXComponent *nativeXComponent) { - renderCallback_.OnSurfaceCreated = OnSurfaceCreatedCB; - renderCallback_.OnSurfaceChanged = OnSurfaceChangedCB; - renderCallback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; - renderCallback_.DispatchTouchEvent = DispatchTouchEventCB; - OH_NativeXComponent_RegisterCallback(nativeXComponent, &renderCallback_); -} -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/cpp/render/include/PluginManager.h b/VideoProcessing/entry/src/main/cpp/render/include/PluginManager.h deleted file mode 100644 index d2c5e4dc72f7e56ea06817f1aa6d121f6c681005..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/render/include/PluginManager.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_PLUGINMANAGER_H -#define VIDEOPROCESSING_PLUGINMANAGER_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include "VideoDecoder.h" -#include "PluginRender.h" -#include "multimedia/video_processing_engine/video_processing.h" - -namespace NativeXComponentSample { -class PluginManager { -public: - ~PluginManager(); - - static PluginManager *GetInstance() {return &PluginManager::pluginManager_;} - - void SetNativeXComponent(std::string &id, OH_NativeXComponent *nativeXComponent); - PluginRender *GetRender(std::string &id); - void Export(napi_env env, napi_value exports); - OHNativeWindow *pluginWindow_ = nullptr; //docoder ->pluginWindow_ - OHNativeWindow *windowOut = nullptr; - OHNativeWindow *renderWindow = nullptr; - OH_VideoProcessing* processor = nullptr; - VideoProcessing_Callback* callback = nullptr; - uint32_t *processCount = nullptr; - SampleInfo *sampleInfo_ = nullptr; - bool isVPRunning = false; - int32_t frameCount = 0; - std::unique_ptr OnErrorThread_ = nullptr; - int32_t errorCode = 0; - void InitProcessing(SampleInfo &sampleInfo); - void PrepareSurface(SampleInfo &sampleInfo); - void StartProcessing(); - void StopProcessing(); - void SetSampleInfo(SampleInfo *sampleInfo); - void DestroyProcessing(); - void Release(); - void ResetVP(int32_t ret, int8_t from); - int32_t BlackLastFrame(); - -private: - static PluginManager pluginManager_; - bool isEnvironmentInited = false; - void VPOnErrorThread(); - std::unordered_map nativeXComponentMap_; - std::unordered_map pluginRenderMap_; -}; -} -#endif //VIDEOPROCESSING_PLUGINMANAGER_H diff --git a/VideoProcessing/entry/src/main/cpp/render/include/PluginRender.h b/VideoProcessing/entry/src/main/cpp/render/include/PluginRender.h deleted file mode 100644 index 3093439d4fe92e983f70753fe87cf4d7aab9d6fe..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/render/include/PluginRender.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_PLUGINRENDER_H -#define VIDEOPROCESSING_PLUGINRENDER_H - -#include -#include -#include -#include -#include - -namespace NativeXComponentSample { -class PluginRender { -public: - explicit PluginRender(std::string &id); - ~PluginRender() {}; - static PluginRender *GetInstance(std::string &id); - static void Release(std::string &id); - void Export(napi_env env, napi_value exports); - void OnSurfaceChanged(OH_NativeXComponent *component, void *window); - void OnTouchEvent(OH_NativeXComponent *component, void *window); - void RegisterCallback(OH_NativeXComponent *nativeXComponent); - static std::unordered_map instance_; - std::string id_; - static int32_t hasDraw_; - static int32_t hasChangeColor_; - -private: - OH_NativeXComponent_Callback renderCallback_; - OH_NativeXComponent_MouseEvent_Callback mouseCallback_; -}; -} - -#endif //VIDEOPROCESSING_PLUGINRENDER_H diff --git a/VideoProcessing/entry/src/main/cpp/sample/player/Player.cpp b/VideoProcessing/entry/src/main/cpp/sample/player/Player.cpp deleted file mode 100644 index 6f435717cbb6815897f8461915a55dd6852f30b3..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/sample/player/Player.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/* -* 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. -*/ - -#include "Player.h" -#include -#include -#include "AVCodecSampleLog.h" -#include "dfx/error/AVCodecSampleError.h" -#undef LOG_TAG -#define LOG_TAG "player" - -namespace { -constexpr int BALANCE_VALUE = 5; -using namespace std::chrono_literals; -} - -Player::~Player() {Player::StartRelease(); } - -int32_t Player::Init(SampleInfo &sampleInfo) { - std::lock_guard lock(mutex_); - sampleInfo_ = sampleInfo; - videoDecoder_ = std::make_unique(); - audioDecoder_ = std::make_unique(); - demuxer_ = std::make_unique(); - - int32_t ret = demuxer_->Create(sampleInfo_); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, ret, "Create Demuxer failed"); - ret = CreateAudioDecoder(); -// CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, ret, "Create AudioDecoder failed"); - ret = CreateVideoDecoder(); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, ret, "Create VideoDecoder failed"); - - isReleased_ = false; - AVCODEC_SAMPLE_LOGI("Player Init Succeed"); - return AVCODEC_SAMPLE_ERR_OK; -} - -int32_t Player::Start() { - std::lock_guard lock(mutex_); - int32_t ret = AVCODEC_SAMPLE_ERR_ERROR; - if (videoDecContext_) { - ret = videoDecoder_->Start(); - if (ret != AVCODEC_SAMPLE_ERR_OK) { - StartRelease(); - return AVCODEC_SAMPLE_ERR_ERROR; - } - isStarted_ = true; - videoDecInputThread_ = std::make_unique(&Player::VideoDecInputThread, this); - videoDecOutputThread_ = std::make_unique(&Player::VideoDecOutputThread, this); - if (videoDecInputThread_ == nullptr || videoDecOutputThread_ == nullptr) { - StartRelease(); - return AVCODEC_SAMPLE_ERR_ERROR; - } - } - - if (audioDecContext_) { - ret = audioDecoder_->Start(); - isStarted_ = true; - } - while (audioDecContext_ && !audioDecContext_->renderQueue.empty()) { - audioDecContext_->renderQueue.pop(); - } - if (audioRender_) { - OH_AudioRenderer_Start(audioRender_); - } - doneCond_.notify_all(); - AVCODEC_SAMPLE_LOGI("Player Start Succeed"); - isPlaying = true; - return AVCODEC_SAMPLE_ERR_OK; -} - -void Player::VideoDecInputThread() { - while (true) { - CHECK_AND_BREAK_LOG(isStarted_, "VideoDecInputThread in"); - std::unique_lock lock(videoDecContext_->inputMutex); - bool condRet = videoDecContext_->inputCond.wait_for( - lock, 5s, [this](){return !isStarted_ || !videoDecContext_->inputBufferInfoQueue.empty(); }); - CHECK_AND_BREAK_LOG(isStarted_, "VideoDecInputThread Work Done, thread out"); - CHECK_AND_CONTINUE_LOG(!videoDecContext_->inputBufferInfoQueue.empty(), - "VideoDecInputThread Buffer queue is empty,cond ret:%{public}d", condRet); - CodecBufferInfo bufferInfo = videoDecContext_->inputBufferInfoQueue.front(); - videoDecContext_->inputBufferInfoQueue.pop(); - videoDecContext_->inputFrameCount++; - lock.unlock(); - - demuxer_->ReadSample(demuxer_->GetVideoTrackId(), reinterpret_cast(bufferInfo.buffer), - bufferInfo.attr); - - int32_t ret = videoDecoder_->PushInputBuffer(bufferInfo); - CHECK_AND_BREAK_LOG(ret == AVCODEC_SAMPLE_ERR_OK, "VideoDecInputThread Push data failed, thread out"); - CHECK_AND_BREAK_LOG(!(bufferInfo.attr.flags & AVCODEC_BUFFER_FLAGS_EOS), "VideoDecInputThread catch EOS, thread out"); - } -} - -void Player::VideoDecOutputThread() { - sampleInfo_.frameInterval = MICROSECOND / sampleInfo_.frameRate; - while (true) { - thread_local auto lastPushTime = std::chrono::system_clock::now(); - CHECK_AND_BREAK_LOG(isStarted_, "VideoDecOutputThread in"); - std::unique_lock lock(videoDecContext_->outputMutex); - bool condRet = videoDecContext_->outputCond.wait_for( - lock, 5s, [this](){return !isStarted_ || !videoDecContext_->outputBufferInfoQueue.empty(); }); - CHECK_AND_BREAK_LOG(isStarted_, "VideoDecOutputThread Work Done, thread out"); - CHECK_AND_CONTINUE_LOG(!videoDecContext_->outputBufferInfoQueue.empty(), - "VideoDecOutputThread Buffer queue is empty, cond ret:%{public}d", condRet); - CodecBufferInfo bufferInfo = videoDecContext_->outputBufferInfoQueue.front(); - videoDecContext_->outputBufferInfoQueue.pop(); - CHECK_AND_BREAK_LOG(!(bufferInfo.attr.flags & AVCODEC_BUFFER_FLAGS_EOS), "VideoDecOutputThread catch EOS, thread out"); - videoDecContext_->outputFrameCount++; - lock.unlock(); - int32_t ret = videoDecoder_->FreeOutputBuffer(bufferInfo.bufferIndex, true); - CHECK_AND_BREAK_LOG(ret == AVCODEC_SAMPLE_ERR_OK, "VideoDecOutputThread, thread out"); - - std::this_thread::sleep_until(lastPushTime + std::chrono::microseconds(sampleInfo_.frameInterval)); - lastPushTime = std::chrono::system_clock::now(); - } - StartRelease(); -} - -void Player::AudioDecInputThread() { - while(true) { - CHECK_AND_BREAK_LOG(isStarted_, "AudioDecInputThread in"); - std::unique_lock lock(audioDecContext_->inputMutex); - bool condRet = audioDecContext_->inputCond.wait_for( - lock, 5s, [this](){return !isStarted_ || !audioDecContext_->inputBufferInfoQueue.empty(); }); - CHECK_AND_BREAK_LOG(isStarted_, "AudioDecInputThread Work Done, thread out"); - CHECK_AND_CONTINUE_LOG(!audioDecContext_->inputBufferInfoQueue.empty(), - "AudioDecInputThread Buffer queue is empty"); - CodecBufferInfo bufferInfo = audioDecContext_->inputBufferInfoQueue.front(); - audioDecContext_->inputBufferInfoQueue.pop(); - audioDecContext_->inputFrameCount++; - lock.unlock(); - demuxer_->ReadSample(demuxer_->GetVideoTrackId(), reinterpret_cast(bufferInfo.buffer), - bufferInfo.attr); - int32_t ret = audioDecoder_->PushInputBuffer(bufferInfo); - CHECK_AND_BREAK_LOG(ret == AVCODEC_SAMPLE_ERR_OK, "AudioDecInputThread Push data failed, thread out"); - CHECK_AND_BREAK_LOG(!(bufferInfo.attr.flags & AVCODEC_BUFFER_FLAGS_EOS), "AudioDecInputThread catch EOS, thread out"); - } -} - -void Player::AudioDecOutputThread() { - while (true) { - CHECK_AND_BREAK_LOG(isStarted_, "AudioDecOutputThread in"); - std::unique_lock lock(audioDecContext_->outputMutex); - bool condRet = audioDecContext_->outputCond.wait_for( - lock, 5s, [this](){return !isStarted_ || !audioDecContext_->outputBufferInfoQueue.empty(); }); - CHECK_AND_BREAK_LOG(isStarted_, "AudioDecOutputThread Work Done, thread out"); - CHECK_AND_CONTINUE_LOG(!audioDecContext_->outputBufferInfoQueue.empty(), - "AudioDecOutputThread Buffer queue is empty"); - CodecBufferInfo bufferInfo = audioDecContext_->outputBufferInfoQueue.front(); - audioDecContext_->outputBufferInfoQueue.pop(); - CHECK_AND_BREAK_LOG(!(bufferInfo.attr.flags & AVCODEC_BUFFER_FLAGS_EOS), "AudioDecOutputThread catch EOS, thread out"); - audioDecContext_->outputFrameCount++; - uint8_t *source = OH_AVBuffer_GetAddr(reinterpret_cast(bufferInfo.buffer)); - for (int i = 0; i < bufferInfo.attr.size; i++) { - audioDecContext_->renderQueue.push(*(source + i)); - } - lock.unlock(); - int32_t ret = audioDecoder_->FreeOutputBuffer(bufferInfo.bufferIndex, true); - CHECK_AND_BREAK_LOG(ret == AVCODEC_SAMPLE_ERR_OK, "AudioDecOutputThread, thread out"); - - std::unique_lock lockRender(audioDecContext_->renderMutex); - audioDecContext_->renderCond.wait_for(lockRender, 20ms, [this, bufferInfo]() { - return audioDecContext_->renderQueue.size() < BALANCE_VALUE * bufferInfo.attr.size; - }); - } -} - -void Player::Release() { - std::lock_guard lock(mutex_); - isStarted_ = false; - while (audioDecContext_ && !audioDecContext_->renderQueue.empty()) { - audioDecContext_->renderQueue.pop(); - } - if (audioRender_ != nullptr) { - OH_AudioRenderer_Release(audioRender_); - audioRender_ = nullptr; - } - ReleaseThread(); - if (demuxer_ != nullptr) { - demuxer_->Release(); - demuxer_.reset(); - } - if (videoDecoder_ != nullptr) { - videoDecoder_->Release(); - videoDecoder_.reset(); - } - int32_t decodeFrameCount = 0; - if (videoDecContext_ != nullptr) { - decodeFrameCount = videoDecContext_->outputFrameCount; - delete videoDecContext_; - videoDecContext_ = nullptr; - } - if (audioDecoder_ != nullptr) { - audioDecoder_->Release(); - audioDecoder_.reset(); - } - if (audioDecContext_ != nullptr) { - delete audioDecContext_; - audioDecContext_ = nullptr; - } - OH_AudioStreamBuilder_Destroy(builder_); - doneCond_.notify_all(); - sampleInfo_.playDoneCallback(sampleInfo_.playDoneCallbackData); - - if (sampleInfo_.processType != 0) { - NativeXComponentSample::PluginManager().GetInstance()->frameCount = decodeFrameCount; - NativeXComponentSample::PluginManager().GetInstance()->StopProcessing(); - } - NativeXComponentSample::PluginManager().GetInstance()->BlackLastFrame(); -} - -void Player::StartRelease() { - if (audioRender_) { - OH_AudioRenderer_Stop(audioRender_); - } - if (!isReleased_) { - isReleased_ = true; - Release(); - } - isPlaying = false; -} - -void Player::ReleaseThread() { - if (videoDecInputThread_ && videoDecInputThread_->joinable()) { - videoDecInputThread_->detach(); - videoDecInputThread_.reset(); - } - if (videoDecOutputThread_ && videoDecOutputThread_->joinable()) { - videoDecOutputThread_->detach(); - videoDecOutputThread_.reset(); - } - if (audioDecInputThread_ && audioDecInputThread_->joinable()) { - audioDecInputThread_->detach(); - audioDecInputThread_.reset(); - } - if (audioDecOutputThread_ && audioDecOutputThread_->joinable()) { - audioDecOutputThread_->detach(); - audioDecOutputThread_.reset(); - } -} - -int32_t Player::CreateAudioDecoder() { - int32_t ret = audioDecoder_->Create(sampleInfo_.audioCodecMime); - if (ret == AVCODEC_SAMPLE_ERR_OK) { - audioDecContext_ = new CodecUserData; - ret = audioDecoder_->Config(sampleInfo_, audioDecContext_); - OH_AudioStreamBuilder_Create(&builder_, AUDIOSTREAM_TYPE_RENDERER); - OH_AudioStreamBuilder_SetLatencyMode(builder_, AUDIOSTREAM_LATENCY_MODE_NORMAL); - OH_AudioStreamBuilder_SetSamplingRate(builder_, sampleInfo_.audioSampleRate); - OH_AudioStreamBuilder_SetChannelCount(builder_, sampleInfo_.audioChannelCount); - OH_AudioStreamBuilder_SetSampleFormat(builder_, AUDIOSTREAM_SAMPLE_S16LE); - OH_AudioStreamBuilder_SetEncodingType(builder_, AUDIOSTREAM_ENCODING_TYPE_RAW); - OH_AudioStreamBuilder_SetRendererInfo(builder_, AUDIOSTREAM_USAGE_MUSIC); - OH_AudioRenderer_Callbacks callbacks; -#ifndef DEBUG_DECODE - callbacks.OH_AudioRenderer_OnWriteData = SampleCallback::OnRenderWriteData; -#else - callbacks.OH_AudioRenderer_OnWriteData = null; -#endif - callbacks.OH_AudioRenderer_OnStreamEvent = SampleCallback::OnRenderStreamEvent; - callbacks.OH_AudioRenderer_OnInterruptEvent = SampleCallback::OnRenderInterruptEvent; - callbacks.OH_AudioRenderer_OnError = SampleCallback::onRenderError; - - OH_AudioStreamBuilder_SetRendererCallback(builder_, callbacks, audioDecContext_); - OH_AudioStreamBuilder_GenerateRenderer(builder_, &audioRender_); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, ret, "AudioDecoder Config failed"); - return AVCODEC_SAMPLE_ERR_OK; - } - return AVCODEC_SAMPLE_ERR_ERROR; -} - -int32_t Player::CreateVideoDecoder() { - int32_t ret = videoDecoder_->Create(sampleInfo_.videoCodecMime); - if (ret == AVCODEC_SAMPLE_ERR_OK) { - videoDecContext_ = new CodecUserData; - ret = videoDecoder_->Config(sampleInfo_, videoDecContext_); - CHECK_AND_RETURN_RET_LOG(ret == AVCODEC_SAMPLE_ERR_OK, ret, "VideoDecoder Config failed"); - return AVCODEC_SAMPLE_ERR_OK; - } - return AVCODEC_SAMPLE_ERR_ERROR; -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/cpp/sample/player/Player.h b/VideoProcessing/entry/src/main/cpp/sample/player/Player.h deleted file mode 100644 index 758b1de870ed4039a0d3dca87b11c794ec120ea2..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/sample/player/Player.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_PLAYER_H -#define VIDEOPROCESSING_PLAYER_H - -#include -#include -#include -#include -#include -#include -#include "VideoDecoder.h" -#include "AudioDecoder.h" -#include "Demuxer.h" -#include "SampleInfo.h" -#include "PluginManager.h" - -class Player { -public: - Player(){}; - ~Player(); - - int32_t Init(SampleInfo &sampleInfo); - int32_t Start(); - bool isPlaying = false; -private: - void VideoDecInputThread(); - void VideoDecOutputThread(); - void AudioDecInputThread(); - void AudioDecOutputThread(); - void Release(); - void StartRelease(); - void ReleaseThread(); - int32_t CreateAudioDecoder(); - int32_t CreateVideoDecoder(); - std::unique_ptr videoDecoder_ = nullptr; - std::shared_ptr audioDecoder_ = nullptr; - std::unique_ptr demuxer_ = nullptr; - - std::mutex mutex_; - std::atomic isStarted_{false}; - std::atomic isReleased_{false}; - std::unique_ptr videoDecInputThread_ = nullptr; - std::unique_ptr videoDecOutputThread_ = nullptr; - std::unique_ptr audioDecInputThread_ = nullptr; - std::unique_ptr audioDecOutputThread_ = nullptr; - std::condition_variable doneCond_; - SampleInfo sampleInfo_; - CodecUserData *videoDecContext_ = nullptr; - CodecUserData *audioDecContext_ = nullptr; - OH_AudioStreamBuilder *builder_ = nullptr; - OH_AudioRenderer *audioRender_ = nullptr; - - static constexpr int64_t MICROSECOND = 1000000; -}; - -#endif //VIDEOPROCESSING_PLAYER_H diff --git a/VideoProcessing/entry/src/main/cpp/sample/player/PlayerNative.cpp b/VideoProcessing/entry/src/main/cpp/sample/player/PlayerNative.cpp deleted file mode 100644 index 992e8ab6707d3e8f5c617ea093d61e5f90c21a1d..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/sample/player/PlayerNative.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* -* 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. -*/ - -#include "PlayerNative.h" -#include -#include -#include -#include -#undef LOG_DOMAIN -#undef LOG_TAG -#define LOG_DOMAIN 0xFF00 -#define LOG_TAG "Player" - -Player *player[2]; -SampleInfo *p_sampleInfo[2]; - -void Callback(void *asyncContext) { - uv_loop_s *loop = nullptr; - CallbackContext *context = (CallbackContext *)asyncContext; - napi_get_uv_event_loop(context->env, &loop); - if (loop != nullptr) { - uv_work_t *work = new uv_work_t; - work->data = context; - uv_queue_work( - loop, work, [](uv_work_t *work){}, - [](uv_work_t *work, int status) { - CallbackContext *context = (CallbackContext *)work->data; - napi_handle_scope scope = nullptr; - napi_open_handle_scope(context->env, &scope); - napi_value callbck = nullptr; - napi_get_reference_value(context->env, context->callbackRef, &callbck); - - size_t argc = 1; - napi_value arg; - napi_create_int32(context->env, context->code, &arg); - napi_value* argv = &arg; - napi_call_function(context->env, nullptr, callbck, argc, argv, nullptr); - napi_close_handle_scope(context->env, scope); - delete context; - delete work; - }); - } else { - OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, "playerNative", "callback::loop is nullptr"); - } -} - -napi_value Preload(napi_env env, napi_callback_info info) { - size_t argc = 2; - napi_value args[2] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - int32_t inputFD = 0; - int64_t offset = 0; - int64_t size = 0; - napi_get_value_int32(env, args[0], &inputFD); - napi_get_value_int64(env, args[1], &size); - - auto source = OH_AVSource_CreateWithFD(inputFD, offset, size); - auto sourceFormat = OH_AVSource_GetSourceFormat(source); - int32_t trackCount = 0; - OH_AVFormat_GetIntValue(sourceFormat, OH_MD_KEY_TRACK_COUNT, &trackCount); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "playerNative", "playerNative::Preload track count: %{public}d", trackCount); - std::string msg = ""; - for(int i = 0; i < trackCount; i++) { - OH_AVFormat *trackFormat = OH_AVSource_GetTrackFormat(source, i); - int32_t trackType = -1; - OH_AVFormat_GetIntValue(trackFormat, OH_MD_KEY_TRACK_TYPE, &trackType); - if (trackType == OH_MediaType::MEDIA_TYPE_VID) { - int32_t isVivid = 0; - int32_t profile = 0; - int32_t transfer = 0; - OH_AVFormat_GetIntValue(trackFormat, OH_MD_KEY_VIDEO_IS_HDR_VIVID, &isVivid); - if (isVivid) { - msg = "HDRVivid"; - } else { - OH_AVFormat_GetIntValue(trackFormat, OH_MD_KEY_PROFILE, &profile); - if (profile == HEVC_PROFILE_MAIN_10) { - msg = "HDR"; - } else { - msg = "SDR"; - } - } - OH_AVFormat_GetIntValue(trackFormat, OH_MD_KEY_TRANSFER_CHARACTERISTICS, &transfer); - switch(transfer) { - case TRANSFER_CHARACTERISTIC_PQ: - msg += " PQ"; - break; - case TRANSFER_CHARACTERISTIC_HLG: - msg += " HLG"; - break; - default: - msg += " UNKNOWN"; - } - int32_t width = 0; - int32_t height = 0; - OH_AVFormat_GetIntValue(trackFormat, OH_MD_KEY_WIDTH, &width); - OH_AVFormat_GetIntValue(trackFormat, OH_MD_KEY_HEIGHT, &height); - - int32_t pixelFormat = 0; - OH_AVFormat_GetIntValue(trackFormat, OH_MD_KEY_PIXEL_FORMAT, &pixelFormat); - msg += "@" + std::to_string(width) + "x" + std::to_string(height) + "@" + std::to_string(pixelFormat); - } - OH_AVFormat_Destroy(trackFormat); - } - OH_AVFormat_Destroy(sourceFormat); - OH_AVSource_Destroy(source); - napi_value retVal; - napi_create_string_utf8(env, msg.c_str(), msg.size(), &retVal); - return retVal; -} - -napi_value StartPlay(napi_env env, napi_callback_info info) { - size_t argc = 10; - napi_value args[10] = {nullptr}; - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - int32_t outputFd = -1; - int32_t color = 0; - int32_t metaData = 0; - int32_t zoomLevel = 0; - int32_t videoIndex = 0; - int32_t processType = 0; - napi_get_value_int32(env, args[8], &processType); - napi_get_value_int32(env, args[3], &videoIndex); - if (p_sampleInfo[videoIndex] == nullptr) { - p_sampleInfo[videoIndex] = new SampleInfo(); - } - p_sampleInfo[videoIndex]->videoIndex = videoIndex; - p_sampleInfo[videoIndex]->processType = processType; - napi_get_value_int32(env, args[0], &p_sampleInfo[videoIndex]->inputFd); - napi_get_value_int64(env, args[1], &p_sampleInfo[videoIndex]->inputFileOffset); - napi_get_value_int64(env, args[2], &p_sampleInfo[videoIndex]->inputFileSize); - - auto asyncContext = new CallbackContext(); - asyncContext->env = env; - napi_create_reference(env, args[9], 1, &asyncContext->callbackRef); - p_sampleInfo[videoIndex]->playDoneCallback = &Callback; - p_sampleInfo[videoIndex]->playDoneCallbackData = asyncContext; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "playerNative", "StartPlay: index:%{public}d, type:%{public}d", videoIndex, processType); - if (p_sampleInfo[videoIndex]->processType) { - napi_get_value_int32(env, args[4], &outputFd); - p_sampleInfo[videoIndex]->outputFd = outputFd; - napi_get_value_int32(env, args[5], &color); - p_sampleInfo[videoIndex]->colorSpace = (OH_NativeBuffer_ColorSpace)color; - napi_get_value_int32(env, args[6], &metaData); - p_sampleInfo[videoIndex]->metaData = metaData; - napi_get_value_int32(env, args[7], &zoomLevel); - p_sampleInfo[videoIndex]->zoomLevel = zoomLevel; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "playerNative", - "StartPlay: fd:%{public}d, color:%{public}d,metadata:%{public}d, zoomLevel:%{public}d ", - outputFd, color, metaData, zoomLevel); - player[videoIndex] = new Player(); - player[videoIndex]->Init(*p_sampleInfo[videoIndex]); - player[videoIndex]->Start(); - NativeXComponentSample::PluginManager::GetInstance()->SetSampleInfo(p_sampleInfo[videoIndex]); - NativeXComponentSample::PluginManager::GetInstance()->StartProcessing(); - } else { - player[videoIndex] = new Player(); - player[videoIndex]->Init(*p_sampleInfo[videoIndex]); - player[videoIndex]->Start(); - } - return nullptr; -} - -napi_value Destroy(napi_env env, napi_callback_info info) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "playerNative", "playerNative::Destroy"); - if (p_sampleInfo[0] != nullptr) { - delete p_sampleInfo[0]; - p_sampleInfo[0] = nullptr; - } - if (p_sampleInfo[1] != nullptr) { - delete p_sampleInfo[1]; - p_sampleInfo[1] = nullptr; - } - NativeXComponentSample::PluginManager::GetInstance()->Release(); - return nullptr; -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) { - napi_property_descriptor classProp[] = { - {"preload", nullptr, Preload, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"playNative", nullptr, StartPlay, nullptr, nullptr, nullptr, napi_default, nullptr}, - {"destroy", nullptr, Destroy, nullptr, nullptr, nullptr, napi_default, nullptr} - }; - napi_define_properties(env, exports, sizeof(classProp) / sizeof(classProp[0]), classProp); - NativeXComponentSample::PluginManager::GetInstance()->Export(env, exports); - return exports; -} -EXTERN_C_END - -static napi_module PlayerModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "player", - .nm_priv = ((void *)0), - .reserved = {0} -}; - -extern "C" __attribute__((constructor)) void RegisterPlayerModule(void) { napi_module_register(&PlayerModule); } \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/cpp/sample/player/PlayerNative.h b/VideoProcessing/entry/src/main/cpp/sample/player/PlayerNative.h deleted file mode 100644 index 2f3b95534385dd5ae233fb93a498fd10e8a900c7..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/sample/player/PlayerNative.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -* 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. -*/ - -#ifndef VIDEOPROCESSING_PLAYERNATIVE_H -#define VIDEOPROCESSING_PLAYERNATIVE_H - -#include -#include -#include -#include "Player.h" -#include "PluginManager.h" - -static napi_value Preload(napi_env env, napi_callback_info info); -static napi_value StartPlay(napi_env env, napi_callback_info info); -static napi_value Destroy(napi_env env, napi_callback_info info); - -#endif //VIDEOPROCESSING_PLAYERNATIVE_H diff --git a/VideoProcessing/entry/src/main/cpp/types/player/index.d.ts b/VideoProcessing/entry/src/main/cpp/types/player/index.d.ts deleted file mode 100644 index 02dcf022c8e94bcf5a24297aee70c09aab56ccb7..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/types/player/index.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* -* 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. -*/ - -export const preload: ( - inputFileFd: number, - inputFileSize: number -) => string; - -export const playNative: ( - intputFIleFd: number, - inputFileOffset: number, - inputFileSize: number, - needProcess: number, - outputFileFd: number, - outputColorSpace: number, - outputMetaData: number, - zoomLevel: number, - processType: number, - cbFn: (ret: number) => void -) => void; - -export const destroy: () => void; \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/cpp/types/player/oh-package.json5 b/VideoProcessing/entry/src/main/cpp/types/player/oh-package.json5 deleted file mode 100644 index c037d102c7c9ad90391a4862aa14e2d6693bf6fb..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/cpp/types/player/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* -* 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": "libplayer.so", - "types": "./index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/ets/common/constant/CommonConstants.ets b/VideoProcessing/entry/src/main/ets/common/constant/CommonConstants.ets deleted file mode 100644 index c628bd1360910ce70b12047ce859f41a8c1894e8..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/ets/common/constant/CommonConstants.ets +++ /dev/null @@ -1,45 +0,0 @@ -/* -* 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. -*/ - -/** - * Common constants for all features - */ -export class CommonConstants { - - /** - * Full percent. - */ - static readonly FULL_PERCENT: string = '100%'; - - /** - * Font weight 500. - */ - static readonly FONT_WEIGHT_500: number = 500; - - /** - * Font weight 700. - */ - static readonly FONT_WEIGHT_700: number = 700; - - /** - * Window util. - */ - static readonly WINDOW_UTIL: string = 'windowUtil'; - - /** - * Device types. - */ - static readonly DEVICE_TYPES: string[] = ['2in1', 'tablet', 'phone']; -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/ets/common/utils/DateTimeUtil.ets b/VideoProcessing/entry/src/main/ets/common/utils/DateTimeUtil.ets deleted file mode 100644 index dbffb84423a317deef9d0f2572a8d174a28a5b2c..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/ets/common/utils/DateTimeUtil.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -export default class DateTimeUtil { - getTime(): string { - const DATETIME = new Date(); - return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()); - } - - getDate(): string { - const DATETIME = new Date(); - return this.concatDate(DATETIME.getFullYear(), DATETIME.getMonth() + 1, DATETIME.getDate()); - } - - fill(value: number): string { - return (value > 9 ? '' : '0') + value; - } - - concatDate(year: number, month: number, date: number): string { - return `${year}${month}${date}`; - } - - concatTime(hour: number, minute: number, second: number): string { - return `${this.fill(hour)}${this.fill(minute)}${this.fill(second)}`; - } -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/ets/common/utils/Logger.ets b/VideoProcessing/entry/src/main/ets/common/utils/Logger.ets deleted file mode 100644 index 5591248238fdc20cb3bf58134784e83fe3161c87..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/ets/common/utils/Logger.ets +++ /dev/null @@ -1,51 +0,0 @@ -/* -* 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'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s, %{public}s'; - - /** - * constructor. - * - * @param Prefix Identifies the log tag. - * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. - */ - constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { - this.prefix = prefix; - this.domain = domain; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('[VideoProcessing]', 0xFF00); \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/ets/common/utils/WindowUtil.ets b/VideoProcessing/entry/src/main/ets/common/utils/WindowUtil.ets deleted file mode 100644 index ad077dbd5af67329e21e49686ab53fca7d5cb838..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/ets/common/utils/WindowUtil.ets +++ /dev/null @@ -1,92 +0,0 @@ -/* -* 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 { window } from "@kit.ArkUI"; -import { CommonConstants } from "../constant/CommonConstants"; -import Logger from "./Logger"; -import { deviceInfo } from "@kit.BasicServicesKit"; - -@Observed -export class WindowUtil { - private windowStage?: window.WindowStage; - private mainWindowClass?: window.Window; - - static getInstance(): WindowUtil | undefined { - if (!AppStorage.get(CommonConstants.WINDOW_UTIL)) { - AppStorage.setOrCreate(CommonConstants.WINDOW_UTIL, new WindowUtil()); - } else { - Logger.info('AppStorage does not have windowUtil'); - } - return AppStorage.get(CommonConstants.WINDOW_UTIL); - } - - setWindowStage(windowStage: window.WindowStage): void { - this.windowStage = windowStage; - } - - setMainWindowPortrait(): void { - if (this.windowStage === undefined) { - Logger.error('windowStage is undefined'); - return; - } - this.windowStage.getMainWindow((err, windowClass: window.Window)=> { - this.mainWindowClass = windowClass; - if (err.code) { - Logger.error(`Failed to obtain the main window, Code: ${err.code}, message: ${err.message}`); - return; - } - if (deviceInfo.deviceType !== CommonConstants.DEVICE_TYPES[0] - && deviceInfo.deviceType !== CommonConstants.DEVICE_TYPES[1]) { - this.mainWindowClass.setPreferredOrientation(window.Orientation.PORTRAIT); - } - }); - } - - setMainWindowOrientation(orientation: window.Orientation): void { - if (this.mainWindowClass === undefined) { - Logger.error('mainWindowClass is undefined'); - return; - } - this.mainWindowClass.setPreferredOrientation(orientation); - } - - disableWindowSystemBar(): void { - if (this.mainWindowClass === undefined) { - Logger.error('mainWindowClass is undefined'); - return; - } - this.mainWindowClass.setWindowSystemBarEnable([]); - } - - enableWindowSystemBar(): void { - if (this.mainWindowClass === undefined) { - Logger.error('mainWindowClass is undefined'); - return; - } - this.mainWindowClass.setWindowSystemBarEnable(['status', 'navigation']); - } - - getMainWindow(): window.Window | undefined { - return this.mainWindowClass; - } - - offWindowSizeChange(): void { - if (this.mainWindowClass === undefined) { - Logger.error('mainWindowClass is undefined'); - return; - } - this.mainWindowClass.off('windowSizeChange'); - } -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/ets/entryability/EntryAbility.ets b/VideoProcessing/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 23275cb83c5f4319d654a259bcbe2a9a7def8873..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,72 +0,0 @@ -/* -* 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 { abilityAccessCtrl, AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; -import { BusinessError } from '@ohos.base'; -import { WindowUtil } from '../common/utils/WindowUtil'; - -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'); - // try { - // let atManager = abilityAccessCtrl.createAtManager(); - // atManager.requestPermissionsFromUser(this.context, ['ohos.permission.READ_MEDIA']) - // .then((data)=> { - // hilog.error(0x0000, 'testTag', 'Succeed to request permission.'); - // }).catch((err: BusinessError)=>{ - // hilog.error(0x0000, 'testTag', 'Failed to request permission. Cause: %{public}s', err.message); - // }) - // } catch (err) { - // hilog.error(0x0000, 'testTag', 'Failed to request permission. Cause: %{public}s', err.message); - // } - - WindowUtil.getInstance()?.setWindowStage(windowStage); - WindowUtil.getInstance()?.setMainWindowPortrait(); - - windowStage.loadContent('pages/VideoPage', (err) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', err.message); - 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/VideoProcessing/entry/src/main/ets/pages/VideoPage.ets b/VideoProcessing/entry/src/main/ets/pages/VideoPage.ets deleted file mode 100644 index 4251b694174a10341a0857b2c4443f86ee37c162..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/ets/pages/VideoPage.ets +++ /dev/null @@ -1,590 +0,0 @@ -/* -* 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 { common } from '@kit.AbilityKit'; -import { fileIo, picker } from '@kit.CoreFileKit'; -import { image } from '@kit.ImageKit'; -import { media } from '@kit.MediaKit'; -import { photoAccessHelper } from '@kit.MediaLibraryKit'; -import player from 'libplayer.so'; -import { CommonConstants } from '../common/constant/CommonConstants'; -import DateTimeUtil from '../common/utils/DateTimeUtil'; -import Logger from '../common/utils/Logger'; -import { MultiStatusButton } from '../view/MultiStatusButton'; - -const TAG: string = 'VideoPage'; -const DATETIME: DateTimeUtil = new DateTimeUtil(); - -@Entry -@Component -struct VideoPage { - @State selectFilePath: string = ''; - @State myFileNames: string[] = []; - @State percent: number = 0; - @State windowWidth: number = 300; - @State windowHeight: number = 300; - @State hdrMode: string = 'unknown'; - - @State canConvertSDR: boolean = false; - @State canConvertVividPQ: boolean = false; - @State canConvertVividHLG: boolean = false; - @State canConvertHLG: boolean = false; - @State canGenerationMeta: boolean = false; - - @State targetType: string = ''; - - @State colorSpaceIsShow: boolean = false; - @State metaIsShow: boolean = false; - @State scaleIsShow: boolean = false; - - @State viewState: number = 0; - @State pixelMap: image.PixelMap | undefined = undefined; - - targetColorSpace: number = 0; - targetMetaData: number = 0; - - zoomNoneStatus: number = 0; - enhanceLowStatus: number = 0; - enhanceMediumStatus: number = 0; - enhanceHighStatus: number = 0; - zoomLevel: number = 0; - player1Playing: boolean = false; - player2Playing: boolean = false; - isVideoProcessing: boolean = false; - - aboutToDisappear(): void { - Logger.info(TAG, 'aboutToDisappear' + this.selectFilePath); - player.destroy(); - } - - async videoPicker(): Promise { - try { - let photoSelectOptions = new photoAccessHelper.PhotoSelectOptions(); - photoSelectOptions.maxSelectNumber = 1; - let photoPicker = new picker.DocumentViewPicker(); - photoPicker.select(photoSelectOptions).then((photoSelectResult)=>{ - if (photoSelectResult !== null || photoSelectResult !== undefined) { - Logger.info(TAG, `PhotoViewPicker select to file succeed and uri is: ${photoSelectResult[0]}`); - if (photoSelectResult[0]) { - this.selectFilePath = photoSelectResult[0]; - this.reset(); - this.preload(); - } - } - }).catch((err: BusinessError) => { - Logger.error(TAG, `PhotoViewPicker select failed with err: ${err.message}`); - }); - } catch (err) { - Logger.error(TAG, `PhotoViewPicker failed with err: ${err.message}`); - } - } - - preload() { - let inputFile = fileIo.openSync(this.selectFilePath, fileIo.OpenMode.READ_ONLY); - let inputFileState = fileIo.statSync(inputFile.fd); - let info: string = player.preload(inputFile.fd, inputFileState.size); - fileIo.close(inputFile); - Logger.info(TAG, `Video info: ${info}}`); - let arr: string[] = info.split('@'); - let msg = arr[0] + ' ' + arr[1]; - this.hdrMode = info; - if (msg.includes('HDRVivid HLG')) { - this.canConvertVividPQ = true; - this.canConvertSDR = true; - this.canGenerationMeta = true; - } else if (msg.includes('HDRVivid PQ')) { - this.canConvertVividHLG = true; - this.canConvertSDR = true; - this.canGenerationMeta = true; - } else if (msg.includes('HDR')) { - this.canConvertHLG = true; - this.canGenerationMeta = true; - } else if (msg.includes('SDR')) { - this.canConvertSDR = true; - this.canGenerationMeta = false; - } - let pixel = arr[1].split('x'); - let width = Number(pixel[0]); - let height = Number(pixel[1]); - - if (msg.includes('SDR') && (arr[2] === '0' || arr[2] === '2' || arr[2] === '3')) { - if ((width >= 512 && width <= 2000) && (height >= 512 && height <= 2000)) { - this.zoomNoneStatus = 1; - this.enhanceLowStatus = 1; - this.enhanceMediumStatus = 1; - this.enhanceHighStatus = 1; - } else if ((width > 32 && width <= 2000) && (height > 32 && height <= 2000)) { - this.zoomNoneStatus = 1; - this.enhanceLowStatus = 1; - this.enhanceMediumStatus = 1; - this.enhanceHighStatus = 1; - } else { - this.enhanceLowStatus = 0; - this.enhanceMediumStatus = 0; - this.enhanceHighStatus = 0; - } - } - - let timeUs: number = 0; - let queryOption: media.AVImageQueryOptions = media.AVImageQueryOptions.AV_IMAGE_QUERY_PREVIOUS_SYNC; - let param: media.PixelMapParams = { - width: width, - height: height - }; - this.viewState = 1; - media.createAVImageGenerator((err: BusinessError, generator: media.AVImageGenerator)=> { - if (generator != null) { - let inputFile = fileIo.openSync(this.selectFilePath, fileIo.OpenMode.READ_ONLY); - let inputFileState = fileIo.statSync(inputFile.fd); - generator.fdSrc = {fd: inputFile.fd, offset: 0, length: inputFileState.size}; - generator.fetchFrameByTime(timeUs, queryOption, param, (error: BusinessError, pixelMap)=> { - if (error) { - Logger.error(TAG, `Failed to fetch FrameByTime, err: ${error.message}}`); - } else { - this.pixelMap = pixelMap; - } - fileIo.close(inputFile); - generator.release(); - }) - } else { - Logger.error(TAG, `Failed to create AVImageGenerator, error: ${err.message}`); - } - }); - } - - play(): void { - let inputFile1 = fileIo.openSync(this.selectFilePath, fileIo.OpenMode.READ_ONLY); - let inputFileState1 = fileIo.statSync(inputFile1.fd); - this.player1Playing = true; - player.playNative(inputFile1.fd, 0, inputFileState1.size, 0, -1, this.targetColorSpace, - this.targetMetaData, 0, 0, ()=> { - this.viewState = 1; - fileIo.close(inputFile1); - this.player1Playing = false; - this.isVideoProcessing = this.player1Playing || this.player2Playing; - }); - let inputFile2 = fileIo.openSync(this.selectFilePath, fileIo.OpenMode.READ_ONLY); - let inputFileState2 = fileIo.statSync(inputFile2.fd); - this.player2Playing = true; - player.playNative(inputFile2.fd, 0, inputFileState2.size, 1, -1, this.targetColorSpace, - this.targetMetaData, 0, 0, ()=> { - this.viewState = 1; - fileIo.close(inputFile2); - this.player2Playing = false; - this.isVideoProcessing = this.player1Playing || this.player2Playing; - }); - this.isVideoProcessing = true; - } - - reset(): void { - this.zoomNoneStatus = 0; - this.enhanceLowStatus = 0; - this.enhanceMediumStatus = 0; - this.enhanceHighStatus = 0; - - this.canGenerationMeta = false; - - this.canConvertVividHLG = false; - this.canConvertVividPQ = false; - this.canConvertHLG = false; - this.canConvertSDR = false; - Logger.info(TAG, 'reset process status'); - } - - async processVideo(option: number, isSave: boolean): Promise { - let inputFile1 = fileIo.openSync(this.selectFilePath, fileIo.OpenMode.READ_ONLY); - let inputFileState1 = fileIo.statSync(inputFile1.fd); - this.player1Playing = true; - player.playNative(inputFile1.fd, 0, inputFileState1.size, 0, -1, this.targetColorSpace, - this.targetMetaData, 0, 0, (ret: number)=> { - fileIo.close(inputFile1); - this.player1Playing = false; - this.isVideoProcessing = this.player1Playing || this.player2Playing; - }); - let inputFile2 = fileIo.openSync(this.selectFilePath, fileIo.OpenMode.READ_ONLY); - let inputFileState2 = fileIo.statSync(inputFile2.fd); - if (isSave) { - let context = this.getUIContext().getHostContext() as common.UIAbilityContext; - let helper = photoAccessHelper.getPhotoAccessHelper(context); - let videoName = `AVCodecVideo_${DATETIME.getDate()}_${DATETIME.getTime()}`; - Logger.info(TAG, `video save name is : ${videoName}`); - if (!canIUse('SystemCapability.FileManagement.PhotoAccessHelper.Core')) { - return; - } - helper.createAsset(photoAccessHelper.PhotoType.VIDEO, 'mp4', {title: videoName}) - .then((uri)=> { - Logger.info(TAG, `video save uri is: ${uri}`); - let outputFile = fileIo.openSync(uri, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); - if (outputFile.fd !== null) { - this.player2Playing = true; - player.playNative(inputFile2.fd, 0, inputFileState2.size, 1, outputFile.fd, this.targetColorSpace, - this.targetMetaData, this.zoomLevel, option, (ret: number)=> { - fileIo.close(inputFile2); - fileIo.close(outputFile); - if (ret && ret === 5) { - this.getUIContext().getPromptAction().showToast({ message: $r('app.string.video_processing_not_support') }); - } - this.player2Playing = false; - this.isVideoProcessing = this.player1Playing || this.player2Playing; - }); - } - }); - } else { - this.player2Playing = true; - player.playNative(inputFile2.fd, 0, inputFileState2.size, 1, -1, this.targetColorSpace, - this.targetMetaData, this.zoomLevel, option, (ret: number)=> { - fileIo.close(inputFile2); - if (ret && ret === 5) { - this.getUIContext().getPromptAction().showToast({ message: $r('app.string.video_processing_not_support') }); - } - this.player2Playing = false; - this.isVideoProcessing = this.player1Playing || this.player2Playing; - }); - } - this.isVideoProcessing = true; - } - - @Builder - ScaleEnhancerMenu() { - Column() { - MultiStatusButton({text: 'NONE', status: this.zoomNoneStatus}) - .onClick(()=> { - if (this.zoomNoneStatus === 0) { - return; - } - this.scaleIsShow = false; - this.viewState = 2; - this.zoomLevel = 0; - this.processVideo(1, false); - }) - MultiStatusButton({text: 'LOW', status: this.enhanceLowStatus}) - .onClick(()=> { - if (this.enhanceLowStatus === 0) { - return; - } - this.scaleIsShow = false; - this.viewState = 2; - this.zoomLevel = 1; - this.processVideo(1, false); - }) - MultiStatusButton({text: 'MEDIUM', status: this.enhanceMediumStatus}) - .onClick(()=> { - if (this.enhanceMediumStatus === 0) { - return; - } - this.scaleIsShow = false; - this.viewState = 2; - this.zoomLevel = 2; - this.processVideo(1, false); - }) - MultiStatusButton({text: 'HIGH', status: this.enhanceHighStatus}) - .onClick(()=> { - if (this.enhanceHighStatus === 0) { - return; - } - this.scaleIsShow = false; - this.viewState = 2; - this.zoomLevel = 3; - this.processVideo(1, false); - }) - .margin({bottom: $r('app.float.color_space_item_margin_bottom')}) - } - .margin({left: $r('app.float.color_space_item_padding_left'), - right: $r('app.float.color_space_item_padding_left')}) - } - - @Builder - MetaDataMenu() { - Column() { - MultiStatusButton({text: 'HDR Vivid', status: this.canGenerationMeta ? 1 : 0}) - .onClick(()=> { - if (!this.canGenerationMeta) { - return; - } - this.metaIsShow = false; - this.viewState = 2; - this.targetType = 'HDR Vivid'; - if (this.canConvertHLG || this.canConvertVividHLG) { - this.targetColorSpace = 9;//OH_COLORSPACE_BT2020_HLG_LIMIT - } else { - this.targetColorSpace = 10;//OH_COLORSPACE_BT2020_PQ_LIMIT - } - this.targetMetaData = 2;//OH_VIDEO_HDR_VIVID - this.processVideo(2, false); - }) - .margin({bottom: $r('app.float.color_space_item_margin_bottom')}) - } - .margin({left: $r('app.float.color_space_item_padding_left'), - right: $r('app.float.color_space_item_padding_left')}) - } - - @Builder - ColorSpaceMenu() { - Column() { - Text($r('app.string.color_space_sdr')) - .fontColor($r('app.color.color_space_sdr_hint_font_color')) - .width(CommonConstants.FULL_PERCENT) - .padding({left: $r('app.float.color_space_item_padding_left')}) - MultiStatusButton({text: 'BT709', status: this.canConvertSDR ? 1 : 0}) - .onClick(()=> { - if (!this.canConvertSDR) { - return; - } - this.colorSpaceIsShow = false; - this.viewState = 2; - this.targetType = 'SDR BT709'; - this.targetColorSpace = 8;//OH_COLORSPACE_BT709_LIMIT - this.targetMetaData = -1;//OH_VIDEO_NONE - this.processVideo(3, false); - }) - Text($r('app.string.color_space_hdr')) - .fontColor($r('app.color.color_space_sdr_hint_font_color')) - .width(CommonConstants.FULL_PERCENT) - .padding({left: $r('app.float.color_space_item_padding_left')}) - .margin({top: $r('app.float.color_space_hdr_hint_margin_top')}) - MultiStatusButton({text: 'HLG', status: this.canConvertHLG ? 1 : 0}) - .onClick(()=> { - if (!this.canConvertHLG) { - return; - } - this.colorSpaceIsShow = false; - this.viewState = 2; - this.targetType = 'HDR HLG'; - this.targetColorSpace = 9;//OH_COLORSPACE_BT2020_HLG_LIMIT - this.targetMetaData = 0;//OH_VIDEO_HDR_HLG - this.processVideo(3, false); - }) - MultiStatusButton({text: 'Vivid-HLG', status: this.canConvertVividHLG ? 1 : 0}) - .onClick(()=> { - if (!this.canConvertVividHLG) { - return; - } - this.colorSpaceIsShow = false; - this.viewState = 2; - this.targetType = 'HDR Vivid-HLG'; - this.targetColorSpace = 9;//OH_COLORSPACE_BT2020_HLG_LIMIT - this.targetMetaData = 2;//OH_VIDEO_HDR_VIVID - this.processVideo(3, false); - }) - MultiStatusButton({text: 'Vivid-PQ', status: this.canConvertVividPQ ? 1 : 0}) - .onClick(()=> { - if (!this.canConvertVividPQ) { - return; - } - this.colorSpaceIsShow = false; - this.viewState = 2; - this.targetType = 'HDR Vivid-PQ'; - this.targetColorSpace = 10;//OH_COLORSPACE_BT2020_PQ_LIMIT - this.targetMetaData = 2;//OH_VIDEO_HDR_VIVID - this.processVideo(3, false); - }) - .margin({bottom: $r('app.float.color_space_item_margin_bottom')}) - } - .margin({left: $r('app.float.color_space_item_padding_left'), - right: $r('app.float.color_space_item_padding_left')}) - } - - build() { - RelativeContainer() { - Text($r('app.string.video_processing_title')) - .height($r('app.float.videoProcessing_title_height')) - .fontSize($r('app.float.video_processing_title_size')) - .fontWeight(CommonConstants.FONT_WEIGHT_700) - .margin({left: $r('app.float.title_margin_left')}) - .id('title') - Column() { - Row() { - Text($r('app.string.video_processing_after')) - .fontWeight(CommonConstants.FONT_WEIGHT_700) - .margin({left: $r('app.float.title_margin_left')}) - .fontSize($r('app.float.processing_title_size')) - } - .margin({ - top: $r('app.float.processing_title_margin_top'), - bottom: $r('app.float.processing_title_margin_bottom') - }) - .width(CommonConstants.FULL_PERCENT) - Stack({alignContent: Alignment.BottomStart}) { - Text($r('app.string.video_processing_after_area')) - .fontSize($r('app.float.video_processing_after_area_hint_font_size')) - .fontColor($r('app.color.video_processing_after_area_hint_font_color')) - .textAlign(TextAlign.Center) - .backgroundColor($r('app.color.video_processing_after_area_bg_color')) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .visibility(this.viewState === 0 ? Visibility.Visible : Visibility.Hidden) - - Image(this.pixelMap) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .visibility(this.viewState === 1 ? Visibility.Visible : Visibility.Hidden) - - XComponent({id: 'dstPlayer', type: XComponentType.SURFACE, libraryname: 'player'}) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .visibility(this.viewState === 2 ? Visibility.Visible : Visibility.Hidden) - } - .width(CommonConstants.FULL_PERCENT) - .height($r('app.float.video_surface_height')) - Row() { - Text($r('app.string.video_processing_before')) - .fontWeight(CommonConstants.FONT_WEIGHT_700) - .fontSize($r('app.float.processing_title_size')) - .margin({left: $r('app.float.title_margin_left')}) - Text($r('app.string.video_processing_select_file')) - .fontColor($r('app.color.button_select_file_color')) - .fontSize($r('app.float.video_select_button_font_size')) - .margin({right: $r('app.float.title_margin_right')}) - .onClick(()=> { - if (this.isVideoProcessing) { - this.getUIContext().getPromptAction().showToast({ message: $r('app.string.video_is_processing_try_later') }); - return; - } - this.videoPicker(); - }) - } - .width(CommonConstants.FULL_PERCENT) - .margin({ - top: $r('app.float.processing_before_title_margin_top'), - bottom: $r('app.float.processing_title_margin_bottom') - }) - .justifyContent(FlexAlign.SpaceBetween) - Stack({alignContent: Alignment.BottomStart}) { - Text($r('app.string.video_processing_before_are')) - .fontSize($r('app.float.video_processing_after_area_hint_font_size')) - .fontColor($r('app.color.video_processing_after_area_hint_font_color')) - .textAlign(TextAlign.Center) - .backgroundColor($r('app.color.video_processing_after_area_bg_color')) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .visibility(this.viewState === 0 ? Visibility.Visible : Visibility.Hidden) - Image(this.pixelMap) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .visibility(this.viewState === 1 ? Visibility.Visible : Visibility.Hidden) - XComponent({id: 'srcPlayer', type: XComponentType.SURFACE, libraryname: 'player'}) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .visibility(this.viewState === 2 ? Visibility.Visible : Visibility.Hidden) - } - .width(CommonConstants.FULL_PERCENT) - .height($r('app.float.video_surface_height')) - Row() { - Button($r('app.string.video_processing_meta_generate')) - .layoutWeight(1) - .backgroundColor($r('app.color.button_bg_color')) - .fontColor($r('app.color.button_text_color')) - .fontWeight(CommonConstants.FONT_WEIGHT_500) - .margin({right: $r('app.float.meta_button_margin')}) - .bindSheet($$this.metaIsShow, this.MetaDataMenu(), { - detents: [SheetSize.FIT_CONTENT], - backgroundColor: Color.White, - blurStyle: BlurStyle.NONE, - showClose: true, - title: {title: $r('app.string.meta_list')} - }) - .onClick(()=> { - if (this.isVideoProcessing) { - this.getUIContext().getPromptAction().showToast({ message: $r('app.string.video_is_processing_try_later') }); - return; - } - this.metaIsShow = true; - }) - Button($r('app.string.video_processing_scale')) - .layoutWeight(1) - .backgroundColor($r('app.color.button_bg_color')) - .fontColor($r('app.color.button_text_color')) - .fontWeight(CommonConstants.FONT_WEIGHT_500) - .margin({right: $r('app.float.scale_button_margin')}) - .bindSheet($$this.scaleIsShow, this.ScaleEnhancerMenu(), { - detents: [SheetSize.FIT_CONTENT], - backgroundColor: Color.White, - blurStyle: BlurStyle.NONE, - showClose: true, - title: {title: $r('app.string.scale_enhance_list')} - }) - .onClick(()=> { - if (this.isVideoProcessing) { - this.getUIContext().getPromptAction().showToast({ message: $r('app.string.video_is_processing_try_later') }); - return; - } - this.scaleIsShow = true; - }) - } - .justifyContent(FlexAlign.Center) - .margin({ - left: $r('app.float.scale_meta_area_margin_left'), - top: $r('app.float.scale_meta_area_margin_top'), - right: $r('app.float.scale_meta_area_margin_right') - }) - - Button($r('app.string.video_processing_color_space')) - .width(CommonConstants.FULL_PERCENT) - .constraintSize({maxWidth: CommonConstants.FULL_PERCENT}) - .margin({ - left: $r('app.float.title_margin_left'), - top: $r('app.float.color_space_button_margin_top'), - right: $r('app.float.title_margin_right') - }) - .fontWeight(CommonConstants.FONT_WEIGHT_500) - .backgroundColor($r('app.color.button_bg_color')) - .fontColor($r('app.color.button_text_color')) - .bindSheet($$this.colorSpaceIsShow, this.ColorSpaceMenu(), { - detents: [SheetSize.FIT_CONTENT], - backgroundColor: Color.White, - blurStyle: BlurStyle.NONE, - showClose: true, - title: {title: $r('app.string.color_space_list')} - }) - .onClick(()=>{ - if (this.isVideoProcessing) { - this.getUIContext().getPromptAction().showToast({ message: $r('app.string.video_is_processing_try_later') }); - return; - } - this.colorSpaceIsShow = true; - }) - Button($r('app.string.video_processing_play')) - .width(CommonConstants.FULL_PERCENT) - .constraintSize({ maxWidth: CommonConstants.FULL_PERCENT}) - .margin({ - left: $r('app.float.title_margin_left'), - top: $r('app.float.color_space_button_margin_top'), - right: $r('app.float.title_margin_right') - }) - .fontWeight(CommonConstants.FONT_WEIGHT_500) - .backgroundColor($r('app.color.button_bg_color')) - .fontColor($r('app.color.button_text_color')) - .onClick(()=>{ - if (this.isVideoProcessing) { - this.getUIContext().getPromptAction().showToast({ message: $r('app.string.video_is_processing_try_later') }); - return; - } - if(this.selectFilePath) { - this.viewState = 2; - this.play(); - } - }) - } - .height(CommonConstants.FULL_PERCENT) - .width(CommonConstants.FULL_PERCENT) - .alignRules({ - top: { anchor: 'title', align: VerticalAlign.Bottom} - }) - } - .height(CommonConstants.FULL_PERCENT) - .width(CommonConstants.FULL_PERCENT) - } -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/ets/view/MultiStatusButton.ets b/VideoProcessing/entry/src/main/ets/view/MultiStatusButton.ets deleted file mode 100644 index c9676fbe0fbcc30424b68ffca70cc3d742db3d1c..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/ets/view/MultiStatusButton.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* -* 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 { CommonConstants } from '../common/constant/CommonConstants'; - -@Component -export struct MultiStatusButton { - @State status: number = 2; //0不可用,1可用,2选中 - @State text: string = 'NONE'; - - build() { - Column() { - if (this.status === 0) { - Text(this.text) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .fontColor($r('app.color.color_space_item_disable_font_color')) - .backgroundColor($r('app.color.color_space_item_disable_bg_color')) - .borderRadius(16) - .padding({left: $r('app.float.color_space_item_padding_left')}) - .margin({top: $r('app.float.color_space_item_margin_left')}) - } else if (this.status === 1) { - Text(this.text) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .fontColor($r('app.color.color_space_item_enable_font_color')) - .backgroundColor($r('app.color.color_space_item_enable_bg_color')) - .borderRadius(16) - .padding({left: $r('app.float.color_space_item_padding_left')}) - .margin({top: $r('app.float.color_space_item_margin_left')}) - .onTouch(()=>{ - this.status = 2; - }) - } else if (this.status === 2) { - Text(this.text) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .fontColor($r('app.color.color_space_item_checked_font_color')) - .backgroundColor($r('app.color.color_space_item_checked_bg_color')) - .borderRadius(16) - .padding({left: $r('app.float.color_space_item_padding_left')}) - .margin({top: $r('app.float.color_space_item_margin_left')}) - .borderWidth(1) - .borderColor($r('app.color.space_item_checked_border_color')) - } - } - .margin({top: $r('app.float.item_margin_top')}) - .width(CommonConstants.FULL_PERCENT) - .height($r('app.float.sheet_item_height')) - } -} diff --git a/VideoProcessing/entry/src/main/module.json5 b/VideoProcessing/entry/src/main/module.json5 deleted file mode 100644 index 6b395739a677905d18c754df214b01199baafa90..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/module.json5 +++ /dev/null @@ -1,36 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "phone" - ], - "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" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/resources/base/element/color.json b/VideoProcessing/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 9faa51267b00b0f512dd56fd41e1a0c1aed9157e..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, - { - "name": "button_select_file_color", - "value": "#0A59F7" - }, - { - "name": "button_bg_color", - "value": "#11000000" - }, - { - "name": "button_text_color", - "value": "#0A59F7" - }, - { - "name": "video_processing_after_area_hint_font_color", - "value": "#5A000000" - }, - { - "name": "video_processing_after_area_bg_color", - "value": "#F1F3F5" - }, - { - "name": "color_space_item_enable_bg_color", - "value": "#0C000000" - }, - { - "name": "color_space_item_disable_bg_color", - "value": "#0C000000" - }, - { - "name": "color_space_item_enable_font_color", - "value": "#000000" - }, - { - "name": "color_space_item_disable_font_color", - "value": "#66000000" - }, - { - "name": "color_space_item_checked_font_color", - "value": "#0A59F7" - }, - { - "name": "color_space_item_checked_bg_color", - "value": "#0C0A59F7" - }, - { - "name": "space_item_checked_border_color", - "value": "#0A59F7" - }, - { - "name": "color_space_sdr_hint_font_color", - "value": "#99000000" - } - ] -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/resources/base/element/float.json b/VideoProcessing/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 88c49ff474b664e293ca9abf8959cd64e80c1edb..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "float": [ - { - "name": "item_margin_top", - "value": "8vp" - }, - { - "name": "sheet_item_height", - "value": "56vp" - }, - { - "name": "video_processing_title_size", - "value": "24fp" - }, - { - "name": "title_margin_left", - "value": "16vp" - }, - { - "name": "processing_title_size", - "value": "18fp" - }, - { - "name": "title_margin_right", - "value": "16vp" - }, - { - "name": "video_select_button_font_size", - "value": "16fp" - }, - { - "name": "processing_title_margin_top", - "value": "24vp" - }, - { - "name": "processing_title_margin_bottom", - "value": "8vp" - }, - { - "name": "processing_before_title_margin_top", - "value": "48vp" - }, - { - "name": "processing_before_title_margin_bottom", - "value": "8vp" - }, - { - "name": "play_button_width", - "value": "24vp" - }, - { - "name": "play_button_height", - "value": "24vp" - }, - { - "name": "play_botton_margin_bottom", - "value": "8vp" - }, - { - "name": "scale_button_width", - "value": "158vp" - }, - { - "name": "meta_button_width", - "value": "158vp" - }, - { - "name": "color_space_button_width", - "value": "328vp" - }, - { - "name": "scale_button_margin", - "value": "6vp" - }, - { - "name": "meta_button_margin", - "value": "6vp" - }, - { - "name": "scale_meta_area_margin_left", - "value": "16vp" - }, - { - "name": "scale_meta_area_margin_top", - "value": "12vp" - }, - { - "name": "scale_meta_area_margin_right", - "value": "16vp" - }, - { - "name": "color_space_button_margin_top", - "value": "12vp" - }, - { - "name": "video_processing_after_area_hint_font_size", - "value": "14fp" - }, - { - "name": "color_space_item_padding_left", - "value": "16vp" - }, - { - "name": "color_space_item_margin_left", - "value": "8vp" - }, - { - "name": "color_space_hdr_hint_margin_top", - "value": "34vp" - }, - { - "name": "color_space_item_margin_top", - "value": "12vp" - }, - { - "name": "color_space_item_margin_bottom", - "value": "56vp" - }, - { - "name": "videoProcessing_title_height", - "value": "56vp" - }, - { - "name": "video_surface_height", - "value": "184vp" - } - ] -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/resources/base/element/string.json b/VideoProcessing/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 174eac1fa815a94558fb3cd5cb6a45e0b11c5c35..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "VideoProcessing" - }, - { - "name": "video_processing_not_support", - "value": "The video does not support the current operation" - }, - { - "name": "color_space_sdr", - "value": "SDR" - }, - { - "name": "color_space_hdr", - "value": "HDR" - }, - { - "name": "video_processing_title", - "value": "VideoProcessing" - }, - { - "name": "video_processing_after", - "value": "After optimization" - }, - { - "name": "video_processing_after_area", - "value": "Please select the video first, and then display the content" - }, - { - "name": "video_processing_before", - "value": "Original video" - }, - { - "name": "video_processing_select_file", - "value": "Select Video" - }, - { - "name": "video_processing_before_are", - "value": "Please select the video first" - }, - { - "name": "video_processing_meta_generate", - "value": "Metadata generation" - }, - { - "name": "video_processing_scale", - "value": "Video zoom" - }, - { - "name": "meta_list", - "value": "HDR metadata support" - }, - { - "name": "scale_enhance_list", - "value": "Zoom Boost Gear" - }, - { - "name": "video_processing_color_space", - "value": "Color space conversion" - }, - { - "name": "video_processing_play", - "value": "Play the video" - }, - { - "name": "color_space_list", - "value": "Color space conversion" - }, - { - "name": "video_is_processing_try_later", - "value": "Video is processing, try later" - } - ] -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/resources/base/media/background.png b/VideoProcessing/entry/src/main/resources/base/media/background.png deleted file mode 100644 index f939c9fa8cc8914832e602198745f592a0dfa34d..0000000000000000000000000000000000000000 Binary files a/VideoProcessing/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/VideoProcessing/entry/src/main/resources/base/media/foreground.png b/VideoProcessing/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 4483ddad1f079e1089d685bd204ee1cfe1d01902..0000000000000000000000000000000000000000 Binary files a/VideoProcessing/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/VideoProcessing/entry/src/main/resources/base/media/layered_image.json b/VideoProcessing/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/resources/base/media/startIcon.png b/VideoProcessing/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/VideoProcessing/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/VideoProcessing/entry/src/main/resources/base/profile/main_pages.json b/VideoProcessing/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index d0e1dd7533d8e4e753c8aae063b4876489aa0baf..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/VideoPage" - ] -} diff --git a/VideoProcessing/entry/src/main/resources/en_US/element/string.json b/VideoProcessing/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 174eac1fa815a94558fb3cd5cb6a45e0b11c5c35..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "VideoProcessing" - }, - { - "name": "video_processing_not_support", - "value": "The video does not support the current operation" - }, - { - "name": "color_space_sdr", - "value": "SDR" - }, - { - "name": "color_space_hdr", - "value": "HDR" - }, - { - "name": "video_processing_title", - "value": "VideoProcessing" - }, - { - "name": "video_processing_after", - "value": "After optimization" - }, - { - "name": "video_processing_after_area", - "value": "Please select the video first, and then display the content" - }, - { - "name": "video_processing_before", - "value": "Original video" - }, - { - "name": "video_processing_select_file", - "value": "Select Video" - }, - { - "name": "video_processing_before_are", - "value": "Please select the video first" - }, - { - "name": "video_processing_meta_generate", - "value": "Metadata generation" - }, - { - "name": "video_processing_scale", - "value": "Video zoom" - }, - { - "name": "meta_list", - "value": "HDR metadata support" - }, - { - "name": "scale_enhance_list", - "value": "Zoom Boost Gear" - }, - { - "name": "video_processing_color_space", - "value": "Color space conversion" - }, - { - "name": "video_processing_play", - "value": "Play the video" - }, - { - "name": "color_space_list", - "value": "Color space conversion" - }, - { - "name": "video_is_processing_try_later", - "value": "Video is processing, try later" - } - ] -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/resources/zh_CN/element/string.json b/VideoProcessing/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index ec28cb2fb9a0e4246f86f58de4062968abf6c785..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "视频处理" - }, - { - "name": "video_processing_not_support", - "value": "该视频不支持当前操作" - }, - { - "name": "color_space_sdr", - "value": "SDR" - }, - { - "name": "color_space_hdr", - "value": "HDR" - }, - { - "name": "video_processing_title", - "value": "视频处理" - }, - { - "name": "video_processing_after", - "value": "优化后" - }, - { - "name": "video_processing_after_area", - "value": "请先选择视频,相关操作后显示内容" - }, - { - "name": "video_processing_before", - "value": "原视频" - }, - { - "name": "video_processing_select_file", - "value": "选择视频" - }, - { - "name": "video_processing_before_are", - "value": "请先选择视频" - }, - { - "name": "video_processing_meta_generate", - "value": "元数据生成" - }, - { - "name": "video_processing_scale", - "value": "视频缩放" - }, - { - "name": "meta_list", - "value": "HDR支持生成元数据的格式" - }, - { - "name": "scale_enhance_list", - "value": "缩放增强档位" - }, - { - "name": "video_processing_color_space", - "value": "色彩空间转换" - }, - { - "name": "video_processing_play", - "value": "播放视频" - }, - { - "name": "color_space_list", - "value": "色彩空间转换" - }, - { - "name": "video_is_processing_try_later", - "value": "视频正在处理中,稍后再试" - } - ] -} \ No newline at end of file diff --git a/VideoProcessing/entry/src/main/syscap.json b/VideoProcessing/entry/src/main/syscap.json deleted file mode 100644 index 5dbd617f5169571a28121b84672b34b37de3130a..0000000000000000000000000000000000000000 --- a/VideoProcessing/entry/src/main/syscap.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "devices": { - "general": [ - "phone" - ] - }, - "development": { - "addedSysCaps": [ - "SystemCapability.Multimedia.VideoProcessingEngine" - ] - } -} \ No newline at end of file diff --git a/VideoProcessing/hvigor/hvigor-config.json5 b/VideoProcessing/hvigor/hvigor-config.json5 deleted file mode 100644 index e0bd0d82696bcd6337fc106180834b6a9ac56a5d..0000000000000000000000000000000000000000 --- a/VideoProcessing/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/VideoProcessing/hvigorfile.ts b/VideoProcessing/hvigorfile.ts deleted file mode 100644 index f3cb9f1a87a81687554a76283af8df27d8bda775..0000000000000000000000000000000000000000 --- a/VideoProcessing/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/VideoProcessing/oh-package.json5 b/VideoProcessing/oh-package.json5 deleted file mode 100644 index 1126f2d7b559b9e56e8ca5b4190c7db9608d8ac5..0000000000000000000000000000000000000000 --- a/VideoProcessing/oh-package.json5 +++ /dev/null @@ -1,8 +0,0 @@ -{ - "modelVersion": "5.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - } -} diff --git a/VideoProcessing/screenshots/device/videoprocessing.png b/VideoProcessing/screenshots/device/videoprocessing.png deleted file mode 100644 index b0608d2f5de0d34883ae344cee42eff1e4f9164e..0000000000000000000000000000000000000000 Binary files a/VideoProcessing/screenshots/device/videoprocessing.png and /dev/null differ diff --git a/pasteboard/pasteboard_NDK_sample/.gitignore b/pasteboard/pasteboard_NDK_sample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/pasteboard/pasteboard_NDK_sample/AppScope/app.json5 b/pasteboard/pasteboard_NDK_sample/AppScope/app.json5 deleted file mode 100644 index 73e81c8a3a59465571b0d60f91b2fab1f6ca23d7..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.pasteboard_ndk_sample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/element/string.json b/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/element/string.json deleted file mode 100644 index 4b84bfe00e7d9bee13fb7cd4c55676d1cb36e674..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "pasteboard_NDK_sample" - } - ] -} diff --git a/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/media/background.png b/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/media/foreground.png b/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/media/layered_image.json b/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/README.md b/pasteboard/pasteboard_NDK_sample/README.md deleted file mode 100644 index a0d83db490b825b906b7bcb94dceb37035e04ce8..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# 使用场景 - -## 介绍 -本示例通过使用[剪贴板指南文档](https://gitcode.com/openharmony/docs/tree/master/zh-cn/application-dev/basic-services/pasteboard)中NDK场景的开发示例,展示在工程中,帮助开发者更好地理解剪贴板模块代码合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [使用剪贴板进行复制粘贴 (C/C++)](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/pasteboard/native-use-pasteboard.md)。 - -2. [使用剪贴板进行延迟复制粘贴](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/pasteboard/pasteboard-time-lapse-copy-and-paste.md)。 - -## 效果预览 - -| 主页 | -|-------| -| ![image](screenshots/UI.PNG) | - -### 使用说明 - -1. 在主界面,可以点击文本框进行输入。 - -2. 输入文本后点击复制按钮进行剪贴板数据写入。 - -3. 第一次点击粘贴时,会弹出授权请求对话框,用户授权后,粘贴的内容将在文本框显示。 - -## 工程目录 - -``` -entry/src/main - │── cpp - │ ├── types - │ ├── libentry - │ ├── Index.d.t - │ ├── oh-package.json5 - │ ├── CMakeLists.txt // 添加动态链接库 - │ ├── napi_init.cpp // 开发步骤示例代码 - │── ets - │ ├── entryability - │ ├── entrybackupability - │ ├── pages - │ ├── Index.ets // UI页面 - ├── resources - │ └── module.json5 // 声明所需的权限 - -``` - -## 相关权限 - -1.使用[安全控件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/pastebutton.md)访问剪贴板内容的应用。 - -2.申请ohos.permission.READ_PASTEBOARD允许应用访问剪贴板。 - -## 依赖 - -不涉及。 - -## 约束与限制 - -1. 本示例支持标准系统上运行,支持设备:RK3568,Phone; - -2. 本示例支持API20版本SDK,版本号:6.0.0.49; - -3. 本示例需要使用DevEco Studio 5.1.1 Release(5.1.1.840)及以上版本才可编译运行。 - -## 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkTS/NodeAPI/NodeAPIClassicUseCases/NodeAPIApplicationScenario > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` diff --git a/pasteboard/pasteboard_NDK_sample/build-profile.json5 b/pasteboard/pasteboard_NDK_sample/build-profile.json5 deleted file mode 100644 index a09d5d7b12890159ef1d77ee3e8b8409f24def33..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "nativeCompiler": "BiSheng", - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/code-linter.json5 b/pasteboard/pasteboard_NDK_sample/code-linter.json5 deleted file mode 100644 index ed05653cca31b61d64cf6471529eaf50d4f70709..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/.gitignore b/pasteboard/pasteboard_NDK_sample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/build-profile.json5 b/pasteboard/pasteboard_NDK_sample/entry/build-profile.json5 deleted file mode 100644 index 3974c0bbe91b785fb2f765d1e8ba3cb31e2ae74c..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/build-profile.json5 +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - }, - "externalNativeOptions": { - "path": "./src/main/cpp/CMakeLists.txt", - "arguments": "", - "cppFlags": "", - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - }, - "nativeLib": { - "debugSymbol": { - "strip": true, - "exclude": [] - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/hvigorfile.ts b/pasteboard/pasteboard_NDK_sample/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/oh-package.json5 b/pasteboard/pasteboard_NDK_sample/entry/oh-package.json5 deleted file mode 100644 index 118bdd4fe7699368a010e04c24f5bfc887cf1298..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "libentry.so": "file:./src/main/cpp/types/libentry" - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/CMakeLists.txt b/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 522144c755a4df3dbab3ad5f3de9c0eb61341210..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -# the minimum version of CMake. -cmake_minimum_required(VERSION 3.5.0) -project(pasteboard_NDK_sample) - -set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -if(DEFINED PACKAGE_FIND_FILE) - include(${PACKAGE_FIND_FILE}) -endif() - -include_directories(${NATIVERENDER_ROOT_PATH} - ${NATIVERENDER_ROOT_PATH}/include) - -add_library(entry SHARED napi_init.cpp) -target_link_libraries(entry PUBLIC libace_napi.z.so - PUBLIC libudmf.so - PUBLIC libpasteboard.so - PUBLIC libhilog_ndk.z.so - PUBLIC ability_access_control.so) \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/napi_init.cpp b/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/napi_init.cpp deleted file mode 100644 index 7e55dfe89dea12fe353f80b487f6d0b0cdb8c7af..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/napi_init.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -#include "napi/native_api.h" -#include -#include -// [Start pasteboard_native2] -#include -// [Start pasteboard_timelapse_Record1] -#include -#include -#include -// [End pasteboard_native2] -#include -// [End pasteboard_timelapse_Record1] -#include -#include -#undef LOG_TAG -#define LOG_TAG "MY_LOG" -// [Start pasteboard_native3] -// 定义剪贴板数据内容变更时的通知回调函数 -static void PasteboardNotifyImpl2(void* context, Pasteboard_NotifyType type) -{ - OH_LOG_INFO(LOG_APP, "Pasteboard_NotifyType, type: %d", type); -} -// 定义剪贴板数据变更观察者对象销毁时的通知回调函数 -static void PasteboardFinalizeImpl2(void* context) -{ - OH_LOG_INFO(LOG_APP, "callback: Pasteboard_Finalize"); -} -// [End pasteboard_native3] -static void PasteboardTestObserver() -{ - // [Start pasteboard_native4] - // 1. 创建一个剪贴板实例 - OH_Pasteboard* pasteboard = OH_Pasteboard_Create(); - // 2. 创建一个剪贴板数据变更观察者实例 - OH_PasteboardObserver* observer = OH_PasteboardObserver_Create(); - // 3. 将两个回调函数设置到观察者实例 - OH_PasteboardObserver_SetData(observer, (void*)pasteboard, PasteboardNotifyImpl2, PasteboardFinalizeImpl2); - // 4. 设置对剪贴板本端数据变化的订阅 - OH_Pasteboard_Subscribe(pasteboard, NOTIFY_LOCAL_DATA_CHANGE, observer); - // [End pasteboard_native4] -} -static napi_value NAPI_Pasteboard_set(napi_env env, napi_callback_info info) -{ - napi_value args[1]; - size_t argc = 1; - napi_status status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); - - char text[256]; - size_t value0Size; - status = napi_get_value_string_utf8(env, args[0], text, sizeof(text), &value0Size); - - // [Start pasteboard_native5] - // 1. 创建一个剪贴板实例 - OH_Pasteboard* pasteboard = OH_Pasteboard_Create(); - if (pasteboard == nullptr) { - OH_LOG_INFO(LOG_APP, "Failed to create pasteboard instance."); - }; - // 2. 创建OH_UdmfRecord对象,并向OH_UdmfRecord中添加文本类型数据 - OH_UdsPlainText* udsPlainText = OH_UdsPlainText_Create(); - OH_UdsPlainText_SetContent(udsPlainText, text); - OH_UdsHtml* udsHtml = OH_UdsHtml_Create(); - OH_UdsHtml_SetContent(udsHtml, "hello world"); - OH_UdmfRecord* record = OH_UdmfRecord_Create(); - OH_UdmfRecord_AddPlainText(record, udsPlainText); - OH_UdmfRecord_AddHtml(record, udsHtml); - - // 3. 创建OH_UdmfData对象,并向OH_UdmfData中添加OH_UdmfRecord - OH_UdmfData* data = OH_UdmfData_Create(); - OH_UdmfData_AddRecord(data, record); - - // 4. 将数据写入剪贴板 - OH_Pasteboard_SetData(pasteboard, data); - - // 5. 使用完销毁指针 - OH_UdsPlainText_Destroy(udsPlainText); - OH_UdsHtml_Destroy(udsHtml); - OH_UdmfRecord_Destroy(record); - OH_UdmfData_Destroy(data); - OH_Pasteboard_Destroy(pasteboard); - // [End pasteboard_native5] - napi_value result; - napi_get_undefined(env, &result); - return result; -} -static napi_value NAPI_Pasteboard_get(napi_env env, napi_callback_info info) -{ - // [Start pasteboard_native6] - // 1. 创建一个剪贴板实例 - OH_Pasteboard* pasteboard = OH_Pasteboard_Create(); - if (pasteboard == nullptr) { - OH_LOG_INFO(LOG_APP, "Failed to create pasteboard instance."); - }; - // 2. 判断剪贴板中是否有文本类型数据 - bool hasPlainTextData = OH_Pasteboard_HasType(pasteboard, "text/plain"); - if (hasPlainTextData) { - // 3. 从剪贴板中获取统一类型数据OH_UdmfData - int ret = 0; - OH_UdmfData* udmfData = OH_Pasteboard_GetData(pasteboard, &ret); - if (udmfData == nullptr) { - OH_LOG_INFO(LOG_APP, "Failed to get data from pasteboard."); - }; - // 4. 从OH_UdmfData中获取第一个数据记录 - OH_UdmfRecord* record = OH_UdmfData_GetRecord(udmfData, 0); - if (record == nullptr) { - OH_LOG_INFO(LOG_APP, "Failed to get record from udmfData."); - }; - // 5. 从数据记录中获取文本数据内容 - OH_UdsPlainText* plainText = OH_UdsPlainText_Create(); - if (plainText == nullptr) { - OH_LOG_INFO(LOG_APP, "Failed to create plain text object."); - }; - OH_UdmfRecord_GetPlainText(record, plainText); - const char* content = OH_UdsPlainText_GetContent(plainText); - if (content == nullptr) { - OH_LOG_INFO(LOG_APP, "Failed to get content from plain text."); - } - napi_value result; - napi_create_string_utf8(env, content, strlen(content), &result); - // 5. 使用完销毁指针 - OH_UdsPlainText_Destroy(plainText); - OH_UdmfRecord_Destroy(record); - return result; - } else { - OH_LOG_INFO(LOG_APP, "No plain text data in pasteboard."); - } - OH_Pasteboard_Destroy(pasteboard); - // [End pasteboard_native6] -} -// [Start pasteboard_timelapse_Record2] -// 1. 获取数据时触发的提供剪贴板数据的回调函数。 -void* GetDataCallback(void* context, const char* type) -{ - // 纯文本类型 - if (memcmp(type, UDMF_META_PLAIN_TEXT, sizeof(UDMF_META_PLAIN_TEXT) - 1) == 0) { - // 创建纯文本类型的Uds对象。 - OH_UdsPlainText* udsText = OH_UdsPlainText_Create(); - // 设置纯文本内容。 - OH_UdsPlainText_SetContent(udsText, "hello world"); - return udsText; - } else if (strcmp(type, UDMF_META_HTML) == 0) { - // 创建HTML类型的Uds对象。 - OH_UdsHtml* udsHtml = OH_UdsHtml_Create(); - // 设置HTML内容。 - OH_UdsHtml_SetContent(udsHtml, "
hello world
"); - return udsHtml; - } - return nullptr; -} -// 2. OH_UdmfRecordProvider销毁时触发的回调函数。 -void ProviderFinalizeCallback(void* context) -{ - OH_LOG_INFO(LOG_APP, "OH_UdmfRecordProvider finalize."); -} -// [End pasteboard_timelapse_Record2] -// [Start pasteboard_timelapse_Record3] -// 3. 定义应用退出时调用延迟同步接口触发的回调函数。 -void SyncCallback(int errorCode) -{ - // 继续退出 -} -// [End pasteboard_timelapse_Record3] -OH_Pasteboard* CreateAndSetPasteboardData() -{ - // [Start pasteboard_timelapse_Record4] - // 4. 创建OH_UdmfRecord对象。 - OH_UdmfRecord* record = OH_UdmfRecord_Create(); - // 5. 创建OH_UdmfRecordProvider对象,并设置用于提供延迟数据、析构的两个回调函数。 - OH_UdmfRecordProvider* provider = OH_UdmfRecordProvider_Create(); - OH_UdmfRecordProvider_SetData(provider, (void*)record, GetDataCallback, ProviderFinalizeCallback); - - // 6. 将provider绑定到record,并设置支持的数据类型。 - #define TYPE_COUNT 2 - const char* types[TYPE_COUNT] = { UDMF_META_PLAIN_TEXT, UDMF_META_HTML }; - OH_UdmfRecord_SetProvider(record, types, TYPE_COUNT, provider); - - // 7. 创建OH_UdmfData对象,并向OH_UdmfData中添加OH_UdmfRecord。 - OH_UdmfData* setData = OH_UdmfData_Create(); - if (setData != nullptr) { - OH_UdmfData_AddRecord(setData, record); - } - - // 8. 创建OH_Pasteboard对象,将数据写入剪贴板中。 - OH_Pasteboard* pasteboard = OH_Pasteboard_Create(); - if (setData != nullptr) { - OH_Pasteboard_SetData(pasteboard, setData); - } - OH_UdmfRecordProvider_Destroy(provider); - OH_UdmfRecord_Destroy(record); - OH_UdmfData_Destroy(setData); - // [End pasteboard_timelapse_Record4] - return pasteboard; -} -// [Start pasteboard_timelapse_Record5] -void ProcessRecordType(OH_UdmfRecord* record, const char* recordType) -{ - OH_UdsPlainText* udsText = nullptr; - OH_UdsHtml* udsHtml = nullptr; - if (strcmp(recordType, UDMF_META_PLAIN_TEXT) == 0) { - // 创建纯文本类型的Uds对象 - udsText = OH_UdsPlainText_Create(); - if (udsText != nullptr) { - // 从record中获取纯文本类型的Uds对象 - OH_UdmfRecord_GetPlainText(record, udsText); - // 从Uds对象中获取内容 - const char* content = OH_UdsPlainText_GetContent(udsText); - } else if (strcmp(recordType, UDMF_META_HTML) == 0) { - // 创建HTML类型的Uds对象 - udsHtml = OH_UdsHtml_Create(); - if (udsHtml != nullptr) { - // 从record中获取HTML类型的Uds对象 - OH_UdmfRecord_GetHtml(record, udsHtml); - // 从Uds对象中获取内容 - const char* content = OH_UdsHtml_GetContent(udsHtml); - } - } - } -} -void ProcessRecord(OH_UdmfRecord* record) -{ - // 13. 查询OH_UdmfRecord中的数据类型。 - unsigned typeCount = 0; - char** recordTypes = OH_UdmfRecord_GetTypes(record, &typeCount); - - // 14. 遍历数据类型。 - for (unsigned int typeIndex = 0; typeIndex < typeCount; ++typeIndex) { - const char* recordType = recordTypes[typeIndex]; - ProcessRecordType(record, recordType); - } -} -// [StartExclude pasteboard_timelapse_Record5] - -static napi_value NAPI_Pasteboard_time(napi_env env, napi_callback_info info) -{ - OH_Pasteboard* pasteboard = CreateAndSetPasteboardData(); - // [EndExclude pasteboard_timelapse_Record5] - // 9. 记录当前的剪贴板数据变化次数。 - uint32_t changeCount = OH_Pasteboard_GetChangeCount(pasteboard); - - // 10. 从剪贴板获取OH_UdmfData。 - int status = -1; - bool hasPermission = OH_AT_CheckSelfPermission("ohos.permission.READ_PASTEBOARD"); - if (!hasPermission) { - OH_LOG_ERROR(LOG_APP, "No Permission READ_PASTEBOARD"); - }; - OH_UdmfData* getData = OH_Pasteboard_GetData(pasteboard, &status); - if (getData == nullptr) { - // 处理错误情况,清理资源 - OH_LOG_ERROR(LOG_APP, "Failed to get data from pasteboard, status: %d\n", status); - } - - // 11. 获取OH_UdmfData中的所有OH_UdmfRecord。 - unsigned int recordCount = 0; - OH_UdmfRecord** getRecords = OH_UdmfData_GetRecords(getData, &recordCount); - OH_UdsPlainText* udsText = nullptr; - OH_UdsHtml* udsHtml = nullptr; - - // 12. 遍历OH_UdmfRecord。 - for (unsigned int recordIndex = 0; recordIndex < recordCount; ++recordIndex) { - OH_UdmfRecord* record = getRecords[recordIndex]; - ProcessRecord(record); - } - // [End pasteboard_timelapse_Record5] - // [Start pasteboard_timelapse_Record6] - // 15. 查询剪贴板内的数据是否变化。 - uint32_t newChangeCount = OH_Pasteboard_GetChangeCount(pasteboard); - // 16. 如果newChangeCount == changeCount通知剪贴板获取全量数据,需要等待SyncCallback回调完成再继续退出 - // [End pasteboard_timelapse_Record6] - // 17. 查询剪贴板内的数据是否变化。 - // [Start pasteboard_timelapse_Record7] - OH_UdsPlainText_Destroy(udsText); - OH_UdsHtml_Destroy(udsHtml); - OH_UdmfData_Destroy(getData); - OH_Pasteboard_Destroy(pasteboard); - // [End pasteboard_timelapse_Record7] -} - -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) -{ - napi_property_descriptor desc[] = { - { "pasteboard_test_set", nullptr, NAPI_Pasteboard_set, nullptr, nullptr, nullptr, napi_default, nullptr }, - { "pasteboard_test_get", nullptr, NAPI_Pasteboard_get, nullptr, nullptr, nullptr, napi_default, nullptr } - }; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "entry", - .nm_priv = ((void*)0), - .reserved = { 0 }, -}; - -extern "C" __attribute__((constructor)) void RegisterEntryModule(void) -{ - napi_module_register(&demoModule); -} diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/types/libentry/Index.d.ts b/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/types/libentry/Index.d.ts deleted file mode 100644 index 74c347bc383bd5d9c56eeaeb5c0552a0f3cf251e..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/types/libentry/Index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -export const pasteboard_test_set: (text: string) => void; -export const pasteboard_test_get: () => string; \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/types/libentry/oh-package.json5 b/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/types/libentry/oh-package.json5 deleted file mode 100644 index 6abf3b7c20f22c62aaac6a995a25cae672f73f35..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/cpp/types/libentry/oh-package.json5 +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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": "libentry.so", - "types": "./Index.d.ts", - "version": "1.0.0", - "description": "Please describe the basic information." -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/ets/entryability/EntryAbility.ets b/pasteboard/pasteboard_NDK_sample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 4222e3ab96c492f0f56d31a0382a4cf2ee8cfed7..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/pasteboard/pasteboard_NDK_sample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/ets/pages/Index.ets b/pasteboard/pasteboard_NDK_sample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 6e360653b7bff19cd3bb71186fd1b8d7a551a4c0..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2025 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 testNapi from 'libentry.so'; -import { BusinessError, pasteboard} from '@kit.BasicServicesKit'; -import { abilityAccessCtrl, common, Permissions } from '@kit.AbilityKit'; -import { preferences } from '@kit.ArkData'; - -const permissions: Permissions[] = ['ohos.permission.READ_PASTEBOARD']; -const systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); -const patterns: pasteboard.Pattern[] = [pasteboard.Pattern.URL, pasteboard.Pattern.EMAIL_ADDRESS]; -let dataPreferences: preferences.Preferences | null = null; - -async function isNeedGetPermissionFromUser(): Promise { - try { - let hasData: boolean = await systemPasteboard.hasData(); - if (!hasData) { - // 剪贴板不存在数据,无需申请权限 - return false; - } - // 获取剪贴板的内容变化次数 - let result : number = systemPasteboard.getChangeCount(); - console.info('Succeeded in getting the ChangeCount. Result: ${result}'); - // 从 Preferences 中读取上次保存的 changeCount - let storedChangeCount: number = dataPreferences ? Number(dataPreferences.getSync('pasteboardChangeCount', 0)) : 0; - if (result === storedChangeCount) { - // 剪贴板无数据变化,无需申请权限 - return false; - } - } catch (err) { - console.error('Failed to get the ChangeCount. Cause: ${err.message}'); - return false; - }; - - // 查询剪贴板是否存在应用所需数据类型 - try { - // (可选)涉及口令等应用自身特殊复制内容的,使用detectPatterns过滤口令格式 - let data: pasteboard.Pattern[] = await systemPasteboard.detectPatterns(patterns); - if (patterns.sort().join('') != data.sort().join('')) { - console.info('Not all needed patterns detected, no need to get data.'); - return false; - } - // (可选)判断是否有应用需要的数据类型 - let result: boolean = systemPasteboard.hasDataType(pasteboard.MIMETYPE_TEXT_PLAIN); - console.info('Succeeded in checking the DataType. Result: ${result}'); - if (!result) { - // 剪贴板不存在应用所需数据类型,无需申请权限 - return false; - } - } catch (err) { - console.error('Failed to check the DataType. Cause:' + err.message); - return false; - }; - return true; -} -@Entry -@Component -struct Index { - @State data: string = ''; - @State text: string = ''; - - build() { - Row() { - Column() { - Button('复制') - .fontSize(20) - .fontWeight(FontWeight.Normal) - .type(ButtonType.Capsule) - .margin({ top: 4, left: 4 }) - .width('210') - .height('30') - .backgroundColor('#f32dc400') - .onClick(() => { - let ret = testNapi.pasteboard_test_set(this.data); - }) - TextArea().width(300) - .onChange((value) => { - this.data = value; - }) - Button('粘贴') - .fontSize(20) - .fontWeight(FontWeight.Normal) - .type(ButtonType.Capsule) - .margin({ top: 4, left: 4 }) - .width('210') - .height('30') - .backgroundColor('#f32dc400') - .onClick(() => { - const context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; - if (!isNeedGetPermissionFromUser()) { - console.info("No neded to bring up the permission pop-up window"); - return; - } - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗。 - atManager.requestPermissionsFromUser(context, permissions).then((data) => { - let grantStatus: number[] = data.authResults; - for (const status of grantStatus) { - if (status === 0) { - // 用户授权,可以继续访问目标操作。 - this.text = testNapi.pasteboard_test_get(); - // 获取当前 ChangeCount - let currentChangeCount: number = systemPasteboard.getChangeCount(); - console.info('Current ChangeCount: ' + currentChangeCount); - // 更新 Preferences 中的 ChangeCount - if (dataPreferences) { - dataPreferences.putSync('pasteboardChangeCount', currentChangeCount); - dataPreferences.flushSync(); // 确保数据写入持久化存储 - console.info('ChangeCount has been updated to: ' + currentChangeCount); - } - } else { - // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限。 - return; - } - } - // 授权成功。 - }).catch((err: BusinessError) => { - console.error('Failed to request permissions from user. '); - }) - }) - Text(this.text){ - }.baselineOffset(5) - } - .width('100%') - } - .height('100%') - } -} diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/module.json5 b/pasteboard/pasteboard_NDK_sample/entry/src/main/module.json5 deleted file mode 100644 index 135e16c2dde7c3f4c26f047a1a7585393e51036b..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/module.json5 +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone" - ], - "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": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.READ_PASTEBOARD", - "reason": "$string:READ_PASTEBOARD_reason", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/element/color.json b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/element/float.json b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/element/string.json b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d0be93b363093a90bd88e57bc6d461a3d6af7a32..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "READ_PASTEBOARD_reason", - "value": "用户申请读取权限" - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/background.png b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/foreground.png b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/layered_image.json b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/startIcon.png b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/profile/backup_config.json b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/profile/main_pages.json b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/dark/element/color.json b/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/mock/Libentry.mock.ets b/pasteboard/pasteboard_NDK_sample/entry/src/mock/Libentry.mock.ets deleted file mode 100644 index eebf1ed910f6a8f2a9e7e565aa71b179b7b8b537..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/mock/Libentry.mock.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -const NativeMock: Record = { - 'add': (a: number, b: number) => { - return a + b; - }, -}; - -export default NativeMock; \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/mock/mock-config.json5 b/pasteboard/pasteboard_NDK_sample/entry/src/mock/mock-config.json5 deleted file mode 100644 index 2c7d2ba82b796a2850ced0a277d261d7d7355416..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -{ - "libentry.so": { - "source": "src/mock/Libentry.mock.ets" - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/ohosTest/ets/test/Ability.test.ets b/pasteboard/pasteboard_NDK_sample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/ohosTest/ets/test/List.test.ets b/pasteboard/pasteboard_NDK_sample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/ohosTest/module.json5 b/pasteboard/pasteboard_NDK_sample/entry/src/ohosTest/module.json5 deleted file mode 100644 index a43680ca704ea9bf17ba9b9f88086a2735012c37..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/test/List.test.ets b/pasteboard/pasteboard_NDK_sample/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/entry/src/test/LocalUnit.test.ets b/pasteboard/pasteboard_NDK_sample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/hvigor/hvigor-config.json5 b/pasteboard/pasteboard_NDK_sample/hvigor/hvigor-config.json5 deleted file mode 100644 index b8fea3f097bd68b0bc4d87de986d2cb7732c1d9b..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/pasteboard/pasteboard_NDK_sample/hvigorfile.ts b/pasteboard/pasteboard_NDK_sample/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/pasteboard/pasteboard_NDK_sample/oh-package.json5 b/pasteboard/pasteboard_NDK_sample/oh-package.json5 deleted file mode 100644 index 69cb43cba3addcee1840403c67405134a2a9102c..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/pasteboard/pasteboard_NDK_sample/ohosTest.md b/pasteboard/pasteboard_NDK_sample/ohosTest.md deleted file mode 100644 index 871d29ea0f39c907517b465f239f22dacc83f4f2..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_NDK_sample/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 测试用例归档 - -## 用例表 - -|测试功能|预置条件|输入|预期输出|是否自动|测试结果| -|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------| -|拉起应用| 设备正常运行| |成功拉起应用|是|Pass| -|申请权限| 第一次点击粘贴按钮| |弹出提示框|是|Pass| -|主页复制按钮点击| 文本框内输入文本| 文本框文本| 剪贴板写入数据|是|Pass| -|主页粘贴按钮点击| 已进行授权| 点已复制的文本| 展示剪贴板中读取的数据|是|Pass| diff --git a/pasteboard/pasteboard_NDK_sample/screenshots/UI.png b/pasteboard/pasteboard_NDK_sample/screenshots/UI.png deleted file mode 100644 index ef45a87f2d884fb4fabd8314bba59a0ac1409a95..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_NDK_sample/screenshots/UI.png and /dev/null differ diff --git a/pasteboard/pasteboard_arkts_sample/.gitignore b/pasteboard/pasteboard_arkts_sample/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/pasteboard/pasteboard_arkts_sample/AppScope/app.json5 b/pasteboard/pasteboard_arkts_sample/AppScope/app.json5 deleted file mode 100644 index 0410d95d6c267ff22d4e02ffba94e284934d466a..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/AppScope/app.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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.pasteboard_arkts_sample", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/element/string.json b/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/element/string.json deleted file mode 100644 index 15b7f339d2075c729863e825d8017d91bb513790..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "pasteboard_arkts_sample" - } - ] -} diff --git a/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/media/background.png b/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/media/foreground.png b/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/media/layered_image.json b/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/README.md b/pasteboard/pasteboard_arkts_sample/README.md deleted file mode 100644 index 91d27a0b33feb7ef785a31f92163ba0e95a35e82..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# 剪贴板指南Sample - -## 介绍 - - 本示例通过使用[剪贴板指南文档](https://gitcode.com/openharmony/docs/tree/master/zh-cn/application-dev/basic-services/pasteboard)中ArkTS场景的开发示例,展示开发步骤在工程中,帮助开发者更好地理解剪贴板模块代码合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [使用剪贴板进行复制粘贴](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/pasteboard/use_pasteboard_to_copy_and_paste.md)。 - -2. [使用剪贴板进行延迟复制粘贴](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/pasteboard/pasteboard-time-lapse-copy-and-paste.md)。 - -3. [申请访问剪贴板权限](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/pasteboard/get-pastedata-permission-guidelines.md)。 - -## 效果预览 - -| 主页 | -|-------| -| ![image](screenshots/UI.PNG) | - -### 使用说明 - -1. 在主界面,可以点击文本框进行输入。 - -2. 输入文本后点击复制按钮进行剪贴板数据写入。 - -3. 第一次点击粘贴时,会弹出授权请求对话框,用户授权后,粘贴的内容将在文本框显示。 - -## 工程目录 - -``` -entry/src/main - │── ets - │ ├── entryability - │ ├── entrybackupability - │ ├── pages - │ ├── Index.ets // UI页面 - │ ├── PasteboardModel.ets // 开发步骤示例代码 - ├── resources - │ └── module.json5 // 声明所需的权限 - -``` - -## 相关权限 - -1.使用[安全控件](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/pastebutton.md)访问剪贴板内容的应用。 - -2.申请ohos.permission.READ_PASTEBOARD允许应用访问剪贴板。 - -## 依赖 - -不涉及 - -## 约束与限制 - -1. 本示例支持标准系统上运行,支持设备:RK3568,Phone; - -2. 本示例支持API20版本SDK,版本号:6.0.0.49; - -3. 本示例需要使用DevEco Studio 5.1.1 Release(5.1.1.840)及以上版本才可编译运行。 - -4. 本示例涉及调用系统权限的接口,需要配置允许权限列表,可以参考[申请访问剪贴板权限](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/basic-services/pasteboard/get-pastedata-permission-guidelines.md)配置相关权限。 - -## 下载 - -如需单独下载本工程,执行如下命令: - - git init - git config core.sparsecheckout true - echo code/BasicFeature/DataManagement/pasteboard/ > .git/info/sparse-checkout - git remote add origin https://gitee.com/openharmony/applications_app_samples.git - git pull origin master diff --git a/pasteboard/pasteboard_arkts_sample/build-profile.json5 b/pasteboard/pasteboard_arkts_sample/build-profile.json5 deleted file mode 100644 index 8492b3d734d39bea26372c31042126cc81435f6d..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/build-profile.json5 +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2025 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", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/code-linter.json5 b/pasteboard/pasteboard_arkts_sample/code-linter.json5 deleted file mode 100644 index 516cf49a24a77673936a11ebf47b7f732f388fce..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/code-linter.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - - { - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/.gitignore b/pasteboard/pasteboard_arkts_sample/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/build-profile.json5 b/pasteboard/pasteboard_arkts_sample/entry/build-profile.json5 deleted file mode 100644 index 6bf0d132e6f78049e712446c63f2633b2d1613d3..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/build-profile.json5 +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/hvigorfile.ts b/pasteboard/pasteboard_arkts_sample/entry/hvigorfile.ts deleted file mode 100644 index cfa8a00f74f409d9647f55cdf270ab6aec69fe41..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/obfuscation-rules.txt b/pasteboard/pasteboard_arkts_sample/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/pasteboard/pasteboard_arkts_sample/entry/oh-package.json5 b/pasteboard/pasteboard_arkts_sample/entry/oh-package.json5 deleted file mode 100644 index c9cb6c8174858277c9b0d465a51547dcab16d5ff..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/entryability/EntryAbility.ets b/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 62f53acbc95e5be7985f8fb1fe2db591cea260bd..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 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, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 0a97e21bd7a15599af76a806695860ff1eb0ebfe..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 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'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/pages/Index.ets b/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 182269ed94f7c8ea7c8b5b8542ae9dcc564cced8..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2025 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 { TestJs } from './PasteboardModel'; -// [Start pasteboard_permission] -import { BusinessError, pasteboard} from '@kit.BasicServicesKit'; -import { abilityAccessCtrl, common, Permissions } from '@kit.AbilityKit'; -import { preferences } from '@kit.ArkData'; - - -const permissions: Permissions[] = ['ohos.permission.READ_PASTEBOARD']; -const systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); -const patterns: pasteboard.Pattern[] = [pasteboard.Pattern.URL, pasteboard.Pattern.EMAIL_ADDRESS]; -let dataPreferences: preferences.Preferences | null = null; -// [StartExclude pasteboard_permission] -const LOG_DOMAIN = 0x1C04; -const LOG_TAG = "PBDEMO" -// [EndExclude pasteboard_permission] -async function isNeedGetPermissionFromUser(): Promise { - try { - let hasData: boolean = await systemPasteboard.hasData(); - if (!hasData) { - // 剪贴板不存在数据,无需申请权限 - return false; - } - // 获取剪贴板的内容变化次数 - let result : number = systemPasteboard.getChangeCount(); - console.info('Succeeded in getting the ChangeCount. Result: ${result}'); - // 从 Preferences 中读取上次保存的 changeCount - let storedChangeCount: number = dataPreferences ? Number(dataPreferences.getSync('pasteboardChangeCount', 0)) : 0; - if (result === storedChangeCount) { - // 剪贴板无数据变化,无需申请权限 - return false; - } - } catch (err) { - console.error('Failed to get the ChangeCount. Cause: ${err.message}'); - return false; - }; - - // 查询剪贴板是否存在应用所需数据类型 - try { - // (可选)涉及口令等应用自身特殊复制内容的,使用detectPatterns过滤口令格式 - let data: pasteboard.Pattern[] = await systemPasteboard.detectPatterns(patterns); - if (patterns.sort().join('') != data.sort().join('')) { - console.info('Not all needed patterns detected, no need to get data.'); - return false; - } - // (可选)判断是否有应用需要的数据类型 - let result: boolean = systemPasteboard.hasDataType(pasteboard.MIMETYPE_TEXT_PLAIN); - console.info('Succeeded in checking the DataType. Result: ${result}'); - if (!result) { - // 剪贴板不存在应用所需数据类型,无需申请权限 - return false; - } - } catch (err) { - console.error('Failed to check the DataType. Cause:' + err.message); - return false; - }; - return true; -} - -// [StartExclude pasteboard_permission] -@Entry -@Component -struct Index { - @State data: string = ''; - @State text: string = ''; - controller: RichEditorController = new RichEditorController(); - options: RichEditorOptions = { controller: this.controller }; - scroller:Scroller = new Scroller(); - - printLog(content: string): void { - hilog.info(LOG_DOMAIN, LOG_TAG, content); - this.controller.addTextSpan(content); - this.scroller.scrollEdge(Edge.End); - } - - build() { - Row() { - Column() { - Button('复制') - .fontSize(20) - .fontWeight(FontWeight.Normal) - .type(ButtonType.Capsule) - .margin({ top: 4, left: 4 }) - .width('210') - .height('30') - .backgroundColor('#f32dc400') - .onClick(() => { - TestJs.setPlainData(this.data); - }) - TextArea().width(300) - .onChange((value) => { - this.data = value; - }) - Button('粘贴') - .fontSize(20) - .fontWeight(FontWeight.Normal) - .type(ButtonType.Capsule) - .margin({ top: 4, left: 4 }) - .width('210') - .height('30') - .backgroundColor('#f32dc400') - .onClick(() => { - // [EndExclude pasteboard_permission] - const context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; - if (!isNeedGetPermissionFromUser()) { - console.info('No neded to bring up the permission pop-up window'); - return; - } - let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); - // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗。 - atManager.requestPermissionsFromUser(context, permissions).then((data) => { - let grantStatus: number[] = data.authResults; - for (const status of grantStatus) { - if (status === 0) { - // 用户授权,可以继续访问目标操作。 - // [StartExclude pasteboard_permission] - TestJs.getPlainData(pasteboard.MIMETYPE_TEXT_PLAIN) - .then((ret) => { - this.text = ret; - }) - .catch(() => { - this.printLog('get failed.'); - }); - // [EndExclude pasteboard_permission] - // 获取当前 ChangeCount - let currentChangeCount: number = systemPasteboard.getChangeCount(); - console.info('Current ChangeCount: ' + currentChangeCount); - // 更新 Preferences 中的 ChangeCount - if (dataPreferences) { - dataPreferences.putSync('pasteboardChangeCount', currentChangeCount); - dataPreferences.flushSync(); // 确保数据写入持久化存储 - console.info('ChangeCount has been updated to: ' + currentChangeCount); - } - } else { - // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限。 - return; - } - } - // 授权成功。 - }).catch((err: BusinessError) => { - console.error('Failed to request permissions from user. '); - }) - // [End pasteboard_permission] - }) - Text(this.text){ - }.baselineOffset(5) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/pages/PasteboardModel.ets b/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/pages/PasteboardModel.ets deleted file mode 100644 index 65ad26ba2c1676e577db84dab4bc8136edd4e452..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/ets/pages/PasteboardModel.ets +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -// [Start pasteboard_timelaps_PasteData1] -// [Start pasteboard_usedata] -// [Start pasteboard_useudc] -import {BusinessError, pasteboard} from '@kit.BasicServicesKit'; -// [StartExclude pasteboard_usedata] -import {unifiedDataChannel, uniformDataStruct, uniformTypeDescriptor } from '@kit.ArkData'; -// [End pasteboard_timelaps_PasteData1] -// [StartExclude pasteboard_useudc] -// [EndExclude pasteboard_usedata] -const systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); -// [StartExclude pasteboard_usedata] -export namespace TestJs { - // 使用基础数据类型进行复制粘贴 - export async function setPlainData(content: string): Promise { - // [EndExclude pasteboard_usedata] - let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, content); - await systemPasteboard.setData(pasteData); - // [StartExclude pasteboard_usedata] - } - - export async function getPlainData(type: string): Promise { - // [EndExclude pasteboard_usedata] - //从系统剪贴板中读取数据 - let data = await systemPasteboard.getData(); - let recordCount = data.getRecordCount(); - let result = ''; - for (let i = 0; i < recordCount; i++) { - let record = data.getRecord(i).toPlainText(); - console.info('Get data success, record:' + record); - result = record; - } - // [End pasteboard_usedata] - return result; - } - - // 使用统一数据类型进行复制粘贴 - // [EndExclude pasteboard_useudc] - // 1.构造一条PlainText数据 - export async function handleUniformData () { - let plainText : uniformDataStruct.PlainText = { - uniformDataType: uniformTypeDescriptor.UniformDataType.PLAIN_TEXT, - textContent : 'PLAINTEXT_CONTENT', - abstract : 'PLAINTEXT_ABSTRACT', - } - - let record = new unifiedDataChannel.UnifiedRecord(uniformTypeDescriptor.UniformDataType.PLAIN_TEXT, plainText); - let data = new unifiedDataChannel.UnifiedData(); - data.addRecord(record); - // 2.向系统剪贴板中存入一条PlainText数据 - systemPasteboard.setUnifiedData(data).then((data: void) => { - console.info('Succeeded in setting UnifiedData.'); - // 存入成功,处理正常场景 - }).catch((err: BusinessError) => { - console.error('Failed to set UnifiedData. Cause: ' + err.message); - // 处理异常场景 - }); - // 3.从系统剪贴板中读取这条text数据 - systemPasteboard.getUnifiedData().then((data) => { - let records: unifiedDataChannel.UnifiedRecord[] = data.getRecords(); - for (let j = 0; j < records.length; j++) { - if (records[j].getType() === uniformTypeDescriptor.UniformDataType.PLAIN_TEXT) { - let text = records[j].getValue() as uniformDataStruct.PlainText; - console.info(`${j + 1}.${text.textContent}`); - } - } - }).catch((err: BusinessError) => { - console.error('Failed to get UnifiedData. Cause: ' + err.message); - // 处理异常场景 - }); - } - // [End pasteboard_useudc] - - // 使用基于PasteData级别的延迟复制粘贴(不建议使用,会影响粘贴体验和成功率) - export async function pasteDatatimelate () { - // [Start pasteboard_timelaps_PasteData2] - let plainTextData = new unifiedDataChannel.UnifiedData(); - let getDelayPlainText = ((dataType:string) => { - let plainText = new unifiedDataChannel.PlainText(); - plainText.details = { - Key: 'delayPlaintext', - Value: 'delayPlaintext', - }; - plainText.textContent = 'delayTextContent'; - plainText.abstract = 'delayTextContent'; - plainTextData.addRecord(plainText); - return plainTextData; - }); - // [End pasteboard_timelaps_PasteData2] - // [Start pasteboard_timelaps_PasteData3] - let setDelayPlainText = () => { - plainTextData.properties.shareOptions = unifiedDataChannel.ShareOptions.CROSS_APP; - // 跨应用使用时设置为CROSS_APP,本应用内使用时设置为IN_APP - plainTextData.properties.getDelayData = getDelayPlainText; - pasteboard.getSystemPasteboard().setUnifiedData(plainTextData).then(()=>{ - console.info('Succeeded in set PlainText.'); - // 存入成功,处理正常场景 - }).catch((error: BusinessError) => { - console.error('Failed to set PlainText. Cause: ' + error.message); - // 处理异常场景 - }); - } - // [End pasteboard_timelaps_PasteData3] - // [Start pasteboard_timelaps_PasteData4] - let getPlainTextUnifiedData = (() => { - pasteboard.getSystemPasteboard().getUnifiedData().then((data) => { - let outputData = data; - let records = outputData.getRecords(); - if (records[0].getType() == uniformTypeDescriptor.UniformDataType.PLAIN_TEXT) { - let record = records[0] as unifiedDataChannel.PlainText; - console.info('GetPlainText success, type:' + records[0].getType() ); - //注意:用户复制的数据内容属于敏感信息,禁止应用程序使用日志明文打印从剪贴板获取到的数据内容。 - } else { - console.info('Get Plain Text Data No Success, Type is: ' + records[0].getType()); - } - }).catch((error: BusinessError) => { - console.error('Failed to get PlainTextUnifiedData. Cause: ' + error.message); - //处理异常场景 - }) - }) - // [End pasteboard_timelaps_PasteData4] - // [Start pasteboard_timelaps_PasteData5] - try { - systemPasteboard.setAppShareOptions(pasteboard.ShareOption.LOCALDEVICE); - console.info('Set app share options success.'); - } catch (err) { - console.error('Failed to gSet app share options. Cause: ' + err.message); - //处理异常场景 - } - // [End pasteboard_timelaps_PasteData5] - // [Start pasteboard_timelaps_PasteData6] - try { - systemPasteboard.removeAppShareOptions(); - console.info('Remove app share options success.'); - } catch (err) { - console.error('Failed to Remove app share options. Cause: ' + err.message); - //处理异常场景 - } - // [End pasteboard_timelaps_PasteData6] - } -} diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/module.json5 b/pasteboard/pasteboard_arkts_sample/entry/src/main/module.json5 deleted file mode 100644 index 135e16c2dde7c3f4c26f047a1a7585393e51036b..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/module.json5 +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2025 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": [ - "phone" - ], - "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": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ], - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.READ_PASTEBOARD", - "reason": "$string:READ_PASTEBOARD_reason", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/element/color.json b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/element/float.json b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/element/string.json b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d0be93b363093a90bd88e57bc6d461a3d6af7a32..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "READ_PASTEBOARD_reason", - "value": "用户申请读取权限" - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/background.png b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/foreground.png b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/layered_image.json b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/startIcon.png b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/profile/backup_config.json b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/profile/main_pages.json b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/dark/element/color.json b/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/mock/mock-config.json5 b/pasteboard/pasteboard_arkts_sample/entry/src/mock/mock-config.json5 deleted file mode 100644 index b9a78e201535765168a92d3543c690273ecdc019..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 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/pasteboard/pasteboard_arkts_sample/entry/src/ohosTest/ets/test/Ability.test.ets b/pasteboard/pasteboard_arkts_sample/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/ohosTest/ets/test/List.test.ets b/pasteboard/pasteboard_arkts_sample/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 1eac52fcebe8958e19a7b8fed2e8f39c520a3e42..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/ohosTest/module.json5 b/pasteboard/pasteboard_arkts_sample/entry/src/ohosTest/module.json5 deleted file mode 100644 index a43680ca704ea9bf17ba9b9f88086a2735012c37..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 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_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/test/List.test.ets b/pasteboard/pasteboard_arkts_sample/entry/src/test/List.test.ets deleted file mode 100644 index f1186b1f53c3a70930921c5dbd1417332bec56c9..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 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 localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/entry/src/test/LocalUnit.test.ets b/pasteboard/pasteboard_arkts_sample/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 7fc57c77dbf76d8df08a2b802a55b948e3fcf968..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2025 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/hvigor/hvigor-config.json5 b/pasteboard/pasteboard_arkts_sample/hvigor/hvigor-config.json5 deleted file mode 100644 index b8fea3f097bd68b0bc4d87de986d2cb7732c1d9b..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/pasteboard/pasteboard_arkts_sample/hvigorfile.ts b/pasteboard/pasteboard_arkts_sample/hvigorfile.ts deleted file mode 100644 index e3340f07e45ddc5dcadbb87012668555def2e6e0..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/hvigorfile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 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. */ -} \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/oh-package.json5 b/pasteboard/pasteboard_arkts_sample/oh-package.json5 deleted file mode 100644 index 69cb43cba3addcee1840403c67405134a2a9102c..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/oh-package.json5 +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/pasteboard/pasteboard_arkts_sample/ohosTest.md b/pasteboard/pasteboard_arkts_sample/ohosTest.md deleted file mode 100644 index d7b3982cbc361df725495446ffe22e5235bba276..0000000000000000000000000000000000000000 --- a/pasteboard/pasteboard_arkts_sample/ohosTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# 测试用例归档 - -## 用例表 - -|测试功能|预置条件|输入|预期输出|是否自动|测试结果| -|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------| -|拉起应用| 设备正常运行| |成功拉起应用|是|Pass| -|申请权限| 第一次点击粘贴按钮| |弹出提示框|是|Pass| -|主页复制按钮点击| 文本框内输入文本| 文本框文本| 剪贴板写入数据|是|Pass| -|主页粘贴按钮点击| 已进行授权| 点已复制的文本| 展示剪贴板中读取的数据|是|Pass| \ No newline at end of file diff --git a/pasteboard/pasteboard_arkts_sample/screenshots/UI.png b/pasteboard/pasteboard_arkts_sample/screenshots/UI.png deleted file mode 100644 index ef45a87f2d884fb4fabd8314bba59a0ac1409a95..0000000000000000000000000000000000000000 Binary files a/pasteboard/pasteboard_arkts_sample/screenshots/UI.png and /dev/null differ diff --git a/xperf/app_start/.gitignore b/xperf/app_start/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/xperf/app_start/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/xperf/app_start/AppScope/app.json5 b/xperf/app_start/AppScope/app.json5 deleted file mode 100644 index 3c5636c5dfe069e46e47639a4be98bc6c688f1f2..0000000000000000000000000000000000000000 --- a/xperf/app_start/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.example.app_start", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/xperf/app_start/AppScope/resources/base/element/string.json b/xperf/app_start/AppScope/resources/base/element/string.json deleted file mode 100644 index 5a32c3d843b216c302fc4f966695b2b072f74768..0000000000000000000000000000000000000000 --- a/xperf/app_start/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "app_start" - } - ] -} diff --git a/xperf/app_start/AppScope/resources/base/media/background.png b/xperf/app_start/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/xperf/app_start/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/xperf/app_start/AppScope/resources/base/media/foreground.png b/xperf/app_start/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/xperf/app_start/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/xperf/app_start/AppScope/resources/base/media/layered_image.json b/xperf/app_start/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/xperf/app_start/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/xperf/app_start/build-profile.json5 b/xperf/app_start/build-profile.json5 deleted file mode 100644 index c4e8cef12735e3a7929c1740117603c46528ebe4..0000000000000000000000000000000000000000 --- a/xperf/app_start/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/xperf/app_start/code-linter.json5 b/xperf/app_start/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/xperf/app_start/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/xperf/app_start/entry/.gitignore b/xperf/app_start/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/xperf/app_start/entry/build-profile.json5 b/xperf/app_start/entry/build-profile.json5 deleted file mode 100644 index 6bd6457a2fed846cc10698666fa1268219f1bee1..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/build-profile.json5 +++ /dev/null @@ -1,33 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/xperf/app_start/entry/hvigorfile.ts b/xperf/app_start/entry/hvigorfile.ts deleted file mode 100644 index b0e3a1ab98a91bc918d6404b2413111a5011f14a..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/xperf/app_start/entry/obfuscation-rules.txt b/xperf/app_start/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/xperf/app_start/entry/oh-package.json5 b/xperf/app_start/entry/oh-package.json5 deleted file mode 100644 index 248c3b7541a589682a250f86a6d3ecf7414d2d6a..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/xperf/app_start/entry/src/main/ets/entryability/EntryAbility.ets b/xperf/app_start/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 7e929160b07f297673cfd2e83903955f1ff8907c..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,74 +0,0 @@ -import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { window } from '@kit.ArkUI'; -// [Start hiAppEvent_appStart] -import { hiAppEvent, hilog } from '@kit.PerformanceAnalysisKit'; - -hiAppEvent.addWatcher({ - // 开发者可以自定义观察者名称,系统会使用名称来标识不同的观察者 - name: "watcher", - // 开发者可以订阅感兴趣的系统事件,此处是订阅了启动耗时事件 - appEventFilters: [ - { - domain: hiAppEvent.domain.OS, - names: [hiAppEvent.event.APP_LAUNCH] - } - ], - // 开发者可以自行实现订阅回调函数,以便对订阅获取到的事件数据进行自定义处理 - onReceive: (domain: string, appEventGroups: Array) => { - hilog.info(0x0000, 'testTag', `HiAppEvent onReceive: domain=${domain}`); - for (const eventGroup of appEventGroups) { - // 开发者可以根据事件集合中的事件名称区分不同的系统事件 - hilog.info(0x0000, 'testTag', `HiAppEvent eventName=${eventGroup.name}`); - for (const eventInfo of eventGroup.appEventInfos) { - // 开发者可以对事件集合中的事件数据进行自定义处理,此处是将事件数据打印在日志中 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo=${JSON.stringify(eventInfo)}`); - } - } - } -}); -// [End hiAppEvent_appStart] - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/xperf/app_start/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 8e4de99282050bad799ac892eb85ac5449364a51..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,16 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/main/ets/pages/Index.ets b/xperf/app_start/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 8e2d24ad42693fc877d51bb7820f0a9da68fa135..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,23 +0,0 @@ -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - RelativeContainer() { - Text(this.message) - .id('HelloWorld') - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .alignRules({ - center: { anchor: '__container__', align: VerticalAlign.Center }, - middle: { anchor: '__container__', align: HorizontalAlign.Center } - }) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/main/module.json5 b/xperf/app_start/entry/src/main/module.json5 deleted file mode 100644 index 53024e8f020cc0824592631ba6924108c8028f0f..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/module.json5 +++ /dev/null @@ -1,50 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "phone" - ], - "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": [ - "ohos.want.action.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/xperf/app_start/entry/src/main/resources/base/element/color.json b/xperf/app_start/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/main/resources/base/element/float.json b/xperf/app_start/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/xperf/app_start/entry/src/main/resources/base/element/string.json b/xperf/app_start/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/main/resources/base/media/background.png b/xperf/app_start/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/xperf/app_start/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/xperf/app_start/entry/src/main/resources/base/media/foreground.png b/xperf/app_start/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/xperf/app_start/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/xperf/app_start/entry/src/main/resources/base/media/layered_image.json b/xperf/app_start/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/main/resources/base/media/startIcon.png b/xperf/app_start/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/xperf/app_start/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/xperf/app_start/entry/src/main/resources/base/profile/backup_config.json b/xperf/app_start/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/main/resources/base/profile/main_pages.json b/xperf/app_start/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/xperf/app_start/entry/src/main/resources/dark/element/color.json b/xperf/app_start/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/mock/mock-config.json5 b/xperf/app_start/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41bfdf76d6f793007240d80983a52f15f97..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/ohosTest/ets/test/Ability.test.ets b/xperf/app_start/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f67579d6e31b5f5aeea463e216b9b141048..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/ohosTest/ets/test/List.test.ets b/xperf/app_start/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/ohosTest/module.json5 b/xperf/app_start/entry/src/ohosTest/module.json5 deleted file mode 100644 index 509a3a28a3e6be8d7f98cc563fa8195657d77d1d..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/xperf/app_start/entry/src/test/List.test.ets b/xperf/app_start/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/xperf/app_start/entry/src/test/LocalUnit.test.ets b/xperf/app_start/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/xperf/app_start/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/xperf/app_start/hvigor/hvigor-config.json5 b/xperf/app_start/hvigor/hvigor-config.json5 deleted file mode 100644 index 7a7ab8914d8db6ab89758e185df5855dffe88d04..0000000000000000000000000000000000000000 --- a/xperf/app_start/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/xperf/app_start/hvigorfile.ts b/xperf/app_start/hvigorfile.ts deleted file mode 100644 index 47113e2e36ecefde41c136272a0bd6ff745cffe4..0000000000000000000000000000000000000000 --- a/xperf/app_start/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/xperf/app_start/oh-package-lock.json5 b/xperf/app_start/oh-package-lock.json5 deleted file mode 100644 index 6b264af261c4152dee3641068ee2fff156299e4b..0000000000000000000000000000000000000000 --- a/xperf/app_start/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.24": "@ohos/hypium@1.0.24" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.24": { - "name": "", - "version": "1.0.24", - "integrity": "sha512-3dCqc+BAR5LqEGG2Vtzi8O3r7ci/3fYU+FWjwvUobbfko7DUnXGOccaror0yYuUhJfXzFK0aZNMGSnXaTwEnbw==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.24.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/xperf/app_start/oh-package.json5 b/xperf/app_start/oh-package.json5 deleted file mode 100644 index c72aa05d549507e5ea6ce0bc0a8080c450508c7d..0000000000000000000000000000000000000000 --- a/xperf/app_start/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "modelVersion": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -} diff --git a/xperf/scroll_jank/.gitignore b/xperf/scroll_jank/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/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/xperf/scroll_jank/AppScope/app.json5 b/xperf/scroll_jank/AppScope/app.json5 deleted file mode 100644 index 7413e1dba67862ffcd9648993a917d2dff48f19d..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/AppScope/app.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "app": { - "bundleName": "com.example.scroll_jank", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name" - } -} diff --git a/xperf/scroll_jank/AppScope/resources/base/element/string.json b/xperf/scroll_jank/AppScope/resources/base/element/string.json deleted file mode 100644 index 88041c331670c425d03958bdce1d47f84de5f27b..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "scroll_jank" - } - ] -} diff --git a/xperf/scroll_jank/AppScope/resources/base/media/background.png b/xperf/scroll_jank/AppScope/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/xperf/scroll_jank/AppScope/resources/base/media/background.png and /dev/null differ diff --git a/xperf/scroll_jank/AppScope/resources/base/media/foreground.png b/xperf/scroll_jank/AppScope/resources/base/media/foreground.png deleted file mode 100644 index eb9427585b36d14b12477435b6419d1f07b3e0bb..0000000000000000000000000000000000000000 Binary files a/xperf/scroll_jank/AppScope/resources/base/media/foreground.png and /dev/null differ diff --git a/xperf/scroll_jank/AppScope/resources/base/media/layered_image.json b/xperf/scroll_jank/AppScope/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/AppScope/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/xperf/scroll_jank/build-profile.json5 b/xperf/scroll_jank/build-profile.json5 deleted file mode 100644 index c4e8cef12735e3a7929c1740117603c46528ebe4..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/xperf/scroll_jank/code-linter.json5 b/xperf/scroll_jank/code-linter.json5 deleted file mode 100644 index 073990fa45394e1f8e85d85418ee60a8953f9b99..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/code-linter.json5 +++ /dev/null @@ -1,32 +0,0 @@ -{ - "files": [ - "**/*.ets" - ], - "ignore": [ - "**/src/ohosTest/**/*", - "**/src/test/**/*", - "**/src/mock/**/*", - "**/node_modules/**/*", - "**/oh_modules/**/*", - "**/build/**/*", - "**/.preview/**/*" - ], - "ruleSet": [ - "plugin:@performance/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@security/no-unsafe-aes": "error", - "@security/no-unsafe-hash": "error", - "@security/no-unsafe-mac": "warn", - "@security/no-unsafe-dh": "error", - "@security/no-unsafe-dsa": "error", - "@security/no-unsafe-ecdsa": "error", - "@security/no-unsafe-rsa-encrypt": "error", - "@security/no-unsafe-rsa-sign": "error", - "@security/no-unsafe-rsa-key": "error", - "@security/no-unsafe-dsa-key": "error", - "@security/no-unsafe-dh-key": "error", - "@security/no-unsafe-3des": "error" - } -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/.gitignore b/xperf/scroll_jank/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/xperf/scroll_jank/entry/build-profile.json5 b/xperf/scroll_jank/entry/build-profile.json5 deleted file mode 100644 index 6bd6457a2fed846cc10698666fa1268219f1bee1..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/build-profile.json5 +++ /dev/null @@ -1,33 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - "resOptions": { - "copyCodeResource": { - "enable": false - } - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/hvigorfile.ts b/xperf/scroll_jank/entry/hvigorfile.ts deleted file mode 100644 index b0e3a1ab98a91bc918d6404b2413111a5011f14a..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/obfuscation-rules.txt b/xperf/scroll_jank/entry/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# 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/xperf/scroll_jank/entry/oh-package.json5 b/xperf/scroll_jank/entry/oh-package.json5 deleted file mode 100644 index 248c3b7541a589682a250f86a6d3ecf7414d2d6a..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/xperf/scroll_jank/entry/src/main/ets/entryability/EntryAbility.ets b/xperf/scroll_jank/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 4ea415521b5cd77102200bf840c81921ba854e27..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,74 +0,0 @@ -import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { window } from '@kit.ArkUI'; -// [Start hiAppEvent_scrollJank] -import { hiAppEvent, hilog } from '@kit.PerformanceAnalysisKit'; - -hiAppEvent.addWatcher({ - // 开发者可以自定义观察者名称,系统会使用名称来标识不同的观察者 - name: "watcher", - // 开发者可以订阅感兴趣的系统事件,此处是订阅了滑动丢帧事件 - appEventFilters: [ - { - domain: hiAppEvent.domain.OS, - names: [hiAppEvent.event.SCROLL_JANK] - } - ], - // 开发者可以自行实现订阅回调函数,以便对订阅获取到的事件数据进行自定义处理 - onReceive: (domain: string, appEventGroups: Array) => { - hilog.info(0x0000, 'testTag', `HiAppEvent onReceive: domain=${domain}`); - for (const eventGroup of appEventGroups) { - // 开发者可以根据事件集合中的事件名称区分不同的系统事件 - hilog.info(0x0000, 'testTag', `HiAppEvent eventName=${eventGroup.name}`); - for (const eventInfo of eventGroup.appEventInfos) { - // 开发者可以对事件集合中的事件数据进行自定义处理,此处是将事件数据打印在日志中 - hilog.info(0x0000, 'testTag', `HiAppEvent eventInfo=${JSON.stringify(eventInfo)}`); - } - } - } -}); -// [End hiAppEvent_scrollJank] - -const DOMAIN = 0x0000; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/xperf/scroll_jank/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets deleted file mode 100644 index 8e4de99282050bad799ac892eb85ac5449364a51..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ /dev/null @@ -1,16 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; - -const DOMAIN = 0x0000; - -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/main/ets/pages/Index.ets b/xperf/scroll_jank/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 60aed72b482b37ef359d2cd206064a26a4c2e18e..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,30 +0,0 @@ -@Entry -@Component -// [Start hiAppEvent_scrollJank_case] -struct Index { - private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23] - build() { - List({ space: 10 }) { - ForEach(this.arr, (item: number) => { - ListItem() { - Text(`${item}`) - .width('100%') - .height(100) - .fontSize(20) - .fontColor(Color.White) - .textAlign(TextAlign.Center) - .borderRadius(10) - .backgroundColor(0x007DFF) - } - }) - } - .onScrollIndex((firstIndex: number) => { - let i = 1; - while (i<20000) { // 在列表滑动事件中做一些耗时操作 - console.log("do something"); - i++; - } - }) - } -} -// [End hiAppEvent_scrollJank_case] \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/main/module.json5 b/xperf/scroll_jank/entry/src/main/module.json5 deleted file mode 100644 index 53024e8f020cc0824592631ba6924108c8028f0f..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/module.json5 +++ /dev/null @@ -1,50 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "phone" - ], - "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": [ - "ohos.want.action.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/xperf/scroll_jank/entry/src/main/resources/base/element/color.json b/xperf/scroll_jank/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/main/resources/base/element/float.json b/xperf/scroll_jank/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/xperf/scroll_jank/entry/src/main/resources/base/element/string.json b/xperf/scroll_jank/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/main/resources/base/media/background.png b/xperf/scroll_jank/entry/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/xperf/scroll_jank/entry/src/main/resources/base/media/background.png and /dev/null differ diff --git a/xperf/scroll_jank/entry/src/main/resources/base/media/foreground.png b/xperf/scroll_jank/entry/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/xperf/scroll_jank/entry/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/xperf/scroll_jank/entry/src/main/resources/base/media/layered_image.json b/xperf/scroll_jank/entry/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/resources/base/media/layered_image.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "layered-image": - { - "background" : "$media:background", - "foreground" : "$media:foreground" - } -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/main/resources/base/media/startIcon.png b/xperf/scroll_jank/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/xperf/scroll_jank/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/xperf/scroll_jank/entry/src/main/resources/base/profile/backup_config.json b/xperf/scroll_jank/entry/src/main/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/main/resources/base/profile/main_pages.json b/xperf/scroll_jank/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/xperf/scroll_jank/entry/src/main/resources/dark/element/color.json b/xperf/scroll_jank/entry/src/main/resources/dark/element/color.json deleted file mode 100644 index 79b11c2747aec33e710fd3a7b2b3c94dd9965499..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/main/resources/dark/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#000000" - } - ] -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/mock/mock-config.json5 b/xperf/scroll_jank/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41bfdf76d6f793007240d80983a52f15f97..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/ohosTest/ets/test/Ability.test.ets b/xperf/scroll_jank/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f67579d6e31b5f5aeea463e216b9b141048..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/ohosTest/ets/test/List.test.ets b/xperf/scroll_jank/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/ohosTest/module.json5 b/xperf/scroll_jank/entry/src/ohosTest/module.json5 deleted file mode 100644 index 509a3a28a3e6be8d7f98cc563fa8195657d77d1d..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/xperf/scroll_jank/entry/src/test/List.test.ets b/xperf/scroll_jank/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/xperf/scroll_jank/entry/src/test/LocalUnit.test.ets b/xperf/scroll_jank/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/xperf/scroll_jank/hvigor/hvigor-config.json5 b/xperf/scroll_jank/hvigor/hvigor-config.json5 deleted file mode 100644 index 7a7ab8914d8db6ab89758e185df5855dffe88d04..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "modelVersion": "6.0.0", - "dependencies": { - }, - "execution": { - // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | 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 */ - // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */ - }, - "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/xperf/scroll_jank/hvigorfile.ts b/xperf/scroll_jank/hvigorfile.ts deleted file mode 100644 index 47113e2e36ecefde41c136272a0bd6ff745cffe4..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -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. */ -} \ No newline at end of file diff --git a/xperf/scroll_jank/oh-package-lock.json5 b/xperf/scroll_jank/oh-package-lock.json5 deleted file mode 100644 index 6b264af261c4152dee3641068ee2fff156299e4b..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/oh-package-lock.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "meta": { - "stableOrder": true, - "enableUnifiedLockfile": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.24": "@ohos/hypium@1.0.24" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.24": { - "name": "", - "version": "1.0.24", - "integrity": "sha512-3dCqc+BAR5LqEGG2Vtzi8O3r7ci/3fYU+FWjwvUobbfko7DUnXGOccaror0yYuUhJfXzFK0aZNMGSnXaTwEnbw==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.24.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/xperf/scroll_jank/oh-package.json5 b/xperf/scroll_jank/oh-package.json5 deleted file mode 100644 index c72aa05d549507e5ea6ce0bc0a8080c450508c7d..0000000000000000000000000000000000000000 --- a/xperf/scroll_jank/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "modelVersion": "6.0.0", - "description": "Please describe the basic information.", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.24", - "@ohos/hamock": "1.0.0" - } -}