diff --git a/Privacy/ContactData/.gitignore b/Privacy/ContactData/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/Privacy/ContactData/build-profile.json5 b/Privacy/ContactData/build-profile.json5 deleted file mode 100644 index 4d611879c7913fb0610c686e2399258ab3a6dad1..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/build-profile.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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/Privacy/ContactData/hvigorfile.ts b/Privacy/ContactData/hvigorfile.ts deleted file mode 100644 index c6edcd90486dd5a853cf7d34c8647f08414ca7a3..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/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/Privacy/ContactData/obfuscation-rules.txt b/Privacy/ContactData/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/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/Privacy/ContactData/oh-package.json5 b/Privacy/ContactData/oh-package.json5 deleted file mode 100644 index 979c6e016dba34ac67fdf9d87044d79a125662f0..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "contactdata", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/Privacy/ContactData/src/main/ets/contactdataability/ContactDataAbility.ets b/Privacy/ContactData/src/main/ets/contactdataability/ContactDataAbility.ets deleted file mode 100644 index 253c44e3f38f4a3c53f30fa6582ca770c113f049..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/src/main/ets/contactdataability/ContactDataAbility.ets +++ /dev/null @@ -1,43 +0,0 @@ -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class ContactDataAbility 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/Privacy/ContactData/src/main/ets/pages/Index.ets b/Privacy/ContactData/src/main/ets/pages/Index.ets deleted file mode 100644 index 8e2d24ad42693fc877d51bb7820f0a9da68fa135..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/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/Privacy/ContactData/src/main/module.json5 b/Privacy/ContactData/src/main/module.json5 deleted file mode 100644 index 39009717a3c11b988804f497f7b11204e466f96e..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/src/main/module.json5 +++ /dev/null @@ -1,35 +0,0 @@ -{ - "module": { - "name": "ContactData", - "type": "feature", - "description": "$string:module_desc", - "mainElement": "ContactDataAbility", - "deviceTypes": [ - "phone", - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - /** - * 最佳实践:应用安全编码实践 - * 场景四:对外交互的应用组件应设置合理的访问权限 - */ - // [Start module_json_permissions] - "name": "ContactDataAbility", - "srcEntry": "./ets/contactdataability/ContactDataAbility.ets", - "description": "$string:ContactDataAbility_desc", - "exported": true, - "permissions": ["ohos.permission.READ_CONTACTS"], - // [End module_json_permissions] - "icon": "$media:layered_image", - "label": "$string:ContactDataAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - } - ] - } -} \ No newline at end of file diff --git a/Privacy/ContactData/src/main/resources/base/element/color.json b/Privacy/ContactData/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/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/Privacy/ContactData/src/main/resources/base/element/float.json b/Privacy/ContactData/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/Privacy/ContactData/src/main/resources/base/element/string.json b/Privacy/ContactData/src/main/resources/base/element/string.json deleted file mode 100644 index 4346de3a1d7bd7dd8cfcaa20f5b584e0663e0dac..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "ContactDataAbility_desc", - "value": "description" - }, - { - "name": "ContactDataAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/Privacy/ContactData/src/main/resources/base/media/background.png b/Privacy/ContactData/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/Privacy/ContactData/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Privacy/ContactData/src/main/resources/base/media/foreground.png b/Privacy/ContactData/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/Privacy/ContactData/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Privacy/ContactData/src/main/resources/base/media/layered_image.json b/Privacy/ContactData/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/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/Privacy/ContactData/src/main/resources/base/media/startIcon.png b/Privacy/ContactData/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Privacy/ContactData/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Privacy/ContactData/src/main/resources/base/profile/main_pages.json b/Privacy/ContactData/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/Privacy/ContactData/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/Privacy/ContactDataError/.gitignore b/Privacy/ContactDataError/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/Privacy/ContactDataError/build-profile.json5 b/Privacy/ContactDataError/build-profile.json5 deleted file mode 100644 index 4d611879c7913fb0610c686e2399258ab3a6dad1..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/build-profile.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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/Privacy/ContactDataError/hvigorfile.ts b/Privacy/ContactDataError/hvigorfile.ts deleted file mode 100644 index c6edcd90486dd5a853cf7d34c8647f08414ca7a3..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/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/Privacy/ContactDataError/obfuscation-rules.txt b/Privacy/ContactDataError/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/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/Privacy/ContactDataError/oh-package.json5 b/Privacy/ContactDataError/oh-package.json5 deleted file mode 100644 index e055afe7d83a42594fe3dd82c7423293106bfc54..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "contactdataerror", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/Privacy/ContactDataError/src/main/ets/contactdataerrorability/ContactDataErrorAbility.ets b/Privacy/ContactDataError/src/main/ets/contactdataerrorability/ContactDataErrorAbility.ets deleted file mode 100644 index fdfd61a6e0c521dfb8990ffdb5dd53a09a0046e4..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/src/main/ets/contactdataerrorability/ContactDataErrorAbility.ets +++ /dev/null @@ -1,43 +0,0 @@ -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -const DOMAIN = 0x0000; - -export default class ContactDataErrorAbility 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/Privacy/ContactDataError/src/main/ets/pages/Index.ets b/Privacy/ContactDataError/src/main/ets/pages/Index.ets deleted file mode 100644 index 8e2d24ad42693fc877d51bb7820f0a9da68fa135..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/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/Privacy/ContactDataError/src/main/module.json5 b/Privacy/ContactDataError/src/main/module.json5 deleted file mode 100644 index 12823797c41e1862e440f3e6faa932c08e9472ed..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/src/main/module.json5 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "module": { - "name": "ContactDataError", - "type": "feature", - "description": "$string:module_desc", - "mainElement": "ContactDataErrorAbility", - "deviceTypes": [ - "phone", - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - /** - * 最佳实践:应用安全编码实践 - * 场景三:对外交互的应用组件应设置合理的访问权限错误示例 - */ - // [Start module_json_permissions_error] - "name": "ContactDataErrorAbility", - "srcEntry": "./ets/contactdataerrorability/ContactDataErrorAbility.ets", - "description": "$string:ContactDataErrorAbility_desc", - "exported": true, - // [End module_json_permissions_error] - "icon": "$media:layered_image", - "label": "$string:ContactDataErrorAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - } - ] - } -} \ No newline at end of file diff --git a/Privacy/ContactDataError/src/main/resources/base/element/color.json b/Privacy/ContactDataError/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/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/Privacy/ContactDataError/src/main/resources/base/element/float.json b/Privacy/ContactDataError/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea22304f9b1485b5f22d811023701b5d4e35b6..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/Privacy/ContactDataError/src/main/resources/base/element/string.json b/Privacy/ContactDataError/src/main/resources/base/element/string.json deleted file mode 100644 index 879ebe3f5a778f5a7b2e5e7c62bcfaf3bca0e899..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "ContactDataErrorAbility_desc", - "value": "description" - }, - { - "name": "ContactDataErrorAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/Privacy/ContactDataError/src/main/resources/base/media/background.png b/Privacy/ContactDataError/src/main/resources/base/media/background.png deleted file mode 100644 index 923f2b3f27e915d6871871deea0420eb45ce102f..0000000000000000000000000000000000000000 Binary files a/Privacy/ContactDataError/src/main/resources/base/media/background.png and /dev/null differ diff --git a/Privacy/ContactDataError/src/main/resources/base/media/foreground.png b/Privacy/ContactDataError/src/main/resources/base/media/foreground.png deleted file mode 100644 index 97014d3e10e5ff511409c378cd4255713aecd85f..0000000000000000000000000000000000000000 Binary files a/Privacy/ContactDataError/src/main/resources/base/media/foreground.png and /dev/null differ diff --git a/Privacy/ContactDataError/src/main/resources/base/media/layered_image.json b/Privacy/ContactDataError/src/main/resources/base/media/layered_image.json deleted file mode 100644 index fb49920440fb4d246c82f9ada275e26123a2136a..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/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/Privacy/ContactDataError/src/main/resources/base/media/startIcon.png b/Privacy/ContactDataError/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b..0000000000000000000000000000000000000000 Binary files a/Privacy/ContactDataError/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/Privacy/ContactDataError/src/main/resources/base/profile/main_pages.json b/Privacy/ContactDataError/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/Privacy/ContactDataError/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/Privacy/PrivacyError/src/main/ets/pages/GeolocationAccess.ets b/Privacy/PrivacyError/src/main/ets/pages/GeolocationAccess.ets index fda0854bdccb6d392ba47353361937159e8bf594..fa17bcfa7d058289291026034a39e553d24ea1f8 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/GeolocationAccess.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/GeolocationAccess.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景二十一:避免在用户同意前返回位置信息错误示例 diff --git a/Privacy/PrivacyError/src/main/ets/pages/Index.ets b/Privacy/PrivacyError/src/main/ets/pages/Index.ets index 8e2d24ad42693fc877d51bb7820f0a9da68fa135..0f481f696485b8c840d49ad9e7d7dff7f6b71241 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/Index.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/Index.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 { diff --git a/Privacy/PrivacyError/src/main/ets/pages/JavaScriptProxy.ets b/Privacy/PrivacyError/src/main/ets/pages/JavaScriptProxy.ets index ccc14631368b2b12413c96afbb03943fb352ab61..8c45163dbab04e928e98da8c7e8fd605c441c3d6 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/JavaScriptProxy.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/JavaScriptProxy.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景二十二:避免注册返回含有全局认证凭据的JavaScriptProxy diff --git a/Privacy/PrivacyError/src/main/ets/pages/MixedMode.ets b/Privacy/PrivacyError/src/main/ets/pages/MixedMode.ets index 12837bc589aed422c00a9e237a03a1d9b0ac438b..2ff5100cbbaf002645ebaa345f58e6f551638e7d 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/MixedMode.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/MixedMode.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景十七:避免将mixedMode属性配置成All diff --git a/Privacy/PrivacyError/src/main/ets/pages/NoInfoJumpTo.ets b/Privacy/PrivacyError/src/main/ets/pages/NoInfoJumpTo.ets index dcf626e361a7b0f2b4abe1df388fe32334190c3c..6f972a4aa8199a0bae50929c1b84d5325639b74b 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/NoInfoJumpTo.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/NoInfoJumpTo.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景五:建议隐式启动应用组件时避免携带个人数据错误示例 diff --git a/Privacy/PrivacyError/src/main/ets/pages/OnSslErrorEventReceive.ets b/Privacy/PrivacyError/src/main/ets/pages/OnSslErrorEventReceive.ets index 5fbfe7fa9cfae31683e9150a9ba7d63d3e301cb1..d7693da5427f2e533adb3f9407feb3e1a45f35a1 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/OnSslErrorEventReceive.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/OnSslErrorEventReceive.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景十九:避免在SSL校验出错时继续加载页面错误示例 diff --git a/Privacy/PrivacyError/src/main/ets/pages/PublicSafeInfo.ets b/Privacy/PrivacyError/src/main/ets/pages/PublicSafeInfo.ets index c6e44b98f0dd1b9704fd174bdf2ac9954ed5f44f..6cb95957cc1a3835d5ad4a9eaf997b447c63ab5b 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/PublicSafeInfo.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/PublicSafeInfo.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景八:避免使用携带个人数据未设置权限的动态公共事件错误示例 diff --git a/Privacy/PrivacyError/src/main/ets/pages/PublicSensitive.ets b/Privacy/PrivacyError/src/main/ets/pages/PublicSensitive.ets index 0edd5b4a50dd843000b3fa2576dfe9f6409a43c3..22761a20cf0f785634fd8c749d37d37ae27728a4 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/PublicSensitive.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/PublicSensitive.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景十:建议对涉及敏感功能的公共事件进行访问权限控制错误示例 diff --git a/Privacy/PrivacyError/src/main/ets/pages/RunJavaScriptTrustList.ets b/Privacy/PrivacyError/src/main/ets/pages/RunJavaScriptTrustList.ets index 1e96d7322dbd349354e6a6995a6defa3466e42a2..9843d243431ae3e8d1b369f678479c7503bc5c13 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/RunJavaScriptTrustList.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/RunJavaScriptTrustList.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景十六:避免加载不可信的JavaScript脚本—加载前进行白名单校验错误示例 diff --git a/Privacy/PrivacyError/src/main/ets/pages/UntrustedDataToSQL.ets b/Privacy/PrivacyError/src/main/ets/pages/UntrustedDataToSQL.ets index 3fa2db3aa4ca77994a40bfb1103b1b30117a27de..8bdb73e5f15b1064a5516c83f9bc6bbfd5ea656a 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/UntrustedDataToSQL.ets +++ b/Privacy/PrivacyError/src/main/ets/pages/UntrustedDataToSQL.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景二十八:避免直接使用不可信数据来拼接SQL语句 diff --git a/Privacy/PrivacyError/src/main/ets/pages/app_json.md b/Privacy/PrivacyError/src/main/ets/pages/app_json.md index be9a2bd7f7ac32c1fa8333c09ba5afbd7618dcbc..278944af7cd70e8110492a8798b0208011da9e48 100644 --- a/Privacy/PrivacyError/src/main/ets/pages/app_json.md +++ b/Privacy/PrivacyError/src/main/ets/pages/app_json.md @@ -1,3 +1,18 @@ +/* +* Copyright (c) 2025 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景三十一:建议正确设置发布版本应用调试属性 diff --git a/Privacy/PrivacyError/src/main/ets/privacyerrorability/PrivacyErrorAbility.ets b/Privacy/PrivacyError/src/main/ets/privacyerrorability/PrivacyErrorAbility.ets index 4643ee5d83aa0b8fb7e4ebf366903ac61fecee3b..eccbf622c69f78f94b01773ec5da099231fa107d 100644 --- a/Privacy/PrivacyError/src/main/ets/privacyerrorability/PrivacyErrorAbility.ets +++ b/Privacy/PrivacyError/src/main/ets/privacyerrorability/PrivacyErrorAbility.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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'; diff --git a/Privacy/PrivacyError/src/main/resources/rawfile/H5CallETS.html b/Privacy/PrivacyError/src/main/resources/rawfile/H5CallETS.html index 965fef53f85e2b963011257d4d05d90416bea1e5..65c1aaf1eb9ca74d4cb889c2005289f9b2d87a73 100644 --- a/Privacy/PrivacyError/src/main/resources/rawfile/H5CallETS.html +++ b/Privacy/PrivacyError/src/main/resources/rawfile/H5CallETS.html @@ -1,3 +1,18 @@ +/* +* Copyright (c) 2025 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + /** * 最佳实践:应用安全编码实践 * 场景二十三:避免注册返回含有全局认证凭据的JavaScriptProxy-html diff --git a/Privacy/PrivacyError/src/main/resources/rawfile/index.html b/Privacy/PrivacyError/src/main/resources/rawfile/index.html index e6a0866f17585b1128757e54786f6d89dd20b718..4c05a7736967323229a471d11c6003596e956694 100644 --- a/Privacy/PrivacyError/src/main/resources/rawfile/index.html +++ b/Privacy/PrivacyError/src/main/resources/rawfile/index.html @@ -1,3 +1,18 @@ +/* +* Copyright (c) 2025 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + diff --git a/Privacy/README.md b/Privacy/README.md index 977441bd8e47cdd680c20ce4914d7c6391bd267f..870130d6f7e1923608e6a0f4b9d398f8c3f04f53 100644 --- a/Privacy/README.md +++ b/Privacy/README.md @@ -1,17 +1,12 @@ -# 应用资产保护设计 +# 应用安全示例代码 ### 介绍 -本示例是《应用资产保护设计》最佳实践中的代码示例片段。 +本示例是应用安全编码实践、应用资产保护设计、应用代码混淆、网络连接安全配置四篇最佳实践中的代码示例片段。 ##### 使用说明 -进入首面,点击按钮,分别进入示例页面。 - - -### 具体实现 - -1. privacy模块:对应《应用资产保护设计》最佳实践中的代码示例 +本示例为最佳实践示例代码,开发者可以查阅官网最佳实践下应用安全编码实践、应用资产保护设计、应用代码混淆、网络连接安全配置四篇最佳实践学习。 ### 相关权限 diff --git a/Privacy/build-profile.json5 b/Privacy/build-profile.json5 index 9836fe5f95babae5dedd4dc1adb30c9b7f3e8bf2..9118e99fa1de65b9beec902c6f8c02b4e8c46d47 100644 --- a/Privacy/build-profile.json5 +++ b/Privacy/build-profile.json5 @@ -1,6 +1,20 @@ { "app": { - "signingConfigs": [], + "signingConfigs": [ + { + "name": "default", + "type": "HarmonyOS", + "material": { + "certpath": "C:\\Users\\Administrator\\.ohos\\config\\default_Privacy_DGQm1oqD0cdFXvYgAvDzJ5LioP1ikDr6k7Ofvwpl4u8=.cer", + "keyAlias": "debugKey", + "keyPassword": "0000001A6770B069586AC8008FE21343F9A8706CAD8AC17D191DC259338F32A88A8BEB537053B05FB80B", + "profile": "C:\\Users\\Administrator\\.ohos\\config\\default_Privacy_DGQm1oqD0cdFXvYgAvDzJ5LioP1ikDr6k7Ofvwpl4u8=.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "C:\\Users\\Administrator\\.ohos\\config\\default_Privacy_DGQm1oqD0cdFXvYgAvDzJ5LioP1ikDr6k7Ofvwpl4u8=.p12", + "storePassword": "0000001A1123FBAF52335761538730A9CEF6FFB727C88EF76C0AD0F7F15A9B0A6A5062D64495C342C620" + } + } + ], "products": [ { "name": "default", @@ -49,30 +63,6 @@ ] } ] - }, - { - "name": "ContactData", - "srcPath": "./ContactData", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - }, - { - "name": "ContactDataError", - "srcPath": "./ContactDataError", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] } ] } \ No newline at end of file diff --git a/Privacy/privacy/src/main/ets/pages/ApplicationAssetProtectionAfter.ets b/Privacy/privacy/src/main/ets/pages/ApplicationAssetProtectionAfter.ets index d108925ead9ec3ba964c3a4b5ce08b1aa20ed8da..ce56ce0e7f1a8f2d05f7ab7b4c48850454137425 100644 --- a/Privacy/privacy/src/main/ets/pages/ApplicationAssetProtectionAfter.ets +++ b/Privacy/privacy/src/main/ets/pages/ApplicationAssetProtectionAfter.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用资产保护设计 * 场景二:HarmonyOS资产保护关键技术介绍-混淆后 diff --git a/Privacy/privacy/src/main/ets/pages/ApplicationAssetProtectionBefore.ets b/Privacy/privacy/src/main/ets/pages/ApplicationAssetProtectionBefore.ets index 73b98f3e57a7aba4cde86385d6a50e757e5bc92d..fa840d18460c2d46bd609e57ed80389ca6676d7e 100644 --- a/Privacy/privacy/src/main/ets/pages/ApplicationAssetProtectionBefore.ets +++ b/Privacy/privacy/src/main/ets/pages/ApplicationAssetProtectionBefore.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用资产保护设计 * 场景一:HarmonyOS资产保护关键技术介绍-混淆前 diff --git a/Privacy/privacy/src/main/ets/pages/CheckWantOne.ets b/Privacy/privacy/src/main/ets/pages/CheckWantOne.ets index 53f8ebe2b12cbeb27e1d5a1e74b9eb61b746a4de..e380fc6ef646eef3534cc016625d8198023e33db 100644 --- a/Privacy/privacy/src/main/ets/pages/CheckWantOne.ets +++ b/Privacy/privacy/src/main/ets/pages/CheckWantOne.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景二十五:建议对跨信任边界传入的Want进行合法性判断-确保访问的对象属性存在 diff --git a/Privacy/privacy/src/main/ets/pages/CheckWantTwo.ets b/Privacy/privacy/src/main/ets/pages/CheckWantTwo.ets index 4c7347b27d8d083b7a824cf929234d486c064365..716e9db5b415097e2a587aaa201e44ae33ca853d 100644 --- a/Privacy/privacy/src/main/ets/pages/CheckWantTwo.ets +++ b/Privacy/privacy/src/main/ets/pages/CheckWantTwo.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景二十六:建议对跨信任边界传入的Want进行合法性判断-进行try...catch异常捕获 diff --git a/Privacy/privacy/src/main/ets/pages/CodeConfusion.cpp b/Privacy/privacy/src/main/ets/pages/CodeConfusion.cpp index 98ee3d66fa0f0c4b0a5458447b8be01260c3a2fe..ca5062d2b3f00c9529ed3b80d3086d2260e40985 100644 --- a/Privacy/privacy/src/main/ets/pages/CodeConfusion.cpp +++ b/Privacy/privacy/src/main/ets/pages/CodeConfusion.cpp @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景三十二:正确示例,开启属性混淆例子 diff --git a/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp b/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp index 79bbff32032fd42f932dc3cbf4700b9012c93d00..a35854af6a66d1373a892923d3aa7c962061741e 100644 --- a/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp +++ b/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:网络连接安全配置开发实践 * 场景一:配置信任系统预置的CA证书 diff --git a/Privacy/privacy/src/main/ets/pages/GeolocationAccess.ets b/Privacy/privacy/src/main/ets/pages/GeolocationAccess.ets index 80867fc1e41c34544643ae74592e9dee3aa3f7d7..b1e324a7adec592ab77d2405e8fedd58c77a5f2b 100644 --- a/Privacy/privacy/src/main/ets/pages/GeolocationAccess.ets +++ b/Privacy/privacy/src/main/ets/pages/GeolocationAccess.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景二十:避免在用户同意前返回位置信息 diff --git a/Privacy/privacy/src/main/ets/pages/Index.ets b/Privacy/privacy/src/main/ets/pages/Index.ets index 8e2d24ad42693fc877d51bb7820f0a9da68fa135..0f481f696485b8c840d49ad9e7d7dff7f6b71241 100644 --- a/Privacy/privacy/src/main/ets/pages/Index.ets +++ b/Privacy/privacy/src/main/ets/pages/Index.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 { diff --git a/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets b/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets index 4cbd405fa04dea5383391e398d080cde3e966c22..8792e61189a9438761c6225d23cb163e62d3bf07 100644 --- a/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets +++ b/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 { http } from '@kit.NetworkKit' import { rcp } from '@kit.RemoteCommunicationKit'; diff --git a/Privacy/privacy/src/main/ets/pages/NoInfoJumpTo.ets b/Privacy/privacy/src/main/ets/pages/NoInfoJumpTo.ets index 41e04b4553f261a39851aa5a9ec235c8a9bbeea8..b74bf3ee535e1ae494f2ec791e624def37e22539 100644 --- a/Privacy/privacy/src/main/ets/pages/NoInfoJumpTo.ets +++ b/Privacy/privacy/src/main/ets/pages/NoInfoJumpTo.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景六:建议隐式启动应用组件时避免携带个人数据 diff --git a/Privacy/privacy/src/main/ets/pages/OnSslErrorEventReceive.ets b/Privacy/privacy/src/main/ets/pages/OnSslErrorEventReceive.ets index 3b477e0f1f2f09f20c548067b75d4b371b450656..26fab2fcf46eb4aca092941ad0572254ac019dc6 100644 --- a/Privacy/privacy/src/main/ets/pages/OnSslErrorEventReceive.ets +++ b/Privacy/privacy/src/main/ets/pages/OnSslErrorEventReceive.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景十八:避免在SSL校验出错时继续加载页面 diff --git a/Privacy/privacy/src/main/ets/pages/PrivacyMode.ets b/Privacy/privacy/src/main/ets/pages/PrivacyMode.ets index f9aa08354aab47040c2274b87a24fdb538dea3b4..18b00e010ff1d6be634731503025fca6cb03c747 100644 --- a/Privacy/privacy/src/main/ets/pages/PrivacyMode.ets +++ b/Privacy/privacy/src/main/ets/pages/PrivacyMode.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景七:避免涉及口令输入的应用界面可以被截屏或录屏 diff --git a/Privacy/privacy/src/main/ets/pages/PublicSafeInfo.ets b/Privacy/privacy/src/main/ets/pages/PublicSafeInfo.ets index 68436b2a5755f0c24726aaa16ef23e38792abd46..6b3b7ddc8b6800374a5270ca3c5a8181c4f36c0b 100644 --- a/Privacy/privacy/src/main/ets/pages/PublicSafeInfo.ets +++ b/Privacy/privacy/src/main/ets/pages/PublicSafeInfo.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景九:避免使用携带个人数据未设置权限的动态公共事件 diff --git a/Privacy/privacy/src/main/ets/pages/PublicSensitive.ets b/Privacy/privacy/src/main/ets/pages/PublicSensitive.ets index c46fcf60480fefce2bfaf5d926bbf174cace1894..9775bb24a659e14b2303da646458c9abdc74d455 100644 --- a/Privacy/privacy/src/main/ets/pages/PublicSensitive.ets +++ b/Privacy/privacy/src/main/ets/pages/PublicSensitive.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景十一:建议对涉及敏感功能的公共事件进行访问权限控制 diff --git a/Privacy/privacy/src/main/ets/pages/RunJavaScript.ets b/Privacy/privacy/src/main/ets/pages/RunJavaScript.ets index 1421a0a2050b9bda5105e889b21dbfb01070b752..80091fe0d47643ea84341d5c25c6e867f135bed1 100644 --- a/Privacy/privacy/src/main/ets/pages/RunJavaScript.ets +++ b/Privacy/privacy/src/main/ets/pages/RunJavaScript.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景十三:避免加载不可信的JavaScript脚本 diff --git a/Privacy/privacy/src/main/ets/pages/RunJavaScriptTrustList.ets b/Privacy/privacy/src/main/ets/pages/RunJavaScriptTrustList.ets index cf6a9741c586a0d112d753fa38fe26ef3c9d8cc7..e9cb0f8b88d5b42d727e5afa354b825cc86041ec 100644 --- a/Privacy/privacy/src/main/ets/pages/RunJavaScriptTrustList.ets +++ b/Privacy/privacy/src/main/ets/pages/RunJavaScriptTrustList.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景十五:避免加载不可信的JavaScript脚本—加载前进行白名单校验 diff --git a/Privacy/privacy/src/main/ets/pages/SignInfo.cpp b/Privacy/privacy/src/main/ets/pages/SignInfo.cpp index f6d95e3ba9f5ae60b42636bfd3e242cab9af7483..3a16498de4478dd99f44214edb001380caf39c91 100644 --- a/Privacy/privacy/src/main/ets/pages/SignInfo.cpp +++ b/Privacy/privacy/src/main/ets/pages/SignInfo.cpp @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景三十三:建议应用软件应包含的签名信息需要真实有效错误示例 diff --git a/Privacy/privacy/src/main/ets/pages/TrustListCheck.ets b/Privacy/privacy/src/main/ets/pages/TrustListCheck.ets index 59b4eee2976e5b181db94bd6711d2c036397d59d..4b6c41b0690773b02401ea49246caadfbffce52d 100644 --- a/Privacy/privacy/src/main/ets/pages/TrustListCheck.ets +++ b/Privacy/privacy/src/main/ets/pages/TrustListCheck.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景二十三:避免注册返回含有全局认证凭据的JavaScriptProxy-修改方法一 diff --git a/Privacy/privacy/src/main/ets/pages/UrlListCheck.ets b/Privacy/privacy/src/main/ets/pages/UrlListCheck.ets index 5afeabf468054a6d888669dc935436db7bc1c50c..65ea0b79542e513acd349ecf22e82f407bab3593 100644 --- a/Privacy/privacy/src/main/ets/pages/UrlListCheck.ets +++ b/Privacy/privacy/src/main/ets/pages/UrlListCheck.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景二十四:避免注册返回含有全局认证凭据的JavaScriptProxy-修改方法二 diff --git a/Privacy/privacy/src/main/ets/pages/WantScene.ts b/Privacy/privacy/src/main/ets/pages/WantScene.ts index 88eb73ec6b548b4adac9cf9121e8653e45d216c0..d895fedfa6ea44b16bc1cb8d75567d96ae0930d9 100644 --- a/Privacy/privacy/src/main/ets/pages/WantScene.ts +++ b/Privacy/privacy/src/main/ets/pages/WantScene.ts @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 { rpc } from '@kit.IPCKit'; diff --git a/Privacy/privacy/src/main/ets/pages/WebUrlSafe.ets b/Privacy/privacy/src/main/ets/pages/WebUrlSafe.ets index 3a1321d6c9bd3d198c30d58b187a0097d18ec223..9b8c84b8c2035437d942d1687f6f5b67cd70d654 100644 --- a/Privacy/privacy/src/main/ets/pages/WebUrlSafe.ets +++ b/Privacy/privacy/src/main/ets/pages/WebUrlSafe.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景十二:避免加载不安全的URL或页面 diff --git a/Privacy/privacy/src/main/ets/pages/app_json.md b/Privacy/privacy/src/main/ets/pages/app_json.md index a1dacbe57516afcc48ee9a139ba4e81572928b0c..2bb98449384f88e892962d4cce30504a759b08fb 100644 --- a/Privacy/privacy/src/main/ets/pages/app_json.md +++ b/Privacy/privacy/src/main/ets/pages/app_json.md @@ -1,3 +1,18 @@ +/* +* Copyright (c) 2025 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. + */ + /** * 最佳实践:应用安全编码实践 * 场景三十:建议正确设置发布版本应用调试属性错误示例 diff --git a/Privacy/privacy/src/main/ets/privacyability/PrivacyAbility.ets b/Privacy/privacy/src/main/ets/privacyability/PrivacyAbility.ets index 8c0cad413628198049a3a231e52ea40f6fa21048..d12583abdacbd29d7c767c23063a1a91961fdf2f 100644 --- a/Privacy/privacy/src/main/ets/privacyability/PrivacyAbility.ets +++ b/Privacy/privacy/src/main/ets/privacyability/PrivacyAbility.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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'; diff --git a/Privacy/privacy/src/main/ets/privacybackupability/PrivacyBackupAbility.ets b/Privacy/privacy/src/main/ets/privacybackupability/PrivacyBackupAbility.ets index 4aa035c51ba541b14f2afa1fe0353968e4889ddc..4204c032bf52218d42ae69357a3e425b3f90bdba 100644 --- a/Privacy/privacy/src/main/ets/privacybackupability/PrivacyBackupAbility.ets +++ b/Privacy/privacy/src/main/ets/privacybackupability/PrivacyBackupAbility.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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';